|
@@ -17,6 +17,7 @@ import { useDebounceFn, useResizeObserver } from '@vueuse/core';
|
|
|
import CardPreview from '/src/components/card-preview';
|
|
|
import { eventGlobal } from '/src/utils';
|
|
|
import ClassSearchGroup from './class-search-group';
|
|
|
+import { useCatchStore } from '/src/store/modules/catchData';
|
|
|
|
|
|
const formatType = (type: string) => {
|
|
|
if (type === 'shareResources') {
|
|
@@ -43,6 +44,7 @@ export default defineComponent({
|
|
|
},
|
|
|
setup(props) {
|
|
|
const prepareStore = usePrepareStore();
|
|
|
+ const catchStore = useCatchStore();
|
|
|
const { type } = toRefs(props);
|
|
|
const className = 'resourceSearchGroup' + +new Date();
|
|
|
const state = reactive({
|
|
@@ -57,8 +59,9 @@ export default defineComponent({
|
|
|
type: 'MUSIC', //
|
|
|
name: '',
|
|
|
bookVersionId: null,
|
|
|
- subjectId: prepareStore.getSubjectId,
|
|
|
+ // subjectId: prepareStore.getSubjectId,
|
|
|
sourceType: formatType(type.value),
|
|
|
+ musicalInstrumentId: null as any,
|
|
|
enableFlag: true
|
|
|
},
|
|
|
tableList: [] as any,
|
|
@@ -163,7 +166,17 @@ export default defineComponent({
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- onMounted(() => {
|
|
|
+ onMounted(async () => {
|
|
|
+ // 获取声部
|
|
|
+ await catchStore.getSubjects();
|
|
|
+ catchStore.getSubjectInstruments.forEach((item: any) => {
|
|
|
+ if (item.id == prepareStore.getSubjectId) {
|
|
|
+ if (item.instruments && item.instruments.length > 0) {
|
|
|
+ state.searchGroup.musicalInstrumentId = item.instruments[0].value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
getList();
|
|
|
|
|
|
useResizeObserver(
|