|
@@ -341,39 +341,17 @@ export default defineComponent({
|
|
|
};
|
|
|
if (Array.isArray(row.instruments)) {
|
|
|
row.instruments.forEach((i: any) => {
|
|
|
+ const code = i.code ? i.code.split(",") : [];
|
|
|
tempList.children.push({
|
|
|
text: i.name,
|
|
|
id: i.id,
|
|
|
- value: mappingVoicePart(i.code, "INSTRUMENT"),
|
|
|
+ value: mappingVoicePart(code[0] || "", "INSTRUMENT"),
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
tempSubjects.push(tempList);
|
|
|
- // if (row.instruments && row.instruments.length > 0) {
|
|
|
- // if (row.instruments.length > 1) {
|
|
|
- // row.instruments.forEach((i: any) => {
|
|
|
- // tempList.children.push({
|
|
|
- // text: i.name,
|
|
|
- // id: i.id,
|
|
|
- // value: mappingVoicePart(i.code, "INSTRUMENT"),
|
|
|
- // });
|
|
|
- // });
|
|
|
- // } else {
|
|
|
- // const singleRow = row.instruments[0];
|
|
|
- // if (singleRow.code) {
|
|
|
- // tempList.value = mappingVoicePart(singleRow.code, "INSTRUMENT");
|
|
|
- // tempList.id = singleRow.id;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // data.subjects.push(tempList);
|
|
|
});
|
|
|
console.log(data.subject, "data.subject");
|
|
|
- // tempSubjects.forEach((item: any) => {
|
|
|
- // if (item.value === data.subject && item.children?.length > 1) {
|
|
|
- // data.subject = item.children[0].value;
|
|
|
- // }
|
|
|
- // });
|
|
|
data.subjects = tempSubjects;
|
|
|
} catch (e) {
|
|
|
//
|