|
@@ -1,5 +1,5 @@
|
|
|
import { NScrollbar, NSpin, NTabPane, NTabs } from 'naive-ui';
|
|
|
-import { defineComponent, onMounted, reactive } from 'vue';
|
|
|
+import { defineComponent, onMounted, reactive, watch } from 'vue';
|
|
|
import styles from './index.module.less';
|
|
|
import CardType from '@/components/card-type';
|
|
|
import SearchGroup from './search-group';
|
|
@@ -67,22 +67,26 @@ export default defineComponent({
|
|
|
// });
|
|
|
const { data } = await materialQueryPage({
|
|
|
...state.searchGroup,
|
|
|
- ...state.pagination,
|
|
|
- subjectId: prepareStore.getSubjectId
|
|
|
+ ...state.pagination
|
|
|
+ // subjectId: prepareStore.getSubjectId
|
|
|
});
|
|
|
state.loading = false;
|
|
|
const tempRows = data.rows || [];
|
|
|
const temp: any = [];
|
|
|
tempRows.forEach((row: any) => {
|
|
|
+ const index = prepareStore.getTrainList.findIndex(
|
|
|
+ (course: any) => course.musicId === row.id
|
|
|
+ );
|
|
|
temp.push({
|
|
|
id: row.id,
|
|
|
- coverImg: row.musicSvg,
|
|
|
+ coverImg: row.coverImg || row.musicSvg,
|
|
|
type: 'MUSIC',
|
|
|
- title: row.musicSheetName,
|
|
|
+ title: row.name,
|
|
|
isCollect: false,
|
|
|
isSelected: true,
|
|
|
content: row.id,
|
|
|
- xmlFileUrl: row.xmlFileUrl
|
|
|
+ xmlFileUrl: row.xmlFileUrl,
|
|
|
+ exist: index !== -1 ? true : false // 是否存在
|
|
|
});
|
|
|
});
|
|
|
state.tableList.push(...temp);
|
|
@@ -93,6 +97,22 @@ export default defineComponent({
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ watch(
|
|
|
+ () => prepareStore.trainList,
|
|
|
+ () => {
|
|
|
+ state.tableList.forEach((item: any) => {
|
|
|
+ const index = prepareStore.getTrainList.findIndex(
|
|
|
+ (course: any) => course.musicId === item.id
|
|
|
+ );
|
|
|
+ item.exist = index !== -1 ? true : false; // 是否存在
|
|
|
+ });
|
|
|
+ },
|
|
|
+ {
|
|
|
+ deep: true,
|
|
|
+ immediate: true
|
|
|
+ }
|
|
|
+ );
|
|
|
+
|
|
|
const throttledFnSearch = useDebounceFn(item => {
|
|
|
state.pagination.page = 1;
|
|
|
state.tableList = [];
|