|
@@ -463,26 +463,37 @@ export default defineComponent({
|
|
|
instrumentCodeList.push(instrumentCode)
|
|
|
}
|
|
|
}
|
|
|
- const codeIdMap = new Map<string, []>() as any
|
|
|
+ // 乐器支持多编码,暂不开放
|
|
|
+ // const codeIdMap = new Map<string, []>() as any
|
|
|
+ // state.instrumentData.forEach((data: any) => {
|
|
|
+ // const codes = data.code.split(/,|,/)
|
|
|
+ // codes.forEach((code: string) => {
|
|
|
+ // if (codeIdMap.has(code)) {
|
|
|
+ // codeIdMap.get(code).push(data.id + '')
|
|
|
+ // } else {
|
|
|
+ // const arr = [] as any;
|
|
|
+ // arr.push(data.id + '')
|
|
|
+ // codeIdMap.set(code, arr)
|
|
|
+ // }
|
|
|
+ // // codeIdMap.set(code, data.id + '')
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ // forms.musicalInstrumentIdList = []
|
|
|
+ // instrumentCodeList.forEach((code: string) => {
|
|
|
+ // if (codeIdMap.has(code)) {
|
|
|
+ // codeIdMap.get(code).forEach((c: any) => {
|
|
|
+ // forms.musicalInstrumentIdList.push(c)
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ const codeIdMap = new Map<string, string>()
|
|
|
state.instrumentData.forEach((data: any) => {
|
|
|
- const codes = data.code.split(/,|,/)
|
|
|
- codes.forEach((code: string) => {
|
|
|
- if (codeIdMap.has(code)) {
|
|
|
- codeIdMap.get(code).push(data.id + '')
|
|
|
- } else {
|
|
|
- const arr = [] as any;
|
|
|
- arr.push(data.id + '')
|
|
|
- codeIdMap.set(code, arr)
|
|
|
- }
|
|
|
- // codeIdMap.set(code, data.id + '')
|
|
|
- })
|
|
|
+ codeIdMap.set(data.code, data.id + '')
|
|
|
})
|
|
|
forms.musicalInstrumentIdList = []
|
|
|
instrumentCodeList.forEach((code: string) => {
|
|
|
if (codeIdMap.has(code)) {
|
|
|
- codeIdMap.get(code).forEach((c: any) => {
|
|
|
- forms.musicalInstrumentIdList.push(c)
|
|
|
- })
|
|
|
+ forms.musicalInstrumentIdList.push(codeIdMap.get(code))
|
|
|
}
|
|
|
})
|
|
|
|