music-sheet-kt.tsx 26 KB

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