lex-xin 6 months ago
parent
commit
95dee7c8a9

+ 0 - 1
components.d.ts

@@ -15,7 +15,6 @@ declare module '@vue/runtime-core' {
     NBreadcrumb: typeof import('naive-ui')['NBreadcrumb']
     NBreadcrumbItem: typeof import('naive-ui')['NBreadcrumbItem']
     NButton: typeof import('naive-ui')['NButton']
-    NCheckbox: typeof import('naive-ui')['NCheckbox']
     NConfigProvider: typeof import('naive-ui')['NConfigProvider']
     NCountdown: typeof import('naive-ui')['NCountdown']
     NDialogProvider: typeof import('naive-ui')['NDialogProvider']

+ 10 - 1
src/views/music-library/project-music-sheet/module/gym/music-sheet-gym.tsx

@@ -401,7 +401,16 @@ export default defineComponent({
           }
         },
         {
-          title: '状态',
+          title: '曲目状态',
+          key: 'clientStatus',
+          render(row: any) {
+            return (
+              <NTag type={row.clientStatus ? 'primary' : 'default'}>{row.clientStatus ? '启用' : '停用'}</NTag>
+            )
+          }
+        },
+        {
+          title: '项目状态',
           key: 'status',
           render(row: any) {
             return (

+ 10 - 1
src/views/music-library/project-music-sheet/module/gyt/music-sheet-gyt.tsx

@@ -393,7 +393,16 @@ export default defineComponent({
           }
         },
         {
-          title: '状态',
+          title: '曲目状态',
+          key: 'clientStatus',
+          render(row: any) {
+            return (
+              <NTag type={row.clientStatus ? 'primary' : 'default'}>{row.clientStatus ? '启用' : '停用'}</NTag>
+            )
+          }
+        },
+        {
+          title: '项目状态',
           key: 'status',
           render(row: any) {
             return (

+ 10 - 1
src/views/music-library/project-music-sheet/module/klx/music-sheet-klx.tsx

@@ -447,7 +447,16 @@ export default defineComponent({
           }
         },
         {
-          title: '状态',
+          title: '曲目状态',
+          key: 'clientStatus',
+          render(row: any) {
+            return (
+              <NTag type={row.clientStatus ? 'primary' : 'default'}>{row.clientStatus ? '启用' : '停用'}</NTag>
+            )
+          }
+        },
+        {
+          title: '项目状态',
           key: 'status',
           render(row: any) {
             return (

+ 65 - 104
src/views/music-library/project-music-sheet/module/klx_jg/music-sheet-klx_jg.tsx

@@ -3,6 +3,7 @@ import SaveForm from '@components/save-form'
 import {
   DataTableRowKey,
   NButton,
+  NCascader,
   NDataTable,
   NDatePicker,
   NDescriptions,
@@ -32,8 +33,8 @@ import {
 import {
   musicSheetApplicationExtendDel,
   musicSheetApplicationExtendStatus,
-  musicSheetApplicationExtendTagList,
   musicSheetApplicationOwnerList,
+  musicSheetCategoriesQueryTree,
   musicSheetPageByApplication
 } from '@views/music-library/api'
 import {
@@ -83,7 +84,6 @@ export default defineComponent({
         availableType: null, //可用途径 ORG 机构 PLATFORM 平台
         appAuditFlag: null, //是否审核版本
         detailFlag: null, //是否查询详情
-        musicTagIds: [] as any, //曲目标签
         applicationId: null, //所属人项目ID
         extendApplicationId: null //所属人项目ID
       },
@@ -99,9 +99,30 @@ export default defineComponent({
       musicPreview: false,
       musicPreviewScoreType: 'staff', // 预览谱面类型
       musicScore: null as any,
-      useProjectData: [] as any // 适用项目行数据
+      useProjectData: [] as any, // 适用项目行数据
+      musicSheetCategories: [] as any
     })
 
+    // 获取分类
+    const getMusicSheetCategorieList = async () => {
+      try {
+        const { data } = await musicSheetCategoriesQueryTree({})
+        // state.musicSheetCategories = filterPointCategory(data, 'musicSheetCategoriesList')
+        state.musicSheetCategories = data || []
+        clearEmptyMusicCategory(state.musicSheetCategories)
+      } catch (e) {}
+    }
+
+    const clearEmptyMusicCategory = (data: any) => {
+      for (let i = 0; i < data.length; i++) {
+        if (data[i].musicSheetCategoriesList.length < 1) {
+          data[i].musicSheetCategoriesList = null
+        } else {
+          clearEmptyMusicCategory(data[i].musicSheetCategoriesList)
+        }
+      }
+    }
+
     onMounted(async () => {
       state.loading = true
       // 获取应用APP信息
@@ -146,20 +167,22 @@ export default defineComponent({
         state.subjectList = tempList
       } catch {}
 
-      // 加载曲目标签
+      getMusicSheetCategorieList()
 
-      try {
-        const { data } = await musicSheetApplicationExtendTagList({ applicationId: state.appId })
-        if (data && data.length > 0) {
-          data.forEach((item: any) => {
-            state.musicTagList.push({
-              ...item,
-              label: item.name,
-              value: item.id
-            })
-          })
-        }
-      } catch (err) {}
+      // 加载曲目标签
+      // try {
+        // const { data } = await musicSheetApplicationExtendTagList({ applicationId: state.appId })
+        // if (data && data.length > 0) {
+        //   data.forEach((item: any) => {
+        //     state.musicTagList.push({
+        //       ...item,
+        //       label: item.name,
+        //       value: item.id
+        //     })
+        //   })
+        // }
+        
+      // } catch (err) {}
 
       // 加载表格数据
       initUseAppList()
@@ -220,7 +243,6 @@ export default defineComponent({
           ...state.searchForm,
           userId: sourceType && sourceType === 'PERSON' ? state.searchForm.userId : null,
           organizationRoleId: sourceType && sourceType === 'ORG' ? state.searchForm.userId : null,
-          musicTagIds: state.searchForm.musicTagIds?.join(','),
           ...filterTimes(state.searchForm.times, ['startTime', 'endTime']),
           applicationId: state.applicationId
         })
@@ -312,7 +334,7 @@ export default defineComponent({
       }
     }
 
-    const onRmove = (row: any): void => {
+    const onRemove = (row: any): void => {
       dialog.warning({
         title: '提示',
         content: `删除曲目,是否继续?`,
@@ -371,9 +393,6 @@ export default defineComponent({
                 <NDescriptionsItem label="曲目来源">
                   {getMapValueByKey(row.sourceType, new Map(Object.entries(musicSheetSourceType)))}
                 </NDescriptionsItem>
-                {/* <NDescriptionsItem label="谱面渲染">
-                  {getMapValueByKey(row.musicSheetType, new Map(Object.entries(musicSheetType)))}
-                </NDescriptionsItem> */}
                 <NDescriptionsItem label="所属人">
                   <TheTooltip content={getOwnerName(row.musicSheetExtend, row.sourceType)} />
                 </NDescriptionsItem>
@@ -395,68 +414,31 @@ export default defineComponent({
             )
           }
         },
-        // {
-        //   title: '可用声部',
-        //   key: 'subjectNames',
-        //   render: (row: any) => {
-        //     return <TheTooltip content={row.subjectNames}/>
-        //   }
-        // },
         {
-          title: '曲目标签',
+          title: '曲目分类',
           key: 'musicTagNames'
         },
         {
-          title: '可用途径',
-          key: 'applicationAvailableType',
-          render: (row: any) => {
+          title: '上传时间',
+          minWidth: '150px',
+          key: 'composer',
+          render(row: any) {
             return (
-              <div>
-                {getMapValueByKey(
-                  row.applicationAvailableType,
-                  new Map(Object.entries(musicSheetAvailableType))
-                )}
-              </div>
+              row.createTime
             )
           }
         },
         {
-          title: '是否置顶',
-          key: 'topFlag',
-          render: (row: any) => {
-            return <div>{row.topFlag ? '是' : '否'}</div>
-          }
-        },
-        {
-          title: '是否精品',
-          key: 'exquisiteFlag',
-          render: (row: any) => {
-            return <div>{row.topFlag ? '是' : '否'}</div>
-          }
-        },
-        {
-          title: '收费方式',
-          key: 'paymentType',
-          render: (row: any) => {
-            return <div>{getPaymentType(row.paymentType?.split(','))}</div>
-          }
-        },
-        {
-          title: '曲目价格',
-          key: 'musicPrice'
-        },
-        {
-          title: '上传时间',
-          minWidth: '150px',
-          key: 'composer',
+          title: '曲目状态',
+          key: 'clientStatus',
           render(row: any) {
             return (
-              row.createTime
+              <NTag type={row.clientStatus ? 'primary' : 'default'}>{row.clientStatus ? '启用' : '停用'}</NTag>
             )
           }
         },
         {
-          title: '状态',
+          title: '项目状态',
           key: 'status',
           render(row: any) {
             return (
@@ -495,7 +477,7 @@ export default defineComponent({
                   type="primary"
                   size="small"
                   text
-                  v-auth="musicSheetApplicationExtend/status1751229794627878914"
+                  v-auth="musicSheetApplicationExtend/status1828741083419410433"
                   onClick={() => onChangeStatus(row)}
                 >
                   {row.status ? '停用' : '启用'}
@@ -504,7 +486,7 @@ export default defineComponent({
                   type="primary"
                   size="small"
                   text
-                  v-auth="musicSheetApplicationExtend/update1751235573456044033"
+                  v-auth="musicSheetApplicationExtend/update1828741129602891777"
                   onClick={() => {
                     state.showEditDialog = true
                     state.updateRow = row
@@ -517,8 +499,8 @@ export default defineComponent({
                   size="small"
                   text
                   disabled={!!row.status}
-                  onClick={() => onRmove(row)}
-                  v-auth="musicSheetApplicationExtend/del1770708473623916546"
+                  onClick={() => onRemove(row)}
+                  v-auth="musicSheetApplicationExtend/del1828741276168650753"
                 >
                   删除
                 </NButton>
@@ -620,37 +602,17 @@ export default defineComponent({
                 filterable
               />
             </NFormItem>
-            <NFormItem label="曲目标签" path="musicTagIds">
-              <NSelect
-                placeholder="请选择曲目标签"
-                v-model:value={state.searchForm.musicTagIds}
-                options={state.musicTagList}
-                multiple
-                maxTagCount={2}
+            <NFormItem label="曲目分类" path="musicTagIds">
+              <NCascader
+                valueField="id"
+                labelField="name"
+                children-field="musicSheetCategoriesList"
+                placeholder="请选择曲目分类"
+                v-model:value={state.searchForm.musicCategoryId}
+                options={state.musicSheetCategories}
                 clearable
-                filterable
               />
             </NFormItem>
-            {/*<NFormItem*/}
-            {/*    label="可用途径"*/}
-            {/*    path="availableType"*/}
-            {/*>*/}
-            {/*  <NSelect*/}
-            {/*      placeholder="请选择可用途径"*/}
-            {/*      v-model:value={state.searchForm.availableType}*/}
-            {/*      options={getSelectDataFromObj(musicSheetAvailableType)}*/}
-            {/*      clearable*/}
-            {/*  >*/}
-            {/*  </NSelect>*/}
-            {/*</NFormItem>*/}
-            <NFormItem label="收费方式" path="paymentType">
-              <NSelect
-                placeholder="请选择收费方式"
-                v-model:value={state.searchForm.paymentType}
-                options={getSelectDataFromObj(musicSheetPaymentType)}
-                clearable
-              ></NSelect>
-            </NFormItem>
             <NFormItem label="状态" path="status">
               <NSelect
                 v-model:value={state.searchForm.status}
@@ -696,7 +658,7 @@ export default defineComponent({
             <NSpace style={{ paddingBottom: '12px' }}>
               <NButton
                 type="primary"
-                v-auth="musicSheetApplicationExtend/saveBatch1751227277370195969"
+                v-auth="musicSheetApplicationExtend/saveBatch1828740811787894786"
                 onClick={() => {
                   state.showAddDialog = true
                 }}
@@ -705,7 +667,7 @@ export default defineComponent({
               </NButton>
               <NButton
                 disabled={checkedRowKeysRef.value.length == 0}
-                v-auth="musicSheetApplicationExtend/status1751229794627878914"
+                v-auth="musicSheetApplicationExtend/status1828741083419410433"
                 onClick={() => {
                   onBatchChangeStatus(false)
                 }}
@@ -714,7 +676,7 @@ export default defineComponent({
               </NButton>
               <NButton
                 disabled={checkedRowKeysRef.value.length == 0}
-                v-auth="musicSheetApplicationExtend/status1751229794627878914"
+                v-auth="musicSheetApplicationExtend/status1828741083419410433"
                 onClick={() => {
                   onBatchChangeStatus(true)
                 }}
@@ -772,7 +734,6 @@ export default defineComponent({
               }}
               rowData={state.updateRow}
               appId={state.appId}
-              musicSheetTagList={state.musicTagList}
             />
           </NModal>
           <NModal

+ 10 - 1
src/views/music-library/project-music-sheet/module/kt/music-sheet-kt.tsx

@@ -379,7 +379,16 @@ export default defineComponent({
           }
         },
         {
-          title: '状态',
+          title: '曲目状态',
+          key: 'clientStatus',
+          render(row: any) {
+            return (
+              <NTag type={row.clientStatus ? 'primary' : 'default'}>{row.clientStatus ? '启用' : '停用'}</NTag>
+            )
+          }
+        },
+        {
+          title: '项目状态',
           key: 'status',
           render(row: any) {
             return (