lex-xin 10 місяців тому
батько
коміт
e084e07fda

+ 12 - 3
src/views/music-library/project-music-sheet/index.tsx

@@ -8,13 +8,14 @@ import MusicSheetKt from '@views/music-library/project-music-sheet/module/kt/mus
 import MusicSheetGym from '@views/music-library/project-music-sheet/module/gym/music-sheet-gym'
 import MusicSheetGyt from '@views/music-library/project-music-sheet/module/gyt/music-sheet-gyt'
 import MusicSheetKlx from '@views/music-library/project-music-sheet/module/klx/music-sheet-klx'
+import MusicSheetKlxJG from '@views/music-library/project-music-sheet/module/klx_jg/music-sheet-klx_jg'
 import { disAuthCheckStatus } from '@/utils/directive/authDirective'
 
 export default defineComponent({
   name: 'project-music-sheet',
   setup() {
     const state = reactive({
-      tabName: 'KLX' as 'KT' | 'GYT' | 'KLX' | 'GYM' | 'KLXT',
+      tabName: 'KLX' as 'KT' | 'GYT' | 'KLX' | 'GYM' | 'KLX_JG',
       appKeyList: [] as any,
       appNameList: [] as any
     })
@@ -33,7 +34,7 @@ export default defineComponent({
     onMounted(async () => {
       // 获取应用APP信息
       const appKeys = Object.keys(appKey)
-      const { data } = await sysApplicationPage({ page: 1, rows: 99, parentId: 0 })
+      const { data } = await sysApplicationPage({ page: 1, rows: 99, parentId: 0, hiddenFlag: true  })
       const tempList = data.rows || []
       tempList.forEach((next: any) => {
         if (appKeys.includes(next.appKey)) {
@@ -44,9 +45,11 @@ export default defineComponent({
 
       if (disAuthCheckStatus('musicSheet/pageByApplication1751225218734489601')) {
         state.tabName = 'KLX'
+      } else if (disAuthCheckStatus('musicSheet/pageByApplication1828630545792307201')) {
+        state.tabName = 'KLX_JG'
       } else if (disAuthCheckStatus('musicSheet/pageByApplication1751225314930851842')) {
         state.tabName = 'GYM'
-      } else if (disAuthCheckStatus('musicSheet/pageByApplication1751225386909302786')) {
+      }  else if (disAuthCheckStatus('musicSheet/pageByApplication1751225386909302786')) {
         state.tabName = 'KT'
       } else if (disAuthCheckStatus('musicSheet/pageByApplication1751225483038556162')) {
         state.tabName = 'GYT'
@@ -72,6 +75,12 @@ export default defineComponent({
                 </NTabPane>
               )}
 
+              {disAuthCheckStatus('musicSheet/pageByApplication1828630545792307201') && (
+                <NTabPane name={'KLX_JG'} tab={'酷乐秀机构'}>
+                  <MusicSheetKlxJG appKey={'KLX_JG'} />
+                </NTabPane>
+              )}
+
               {disAuthCheckStatus('musicSheet/pageByApplication1751225314930851842') && (
                 <NTabPane name={'GYM'} tab={'管乐迷'}>
                   <MusicSheetGym appKey={'GYM'} />

+ 179 - 79
src/views/music-library/project-music-sheet/module/gym/addMusic.tsx

@@ -76,9 +76,10 @@ export default defineComponent({
       selectRowData: [] as any, // 选择的数据列表
       musicSheetCategories: [] as any,
       startSortNum: null as any, // 排序起始值
-      projectMusicCategoryId: null as any, // 曲目分类ID
+      // projectMusicCategoryId: null as any, // 曲目分类ID
       globalPaymentType: null as any, //收费方式
       isConvertibleScore: null as any, //是否支持转简谱
+      status: false, // 是否启用
       scoreType: null as any, //默认谱面
 
       userIdDisable: true,
@@ -196,10 +197,10 @@ export default defineComponent({
       const params = [] as any[]
       for (let i = 0; i < state.selectRowData.length; i++) {
         const item = state.selectRowData[i]
-        if (!item.projectMusicCategoryId) {
-          message.error('曲目分类不能为空')
-          return
-        }
+        // if (!item.projectMusicCategoryId) {
+        //   message.error('曲目分类不能为空')
+        //   return
+        // }
         if (item.scoreType == null) {
           message.error('默认谱面不能为空')
           return
@@ -208,6 +209,10 @@ export default defineComponent({
           message.error('是否支持转谱不能为空')
           return
         }
+        if(item.status == null) {
+          message.error('是否启用不能为空')
+          return
+        }
         if (item.sortNo === null || item.sortNo === undefined || item.sortNo === '') {
           message.error('排序号不能为空')
           return
@@ -215,7 +220,7 @@ export default defineComponent({
         params.push({
           ...item,
           musicSheetId: item.id,
-          musicSheetCategoryId: item.projectMusicCategoryId,
+          // musicSheetCategoryId: item.projectMusicCategoryId,
           applicationId: props.appId,
           id: null
         })
@@ -258,6 +263,10 @@ export default defineComponent({
         title: '音乐人',
         key: 'composer'
       },
+      {
+        title: '曲目分类',
+        key: 'musicCategoryName'
+      },
       // {
       //   title: '谱面渲染',
       //   key: 'musicSheetType',
@@ -279,7 +288,6 @@ export default defineComponent({
       {
         title: '所属人',
         key: 'userName',
-        width: 200,
         render: (row: any) => {
           return <TheTooltip content={getOwnerName(row.musicSheetExtend, row.sourceType)} />
         }
@@ -293,18 +301,97 @@ export default defineComponent({
     const stepColumns = (): DataTableColumns => {
       const field = deepClone(columnsField)
       field.splice(0, 1)
+      // field.push({
+      //   title(column: any) {
+      //     return (
+      //       <NSpace>
+      //         曲目分类
+      //         <NButton
+      //           type="primary"
+      //           size="small"
+      //           text
+      //           onClick={() => {
+      //             dialogs.create({
+      //               title: '请选择曲目分类',
+      //               showIcon: false,
+      //               content: () => {
+      //                 return h(
+      //                   'div',
+      //                   {
+      //                     class: 'flex flex-col justify-center items-center text-14px'
+      //                   },
+      //                   [
+      //                     // icon
+      //                     h(NCascader, {
+      //                       onUpdateValue(v) {
+      //                         state.projectMusicCategoryId = v
+      //                       },
+      //                       valueField: 'id',
+      //                       labelField: 'name',
+      //                       childrenField: 'children',
+      //                       filterable: true,
+      //                       options: state.musicSheetCategories
+      //                     })
+      //                   ]
+      //                 )
+      //               },
+      //               positiveText: '确定',
+      //               negativeText: '取消',
+      //               onPositiveClick: () => {
+      //                 for (let i = 0; i < state.selectRowData.length; i++) {
+      //                   const item = state.selectRowData[i]
+      //                   item.projectMusicCategoryId = state.projectMusicCategoryId
+      //                 }
+      //               }
+      //             })
+      //           }}
+      //         >
+      //           <NIcon size={15} style="padding-left: 5px;margin-top:4px">
+      //             <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
+      //               <path d="M2 26h28v2H2z" fill="currentColor"></path>
+      //               <path
+      //                 d="M25.4 9c.8-.8.8-2 0-2.8l-3.6-3.6c-.8-.8-2-.8-2.8 0l-15 15V24h6.4l15-15zm-5-5L24 7.6l-3 3L17.4 7l3-3zM6 22v-3.6l10-10l3.6 3.6l-10 10H6z"
+      //                 fill="currentColor"
+      //               ></path>
+      //             </svg>
+      //           </NIcon>
+      //         </NButton>
+      //       </NSpace>
+      //     )
+      //   },
+      //   key: 'projectMusicCategoryId',
+      //   width: 200,
+      //   render: (row: any) => {
+      //     // })
+      //     return (
+      //       <NCascader
+      //         valueField="id"
+      //         labelField="name"
+      //         children-field="children"
+      //         placeholder="请选择曲目分类"
+      //         value={row.projectMusicCategoryId}
+      //         options={state.musicSheetCategories}
+      //         onUpdateValue={(value: any) => {
+      //           row.projectMusicCategoryId = value
+      //         }}
+      //         filterable
+      //         clearable
+      //       />
+      //     )
+      //   }
+      // })
       field.push({
         title(column: any) {
           return (
             <NSpace>
-              曲目分类
+              收费方式
               <NButton
                 type="primary"
                 size="small"
                 text
                 onClick={() => {
                   dialogs.create({
-                    title: '请选择曲目分类',
+                    title: '请选择收费方式',
                     showIcon: false,
                     content: () => {
                       return h(
@@ -313,16 +400,21 @@ export default defineComponent({
                           class: 'flex flex-col justify-center items-center text-14px'
                         },
                         [
-                          // icon
-                          h(NCascader, {
+                          h(NSelect, {
                             onUpdateValue(v) {
-                              state.projectMusicCategoryId = v
+                              state.globalPaymentType = v
                             },
-                            valueField: 'id',
-                            labelField: 'name',
-                            childrenField: 'children',
-                            filterable: true,
-                            options: state.musicSheetCategories
+                            clearable: true,
+                            options: [
+                              {
+                                label: '免费',
+                                value: 'FREE'
+                              },
+                              {
+                                label: '收费',
+                                value: 'VIP'
+                              }
+                            ]
                           })
                         ]
                       )
@@ -332,7 +424,7 @@ export default defineComponent({
                     onPositiveClick: () => {
                       for (let i = 0; i < state.selectRowData.length; i++) {
                         const item = state.selectRowData[i]
-                        item.projectMusicCategoryId = state.projectMusicCategoryId
+                        item.paymentType = state.globalPaymentType
                       }
                     }
                   })
@@ -351,23 +443,27 @@ export default defineComponent({
             </NSpace>
           )
         },
-        key: 'projectMusicCategoryId',
+        key: 'paymentType',
         width: 200,
         render: (row: any) => {
-          // })
           return (
-            <NCascader
-              valueField="id"
-              labelField="name"
-              children-field="children"
-              placeholder="请选择曲目分类"
-              value={row.projectMusicCategoryId}
-              options={state.musicSheetCategories}
-              onUpdateValue={(value: any) => {
-                row.projectMusicCategoryId = value
-              }}
-              filterable
+            <NSelect
+              placeholder="请选择收费方式"
+              value={row.paymentType}
+              options={[
+                {
+                  label: '免费',
+                  value: 'FREE'
+                },
+                {
+                  label: '收费',
+                  value: 'VIP'
+                }
+              ]}
               clearable
+              onUpdateValue={(value) => {
+                row['paymentType'] = value
+              }}
             />
           )
         }
@@ -376,14 +472,14 @@ export default defineComponent({
         title(column: any) {
           return (
             <NSpace>
-              收费方式
+              默认谱面
               <NButton
                 type="primary"
                 size="small"
                 text
                 onClick={() => {
                   dialogs.create({
-                    title: '请选择收费方式',
+                    title: '请选择默认谱面',
                     showIcon: false,
                     content: () => {
                       return h(
@@ -392,21 +488,12 @@ export default defineComponent({
                           class: 'flex flex-col justify-center items-center text-14px'
                         },
                         [
+                          // icon
                           h(NSelect, {
                             onUpdateValue(v) {
-                              state.globalPaymentType = v
+                              state.scoreType = v
                             },
-                            clearable: true,
-                            options: [
-                              {
-                                label: '免费',
-                                value: 'FREE'
-                              },
-                              {
-                                label: '收费',
-                                value: 'VIP'
-                              }
-                            ]
+                            options: getSelectDataFromObj(scoreType)
                           })
                         ]
                       )
@@ -416,7 +503,7 @@ export default defineComponent({
                     onPositiveClick: () => {
                       for (let i = 0; i < state.selectRowData.length; i++) {
                         const item = state.selectRowData[i]
-                        item.paymentType = state.globalPaymentType
+                        item.scoreType = state.scoreType
                       }
                     }
                   })
@@ -435,27 +522,19 @@ export default defineComponent({
             </NSpace>
           )
         },
-        key: 'paymentType',
+        key: 'scoreType',
         width: 200,
         render: (row: any) => {
+          // })
           return (
             <NSelect
-              placeholder="请选择收费方式"
-              value={row.paymentType}
-              options={[
-                {
-                  label: '免费',
-                  value: 'FREE'
-                },
-                {
-                  label: '收费',
-                  value: 'VIP'
-                }
-              ]}
-              clearable
-              onUpdateValue={(value) => {
-                row['paymentType'] = value
+              placeholder="请选择默认谱面"
+              value={row.scoreType}
+              options={getSelectDataFromObj(scoreType)}
+              onUpdateValue={(value: any) => {
+                row.scoreType = value
               }}
+              clearable
             />
           )
         }
@@ -464,14 +543,14 @@ export default defineComponent({
         title(column: any) {
           return (
             <NSpace>
-              默认谱面
+              是否支持转谱
               <NButton
                 type="primary"
                 size="small"
                 text
                 onClick={() => {
                   dialogs.create({
-                    title: '请选择默认谱面',
+                    title: '是否支持转谱',
                     showIcon: false,
                     content: () => {
                       return h(
@@ -483,9 +562,18 @@ export default defineComponent({
                           // icon
                           h(NSelect, {
                             onUpdateValue(v) {
-                              state.scoreType = v
+                              state.isConvertibleScore = v
                             },
-                            options: getSelectDataFromObj(scoreType)
+                            options: [
+                              {
+                                label: '是',
+                                value: true
+                              },
+                              {
+                                label: '否',
+                                value: false
+                              }
+                            ] as any
                           })
                         ]
                       )
@@ -495,7 +583,7 @@ export default defineComponent({
                     onPositiveClick: () => {
                       for (let i = 0; i < state.selectRowData.length; i++) {
                         const item = state.selectRowData[i]
-                        item.scoreType = state.scoreType
+                        item.isConvertibleScore = state.isConvertibleScore
                       }
                     }
                   })
@@ -514,35 +602,46 @@ export default defineComponent({
             </NSpace>
           )
         },
-        key: 'scoreType',
+        key: 'isConvertibleScore',
         width: 200,
         render: (row: any) => {
           // })
           return (
             <NSelect
-              placeholder="请选择默认谱面"
-              value={row.scoreType}
-              options={getSelectDataFromObj(scoreType)}
+              value={row.isConvertibleScore}
+              options={[
+                {
+                  label: '是',
+                  value: true
+                },
+                {
+                  label: '否',
+                  value: false
+                } as any
+              ]}
               onUpdateValue={(value: any) => {
-                row.scoreType = value
+                row.isConvertibleScore = value
               }}
+              filterable
               clearable
             />
           )
         }
       })
+
+
       field.push({
         title(column: any) {
           return (
             <NSpace>
-              是否支持简谱
+              是否启用
               <NButton
                 type="primary"
                 size="small"
                 text
                 onClick={() => {
                   dialogs.create({
-                    title: '是否支持转谱',
+                    title: '是否启用',
                     showIcon: false,
                     content: () => {
                       return h(
@@ -554,7 +653,7 @@ export default defineComponent({
                           // icon
                           h(NSelect, {
                             onUpdateValue(v) {
-                              state.isConvertibleScore = v
+                              state.status = v
                             },
                             options: [
                               {
@@ -575,7 +674,7 @@ export default defineComponent({
                     onPositiveClick: () => {
                       for (let i = 0; i < state.selectRowData.length; i++) {
                         const item = state.selectRowData[i]
-                        item.isConvertibleScore = state.isConvertibleScore
+                        item.status = state.status
                       }
                     }
                   })
@@ -594,13 +693,13 @@ export default defineComponent({
             </NSpace>
           )
         },
-        key: 'isConvertibleScore',
+        key: 'status',
         width: 200,
         render: (row: any) => {
           // })
           return (
             <NSelect
-              value={row.isConvertibleScore}
+              value={row.status}
               options={[
                 {
                   label: '是',
@@ -612,7 +711,7 @@ export default defineComponent({
                 } as any
               ]}
               onUpdateValue={(value: any) => {
-                row.isConvertibleScore = value
+                row.status = value
               }}
               filterable
               clearable
@@ -620,6 +719,7 @@ export default defineComponent({
           )
         }
       })
+
       field.push({
         title(column: any) {
           return (

+ 2 - 5
src/views/music-library/project-music-sheet/module/gym/music-sheet-gym.tsx

@@ -391,15 +391,12 @@ export default defineComponent({
           }
         },
         {
-          title: '上传',
+          title: '上传时间',
           minWidth: '150px',
           key: 'composer',
           render(row: any) {
             return (
-              <NDescriptions labelPlacement="left" column={1}>
-                <NDescriptionsItem label="上传人">{row.createByName}</NDescriptionsItem>
-                <NDescriptionsItem label="上传时间">{row.createTime}</NDescriptionsItem>
-              </NDescriptions>
+              row.createTime
             )
           }
         },

+ 32 - 4
src/views/music-library/project-music-sheet/module/gym/updateMusic.tsx

@@ -26,11 +26,12 @@ export default defineComponent({
     const message = useMessage()
     const btnLoading = ref(false)
     const forms = reactive({
-      musicSheetCategoryId: null as any,
+      // musicSheetCategoryId: null as any,
       sortNo: null as any,
       paymentType: null as any,
       isConvertibleScore: null as any,//是否支持转简谱
       scoreType: null as any,//默认谱面
+      status: null as any
     })
     const formsRef = ref()
 
@@ -48,11 +49,12 @@ export default defineComponent({
         message.error("加载应用失败")
         return
       }
-      forms.musicSheetCategoryId = data[0].musicSheetCategoryId
+      // forms.musicSheetCategoryId = data[0].musicSheetCategoryId
       forms.sortNo = data[0].sortNo
       forms.paymentType = data[0].paymentType
       forms.isConvertibleScore = data[0].isConvertibleScore
       forms.scoreType = data[0].scoreType
+      forms.status = data[0].status
 
     })
 
@@ -88,7 +90,7 @@ export default defineComponent({
                 label-placement="left"
                 label-width="auto"
             >
-              <NFormItem
+              {/* <NFormItem
                   label="曲目分类"
                   path="musicSheetCategoryId"
                   rule={[
@@ -111,7 +113,7 @@ export default defineComponent({
                     }}
                     clearable
                 />
-              </NFormItem>
+              </NFormItem> */}
               <NFormItem
                   label="收费方式"
                   path="paymentType"
@@ -192,6 +194,32 @@ export default defineComponent({
                 ></NSelect>
               </NFormItem>
               <NFormItem
+                  label="是否启用"
+                  path="status"
+                  rule={[
+                    {
+                      required: true,
+                      message: '请选择是否启用'
+                    }
+                  ]}
+              >
+                <NSelect
+                    placeholder="请选择是否启用"
+                    options={[
+                      {
+                        label: '是',
+                        value: true
+                      },
+                      {
+                        label: '否',
+                        value: false
+                      }
+                    ] as any}
+                    v-model:value={forms.status}
+                    clearable
+                />
+              </NFormItem>
+              <NFormItem
                   label="排序值"
                   path="sortNo"
                   rule={[

+ 145 - 44
src/views/music-library/project-music-sheet/module/gyt/addMusic.tsx

@@ -86,8 +86,9 @@ export default defineComponent({
       selectRowData: [] as any, // 选择的数据列表
       musicSheetCategories: [] as any,
       startSortNum: null as any, // 排序起始值
-      projectMusicCategoryId: null as any, // 曲目分类ID
+      // projectMusicCategoryId: null as any, // 曲目分类ID
       isConvertibleScore: null as any, //是否支持转简谱
+      status: false, // 是否启用
       scoreType: null as any, //默认谱面
 
       useProjectData: [] as any, // 适用项目行数据
@@ -216,10 +217,10 @@ export default defineComponent({
           message.error('可用途径不能为空')
           return
         }
-        if (!item.projectMusicCategoryId) {
-          message.error('曲目分类不能为空')
-          return
-        }
+        // if (!item.projectMusicCategoryId) {
+        //   message.error('曲目分类不能为空')
+        //   return
+        // }
         if (item.scoreType == null) {
           message.error('默认谱面不能为空')
           return
@@ -228,6 +229,10 @@ export default defineComponent({
           message.error('是否支持转谱不能为空')
           return
         }
+        if (item.status == null) {
+          message.error('是否启用不能为空')
+          return
+        }
         if (item.sortNo === null || item.sortNo === undefined || item.sortNo === '') {
           message.error('排序号不能为空')
           return
@@ -235,7 +240,7 @@ export default defineComponent({
         params.push({
           ...item,
           musicSheetId: item.id,
-          musicSheetCategoryId: item.projectMusicCategoryId,
+          // musicSheetCategoryId: item.projectMusicCategoryId,
           availableType: item.availableType,
           applicationId: props.appId,
           id: null
@@ -279,6 +284,10 @@ export default defineComponent({
         title: '音乐人',
         key: 'composer'
       },
+      {
+        title: '曲目分类',
+        key: 'musicCategoryName'
+      },
       // {
       //   title: '谱面渲染',
       //   key: 'musicSheetType',
@@ -401,18 +410,98 @@ export default defineComponent({
           )
         }
       })
+      // field.push({
+      //   title(column: any) {
+      //     return (
+      //       <NSpace>
+      //         曲目分类
+      //         <NButton
+      //           type="primary"
+      //           size="small"
+      //           text
+      //           onClick={() => {
+      //             dialogs.create({
+      //               title: '请选择曲目分类',
+      //               showIcon: false,
+      //               content: () => {
+      //                 return h(
+      //                   'div',
+      //                   {
+      //                     class: 'flex flex-col justify-center items-center text-14px'
+      //                   },
+      //                   [
+      //                     // icon
+      //                     h(NCascader, {
+      //                       onUpdateValue(v) {
+      //                         state.projectMusicCategoryId = v
+      //                       },
+      //                       valueField: 'id',
+      //                       labelField: 'name',
+      //                       childrenField: 'children',
+      //                       placeholderField: '请选择曲目分类',
+      //                       filterable: true,
+      //                       options: state.musicSheetCategories
+      //                     })
+      //                   ]
+      //                 )
+      //               },
+      //               positiveText: '确定',
+      //               negativeText: '取消',
+      //               onPositiveClick: () => {
+      //                 for (let i = 0; i < state.selectRowData.length; i++) {
+      //                   const item = state.selectRowData[i]
+      //                   item.projectMusicCategoryId = state.projectMusicCategoryId
+      //                 }
+      //               }
+      //             })
+      //           }}
+      //         >
+      //           <NIcon size={15} style="padding-left: 5px;margin-top:4px">
+      //             <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
+      //               <path d="M2 26h28v2H2z" fill="currentColor"></path>
+      //               <path
+      //                 d="M25.4 9c.8-.8.8-2 0-2.8l-3.6-3.6c-.8-.8-2-.8-2.8 0l-15 15V24h6.4l15-15zm-5-5L24 7.6l-3 3L17.4 7l3-3zM6 22v-3.6l10-10l3.6 3.6l-10 10H6z"
+      //                 fill="currentColor"
+      //               ></path>
+      //             </svg>
+      //           </NIcon>
+      //         </NButton>
+      //       </NSpace>
+      //     )
+      //   },
+      //   key: 'projectMusicCategoryId',
+      //   width: 200,
+      //   render: (row: any) => {
+      //     // })
+      //     return (
+      //       <NCascader
+      //         valueField="id"
+      //         labelField="name"
+      //         children-field="children"
+      //         placeholder="请选择曲目分类"
+      //         value={row.projectMusicCategoryId}
+      //         options={state.musicSheetCategories}
+      //         onUpdateValue={(value: any) => {
+      //           row.projectMusicCategoryId = value
+      //         }}
+      //         filterable
+      //         clearable
+      //       />
+      //     )
+      //   }
+      // })
       field.push({
         title(column: any) {
           return (
             <NSpace>
-              曲目分类
+              默认谱面
               <NButton
                 type="primary"
                 size="small"
                 text
                 onClick={() => {
                   dialogs.create({
-                    title: '请选择曲目分类',
+                    title: '请选择默认谱面',
                     showIcon: false,
                     content: () => {
                       return h(
@@ -422,16 +511,11 @@ export default defineComponent({
                         },
                         [
                           // icon
-                          h(NCascader, {
+                          h(NSelect, {
                             onUpdateValue(v) {
-                              state.projectMusicCategoryId = v
+                              state.scoreType = v
                             },
-                            valueField: 'id',
-                            labelField: 'name',
-                            childrenField: 'children',
-                            placeholderField: '请选择曲目分类',
-                            filterable: true,
-                            options: state.musicSheetCategories
+                            options: getSelectDataFromObj(scoreType)
                           })
                         ]
                       )
@@ -441,7 +525,7 @@ export default defineComponent({
                     onPositiveClick: () => {
                       for (let i = 0; i < state.selectRowData.length; i++) {
                         const item = state.selectRowData[i]
-                        item.projectMusicCategoryId = state.projectMusicCategoryId
+                        item.scoreType = state.scoreType
                       }
                     }
                   })
@@ -460,22 +544,18 @@ export default defineComponent({
             </NSpace>
           )
         },
-        key: 'projectMusicCategoryId',
+        key: 'scoreType',
         width: 200,
         render: (row: any) => {
           // })
           return (
-            <NCascader
-              valueField="id"
-              labelField="name"
-              children-field="children"
-              placeholder="请选择曲目分类"
-              value={row.projectMusicCategoryId}
-              options={state.musicSheetCategories}
+            <NSelect
+              placeholder="请选择默认谱面"
+              value={row.scoreType}
+              options={getSelectDataFromObj(scoreType)}
               onUpdateValue={(value: any) => {
-                row.projectMusicCategoryId = value
+                row.scoreType = value
               }}
-              filterable
               clearable
             />
           )
@@ -485,14 +565,14 @@ export default defineComponent({
         title(column: any) {
           return (
             <NSpace>
-              默认谱面
+              是否支持转谱
               <NButton
                 type="primary"
                 size="small"
                 text
                 onClick={() => {
                   dialogs.create({
-                    title: '请选择默认谱面',
+                    title: '是否支持转谱',
                     showIcon: false,
                     content: () => {
                       return h(
@@ -504,9 +584,18 @@ export default defineComponent({
                           // icon
                           h(NSelect, {
                             onUpdateValue(v) {
-                              state.scoreType = v
+                              state.isConvertibleScore = v
                             },
-                            options: getSelectDataFromObj(scoreType)
+                            options: [
+                              {
+                                label: '是',
+                                value: true
+                              },
+                              {
+                                label: '否',
+                                value: false
+                              }
+                            ] as any
                           })
                         ]
                       )
@@ -516,7 +605,7 @@ export default defineComponent({
                     onPositiveClick: () => {
                       for (let i = 0; i < state.selectRowData.length; i++) {
                         const item = state.selectRowData[i]
-                        item.scoreType = state.scoreType
+                        item.isConvertibleScore = state.isConvertibleScore
                       }
                     }
                   })
@@ -535,35 +624,45 @@ export default defineComponent({
             </NSpace>
           )
         },
-        key: 'scoreType',
+        key: 'isConvertibleScore',
         width: 200,
         render: (row: any) => {
           // })
           return (
             <NSelect
-              placeholder="请选择默认谱面"
-              value={row.scoreType}
-              options={getSelectDataFromObj(scoreType)}
+              value={row.isConvertibleScore}
+              options={[
+                {
+                  label: '是',
+                  value: true
+                },
+                {
+                  label: '否',
+                  value: false
+                } as any
+              ]}
               onUpdateValue={(value: any) => {
-                row.scoreType = value
+                row.isConvertibleScore = value
               }}
+              filterable
               clearable
             />
           )
         }
       })
+
       field.push({
         title(column: any) {
           return (
             <NSpace>
-              是否支持转谱
+              是否启用
               <NButton
                 type="primary"
                 size="small"
                 text
                 onClick={() => {
                   dialogs.create({
-                    title: '是否支持转谱',
+                    title: '是否启用',
                     showIcon: false,
                     content: () => {
                       return h(
@@ -575,7 +674,7 @@ export default defineComponent({
                           // icon
                           h(NSelect, {
                             onUpdateValue(v) {
-                              state.isConvertibleScore = v
+                              state.status = v
                             },
                             options: [
                               {
@@ -596,7 +695,7 @@ export default defineComponent({
                     onPositiveClick: () => {
                       for (let i = 0; i < state.selectRowData.length; i++) {
                         const item = state.selectRowData[i]
-                        item.isConvertibleScore = state.isConvertibleScore
+                        item.status = state.status
                       }
                     }
                   })
@@ -615,13 +714,13 @@ export default defineComponent({
             </NSpace>
           )
         },
-        key: 'isConvertibleScore',
+        key: 'status',
         width: 200,
         render: (row: any) => {
           // })
           return (
             <NSelect
-              value={row.isConvertibleScore}
+              value={row.status}
               options={[
                 {
                   label: '是',
@@ -633,7 +732,7 @@ export default defineComponent({
                 } as any
               ]}
               onUpdateValue={(value: any) => {
-                row.isConvertibleScore = value
+                row.status = value
               }}
               filterable
               clearable
@@ -641,6 +740,7 @@ export default defineComponent({
           )
         }
       })
+
       field.push({
         title(column: any) {
           return (
@@ -771,6 +871,7 @@ export default defineComponent({
             return row.id === next.id
           })
           if (!find) {
+            next.status = false
             state.selectRowData.push(next)
           }
         }

+ 2 - 5
src/views/music-library/project-music-sheet/module/gyt/music-sheet-gyt.tsx

@@ -383,15 +383,12 @@ export default defineComponent({
         //   }
         // },
         {
-          title: '上传',
+          title: '上传时间',
           minWidth: '150px',
           key: 'composer',
           render(row: any) {
             return (
-              <NDescriptions labelPlacement="left" column={1}>
-                <NDescriptionsItem label="上传人">{row.createByName}</NDescriptionsItem>
-                <NDescriptionsItem label="上传时间">{row.createTime}</NDescriptionsItem>
-              </NDescriptions>
+              row.createTime
             )
           }
         },

+ 28 - 0
src/views/music-library/project-music-sheet/module/gyt/updateMusic.tsx

@@ -30,6 +30,7 @@ export default defineComponent({
       sortNo: null as any,
       availableType: null as any,
       isConvertibleScore: null as any,//是否支持转简谱
+      status: false, // 是否启用
       scoreType: null as any,//默认谱面
     })
     const formsRef = ref()
@@ -53,6 +54,7 @@ export default defineComponent({
       forms.availableType = data[0].availableType
       forms.isConvertibleScore = data[0].isConvertibleScore
       forms.scoreType = data[0].scoreType
+      forms.status = data[0].status
     })
 
     const onSubmit = async () => {
@@ -191,6 +193,32 @@ export default defineComponent({
                 ></NSelect>
               </NFormItem>
               <NFormItem
+                  label="是否启用"
+                  path="status"
+                  rule={[
+                    {
+                      required: true,
+                      message: '请选择是否启用'
+                    }
+                  ]}
+              >
+                <NSelect
+                    placeholder="请选择是否启用"
+                    options={[
+                      {
+                        label: '是',
+                        value: true
+                      },
+                      {
+                        label: '否',
+                        value: false
+                      }
+                    ] as any}
+                    v-model:value={forms.status}
+                    clearable
+                />
+              </NFormItem>
+              <NFormItem
                   label="排序值"
                   path="sortNo"
                   rule={[

+ 96 - 0
src/views/music-library/project-music-sheet/module/klx/addMusic.tsx

@@ -99,6 +99,7 @@ export default defineComponent({
       globalExquisiteFlag: null as any, //精品乐谱
       globalStartSortNum: null as any, // 排序起始值
       isConvertibleScore: null as any, //是否支持转简谱
+      status: false, // 是否启用
       scoreType: null as any //默认谱面
     })
 
@@ -262,6 +263,10 @@ export default defineComponent({
           message.error('是否支持转谱不能为空')
           return
         }
+        if (item.status == null) {
+          message.error('是否启用不能为空')
+          return
+        }
         if (item.sortNo === null || item.sortNo === undefined || item.sortNo === '') {
           message.error('排序号不能为空')
           return
@@ -1008,6 +1013,97 @@ export default defineComponent({
         }
       })
 
+
+      field.push({
+        title(column: any) {
+          return (
+            <NSpace>
+              是否启用
+              <NButton
+                type="primary"
+                size="small"
+                text
+                onClick={() => {
+                  dialogs.create({
+                    title: '是否启用',
+                    showIcon: false,
+                    content: () => {
+                      return h(
+                        'div',
+                        {
+                          class: 'flex flex-col justify-center items-center text-14px'
+                        },
+                        [
+                          // icon
+                          h(NSelect, {
+                            onUpdateValue(v) {
+                              state.status = v
+                            },
+                            options: [
+                              {
+                                label: '是',
+                                value: true
+                              },
+                              {
+                                label: '否',
+                                value: false
+                              }
+                            ] as any
+                          })
+                        ]
+                      )
+                    },
+                    positiveText: '确定',
+                    negativeText: '取消',
+                    onPositiveClick: () => {
+                      for (let i = 0; i < state.selectRowData.length; i++) {
+                        const item = state.selectRowData[i]
+                        item.status = state.status
+                      }
+                    }
+                  })
+                }}
+              >
+                <NIcon size={15} style="padding-left: 5px;margin-top:4px">
+                  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
+                    <path d="M2 26h28v2H2z" fill="currentColor"></path>
+                    <path
+                      d="M25.4 9c.8-.8.8-2 0-2.8l-3.6-3.6c-.8-.8-2-.8-2.8 0l-15 15V24h6.4l15-15zm-5-5L24 7.6l-3 3L17.4 7l3-3zM6 22v-3.6l10-10l3.6 3.6l-10 10H6z"
+                      fill="currentColor"
+                    ></path>
+                  </svg>
+                </NIcon>
+              </NButton>
+            </NSpace>
+          )
+        },
+        key: 'status',
+        width: 200,
+        render: (row: any) => {
+          // })
+          return (
+            <NSelect
+              value={row.status}
+              options={[
+                {
+                  label: '是',
+                  value: true
+                },
+                {
+                  label: '否',
+                  value: false
+                } as any
+              ]}
+              onUpdateValue={(value: any) => {
+                row.status = value
+              }}
+              filterable
+              clearable
+            />
+          )
+        }
+      })
+
       field.push({
         title(column: any) {
           return (

+ 2 - 7
src/views/music-library/project-music-sheet/module/klx/music-sheet-klx.tsx

@@ -439,16 +439,11 @@ export default defineComponent({
           key: 'musicPrice'
         },
         {
-          title: '上传',
+          title: '上传时间',
           minWidth: '150px',
           key: 'composer',
           render(row: any) {
-            return (
-              <NDescriptions labelPlacement="left" column={1}>
-                <NDescriptionsItem label="上传人">{row.createByName}</NDescriptionsItem>
-                <NDescriptionsItem label="上传时间">{row.createTime}</NDescriptionsItem>
-              </NDescriptions>
-            )
+            return row.createTime
           }
         },
         {

+ 28 - 0
src/views/music-library/project-music-sheet/module/klx/updateMusic.tsx

@@ -34,6 +34,7 @@ export default defineComponent({
       topFlag: null as any,
       exquisiteFlag: null as any,
       isConvertibleScore: null as any,//是否支持转简谱
+      status: null as any, // 是否启用
       scoreType: null as any,//默认谱面
     })
     const formsRef = ref()
@@ -63,6 +64,7 @@ export default defineComponent({
       forms.exquisiteFlag = data[0].exquisiteFlag
       forms.isConvertibleScore = data[0].isConvertibleScore
       forms.scoreType = data[0].scoreType
+      forms.status = data[0].status
     })
 
     const onSubmit = async () => {
@@ -290,6 +292,32 @@ export default defineComponent({
                 ></NSelect>
               </NFormItem>
               <NFormItem
+                  label="是否启用"
+                  path="status"
+                  rule={[
+                    {
+                      required: true,
+                      message: '请选择是否启用'
+                    }
+                  ]}
+              >
+                <NSelect
+                    placeholder="请选择是否启用"
+                    options={[
+                      {
+                        label: '是',
+                        value: true
+                      },
+                      {
+                        label: '否',
+                        value: false
+                      }
+                    ] as any}
+                    v-model:value={forms.status}
+                    clearable
+                />
+              </NFormItem>
+              <NFormItem
                   label="排序值"
                   path="sortNo"
                   rule={[

+ 904 - 0
src/views/music-library/project-music-sheet/module/klx_jg/addMusic.tsx

@@ -0,0 +1,904 @@
+import { defineComponent, h, onMounted, reactive, ref } from 'vue'
+import SaveForm from '@components/save-form'
+import {
+  DataTableColumns,
+  DataTableRowKey,
+  NButton,
+  NDataTable,
+  NFormItem,
+  NIcon,
+  NImage,
+  NInput,
+  NInputNumber,
+  NSelect,
+  NSpace,
+  NStep,
+  NSteps,
+  useDialog,
+  useMessage
+} from 'naive-ui'
+import Pagination from '@components/pagination'
+import { getMapValueByKey, getSelectDataFromObj } from '@/utils/objectUtil'
+import {
+  appKey,
+  musicSheetAvailableType,
+  musicSheetPaymentType,
+  musicSheetSourceType,
+  musicSheetType,
+  scoreType
+} from '@/utils/constant'
+import {
+  musicSheetApplicationExtendSaveBatch,
+  musicSheetApplicationExtendTagList,
+  musicSheetApplicationOwnerList,
+  musicSheetPage
+} from '@views/music-library/api'
+import deepClone from '@/utils/deep.clone'
+import { getOwnerName } from '@views/music-library/musicUtil'
+import TheTooltip from '@components/TheTooltip'
+import { sysApplicationPage } from '@views/menu-manage/api'
+
+export default defineComponent({
+  name: 'klx-addMusic',
+  props: {
+    appId: {
+      type: String,
+      required: true
+    },
+    subjectList: {
+      type: Array,
+      default: () => []
+    },
+    musicSheetTagList: {
+      type: Array,
+      default: () => []
+    }
+  },
+  emits: ['close', 'getList'],
+  setup(props, { slots, attrs, emit }) {
+    const dialogs = useDialog()
+    const message = useMessage()
+    const state = reactive({
+      loading: false,
+      pagination: {
+        page: 1,
+        rows: 5,
+        pageTotal: 0
+      },
+      stepPagination: {
+        page: 1,
+        rows: 5,
+        pageTotal: 0
+      },
+      searchForm: {
+        keyword: null,
+        // musicSheetType: null,
+        subjectId: null,
+        sourceType: null,
+        composer: null,
+        userId: null,
+        applicationId: null
+      },
+      subjectList: [] as any,
+      showAdd: false,
+      currentStep: 1,
+      dataList: [],
+      selectRowData: [] as any, // 选择的数据列表
+      musicSheetCategories: [] as any,
+      musicSheetTagList: [] as any,
+      useProjectData: [] as any, // 适用项目行数据
+
+      userIdDisable: true,
+      userIdData: [] as any,
+
+      globalStartSortNum: null as any, // 排序起始值
+      status: false as any, // 是否启用
+      isConvertibleScore: null as any, //是否支持转简谱
+      scoreType: null as any //默认谱面
+    })
+
+    onMounted(async () => {
+      state.searchForm.keyword = null
+      // state.searchForm.musicSheetType = null
+      state.searchForm.subjectId = null
+      state.searchForm.sourceType = null
+      state.searchForm.composer = null
+      state.searchForm.userId = null
+      state.searchForm.applicationId = null
+
+      state.loading = true
+      state.subjectList = props.subjectList
+      // state.musicSheetTagList = props.musicSheetTagList
+      // 加载曲目标签
+
+      try {
+        const { data } = await musicSheetApplicationExtendTagList({
+          applicationId: props.appId,
+          enable: true
+        })
+        if (data && data.length > 0) {
+          data.forEach((item: any) => {
+            state.musicSheetTagList.push({
+              ...item,
+              label: item.name,
+              value: item.id
+            })
+          })
+        }
+      } catch (err) {}
+      await initUseAppList()
+      await getList()
+    })
+
+    const initUseAppList = async () => {
+      try {
+        const appKeys = Object.keys(appKey)
+        const { data } = await sysApplicationPage({ page: 1, rows: 999 })
+        const tempList = data.rows || []
+        state.useProjectData = []
+        const filter = tempList.filter((next: any) => {
+          return appKeys.includes(next.appKey)
+        })
+        filter.forEach((item: any) => {
+          state.useProjectData.push({
+            ...item,
+            label: item.appName,
+            value: item.id
+          })
+        })
+      } catch {}
+    }
+
+    const getList = async () => {
+      try {
+        state.loading = true
+        const search = {
+          ...state.searchForm,
+          userId:
+            state.searchForm.sourceType && state.searchForm.sourceType == 'PERSON'
+              ? state.searchForm.userId
+              : null,
+          organizationRoleId:
+            state.searchForm.sourceType && state.searchForm.sourceType == 'ORG'
+              ? state.searchForm.userId
+              : null
+        }
+        const { data } = await musicSheetPage({
+          ...state.pagination,
+          ...search,
+          addAppId: props.appId
+        })
+        state.pagination.pageTotal = Number(data.total)
+        state.dataList = data.rows || []
+      } catch {}
+      state.loading = false
+    }
+
+    const saveForm = ref()
+
+    const onSearch = () => {
+      checkedRowKeysRef.value = []
+      saveForm.value?.submit()
+    }
+    const onBtnReset = () => {
+      saveForm.value?.reset()
+    }
+
+    const onSubmit = () => {
+      state.pagination.page = 1
+      getList()
+    }
+
+    const updateUserIdData = async (sourceType: any) => {
+      if (!state.searchForm.applicationId) {
+        return
+      }
+      state.userIdData = []
+      state.searchForm.userId = null
+      if (sourceType && sourceType !== 'PLATFORM') {
+        const { data } = await musicSheetApplicationOwnerList({
+          page: 1,
+          rows: 9999,
+          sourceType: sourceType,
+          applicationId: state.searchForm.applicationId
+        })
+        const temp = data.rows || []
+        temp.forEach((next: any) => {
+          state.userIdData.push({
+            ...next,
+            label: sourceType === 'PERSON' ? next.userName : next.organizationRole,
+            value: sourceType === 'PERSON' ? next.userId : next.organizationRoleId
+          })
+        })
+      }
+    }
+
+    const onSave = async () => {
+      if (state.selectRowData.length == 0) {
+        message.error('未选择曲目')
+        return
+      }
+      const params = [] as any[]
+      for (let i = 0; i < state.selectRowData.length; i++) {
+        const item = state.selectRowData[i]
+        if (item.scoreType == null) {
+          message.error('默认谱面不能为空')
+          return
+        }
+        if (item.isConvertibleScore == null) {
+          message.error('是否支持转谱不能为空')
+          return
+        }
+        if (item.sortNo === null || item.sortNo === undefined || item.sortNo === '') {
+          message.error('排序号不能为空')
+          return
+        }
+        params.push({
+          ...item,
+          musicSheetId: item.id,
+          applicationId: props.appId,
+          paymentType: item.paymentType.join(','),
+          musicTagIds: item.musicTagIds.join(','),
+          id: null
+        })
+      }
+      const res = (await musicSheetApplicationExtendSaveBatch(params)) as any
+      if (res && res.code == '200') {
+        message.success(`添加成功`)
+        emit('getList')
+        emit('close')
+      }
+    }
+
+    const columnsField = [
+      {
+        type: 'selection'
+      },
+      {
+        title: '曲目编号',
+        key: 'id'
+      },
+      {
+        title: '封面图',
+        key: 'titleImg',
+        render(row: any) {
+          return <NImage width={40} height={40} src={row.musicCover} />
+        }
+      },
+      {
+        title: '可用声部',
+        key: 'subjectNames',
+        render: (row: any) => {
+          return <TheTooltip content={row.subjectNames} />
+        }
+      },
+      {
+        title: '曲目名称',
+        key: 'name'
+      },
+      {
+        title: '音乐人',
+        key: 'composer'
+      },
+      // {
+      //   title: '谱面渲染',
+      //   key: 'musicSheetType',
+      //   render: (row: any) => {
+      //     return (
+      //       <div>
+      //         {getMapValueByKey(row.musicSheetType, new Map(Object.entries(musicSheetType)))}
+      //       </div>
+      //     )
+      //   }
+      // },
+      {
+        title: '曲目来源',
+        key: 'sourceType',
+        render(row: any) {
+          return getMapValueByKey(row.sourceType, new Map(Object.entries(musicSheetSourceType)))
+        }
+      },
+      {
+        title: '所属人',
+        key: 'userName',
+        render: (row: any) => {
+          return <TheTooltip content={getOwnerName(row.musicSheetExtend, row.sourceType)} />
+        }
+      }
+    ]
+
+    const columns = (): any => {
+      return columnsField
+    }
+
+    const stepColumns = (): DataTableColumns => {
+      const field = deepClone(columnsField)
+      field.splice(0, 1)
+      field.push({
+        title(column: any) {
+          return (
+            <NSpace>
+              默认谱面
+              <NButton
+                type="primary"
+                size="small"
+                text
+                onClick={() => {
+                  dialogs.create({
+                    title: '请选择默认谱面',
+                    showIcon: false,
+                    content: () => {
+                      return h(
+                        'div',
+                        {
+                          class: 'flex flex-col justify-center items-center text-14px'
+                        },
+                        [
+                          // icon
+                          h(NSelect, {
+                            onUpdateValue(v) {
+                              state.scoreType = v
+                            },
+                            options: getSelectDataFromObj(scoreType)
+                          })
+                        ]
+                      )
+                    },
+                    positiveText: '确定',
+                    negativeText: '取消',
+                    onPositiveClick: () => {
+                      for (let i = 0; i < state.selectRowData.length; i++) {
+                        const item = state.selectRowData[i]
+                        item.scoreType = state.scoreType
+                      }
+                    }
+                  })
+                }}
+              >
+                <NIcon size={15} style="padding-left: 5px;margin-top:4px">
+                  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
+                    <path d="M2 26h28v2H2z" fill="currentColor"></path>
+                    <path
+                      d="M25.4 9c.8-.8.8-2 0-2.8l-3.6-3.6c-.8-.8-2-.8-2.8 0l-15 15V24h6.4l15-15zm-5-5L24 7.6l-3 3L17.4 7l3-3zM6 22v-3.6l10-10l3.6 3.6l-10 10H6z"
+                      fill="currentColor"
+                    ></path>
+                  </svg>
+                </NIcon>
+              </NButton>
+            </NSpace>
+          )
+        },
+        key: 'scoreType',
+        width: 200,
+        render: (row: any) => {
+          // })
+          return (
+            <NSelect
+              placeholder="请选择默认谱面"
+              value={row.scoreType}
+              options={getSelectDataFromObj(scoreType)}
+              onUpdateValue={(value: any) => {
+                row.scoreType = value
+              }}
+              clearable
+            />
+          )
+        }
+      })
+      
+      field.push({
+        title(column: any) {
+          return (
+            <NSpace>
+              是否支持转谱
+              <NButton
+                type="primary"
+                size="small"
+                text
+                onClick={() => {
+                  dialogs.create({
+                    title: '是否支持转谱',
+                    showIcon: false,
+                    content: () => {
+                      return h(
+                        'div',
+                        {
+                          class: 'flex flex-col justify-center items-center text-14px'
+                        },
+                        [
+                          // icon
+                          h(NSelect, {
+                            onUpdateValue(v) {
+                              state.isConvertibleScore = v
+                            },
+                            options: [
+                              {
+                                label: '是',
+                                value: true
+                              },
+                              {
+                                label: '否',
+                                value: false
+                              }
+                            ] as any
+                          })
+                        ]
+                      )
+                    },
+                    positiveText: '确定',
+                    negativeText: '取消',
+                    onPositiveClick: () => {
+                      for (let i = 0; i < state.selectRowData.length; i++) {
+                        const item = state.selectRowData[i]
+                        item.isConvertibleScore = state.isConvertibleScore
+                      }
+                    }
+                  })
+                }}
+              >
+                <NIcon size={15} style="padding-left: 5px;margin-top:4px">
+                  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
+                    <path d="M2 26h28v2H2z" fill="currentColor"></path>
+                    <path
+                      d="M25.4 9c.8-.8.8-2 0-2.8l-3.6-3.6c-.8-.8-2-.8-2.8 0l-15 15V24h6.4l15-15zm-5-5L24 7.6l-3 3L17.4 7l3-3zM6 22v-3.6l10-10l3.6 3.6l-10 10H6z"
+                      fill="currentColor"
+                    ></path>
+                  </svg>
+                </NIcon>
+              </NButton>
+            </NSpace>
+          )
+        },
+        key: 'isConvertibleScore',
+        width: 200,
+        render: (row: any) => {
+          // })
+          return (
+            <NSelect
+              value={row.isConvertibleScore}
+              options={[
+                {
+                  label: '是',
+                  value: true
+                },
+                {
+                  label: '否',
+                  value: false
+                } as any
+              ]}
+              onUpdateValue={(value: any) => {
+                row.isConvertibleScore = value
+              }}
+              filterable
+              clearable
+            />
+          )
+        }
+      })
+
+
+      field.push({
+        title(column: any) {
+          return (
+            <NSpace>
+              是否启用
+              <NButton
+                type="primary"
+                size="small"
+                text
+                onClick={() => {
+                  dialogs.create({
+                    title: '是否启用',
+                    showIcon: false,
+                    content: () => {
+                      return h(
+                        'div',
+                        {
+                          class: 'flex flex-col justify-center items-center text-14px'
+                        },
+                        [
+                          // icon
+                          h(NSelect, {
+                            onUpdateValue(v) {
+                              state.status = v
+                            },
+                            options: [
+                              {
+                                label: '是',
+                                value: true
+                              },
+                              {
+                                label: '否',
+                                value: false
+                              }
+                            ] as any
+                          })
+                        ]
+                      )
+                    },
+                    positiveText: '确定',
+                    negativeText: '取消',
+                    onPositiveClick: () => {
+                      for (let i = 0; i < state.selectRowData.length; i++) {
+                        const item = state.selectRowData[i]
+                        item.status = state.status
+                      }
+                    }
+                  })
+                }}
+              >
+                <NIcon size={15} style="padding-left: 5px;margin-top:4px">
+                  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
+                    <path d="M2 26h28v2H2z" fill="currentColor"></path>
+                    <path
+                      d="M25.4 9c.8-.8.8-2 0-2.8l-3.6-3.6c-.8-.8-2-.8-2.8 0l-15 15V24h6.4l15-15zm-5-5L24 7.6l-3 3L17.4 7l3-3zM6 22v-3.6l10-10l3.6 3.6l-10 10H6z"
+                      fill="currentColor"
+                    ></path>
+                  </svg>
+                </NIcon>
+              </NButton>
+            </NSpace>
+          )
+        },
+        key: 'status',
+        width: 200,
+        render: (row: any) => {
+          // })
+          return (
+            <NSelect
+              value={row.status}
+              options={[
+                {
+                  label: '是',
+                  value: true
+                },
+                {
+                  label: '否',
+                  value: false
+                } as any
+              ]}
+              onUpdateValue={(value: any) => {
+                row.status = value
+              }}
+              filterable
+              clearable
+            />
+          )
+        }
+      })
+
+      field.push({
+        title(column: any) {
+          return (
+            <NSpace>
+              排序
+              <NButton
+                type="primary"
+                size="small"
+                text
+                onClick={() => {
+                  dialogs.create({
+                    title: '请输入排序起始值',
+                    showIcon: false,
+                    content: () => {
+                      return h(
+                        'div',
+                        {
+                          class: 'flex flex-col justify-center items-center text-14px'
+                        },
+                        [
+                          // icon
+                          h(NInputNumber, {
+                            onUpdateValue(v) {
+                              state.globalStartSortNum = v
+                            },
+                            min: 0,
+                            max: 9999
+                          })
+                        ]
+                      )
+                    },
+                    positiveText: '确定',
+                    negativeText: '取消',
+                    onPositiveClick: () => {
+                      for (let i = 0; i < state.selectRowData.length; i++) {
+                        const item = state.selectRowData[i]
+                        item.sortNo = state.globalStartSortNum + i
+                      }
+                    }
+                  })
+                }}
+              >
+                <NIcon size={15} style="padding-left: 5px;margin-top:4px">
+                  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
+                    <path d="M2 26h28v2H2z" fill="currentColor"></path>
+                    <path
+                      d="M25.4 9c.8-.8.8-2 0-2.8l-3.6-3.6c-.8-.8-2-.8-2.8 0l-15 15V24h6.4l15-15zm-5-5L24 7.6l-3 3L17.4 7l3-3zM6 22v-3.6l10-10l3.6 3.6l-10 10H6z"
+                      fill="currentColor"
+                    ></path>
+                  </svg>
+                </NIcon>
+              </NButton>
+            </NSpace>
+          )
+        },
+        key: 'sortNo',
+        fixed: 'right',
+        width: 150,
+        render: (row: any) => {
+          return h(NInputNumber, {
+            value: row.sortNo,
+            min: 0,
+            max: 9999,
+            onUpdateValue(value: any) {
+              row.sortNo = value
+            }
+          })
+        }
+      })
+
+      field.push({
+        title: '操作',
+        key: 'operation',
+        fixed: 'right',
+        render(row: any) {
+          return (
+            <NSpace>
+              <NButton
+                type="primary"
+                size="small"
+                text
+                //v-auth="musicSheet/update1602302618558099458"
+                onClick={() => {
+                  dialogs.warning({
+                    title: '提示',
+                    content: `是否删除该数据?`,
+                    positiveText: '确定',
+                    negativeText: '取消',
+                    onPositiveClick: async () => {
+                      try {
+                        const index = state.selectRowData.findIndex((item: any) => {
+                          if (item.id == row.id) {
+                            return true
+                          }
+                        })
+                        if (index > -1) {
+                          state.selectRowData.splice(index, 1)
+                        }
+                        const index1 = checkedRowKeysRef.value.findIndex((item: any) => {
+                          if (item == row.id) {
+                            return true
+                          }
+                        })
+                        if (index1 > -1) {
+                          checkedRowKeysRef.value.splice(index, 1)
+                        }
+                      } catch {}
+                    }
+                  })
+                }}
+              >
+                移除
+              </NButton>
+            </NSpace>
+          )
+        }
+      })
+      return field
+    }
+
+    const checkedRowKeysRef = ref<DataTableRowKey[]>([])
+    const handleCheck = (rowKeys: DataTableRowKey[]) => {
+      checkedRowKeysRef.value = rowKeys
+      // 添加行更新值
+      state.dataList.forEach((next: any) => {
+        if (checkedRowKeysRef.value.includes(next.id)) {
+          const find = state.selectRowData.find((row: any) => {
+            return row.id === next.id
+          })
+          if (!find) {
+            state.selectRowData.push({
+              ...next,
+              status: false,
+              paymentType: [] as any,
+              musicPriceDisable: false // 默认可以编辑曲目价格
+            })
+          }
+        }
+      })
+
+      // 去掉行更新值
+      state.selectRowData = state.selectRowData.filter((next: any) => {
+        return checkedRowKeysRef.value.includes(next.id)
+      })
+    }
+
+    return () => {
+      return (
+        <div class="system-menu-container">
+          <NSpace vertical size="medium">
+            <NSteps
+              current={state.currentStep}
+              // onUpdateCurrent={()=>{
+              //   state.currentStep = val
+              // }}
+              style={'margin-bottom: 10px;margin-top: 10px'}
+            >
+              <NStep title="选择曲目" description=""></NStep>
+              <NStep title="设置曲目信息" description=""></NStep>
+            </NSteps>
+          </NSpace>
+          {state.currentStep === 1 && (
+            <div class="system-menu-container">
+              <SaveForm
+                ref={saveForm}
+                model={state.searchForm}
+                onSubmit={onSubmit}
+                saveKey="klx-addMusic"
+                onSetModel={(val: any) => (state.searchForm = val)}
+              >
+                <NFormItem label="关键词" path="keyword">
+                  <NInput
+                    v-model:value={state.searchForm.keyword}
+                    placeholder="请输入曲目名称/编号"
+                    clearable
+                  />
+                </NFormItem>
+                {/* <NFormItem label="谱面渲染" path="musicSheetType">
+                  <NSelect
+                    placeholder="请选择谱面渲染"
+                    v-model:value={state.searchForm.musicSheetType}
+                    options={getSelectDataFromObj(musicSheetType)}
+                    clearable
+                  />
+                </NFormItem> */}
+                <NFormItem label="可用声部" path="musicSubject">
+                  <NSelect
+                    placeholder="请选择可用声部"
+                    v-model:value={state.searchForm.subjectId}
+                    options={state.subjectList}
+                    clearable
+                    filterable
+                  />
+                </NFormItem>
+                <NFormItem label="音乐人" path="composer">
+                  <NInput
+                    placeholder="请选择音乐人"
+                    v-model:value={state.searchForm.composer}
+                    clearable
+                  />
+                </NFormItem>
+                <NFormItem label="曲目来源" path="sourceType">
+                  <NSelect
+                    placeholder="请选择曲目来源"
+                    v-model:value={state.searchForm.sourceType}
+                    options={getSelectDataFromObj(musicSheetSourceType)}
+                    onUpdateValue={async (value: any) => {
+                      state.userIdData = []
+                      state.searchForm.userId = null
+                      if (value && value !== 'PLATFORM') {
+                        await updateUserIdData(value)
+                        state.userIdDisable = false
+                      } else {
+                        state.userIdDisable = true
+                      }
+                    }}
+                    clearable
+                  />
+                </NFormItem>
+                <NFormItem label="所属项目" path="applicationId">
+                  <NSelect
+                    placeholder="请选择所属项目"
+                    v-model:value={state.searchForm.applicationId}
+                    options={state.useProjectData}
+                    clearable
+                    onUpdateValue={async (value: any) => {
+                      state.searchForm.applicationId = value
+                      if (value) {
+                        await updateUserIdData(state.searchForm.sourceType)
+                        state.userIdDisable = !(
+                          state.searchForm.sourceType && state.searchForm.sourceType !== 'PLATFORM'
+                        )
+                      } else {
+                        state.searchForm.userId = null
+                        state.userIdDisable = true
+                        state.userIdData = []
+                      }
+                    }}
+                  />
+                </NFormItem>
+                <NFormItem label="所属人" path="author">
+                  <NSelect
+                    filterable
+                    placeholder="请选择所属人"
+                    disabled={
+                      state.userIdDisable ||
+                      (!state.searchForm.applicationId && !state.searchForm.sourceType)
+                    }
+                    v-model:value={state.searchForm.userId}
+                    options={state.userIdData}
+                    clearable
+                  ></NSelect>
+                </NFormItem>
+                <NFormItem>
+                  <NSpace>
+                    <NButton type="primary" onClick={onSearch}>
+                      搜索
+                    </NButton>
+                    <NButton type="default" onClick={onBtnReset}>
+                      重置
+                    </NButton>
+                  </NSpace>
+                </NFormItem>
+              </SaveForm>
+              <p style={{ paddingBottom: '12px' }}>
+                你选择了<span style={'color:red;padding:0 8px'}>{state.selectRowData.length}</span>
+                条曲目
+              </p>
+              <NDataTable
+                loading={state.loading}
+                columns={columns()}
+                data={state.dataList}
+                rowKey={(row: any) => row.id}
+                onUpdateCheckedRowKeys={handleCheck}
+                v-model:checkedRowKeys={checkedRowKeysRef.value}
+              ></NDataTable>
+              <Pagination
+                v-model:page={state.pagination.page}
+                v-model:pageSize={state.pagination.rows}
+                v-model:pageTotal={state.pagination.pageTotal}
+                onList={getList}
+                sync
+                saveKey="klx-addMusic"
+              ></Pagination>
+            </div>
+          )}
+          {state.currentStep === 2 && (
+            <div class="system-menu-container" style={'margin-top: 15px;'}>
+              <NDataTable
+                loading={state.loading}
+                columns={stepColumns()}
+                data={state.selectRowData}
+                rowKey={(row: any) => row.id}
+                maxHeight={500}
+                scrollX={2500}
+              ></NDataTable>
+            </div>
+          )}
+          <NSpace justify="end" style={'margin-top:10px'}>
+            <NButton
+              type="default"
+              onClick={() => {
+                if (state.currentStep > 1) {
+                  state.currentStep = state.currentStep - 1
+                } else {
+                  emit('close')
+                }
+              }}
+            >
+              {state.currentStep === 1 ? '取消' : '上一步'}
+            </NButton>
+            <NButton
+              type="primary"
+              onClick={() => {
+                if (state.currentStep < 2) {
+                  if (state.selectRowData.length == 0) {
+                    message.warning('请选择曲目')
+                    return
+                  }
+                  state.currentStep = state.currentStep + 1
+                } else {
+                  onSave()
+                }
+              }}
+              // loading={btnLoading.value}
+              // disabled={btnLoading.value}
+            >
+              {state.currentStep === 2 ? '确定' : '下一步'}
+            </NButton>
+          </NSpace>
+        </div>
+      )
+    }
+  }
+})

+ 785 - 0
src/views/music-library/project-music-sheet/module/klx_jg/music-sheet-klx_jg.tsx

@@ -0,0 +1,785 @@
+import { defineComponent, onMounted, reactive, ref } from 'vue'
+import SaveForm from '@components/save-form'
+import {
+  DataTableRowKey,
+  NButton,
+  NDataTable,
+  NDatePicker,
+  NDescriptions,
+  NDescriptionsItem,
+  NFormItem,
+  NImage,
+  NInput,
+  NModal,
+  NSelect,
+  NSpace,
+  NTag,
+  useDialog,
+  useMessage
+} from 'naive-ui'
+import Pagination from '@components/pagination'
+import TheTooltip from '@components/TheTooltip'
+import AddMusic from '@views/music-library/project-music-sheet/module/klx/addMusic'
+import { getMapValueByKey, getSelectDataFromObj } from '@/utils/objectUtil'
+import {
+  appKey,
+  musicSheetAudioType,
+  musicSheetAvailableType,
+  musicSheetPaymentType,
+  musicSheetSourceType,
+  musicSheetType
+} from '@/utils/constant'
+import {
+  musicSheetApplicationExtendDel,
+  musicSheetApplicationExtendStatus,
+  musicSheetApplicationExtendTagList,
+  musicSheetApplicationOwnerList,
+  musicSheetPageByApplication
+} from '@views/music-library/api'
+import {
+  musicSheetApplicationExtendSubjectList,
+  sysApplicationPage
+} from '@views/system-manage/api'
+import { filterTimes } from '@/utils/dateUtil'
+import deepClone from '@/utils/deep.clone'
+import { copyText, getOwnerName } from '@views/music-library/musicUtil'
+import UpdateMusic from '@views/music-library/project-music-sheet/module/klx/updateMusic'
+import MusicPreView from '@views/music-library/music-sheet/modal/musicPreView'
+
+export default defineComponent({
+  name: 'music-sheet-KLX',
+  props: {
+    appKey: {
+      type: String,
+      default: 'KLX'
+    }
+  },
+
+  setup(props) {
+    const dialog = useDialog()
+    const message = useMessage()
+    const state = reactive({
+      loading: false,
+      appId: null as any,
+      pagination: {
+        page: 1,
+        rows: 10,
+        pageTotal: 0
+      },
+      searchForm: {
+        keyword: null,
+        // musicSheetType: null, //曲目类型(SINGLE:单曲 CONCERT:合奏)
+        subjectId: null, //声部ID
+        subjectIds: null, //曲目声部ID集合
+        status: null, //曲目状态(0:停用,1:启用)
+        sourceType: null, //来源类型/作者属性(PLATFORM: 平台; ORG: 机构; PERSON: 个人)
+        paymentType: null, //收费类型(FREE:免费;VIP:会员;CHARGE:单曲收费)
+        userId: null, //所属人
+        musicCategoryId: null, //曲目分类ID
+        times: null, // 上传时间
+        audioType: null, //音频类型(HOMEMODE: 自制 COMMON: 普通)
+        exquisiteFlag: null, //精品标志
+        topFlag: null, //是否置顶(0:否;1:是)
+        availableType: null, //可用途径 ORG 机构 PLATFORM 平台
+        appAuditFlag: null, //是否审核版本
+        detailFlag: null, //是否查询详情
+        musicTagIds: [] as any, //曲目标签
+        applicationId: null, //所属人项目ID
+        extendApplicationId: null //所属人项目ID
+      },
+      subjectList: [],
+      dataList: [] as any[],
+      showAddDialog: false,
+      showEditDialog: false,
+      userIdDisable: true,
+      userIdData: [] as any,
+      updateRow: {} as any, // 修改选择的行
+      musicTagList: [] as any, //曲目标签
+      applicationId: null, //应用ID
+      musicPreview: false,
+      musicPreviewScoreType: 'staff', // 预览谱面类型
+      musicScore: null as any,
+      useProjectData: [] as any // 适用项目行数据
+    })
+
+    onMounted(async () => {
+      state.loading = true
+      // 获取应用APP信息
+      console.log(props.appKey, 'appKey')
+      try {
+        const { data } = await sysApplicationPage({ page: 1, rows: 1, appKey: props.appKey })
+        const tempList = data.rows || []
+        if (!tempList || tempList.length == 0) {
+          state.loading = false
+          message.error('加载项目信息失败')
+          return
+        }
+        state.appId = tempList[0].id
+        state.applicationId = tempList[0].id
+      } catch {}
+
+      // 加载声部
+
+      try {
+        // const { data } = await subjectPage({ page: 1, rows: 999 })
+        // const tempList = data.rows || []
+        // tempList.forEach((item: any) => {
+        //   item.label = item.name
+        //   item.value = item.id + ''
+        // })
+        // state.subjectList = tempList
+        const { data } = await musicSheetApplicationExtendSubjectList({
+          applicationId: state.applicationId
+        })
+        const tempList = data || []
+        tempList.forEach((item: any) => {
+          item.label = item.subjectName
+          item.value = item.subjectId
+        })
+        state.subjectList = tempList
+      } catch {}
+
+      // 加载曲目标签
+
+      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()
+      getList()
+    })
+
+    const saveForm = ref()
+
+    const onSearch = () => {
+      checkedRowKeysRef.value = []
+      saveForm.value?.submit()
+    }
+    const onBtnReset = () => {
+      saveForm.value?.reset()
+    }
+
+    const onSubmit = () => {
+      state.pagination.page = 1
+      getList()
+    }
+
+    const initUseAppList = async () => {
+      try {
+        const appKeys = Object.keys(appKey)
+        const { data } = await sysApplicationPage({ page: 1, rows: 999 })
+        const tempList = data.rows || []
+        state.useProjectData = []
+        const filter = tempList.filter((next: any) => {
+          return appKeys.includes(next.appKey)
+        })
+        filter.forEach((item: any) => {
+          state.useProjectData.push({
+            ...item,
+            label: item.appName,
+            value: item.id
+          })
+        })
+      } catch {}
+    }
+
+    const checkedRowKeysRef = ref<DataTableRowKey[]>([])
+    const handleCheck = (rowKeys: DataTableRowKey[]) => {
+      checkedRowKeysRef.value = rowKeys
+    }
+
+    const getList = async () => {
+      try {
+        state.loading = true
+        const sourceType = state.searchForm.sourceType
+        let userId = state.searchForm.userId
+        let organizationRoleId = null
+        if (sourceType && sourceType === 'ORG') {
+          organizationRoleId = deepClone(userId)
+          userId = null
+        }
+        const { data } = await musicSheetPageByApplication({
+          ...state.pagination,
+          ...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
+        })
+        state.pagination.pageTotal = Number(data.total)
+        state.dataList = data.rows || []
+      } catch {}
+      state.loading = false
+    }
+
+    const onChangeStatus = (row: any) => {
+      const statusStr = row.status ? '停用' : '启用'
+      dialog.warning({
+        title: '提示',
+        content: `是否${statusStr}?`,
+        positiveText: '确定',
+        negativeText: '取消',
+        onPositiveClick: async () => {
+          try {
+            await musicSheetApplicationExtendStatus({
+              ids: row.applicationExtendId,
+              status: !row.status
+            })
+            getList()
+            message.success(`${statusStr}成功`)
+          } catch {}
+        }
+      })
+    }
+
+    const onBatchChangeStatus = (status: boolean) => {
+      const length = checkedRowKeysRef.value.length
+      if (length == 0) {
+        message.warning('未选择数据')
+      }
+      const statusStr = !status ? '停用' : '启用'
+      dialog.warning({
+        title: '提示',
+        content: `是否${statusStr}` + length + `条数据?`,
+        positiveText: '确定',
+        negativeText: '取消',
+        onPositiveClick: async () => {
+          try {
+            await musicSheetApplicationExtendStatus({
+              ids: checkedRowKeysRef.value.join(','),
+              status: status
+            })
+            getList()
+            message.success(`${statusStr}成功`)
+          } catch {}
+        }
+      })
+    }
+
+    const getPaymentType = (paymentType: any) => {
+      const paymentTypeName = []
+      if (paymentType && paymentType.length > 0) {
+        for (let i = 0; i < paymentType.length; i++) {
+          const name = getMapValueByKey(
+            paymentType[i],
+            new Map(Object.entries(musicSheetPaymentType))
+          )
+          paymentTypeName.push(name)
+        }
+      }
+      return paymentTypeName.join(',')
+    }
+
+    const updateUserIdData = async (sourceType: any) => {
+      if (!state.searchForm.extendApplicationId) {
+        return
+      }
+      state.userIdData = []
+      state.searchForm.userId = null
+      if (sourceType && sourceType !== 'PLATFORM') {
+        const { data } = await musicSheetApplicationOwnerList({
+          page: 1,
+          rows: 9999,
+          sourceType: sourceType,
+          applicationId: state.searchForm.extendApplicationId
+        })
+        const temp = data.rows || []
+        temp.forEach((next: any) => {
+          state.userIdData.push({
+            ...next,
+            label: sourceType === 'PERSON' ? next.userName : next.organizationRole,
+            value: sourceType === 'PERSON' ? next.userId : next.organizationRoleId
+          })
+        })
+      }
+    }
+
+    const onRmove = (row: any): void => {
+      dialog.warning({
+        title: '提示',
+        content: `删除曲目,是否继续?`,
+        positiveText: '确定',
+        negativeText: '取消',
+        onPositiveClick: async () => {
+          try {
+            await musicSheetApplicationExtendDel(row.applicationExtendId)
+            getList()
+            message.success('删除成功')
+          } catch {}
+        }
+      })
+    }
+
+    const columns = (): any => {
+      return [
+        {
+          type: 'selection'
+        },
+        {
+          title: '曲目名称',
+          key: 'id',
+          render: (row: any) => (
+            <>
+              <NDescriptions labelPlacement="left" column={1}>
+                <NDescriptionsItem label="曲目名称">
+                  <TheTooltip content={row.name} />{' '}
+                </NDescriptionsItem>
+                <NDescriptionsItem label="曲目编号">
+                  <div
+                    onDblclick={() => {
+                      copyText(message, row.id)
+                    }}
+                  >
+                    <TheTooltip content={row.id} />
+                  </div>
+                </NDescriptionsItem>
+              </NDescriptions>
+            </>
+          )
+        },
+        {
+          title: '封面图',
+          key: 'musicCover',
+          render(row: any): JSX.Element {
+            return <NImage width={60} height={60} src={row.musicCover} />
+          }
+        },
+        {
+          title: '曲目信息',
+          key: 'musicSheetCategoriesName',
+          render: (row: any) => (
+            <>
+              <NDescriptions labelPlacement="left" column={1}>
+                <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>
+                <NDescriptionsItem label="可用声部">
+                  <TheTooltip content={row.subjectNames} />
+                </NDescriptionsItem>
+              </NDescriptions>
+            </>
+          )
+        },
+        {
+          title: '伴奏类型',
+          key: 'audioType',
+          render: (row: any) => {
+            return (
+              <div>
+                {getMapValueByKey(row.audioType, new Map(Object.entries(musicSheetAudioType)))}
+              </div>
+            )
+          }
+        },
+        // {
+        //   title: '可用声部',
+        //   key: 'subjectNames',
+        //   render: (row: any) => {
+        //     return <TheTooltip content={row.subjectNames}/>
+        //   }
+        // },
+        {
+          title: '曲目标签',
+          key: 'musicTagNames'
+        },
+        {
+          title: '可用途径',
+          key: 'applicationAvailableType',
+          render: (row: any) => {
+            return (
+              <div>
+                {getMapValueByKey(
+                  row.applicationAvailableType,
+                  new Map(Object.entries(musicSheetAvailableType))
+                )}
+              </div>
+            )
+          }
+        },
+        {
+          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',
+          render(row: any) {
+            return (
+              row.createTime
+            )
+          }
+        },
+        {
+          title: '状态',
+          key: 'status',
+          render(row: any) {
+            return (
+              <NTag type={row.status ? 'primary' : 'default'}>{row.status ? '启用' : '停用'}</NTag>
+            )
+          }
+        },
+        {
+          title: '操作',
+          key: 'operation',
+          fixed: 'right',
+          render(row: any) {
+            return (
+              <NSpace>
+                <NButton
+                  type="primary"
+                  size="small"
+                  text
+                  onClick={() => {
+                    state.musicPreview = true
+                    state.musicScore = row
+                    if ('STAVE' == row.scoreType) {
+                      state.musicPreviewScoreType = 'staff'
+                    } else if ('JIAN' == row.scoreType) {
+                      state.musicPreviewScoreType = 'fixedTone'
+                    } else if ('FIRST' == row.scoreType) {
+                      state.musicPreviewScoreType = 'firstTone'
+                    } else {
+                      return
+                    }
+                  }}
+                >
+                  预览
+                </NButton>
+                <NButton
+                  type="primary"
+                  size="small"
+                  text
+                  v-auth="musicSheetApplicationExtend/status1751229794627878914"
+                  onClick={() => onChangeStatus(row)}
+                >
+                  {row.status ? '停用' : '启用'}
+                </NButton>
+                <NButton
+                  type="primary"
+                  size="small"
+                  text
+                  v-auth="musicSheetApplicationExtend/update1751235573456044033"
+                  onClick={() => {
+                    state.showEditDialog = true
+                    state.updateRow = row
+                  }}
+                >
+                  修改
+                </NButton>
+                <NButton
+                  type="primary"
+                  size="small"
+                  text
+                  disabled={!!row.status}
+                  onClick={() => onRmove(row)}
+                  v-auth="musicSheetApplicationExtend/del1770708473623916546"
+                >
+                  删除
+                </NButton>
+              </NSpace>
+            )
+          }
+        }
+      ]
+    }
+
+    return () => {
+      return (
+        <div class="system-menu-container">
+          <SaveForm
+            ref={saveForm}
+            model={state.searchForm}
+            onSubmit={onSubmit}
+            saveKey="music-sheet-klx"
+            onSetModel={(val: any) => (state.searchForm = val)}
+          >
+            <NFormItem label="关键词" path="keyword">
+              <NInput
+                placeholder="请输入曲目名称/编号"
+                v-model:value={state.searchForm.keyword}
+                clearable
+              />
+            </NFormItem>
+            <NFormItem label="曲目来源" path="sourceType">
+              <NSelect
+                placeholder="请选择曲目来源"
+                v-model:value={state.searchForm.sourceType}
+                options={getSelectDataFromObj(musicSheetSourceType)}
+                onUpdateValue={async (value: any) => {
+                  state.userIdData = []
+                  state.searchForm.userId = null
+                  if (value && value !== 'PLATFORM') {
+                    await updateUserIdData(value)
+                    state.userIdDisable = !state.searchForm.extendApplicationId
+                  } else {
+                    state.userIdDisable = true
+                  }
+                }}
+                clearable
+              />
+            </NFormItem>
+            <NFormItem label="所属项目" path="applicationId">
+              <NSelect
+                placeholder="请选择所属项目"
+                v-model:value={state.searchForm.extendApplicationId}
+                options={state.useProjectData}
+                clearable
+                onUpdateValue={async (value: any) => {
+                  state.searchForm.extendApplicationId = value
+                  if (value) {
+                    await updateUserIdData(state.searchForm.sourceType)
+                    state.userIdDisable = !(
+                      state.searchForm.sourceType && state.searchForm.sourceType !== 'PLATFORM'
+                    )
+                  } else {
+                    state.searchForm.userId = null
+                    state.userIdDisable = true
+                    state.userIdData = []
+                  }
+                }}
+              />
+            </NFormItem>
+            <NFormItem label="所属人" path="userId">
+              <NSelect
+                filterable
+                placeholder="请选择所属人"
+                disabled={state.userIdDisable}
+                v-model:value={state.searchForm.userId}
+                options={state.userIdData}
+                clearable
+              ></NSelect>
+            </NFormItem>
+            {/* <NFormItem label="谱面渲染" path="subjectType">
+              <NSelect
+                placeholder="请选择谱面渲染"
+                v-model:value={state.searchForm.musicSheetType}
+                options={getSelectDataFromObj(musicSheetType)}
+                clearable
+              />
+            </NFormItem> */}
+            <NFormItem label="伴奏类型" path="audioType">
+              <NSelect
+                placeholder="请选择伴奏类型"
+                v-model:value={state.searchForm.audioType}
+                options={getSelectDataFromObj(musicSheetAudioType)}
+                clearable
+              />
+            </NFormItem>
+            <NFormItem label="可用声部" path="subjectId">
+              <NSelect
+                placeholder="请选择可用声部"
+                v-model:value={state.searchForm.subjectId}
+                options={state.subjectList}
+                clearable
+                filterable
+              />
+            </NFormItem>
+            <NFormItem label="曲目标签" path="musicTagIds">
+              <NSelect
+                placeholder="请选择曲目标签"
+                v-model:value={state.searchForm.musicTagIds}
+                options={state.musicTagList}
+                multiple
+                maxTagCount={2}
+                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}
+                placeholder="请选择状态"
+                options={
+                  [
+                    {
+                      label: '启用',
+                      value: true
+                    },
+                    {
+                      label: '停用',
+                      value: false
+                    }
+                  ] as any
+                }
+                clearable
+              />
+            </NFormItem>
+            <NFormItem label="上传时间" path="authorFrom">
+              <NDatePicker
+                v-model:value={state.searchForm.times}
+                type="daterange"
+                clearable
+                value-format="yyyy.MM.dd"
+                startPlaceholder="开始时间"
+                endPlaceholder="结束时间"
+              />
+            </NFormItem>
+            <NFormItem>
+              <NSpace>
+                <NButton type="primary" onClick={onSearch}>
+                  搜索
+                </NButton>
+                <NButton type="default" onClick={onBtnReset}>
+                  重置
+                </NButton>
+              </NSpace>
+            </NFormItem>
+          </SaveForm>
+
+          <div class={['section-container']}>
+            <NSpace style={{ paddingBottom: '12px' }}>
+              <NButton
+                type="primary"
+                v-auth="musicSheetApplicationExtend/saveBatch1751227277370195969"
+                onClick={() => {
+                  state.showAddDialog = true
+                }}
+              >
+                添加曲目
+              </NButton>
+              <NButton
+                disabled={checkedRowKeysRef.value.length == 0}
+                v-auth="musicSheetApplicationExtend/status1751229794627878914"
+                onClick={() => {
+                  onBatchChangeStatus(false)
+                }}
+              >
+                批量停用
+              </NButton>
+              <NButton
+                disabled={checkedRowKeysRef.value.length == 0}
+                v-auth="musicSheetApplicationExtend/status1751229794627878914"
+                onClick={() => {
+                  onBatchChangeStatus(true)
+                }}
+              >
+                批量启用
+              </NButton>
+            </NSpace>
+
+            <NDataTable
+              loading={state.loading}
+              columns={columns()}
+              data={state.dataList}
+              rowKey={(row: any) => row.applicationExtendId}
+              v-model:checkedRowKeys={checkedRowKeysRef.value}
+              scrollX={'2000'}
+            ></NDataTable>
+
+            <Pagination
+              v-model:page={state.pagination.page}
+              v-model:pageSize={state.pagination.rows}
+              v-model:pageTotal={state.pagination.pageTotal}
+              onList={getList}
+              sync
+              saveKey="music-sheet-klx"
+            ></Pagination>
+          </div>
+
+          <NModal
+            v-model:show={state.showAddDialog}
+            preset="dialog"
+            showIcon={false}
+            title={'添加曲目'}
+            style={{ width: '1300px' }}
+          >
+            <AddMusic
+              onClose={() => (state.showAddDialog = false)}
+              onGetList={onSubmit}
+              subjectList={state.subjectList}
+              appId={state.appId}
+              musicSheetTagList={state.musicTagList}
+            />
+          </NModal>
+          <NModal
+            v-model:show={state.showEditDialog}
+            preset="dialog"
+            showIcon={false}
+            title={'修改曲目'}
+            style={{ width: '500px' }}
+          >
+            <UpdateMusic
+              onClose={() => (state.showEditDialog = false)}
+              onGetList={() => {
+                state.pagination.page = 1
+                getList()
+              }}
+              rowData={state.updateRow}
+              appId={state.appId}
+              musicSheetTagList={state.musicTagList}
+            />
+          </NModal>
+          <NModal
+            blockScroll={true}
+            v-model:show={state.musicPreview}
+            preset="dialog"
+            showIcon={false}
+            title={'曲目预览'}
+            style={{ width: 'auto' }}
+          >
+            <MusicPreView item={state.musicScore} scoreType={state.musicPreviewScoreType} />
+          </NModal>
+        </div>
+      )
+    }
+  }
+})

+ 203 - 0
src/views/music-library/project-music-sheet/module/klx_jg/updateMusic.tsx

@@ -0,0 +1,203 @@
+import {defineComponent, onMounted, reactive, ref} from "vue";
+import {NButton, NForm, NFormItem, NInputNumber, NSelect, NSpace, useMessage} from "naive-ui";
+import {musicSheetApplicationExtendCategoryApplicationExtendInfo, musicSheetApplicationExtendUpdate} from "@views/music-library/api";
+import {getSelectDataFromObj} from "@/utils/objectUtil";
+import {musicSheetAvailableType, musicSheetPaymentType, scoreType} from "@/utils/constant";
+import {formatTree} from "@views/music-library/musicUtil";
+
+export default defineComponent({
+  name: 'project-music-cooleshow-edu-updateMusic',
+  props: {
+    appId: {
+      type: String,
+      required: true
+    },
+    rowData: {
+      type: Object,
+      required: true
+    },
+    musicSheetTagList: {
+      type: Array,
+      default: () => []
+    }
+  },
+  emits: ['close', 'getList'],
+  setup(props, {slots, attrs, emit}) {
+    const message = useMessage()
+    const btnLoading = ref(false)
+    const forms = reactive({
+      sortNo: null as any,
+      isConvertibleScore: null as any,//是否支持转简谱
+      status: null,
+      scoreType: null as any,//默认谱面
+    })
+    const formsRef = ref()
+
+    const state = reactive({
+      rowData: null as any,
+      musicSheetTagList: [] as any,
+    })
+
+    onMounted(async () => {
+      state.rowData = props.rowData
+      state.musicSheetTagList = props.musicSheetTagList
+      state.musicSheetTagList.map((item: any) => {
+        item.disabled = !item.enable
+      })
+      const {data} = await musicSheetApplicationExtendCategoryApplicationExtendInfo({musicSheetId: state.rowData.id, applicationId: props.appId}) as any
+      if (!data) {
+        message.error("加载应用失败")
+        return
+      }
+      forms.sortNo = data[0].sortNo
+      forms.isConvertibleScore = data[0].isConvertibleScore
+      forms.scoreType = data[0].scoreType
+      forms.status = data[0].status
+    })
+
+    const onSubmit = async () => {
+      formsRef.value.validate(async (error: any) => {
+        if (error) return false
+        btnLoading.value = true
+        try {
+          const res = await musicSheetApplicationExtendUpdate(
+              {
+                ...forms,
+                musicSheetId: state.rowData.id,
+                applicationId: props.appId
+              }
+          ) as any;
+          if (res && res.code === 200) {
+            emit('close')
+            emit('getList')
+          }
+        } catch (error) {
+        }
+        btnLoading.value = false
+      })
+    }
+
+    return () => {
+      return (
+          <div style="background: #fff; padding-top: 12px">
+            <NForm
+                ref={formsRef}
+                labelPlacement="top"
+                model={forms}
+                label-placement="left"
+                label-width="auto"
+            >
+              <NFormItem
+                  label="默认谱面"
+                  path="scoreType"
+                  rule={[
+                    {
+                      required: true,
+                      message: '请选择默认谱面'
+                    }
+                  ]}
+              >
+                <NSelect
+                    v-model:value={forms.scoreType}
+                    placeholder="请选择默认谱面"
+                    options={getSelectDataFromObj(scoreType)}
+                    clearable
+                />
+              </NFormItem>
+              <NFormItem
+                  label="支持转谱"
+                  path="isConvertibleScore"
+                  rule={[
+                    {
+                      required: true,
+                      message: '请选择是否支持转谱',
+                      trigger: ['input', 'blur'],
+                      type: 'boolean'
+                    }
+                  ]}
+              >
+                <NSelect
+                    v-model:value={forms.isConvertibleScore}
+                    options={
+                      [
+                        {
+                          label: '是',
+                          value: true
+                        },
+                        {
+                          label: '否',
+                          value: false
+                        }
+                      ] as any
+                    }
+                    placeholder="请选择是否支持转谱"
+                    onUpdateValue={async (value: any) => {
+                      if (!value) {
+                        //如果不支持,修改默认谱面
+                        // forms.scoreType = 'STAVE'
+                      }
+                    }}
+                    clearable
+                ></NSelect>
+              </NFormItem>
+              <NFormItem
+                  label="是否启用"
+                  path="status"
+                  rule={[
+                    {
+                      required: true,
+                      message: '请选择是否启用'
+                    }
+                  ]}
+              >
+                <NSelect
+                    placeholder="请选择是否启用"
+                    options={[
+                      {
+                        label: '是',
+                        value: true
+                      },
+                      {
+                        label: '否',
+                        value: false
+                      }
+                    ] as any}
+                    v-model:value={forms.status}
+                    clearable
+                />
+              </NFormItem>
+              <NFormItem
+                  label="排序值"
+                  path="sortNo"
+                  rule={[
+                    {
+                      required: true,
+                      message: '请输入排序值'
+                    }
+                  ]}
+              >
+                <NInputNumber
+                    v-model:value={forms.sortNo}
+                    placeholder="请输入排序值"
+                    clearable
+                    min={0}
+                    max={9999}
+                    style={{width: '100%'}}
+                />
+              </NFormItem>
+            </NForm>
+
+            <NSpace justify="end">
+              <NButton onClick={() => emit('close')}>取消</NButton>
+              <NButton type="primary" onClick={onSubmit}
+                       loading={btnLoading.value}
+                       disabled={btnLoading.value}
+              >
+                保存
+              </NButton>
+            </NSpace>
+          </div>
+      )
+    }
+  }
+})

+ 97 - 0
src/views/music-library/project-music-sheet/module/kt/addMusic.tsx

@@ -83,6 +83,7 @@ export default defineComponent({
       startSortNum: null as any, // 排序起始值
       projectMusicCategoryId: null as any, // 曲目分类ID
       isConvertibleScore: null as any, //是否支持转简谱
+      status: false, // 是否启用
       scoreType: null as any, //默认谱面
 
       useProjectData: [] as any, // 适用项目行数据
@@ -199,6 +200,10 @@ export default defineComponent({
           message.error('是否支持转谱不能为空')
           return
         }
+        if (item.status == null) {
+          message.error('是否启用不能为空')
+          return
+        }
         if (!item.sortNo) {
           item.sortNo = 0
         }
@@ -616,6 +621,97 @@ export default defineComponent({
           )
         }
       })
+
+      field.push({
+        title(column: any) {
+          return (
+            <NSpace>
+              是否启用
+              <NButton
+                type="primary"
+                size="small"
+                text
+                onClick={() => {
+                  dialogs.create({
+                    title: '是否启用',
+                    showIcon: false,
+                    content: () => {
+                      return h(
+                        'div',
+                        {
+                          class: 'flex flex-col justify-center items-center text-14px'
+                        },
+                        [
+                          // icon
+                          h(NSelect, {
+                            onUpdateValue(v) {
+                              state.status = v
+                            },
+                            options: [
+                              {
+                                label: '是',
+                                value: true
+                              },
+                              {
+                                label: '否',
+                                value: false
+                              }
+                            ] as any
+                          })
+                        ]
+                      )
+                    },
+                    positiveText: '确定',
+                    negativeText: '取消',
+                    onPositiveClick: () => {
+                      for (let i = 0; i < state.selectRowData.length; i++) {
+                        const item = state.selectRowData[i]
+                        item.status = state.status
+                      }
+                    }
+                  })
+                }}
+              >
+                <NIcon size={15} style="padding-left: 5px;margin-top:4px">
+                  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
+                    <path d="M2 26h28v2H2z" fill="currentColor"></path>
+                    <path
+                      d="M25.4 9c.8-.8.8-2 0-2.8l-3.6-3.6c-.8-.8-2-.8-2.8 0l-15 15V24h6.4l15-15zm-5-5L24 7.6l-3 3L17.4 7l3-3zM6 22v-3.6l10-10l3.6 3.6l-10 10H6z"
+                      fill="currentColor"
+                    ></path>
+                  </svg>
+                </NIcon>
+              </NButton>
+            </NSpace>
+          )
+        },
+        key: 'status',
+        width: 200,
+        render: (row: any) => {
+          // })
+          return (
+            <NSelect
+              value={row.status}
+              options={[
+                {
+                  label: '是',
+                  value: true
+                },
+                {
+                  label: '否',
+                  value: false
+                } as any
+              ]}
+              onUpdateValue={(value: any) => {
+                row.status = value
+              }}
+              filterable
+              clearable
+            />
+          )
+        }
+      })
+
       field.push({
         title(column: any) {
           return (
@@ -748,6 +844,7 @@ export default defineComponent({
             return row.id === next.id
           })
           if (!find) {
+            next.status = false
             state.selectRowData.push(next)
           }
         }

+ 2 - 5
src/views/music-library/project-music-sheet/module/kt/music-sheet-kt.tsx

@@ -369,15 +369,12 @@ export default defineComponent({
           }
         },
         {
-          title: '上传',
+          title: '上传时间',
           minWidth: '150px',
           key: 'composer',
           render(row: any) {
             return (
-              <NDescriptions labelPlacement="left" column={1}>
-                <NDescriptionsItem label="上传人">{row.createByName}</NDescriptionsItem>
-                <NDescriptionsItem label="上传时间">{row.createTime}</NDescriptionsItem>
-              </NDescriptions>
+              row.createTime
             )
           }
         },

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

@@ -30,6 +30,7 @@ export default defineComponent({
       sortNo: null as any,
       paymentType: null as any,
       isConvertibleScore: null as any,//是否支持转简谱
+      status: null as any, // 是否启用
       scoreType: null as any,//默认谱面
     })
     const formsRef = ref()
@@ -53,7 +54,7 @@ export default defineComponent({
       forms.paymentType = data[0].paymentType
       forms.isConvertibleScore = data[0].isConvertibleScore
       forms.scoreType = data[0].scoreType
-
+      forms.status = data[0].status
     })
 
     const onSubmit = async () => {
@@ -192,6 +193,32 @@ export default defineComponent({
                 ></NSelect>
               </NFormItem>
               <NFormItem
+                  label="是否启用"
+                  path="status"
+                  rule={[
+                    {
+                      required: true,
+                      message: '请选择是否启用'
+                    }
+                  ]}
+              >
+                <NSelect
+                    placeholder="请选择是否启用"
+                    options={[
+                      {
+                        label: '是',
+                        value: true
+                      },
+                      {
+                        label: '否',
+                        value: false
+                      }
+                    ] as any}
+                    v-model:value={forms.status}
+                    clearable
+                />
+              </NFormItem>
+              <NFormItem
                   label="排序值"
                   path="sortNo"
                   rule={[