music-list.tsx 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843
  1. import SaveForm from '@/components/save-form'
  2. import Pagination from '@/components/pagination'
  3. import {
  4. DataTableRowKey,
  5. NButton,
  6. NCascader,
  7. NDataTable,
  8. NDescriptions,
  9. NDescriptionsItem,
  10. NFormItem,
  11. NIcon,
  12. NImage,
  13. NInput,
  14. NModal,
  15. NSelect,
  16. NSpace,
  17. NTag,
  18. NTooltip,
  19. useDialog,
  20. useMessage
  21. } from 'naive-ui'
  22. import { defineComponent, onMounted, onUnmounted, reactive, ref, watch } from 'vue'
  23. import {
  24. musicSheetApplicationOwnerList,
  25. musicSheetPage,
  26. musicSheetRemove,
  27. musicSheetImg,
  28. musicSheetStatusList,
  29. musicTagPage,
  30. musicSheetCategoriesQueryTree
  31. } from '../../api'
  32. import MusicOperation from '../modal/music-operation'
  33. import { subjectPage } from '@/views/system-manage/api'
  34. import MusicPreView from '../modal/musicPreView'
  35. import UseProject from '@views/music-library/music-sheet/modal/use-project'
  36. import { getMapValueByKey } from '@/utils/filters'
  37. import { appKey, musicSheetSourceType, musicSheetType } from '@/utils/constant'
  38. import { getSelectDataFromObj } from '@/utils/objectUtil'
  39. import { sysApplicationPage } from '@views/menu-manage/api'
  40. import { getOwnerName } from '@views/music-library/musicUtil'
  41. import styles from './music-list.module.less'
  42. import MusicCreateImg from '../modal/music-create-img'
  43. import TheTooltip from '@components/TheTooltip'
  44. import { HelpCircleOutline } from '@vicons/ionicons5'
  45. export default defineComponent({
  46. name: 'music-list',
  47. props: ['searchId', 'musicCategoryId'],
  48. setup(props, { emit }) {
  49. const dialog = useDialog()
  50. const message = useMessage()
  51. const state = reactive({
  52. loading: false,
  53. pagination: {
  54. page: 1,
  55. rows: 10,
  56. pageTotal: 0
  57. },
  58. searchForm: {
  59. keyword: null,
  60. musicSheetType: null,
  61. subjectId: null, //声部ID
  62. sourceType: null, //来源类型/作者属性(PLATFORM: 平台; ORG: 机构; PERSON: 个人
  63. composer: null, //作曲人/音乐人
  64. userId: null, //所属人
  65. applicationId: null, //所属人项目ID
  66. useAppId: [] as any, //适用项目ID
  67. status: null, //曲目状态(0:停用,1:启用)
  68. appAuditFlag: null, //是否审核版本
  69. categoriesId: null, //是否审核版本
  70. musicCategoryId: null, //曲目分类
  71. dataCorrect: null // 数据修复
  72. },
  73. dataList: [] as any,
  74. subjectList: [] as any,
  75. tagList: [] as any,
  76. visiableMusic: false,
  77. musicOperation: 'add',
  78. musicData: {} as any,
  79. musicSheetCategories: [] as any,
  80. musicPreview: false,
  81. musicScore: null as any,
  82. showUseProject: false, // 适用项目
  83. useProjectData: [] as any, // 适用项目行数据
  84. showUseProjectId: null as any, // 适用项目行数据
  85. detailReadonly: false, // 新增、修改、详情是否可编辑
  86. userIdDisable: true, // 所属人
  87. userIdData: [] as any, // 所属人数据列表
  88. productOpen: false,
  89. productItem: {} as any
  90. })
  91. const columns = (): any => {
  92. return [
  93. {
  94. type: 'selection'
  95. },
  96. {
  97. title: '曲目名称',
  98. minWidth: '200px',
  99. key: 'id',
  100. render(row: any) {
  101. return (
  102. <NDescriptions labelPlacement="left" column={1}>
  103. <NDescriptionsItem label="名称">
  104. <TheTooltip content={row.name} />
  105. </NDescriptionsItem>
  106. <NDescriptionsItem label="编号">
  107. <TheTooltip content={row.id} />
  108. </NDescriptionsItem>
  109. </NDescriptions>
  110. )
  111. }
  112. },
  113. {
  114. title: '封面图',
  115. key: 'titleImg',
  116. render(row: any): JSX.Element {
  117. return <NImage width={60} height={60} src={row.musicCover} />
  118. }
  119. },
  120. {
  121. title: '曲目信息',
  122. minWidth: '200px',
  123. key: 'composer',
  124. render(row: any) {
  125. return (
  126. <NDescriptions labelPlacement="left" column={1}>
  127. <NDescriptionsItem label="音乐人">{row.composer}</NDescriptionsItem>
  128. <NDescriptionsItem label="多声轨渲染">
  129. {getMapValueByKey(row.musicSheetType, new Map(Object.entries(musicSheetType)))}
  130. </NDescriptionsItem>
  131. <NDescriptionsItem label="分类">
  132. <TheTooltip content={row.musicCategoryName} />
  133. </NDescriptionsItem>
  134. <NDescriptionsItem label="可用声部">
  135. <TheTooltip content={row.subjectNames} />
  136. </NDescriptionsItem>
  137. </NDescriptions>
  138. )
  139. }
  140. },
  141. {
  142. title: '作者属性',
  143. minWidth: '250px',
  144. key: 'sourceType',
  145. render(row: any) {
  146. return (
  147. <NDescriptions labelPlacement="left" column={1}>
  148. <NDescriptionsItem label="属性">
  149. {getMapValueByKey(row.sourceType, new Map(Object.entries(musicSheetSourceType)))}
  150. </NDescriptionsItem>
  151. <NDescriptionsItem label="所属人">
  152. {getOwnerName(row.musicSheetExtend, row.sourceType)}
  153. </NDescriptionsItem>
  154. </NDescriptions>
  155. )
  156. }
  157. },
  158. {
  159. title: '适用项目',
  160. key: 'projectName',
  161. render(row: any) {
  162. return (
  163. <NSpace>
  164. <NButton
  165. type="primary"
  166. size="small"
  167. text
  168. v-auth="musicSheetApplicationExtend/save1752901206883221506"
  169. onClick={() => {
  170. state.showUseProject = true
  171. state.showUseProjectId = row.id
  172. }}
  173. >
  174. <TheTooltip
  175. content={
  176. row.musicSheetExtend && row.musicSheetExtend.useApplicationNames
  177. ? row.musicSheetExtend.useApplicationNames
  178. : ''
  179. }
  180. />
  181. <NIcon size={15} style="padding-left: 9px">
  182. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
  183. <path d="M2 26h28v2H2z" fill="currentColor"></path>
  184. <path
  185. 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"
  186. fill="currentColor"
  187. ></path>
  188. </svg>
  189. </NIcon>
  190. </NButton>
  191. </NSpace>
  192. )
  193. }
  194. },
  195. {
  196. title: '更新信息',
  197. minWidth: '250px',
  198. key: 'updateBy',
  199. render(row: any) {
  200. return (
  201. <NDescriptions labelPlacement="left" column={1}>
  202. <NDescriptionsItem label="更新人">{row.updateByName}</NDescriptionsItem>
  203. <NDescriptionsItem label="更新时间">{row.updateTime}</NDescriptionsItem>
  204. </NDescriptions>
  205. )
  206. }
  207. },
  208. {
  209. title: '审核版本',
  210. minWidth: '100px',
  211. key: 'appAuditFlag',
  212. render(row: any) {
  213. return <div>{row.appAuditFlag ? '是' : '否'}</div>
  214. }
  215. },
  216. {
  217. title: '状态',
  218. minWidth: '50px',
  219. key: 'status',
  220. render(row: any) {
  221. return (
  222. <NTag type={row.status ? 'primary' : 'default'}>{row.status ? '启用' : '停用'}</NTag>
  223. )
  224. }
  225. },
  226. {
  227. title: '操作',
  228. key: 'operation',
  229. fixed: 'right',
  230. width: '300px',
  231. render(row: any) {
  232. return (
  233. <NSpace>
  234. <NButton
  235. type="primary"
  236. size="small"
  237. text
  238. onClick={() => {
  239. state.musicPreview = true
  240. state.musicScore = row
  241. }}
  242. >
  243. 预览
  244. </NButton>
  245. <NButton
  246. type="primary"
  247. size="small"
  248. text
  249. v-auth="musicSheet/detail1751241103201271810"
  250. onClick={() => {
  251. state.visiableMusic = true
  252. state.musicOperation = 'preview'
  253. state.musicData = row
  254. state.detailReadonly = true
  255. }}
  256. >
  257. 查看
  258. </NButton>
  259. <NButton
  260. type="primary"
  261. size="small"
  262. text
  263. v-auth="musicSheet/save1751241178962984962"
  264. onClick={() => {
  265. state.visiableMusic = true
  266. state.musicOperation = 'edit'
  267. state.musicData = row
  268. state.detailReadonly = true
  269. }}
  270. >
  271. 修改
  272. </NButton>
  273. <NButton
  274. type="primary"
  275. size="small"
  276. text
  277. v-auth="musicSheet/statusList1751241653309407234"
  278. onClick={() => onChangeStatus(row)}
  279. >
  280. {row.status ? '停用' : '启用'}
  281. </NButton>
  282. <NButton
  283. type="primary"
  284. size="small"
  285. text
  286. v-auth="musicSheet/img1751240591299051522"
  287. onClick={() => {
  288. state.productOpen = true
  289. state.productItem = row
  290. // handleAutoProduct(row)
  291. }}
  292. >
  293. 生成图片
  294. </NButton>
  295. <NButton
  296. type="primary"
  297. size="small"
  298. text
  299. disabled={!!row.status}
  300. onClick={() => onRmove(row)}
  301. v-auth="musicSheet/remove1753457445635645442"
  302. >
  303. 删除
  304. </NButton>
  305. </NSpace>
  306. )
  307. }
  308. }
  309. ]
  310. }
  311. const checkedRowKeysRef = ref<DataTableRowKey[]>([])
  312. const handleCheck = (rowKeys: DataTableRowKey[]) => {
  313. checkedRowKeysRef.value = rowKeys
  314. }
  315. const onChangeStatus = (row: any) => {
  316. const statusStr = row.status ? '停用' : '启用'
  317. dialog.warning({
  318. title: '提示',
  319. content: `是否${statusStr}?`,
  320. positiveText: '确定',
  321. negativeText: '取消',
  322. onPositiveClick: async () => {
  323. try {
  324. await musicSheetStatusList({
  325. ids: new Array(row.id),
  326. status: !row.status
  327. })
  328. getList()
  329. message.success(`${statusStr}成功`)
  330. } catch {}
  331. }
  332. })
  333. }
  334. const onBatchChangeStatus = (status: boolean) => {
  335. const length = checkedRowKeysRef.value.length
  336. if (length == 0) {
  337. message.warning('未选择数据')
  338. }
  339. const statusStr = !status ? '停用' : '启用'
  340. dialog.warning({
  341. title: '提示',
  342. content: `是否${statusStr}` + length + `条数据?`,
  343. positiveText: '确定',
  344. negativeText: '取消',
  345. onPositiveClick: async () => {
  346. try {
  347. await musicSheetStatusList({
  348. ids: checkedRowKeysRef.value,
  349. status: status
  350. })
  351. getList()
  352. message.success(`${statusStr}成功`)
  353. } catch {}
  354. }
  355. })
  356. }
  357. const updateUserIdData = async (sourceType: any) => {
  358. if (!state.searchForm.applicationId) {
  359. return
  360. }
  361. state.userIdData = []
  362. state.searchForm.userId = null
  363. if (sourceType && sourceType !== 'PLATFORM') {
  364. const { data } = await musicSheetApplicationOwnerList({
  365. page: 1,
  366. rows: 9999,
  367. sourceType: sourceType,
  368. applicationId: state.searchForm.applicationId
  369. })
  370. const temp = data.rows || []
  371. temp.forEach((next: any) => {
  372. state.userIdData.push({
  373. ...next,
  374. label: sourceType === 'PERSON' ? next.userName : next.organizationRole,
  375. value: sourceType === 'PERSON' ? next.userId : next.organizationRoleId
  376. })
  377. })
  378. }
  379. }
  380. const onRmove = (row: any): void => {
  381. dialog.warning({
  382. title: '提示',
  383. content: `删除"${row.name}",是否继续?`,
  384. positiveText: '确定',
  385. negativeText: '取消',
  386. onPositiveClick: async () => {
  387. try {
  388. await musicSheetRemove({ id: row.id })
  389. getList()
  390. message.success('删除成功')
  391. } catch {}
  392. }
  393. })
  394. }
  395. const getList = async () => {
  396. try {
  397. state.loading = true
  398. const sourceType = state.searchForm.sourceType
  399. const userId = state.searchForm.userId
  400. let search = {
  401. ...state.searchForm,
  402. useAppId: state.searchForm.useAppId
  403. ? state.searchForm.useAppId.join(',')
  404. : state.searchForm.useAppId
  405. } as any
  406. if (sourceType) {
  407. if (sourceType == 'ORG') {
  408. search.organizationRoleId = userId
  409. search.userId = null
  410. }
  411. }
  412. const { data } = await musicSheetPage({ ...state.pagination, ...search })
  413. state.pagination.pageTotal = Number(data.total)
  414. state.dataList = data.rows || []
  415. } catch {}
  416. state.loading = false
  417. }
  418. // 获取标签
  419. const getTagList = async () => {
  420. try {
  421. const { data } = await musicTagPage({ page: 1, rows: 999 })
  422. const tempList = data.rows || []
  423. tempList.forEach((item: any) => {
  424. item.label = item.name
  425. item.value = item.id
  426. })
  427. state.tagList = tempList
  428. } catch {}
  429. }
  430. // 获取分类
  431. const getMusicSheetCategorieList = async () => {
  432. try {
  433. const { data } = await musicSheetCategoriesQueryTree({})
  434. // state.musicSheetCategories = filterPointCategory(data, 'musicSheetCategoriesList')
  435. state.musicSheetCategories = data || []
  436. } catch (e) {}
  437. }
  438. // 获取声部
  439. const initSubjectList = async () => {
  440. try {
  441. const { data } = await subjectPage({ page: 1, rows: 999 })
  442. const tempList = data.rows || []
  443. tempList.forEach((item: any) => {
  444. item.label = item.name
  445. item.value = item.id + ''
  446. })
  447. state.subjectList = tempList
  448. } catch {}
  449. }
  450. // app列表
  451. const initUseAppList = async () => {
  452. try {
  453. const appKeys = Object.keys(appKey)
  454. const { data } = await sysApplicationPage({ page: 1, rows: 999 })
  455. const tempList = data.rows || []
  456. state.useProjectData = []
  457. const filter = tempList.filter((next: any) => {
  458. return appKeys.includes(next.appKey)
  459. })
  460. filter.forEach((item: any) => {
  461. state.useProjectData.push({
  462. ...item,
  463. label: item.appName,
  464. value: item.id
  465. })
  466. })
  467. } catch {}
  468. }
  469. const saveForm = ref()
  470. const onSubmit = () => {
  471. state.pagination.page = 1
  472. getList()
  473. }
  474. watch(
  475. () => props.searchId,
  476. (val) => {
  477. console.log(val, 'searchId')
  478. }
  479. )
  480. const onSearch = () => {
  481. saveForm.value?.submit()
  482. }
  483. const onBtnReset = () => {
  484. saveForm.value?.reset()
  485. }
  486. onMounted(async () => {
  487. state.loading = true
  488. // getTagList()
  489. if (props.searchId) {
  490. state.searchForm.categoriesId = props.searchId || null
  491. }
  492. if (props.musicCategoryId) {
  493. state.searchForm.musicCategoryId = props.musicCategoryId || null
  494. }
  495. initSubjectList()
  496. initUseAppList()
  497. getMusicSheetCategorieList()
  498. getList()
  499. })
  500. return () => (
  501. <div class="system-menu-container">
  502. <SaveForm
  503. ref={saveForm}
  504. model={state.searchForm}
  505. onSubmit={onSubmit}
  506. saveKey="music-list"
  507. onSetModel={(val: any) => (state.searchForm = val)}
  508. >
  509. <NFormItem label="关键词" path="keyword">
  510. <NInput
  511. placeholder="曲目编号/名称"
  512. v-model:value={state.searchForm.keyword}
  513. clearable
  514. />
  515. </NFormItem>
  516. <NFormItem label="多声轨渲染" path="musicSheetType">
  517. <NSelect
  518. placeholder="请选择多声轨渲染"
  519. v-model:value={state.searchForm.musicSheetType}
  520. options={getSelectDataFromObj(musicSheetType)}
  521. clearable
  522. />
  523. </NFormItem>
  524. <NFormItem label="曲目分类" path="musicCategoryId">
  525. <NCascader
  526. valueField="id"
  527. labelField="name"
  528. children-field="musicSheetCategoriesList"
  529. placeholder="请选择曲目分类"
  530. v-model:value={state.searchForm.musicCategoryId}
  531. options={state.musicSheetCategories}
  532. clearable
  533. />
  534. </NFormItem>
  535. <NFormItem label="可用声部" path="musicSubject">
  536. <NSelect
  537. placeholder="请选择可用声部"
  538. v-model:value={state.searchForm.subjectId}
  539. options={state.subjectList}
  540. clearable
  541. />
  542. </NFormItem>
  543. <NFormItem label="音乐人" path="composer">
  544. <NInput
  545. placeholder="请选择音乐人"
  546. v-model:value={state.searchForm.composer}
  547. clearable
  548. />
  549. </NFormItem>
  550. <NFormItem label="作者属性" path="sourceType">
  551. <NSelect
  552. placeholder="请选择作者属性"
  553. v-model:value={state.searchForm.sourceType}
  554. options={getSelectDataFromObj(musicSheetSourceType)}
  555. onUpdateValue={async (value: any) => {
  556. state.userIdData = []
  557. state.searchForm.userId = null
  558. if (value && value !== 'PLATFORM') {
  559. await updateUserIdData(value)
  560. state.userIdDisable = !state.searchForm.applicationId
  561. } else {
  562. state.userIdDisable = true
  563. }
  564. }}
  565. clearable
  566. />
  567. </NFormItem>
  568. <NFormItem label="所属项目" path="applicationId">
  569. <NSelect
  570. placeholder="请选择所属项目"
  571. v-model:value={state.searchForm.applicationId}
  572. options={state.useProjectData}
  573. clearable
  574. onUpdateValue={async (value: any) => {
  575. state.searchForm.applicationId = value
  576. if (value) {
  577. await updateUserIdData(state.searchForm.sourceType)
  578. state.userIdDisable = !(
  579. state.searchForm.sourceType && state.searchForm.sourceType !== 'PLATFORM'
  580. )
  581. } else {
  582. state.searchForm.userId = null
  583. state.userIdDisable = true
  584. state.userIdData = []
  585. }
  586. }}
  587. />
  588. </NFormItem>
  589. <NFormItem label="所属人" path="userId">
  590. {{
  591. label: () => (
  592. <div>
  593. 所属人
  594. {/*<NTooltip style={"padding-left: 10px"}>*/}
  595. {/* {{*/}
  596. {/* default: () => '请选择作者属性和项目再选择所属人',*/}
  597. {/* trigger: () => (*/}
  598. {/* <span>*/}
  599. {/* <NIcon size="20">*/}
  600. {/* <HelpCircleOutline/>*/}
  601. {/* </NIcon>*/}
  602. {/* </span>*/}
  603. {/* )*/}
  604. {/* }}*/}
  605. {/*</NTooltip>*/}
  606. </div>
  607. ),
  608. default: () => (
  609. <NSelect
  610. filterable
  611. placeholder="请选择所属人"
  612. disabled={
  613. state.userIdDisable ||
  614. (!state.searchForm.applicationId && !state.searchForm.sourceType)
  615. }
  616. v-model:value={state.searchForm.userId}
  617. options={state.userIdData}
  618. clearable
  619. ></NSelect>
  620. )
  621. }}
  622. </NFormItem>
  623. <NFormItem label="适用项目" path="useAppId">
  624. <NSelect
  625. placeholder="请选择适用项目"
  626. v-model:value={state.searchForm.useAppId}
  627. options={state.useProjectData}
  628. multiple
  629. maxTagCount={1}
  630. />
  631. </NFormItem>
  632. <NFormItem label="状态" path="status">
  633. <NSelect
  634. v-model={[state.searchForm.status, 'value']}
  635. placeholder="请选择状态"
  636. clearable
  637. options={
  638. [
  639. {
  640. label: '启用',
  641. value: true
  642. },
  643. {
  644. label: '停用',
  645. value: false
  646. }
  647. ] as any
  648. }
  649. />
  650. </NFormItem>
  651. <NFormItem label="审核版本" path="appAuditFlag">
  652. <NSelect
  653. v-model={[state.searchForm.appAuditFlag, 'value']}
  654. placeholder="请选择审核版本"
  655. clearable
  656. options={
  657. [
  658. {
  659. label: '是',
  660. value: 1
  661. },
  662. {
  663. label: '否',
  664. value: 0
  665. }
  666. ] as any
  667. }
  668. />
  669. </NFormItem>
  670. <NFormItem label="数据修复" path="dataCorrect">
  671. <NSelect
  672. v-model={[state.searchForm.dataCorrect, 'value']}
  673. placeholder="请选择数据修复"
  674. clearable
  675. options={
  676. [
  677. {
  678. label: '是',
  679. value: true
  680. },
  681. {
  682. label: '否',
  683. value: false
  684. }
  685. ] as any
  686. }
  687. />
  688. </NFormItem>
  689. <NFormItem>
  690. <NSpace>
  691. <NButton type="primary" onClick={onSearch}>
  692. 搜索
  693. </NButton>
  694. <NButton type="default" onClick={onBtnReset}>
  695. 重置
  696. </NButton>
  697. </NSpace>
  698. </NFormItem>
  699. </SaveForm>
  700. <div class={['section-container']}>
  701. <NSpace style={{ paddingBottom: '12px' }}>
  702. <NButton
  703. type="primary"
  704. v-auth="musicSheet/save1751241178962984962"
  705. onClick={() => {
  706. state.visiableMusic = true
  707. state.musicOperation = 'add'
  708. state.musicData = {}
  709. state.detailReadonly = true
  710. }}
  711. >
  712. 新增曲目
  713. </NButton>
  714. <NButton
  715. disabled={checkedRowKeysRef.value.length == 0}
  716. v-auth="musicSheet/statusList1751241653309407234"
  717. onClick={() => {
  718. onBatchChangeStatus(false)
  719. }}
  720. >
  721. 批量停用
  722. </NButton>
  723. <NButton
  724. disabled={checkedRowKeysRef.value.length == 0}
  725. v-auth="musicSheet/statusList1751241653309407234"
  726. onClick={() => {
  727. onBatchChangeStatus(true)
  728. }}
  729. >
  730. 批量启用
  731. </NButton>
  732. </NSpace>
  733. <NDataTable
  734. loading={state.loading}
  735. columns={columns()}
  736. data={state.dataList}
  737. rowKey={(row: any) => row.id}
  738. onUpdateCheckedRowKeys={handleCheck}
  739. scrollX={'1200'}
  740. ></NDataTable>
  741. <Pagination
  742. v-model:page={state.pagination.page}
  743. v-model:pageSize={state.pagination.rows}
  744. v-model:pageTotal={state.pagination.pageTotal}
  745. onList={getList}
  746. sync
  747. saveKey="music-list"
  748. ></Pagination>
  749. </div>
  750. <NModal
  751. v-model:show={state.visiableMusic}
  752. preset="dialog"
  753. showIcon={false}
  754. maskClosable={false}
  755. title={() => {
  756. if (state.musicOperation === 'add') {
  757. return '添加曲目'
  758. } else if (state.musicOperation === 'preview') {
  759. return '曲目详情'
  760. }
  761. return '修改曲目'
  762. }}
  763. style={{ width: '980px' }}
  764. >
  765. <MusicOperation
  766. type={state.musicOperation}
  767. data={state.musicData}
  768. subjectList={state.subjectList}
  769. // musicSheetCategories={state.musicSheetCategories}
  770. // tagList={state.tagList}
  771. onClose={() => (state.visiableMusic = false)}
  772. onGetList={getList}
  773. />
  774. </NModal>
  775. <NModal
  776. blockScroll={true}
  777. v-model:show={state.musicPreview}
  778. preset="dialog"
  779. showIcon={false}
  780. title={'曲目预览'}
  781. style={{ width: 'auto' }}
  782. >
  783. <MusicPreView item={state.musicScore} isMove={1} />
  784. </NModal>
  785. <NModal
  786. blockScroll={true}
  787. v-model:show={state.showUseProject}
  788. preset="dialog"
  789. showIcon={false}
  790. title={'适用项目'}
  791. style={{ width: '500px' }}
  792. >
  793. <UseProject
  794. id={state.showUseProjectId}
  795. useProject={state.useProjectData}
  796. onClose={() => (state.showUseProject = false)}
  797. onGetList={getList}
  798. />
  799. </NModal>
  800. <NModal
  801. class={styles.productModal}
  802. title="自动生成曲谱图片"
  803. v-model:show={state.productOpen}
  804. preset="dialog"
  805. closeOnEsc={false}
  806. maskClosable={false}
  807. showIcon={false}
  808. >
  809. <MusicCreateImg
  810. xmlFileUrl={state.productItem.xmlFileUrl}
  811. onClose={() => (state.productOpen = false)}
  812. onConfirm={async (item: any) => {
  813. try {
  814. await musicSheetImg({
  815. ...item,
  816. id: state.productItem.id
  817. })
  818. } catch {}
  819. }}
  820. />
  821. </NModal>
  822. </div>
  823. )
  824. }
  825. })