music-list.tsx 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988
  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. minWidth: '120px',
  164. render(row: any) {
  165. return (
  166. <NDescriptions labelPlacement="left" column={1}>
  167. <NDescriptionsItem label="属性">
  168. {getMapValueByKey(row.sourceType, new Map(Object.entries(musicSheetSourceType)))}
  169. </NDescriptionsItem>
  170. <NDescriptionsItem label="所属人">
  171. {getOwnerName(row.musicSheetExtend, row.sourceType)}
  172. </NDescriptionsItem>
  173. </NDescriptions>
  174. )
  175. }
  176. },
  177. {
  178. title: '适用项目',
  179. key: 'projectName',
  180. render(row: any) {
  181. return (
  182. <NSpace>
  183. <NButton
  184. type="primary"
  185. size="small"
  186. text
  187. v-auth="musicSheetApplicationExtend/save1752901206883221506"
  188. onClick={() => {
  189. state.showUseProject = true
  190. state.showUseProjectId = row.id
  191. }}
  192. >
  193. <TheTooltip
  194. content={
  195. row.musicSheetExtend && row.musicSheetExtend.useApplicationNames
  196. ? row.musicSheetExtend.useApplicationNames
  197. : ''
  198. }
  199. />
  200. <NIcon size={15} style="padding-left: 9px">
  201. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
  202. <path d="M2 26h28v2H2z" fill="currentColor"></path>
  203. <path
  204. 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"
  205. fill="currentColor"
  206. ></path>
  207. </svg>
  208. </NIcon>
  209. </NButton>
  210. {/* <NButton text onClick={()=>state.showUseProject = true}>显示适用项目</NButton> */}
  211. </NSpace>
  212. )
  213. }
  214. },
  215. {
  216. title: '更新信息',
  217. minWidth: '250px',
  218. key: 'updateBy',
  219. render(row: any) {
  220. return (
  221. <NDescriptions labelPlacement="left" column={1}>
  222. <NDescriptionsItem label="更新人">{row.updateByName}</NDescriptionsItem>
  223. <NDescriptionsItem label="更新时间">{row.updateTime}</NDescriptionsItem>
  224. </NDescriptions>
  225. )
  226. }
  227. },
  228. {
  229. title: '审核版本',
  230. minWidth: '100px',
  231. key: 'appAuditFlag',
  232. render(row: any) {
  233. return <div>{row.appAuditFlag ? '是' : '否'}</div>
  234. }
  235. },
  236. {
  237. title: '状态',
  238. minWidth: '50px',
  239. key: 'status',
  240. render(row: any) {
  241. return (
  242. <NTag type={row.status ? 'primary' : 'default'}>{row.status ? '启用' : '停用'}</NTag>
  243. )
  244. }
  245. },
  246. {
  247. title: '操作',
  248. key: 'operation',
  249. fixed: 'right',
  250. width: '300px',
  251. render(row: any) {
  252. return (
  253. <NSpace>
  254. <NDropdown
  255. trigger="hover"
  256. options={[
  257. { label: '五线谱', key: 'staff' },
  258. { label: '首调', key: 'firstTone' },
  259. { label: '固定调', key: 'fixedTone' }
  260. ]}
  261. onSelect={(key: string) => {
  262. state.musicPreview = true
  263. state.musicScore = row
  264. state.musicPreviewScoreType = key
  265. }}
  266. >
  267. <NButton
  268. type="primary"
  269. size="small"
  270. text
  271. onClick={(e: Event) => e.stopPropagation()}
  272. >
  273. 预览
  274. </NButton>
  275. </NDropdown>
  276. <NButton
  277. type="primary"
  278. size="small"
  279. text
  280. v-auth="musicSheet/detail1751241103201271810"
  281. onClick={() => {
  282. state.visiableMusic = true
  283. state.musicOperation = 'preview'
  284. state.musicData = row
  285. state.detailReadonly = true
  286. }}
  287. >
  288. 查看
  289. </NButton>
  290. <NButton
  291. type="primary"
  292. size="small"
  293. text
  294. disabled={row.playMode === 'MIDI'}
  295. v-auth="musicSheet/save1751241178962984962"
  296. onClick={() => {
  297. state.visiableMusic = true
  298. state.musicOperation = 'edit'
  299. state.musicData = row
  300. state.detailReadonly = true
  301. }}
  302. >
  303. 修改
  304. </NButton>
  305. <NButton
  306. type="primary"
  307. size="small"
  308. text
  309. v-auth="musicSheet/statusList1751241653309407234"
  310. onClick={() => onChangeStatus(row)}
  311. >
  312. {row.status ? '停用' : '启用'}
  313. </NButton>
  314. <NButton
  315. type="primary"
  316. size="small"
  317. text
  318. v-auth="musicSheet/img1751240591299051522"
  319. onClick={() => {
  320. state.productOpen = true
  321. state.productItem = row
  322. // handleAutoProduct(row)
  323. }}
  324. >
  325. 生成图片
  326. </NButton>
  327. <NButton
  328. type="primary"
  329. size="small"
  330. text
  331. v-auth="musicSheet/addMix1819259767120539649"
  332. onClick={() => {
  333. state.productItem = row
  334. state.beatTimeOpen = true
  335. }}
  336. >
  337. 生成节拍器音频
  338. </NButton>
  339. <NButton
  340. type="primary"
  341. size="small"
  342. text
  343. disabled={!!row.status}
  344. onClick={() => onRmove(row)}
  345. v-auth="musicSheet/remove1753457445635645442"
  346. >
  347. 删除
  348. </NButton>
  349. </NSpace>
  350. )
  351. }
  352. }
  353. ]
  354. }
  355. const checkedRowKeysRef = ref<DataTableRowKey[]>([])
  356. const handleCheck = (rowKeys: DataTableRowKey[]) => {
  357. checkedRowKeysRef.value = rowKeys
  358. }
  359. const onChangeStatus = (row: any) => {
  360. const statusStr = row.status ? '停用' : '启用'
  361. dialog.warning({
  362. title: '提示',
  363. content: `是否${statusStr}?`,
  364. positiveText: '确定',
  365. negativeText: '取消',
  366. onPositiveClick: async () => {
  367. try {
  368. await musicSheetStatusList({
  369. ids: new Array(row.id),
  370. status: !row.status
  371. })
  372. getList()
  373. message.success(`${statusStr}成功`)
  374. } catch {}
  375. }
  376. })
  377. }
  378. const onBatchChangeStatus = (status: boolean) => {
  379. const length = checkedRowKeysRef.value.length
  380. if (length == 0) {
  381. message.warning('未选择数据')
  382. }
  383. const statusStr = !status ? '停用' : '启用'
  384. dialog.warning({
  385. title: '提示',
  386. content: `是否${statusStr}` + length + `条数据?`,
  387. positiveText: '确定',
  388. negativeText: '取消',
  389. onPositiveClick: async () => {
  390. try {
  391. await musicSheetStatusList({
  392. ids: checkedRowKeysRef.value,
  393. status: status
  394. })
  395. getList()
  396. message.success(`${statusStr}成功`)
  397. } catch {}
  398. }
  399. })
  400. }
  401. const updateUserIdData = async (sourceType: any) => {
  402. if (!state.searchForm.applicationId) {
  403. return
  404. }
  405. state.userIdData = []
  406. state.searchForm.userId = null
  407. if (sourceType && sourceType !== 'PLATFORM') {
  408. const { data } = await musicSheetApplicationOwnerList({
  409. page: 1,
  410. rows: 9999,
  411. sourceType: sourceType,
  412. applicationId: state.searchForm.applicationId
  413. })
  414. const temp = data.rows || []
  415. temp.forEach((next: any) => {
  416. state.userIdData.push({
  417. ...next,
  418. label: sourceType === 'PERSON' ? next.userName : next.organizationRole,
  419. value: sourceType === 'PERSON' ? next.userId : next.organizationRoleId
  420. })
  421. })
  422. }
  423. }
  424. const onRmove = (row: any): void => {
  425. dialog.warning({
  426. title: '提示',
  427. content: `删除"${row.name}",是否继续?`,
  428. positiveText: '确定',
  429. negativeText: '取消',
  430. onPositiveClick: async () => {
  431. try {
  432. await musicSheetRemove({ id: row.id })
  433. getList()
  434. message.success('删除成功')
  435. } catch {}
  436. }
  437. })
  438. }
  439. const getList = async () => {
  440. try {
  441. state.loading = true
  442. const sourceType = state.searchForm.sourceType
  443. const userId = state.searchForm.userId
  444. let search = {
  445. ...state.searchForm,
  446. useAppId: state.searchForm.useAppId
  447. ? state.searchForm.useAppId.join(',')
  448. : state.searchForm.useAppId
  449. } as any
  450. if (sourceType) {
  451. if (sourceType == 'ORG') {
  452. search.organizationRoleId = userId
  453. search.userId = null
  454. }
  455. }
  456. const { data } = await musicSheetPage({ ...state.pagination, ...search })
  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, hiddenFlag: true })
  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: '1200px' }}
  922. >
  923. {/* <UseProject
  924. id={state.showUseProjectId}
  925. useProject={state.useProjectData}
  926. onClose={() => (state.showUseProject = false)}
  927. onGetList={getList}
  928. /> */}
  929. <MusicPlatform
  930. id={state.showUseProjectId}
  931. useProject={state.useProjectData}
  932. onClose={() => (state.showUseProject = false)}
  933. onGetList={getList} />
  934. </NModal>
  935. <NModal
  936. class={styles.productModal}
  937. title="自动生成曲谱图片"
  938. v-model:show={state.productOpen}
  939. preset="dialog"
  940. closeOnEsc={false}
  941. maskClosable={false}
  942. showIcon={false}
  943. >
  944. <MusicCreateImg
  945. xmlFileUrl={state.productItem.xmlFileUrl}
  946. onClose={() => (state.productOpen = false)}
  947. onConfirm={async (item: any) => {
  948. try {
  949. await musicSheetImg({
  950. ...item,
  951. id: state.productItem.id
  952. })
  953. } catch {}
  954. }}
  955. />
  956. </NModal>
  957. {state.beatTimeOpen && (
  958. <MusiceBeatTime
  959. id={state.productItem.id}
  960. onClose={() => {
  961. state.beatTimeOpen = false
  962. }}
  963. ></MusiceBeatTime>
  964. )}
  965. </div>
  966. )
  967. }
  968. })