music-list.tsx 24 KB

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