music-list.tsx 31 KB

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