|
@@ -2,8 +2,11 @@ import SaveForm from '@/components/save-form'
|
|
|
import Pagination from '@/components/pagination'
|
|
|
import {
|
|
|
DataTableRowKey,
|
|
|
- NButton, NCascader,
|
|
|
- NDataTable, NDescriptions, NDescriptionsItem,
|
|
|
+ NButton,
|
|
|
+ NCascader,
|
|
|
+ NDataTable,
|
|
|
+ NDescriptions,
|
|
|
+ NDescriptionsItem,
|
|
|
NFormItem,
|
|
|
NIcon,
|
|
|
NImage,
|
|
@@ -16,33 +19,34 @@ import {
|
|
|
useDialog,
|
|
|
useMessage
|
|
|
} from 'naive-ui'
|
|
|
-import {defineComponent, onMounted, onUnmounted, reactive, ref, watch} from 'vue'
|
|
|
+import { defineComponent, onMounted, onUnmounted, reactive, ref, watch } from 'vue'
|
|
|
import {
|
|
|
musicSheetApplicationOwnerList,
|
|
|
musicSheetPage,
|
|
|
musicSheetRemove,
|
|
|
musicSheetImg,
|
|
|
musicSheetStatusList,
|
|
|
- musicTagPage, musicSheetCategoriesQueryTree
|
|
|
+ musicTagPage,
|
|
|
+ musicSheetCategoriesQueryTree
|
|
|
} from '../../api'
|
|
|
import MusicOperation from '../modal/music-operation'
|
|
|
-import {subjectPage} from '@/views/system-manage/api'
|
|
|
+import { subjectPage } from '@/views/system-manage/api'
|
|
|
import MusicPreView from '../modal/musicPreView'
|
|
|
import UseProject from '@views/music-library/music-sheet/modal/use-project'
|
|
|
-import {getMapValueByKey} from '@/utils/filters'
|
|
|
-import {appKey, musicSheetSourceType, musicSheetType} from '@/utils/constant'
|
|
|
-import {getSelectDataFromObj} from '@/utils/objectUtil'
|
|
|
-import {sysApplicationPage} from '@views/menu-manage/api'
|
|
|
-import {getOwnerName} from '@views/music-library/musicUtil'
|
|
|
+import { getMapValueByKey } from '@/utils/filters'
|
|
|
+import { appKey, musicSheetSourceType, musicSheetType } from '@/utils/constant'
|
|
|
+import { getSelectDataFromObj } from '@/utils/objectUtil'
|
|
|
+import { sysApplicationPage } from '@views/menu-manage/api'
|
|
|
+import { getOwnerName } from '@views/music-library/musicUtil'
|
|
|
import styles from './music-list.module.less'
|
|
|
import MusicCreateImg from '../modal/music-create-img'
|
|
|
-import TheTooltip from "@components/TheTooltip";
|
|
|
+import TheTooltip from '@components/TheTooltip'
|
|
|
import { HelpCircleOutline } from '@vicons/ionicons5'
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'music-list',
|
|
|
props: ['searchId', 'musicCategoryId'],
|
|
|
- setup(props, {emit}) {
|
|
|
+ setup(props, { emit }) {
|
|
|
const dialog = useDialog()
|
|
|
const message = useMessage()
|
|
|
const state = reactive({
|
|
@@ -96,12 +100,14 @@ export default defineComponent({
|
|
|
key: 'id',
|
|
|
render(row: any) {
|
|
|
return (
|
|
|
- <NDescriptions labelPlacement="left" column={1}>
|
|
|
- <NDescriptionsItem label="名称">
|
|
|
- <TheTooltip content={row.name}/>
|
|
|
- </NDescriptionsItem>
|
|
|
- <NDescriptionsItem label="编号"><TheTooltip content={row.id}/></NDescriptionsItem>
|
|
|
- </NDescriptions>
|
|
|
+ <NDescriptions labelPlacement="left" column={1}>
|
|
|
+ <NDescriptionsItem label="名称">
|
|
|
+ <TheTooltip content={row.name} />
|
|
|
+ </NDescriptionsItem>
|
|
|
+ <NDescriptionsItem label="编号">
|
|
|
+ <TheTooltip content={row.id} />
|
|
|
+ </NDescriptionsItem>
|
|
|
+ </NDescriptions>
|
|
|
)
|
|
|
}
|
|
|
},
|
|
@@ -109,7 +115,7 @@ export default defineComponent({
|
|
|
title: '封面图',
|
|
|
key: 'titleImg',
|
|
|
render(row: any): JSX.Element {
|
|
|
- return <NImage width={60} height={60} src={row.musicCover}/>
|
|
|
+ return <NImage width={60} height={60} src={row.musicCover} />
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -118,12 +124,18 @@ export default defineComponent({
|
|
|
key: 'composer',
|
|
|
render(row: any) {
|
|
|
return (
|
|
|
- <NDescriptions labelPlacement="left" column={1}>
|
|
|
- <NDescriptionsItem label="音乐人">{row.composer}</NDescriptionsItem>
|
|
|
- <NDescriptionsItem label="多声轨渲染">{getMapValueByKey(row.musicSheetType, new Map(Object.entries(musicSheetType)))}</NDescriptionsItem>
|
|
|
- <NDescriptionsItem label="分类"><TheTooltip content={row.musicCategoryName}/></NDescriptionsItem>
|
|
|
- <NDescriptionsItem label="可用声部"><TheTooltip content={row.subjectNames}/></NDescriptionsItem>
|
|
|
- </NDescriptions>
|
|
|
+ <NDescriptions labelPlacement="left" column={1}>
|
|
|
+ <NDescriptionsItem label="音乐人">{row.composer}</NDescriptionsItem>
|
|
|
+ <NDescriptionsItem label="多声轨渲染">
|
|
|
+ {getMapValueByKey(row.musicSheetType, new Map(Object.entries(musicSheetType)))}
|
|
|
+ </NDescriptionsItem>
|
|
|
+ <NDescriptionsItem label="分类">
|
|
|
+ <TheTooltip content={row.musicCategoryName} />
|
|
|
+ </NDescriptionsItem>
|
|
|
+ <NDescriptionsItem label="可用声部">
|
|
|
+ <TheTooltip content={row.subjectNames} />
|
|
|
+ </NDescriptionsItem>
|
|
|
+ </NDescriptions>
|
|
|
)
|
|
|
}
|
|
|
},
|
|
@@ -133,10 +145,14 @@ export default defineComponent({
|
|
|
key: 'sourceType',
|
|
|
render(row: any) {
|
|
|
return (
|
|
|
- <NDescriptions labelPlacement="left" column={1}>
|
|
|
- <NDescriptionsItem label="属性">{getMapValueByKey(row.sourceType, new Map(Object.entries(musicSheetSourceType)))}</NDescriptionsItem>
|
|
|
- <NDescriptionsItem label="所属人">{getOwnerName(row.musicSheetExtend, row.sourceType)}</NDescriptionsItem>
|
|
|
- </NDescriptions>
|
|
|
+ <NDescriptions labelPlacement="left" column={1}>
|
|
|
+ <NDescriptionsItem label="属性">
|
|
|
+ {getMapValueByKey(row.sourceType, new Map(Object.entries(musicSheetSourceType)))}
|
|
|
+ </NDescriptionsItem>
|
|
|
+ <NDescriptionsItem label="所属人">
|
|
|
+ {getOwnerName(row.musicSheetExtend, row.sourceType)}
|
|
|
+ </NDescriptionsItem>
|
|
|
+ </NDescriptions>
|
|
|
)
|
|
|
}
|
|
|
},
|
|
@@ -156,9 +172,13 @@ export default defineComponent({
|
|
|
state.showUseProjectId = row.id
|
|
|
}}
|
|
|
>
|
|
|
- <TheTooltip content={row.musicSheetExtend && row.musicSheetExtend.useApplicationNames
|
|
|
- ? row.musicSheetExtend.useApplicationNames
|
|
|
- : ''}/>
|
|
|
+ <TheTooltip
|
|
|
+ content={
|
|
|
+ row.musicSheetExtend && row.musicSheetExtend.useApplicationNames
|
|
|
+ ? row.musicSheetExtend.useApplicationNames
|
|
|
+ : ''
|
|
|
+ }
|
|
|
+ />
|
|
|
<NIcon size={15} style="padding-left: 9px">
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
|
|
|
<path d="M2 26h28v2H2z" fill="currentColor"></path>
|
|
@@ -179,10 +199,10 @@ export default defineComponent({
|
|
|
key: 'updateBy',
|
|
|
render(row: any) {
|
|
|
return (
|
|
|
- <NDescriptions labelPlacement="left" column={1}>
|
|
|
- <NDescriptionsItem label="更新人">{row.updateByName}</NDescriptionsItem>
|
|
|
- <NDescriptionsItem label="更新时间">{row.updateTime}</NDescriptionsItem>
|
|
|
- </NDescriptions>
|
|
|
+ <NDescriptions labelPlacement="left" column={1}>
|
|
|
+ <NDescriptionsItem label="更新人">{row.updateByName}</NDescriptionsItem>
|
|
|
+ <NDescriptionsItem label="更新时间">{row.updateTime}</NDescriptionsItem>
|
|
|
+ </NDescriptions>
|
|
|
)
|
|
|
}
|
|
|
},
|
|
@@ -200,7 +220,7 @@ export default defineComponent({
|
|
|
key: 'status',
|
|
|
render(row: any) {
|
|
|
return (
|
|
|
- <NTag type={row.status ? 'primary' : 'default'}>{row.status ? '启用' : '停用'}</NTag>
|
|
|
+ <NTag type={row.status ? 'primary' : 'default'}>{row.status ? '启用' : '停用'}</NTag>
|
|
|
)
|
|
|
}
|
|
|
},
|
|
@@ -279,7 +299,7 @@ export default defineComponent({
|
|
|
text
|
|
|
disabled={!!row.status}
|
|
|
onClick={() => onRmove(row)}
|
|
|
- v-auth="musicSheet/save1751241178962984962"
|
|
|
+ v-auth="musicSheet/remove1753457445635645442"
|
|
|
>
|
|
|
删除
|
|
|
</NButton>
|
|
@@ -381,11 +401,13 @@ export default defineComponent({
|
|
|
const getList = async () => {
|
|
|
try {
|
|
|
state.loading = true
|
|
|
- const sourceType = state.searchForm.sourceType;
|
|
|
+ const sourceType = state.searchForm.sourceType
|
|
|
const userId = state.searchForm.userId
|
|
|
let search = {
|
|
|
...state.searchForm,
|
|
|
- useAppId: state.searchForm.useAppId ? state.searchForm.useAppId.join(',') : state.searchForm.useAppId
|
|
|
+ useAppId: state.searchForm.useAppId
|
|
|
+ ? state.searchForm.useAppId.join(',')
|
|
|
+ : state.searchForm.useAppId
|
|
|
} as any
|
|
|
if (sourceType) {
|
|
|
if (sourceType == 'ORG') {
|
|
@@ -393,7 +415,7 @@ export default defineComponent({
|
|
|
search.userId = null
|
|
|
}
|
|
|
}
|
|
|
- const { data } = await musicSheetPage({ ...state.pagination, ...search})
|
|
|
+ const { data } = await musicSheetPage({ ...state.pagination, ...search })
|
|
|
state.pagination.pageTotal = Number(data.total)
|
|
|
state.dataList = data.rows || []
|
|
|
} catch {}
|
|
@@ -559,64 +581,66 @@ export default defineComponent({
|
|
|
</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 = []
|
|
|
- }
|
|
|
- }}
|
|
|
+ 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="userId">
|
|
|
{{
|
|
|
- label: () =>
|
|
|
- <div>
|
|
|
- 所属人
|
|
|
- {/*<NTooltip style={"padding-left: 10px"}>*/}
|
|
|
- {/* {{*/}
|
|
|
- {/* default: () => '请选择作者属性和项目再选择所属人',*/}
|
|
|
- {/* trigger: () => (*/}
|
|
|
- {/* <span>*/}
|
|
|
- {/* <NIcon size="20">*/}
|
|
|
- {/* <HelpCircleOutline/>*/}
|
|
|
- {/* </NIcon>*/}
|
|
|
- {/* </span>*/}
|
|
|
- {/* )*/}
|
|
|
- {/* }}*/}
|
|
|
- {/*</NTooltip>*/}
|
|
|
- </div>
|
|
|
- ,
|
|
|
+ label: () => (
|
|
|
+ <div>
|
|
|
+ 所属人
|
|
|
+ {/*<NTooltip style={"padding-left: 10px"}>*/}
|
|
|
+ {/* {{*/}
|
|
|
+ {/* default: () => '请选择作者属性和项目再选择所属人',*/}
|
|
|
+ {/* trigger: () => (*/}
|
|
|
+ {/* <span>*/}
|
|
|
+ {/* <NIcon size="20">*/}
|
|
|
+ {/* <HelpCircleOutline/>*/}
|
|
|
+ {/* </NIcon>*/}
|
|
|
+ {/* </span>*/}
|
|
|
+ {/* )*/}
|
|
|
+ {/* }}*/}
|
|
|
+ {/*</NTooltip>*/}
|
|
|
+ </div>
|
|
|
+ ),
|
|
|
default: () => (
|
|
|
- <NSelect
|
|
|
- filterable
|
|
|
- placeholder="请选择所属人"
|
|
|
- disabled={state.userIdDisable || (!state.searchForm.applicationId && !state.searchForm.sourceType)}
|
|
|
- v-model:value={state.searchForm.userId}
|
|
|
- options={state.userIdData}
|
|
|
- clearable
|
|
|
- ></NSelect>
|
|
|
+ <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 label="适用项目" path="useAppId">
|
|
|
<NSelect
|
|
|
- placeholder="请选择适用项目"
|
|
|
- v-model:value={state.searchForm.useAppId}
|
|
|
- options={state.useProjectData}
|
|
|
- multiple
|
|
|
- maxTagCount={1}
|
|
|
+ placeholder="请选择适用项目"
|
|
|
+ v-model:value={state.searchForm.useAppId}
|
|
|
+ options={state.useProjectData}
|
|
|
+ multiple
|
|
|
+ maxTagCount={1}
|
|
|
/>
|
|
|
</NFormItem>
|
|
|
<NFormItem label="状态" path="status">
|
|
@@ -752,7 +776,7 @@ export default defineComponent({
|
|
|
title={'曲目预览'}
|
|
|
style={{ width: 'auto' }}
|
|
|
>
|
|
|
- <MusicPreView item={state.musicScore} isMove={1}/>
|
|
|
+ <MusicPreView item={state.musicScore} isMove={1} />
|
|
|
</NModal>
|
|
|
|
|
|
<NModal
|