|  | @@ -1,15 +1,32 @@
 | 
	
		
			
				|  |  |  import Pagination from '@/components/pagination'
 | 
	
		
			
				|  |  |  import SaveForm from '@/components/save-form'
 | 
	
		
			
				|  |  |  import { musicSheetPage, musicTagPage } from '@/views/content-manage/api'
 | 
	
		
			
				|  |  | -import {subjectPage} from '@/views/system-manage/api'
 | 
	
		
			
				|  |  | -import {NButton, NImage, NSpace, NTag, NDataTable, NFormItem, NInput, NSelect, NCascader} from 'naive-ui'
 | 
	
		
			
				|  |  | +import { subjectPage, sysApplicationPage } from '@/views/system-manage/api'
 | 
	
		
			
				|  |  | +import {
 | 
	
		
			
				|  |  | +  NButton,
 | 
	
		
			
				|  |  | +  NImage,
 | 
	
		
			
				|  |  | +  NSpace,
 | 
	
		
			
				|  |  | +  NTag,
 | 
	
		
			
				|  |  | +  NDataTable,
 | 
	
		
			
				|  |  | +  NFormItem,
 | 
	
		
			
				|  |  | +  NInput,
 | 
	
		
			
				|  |  | +  NSelect,
 | 
	
		
			
				|  |  | +  NCascader
 | 
	
		
			
				|  |  | +} from 'naive-ui'
 | 
	
		
			
				|  |  |  import { defineComponent, onMounted, reactive, ref } from 'vue'
 | 
	
		
			
				|  |  | -import { accompanimentTypeArray, audioTypeArray } from '@/utils/searchArray'
 | 
	
		
			
				|  |  |  import styles from './index.module.less'
 | 
	
		
			
				|  |  | -import {musicSheetCategoriesQueryTree} from "@views/music-library/api";
 | 
	
		
			
				|  |  | +import { musicSheetCategoriesQueryTree } from '@views/music-library/api'
 | 
	
		
			
				|  |  | +import { appKey } from '@/utils/constant'
 | 
	
		
			
				|  |  | +import TheTooltip from '@/components/TheTooltip'
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  export default defineComponent({
 | 
	
		
			
				|  |  |    name: 'selectMusicSheet',
 | 
	
		
			
				|  |  | +  props: {
 | 
	
		
			
				|  |  | +    type: {
 | 
	
		
			
				|  |  | +      type: String,
 | 
	
		
			
				|  |  | +      default: 'upload'
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +  },
 | 
	
		
			
				|  |  |    emits: ['select'],
 | 
	
		
			
				|  |  |    setup(props, { emit }) {
 | 
	
		
			
				|  |  |      const state = reactive({
 | 
	
	
		
			
				|  | @@ -26,11 +43,13 @@ export default defineComponent({
 | 
	
		
			
				|  |  |          // playMode: null,
 | 
	
		
			
				|  |  |          // accompanimentType: null,
 | 
	
		
			
				|  |  |          status: null,
 | 
	
		
			
				|  |  | -        topFlag: null
 | 
	
		
			
				|  |  | +        topFlag: null,
 | 
	
		
			
				|  |  | +        useAppId: [] as any
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  |        dataList: [] as any,
 | 
	
		
			
				|  |  |        subjectList: [] as any,
 | 
	
		
			
				|  |  |        musicSheetCategories: [] as any,
 | 
	
		
			
				|  |  | +      useProjectData: [] as any, // 适用项目行数据
 | 
	
		
			
				|  |  |        visiableMusic: false,
 | 
	
		
			
				|  |  |        musicOperation: 'add',
 | 
	
		
			
				|  |  |        musicData: {} as any
 | 
	
	
		
			
				|  | @@ -46,6 +65,31 @@ export default defineComponent({
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  |          },
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  | +          title: '适用项目',
 | 
	
		
			
				|  |  | +          key: 'musicSheetExtend.useApplicationNames',
 | 
	
		
			
				|  |  | +          redner(row: any) {
 | 
	
		
			
				|  |  | +            return (
 | 
	
		
			
				|  |  | +              <TheTooltip
 | 
	
		
			
				|  |  | +                content={
 | 
	
		
			
				|  |  | +                  row.musicSheetExtend && row.musicSheetExtend.useApplicationNames
 | 
	
		
			
				|  |  | +                    ? row.musicSheetExtend.useApplicationNames
 | 
	
		
			
				|  |  | +                    : ''
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +              />
 | 
	
		
			
				|  |  | +            )
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        },
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +          title: '状态',
 | 
	
		
			
				|  |  | +          minWidth: '50px',
 | 
	
		
			
				|  |  | +          key: 'status',
 | 
	
		
			
				|  |  | +          render(row: any) {
 | 
	
		
			
				|  |  | +            return (
 | 
	
		
			
				|  |  | +              <NTag type={row.status ? 'primary' : 'default'}>{row.status ? '启用' : '停用'}</NTag>
 | 
	
		
			
				|  |  | +            )
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        },
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  |            title: '曲目封面',
 | 
	
		
			
				|  |  |            key: 'musicCover',
 | 
	
		
			
				|  |  |            render(row: any) {
 | 
	
	
		
			
				|  | @@ -67,7 +111,7 @@ export default defineComponent({
 | 
	
		
			
				|  |  |            title: '可用声部',
 | 
	
		
			
				|  |  |            key: 'subjectNames',
 | 
	
		
			
				|  |  |            render(row: any) {
 | 
	
		
			
				|  |  | -            return <NTag type="primary">{row.subjectNames}</NTag>
 | 
	
		
			
				|  |  | +            return <TheTooltip content={row.subjectNames} />
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  |          },
 | 
	
		
			
				|  |  |          {
 | 
	
	
		
			
				|  | @@ -82,19 +126,6 @@ export default defineComponent({
 | 
	
		
			
				|  |  |              )
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  |          },
 | 
	
		
			
				|  |  | -        // {
 | 
	
		
			
				|  |  | -        //   title: '能否转简谱',
 | 
	
		
			
				|  |  | -        //   key: 'notation',
 | 
	
		
			
				|  |  | -        //   render(row: any) {
 | 
	
		
			
				|  |  | -        //     return (
 | 
	
		
			
				|  |  | -        //       <NTag type={row.notation ? 'primary' : 'default'}>{row.notation ? '是' : '否'}</NTag>
 | 
	
		
			
				|  |  | -        //     )
 | 
	
		
			
				|  |  | -        //   }
 | 
	
		
			
				|  |  | -        // },
 | 
	
		
			
				|  |  | -        // {
 | 
	
		
			
				|  |  | -        //   title: '排序',
 | 
	
		
			
				|  |  | -        //   key: 'sortNumber'
 | 
	
		
			
				|  |  | -        // },
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |            title: '操作',
 | 
	
		
			
				|  |  |            key: 'operation',
 | 
	
	
		
			
				|  | @@ -118,7 +149,10 @@ export default defineComponent({
 | 
	
		
			
				|  |  |            page: state.pagination.page,
 | 
	
		
			
				|  |  |            rows: state.pagination.rows,
 | 
	
		
			
				|  |  |            ...state.searchForm,
 | 
	
		
			
				|  |  | -          status: 1
 | 
	
		
			
				|  |  | +          useAppId: state.searchForm.useAppId
 | 
	
		
			
				|  |  | +            ? state.searchForm.useAppId.join(',')
 | 
	
		
			
				|  |  | +            : state.searchForm.useAppId,
 | 
	
		
			
				|  |  | +          status: props.type === 'upload' ? 1 : null
 | 
	
		
			
				|  |  |          })
 | 
	
		
			
				|  |  |          state.loading = false
 | 
	
		
			
				|  |  |          state.pagination.pageTotal = Number(data.total)
 | 
	
	
		
			
				|  | @@ -128,6 +162,26 @@ export default defineComponent({
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    // app列表
 | 
	
		
			
				|  |  | +    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 getTagList = async () => {
 | 
	
		
			
				|  |  |        try {
 | 
	
	
		
			
				|  | @@ -165,6 +219,7 @@ export default defineComponent({
 | 
	
		
			
				|  |  |      onMounted(() => {
 | 
	
		
			
				|  |  |        getTagList()
 | 
	
		
			
				|  |  |        getSubjectList()
 | 
	
		
			
				|  |  | +      initUseAppList()
 | 
	
		
			
				|  |  |        getList()
 | 
	
		
			
				|  |  |      })
 | 
	
		
			
				|  |  |      return () => (
 | 
	
	
		
			
				|  | @@ -185,13 +240,13 @@ export default defineComponent({
 | 
	
		
			
				|  |  |            </NFormItem>
 | 
	
		
			
				|  |  |            <NFormItem label="曲目分类" path="musicCategoryId">
 | 
	
		
			
				|  |  |              <NCascader
 | 
	
		
			
				|  |  | -                valueField="id"
 | 
	
		
			
				|  |  | -                labelField="name"
 | 
	
		
			
				|  |  | -                children-field="musicSheetCategoriesList"
 | 
	
		
			
				|  |  | -                placeholder="请选择曲目分类"
 | 
	
		
			
				|  |  | -                v-model:value={state.searchForm.musicCategoryId}
 | 
	
		
			
				|  |  | -                options={state.musicSheetCategories}
 | 
	
		
			
				|  |  | -                clearable
 | 
	
		
			
				|  |  | +              valueField="id"
 | 
	
		
			
				|  |  | +              labelField="name"
 | 
	
		
			
				|  |  | +              children-field="musicSheetCategoriesList"
 | 
	
		
			
				|  |  | +              placeholder="请选择曲目分类"
 | 
	
		
			
				|  |  | +              v-model:value={state.searchForm.musicCategoryId}
 | 
	
		
			
				|  |  | +              options={state.musicSheetCategories}
 | 
	
		
			
				|  |  | +              clearable
 | 
	
		
			
				|  |  |              />
 | 
	
		
			
				|  |  |            </NFormItem>
 | 
	
		
			
				|  |  |            <NFormItem label="声部" path="musicSubject">
 | 
	
	
		
			
				|  | @@ -202,22 +257,17 @@ export default defineComponent({
 | 
	
		
			
				|  |  |                clearable
 | 
	
		
			
				|  |  |              />
 | 
	
		
			
				|  |  |            </NFormItem>
 | 
	
		
			
				|  |  | -          {/*<NFormItem label="播放类型" path="playMode">*/}
 | 
	
		
			
				|  |  | -          {/*  <NSelect*/}
 | 
	
		
			
				|  |  | -          {/*    placeholder="请选择播放类型"*/}
 | 
	
		
			
				|  |  | -          {/*    v-model:value={state.searchForm.playMode}*/}
 | 
	
		
			
				|  |  | -          {/*    options={audioTypeArray}*/}
 | 
	
		
			
				|  |  | -          {/*    clearable*/}
 | 
	
		
			
				|  |  | -          {/*  />*/}
 | 
	
		
			
				|  |  | -          {/*</NFormItem>*/}
 | 
	
		
			
				|  |  | -          {/*<NFormItem label="伴奏类型" path="accompanimentType">*/}
 | 
	
		
			
				|  |  | -          {/*  <NSelect*/}
 | 
	
		
			
				|  |  | -          {/*    placeholder="请选择伴奏类型"*/}
 | 
	
		
			
				|  |  | -          {/*    v-model:value={state.searchForm.accompanimentType}*/}
 | 
	
		
			
				|  |  | -          {/*    options={accompanimentTypeArray}*/}
 | 
	
		
			
				|  |  | -          {/*    clearable*/}
 | 
	
		
			
				|  |  | -          {/*  />*/}
 | 
	
		
			
				|  |  | -          {/*</NFormItem>*/}
 | 
	
		
			
				|  |  | +          <NFormItem label="适用项目" path="useAppId">
 | 
	
		
			
				|  |  | +            <NSelect
 | 
	
		
			
				|  |  | +              placeholder="请选择适用项目"
 | 
	
		
			
				|  |  | +              v-model:value={state.searchForm.useAppId}
 | 
	
		
			
				|  |  | +              options={state.useProjectData}
 | 
	
		
			
				|  |  | +              multiple
 | 
	
		
			
				|  |  | +              maxTagCount={1}
 | 
	
		
			
				|  |  | +              clearable
 | 
	
		
			
				|  |  | +              filterable
 | 
	
		
			
				|  |  | +            />
 | 
	
		
			
				|  |  | +          </NFormItem>
 | 
	
		
			
				|  |  |            <NFormItem>
 | 
	
		
			
				|  |  |              <NSpace>
 | 
	
		
			
				|  |  |                <NButton type="primary" onClick={onSearch}>
 |