index.tsx 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792
  1. import ColCropper from '@/components/col-cropper'
  2. import ColUpload from '@/components/col-upload'
  3. import request from '@/helpers/request'
  4. import { verifyNumberIntegerAndFloat } from '@/helpers/toolsValidate'
  5. import { getCodeBaseUrl } from '@/helpers/utils'
  6. import {
  7. ElButton,
  8. ElForm,
  9. ElFormItem,
  10. ElInput,
  11. ElOption,
  12. ElOptionGroup,
  13. ElRadioButton,
  14. ElRadioGroup,
  15. ElSelect,
  16. ElDialog,
  17. ElMessage,
  18. ElInputNumber,
  19. ElTooltip
  20. } from 'element-plus'
  21. import { defineComponent } from 'vue'
  22. import styles from './index.module.less'
  23. import requestOrigin from 'umi-request'
  24. import { FormatXMLInfo, getXmlInfo } from './music-xml'
  25. import MessageTip from './message-tip'
  26. import ListenAudio from './listen-audio'
  27. export type BackgroundMp3 = {
  28. url?: string
  29. id?: string
  30. trackName?: string
  31. track?: string
  32. loading?: boolean
  33. }
  34. export const validator = (rule, value, callback) => {
  35. console.log(value)
  36. if (value == '') {
  37. callback(new Error('请输入收费价格'))
  38. } else if (Number(value) <= 0) {
  39. callback(new Error('收费金额必须大于0'))
  40. } else {
  41. callback()
  42. }
  43. }
  44. export default defineComponent({
  45. name: 'music-operation',
  46. data() {
  47. const query = this.$route.query
  48. return {
  49. type: query.type || 'create',
  50. subjectList: [],
  51. tagList: [],
  52. submitLoading: false,
  53. reason: '',
  54. formated: {} as FormatXMLInfo,
  55. musicSheetAuthRecordId: null as any,
  56. auditStatus: '' as any,
  57. form: {
  58. musicCover: '',
  59. accompanimentType: 'HOMEMODE',
  60. playMode: 'MP3',
  61. xmlFileUrl: '',
  62. playSpeed: '100',
  63. mp3Url: '',
  64. // bgmp3Url: '',
  65. midiFileUrl: '',
  66. name: '',
  67. composer: '',
  68. remark: '',
  69. tags: [] as any[],
  70. paymentType: 'FREE',
  71. musicPrice: '',
  72. backgroundMp3s: [] as BackgroundMp3[]
  73. },
  74. radioList: [], // 选中的人数
  75. tagStatus: false,
  76. music_sheet_service_fee: 0,
  77. music_account_period: 0,
  78. visibleShow: false,
  79. visibleShow2: false,
  80. visibleAudio: false,
  81. fileInfo: {} as any,
  82. messageTipTitle: '上传须知',
  83. messageTipType: 'upload' as 'upload' | 'error' | 'origin',
  84. cbsInstrumentList: [] as any
  85. }
  86. },
  87. async mounted() {
  88. const isCatchTip = localStorage.getItem('isCatchTip')
  89. if (!isCatchTip) {
  90. this.visibleShow = true
  91. }
  92. document.title = this.type === 'create' ? '新建曲谱' : '编辑曲谱'
  93. try {
  94. await request
  95. .get('/api-website/sysConfig/queryByParamNameList', {
  96. params: {
  97. paramNames: 'music_sheet_service_fee,music_account_period'
  98. }
  99. })
  100. .then((res: any) => {
  101. console.log(res, 'res')
  102. const data = res.data || []
  103. data.forEach((item: any) => {
  104. if (item.paramName === 'music_sheet_service_fee') {
  105. this.music_sheet_service_fee = item.paramValue
  106. } else if (item.paramName === 'music_account_period') {
  107. this.music_account_period = item.paramValue
  108. }
  109. })
  110. })
  111. // await request.get('/api-website/open/subject/subjectSelect').then(res => {
  112. // this.subjectList = res.data || []
  113. // })
  114. await request.get('/api-website/open/MusicTag/tree').then(res => {
  115. this.tagList = res.data || []
  116. })
  117. await request
  118. .post('/api-teacher/musicalInstrument/list')
  119. .then((response: any) => {
  120. const data = response.data || []
  121. data.forEach((item: any) => {
  122. this.cbsInstrumentList.push({
  123. id: item.id,
  124. name: item.name,
  125. code: item.code,
  126. loading: false
  127. })
  128. })
  129. })
  130. if (this.$route.query.id) {
  131. this.setDetail(this.$route.query.id as string)
  132. }
  133. } catch {
  134. //
  135. }
  136. },
  137. watch: {
  138. formated() {
  139. this.mergeXmlData(this.formated)
  140. }
  141. },
  142. computed: {
  143. auditDisabled(): boolean {
  144. return this.auditStatus === 'DOING'
  145. }
  146. },
  147. methods: {
  148. mergeXmlData(data: FormatXMLInfo) {
  149. this.formated = data
  150. // this.backgroundMp3s = data.partNames.map((partName: string) => ({
  151. // track: partName
  152. // }))
  153. if (!this.form.name) {
  154. this.form.name = data.title
  155. }
  156. if (!this.form.composer) {
  157. this.form.composer = data.composer
  158. }
  159. if (data.speed) {
  160. this.form.playSpeed = '' + data.speed
  161. }
  162. },
  163. async setDetail(id: string) {
  164. try {
  165. const { data } = await request.get(
  166. '/api-website/open/music/sheet/detail/' + id
  167. )
  168. this.musicSheetAuthRecordId = data.musicSheetAuthRecordId // 审核编号
  169. this.auditStatus = data.auditStatus // 状态
  170. this.form.playMode = data.audioType || 'MP3'
  171. this.form.xmlFileUrl = data.xmlFileUrl
  172. this.form.name = data.musicSheetName
  173. this.form.composer = data.composer
  174. this.form.playSpeed = data.playSpeed
  175. // this.form.tags = data.musicTag?.split(',')
  176. // const names = data.musicTagNames.split(',')
  177. this.form.tags = data.musicTag.split(',')
  178. this.form.tags = this.form.tags
  179. .filter((el: any) => {
  180. return el != ''
  181. })
  182. .map(e => Number(e))
  183. // for (let i = 0; i < names.length; i++) {
  184. // this.form.tagsNames[this.form.tags[i]] = names[i]
  185. // }
  186. this.form.musicCover = data.titleImg
  187. this.form.midiFileUrl = data.midiUrl
  188. this.form.mp3Url = data.metronomeUrl
  189. this.form.remark = data.remark
  190. this.form.paymentType = data.paymentType
  191. this.form.musicPrice = data.musicPrice || 0
  192. // this.form.extConfigJson = data.extConfigJson
  193. this.form.backgroundMp3s = data.background.map((item: any) => {
  194. return {
  195. url: item.audioFileUrl,
  196. trackName: item.musicalInstrumentName,
  197. id: item.musicalInstrumentId,
  198. track: item.track,
  199. loading: false
  200. }
  201. })
  202. } catch (error) {
  203. console.log(error)
  204. }
  205. },
  206. createSubmitData() {
  207. const { form } = this
  208. return {
  209. musicSheetJson: {
  210. playMode: form.playMode, // 播放模式
  211. xmlFileUrl: form.xmlFileUrl, // XML
  212. name: form.name, // 曲目名称
  213. composer: form.composer, // 音乐人
  214. playSpeed: form.playSpeed, // 曲目速度
  215. musicTagIds: form.tags?.join(','),
  216. remark: form.remark,
  217. musicCover: form.musicCover, // 曲目封面
  218. multiTracksSelection: form.backgroundMp3s
  219. .map(item => item.track)
  220. ?.join(','), // 声轨名
  221. midiFileUrl: form.midiFileUrl, // MID文件
  222. musicPrice: form.musicPrice,
  223. paymentType: form.paymentType,
  224. musicSheetAccompanimentList: [
  225. {
  226. audioFileUrl: form.mp3Url,
  227. sortNumber: 1,
  228. audioPlayType: 'PLAY'
  229. }
  230. ], // 伴奏
  231. // playMode: 'HOMEMODE', // HOMEMODE 默认自制
  232. musicSheetSoundList: form.backgroundMp3s.map(item => ({
  233. musicalInstrumentId: item.id,
  234. musicalInstrumentName: item.trackName,
  235. audioFileUrl: item.url,
  236. track: item.track,
  237. audioPlayType: 'PLAY' // SING
  238. })), // 原音
  239. musicalInstrumentIds: form.backgroundMp3s
  240. .map(item => item.id)
  241. ?.join(','), // 乐器编号
  242. extConfigJson: '{"repeatedBeats":0,"gradualTimes":{},"isEvxml":0}'
  243. }
  244. }
  245. },
  246. onFormatter(e: any) {
  247. e.target.value = verifyNumberIntegerAndFloat(e.target.value)
  248. },
  249. readerFile(file: string) {
  250. requestOrigin(file).then(res => {
  251. // this.formated = getXmlInfo(res)
  252. const formated = getXmlInfo(res)
  253. let resultIndexStatus = false
  254. const partNames = formated.partNames || []
  255. const tempMp3s: BackgroundMp3[] = []
  256. for (const i of partNames) {
  257. let index = -1
  258. this.cbsInstrumentList.forEach((item: any, j: number) => {
  259. const code = item.code ? item.code.split(',') : ''
  260. for (const p of code) {
  261. if (i.indexOf(p) > -1) {
  262. index = j
  263. }
  264. }
  265. })
  266. if (index === -1) {
  267. resultIndexStatus = true
  268. break
  269. }
  270. const currentItem = this.cbsInstrumentList[index]
  271. if (currentItem) {
  272. tempMp3s.push({
  273. url: '',
  274. id: currentItem.id,
  275. trackName: currentItem.name,
  276. track: i,
  277. loading: currentItem.loading
  278. })
  279. }
  280. }
  281. if (partNames.length <= 0 || resultIndexStatus) {
  282. this.visibleShow2 = true
  283. this.form.xmlFileUrl = ''
  284. return
  285. }
  286. this.formated = formated
  287. this.form.backgroundMp3s = tempMp3s
  288. console.log(this.form.backgroundMp3s, '121212', tempMp3s)
  289. })
  290. },
  291. onSubmit() {
  292. ;(this as any).$refs.form.validate(async (valid: any) => {
  293. if (valid) {
  294. this.submitLoading = true
  295. try {
  296. if (this.$route.query.id) {
  297. await request.post('/api-teacher/musicSheetAuthRecord/update', {
  298. data: {
  299. ...this.createSubmitData(),
  300. id: this.musicSheetAuthRecordId
  301. }
  302. })
  303. } else {
  304. await request.post('/api-teacher/musicSheetAuthRecord/save', {
  305. data: this.createSubmitData()
  306. })
  307. }
  308. this.submitLoading = false
  309. ElMessage.success('上传成功')
  310. sessionStorage.setItem('musicActiveName', 'DOING')
  311. this.$router.back()
  312. } catch (error) {
  313. this.submitLoading = false
  314. }
  315. } else {
  316. this.$nextTick(() => {
  317. const isError = document.getElementsByClassName('is-error')
  318. isError[0].scrollIntoView({
  319. block: 'center',
  320. behavior: 'smooth'
  321. })
  322. })
  323. return false
  324. }
  325. })
  326. },
  327. onDetail(type: string) {
  328. let url = `${getCodeBaseUrl('/teacher')}/#/registerProtocol`
  329. if (type === 'question') {
  330. url = `${getCodeBaseUrl('/teacher')}/muic-standard/question.html`
  331. } else if (type === 'music') {
  332. url = `${getCodeBaseUrl('/teacher')}/muic-standard/index.html`
  333. }
  334. window.open(url)
  335. }
  336. },
  337. render() {
  338. return (
  339. <div class={styles.form}>
  340. <div class="text-2xl font-semibold text-black leading-none px-6 py-5 flex justify-between">
  341. {this.type === 'create' ? '新建曲谱' : '编辑曲谱'}
  342. <div
  343. class={styles.uploadTips}
  344. onClick={() => (this.visibleShow = true)}
  345. >
  346. 上传须知
  347. </div>
  348. </div>
  349. <ElForm
  350. size="large"
  351. labelPosition="left"
  352. labelWidth={'150px'}
  353. model={this.form}
  354. ref="form"
  355. class="px-7 py-5"
  356. disabled={this.auditDisabled}
  357. >
  358. <div class={styles.fAlert}>曲目上传</div>
  359. <ElFormItem
  360. label="播放类型"
  361. prop="playMode"
  362. rules={[{ required: true, message: '请选择播放类型' }]}
  363. >
  364. <ElRadioGroup v-model={this.form.playMode}>
  365. <ElRadioButton label={'MP3'} class="mr-3 w-24">
  366. MP3
  367. </ElRadioButton>
  368. <ElRadioButton label={'MIDI'} class="w-24">
  369. MIDI
  370. </ElRadioButton>
  371. </ElRadioGroup>
  372. </ElFormItem>
  373. {this.form.playMode === 'MP3' ? (
  374. <ElFormItem
  375. label="上传伴奏"
  376. prop="mp3Url"
  377. rules={[{ required: true, message: '请选择伴奏' }]}
  378. >
  379. <ColUpload
  380. isPreview={this.form.mp3Url ? true : false}
  381. v-model:modelValue={this.form.mp3Url}
  382. bucket={'cloud-coach'}
  383. accept={'.mp3'}
  384. uploadType={'file'}
  385. disabled={this.auditDisabled}
  386. type="music"
  387. btnText="上传伴奏文件"
  388. size={50}
  389. onPreview={(fileInfo: any) => {
  390. this.visibleAudio = true;
  391. this.fileInfo = fileInfo
  392. }}
  393. extraTips="仅支持MP3格式文件,文件最大不能超过50MB"
  394. />
  395. </ElFormItem>
  396. ) : (
  397. <ElFormItem
  398. label="MIDI文件"
  399. prop="midiFileUrl"
  400. rules={[{ required: true, message: '请选择MIDI文件' }]}
  401. >
  402. <ColUpload
  403. isPreview={this.form.midiFileUrl ? true : false}
  404. v-model:modelValue={this.form.midiFileUrl}
  405. bucket={'cloud-coach'}
  406. accept={'.midi,.mid'}
  407. disabled={this.auditDisabled}
  408. uploadType={'file'}
  409. type="music"
  410. btnText="上传MIDI文件"
  411. size={8}
  412. extraTips="仅支持MID格式文件,文件最大不能超过8MB"
  413. />
  414. </ElFormItem>
  415. )}
  416. <ElFormItem
  417. label="上传XML"
  418. prop="xmlFileUrl"
  419. rules={[{ required: true, message: '请选择XML文件' }]}
  420. >
  421. <ColUpload
  422. v-model:modelValue={this.form.xmlFileUrl}
  423. bucket={'cloud-coach'}
  424. accept={'application/xml'}
  425. uploadType={'file'}
  426. isOnlyUpload={this.form.xmlFileUrl ? true : false}
  427. disabled={this.auditDisabled}
  428. type="music"
  429. btnText="上传XML文件"
  430. extraTips="仅支持XML格式文件,文件最大不能超过8MB"
  431. onChange={this.readerFile}
  432. onRemove={() => {
  433. this.form.backgroundMp3s = []
  434. }}
  435. />
  436. </ElFormItem>
  437. {this.form.backgroundMp3s.length > 0 && this.form.playMode === 'MP3' && (
  438. <ElFormItem>
  439. {{
  440. label: () => (
  441. <div class="flex items-center">
  442. <i style="color: var(--el-color-danger);margin-right: 4px;">
  443. *
  444. </i>
  445. 上传原音
  446. <ElTooltip effect="dark" placement="top">
  447. {{
  448. content: () => (
  449. <div class="w-[445px]">
  450. 1、同一首曲目不可重复上传,如有不同版本统一用“()”补充。举例:人生的旋转木马(长笛二重奏版)
  451. <br />
  452. 2、曲目名后可添加曲目信息备注,包含但不限于曲目类型等。曲目名《XXX》,举例:人声的旋转木马《哈尔的移动城堡》(长笛二重奏版)
  453. <br />
  454. 3、其他信息不要写在曲目名里,如歌手、上传人员昵称等。
  455. </div>
  456. ),
  457. default: () => <i class={styles.iconQesution}></i>
  458. }}
  459. </ElTooltip>
  460. </div>
  461. ),
  462. default: () => (
  463. <>
  464. {this.form.backgroundMp3s.map((mp3, index) => (
  465. <ElFormItem
  466. prop={`backgroundMp3s.${index}.url`}
  467. rules={[
  468. {
  469. required: true,
  470. message: '请选择原音文件',
  471. trigger: 'blur,change'
  472. }
  473. ]}
  474. class={styles.formItem}
  475. >
  476. <div style="line-height: 1; font-weight: 500;font-size: 16px;color: #131415; padding-bottom: 12px;">
  477. 所属轨道:{mp3.trackName}
  478. </div>
  479. <ColUpload
  480. isPreview={mp3.url ? true : false}
  481. onPreview={(fileInfo: any) => {
  482. this.visibleAudio = true;
  483. this.fileInfo = fileInfo
  484. }}
  485. v-model:modelValue={mp3.url}
  486. bucket={'cloud-coach'}
  487. accept={'.mp3'}
  488. uploadType={'file'}
  489. disabled={this.auditDisabled}
  490. class={styles.uploadCon}
  491. size={50}
  492. type="music"
  493. btnText="上传原音文件"
  494. extraTips="仅支持MP3格式文件,文件最大不能超过50MB"
  495. />
  496. </ElFormItem>
  497. ))}
  498. </>
  499. )
  500. }}
  501. </ElFormItem>
  502. )}
  503. <div class={styles.fAlert}>曲目信息</div>
  504. <ElFormItem
  505. label="曲目名称"
  506. prop="name"
  507. rules={[{ required: true, message: '请输入曲目名称' }]}
  508. >
  509. <ElInput
  510. v-model={this.form.name}
  511. placeholder="请选择曲目名称"
  512. // eslint-disable-next-line @typescript-eslint/ban-ts-comment
  513. // @ts-ignore
  514. maxlength={50}
  515. showWordLimit
  516. />
  517. </ElFormItem>
  518. <ElFormItem
  519. label="音乐人"
  520. prop="composer"
  521. rules={[{ required: true, message: '请输入音乐人' }]}
  522. >
  523. <ElInput
  524. v-model={this.form.composer}
  525. placeholder="请输入音乐人"
  526. // eslint-disable-next-line @typescript-eslint/ban-ts-comment
  527. // @ts-ignore
  528. maxlength={14}
  529. showWordLimit
  530. />
  531. </ElFormItem>
  532. <ElFormItem label="曲目描述" prop="remark">
  533. <ElInput
  534. v-model={this.form.remark}
  535. placeholder="请输入曲目描述"
  536. // eslint-disable-next-line @typescript-eslint/ban-ts-comment
  537. // @ts-ignore
  538. maxlength={200}
  539. showWordLimit
  540. type="textarea"
  541. />
  542. </ElFormItem>
  543. <ElFormItem
  544. label="曲谱封面"
  545. prop="musicCover"
  546. rules={[
  547. {
  548. required: true,
  549. message: '请上传曲谱封面'
  550. }
  551. ]}
  552. >
  553. <ColCropper
  554. modelValue={this.form.musicCover}
  555. bucket={'cloud-coach'}
  556. cropUploadSuccess={(data: any) => {
  557. this.form.musicCover = data
  558. }}
  559. onRemove={() => {
  560. this.form.musicCover = ''
  561. }}
  562. delete={!this.auditDisabled}
  563. disabled={this.auditDisabled}
  564. domSize={{ height: '150px' }}
  565. options={{
  566. title: '曲谱封面',
  567. enlarge: 2,
  568. autoCropWidth: 300,
  569. autoCropHeight: 300
  570. }}
  571. />
  572. </ElFormItem>
  573. <ElFormItem
  574. label="曲目速度"
  575. prop="playSpeed"
  576. rules={[{ required: true, message: '请输入曲目速度' }]}
  577. >
  578. <ElInputNumber
  579. controls={false}
  580. v-model={this.form.playSpeed}
  581. placeholder="请输入曲目速度"
  582. min={45}
  583. max={270}
  584. />
  585. </ElFormItem>
  586. <ElFormItem
  587. label="曲目标签"
  588. prop="tags"
  589. rules={[{ required: true, message: '请选择曲目标签' }]}
  590. >
  591. <ElSelect
  592. multiple
  593. v-model={this.form.tags}
  594. placeholder="请选择曲目标签"
  595. multipleLimit={3}
  596. class="w-full"
  597. >
  598. {this.tagList.map((item: any) => (
  599. <ElOption key={item.id} value={item.id} label={item.name} />
  600. ))}
  601. </ElSelect>
  602. {/* </div> */}
  603. </ElFormItem>
  604. <ElFormItem
  605. label="是否收费"
  606. prop="paymentType"
  607. rules={[{ required: true, message: '请选择是否收费' }]}
  608. >
  609. <ElRadioGroup v-model={this.form.paymentType}>
  610. <ElRadioButton label={'CHARGE'} class="mr-3 w-24">
  611. </ElRadioButton>
  612. <ElRadioButton label={'FREE'} class="w-24">
  613. </ElRadioButton>
  614. </ElRadioGroup>
  615. </ElFormItem>
  616. {this.form.paymentType === 'CHARGE' && (
  617. <>
  618. <ElFormItem
  619. label="收费价格"
  620. prop="musicPrice"
  621. rules={[{ required: true, validator }]}
  622. >
  623. <ElInput
  624. v-model={this.form.musicPrice}
  625. placeholder="请输入收费价格"
  626. // eslint-disable-next-line @typescript-eslint/ban-ts-comment
  627. // @ts-ignore
  628. maxlength={5}
  629. onKeyup={this.onFormatter}
  630. v-slots={{
  631. suffix: () => <span class="text-base text-[#999]">元</span>
  632. }}
  633. />
  634. </ElFormItem>
  635. <ElFormItem>
  636. <div class={styles.rule}>
  637. <p>
  638. 扣除手续费后该曲目预计收入为:
  639. <span>
  640. {((parseFloat(this.form.musicPrice || '0') || 0) *
  641. (100 - this.music_sheet_service_fee)) /
  642. 100}
  643. <span>元/人</span>
  644. </span>
  645. </p>
  646. <p>
  647. 您的乐谱收入在学员购买后{this.music_account_period}
  648. 天结算到您的账户中
  649. </p>
  650. </div>
  651. </ElFormItem>
  652. </>
  653. )}
  654. </ElForm>
  655. {!this.auditDisabled && (
  656. <div class="text-center pt-6 pb-7">
  657. <ElButton
  658. class="!w-44 !h-[48px]"
  659. round
  660. onClick={() => {
  661. this.$router.back()
  662. }}
  663. >
  664. 取消
  665. </ElButton>
  666. <ElButton
  667. type="primary"
  668. class="!w-44 !h-[48px]"
  669. round
  670. onClick={this.onSubmit}
  671. loading={this.submitLoading}
  672. >
  673. 提交审核
  674. </ElButton>
  675. </div>
  676. )}
  677. {/* <ElDialog
  678. modelValue={this.tagStatus}
  679. onUpdate:modelValue={val => (this.tagStatus = val)}
  680. width="35%"
  681. title="全部标签"
  682. >
  683. {this.tagList.map((item: any, index: number) => (
  684. <div class={[styles.tags, 'py-2']}>
  685. <div class="text-sm pb-2">{item.name}</div>
  686. {item.children.map((child: any) => (
  687. <ElRadioGroup v-model={this.radioList[index]} class="pb-2">
  688. <ElRadioButton label={child.id} class="mr-3">
  689. {child.name}
  690. </ElRadioButton>
  691. </ElRadioGroup>
  692. ))}
  693. </div>
  694. ))}
  695. <div class="text-center pt-2">
  696. <ElButton
  697. class="!w-36 !h-[48px]"
  698. round
  699. size="large"
  700. onClick={() => {
  701. this.radioList = []
  702. }}
  703. >
  704. 重置
  705. </ElButton>
  706. <ElButton
  707. class="!w-36 !h-[48px]"
  708. round
  709. size="large"
  710. type="primary"
  711. onClick={() => {
  712. this.form.tags = this.radioList.filter((el: any) => {
  713. return el != ''
  714. })
  715. this.tagStatus = false
  716. ;(this as any).$refs.form.clearValidate('tags')
  717. }}
  718. >
  719. 确认
  720. </ElButton>
  721. </div>
  722. </ElDialog> */}
  723. <ElDialog
  724. modelValue={this.visibleShow}
  725. onUpdate:modelValue={val => (this.visibleShow = val)}
  726. destroyOnClose={true}
  727. customClass={styles.messageDialog}
  728. >
  729. <MessageTip
  730. type={'upload'}
  731. title={'上传须知'}
  732. onConfirm={() => {
  733. localStorage.setItem('isCatchTip', '1')
  734. this.visibleShow = false
  735. }}
  736. />
  737. </ElDialog>
  738. <ElDialog
  739. modelValue={this.visibleShow2}
  740. onUpdate:modelValue={val => (this.visibleShow2 = val)}
  741. destroyOnClose={true}
  742. customClass={styles.messageDialog2}
  743. >
  744. <MessageTip
  745. type={'error'}
  746. title={'解析失败'}
  747. onConfirm={() => (this.visibleShow2 = false)}
  748. />
  749. </ElDialog>
  750. <ElDialog
  751. modelValue={this.visibleAudio}
  752. onUpdate:modelValue={val => (this.visibleAudio = val)}
  753. destroyOnClose={true}
  754. customClass={styles.messageDialog3}
  755. appendToBody
  756. >
  757. {this.visibleAudio && <ListenAudio fileInfo={this.fileInfo} />}
  758. </ElDialog>
  759. </div>
  760. )
  761. }
  762. })