|
@@ -1,4 +1,4 @@
|
|
|
-import type {SelectOption} from 'naive-ui'
|
|
|
+import type { SelectOption } from 'naive-ui'
|
|
|
import {
|
|
|
NAlert,
|
|
|
NButton,
|
|
@@ -20,19 +20,19 @@ import {
|
|
|
useDialog,
|
|
|
useMessage
|
|
|
} from 'naive-ui'
|
|
|
-import {defineComponent, onMounted, PropType, reactive, ref} from 'vue'
|
|
|
-import {musicSheetCategoriesQueryTree, musicSheetDetail, musicSheetSave} from '../../api'
|
|
|
+import { defineComponent, onMounted, PropType, reactive, ref } from 'vue'
|
|
|
+import { musicSheetCategoriesQueryTree, musicSheetDetail, musicSheetSave } from '../../api'
|
|
|
import UploadFile from '@/components/upload-file'
|
|
|
import styles from './index.module.less'
|
|
|
import deepClone from '@/utils/deep.clone'
|
|
|
import axios from 'axios'
|
|
|
-import {appKey, clientType, musicSheetSourceType, musicSheetType} from '@/utils/constant'
|
|
|
-import {getMapValueByKey, getSelectDataFromObj} from '@/utils/objectUtil'
|
|
|
-import {musicalInstrumentPage} from '@views/system-manage/subject-manage/api'
|
|
|
-import {subjectPage} from '@views/system-manage/api'
|
|
|
+import { appKey, clientType, musicSheetSourceType, musicSheetType } from '@/utils/constant'
|
|
|
+import { getMapValueByKey, getSelectDataFromObj } from '@/utils/objectUtil'
|
|
|
+import { musicalInstrumentPage } from '@views/system-manage/subject-manage/api'
|
|
|
+import { subjectPage } from '@views/system-manage/api'
|
|
|
import MusicSheetOwnerDialog from '@views/music-library/music-sheet/modal/musicSheetOwnerDialog'
|
|
|
-import {sysApplicationPage} from '@views/menu-manage/api'
|
|
|
-import {filterPointCategory} from '@views/teaching-manage/unit-test'
|
|
|
+import { sysApplicationPage } from '@views/menu-manage/api'
|
|
|
+import { filterPointCategory } from '@views/teaching-manage/unit-test'
|
|
|
import MusicCreateImg from './music-create-img'
|
|
|
|
|
|
/**
|
|
@@ -159,8 +159,8 @@ export function getGradualLengthByXml(xml: string) {
|
|
|
const measureNotes = Array.from(measure.querySelectorAll('note'))
|
|
|
|
|
|
const noteInMeasureIndex = Array.from(measure.childNodes)
|
|
|
- .filter((item: any) => item.nodeName === 'note')
|
|
|
- .findIndex((item) => item === note)
|
|
|
+ .filter((item: any) => item.nodeName === 'note')
|
|
|
+ .findIndex((item) => item === note)
|
|
|
|
|
|
let allDuration = 0
|
|
|
let leftDuration = 0
|
|
@@ -214,9 +214,9 @@ export function getGradualLengthByXml(xml: string) {
|
|
|
return textContent && ks.includes(textContent)
|
|
|
})
|
|
|
if (
|
|
|
- ele.type === 'metronome' ||
|
|
|
- (ele.type === 'words' && (textContent.startsWith('a tempo') || isKeyWork)) ||
|
|
|
- isLastNoteAndNotClosed
|
|
|
+ ele.type === 'metronome' ||
|
|
|
+ (ele.type === 'words' && (textContent.startsWith('a tempo') || isKeyWork)) ||
|
|
|
+ isLastNoteAndNotClosed
|
|
|
) {
|
|
|
const indexOf = gradualNotes.findIndex((item) => item.length === 1)
|
|
|
if (indexOf > -1 && ele.index > gradualNotes[indexOf]?.[0].start) {
|
|
@@ -255,8 +255,7 @@ export default defineComponent({
|
|
|
},
|
|
|
data: {
|
|
|
type: Object as PropType<any>,
|
|
|
- default: () => {
|
|
|
- }
|
|
|
+ default: () => {}
|
|
|
},
|
|
|
tagList: {
|
|
|
type: Array as PropType<Array<SelectOption>>,
|
|
@@ -265,7 +264,7 @@ export default defineComponent({
|
|
|
subjectList: {
|
|
|
type: Array as PropType<Array<SelectOption>>,
|
|
|
default: () => []
|
|
|
- },
|
|
|
+ }
|
|
|
// musicSheetCategories: {
|
|
|
// type: Array as PropType<Array<SelectOption>>,
|
|
|
// default: () => []
|
|
@@ -273,7 +272,7 @@ export default defineComponent({
|
|
|
},
|
|
|
emits: ['close', 'getList'],
|
|
|
|
|
|
- setup(props, {slots, attrs, emit}) {
|
|
|
+ setup(props, { slots, attrs, emit }) {
|
|
|
const forms = reactive({
|
|
|
graduals: {} as any, // 渐变速度
|
|
|
playMode: 'MP3', // 播放类型
|
|
@@ -299,9 +298,9 @@ export default defineComponent({
|
|
|
appAuditFlag: 0, // 是否审核版本
|
|
|
midiFileUrl: null, // 伴奏文件 MIDI文件(保留字段)
|
|
|
subjectIds: [] as any, // 可用声部
|
|
|
- musicalInstrumentIdList: [] as any, //可用乐器
|
|
|
- musicCategoryId: null, //曲目分类
|
|
|
- musicSheetAccompanimentList: [] as any, //曲目伴奏
|
|
|
+ musicalInstrumentIdList: [] as any, //可用乐器
|
|
|
+ musicCategoryId: null, //曲目分类
|
|
|
+ musicSheetAccompanimentList: [] as any, //曲目伴奏
|
|
|
audioType: 'HOMEMODE', // 伴奏类型
|
|
|
isPlayBeat: true, // 是否播放节拍器
|
|
|
isUseSystemBeat: true, // 是否使用系统节拍器(0:否;1:是)
|
|
@@ -310,12 +309,12 @@ export default defineComponent({
|
|
|
multiTracksSelection: [] as any, // 声轨
|
|
|
musicSheetExtend: {} as any, //所属人信息
|
|
|
musicImg: '', // 五线谱图片
|
|
|
- musicSvg: '', //首调图片
|
|
|
- musicJianSvg: '' // 简谱固定调
|
|
|
+ musicFirstImg: '', //首调图片
|
|
|
+ musicJianImg: '' // 简谱固定调
|
|
|
})
|
|
|
const state = reactive({
|
|
|
loading: false,
|
|
|
- previewMode: false,//是否是预览模式
|
|
|
+ previewMode: false, //是否是预览模式
|
|
|
tagList: [...props.tagList] as any, // 标签列表
|
|
|
xmlFirstSpeed: null as any, // 第一个音轨速度
|
|
|
partListNames: [] as any, // 所有音轨声部列表
|
|
@@ -442,29 +441,29 @@ export default defineComponent({
|
|
|
if (!xml) return
|
|
|
const xmlParse = new DOMParser().parseFromString(xml, 'text/xml')
|
|
|
// 乐器
|
|
|
- const instrumentCodeList: any = [];
|
|
|
- const instrumentEle = xmlParse.getElementsByTagName('virtual-instrument');
|
|
|
+ const instrumentCodeList: any = []
|
|
|
+ const instrumentEle = xmlParse.getElementsByTagName('virtual-instrument')
|
|
|
for (let index = 0; index < instrumentEle.length; index++) {
|
|
|
const note = instrumentEle[index]
|
|
|
- const instrumentCode = note.getElementsByTagName('virtual-name')?.[0]?.textContent || '';
|
|
|
+ const instrumentCode = note.getElementsByTagName('virtual-name')?.[0]?.textContent || ''
|
|
|
if (instrumentCode && !instrumentCodeList.includes(instrumentCode)) {
|
|
|
- instrumentCodeList.push(instrumentCode);
|
|
|
+ instrumentCodeList.push(instrumentCode)
|
|
|
}
|
|
|
}
|
|
|
- const codeIdMap = new Map<string, string>();
|
|
|
+ const codeIdMap = new Map<string, string>()
|
|
|
state.instrumentData.forEach((data: any) => {
|
|
|
- codeIdMap.set(data.code, data.id + '');
|
|
|
+ codeIdMap.set(data.code, data.id + '')
|
|
|
})
|
|
|
- forms.musicalInstrumentIdList = [];
|
|
|
+ forms.musicalInstrumentIdList = []
|
|
|
instrumentCodeList.forEach((code: string) => {
|
|
|
if (codeIdMap.has(code)) {
|
|
|
- forms.musicalInstrumentIdList.push(codeIdMap.get(code));
|
|
|
+ forms.musicalInstrumentIdList.push(codeIdMap.get(code))
|
|
|
}
|
|
|
})
|
|
|
|
|
|
// 声部
|
|
|
if (forms.musicalInstrumentIdList.length > 0) {
|
|
|
- showBackSubject(forms.musicalInstrumentIdList);
|
|
|
+ showBackSubject(forms.musicalInstrumentIdList)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -482,9 +481,7 @@ export default defineComponent({
|
|
|
}
|
|
|
})
|
|
|
|
|
|
- partListNames = partListNames.filter(
|
|
|
- (n: any) => n.value?.toLocaleUpperCase?.() != 'COMMON'
|
|
|
- )
|
|
|
+ partListNames = partListNames.filter((n: any) => n.value?.toLocaleUpperCase?.() != 'COMMON')
|
|
|
|
|
|
if (partListNames.length > 0) {
|
|
|
forms.musicSheetSoundList = forms.musicSheetSoundList.slice(0, partListNames.length)
|
|
@@ -509,7 +506,9 @@ export default defineComponent({
|
|
|
// )
|
|
|
const partListNames = deepClone(state.partListNames) || []
|
|
|
partListNames.forEach((item: any) => {
|
|
|
- const index = forms.musicSheetSoundList.findIndex((ground: any) => item.value == ground.track)
|
|
|
+ const index = forms.musicSheetSoundList.findIndex(
|
|
|
+ (ground: any) => item.value == ground.track
|
|
|
+ )
|
|
|
if (index > -1 && track == item.value) {
|
|
|
item.disabled = false
|
|
|
} else {
|
|
@@ -705,7 +704,6 @@ export default defineComponent({
|
|
|
const extConfigJson = data.extConfigJson ? JSON.parse(data.extConfigJson) : {}
|
|
|
forms.graduals = extConfigJson.gradualTimes || {}
|
|
|
forms.repeatedBeats = !!extConfigJson.repeatedBeats
|
|
|
-
|
|
|
} catch (error) {}
|
|
|
forms.evaluationStandard = data.evaluationStandard
|
|
|
forms.musicSheetExtend = data.musicSheetExtend
|
|
@@ -719,23 +717,21 @@ export default defineComponent({
|
|
|
state.partListNames = getPartListNames(res?.data as any) as any
|
|
|
|
|
|
// 初始化音轨和原音
|
|
|
- forms.multiTracksSelection = data.multiTracksSelection?.split(',')||[]
|
|
|
+ forms.multiTracksSelection = data.multiTracksSelection?.split(',') || []
|
|
|
|
|
|
- const existSoundList = data.musicSheetSoundList || [];
|
|
|
+ const existSoundList = data.musicSheetSoundList || []
|
|
|
state.partListNames.forEach((item: any) => {
|
|
|
- let audioFileUrl;
|
|
|
+ let audioFileUrl
|
|
|
existSoundList.forEach((next: any) => {
|
|
|
- if(next.track == item.value){
|
|
|
+ if (next.track == item.value) {
|
|
|
audioFileUrl = next.audioFileUrl
|
|
|
}
|
|
|
})
|
|
|
forms.musicSheetSoundList.push({
|
|
|
audioFileUrl: audioFileUrl, // 原音
|
|
|
- track: item.value, // 轨道
|
|
|
+ track: item.value // 轨道
|
|
|
})
|
|
|
})
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
})
|
|
|
} catch (error) {}
|
|
@@ -767,15 +763,15 @@ export default defineComponent({
|
|
|
</NAlert>
|
|
|
<NGrid cols={2}>
|
|
|
<NFormItemGi
|
|
|
- label="曲目名称"
|
|
|
- path="name"
|
|
|
- rule={[
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: '请输入曲目名称',
|
|
|
- trigger: ['input', 'blur']
|
|
|
- }
|
|
|
- ]}
|
|
|
+ label="曲目名称"
|
|
|
+ path="name"
|
|
|
+ rule={[
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入曲目名称',
|
|
|
+ trigger: ['input', 'blur']
|
|
|
+ }
|
|
|
+ ]}
|
|
|
>
|
|
|
<NInput
|
|
|
v-model:value={forms.name}
|
|
@@ -785,15 +781,15 @@ export default defineComponent({
|
|
|
/>
|
|
|
</NFormItemGi>
|
|
|
<NFormItemGi
|
|
|
- label="音乐人"
|
|
|
- path="composer"
|
|
|
- rule={[
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: '请输入音乐人',
|
|
|
- trigger: ['input', 'blur']
|
|
|
- }
|
|
|
- ]}
|
|
|
+ label="音乐人"
|
|
|
+ path="composer"
|
|
|
+ rule={[
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入音乐人',
|
|
|
+ trigger: ['input', 'blur']
|
|
|
+ }
|
|
|
+ ]}
|
|
|
>
|
|
|
<NInput
|
|
|
v-model:value={forms.composer}
|
|
@@ -821,7 +817,7 @@ export default defineComponent({
|
|
|
{
|
|
|
required: true,
|
|
|
message: '请上传曲目封面',
|
|
|
- trigger:['input','blur']
|
|
|
+ trigger: ['input', 'blur']
|
|
|
}
|
|
|
]}
|
|
|
>
|
|
@@ -854,7 +850,7 @@ export default defineComponent({
|
|
|
{
|
|
|
required: true,
|
|
|
message: '请选择曲目类型',
|
|
|
- trigger:'change'
|
|
|
+ trigger: 'change'
|
|
|
}
|
|
|
]}
|
|
|
>
|
|
@@ -872,7 +868,7 @@ export default defineComponent({
|
|
|
{
|
|
|
required: true,
|
|
|
message: '请选择作者属性',
|
|
|
- trigger:'change'
|
|
|
+ trigger: 'change'
|
|
|
}
|
|
|
]}
|
|
|
>
|
|
@@ -901,7 +897,7 @@ export default defineComponent({
|
|
|
{
|
|
|
required: true,
|
|
|
message: '请选择曲目所属人',
|
|
|
- trigger:['input','change']
|
|
|
+ trigger: ['input', 'change']
|
|
|
}
|
|
|
]}
|
|
|
>
|
|
@@ -927,7 +923,7 @@ export default defineComponent({
|
|
|
{
|
|
|
required: true,
|
|
|
message: '请选择曲目所属机构',
|
|
|
- trigger:['input','change']
|
|
|
+ trigger: ['input', 'change']
|
|
|
}
|
|
|
]}
|
|
|
>
|
|
@@ -970,8 +966,8 @@ export default defineComponent({
|
|
|
{
|
|
|
required: true,
|
|
|
message: '请选择审核版本',
|
|
|
- trigger:'change',
|
|
|
- type:'number'
|
|
|
+ trigger: 'change',
|
|
|
+ type: 'number'
|
|
|
}
|
|
|
]}
|
|
|
>
|
|
@@ -991,14 +987,16 @@ export default defineComponent({
|
|
|
v-model:value={forms.appAuditFlag}
|
|
|
/>
|
|
|
</NFormItemGi>
|
|
|
- <NFormItemGi label="曲目分类" path="musicCategoryId"
|
|
|
- rule={[
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: '请选择曲目分类',
|
|
|
- trigger: ['change']
|
|
|
- }
|
|
|
- ]}
|
|
|
+ <NFormItemGi
|
|
|
+ label="曲目分类"
|
|
|
+ path="musicCategoryId"
|
|
|
+ rule={[
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请选择曲目分类',
|
|
|
+ trigger: ['change']
|
|
|
+ }
|
|
|
+ ]}
|
|
|
>
|
|
|
<NCascader
|
|
|
valueField="id"
|
|
@@ -1012,13 +1010,15 @@ export default defineComponent({
|
|
|
</NFormItemGi>
|
|
|
</NGrid>
|
|
|
<NGrid cols={2}>
|
|
|
- <NFormItemGi label="重复节拍时长" path="repeatedBeats"
|
|
|
- rule={[
|
|
|
- {
|
|
|
- required: false,
|
|
|
- message: '请选择是否重复节拍时长'
|
|
|
- }
|
|
|
- ]}
|
|
|
+ <NFormItemGi
|
|
|
+ label="重复节拍时长"
|
|
|
+ path="repeatedBeats"
|
|
|
+ rule={[
|
|
|
+ {
|
|
|
+ required: false,
|
|
|
+ message: '请选择是否重复节拍时长'
|
|
|
+ }
|
|
|
+ ]}
|
|
|
>
|
|
|
<NRadioGroup v-model:value={forms.repeatedBeats}>
|
|
|
<NRadio value={true}>是</NRadio>
|
|
@@ -1253,8 +1253,8 @@ export default defineComponent({
|
|
|
message: `请选择${
|
|
|
forms.musicSheetType === 'SINGLE' ? '页面渲染声轨' : '用户可切换声轨'
|
|
|
}`,
|
|
|
- trigger:'change',
|
|
|
- type:'array'
|
|
|
+ trigger: 'change',
|
|
|
+ type: 'array'
|
|
|
}
|
|
|
]}
|
|
|
>
|
|
@@ -1449,8 +1449,8 @@ export default defineComponent({
|
|
|
// 保存
|
|
|
try {
|
|
|
forms.musicImg = item.musicImg
|
|
|
- forms.musicSvg = item.musicSvg
|
|
|
- forms.musicJianSvg = item.musicJianSvg
|
|
|
+ forms.musicFirstImg = item.musicFirstImg
|
|
|
+ forms.musicJianImg = item.musicJianImg
|
|
|
onSubmit()
|
|
|
} catch (e: any) {
|
|
|
//
|