music-sheet-klx.tsx 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813
  1. import { defineComponent, onMounted, reactive, ref } from 'vue'
  2. import SaveForm from '@components/save-form'
  3. import {
  4. DataTableRowKey,
  5. NButton,
  6. NDataTable,
  7. NDatePicker,
  8. NDescriptions,
  9. NDescriptionsItem,
  10. NFormItem,
  11. NImage,
  12. NInput,
  13. NModal,
  14. NSelect,
  15. NSpace,
  16. NTag,
  17. useDialog,
  18. useMessage
  19. } from 'naive-ui'
  20. import Pagination from '@components/pagination'
  21. import TheTooltip from '@components/TheTooltip'
  22. import AddMusic from '@views/music-library/project-music-sheet/module/klx/addMusic'
  23. import { getMapValueByKey, getSelectDataFromObj } from '@/utils/objectUtil'
  24. import {
  25. appKey,
  26. musicSheetAudioType,
  27. musicSheetAvailableType,
  28. musicSheetPaymentType,
  29. musicSheetSourceType,
  30. musicSheetType
  31. } from '@/utils/constant'
  32. import {
  33. musicSheetApplicationExtendDel,
  34. musicSheetApplicationExtendStatus,
  35. musicSheetApplicationExtendTagList,
  36. musicSheetApplicationOwnerList,
  37. musicSheetPageByApplication
  38. } from '@views/music-library/api'
  39. import {
  40. musicSheetApplicationExtendSubjectList,
  41. sysApplicationPage
  42. } from '@views/system-manage/api'
  43. import { filterTimes } from '@/utils/dateUtil'
  44. import deepClone from '@/utils/deep.clone'
  45. import { copyText, getOwnerName } from '@views/music-library/musicUtil'
  46. import UpdateMusic from '@views/music-library/project-music-sheet/module/klx/updateMusic'
  47. import MusicPreView from '@views/music-library/music-sheet/modal/musicPreView'
  48. import styles from "../index.module.less"
  49. export default defineComponent({
  50. name: 'music-sheet-KLX',
  51. props: {
  52. appKey: {
  53. type: String,
  54. default: 'KLX'
  55. }
  56. },
  57. setup(props) {
  58. const dialog = useDialog()
  59. const message = useMessage()
  60. const state = reactive({
  61. loading: false,
  62. appId: null as any,
  63. pagination: {
  64. page: 1,
  65. rows: 10,
  66. pageTotal: 0
  67. },
  68. searchForm: {
  69. keyword: null,
  70. // musicSheetType: null, //曲目类型(SINGLE:单曲 CONCERT:合奏)
  71. subjectId: null, //声部ID
  72. subjectIds: null, //曲目声部ID集合
  73. clientStatus: null, //曲目状态(0:停用,1:启用)
  74. status: null,
  75. sourceType: null, //来源类型/作者属性(PLATFORM: 平台; ORG: 机构; PERSON: 个人)
  76. paymentType: null, //收费类型(FREE:免费;VIP:会员;CHARGE:单曲收费)
  77. userId: null, //所属人
  78. musicCategoryId: null, //曲目分类ID
  79. times: null, // 上传时间
  80. audioType: null, //音频类型(HOMEMODE: 自制 COMMON: 普通)
  81. exquisiteFlag: null, //精品标志
  82. topFlag: null, //是否置顶(0:否;1:是)
  83. availableType: null, //可用途径 ORG 机构 PLATFORM 平台
  84. appAuditFlag: null, //是否审核版本
  85. detailFlag: null, //是否查询详情
  86. musicTagIds: [] as any, //曲目标签
  87. applicationId: null, //所属人项目ID
  88. extendApplicationId: null //所属人项目ID
  89. },
  90. subjectList: [],
  91. dataList: [] as any[],
  92. showAddDialog: false,
  93. showEditDialog: false,
  94. userIdDisable: true,
  95. userIdData: [] as any,
  96. updateRow: {} as any, // 修改选择的行
  97. musicTagList: [] as any, //曲目标签
  98. applicationId: null, //应用ID
  99. musicPreview: false,
  100. musicPreviewScoreType: 'staff', // 预览谱面类型
  101. musicScore: null as any,
  102. useProjectData: [] as any // 适用项目行数据
  103. })
  104. onMounted(async () => {
  105. state.loading = true
  106. // 获取应用APP信息
  107. try {
  108. const { data } = await sysApplicationPage({ page: 1, rows: 1, appKey: props.appKey })
  109. const tempList = data.rows || []
  110. if (!tempList || tempList.length == 0) {
  111. state.loading = false
  112. message.error('加载项目信息失败')
  113. return
  114. }
  115. state.appId = tempList[0].id
  116. state.applicationId = tempList[0].id
  117. } catch {}
  118. // 加载声部
  119. try {
  120. // const { data } = await subjectPage({ page: 1, rows: 999 })
  121. // const tempList = data.rows || []
  122. // tempList.forEach((item: any) => {
  123. // item.label = item.name
  124. // item.value = item.id + ''
  125. // })
  126. // state.subjectList = tempList
  127. const { data } = await musicSheetApplicationExtendSubjectList({
  128. applicationId: state.applicationId
  129. })
  130. const tempList = data || []
  131. tempList.forEach((item: any) => {
  132. item.label = item.subjectName
  133. item.value = item.subjectId
  134. })
  135. state.subjectList = tempList
  136. } catch {}
  137. // 加载曲目标签
  138. try {
  139. const { data } = await musicSheetApplicationExtendTagList({ applicationId: state.appId })
  140. if (data && data.length > 0) {
  141. data.forEach((item: any) => {
  142. state.musicTagList.push({
  143. ...item,
  144. label: item.name,
  145. value: item.id
  146. })
  147. })
  148. }
  149. } catch (err) {}
  150. // 加载表格数据
  151. initUseAppList()
  152. getList()
  153. })
  154. const saveForm = ref()
  155. const onSearch = () => {
  156. checkedRowKeysRef.value = []
  157. saveForm.value?.submit()
  158. }
  159. const onBtnReset = () => {
  160. saveForm.value?.reset()
  161. }
  162. const onSubmit = () => {
  163. state.pagination.page = 1
  164. getList()
  165. }
  166. const initUseAppList = async () => {
  167. try {
  168. const appKeys = Object.keys(appKey)
  169. const { data } = await sysApplicationPage({ page: 1, rows: 999 })
  170. const tempList = data.rows || []
  171. state.useProjectData = []
  172. const filter = tempList.filter((next: any) => {
  173. return appKeys.includes(next.appKey)
  174. })
  175. filter.forEach((item: any) => {
  176. state.useProjectData.push({
  177. ...item,
  178. label: item.appName,
  179. value: item.id
  180. })
  181. })
  182. } catch {}
  183. }
  184. const checkedRowKeysRef = ref<DataTableRowKey[]>([])
  185. const handleCheck = (rowKeys: DataTableRowKey[]) => {
  186. checkedRowKeysRef.value = rowKeys
  187. }
  188. const getList = async () => {
  189. try {
  190. state.loading = true
  191. const sourceType = state.searchForm.sourceType
  192. let userId = state.searchForm.userId
  193. let organizationRoleId = null
  194. if (sourceType && sourceType === 'ORG') {
  195. organizationRoleId = deepClone(userId)
  196. userId = null
  197. }
  198. const { data } = await musicSheetPageByApplication({
  199. ...state.pagination,
  200. ...state.searchForm,
  201. userId: sourceType && sourceType === 'PERSON' ? state.searchForm.userId : null,
  202. organizationRoleId: sourceType && sourceType === 'ORG' ? state.searchForm.userId : null,
  203. musicTagIds: state.searchForm.musicTagIds?.join(','),
  204. ...filterTimes(state.searchForm.times, ['startTime', 'endTime']),
  205. applicationId: state.applicationId
  206. })
  207. state.pagination.pageTotal = Number(data.total)
  208. state.dataList = data.rows || []
  209. } catch {}
  210. state.loading = false
  211. }
  212. const onChangeStatus = (row: any) => {
  213. const statusStr = row.clientStatus ? '停用' : '启用'
  214. dialog.warning({
  215. title: '提示',
  216. content: `是否${statusStr}?`,
  217. positiveText: '确定',
  218. negativeText: '取消',
  219. onPositiveClick: async () => {
  220. try {
  221. await musicSheetApplicationExtendStatus({
  222. ids: row.applicationExtendId,
  223. status: !row.clientStatus
  224. })
  225. getList()
  226. message.success(`${statusStr}成功`)
  227. } catch {}
  228. }
  229. })
  230. }
  231. const onBatchChangeStatus = (status: boolean) => {
  232. const length = checkedRowKeysRef.value.length
  233. if (length == 0) {
  234. message.warning('未选择数据')
  235. }
  236. const statusStr = !status ? '停用' : '启用'
  237. dialog.warning({
  238. title: '提示',
  239. content: `是否${statusStr}` + length + `条数据?`,
  240. positiveText: '确定',
  241. negativeText: '取消',
  242. onPositiveClick: async () => {
  243. try {
  244. await musicSheetApplicationExtendStatus({
  245. ids: checkedRowKeysRef.value.join(','),
  246. status: status
  247. })
  248. getList()
  249. message.success(`${statusStr}成功`)
  250. } catch {}
  251. }
  252. })
  253. }
  254. const getPaymentType = (paymentType: any) => {
  255. const paymentTypeName = []
  256. if (paymentType && paymentType.length > 0) {
  257. for (let i = 0; i < paymentType.length; i++) {
  258. const name = getMapValueByKey(
  259. paymentType[i],
  260. new Map(Object.entries(musicSheetPaymentType))
  261. )
  262. paymentTypeName.push(name)
  263. }
  264. }
  265. return paymentTypeName.join(',')
  266. }
  267. const updateUserIdData = async (sourceType: any) => {
  268. if (!state.searchForm.extendApplicationId) {
  269. return
  270. }
  271. state.userIdData = []
  272. state.searchForm.userId = null
  273. if (sourceType && sourceType !== 'PLATFORM') {
  274. const { data } = await musicSheetApplicationOwnerList({
  275. page: 1,
  276. rows: 9999,
  277. sourceType: sourceType,
  278. applicationId: state.searchForm.extendApplicationId
  279. })
  280. const temp = data.rows || []
  281. temp.forEach((next: any) => {
  282. state.userIdData.push({
  283. ...next,
  284. label: sourceType === 'PERSON' ? next.userName : next.organizationRole,
  285. value: sourceType === 'PERSON' ? next.userId : next.organizationRoleId
  286. })
  287. })
  288. }
  289. }
  290. const onRmove = (row: any): void => {
  291. dialog.warning({
  292. title: '提示',
  293. content: `删除曲目,是否继续?`,
  294. positiveText: '确定',
  295. negativeText: '取消',
  296. onPositiveClick: async () => {
  297. try {
  298. await musicSheetApplicationExtendDel(row.applicationExtendId)
  299. getList()
  300. message.success('删除成功')
  301. } catch {}
  302. }
  303. })
  304. }
  305. const columns = (): any => {
  306. return [
  307. {
  308. type: 'selection'
  309. },
  310. {
  311. title: '曲目名称',
  312. key: 'id',
  313. render: (row: any) => (
  314. <>
  315. <NDescriptions labelPlacement="left" column={1}>
  316. <NDescriptionsItem label="曲目名称">
  317. <TheTooltip content={row.name} />{' '}
  318. </NDescriptionsItem>
  319. <NDescriptionsItem label="曲目编号">
  320. <div
  321. onDblclick={() => {
  322. copyText(message, row.id)
  323. }}
  324. >
  325. <TheTooltip content={row.id} />
  326. </div>
  327. </NDescriptionsItem>
  328. </NDescriptions>
  329. </>
  330. )
  331. },
  332. {
  333. title: '封面图',
  334. key: 'musicCover',
  335. render(row: any): JSX.Element {
  336. return <NImage width={60} height={60} src={row.musicCover} />
  337. }
  338. },
  339. {
  340. title: '曲目信息',
  341. key: 'musicSheetCategoriesName',
  342. render: (row: any) => (
  343. <>
  344. <NDescriptions labelPlacement="left" column={1}>
  345. <NDescriptionsItem label="曲目来源">
  346. {getMapValueByKey(row.sourceType, new Map(Object.entries(musicSheetSourceType)))}
  347. </NDescriptionsItem>
  348. {/* <NDescriptionsItem label="谱面渲染">
  349. {getMapValueByKey(row.musicSheetType, new Map(Object.entries(musicSheetType)))}
  350. </NDescriptionsItem> */}
  351. <NDescriptionsItem label="所属人">
  352. <TheTooltip content={getOwnerName(row.musicSheetExtend, row.sourceType)} />
  353. </NDescriptionsItem>
  354. <NDescriptionsItem label="可用声部">
  355. <TheTooltip content={row.subjectNames} />
  356. </NDescriptionsItem>
  357. </NDescriptions>
  358. </>
  359. )
  360. },
  361. {
  362. title: '伴奏类型',
  363. key: 'audioType',
  364. render: (row: any) => {
  365. return (
  366. <div>
  367. {getMapValueByKey(row.audioType, new Map(Object.entries(musicSheetAudioType)))}
  368. </div>
  369. )
  370. }
  371. },
  372. // {
  373. // title: '可用声部',
  374. // key: 'subjectNames',
  375. // render: (row: any) => {
  376. // return <TheTooltip content={row.subjectNames}/>
  377. // }
  378. // },
  379. {
  380. title: '曲目标签',
  381. key: 'musicTagNames'
  382. },
  383. {
  384. title: '可用途径',
  385. key: 'applicationAvailableType',
  386. render: (row: any) => {
  387. return (
  388. <div>
  389. {getMapValueByKey(
  390. row.applicationAvailableType,
  391. new Map(Object.entries(musicSheetAvailableType))
  392. )}
  393. </div>
  394. )
  395. }
  396. },
  397. {
  398. title: '是否置顶',
  399. key: 'topFlag',
  400. render: (row: any) => {
  401. return <div>{row.topFlag ? '是' : '否'}</div>
  402. }
  403. },
  404. {
  405. title: '是否精品',
  406. key: 'exquisiteFlag',
  407. render: (row: any) => {
  408. return <div>{row.topFlag ? '是' : '否'}</div>
  409. }
  410. },
  411. {
  412. title: '收费方式',
  413. key: 'paymentType',
  414. render: (row: any) => {
  415. return <div>{getPaymentType(row.paymentType?.split(','))}</div>
  416. }
  417. },
  418. {
  419. title: '曲目价格',
  420. key: 'musicPrice'
  421. },
  422. {
  423. title: '上传时间',
  424. minWidth: '150px',
  425. key: 'composer',
  426. render(row: any) {
  427. return row.createTime
  428. }
  429. },
  430. {
  431. title: '业务曲目状态',
  432. key: 'clientStatus',
  433. render(row: any) {
  434. return (
  435. <NTag type={row.clientStatus ? 'primary' : 'default'}>{row.clientStatus ? '启用' : '停用'}</NTag>
  436. )
  437. }
  438. },
  439. {
  440. title: '平台曲目状态',
  441. key: 'status',
  442. render(row: any) {
  443. return (
  444. <NTag type={row.status ? 'primary' : 'default'}>{row.status ? '启用' : '停用'}</NTag>
  445. )
  446. }
  447. },
  448. {
  449. title: '操作',
  450. key: 'operation',
  451. fixed: 'right',
  452. render(row: any) {
  453. return (
  454. <NSpace>
  455. <NButton
  456. type="primary"
  457. size="small"
  458. text
  459. onClick={() => {
  460. state.musicPreview = true
  461. state.musicScore = row
  462. if ('STAVE' == row.scoreType) {
  463. state.musicPreviewScoreType = 'staff'
  464. } else if ('JIAN' == row.scoreType) {
  465. state.musicPreviewScoreType = 'fixedTone'
  466. } else if ('FIRST' == row.scoreType) {
  467. state.musicPreviewScoreType = 'firstTone'
  468. } else {
  469. return
  470. }
  471. }}
  472. >
  473. 预览
  474. </NButton>
  475. <NButton
  476. type="primary"
  477. size="small"
  478. text
  479. v-auth="musicSheetApplicationExtend/status1751229794627878914"
  480. onClick={() => onChangeStatus(row)}
  481. >
  482. {row.clientStatus ? '停用' : '启用'}
  483. </NButton>
  484. <NButton
  485. type="primary"
  486. size="small"
  487. text
  488. v-auth="musicSheetApplicationExtend/update1751235573456044033"
  489. onClick={() => {
  490. state.showEditDialog = true
  491. state.updateRow = row
  492. }}
  493. >
  494. 修改
  495. </NButton>
  496. <NButton
  497. type="primary"
  498. size="small"
  499. text
  500. disabled={!!row.clientStatus}
  501. onClick={() => onRmove(row)}
  502. v-auth="musicSheetApplicationExtend/del1770708473623916546"
  503. >
  504. 删除
  505. </NButton>
  506. </NSpace>
  507. )
  508. }
  509. }
  510. ]
  511. }
  512. return () => {
  513. return (
  514. <div class="system-menu-container">
  515. <SaveForm
  516. ref={saveForm}
  517. model={state.searchForm}
  518. onSubmit={onSubmit}
  519. saveKey="music-sheet-klx"
  520. onSetModel={(val: any) => (state.searchForm = val)}
  521. >
  522. <NFormItem label="关键词" path="keyword">
  523. <NInput
  524. placeholder="请输入曲目名称/编号"
  525. v-model:value={state.searchForm.keyword}
  526. clearable
  527. />
  528. </NFormItem>
  529. <NFormItem label="曲目来源" path="sourceType">
  530. <NSelect
  531. placeholder="请选择曲目来源"
  532. v-model:value={state.searchForm.sourceType}
  533. options={getSelectDataFromObj(musicSheetSourceType)}
  534. onUpdateValue={async (value: any) => {
  535. state.userIdData = []
  536. state.searchForm.userId = null
  537. if (value && value !== 'PLATFORM') {
  538. await updateUserIdData(value)
  539. state.userIdDisable = !state.searchForm.extendApplicationId
  540. } else {
  541. state.userIdDisable = true
  542. }
  543. }}
  544. clearable
  545. />
  546. </NFormItem>
  547. <NFormItem label="所属项目" path="applicationId">
  548. <NSelect
  549. placeholder="请选择所属项目"
  550. v-model:value={state.searchForm.extendApplicationId}
  551. options={state.useProjectData}
  552. clearable
  553. onUpdateValue={async (value: any) => {
  554. state.searchForm.extendApplicationId = value
  555. if (value) {
  556. await updateUserIdData(state.searchForm.sourceType)
  557. state.userIdDisable = !(
  558. state.searchForm.sourceType && state.searchForm.sourceType !== 'PLATFORM'
  559. )
  560. } else {
  561. state.searchForm.userId = null
  562. state.userIdDisable = true
  563. state.userIdData = []
  564. }
  565. }}
  566. />
  567. </NFormItem>
  568. <NFormItem label="所属人" path="userId">
  569. <NSelect
  570. filterable
  571. placeholder="请选择所属人"
  572. disabled={state.userIdDisable}
  573. v-model:value={state.searchForm.userId}
  574. options={state.userIdData}
  575. clearable
  576. ></NSelect>
  577. </NFormItem>
  578. {/* <NFormItem label="谱面渲染" path="subjectType">
  579. <NSelect
  580. placeholder="请选择谱面渲染"
  581. v-model:value={state.searchForm.musicSheetType}
  582. options={getSelectDataFromObj(musicSheetType)}
  583. clearable
  584. />
  585. </NFormItem> */}
  586. <NFormItem label="伴奏类型" path="audioType">
  587. <NSelect
  588. placeholder="请选择伴奏类型"
  589. v-model:value={state.searchForm.audioType}
  590. options={getSelectDataFromObj(musicSheetAudioType)}
  591. clearable
  592. />
  593. </NFormItem>
  594. <NFormItem label="可用声部" path="subjectId">
  595. <NSelect
  596. placeholder="请选择可用声部"
  597. v-model:value={state.searchForm.subjectId}
  598. options={state.subjectList}
  599. clearable
  600. filterable
  601. />
  602. </NFormItem>
  603. <NFormItem label="曲目标签" path="musicTagIds">
  604. <NSelect
  605. placeholder="请选择曲目标签"
  606. v-model:value={state.searchForm.musicTagIds}
  607. options={state.musicTagList}
  608. multiple
  609. maxTagCount={2}
  610. clearable
  611. filterable
  612. />
  613. </NFormItem>
  614. {/*<NFormItem*/}
  615. {/* label="可用途径"*/}
  616. {/* path="availableType"*/}
  617. {/*>*/}
  618. {/* <NSelect*/}
  619. {/* placeholder="请选择可用途径"*/}
  620. {/* v-model:value={state.searchForm.availableType}*/}
  621. {/* options={getSelectDataFromObj(musicSheetAvailableType)}*/}
  622. {/* clearable*/}
  623. {/* >*/}
  624. {/* </NSelect>*/}
  625. {/*</NFormItem>*/}
  626. <NFormItem label="收费方式" path="paymentType">
  627. <NSelect
  628. placeholder="请选择收费方式"
  629. v-model:value={state.searchForm.paymentType}
  630. options={getSelectDataFromObj(musicSheetPaymentType)}
  631. clearable
  632. ></NSelect>
  633. </NFormItem>
  634. <NFormItem label="业务曲目状态" path="clientStatus">
  635. <NSelect
  636. v-model:value={state.searchForm.clientStatus}
  637. placeholder="请选择业务曲目状态"
  638. options={
  639. [
  640. {
  641. label: '启用',
  642. value: true
  643. },
  644. {
  645. label: '停用',
  646. value: false
  647. }
  648. ] as any
  649. }
  650. clearable
  651. />
  652. </NFormItem>
  653. <NFormItem label="平台曲目状态" path="status">
  654. <NSelect
  655. v-model:value={state.searchForm.status}
  656. placeholder="请选择平台曲目状态"
  657. options={
  658. [
  659. {
  660. label: '启用',
  661. value: true
  662. },
  663. {
  664. label: '停用',
  665. value: false
  666. }
  667. ] as any
  668. }
  669. clearable
  670. />
  671. </NFormItem>
  672. <NFormItem label="上传时间" path="authorFrom">
  673. <NDatePicker
  674. v-model:value={state.searchForm.times}
  675. type="daterange"
  676. clearable
  677. value-format="yyyy.MM.dd"
  678. startPlaceholder="开始时间"
  679. endPlaceholder="结束时间"
  680. />
  681. </NFormItem>
  682. <NFormItem>
  683. <NSpace>
  684. <NButton type="primary" onClick={onSearch}>
  685. 搜索
  686. </NButton>
  687. <NButton type="default" onClick={onBtnReset}>
  688. 重置
  689. </NButton>
  690. </NSpace>
  691. </NFormItem>
  692. </SaveForm>
  693. <div class={['section-container']}>
  694. <NSpace style={{ paddingBottom: '12px' }}>
  695. <NButton
  696. type="primary"
  697. v-auth="musicSheetApplicationExtend/saveBatch1751227277370195969"
  698. onClick={() => {
  699. state.showAddDialog = true
  700. }}
  701. >
  702. 添加曲目
  703. </NButton>
  704. <NButton
  705. disabled={checkedRowKeysRef.value.length == 0}
  706. v-auth="musicSheetApplicationExtend/status1751229794627878914"
  707. onClick={() => {
  708. onBatchChangeStatus(false)
  709. }}
  710. >
  711. 批量停用
  712. </NButton>
  713. <NButton
  714. disabled={checkedRowKeysRef.value.length == 0}
  715. v-auth="musicSheetApplicationExtend/status1751229794627878914"
  716. onClick={() => {
  717. onBatchChangeStatus(true)
  718. }}
  719. >
  720. 批量启用
  721. </NButton>
  722. </NSpace>
  723. <NDataTable
  724. loading={state.loading}
  725. columns={columns()}
  726. data={state.dataList}
  727. rowKey={(row: any) => row.applicationExtendId}
  728. v-model:checkedRowKeys={checkedRowKeysRef.value}
  729. scrollX={'2000'}
  730. ></NDataTable>
  731. <Pagination
  732. v-model:page={state.pagination.page}
  733. v-model:pageSize={state.pagination.rows}
  734. v-model:pageTotal={state.pagination.pageTotal}
  735. onList={getList}
  736. sync
  737. saveKey="music-sheet-klx"
  738. ></Pagination>
  739. </div>
  740. <NModal
  741. v-model:show={state.showAddDialog}
  742. preset="dialog"
  743. showIcon={false}
  744. title={'添加曲目'}
  745. style={{ width: '1300px' }}
  746. >
  747. <AddMusic
  748. onClose={() => (state.showAddDialog = false)}
  749. onGetList={onSubmit}
  750. subjectList={state.subjectList}
  751. appId={state.appId}
  752. musicSheetTagList={state.musicTagList}
  753. />
  754. </NModal>
  755. <NModal
  756. v-model:show={state.showEditDialog}
  757. preset="dialog"
  758. showIcon={false}
  759. title={'修改曲目'}
  760. style={{ width: '500px' }}
  761. >
  762. <UpdateMusic
  763. onClose={() => (state.showEditDialog = false)}
  764. onGetList={() => {
  765. state.pagination.page = 1
  766. getList()
  767. }}
  768. rowData={state.updateRow}
  769. appId={state.appId}
  770. musicSheetTagList={state.musicTagList}
  771. />
  772. </NModal>
  773. <NModal
  774. blockScroll={true}
  775. v-model:show={state.musicPreview}
  776. preset="card"
  777. showIcon={false}
  778. title={'曲目预览'}
  779. class={styles.musicPreviewModal}
  780. >
  781. <MusicPreView item={state.musicScore} scoreType={state.musicPreviewScoreType} />
  782. </NModal>
  783. </div>
  784. )
  785. }
  786. }
  787. })