music-list.tsx 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983
  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. NDropdown,
  11. NFormItem,
  12. NIcon,
  13. NImage,
  14. NInput,
  15. NModal,
  16. NSelect,
  17. NSpace,
  18. NTag,
  19. NTooltip,
  20. useDialog,
  21. useMessage
  22. } from 'naive-ui'
  23. import { defineComponent, onMounted, onUnmounted, reactive, ref, watch } from 'vue'
  24. import {
  25. musicSheetApplicationOwnerList,
  26. musicSheetPage,
  27. musicSheetRemove,
  28. musicSheetImg,
  29. musicSheetStatusList,
  30. musicTagPage,
  31. musicSheetCategoriesQueryTree
  32. } from '../../api'
  33. import MusicOperation from '../modal/music-operationV2'
  34. import { subjectPage } from '@/views/system-manage/api'
  35. import MusicPreView from '../modal/musicPreView'
  36. import UseProject from '@views/music-library/music-sheet/modal/use-project'
  37. import { getMapValueByKey } from '@/utils/filters'
  38. import { appKey, musicSheetSourceType } from '@/utils/constant'
  39. import { getSelectDataFromObj } from '@/utils/objectUtil'
  40. import { sysApplicationPage } from '@views/menu-manage/api'
  41. import { getOwnerName, copyText } from '@views/music-library/musicUtil'
  42. import styles from './music-list.module.less'
  43. import MusicCreateImg from '../modal/music-create-img'
  44. import TheTooltip from '@components/TheTooltip'
  45. import { HelpCircleOutline } from '@vicons/ionicons5'
  46. import { musicalInstrumentPage } from '@views/system-manage/subject-manage/api'
  47. import MusiceBeatTime from '../modal/musiceBeatTime'
  48. export default defineComponent({
  49. name: 'music-list',
  50. props: ['searchId', 'musicCategoryId'],
  51. setup(props, { emit }) {
  52. const dialog = useDialog()
  53. const message = useMessage()
  54. const state = reactive({
  55. loading: false,
  56. pagination: {
  57. page: 1,
  58. rows: 10,
  59. pageTotal: 0
  60. },
  61. searchForm: {
  62. keyword: null,
  63. isScoreRender: null,
  64. subjectId: null, //声部ID
  65. sourceType: null, //来源类型/作者属性(PLATFORM: 平台; ORG: 机构; PERSON: 个人
  66. composer: null, //作曲人/音乐人
  67. userId: null, //所属人
  68. applicationId: null, //所属人项目ID
  69. useAppId: [] as any, //适用项目ID
  70. status: null, //曲目状态(0:停用,1:启用)
  71. appAuditFlag: null, //是否审核版本
  72. categoriesId: null, //是否审核版本
  73. musicCategoryId: null, //曲目分类
  74. musicalInstrumentId: null, // 乐器ID
  75. dataCorrect: null, // 数据修复
  76. generateFirst: null, // 妙级课需要针对生成节拍器音频
  77. generateMetronomeAudio: null // 是否生成节拍器音频
  78. },
  79. dataList: [] as any,
  80. subjectList: [] as any,
  81. instrumentList: [] as any,
  82. tagList: [] as any,
  83. visiableMusic: false,
  84. musicOperation: 'add',
  85. musicData: {} as any,
  86. musicSheetCategories: [] as any,
  87. musicPreview: false,
  88. musicPreviewScoreType: 'staff', // 预览谱面类型
  89. musicScore: null as any,
  90. showUseProject: false, // 适用项目
  91. useProjectData: [] as any, // 适用项目行数据
  92. showUseProjectId: null as any, // 适用项目行数据
  93. detailReadonly: false, // 新增、修改、详情是否可编辑
  94. userIdDisable: true, // 所属人
  95. userIdData: [] as any, // 所属人数据列表
  96. productOpen: false,
  97. beatTimeOpen: false,
  98. productItem: {} as any
  99. })
  100. const columns = (): any => {
  101. return [
  102. {
  103. type: 'selection'
  104. },
  105. {
  106. title: '曲目名称',
  107. minWidth: '200px',
  108. key: 'id',
  109. render(row: any) {
  110. return (
  111. <NDescriptions labelPlacement="left" column={1}>
  112. <NDescriptionsItem label="名称">
  113. <TheTooltip content={row.name} />
  114. </NDescriptionsItem>
  115. <NDescriptionsItem label="编号">
  116. <div
  117. onDblclick={() => {
  118. copyText(message, row.id)
  119. }}
  120. >
  121. <TheTooltip content={row.id} />
  122. </div>
  123. </NDescriptionsItem>
  124. </NDescriptions>
  125. )
  126. }
  127. },
  128. {
  129. title: '封面图',
  130. key: 'titleImg',
  131. render(row: any): JSX.Element {
  132. return <NImage width={60} height={60} src={row.musicCover} />
  133. }
  134. },
  135. {
  136. title: '曲目信息',
  137. minWidth: '200px',
  138. key: 'composer',
  139. render(row: any) {
  140. return (
  141. <NDescriptions labelPlacement="left" column={1}>
  142. <NDescriptionsItem label="音乐人">{row.composer}</NDescriptionsItem>
  143. <NDescriptionsItem label="总谱渲染">
  144. {row.isScoreRender ? '支持' : '不支持'}
  145. </NDescriptionsItem>
  146. <NDescriptionsItem label="分类">
  147. <TheTooltip content={row.musicCategoryName} />
  148. </NDescriptionsItem>
  149. <NDescriptionsItem label="可用声部">
  150. <TheTooltip content={row.subjectNames} />
  151. </NDescriptionsItem>
  152. {/*<NDescriptionsItem label="可用乐器">*/}
  153. {/* <TheTooltip content={row.musicalInstrumentNames} />*/}
  154. {/*</NDescriptionsItem>*/}
  155. </NDescriptions>
  156. )
  157. }
  158. },
  159. {
  160. title: '作者属性',
  161. minWidth: '250px',
  162. key: 'sourceType',
  163. render(row: any) {
  164. return (
  165. <NDescriptions labelPlacement="left" column={1}>
  166. <NDescriptionsItem label="属性">
  167. {getMapValueByKey(row.sourceType, new Map(Object.entries(musicSheetSourceType)))}
  168. </NDescriptionsItem>
  169. <NDescriptionsItem label="所属人">
  170. {getOwnerName(row.musicSheetExtend, row.sourceType)}
  171. </NDescriptionsItem>
  172. </NDescriptions>
  173. )
  174. }
  175. },
  176. {
  177. title: '适用项目',
  178. key: 'projectName',
  179. render(row: any) {
  180. return (
  181. <NSpace>
  182. <NButton
  183. type="primary"
  184. size="small"
  185. text
  186. v-auth="musicSheetApplicationExtend/save1752901206883221506"
  187. onClick={() => {
  188. state.showUseProject = true
  189. state.showUseProjectId = row.id
  190. }}
  191. >
  192. <TheTooltip
  193. content={
  194. row.musicSheetExtend && row.musicSheetExtend.useApplicationNames
  195. ? row.musicSheetExtend.useApplicationNames
  196. : ''
  197. }
  198. />
  199. <NIcon size={15} style="padding-left: 9px">
  200. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
  201. <path d="M2 26h28v2H2z" fill="currentColor"></path>
  202. <path
  203. 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"
  204. fill="currentColor"
  205. ></path>
  206. </svg>
  207. </NIcon>
  208. </NButton>
  209. </NSpace>
  210. )
  211. }
  212. },
  213. {
  214. title: '更新信息',
  215. minWidth: '250px',
  216. key: 'updateBy',
  217. render(row: any) {
  218. return (
  219. <NDescriptions labelPlacement="left" column={1}>
  220. <NDescriptionsItem label="更新人">{row.updateByName}</NDescriptionsItem>
  221. <NDescriptionsItem label="更新时间">{row.updateTime}</NDescriptionsItem>
  222. </NDescriptions>
  223. )
  224. }
  225. },
  226. {
  227. title: '审核版本',
  228. minWidth: '100px',
  229. key: 'appAuditFlag',
  230. render(row: any) {
  231. return <div>{row.appAuditFlag ? '是' : '否'}</div>
  232. }
  233. },
  234. {
  235. title: '状态',
  236. minWidth: '50px',
  237. key: 'status',
  238. render(row: any) {
  239. return (
  240. <NTag type={row.status ? 'primary' : 'default'}>{row.status ? '启用' : '停用'}</NTag>
  241. )
  242. }
  243. },
  244. {
  245. title: '操作',
  246. key: 'operation',
  247. fixed: 'right',
  248. width: '300px',
  249. render(row: any) {
  250. return (
  251. <NSpace>
  252. <NDropdown
  253. trigger="hover"
  254. options={[
  255. { label: '五线谱', key: 'staff' },
  256. { label: '首调', key: 'firstTone' },
  257. { label: '固定调', key: 'fixedTone' }
  258. ]}
  259. onSelect={(key: string) => {
  260. state.musicPreview = true
  261. state.musicScore = row
  262. state.musicPreviewScoreType = key
  263. }}
  264. >
  265. <NButton
  266. type="primary"
  267. size="small"
  268. text
  269. onClick={(e: Event) => e.stopPropagation()}
  270. >
  271. 预览
  272. </NButton>
  273. </NDropdown>
  274. <NButton
  275. type="primary"
  276. size="small"
  277. text
  278. v-auth="musicSheet/detail1751241103201271810"
  279. onClick={() => {
  280. state.visiableMusic = true
  281. state.musicOperation = 'preview'
  282. state.musicData = row
  283. state.detailReadonly = true
  284. }}
  285. >
  286. 查看
  287. </NButton>
  288. <NButton
  289. type="primary"
  290. size="small"
  291. text
  292. disabled={row.playMode === 'MIDI'}
  293. v-auth="musicSheet/save1751241178962984962"
  294. onClick={() => {
  295. state.visiableMusic = true
  296. state.musicOperation = 'edit'
  297. state.musicData = row
  298. state.detailReadonly = true
  299. }}
  300. >
  301. 修改
  302. </NButton>
  303. <NButton
  304. type="primary"
  305. size="small"
  306. text
  307. v-auth="musicSheet/statusList1751241653309407234"
  308. onClick={() => onChangeStatus(row)}
  309. >
  310. {row.status ? '停用' : '启用'}
  311. </NButton>
  312. <NButton
  313. type="primary"
  314. size="small"
  315. text
  316. v-auth="musicSheet/img1751240591299051522"
  317. onClick={() => {
  318. state.productOpen = true
  319. state.productItem = row
  320. // handleAutoProduct(row)
  321. }}
  322. >
  323. 生成图片
  324. </NButton>
  325. <NButton
  326. type="primary"
  327. size="small"
  328. text
  329. v-auth="musicSheet/addMix1819259767120539649"
  330. onClick={() => {
  331. state.productItem = row
  332. state.beatTimeOpen = true
  333. }}
  334. >
  335. 生成节拍器音频
  336. </NButton>
  337. <NButton
  338. type="primary"
  339. size="small"
  340. text
  341. disabled={!!row.status}
  342. onClick={() => onRmove(row)}
  343. v-auth="musicSheet/remove1753457445635645442"
  344. >
  345. 删除
  346. </NButton>
  347. </NSpace>
  348. )
  349. }
  350. }
  351. ]
  352. }
  353. const checkedRowKeysRef = ref<DataTableRowKey[]>([])
  354. const handleCheck = (rowKeys: DataTableRowKey[]) => {
  355. checkedRowKeysRef.value = rowKeys
  356. }
  357. const onChangeStatus = (row: any) => {
  358. const statusStr = row.status ? '停用' : '启用'
  359. dialog.warning({
  360. title: '提示',
  361. content: `是否${statusStr}?`,
  362. positiveText: '确定',
  363. negativeText: '取消',
  364. onPositiveClick: async () => {
  365. try {
  366. await musicSheetStatusList({
  367. ids: new Array(row.id),
  368. status: !row.status
  369. })
  370. getList()
  371. message.success(`${statusStr}成功`)
  372. } catch {}
  373. }
  374. })
  375. }
  376. const onBatchChangeStatus = (status: boolean) => {
  377. const length = checkedRowKeysRef.value.length
  378. if (length == 0) {
  379. message.warning('未选择数据')
  380. }
  381. const statusStr = !status ? '停用' : '启用'
  382. dialog.warning({
  383. title: '提示',
  384. content: `是否${statusStr}` + length + `条数据?`,
  385. positiveText: '确定',
  386. negativeText: '取消',
  387. onPositiveClick: async () => {
  388. try {
  389. await musicSheetStatusList({
  390. ids: checkedRowKeysRef.value,
  391. status: status
  392. })
  393. getList()
  394. message.success(`${statusStr}成功`)
  395. } catch {}
  396. }
  397. })
  398. }
  399. const updateUserIdData = async (sourceType: any) => {
  400. if (!state.searchForm.applicationId) {
  401. return
  402. }
  403. state.userIdData = []
  404. state.searchForm.userId = null
  405. if (sourceType && sourceType !== 'PLATFORM') {
  406. const { data } = await musicSheetApplicationOwnerList({
  407. page: 1,
  408. rows: 9999,
  409. sourceType: sourceType,
  410. applicationId: state.searchForm.applicationId
  411. })
  412. const temp = data.rows || []
  413. temp.forEach((next: any) => {
  414. state.userIdData.push({
  415. ...next,
  416. label: sourceType === 'PERSON' ? next.userName : next.organizationRole,
  417. value: sourceType === 'PERSON' ? next.userId : next.organizationRoleId
  418. })
  419. })
  420. }
  421. }
  422. const onRmove = (row: any): void => {
  423. dialog.warning({
  424. title: '提示',
  425. content: `删除"${row.name}",是否继续?`,
  426. positiveText: '确定',
  427. negativeText: '取消',
  428. onPositiveClick: async () => {
  429. try {
  430. await musicSheetRemove({ id: row.id })
  431. getList()
  432. message.success('删除成功')
  433. } catch {}
  434. }
  435. })
  436. }
  437. const getList = async () => {
  438. try {
  439. state.loading = true
  440. const sourceType = state.searchForm.sourceType
  441. const userId = state.searchForm.userId
  442. let search = {
  443. ...state.searchForm,
  444. useAppId: state.searchForm.useAppId
  445. ? state.searchForm.useAppId.join(',')
  446. : state.searchForm.useAppId
  447. } as any
  448. if (sourceType) {
  449. if (sourceType == 'ORG') {
  450. search.organizationRoleId = userId
  451. search.userId = null
  452. }
  453. }
  454. const opt = { ...state.pagination, ...search }
  455. opt.generateFirst && (opt.musicCategoryId = "100061")
  456. const { data } = await musicSheetPage(opt)
  457. state.pagination.pageTotal = Number(data.total)
  458. state.dataList = data.rows || []
  459. } catch {}
  460. state.loading = false
  461. }
  462. // 获取标签
  463. const getTagList = async () => {
  464. try {
  465. const { data } = await musicTagPage({ page: 1, rows: 999 })
  466. const tempList = data.rows || []
  467. tempList.forEach((item: any) => {
  468. item.label = item.name
  469. item.value = item.id
  470. })
  471. state.tagList = tempList
  472. } catch {}
  473. }
  474. // 获取分类
  475. const getMusicSheetCategorieList = async () => {
  476. try {
  477. const { data } = await musicSheetCategoriesQueryTree({})
  478. // state.musicSheetCategories = filterPointCategory(data, 'musicSheetCategoriesList')
  479. state.musicSheetCategories = data || []
  480. clearEmptyMusicCategory(state.musicSheetCategories)
  481. } catch (e) {}
  482. }
  483. const clearEmptyMusicCategory = (data: any) => {
  484. for (let i = 0; i < data.length; i++) {
  485. if (data[i].musicSheetCategoriesList.length < 1) {
  486. data[i].musicSheetCategoriesList = null
  487. } else {
  488. clearEmptyMusicCategory(data[i].musicSheetCategoriesList)
  489. }
  490. }
  491. }
  492. // 获取声部
  493. const initSubjectList = async () => {
  494. try {
  495. const { data } = await subjectPage({ page: 1, rows: 999 })
  496. const tempList = data.rows || []
  497. tempList.forEach((item: any) => {
  498. item.label = item.name
  499. item.value = item.id + ''
  500. })
  501. state.subjectList = tempList
  502. } catch {}
  503. }
  504. const initInstrumentList = async () => {
  505. try {
  506. const { data } = await musicalInstrumentPage({ page: 1, rows: 999 })
  507. const tempList = data.rows || []
  508. tempList.forEach((item: any) => {
  509. item.label = item.name
  510. item.value = item.id + ''
  511. })
  512. state.instrumentList = tempList
  513. } catch {}
  514. }
  515. // app列表
  516. const initUseAppList = async () => {
  517. try {
  518. const appKeys = Object.keys(appKey)
  519. const { data } = await sysApplicationPage({ page: 1, rows: 999 })
  520. const tempList = data.rows || []
  521. state.useProjectData = []
  522. const filter = tempList.filter((next: any) => {
  523. return appKeys.includes(next.appKey)
  524. })
  525. filter.forEach((item: any) => {
  526. state.useProjectData.push({
  527. ...item,
  528. label: item.appName,
  529. value: item.id
  530. })
  531. })
  532. } catch {}
  533. }
  534. const saveForm = ref()
  535. const onSubmit = () => {
  536. state.pagination.page = 1
  537. getList()
  538. }
  539. watch(
  540. () => props.searchId,
  541. (val) => {
  542. console.log(val, 'searchId')
  543. }
  544. )
  545. const onSearch = () => {
  546. checkedRowKeysRef.value = []
  547. saveForm.value?.submit()
  548. }
  549. const onBtnReset = () => {
  550. saveForm.value?.reset()
  551. }
  552. onMounted(async () => {
  553. state.loading = true
  554. // getTagList()
  555. if (props.searchId) {
  556. state.searchForm.categoriesId = props.searchId || null
  557. }
  558. if (props.musicCategoryId) {
  559. state.searchForm.musicCategoryId = props.musicCategoryId || null
  560. }
  561. initSubjectList()
  562. initInstrumentList()
  563. initUseAppList()
  564. getMusicSheetCategorieList()
  565. getList()
  566. })
  567. return () => (
  568. <div class="system-menu-container">
  569. <SaveForm
  570. ref={saveForm}
  571. model={state.searchForm}
  572. onSubmit={onSubmit}
  573. saveKey="music-list"
  574. onSetModel={(val: any) => (state.searchForm = val)}
  575. >
  576. <NFormItem label="关键词" path="keyword">
  577. <NInput
  578. placeholder="曲目编号/名称"
  579. v-model:value={state.searchForm.keyword}
  580. clearable
  581. />
  582. </NFormItem>
  583. <NFormItem label="总谱渲染" path="isScoreRender">
  584. <NSelect
  585. placeholder="请选择总谱渲染"
  586. v-model:value={state.searchForm.isScoreRender}
  587. options={
  588. [
  589. {
  590. label: '支持',
  591. value: true
  592. },
  593. {
  594. label: '不支持',
  595. value: false
  596. }
  597. ] as any
  598. }
  599. clearable
  600. />
  601. </NFormItem>
  602. <NFormItem label="曲目分类" path="musicCategoryId">
  603. <NCascader
  604. valueField="id"
  605. labelField="name"
  606. children-field="musicSheetCategoriesList"
  607. placeholder="请选择曲目分类"
  608. v-model:value={state.searchForm.musicCategoryId}
  609. options={state.musicSheetCategories}
  610. clearable
  611. />
  612. </NFormItem>
  613. <NFormItem label="可用声部" path="musicSubject">
  614. <NSelect
  615. placeholder="请选择可用声部"
  616. v-model:value={state.searchForm.subjectId}
  617. options={state.subjectList}
  618. filterable
  619. clearable
  620. />
  621. </NFormItem>
  622. <NFormItem label="可用乐器" path="musicalInstrumentId">
  623. <NSelect
  624. placeholder="请选择可用乐器"
  625. v-model:value={state.searchForm.musicalInstrumentId}
  626. options={state.instrumentList}
  627. filterable
  628. clearable
  629. />
  630. </NFormItem>
  631. <NFormItem label="音乐人" path="composer">
  632. <NInput
  633. placeholder="请选择音乐人"
  634. v-model:value={state.searchForm.composer}
  635. clearable
  636. />
  637. </NFormItem>
  638. <NFormItem label="作者属性" path="sourceType">
  639. <NSelect
  640. placeholder="请选择作者属性"
  641. v-model:value={state.searchForm.sourceType}
  642. options={getSelectDataFromObj(musicSheetSourceType)}
  643. onUpdateValue={async (value: any) => {
  644. state.userIdData = []
  645. state.searchForm.userId = null
  646. if (value && value !== 'PLATFORM') {
  647. await updateUserIdData(value)
  648. state.userIdDisable = !state.searchForm.applicationId
  649. } else {
  650. state.userIdDisable = true
  651. }
  652. }}
  653. clearable
  654. />
  655. </NFormItem>
  656. <NFormItem label="所属项目" path="applicationId">
  657. <NSelect
  658. placeholder="请选择所属项目"
  659. v-model:value={state.searchForm.applicationId}
  660. options={state.useProjectData}
  661. clearable
  662. onUpdateValue={async (value: any) => {
  663. state.searchForm.applicationId = value
  664. if (value) {
  665. await updateUserIdData(state.searchForm.sourceType)
  666. state.userIdDisable = !(
  667. state.searchForm.sourceType && state.searchForm.sourceType !== 'PLATFORM'
  668. )
  669. } else {
  670. state.searchForm.userId = null
  671. state.userIdDisable = true
  672. state.userIdData = []
  673. }
  674. }}
  675. />
  676. </NFormItem>
  677. <NFormItem label="所属人" path="userId">
  678. {{
  679. label: () => (
  680. <div>
  681. 所属人
  682. {/*<NTooltip style={"padding-left: 10px"}>*/}
  683. {/* {{*/}
  684. {/* default: () => '请选择作者属性和项目再选择所属人',*/}
  685. {/* trigger: () => (*/}
  686. {/* <span>*/}
  687. {/* <NIcon size="20">*/}
  688. {/* <HelpCircleOutline/>*/}
  689. {/* </NIcon>*/}
  690. {/* </span>*/}
  691. {/* )*/}
  692. {/* }}*/}
  693. {/*</NTooltip>*/}
  694. </div>
  695. ),
  696. default: () => (
  697. <NSelect
  698. filterable
  699. placeholder="请选择所属人"
  700. disabled={
  701. state.userIdDisable ||
  702. (!state.searchForm.applicationId && !state.searchForm.sourceType)
  703. }
  704. v-model:value={state.searchForm.userId}
  705. options={state.userIdData}
  706. clearable
  707. ></NSelect>
  708. )
  709. }}
  710. </NFormItem>
  711. <NFormItem label="适用项目" path="useAppId">
  712. <NSelect
  713. placeholder="请选择适用项目"
  714. v-model:value={state.searchForm.useAppId}
  715. options={state.useProjectData}
  716. multiple
  717. maxTagCount={1}
  718. />
  719. </NFormItem>
  720. <NFormItem label="状态" path="status">
  721. <NSelect
  722. v-model={[state.searchForm.status, 'value']}
  723. placeholder="请选择状态"
  724. clearable
  725. options={
  726. [
  727. {
  728. label: '启用',
  729. value: true
  730. },
  731. {
  732. label: '停用',
  733. value: false
  734. }
  735. ] as any
  736. }
  737. />
  738. </NFormItem>
  739. <NFormItem label="审核版本" path="appAuditFlag">
  740. <NSelect
  741. v-model={[state.searchForm.appAuditFlag, 'value']}
  742. placeholder="请选择审核版本"
  743. clearable
  744. options={
  745. [
  746. {
  747. label: '是',
  748. value: 1
  749. },
  750. {
  751. label: '否',
  752. value: 0
  753. }
  754. ] as any
  755. }
  756. />
  757. </NFormItem>
  758. <NFormItem label="数据修复" path="dataCorrect">
  759. <NSelect
  760. v-model={[state.searchForm.dataCorrect, 'value']}
  761. placeholder="请选择数据修复"
  762. clearable
  763. options={
  764. [
  765. {
  766. label: '是',
  767. value: true
  768. },
  769. {
  770. label: '否',
  771. value: false
  772. }
  773. ] as any
  774. }
  775. />
  776. </NFormItem>
  777. <NFormItem label="生成节拍器音频" path="generateMetronomeAudio">
  778. <NSelect
  779. v-model={[state.searchForm.generateMetronomeAudio, 'value']}
  780. placeholder="请选择是否生成节拍器音频"
  781. clearable
  782. options={
  783. [
  784. {
  785. label: '已生成',
  786. value: true
  787. },
  788. {
  789. label: '未生成',
  790. value: false
  791. }
  792. ] as any
  793. }
  794. />
  795. </NFormItem>
  796. <NFormItem label="妙极客节拍器" path="generateFirst">
  797. <NSelect
  798. v-model={[state.searchForm.generateFirst, 'value']}
  799. placeholder="请选择妙极客节拍器"
  800. clearable
  801. options={
  802. [
  803. {
  804. label: '是',
  805. value: true
  806. },
  807. {
  808. label: '否',
  809. value: false
  810. }
  811. ] as any
  812. }
  813. />
  814. </NFormItem>
  815. <NFormItem>
  816. <NSpace>
  817. <NButton type="primary" onClick={onSearch}>
  818. 搜索
  819. </NButton>
  820. <NButton type="default" onClick={onBtnReset}>
  821. 重置
  822. </NButton>
  823. </NSpace>
  824. </NFormItem>
  825. </SaveForm>
  826. <div class={['section-container']}>
  827. <NSpace style={{ paddingBottom: '12px' }}>
  828. <NButton
  829. type="primary"
  830. v-auth="musicSheet/save1751241178962984962"
  831. onClick={() => {
  832. state.visiableMusic = true
  833. state.musicOperation = 'add'
  834. state.musicData = {}
  835. state.detailReadonly = true
  836. }}
  837. >
  838. 新增曲目
  839. </NButton>
  840. <NButton
  841. disabled={checkedRowKeysRef.value.length == 0}
  842. v-auth="musicSheet/statusList1751241653309407234"
  843. onClick={() => {
  844. onBatchChangeStatus(false)
  845. }}
  846. >
  847. 批量停用
  848. </NButton>
  849. <NButton
  850. disabled={checkedRowKeysRef.value.length == 0}
  851. v-auth="musicSheet/statusList1751241653309407234"
  852. onClick={() => {
  853. onBatchChangeStatus(true)
  854. }}
  855. >
  856. 批量启用
  857. </NButton>
  858. </NSpace>
  859. <NDataTable
  860. loading={state.loading}
  861. columns={columns()}
  862. data={state.dataList}
  863. rowKey={(row: any) => row.id}
  864. v-model:checkedRowKeys={checkedRowKeysRef.value}
  865. scrollX={'1200'}
  866. ></NDataTable>
  867. <Pagination
  868. v-model:page={state.pagination.page}
  869. v-model:pageSize={state.pagination.rows}
  870. v-model:pageTotal={state.pagination.pageTotal}
  871. onList={getList}
  872. sync
  873. saveKey="music-list"
  874. ></Pagination>
  875. </div>
  876. <NModal
  877. v-model:show={state.visiableMusic}
  878. preset="dialog"
  879. showIcon={false}
  880. maskClosable={false}
  881. title={() => {
  882. if (state.musicOperation === 'add') {
  883. return '添加曲目'
  884. } else if (state.musicOperation === 'preview') {
  885. return '曲目详情'
  886. }
  887. return '修改曲目'
  888. }}
  889. style={{ width: '980px' }}
  890. >
  891. <MusicOperation
  892. type={state.musicOperation}
  893. data={state.musicData}
  894. subjectList={state.subjectList}
  895. // musicSheetCategories={state.musicSheetCategories}
  896. // tagList={state.tagList}
  897. onClose={() => (state.visiableMusic = false)}
  898. onGetList={getList}
  899. />
  900. </NModal>
  901. <NModal
  902. blockScroll={true}
  903. v-model:show={state.musicPreview}
  904. preset="dialog"
  905. showIcon={false}
  906. title={'曲目预览'}
  907. style={{ width: 'auto' }}
  908. >
  909. <MusicPreView
  910. item={state.musicScore}
  911. isMove={1}
  912. scoreType={state.musicPreviewScoreType}
  913. />
  914. </NModal>
  915. <NModal
  916. blockScroll={true}
  917. v-model:show={state.showUseProject}
  918. preset="dialog"
  919. showIcon={false}
  920. title={'适用项目'}
  921. style={{ width: '500px' }}
  922. >
  923. <UseProject
  924. id={state.showUseProjectId}
  925. useProject={state.useProjectData}
  926. onClose={() => (state.showUseProject = false)}
  927. onGetList={getList}
  928. />
  929. </NModal>
  930. <NModal
  931. class={styles.productModal}
  932. title="自动生成曲谱图片"
  933. v-model:show={state.productOpen}
  934. preset="dialog"
  935. closeOnEsc={false}
  936. maskClosable={false}
  937. showIcon={false}
  938. >
  939. <MusicCreateImg
  940. xmlFileUrl={state.productItem.xmlFileUrl}
  941. onClose={() => (state.productOpen = false)}
  942. onConfirm={async (item: any) => {
  943. try {
  944. await musicSheetImg({
  945. ...item,
  946. id: state.productItem.id
  947. })
  948. } catch {}
  949. }}
  950. />
  951. </NModal>
  952. {state.beatTimeOpen && (
  953. <MusiceBeatTime
  954. id={state.productItem.id}
  955. onClose={() => {
  956. state.beatTimeOpen = false
  957. }}
  958. ></MusiceBeatTime>
  959. )}
  960. </div>
  961. )
  962. }
  963. })