music-list.tsx 24 KB

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