music-sheet-klx_jg.tsx 25 KB

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