|
@@ -37,6 +37,7 @@ import MusicSheetOwnerDialog from '@views/music-library/music-sheet/modal/musicS
|
|
|
import {sysApplicationPage} from '@views/menu-manage/api'
|
|
|
import {filterPointCategory} from '@views/teaching-manage/unit-test'
|
|
|
import MusicCreateImg from './music-create-img'
|
|
|
+import MusiceBeatTime from "./musiceBeatTime"
|
|
|
|
|
|
/**
|
|
|
* 获取指定元素下一个Note元素
|
|
@@ -366,7 +367,10 @@ export default defineComponent({
|
|
|
list: [] as any[],
|
|
|
gradualRefs: [] as any[]
|
|
|
})
|
|
|
-
|
|
|
+ const beatTimeData = reactive({
|
|
|
+ beatTimeOpen: false,
|
|
|
+ musicId: ""
|
|
|
+ })
|
|
|
watch(
|
|
|
() => forms.multiTracksSelection,
|
|
|
(value) => {
|
|
@@ -393,23 +397,21 @@ export default defineComponent({
|
|
|
data.rows.map((row: any) => {
|
|
|
if (row.code) {
|
|
|
row.code.split(',').forEach((code: string) => {
|
|
|
- set.push(code.trim().toLocaleLowerCase())
|
|
|
+ set.push(code.replaceAll(' ','').toLocaleLowerCase())
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
let unDefinedTrack = [] as any
|
|
|
forms.multiTracksSelection.forEach((item: any) => {
|
|
|
- if (item) {
|
|
|
+ if (item && !isPtrack(item)) {
|
|
|
let contain = false;
|
|
|
- if (set.includes(item.trim().toLocaleLowerCase())) {
|
|
|
- contain = true
|
|
|
+ let code = item.replace(' ', '').toLocaleLowerCase()
|
|
|
+ for (let i = 0; i < set.length; i++) {
|
|
|
+ if (code.startsWith(set[i])) {
|
|
|
+ contain = true
|
|
|
+ break
|
|
|
+ }
|
|
|
}
|
|
|
- // for (let i = 0; i < set.length; i++) {
|
|
|
- // if (set[i].startsWith(code) || set[i].endsWith(code)) {
|
|
|
- // contain = true
|
|
|
- // break
|
|
|
- // }
|
|
|
- // }
|
|
|
if (!contain) {
|
|
|
unDefinedTrack.push(item)
|
|
|
}
|
|
@@ -565,24 +567,43 @@ export default defineComponent({
|
|
|
obj.musicSheetSoundList = []
|
|
|
}
|
|
|
btnLoading.value = true
|
|
|
+ let resData:any
|
|
|
if (props.type === 'add') {
|
|
|
- await musicSheetSave(obj)
|
|
|
- message.success('添加成功')
|
|
|
+ resData = await musicSheetSave(obj)
|
|
|
} else if (props.type === 'edit') {
|
|
|
- await musicSheetSave({...obj, id: props.data.id})
|
|
|
- message.success('修改成功')
|
|
|
+ resData = await musicSheetSave({...obj, id: props.data.id})
|
|
|
}
|
|
|
- emit('getList')
|
|
|
- emit('close')
|
|
|
+ beatTimeData.beatTimeOpen = true
|
|
|
+ beatTimeData.musicId = resData.data
|
|
|
} catch (e) {
|
|
|
console.log(e)
|
|
|
+ setTimeout(() => {
|
|
|
+ btnLoading.value = false
|
|
|
+ state.isAutoSave = false
|
|
|
+ }, 100)
|
|
|
}
|
|
|
- setTimeout(() => {
|
|
|
- btnLoading.value = false
|
|
|
- state.isAutoSave = false
|
|
|
- }, 100)
|
|
|
})
|
|
|
}
|
|
|
+ // 合成节拍器的回调
|
|
|
+ function handlerMusiceBeatTimeClose() {
|
|
|
+ if (props.type === 'add') {
|
|
|
+ message.success('添加成功')
|
|
|
+ } else if (props.type === 'edit') {
|
|
|
+ message.success('修改成功')
|
|
|
+ }
|
|
|
+ emit('getList')
|
|
|
+ emit('close')
|
|
|
+ setTimeout(() => {
|
|
|
+ btnLoading.value = false
|
|
|
+ state.isAutoSave = false
|
|
|
+ }, 100)
|
|
|
+ }
|
|
|
+ const isPtrack = async (track: string) => {
|
|
|
+ if (track && (track == 'P1' || track == 'P2' || track == 'P3' || track == 'P4')) {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ return false
|
|
|
+ }
|
|
|
|
|
|
const initFSongList = async () => {
|
|
|
forms.fSongList.forEach((fSong: any) => {
|
|
@@ -745,7 +766,7 @@ export default defineComponent({
|
|
|
if (!data.disabled) {
|
|
|
const codes = data.code.split(/[,,]/)
|
|
|
codes.forEach((code: string) => {
|
|
|
- let codeTemp = code.trim().toLowerCase()
|
|
|
+ let codeTemp = code.replaceAll(' ','').toLowerCase()
|
|
|
if (codeIdMap.has(codeTemp)) {
|
|
|
codeIdMap.get(codeTemp).push(data.id + '')
|
|
|
} else {
|
|
@@ -757,7 +778,7 @@ export default defineComponent({
|
|
|
}
|
|
|
})
|
|
|
for (let i = 0; i < codes.length; i++) {
|
|
|
- let code = codes[i].trim().toLowerCase()
|
|
|
+ let code = codes[i].replaceAll(' ','').toLowerCase()
|
|
|
if (codeIdMap.has(code)) {
|
|
|
codeIdMap.get(code).forEach((c: any) => {
|
|
|
if (!forms.musicalInstrumentIdList.includes(c)) {
|
|
@@ -1308,7 +1329,7 @@ export default defineComponent({
|
|
|
path="composer"
|
|
|
rule={[
|
|
|
{
|
|
|
- required: true,
|
|
|
+ required: false,
|
|
|
message: '请输入音乐人',
|
|
|
trigger: ['input', 'blur']
|
|
|
}
|
|
@@ -1600,12 +1621,12 @@ export default defineComponent({
|
|
|
{/* </NRadioGroup>*/}
|
|
|
{/*</NFormItemGi>*/}
|
|
|
<NFormItemGi
|
|
|
- label="是否节奏练习"
|
|
|
+ label="是否全声部"
|
|
|
path="isAllSubject"
|
|
|
rule={[
|
|
|
{
|
|
|
required: true,
|
|
|
- message: '请选择是否节奏练习',
|
|
|
+ message: '是否全声部',
|
|
|
}
|
|
|
]}
|
|
|
>
|
|
@@ -1635,54 +1656,54 @@ export default defineComponent({
|
|
|
{!forms.isAllSubject && (
|
|
|
<NGrid cols={2}>
|
|
|
<NFormItemGi
|
|
|
- label="可用声部"
|
|
|
- path="subjectIds"
|
|
|
+ label="可用乐器"
|
|
|
+ path="musicalInstrumentIdList"
|
|
|
rule={[
|
|
|
{
|
|
|
required: true,
|
|
|
- message: '请选择可用声部',
|
|
|
+ message: '请选择可用乐器',
|
|
|
trigger: 'change',
|
|
|
type: 'array'
|
|
|
}
|
|
|
]}
|
|
|
>
|
|
|
<NSelect
|
|
|
- v-model:value={forms.subjectIds}
|
|
|
- options={state.subjectList}
|
|
|
- disabled={true}
|
|
|
+ placeholder="请选择可用乐器"
|
|
|
+ options={state.instrumentList}
|
|
|
+ v-model:value={forms.musicalInstrumentIdList}
|
|
|
+ // disabled = {state.instrumentDisabled}
|
|
|
+ clearable
|
|
|
multiple
|
|
|
filterable
|
|
|
- clearable
|
|
|
- placeholder="请选择可用声部"
|
|
|
maxTagCount={10}
|
|
|
- onUpdateValue={async (val: any) => {
|
|
|
- // await changeSubject(val)
|
|
|
+ onUpdateValue={async (value: any) => {
|
|
|
+ await showBackSubject(value)
|
|
|
}}
|
|
|
/>
|
|
|
</NFormItemGi>
|
|
|
<NFormItemGi
|
|
|
- label="可用乐器"
|
|
|
- path="musicalInstrumentIdList"
|
|
|
+ label="可用声部"
|
|
|
+ path="subjectIds"
|
|
|
rule={[
|
|
|
{
|
|
|
required: true,
|
|
|
- message: '请选择可用乐器',
|
|
|
+ message: '请选择可用声部',
|
|
|
trigger: 'change',
|
|
|
type: 'array'
|
|
|
}
|
|
|
]}
|
|
|
>
|
|
|
<NSelect
|
|
|
- placeholder="请选择可用乐器"
|
|
|
- options={state.instrumentList}
|
|
|
- v-model:value={forms.musicalInstrumentIdList}
|
|
|
- disabled = {state.instrumentDisabled}
|
|
|
- clearable
|
|
|
+ v-model:value={forms.subjectIds}
|
|
|
+ options={state.subjectList}
|
|
|
+ // disabled={true}
|
|
|
multiple
|
|
|
filterable
|
|
|
+ clearable
|
|
|
+ placeholder="请选择可用声部"
|
|
|
maxTagCount={10}
|
|
|
- onUpdateValue={async (value: any) => {
|
|
|
- await showBackSubject(value)
|
|
|
+ onUpdateValue={async (val: any) => {
|
|
|
+ // await changeSubject(val)
|
|
|
}}
|
|
|
/>
|
|
|
</NFormItemGi>
|
|
@@ -2358,6 +2379,9 @@ export default defineComponent({
|
|
|
}}
|
|
|
/>
|
|
|
</NModal>
|
|
|
+ {
|
|
|
+ beatTimeData.beatTimeOpen && <MusiceBeatTime id={ beatTimeData.musicId } onClose={handlerMusiceBeatTimeClose}></MusiceBeatTime>
|
|
|
+ }
|
|
|
</div>
|
|
|
)
|
|
|
}
|