}
},
{
title: '曲目名称',
key: 'name'
},
{
title: '音乐人',
key: 'composer'
},
{
title: '多声轨渲染',
key: 'musicSheetType',
render: (row: any) => {
return (
{getMapValueByKey(row.musicSheetType, new Map(Object.entries(musicSheetType)))}
)
}
},
{
title: '曲目来源',
key: 'sourceType',
render(row: any) {
return getMapValueByKey(row.sourceType, new Map(Object.entries(musicSheetSourceType)))
}
},
{
title: '所属人',
key: 'userName',
render: (row: any) => {
return
}
}
]
const columns = (): any => {
return columnsField
}
const stepColumns = (): DataTableColumns => {
const field = deepClone(columnsField)
field.splice(0, 1)
field.push({
title(column: any) {
return (
乐谱教材
{
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: '请选择乐谱教材',
options: state.musicSheetCategories
})
]
)
},
positiveText: '确定',
negativeText: '取消',
onPositiveClick: () => {
for (let i = 0; i < state.selectRowData.length; i++) {
const item = state.selectRowData[i]
item.projectMusicCategoryId = state.projectMusicCategoryId
}
}
})
}}
>
)
},
key: 'projectMusicCategoryId',
fixed: 'right',
width: 200,
render: (row: any) => {
// })
return (
{
row.projectMusicCategoryId = value
}}
clearable
/>
)
}
})
field.push({
title(column: any) {
return (
排序
{
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.startSortNum = v
},
min: 0,
max: 9999
})
]
)
},
positiveText: '确定',
negativeText: '取消',
onPositiveClick: () => {
if (state.startSortNum) {
for (let i = 0; i < state.selectRowData.length; i++) {
const item = state.selectRowData[i]
item.sortNo = state.startSortNum + i
}
}
}
})
}}
>
)
},
key: 'sortNo',
fixed: 'right',
width: 150,
render: (row: any) => {
return h(NInputNumber, {
value: row.sortNo,
min: 0,
max: 9999,
defaultValue: 0,
onUpdateValue(value: any) {
row.sortNo = value
}
})
}
})
field.push({
title: '操作',
key: 'operation',
fixed: 'right',
render(row: any) {
return (
{
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 {}
}
})
}}
>
移除
)
}
})
return field
}
const checkedRowKeysRef = ref([])
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)
}
}
})
// 去掉行更新值
state.selectRowData = state.selectRowData.filter((next: any) => {
return checkedRowKeysRef.value.includes(next.id)
})
}
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
})
})
}
}
return () => {
return (
)
}
}
})