music-list.tsx 25 KB

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