|
@@ -23,47 +23,58 @@ import {
|
|
|
NIcon
|
|
|
} from 'naive-ui';
|
|
|
import CardType from '/src/components/card-type';
|
|
|
-import AttendClass from '/src/views/prepare-lessons/model/attend-class';
|
|
|
+// import AttendClass from '/src/views/prepare-lessons/model/attend-class';
|
|
|
import { usePrepareStore } from '/src/store/modules/prepareLessons';
|
|
|
import { useCatchStore } from '/src/store/modules/catchData';
|
|
|
-import TheEmpty from '/src/components/TheEmpty';
|
|
|
+// import TheEmpty from '/src/components/TheEmpty';
|
|
|
import {
|
|
|
- api_add,
|
|
|
- courseScheduleStart,
|
|
|
- queryCourseware,
|
|
|
- saveCourseware,
|
|
|
- teacherKnowledgeMaterialDelete
|
|
|
+ api_teacherChapterLessonCoursewareAdd,
|
|
|
+ api_teacherChapterLessonCoursewareUpdate,
|
|
|
+ api_teacherChapterLessonCoursewareDetail,
|
|
|
+ // courseScheduleStart,
|
|
|
+ // queryCourseware,
|
|
|
+ saveCourseware
|
|
|
} from '../../../api';
|
|
|
import Draggable from 'vuedraggable';
|
|
|
import iconDelete from '../../../images/icon-delete.png';
|
|
|
import iconAddMusic from '../../../images/icon-add-music.png';
|
|
|
import { onBeforeRouteUpdate, useRoute, useRouter } from 'vue-router';
|
|
|
-import deepClone from '/src/helpers/deep-clone';
|
|
|
+// import deepClone from '/src/helpers/deep-clone';
|
|
|
import CardPreview from '/src/components/card-preview';
|
|
|
import PreviewWindow from '/src/views/preview-window';
|
|
|
-import { state } from '/src/state';
|
|
|
+// import { state } from '/src/state';
|
|
|
import SubjectSync from '../../../model/subject-sync';
|
|
|
import { eventGlobal } from '/src/utils';
|
|
|
-import iconTips from '../../../images/icon-tips.png';
|
|
|
+// import iconTips from '../../../images/icon-tips.png';
|
|
|
import TheMessageDialog from '/src/components/TheMessageDialog';
|
|
|
+import AddItemModel from '../../../model/add-item-model';
|
|
|
+import AddOtherSource from '../../../model/add-other-source';
|
|
|
export default defineComponent({
|
|
|
name: 'courseware-modal',
|
|
|
+ props: {
|
|
|
+ groupItem: {
|
|
|
+ type: Object,
|
|
|
+ default: () => ({})
|
|
|
+ }
|
|
|
+ },
|
|
|
emits: ['change'],
|
|
|
setup(props, { emit }) {
|
|
|
const catchStore = useCatchStore();
|
|
|
const prepareStore = usePrepareStore();
|
|
|
- const route = useRoute();
|
|
|
+ // const route = useRoute();
|
|
|
const router = useRouter();
|
|
|
- const dialog = useDialog();
|
|
|
+ // const dialog = useDialog();
|
|
|
const message = useMessage();
|
|
|
|
|
|
const forms = reactive({
|
|
|
subjects: [] as any,
|
|
|
+ openFlagEnable: true, // 是否支持修改公开状态
|
|
|
name: '',
|
|
|
openFlag: false,
|
|
|
coursewareList: [
|
|
|
{
|
|
|
name: '',
|
|
|
+ id: null,
|
|
|
list: [] as any
|
|
|
}
|
|
|
] as any,
|
|
@@ -72,11 +83,13 @@ export default defineComponent({
|
|
|
attendClassType: 'change', //
|
|
|
removeIds: [] as any, // 临时删除的编号
|
|
|
editSubjectIds: '', // 声部编号
|
|
|
- removeVisiable: false,
|
|
|
+ addCoursewareVisiable: false,
|
|
|
addCoursewareItem: {} as any,
|
|
|
+ messageCallBack: null as any,
|
|
|
messageOperation: {
|
|
|
visiable: false,
|
|
|
- type: 'delete' as 'delete' | 'addItem' | 'save',
|
|
|
+ loading: false, // 是否显示加载
|
|
|
+ type: 'delete' as 'delete' | 'addItem' | 'save' | 'pageLive',
|
|
|
contentDirection: 'center' as 'left' | 'center' | 'right',
|
|
|
title: '删除知识点',
|
|
|
content: '请确认是否删除该知识点,删除知识点后将同步删除知识点下的资源',
|
|
@@ -92,56 +105,69 @@ export default defineComponent({
|
|
|
type: '',
|
|
|
subjectId: '',
|
|
|
detailId: ''
|
|
|
- } as any
|
|
|
+ } as any,
|
|
|
+ addOtherSource: false
|
|
|
});
|
|
|
|
|
|
// 获取列表
|
|
|
const getList = async () => {
|
|
|
forms.loadingStatus = true;
|
|
|
try {
|
|
|
- // const { data } = await queryCourseware({
|
|
|
- // coursewareDetailKnowledgeId: prepareStore.getSelectKey,
|
|
|
- // subjectId: prepareStore.getSubjectId,
|
|
|
- // page: 1,
|
|
|
- // rows: 99
|
|
|
- // });
|
|
|
- // const tempRows = data.rows || [];
|
|
|
- // const temp: any = [];
|
|
|
- // tempRows.forEach((row: any) => {
|
|
|
- // temp.push({
|
|
|
- // id: row.id,
|
|
|
- // materialId: row.materialId,
|
|
|
- // coverImg: row.coverImg,
|
|
|
- // type: row.materialType,
|
|
|
- // title: row.materialName,
|
|
|
- // isCollect: !!row.favoriteFlag,
|
|
|
- // isSelected: row.source === 'PLATFORM' ? true : false,
|
|
|
- // content: row.content,
|
|
|
- // removeFlag: row.removeFlag
|
|
|
- // });
|
|
|
- // });
|
|
|
- // prepareStore.setCoursewareList(temp || []);
|
|
|
- // const tempCourse: any = [];
|
|
|
- // temp.forEach((item: any) => {
|
|
|
- // if (!forms.removeIds.includes(item.id)) {
|
|
|
- // tempCourse.push(item);
|
|
|
- // }
|
|
|
- // });
|
|
|
- // forms.coursewareList = tempCourse;
|
|
|
- } catch {
|
|
|
+ if (!props.groupItem.id) return (forms.loadingStatus = false);
|
|
|
+
|
|
|
+ const { data } = await api_teacherChapterLessonCoursewareDetail(
|
|
|
+ props.groupItem.id
|
|
|
+ );
|
|
|
+ const tempRows = data.chapterKnowledgeList || [];
|
|
|
+ forms.name = data.name;
|
|
|
+ forms.subjects = data.subjectIds
|
|
|
+ ? data.subjectIds.split(',').map((s: any) => {
|
|
|
+ return Number(s);
|
|
|
+ })
|
|
|
+ : [];
|
|
|
+ forms.openFlag = data.openFlag;
|
|
|
+ forms.openFlagEnable = data.openFlagEnable;
|
|
|
+ const temp: any = [];
|
|
|
+ tempRows.forEach((row: any) => {
|
|
|
+ const child: any = row.chapterKnowledgeMaterialList;
|
|
|
+ const childList: any[] = [];
|
|
|
+ if (Array.isArray(child) && child.length > 0) {
|
|
|
+ child.forEach((sub: any) => {
|
|
|
+ childList.push({
|
|
|
+ id: sub.id,
|
|
|
+ materialId: sub.bizId,
|
|
|
+ coverImg: sub.bizInfo.coverImg,
|
|
|
+ type: sub.type,
|
|
|
+ title: sub.bizInfo.name,
|
|
|
+ // isCollect: !!sub.favoriteFlag,
|
|
|
+ isSelected: sub.source === 'PLATFORM' ? true : false,
|
|
|
+ content: sub.bizInfo.content,
|
|
|
+ removeFlag: sub.removeFlag
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ temp.push({
|
|
|
+ name: row.name,
|
|
|
+ id: row.id,
|
|
|
+ list: [...childList]
|
|
|
+ });
|
|
|
+ });
|
|
|
+ forms.coursewareList = temp;
|
|
|
+ } catch (e) {
|
|
|
//
|
|
|
+ console.log(e);
|
|
|
}
|
|
|
forms.loadingStatus = false;
|
|
|
};
|
|
|
|
|
|
// 删除
|
|
|
- const onDelete = (item: any) => {
|
|
|
- //
|
|
|
- forms.removeIds.push(item.id);
|
|
|
- const index = forms.coursewareList.findIndex(
|
|
|
+ const onDelete = (item: any, index: number) => {
|
|
|
+ const coursewareItem = forms.coursewareList[index];
|
|
|
+ if (!coursewareItem) return;
|
|
|
+ const childIndex = coursewareItem.list.findIndex(
|
|
|
(c: any) => c.id === item.id
|
|
|
);
|
|
|
- forms.coursewareList.splice(index, 1);
|
|
|
+ coursewareItem.list.splice(childIndex, 1);
|
|
|
};
|
|
|
|
|
|
// 完成编辑
|
|
@@ -169,7 +195,7 @@ export default defineComponent({
|
|
|
});
|
|
|
|
|
|
message.success('编辑成功');
|
|
|
- forms.removeVisiable = false;
|
|
|
+ // forms.removeVisiable = false;
|
|
|
prepareStore.setIsEditResource(false);
|
|
|
// 重置临时删除编号
|
|
|
forms.removeIds = [];
|
|
@@ -194,15 +220,24 @@ export default defineComponent({
|
|
|
// 操作
|
|
|
const onChangePoint = (type: string, index: number) => {
|
|
|
if (type === 'up') {
|
|
|
- //
|
|
|
+ // 向上移动
|
|
|
+ if (index === 0) return;
|
|
|
+ const temp = forms.coursewareList[index - 1];
|
|
|
+ forms.coursewareList[index - 1] = forms.coursewareList[index];
|
|
|
+ forms.coursewareList[index] = temp;
|
|
|
} else if (type === 'down') {
|
|
|
- //
|
|
|
+ // 向下移动
|
|
|
+ if (index >= forms.coursewareList.length - 1) return;
|
|
|
+ const temp = forms.coursewareList[index + 1];
|
|
|
+ forms.coursewareList[index + 1] = forms.coursewareList[index];
|
|
|
+ forms.coursewareList[index] = temp;
|
|
|
} else if (type === 'remove') {
|
|
|
forms.messageOperation = {
|
|
|
visiable: true,
|
|
|
type: 'delete',
|
|
|
contentDirection: 'left',
|
|
|
title: '删除知识点',
|
|
|
+ loading: false,
|
|
|
content:
|
|
|
'请确认是否删除该知识点,删除知识点后将同步删除知识点下的资源',
|
|
|
cancelButtonText: '取消',
|
|
@@ -220,8 +255,20 @@ export default defineComponent({
|
|
|
} else if (type === 'addItem') {
|
|
|
forms.coursewareList.push({ name: '', list: [] });
|
|
|
addCoursewareItem(forms.addCoursewareItem);
|
|
|
- } else if (type === 'save') {
|
|
|
+ } else if (type === 'save' || type === 'pageLive') {
|
|
|
+ if (forms.messageOperation.loading) return;
|
|
|
+ forms.messageOperation.loading = true;
|
|
|
await onSaveCourseWare();
|
|
|
+ forms.messageOperation.loading = false;
|
|
|
+
|
|
|
+ if (
|
|
|
+ type === 'pageLive' &&
|
|
|
+ typeof forms.messageCallBack === 'function'
|
|
|
+ ) {
|
|
|
+ forms.messageCallBack();
|
|
|
+ }
|
|
|
+ emit('change', { status: false });
|
|
|
+ eventGlobal.emit('teacher-slideshow', false);
|
|
|
}
|
|
|
forms.messageOperation.visiable = false;
|
|
|
};
|
|
@@ -231,29 +278,28 @@ export default defineComponent({
|
|
|
if (point) {
|
|
|
const dom = document.querySelectorAll('.row-nav');
|
|
|
let isAdd = false;
|
|
|
- dom.forEach((child: any, index: number) => {
|
|
|
+ dom.forEach((child: any) => {
|
|
|
+ // console.log(child);
|
|
|
const status = isPointInsideElement(child, point.x, point.y);
|
|
|
if (status) {
|
|
|
- const array: any = forms.coursewareList;
|
|
|
+ const array: any =
|
|
|
+ forms.coursewareList[item.index || 0].list || [];
|
|
|
const left = isPointOnLeft(child, point.x);
|
|
|
if (!left) {
|
|
|
- array.splice(index + 1, 0, item);
|
|
|
+ array.splice(item.index + 1, 0, item);
|
|
|
} else {
|
|
|
- array.splice(index, 0, item);
|
|
|
+ array.splice(item.index, 0, item);
|
|
|
}
|
|
|
isAdd = true;
|
|
|
forms.coursewareList[item.index || 0].list = array;
|
|
|
- prepareStore.setCoursewareList(forms.coursewareList);
|
|
|
}
|
|
|
});
|
|
|
if (!isAdd) {
|
|
|
forms.coursewareList[item.index || 0].list.push(item);
|
|
|
- prepareStore.setCoursewareList(forms.coursewareList);
|
|
|
}
|
|
|
} else {
|
|
|
- forms.coursewareList[0].list.push(item);
|
|
|
- console.log(forms.coursewareList);
|
|
|
- prepareStore.setCoursewareList(forms.coursewareList);
|
|
|
+ forms.coursewareList[item.index || 0].list.push(item);
|
|
|
+ message.success('添加成功');
|
|
|
}
|
|
|
});
|
|
|
};
|
|
@@ -288,6 +334,7 @@ export default defineComponent({
|
|
|
forms.messageOperation = {
|
|
|
visiable: true,
|
|
|
type: 'save',
|
|
|
+ loading: false,
|
|
|
contentDirection: 'center',
|
|
|
title: '保存课件',
|
|
|
content: '当前课件暂未保存,是否保存?',
|
|
@@ -299,11 +346,8 @@ export default defineComponent({
|
|
|
//
|
|
|
}
|
|
|
};
|
|
|
- let isLock = false;
|
|
|
const onSaveCourseWare = async () => {
|
|
|
try {
|
|
|
- if (isLock) return;
|
|
|
- isLock = true;
|
|
|
const params = {
|
|
|
name: forms.name,
|
|
|
subjectIds: forms.subjects.join(','),
|
|
@@ -328,13 +372,16 @@ export default defineComponent({
|
|
|
chapterKnowledgeMaterialList: tempItem
|
|
|
});
|
|
|
});
|
|
|
- await api_add(params);
|
|
|
- message.success('添加成功');
|
|
|
- emit('change', { status: false });
|
|
|
- eventGlobal.emit('teacher-slideshow', false);
|
|
|
- setTimeout(() => {
|
|
|
- isLock = false;
|
|
|
- }, 100);
|
|
|
+ if (props.groupItem?.id) {
|
|
|
+ await api_teacherChapterLessonCoursewareUpdate({
|
|
|
+ id: props.groupItem.id,
|
|
|
+ ...params
|
|
|
+ });
|
|
|
+ message.success('修改成功');
|
|
|
+ } else {
|
|
|
+ await api_teacherChapterLessonCoursewareAdd(params);
|
|
|
+ message.success('添加成功');
|
|
|
+ }
|
|
|
} catch {
|
|
|
//
|
|
|
}
|
|
@@ -349,26 +396,58 @@ export default defineComponent({
|
|
|
type: 'addItem',
|
|
|
contentDirection: 'center',
|
|
|
title: '添加到知识点',
|
|
|
+ loading: false,
|
|
|
content: '当前课件暂无知识点,请添加知识点后操作',
|
|
|
cancelButtonText: '取消',
|
|
|
confirmButtonText: '添加知识点',
|
|
|
index: 0
|
|
|
};
|
|
|
+ } else if (forms.coursewareList.length > 1 && item.addType !== 'drag') {
|
|
|
+ forms.addCoursewareVisiable = true;
|
|
|
+ forms.addCoursewareItem = item;
|
|
|
} else {
|
|
|
addCoursewareItem(item, point);
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
+ // 当页面离开时
|
|
|
+ const onPageBeforeLeave = (event: any) => {
|
|
|
+ console.log(event, typeof event);
|
|
|
+ forms.messageCallBack = event;
|
|
|
+ forms.messageOperation = {
|
|
|
+ visiable: true,
|
|
|
+ type: 'pageLive',
|
|
|
+ loading: false,
|
|
|
+ contentDirection: 'center',
|
|
|
+ title: '保存课件',
|
|
|
+ content: '当前课件暂未保存,是否保存?',
|
|
|
+ cancelButtonText: '不保存',
|
|
|
+ confirmButtonText: '保存',
|
|
|
+ index: 0
|
|
|
+ };
|
|
|
+ };
|
|
|
onMounted(async () => {
|
|
|
await getList();
|
|
|
-
|
|
|
// 动态添加数据
|
|
|
eventGlobal.on('onPrepareAddItem', addItem);
|
|
|
+
|
|
|
+ eventGlobal.on('pageBeforeLeave', onPageBeforeLeave);
|
|
|
});
|
|
|
|
|
|
onUnmounted(() => {
|
|
|
eventGlobal.off('onPrepareAddItem', addItem);
|
|
|
});
|
|
|
|
|
|
+ // 当列表数据更新时同步缓存数据
|
|
|
+ watch(
|
|
|
+ () => forms.coursewareList,
|
|
|
+ () => {
|
|
|
+ prepareStore.setCoursewareList = forms.coursewareList;
|
|
|
+ },
|
|
|
+ {
|
|
|
+ deep: true
|
|
|
+ }
|
|
|
+ );
|
|
|
return () => (
|
|
|
<div class={styles.coursewareModal}>
|
|
|
<div class={styles.btnGroup}>
|
|
@@ -377,7 +456,12 @@ export default defineComponent({
|
|
|
<span class={styles.btnTitle}>
|
|
|
<span>*</span>标题:
|
|
|
</span>
|
|
|
- <NInput placeholder="请输入课件标题" v-model:value={forms.name} />
|
|
|
+ <NInput
|
|
|
+ placeholder="请输入课件标题"
|
|
|
+ v-model:value={forms.name}
|
|
|
+ maxlength={15}
|
|
|
+ clearable
|
|
|
+ />
|
|
|
</div>
|
|
|
<div class={styles.btnItem}>
|
|
|
<span class={styles.btnTitle}>
|
|
@@ -393,11 +477,30 @@ export default defineComponent({
|
|
|
maxTagCount={1}
|
|
|
size="small"
|
|
|
v-model:value={forms.subjects}
|
|
|
+ clearable
|
|
|
/>
|
|
|
</div>
|
|
|
<div class={styles.btnItem}>
|
|
|
<span class={styles.btnTitle}>公开:</span>
|
|
|
- <NSwitch v-model:value={forms.openFlag} />
|
|
|
+ {!forms.openFlagEnable ? (
|
|
|
+ <NTooltip style={{ maxWidth: '200px' }} showArrow={false}>
|
|
|
+ {{
|
|
|
+ trigger: () => (
|
|
|
+ <NSwitch
|
|
|
+ v-model:value={forms.openFlag}
|
|
|
+ disabled={!forms.openFlagEnable}
|
|
|
+ />
|
|
|
+ ),
|
|
|
+ default: () =>
|
|
|
+ '为尊重课件原作者,在“相关课件”中添加的课件不支持公开'
|
|
|
+ }}
|
|
|
+ </NTooltip>
|
|
|
+ ) : (
|
|
|
+ <NSwitch
|
|
|
+ v-model:value={forms.openFlag}
|
|
|
+ disabled={!forms.openFlagEnable}
|
|
|
+ />
|
|
|
+ )}
|
|
|
</div>
|
|
|
</NSpace>
|
|
|
|
|
@@ -414,6 +517,13 @@ export default defineComponent({
|
|
|
<NButton type="primary" onClick={onSubmit}>
|
|
|
保存课件
|
|
|
</NButton>
|
|
|
+ {/* <NButton
|
|
|
+ type="primary"
|
|
|
+ onClick={() => {
|
|
|
+ forms.coursewareList = [{ name: '', list: [] }];
|
|
|
+ }}>
|
|
|
+ 请空
|
|
|
+ </NButton> */}
|
|
|
</NSpace>
|
|
|
</div>
|
|
|
|
|
@@ -431,7 +541,10 @@ export default defineComponent({
|
|
|
}}
|
|
|
onDrop={(e: any) => {
|
|
|
let dropItem = e.dataTransfer.getData('text');
|
|
|
- dropItem = dropItem ? JSON.parse(dropItem) : {};
|
|
|
+ dropItem =
|
|
|
+ dropItem && e.dataTransfer.effectAllowed === 'all'
|
|
|
+ ? JSON.parse(dropItem)
|
|
|
+ : {};
|
|
|
// 判断是否有数据
|
|
|
if (dropItem.id) {
|
|
|
// 获取拖拽的目标元素
|
|
@@ -441,12 +554,13 @@ export default defineComponent({
|
|
|
materialId: dropItem.id,
|
|
|
coverImg: dropItem.coverImg,
|
|
|
type: dropItem.type,
|
|
|
- title: dropItem.name,
|
|
|
+ title: dropItem.title,
|
|
|
isCollect: dropItem.isCollect,
|
|
|
isSelected: dropItem.isSelected,
|
|
|
content: dropItem.content,
|
|
|
removeFlag: false,
|
|
|
- index
|
|
|
+ index,
|
|
|
+ addType: 'drag'
|
|
|
},
|
|
|
{
|
|
|
x: e.clientX,
|
|
@@ -463,6 +577,8 @@ export default defineComponent({
|
|
|
<NInput
|
|
|
placeholder="未命名知识点"
|
|
|
v-model:value={item.name}
|
|
|
+ maxlength={15}
|
|
|
+ clearable
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -476,7 +592,7 @@ export default defineComponent({
|
|
|
class={styles.iconCUp}
|
|
|
onClick={() => onChangePoint('up', index)}></i>
|
|
|
),
|
|
|
- default: '上移知识点'
|
|
|
+ default: () => '上移知识点'
|
|
|
}}
|
|
|
</NTooltip>
|
|
|
)}
|
|
@@ -488,7 +604,7 @@ export default defineComponent({
|
|
|
class={styles.iconCDown}
|
|
|
onClick={() => onChangePoint('down', index)}></i>
|
|
|
),
|
|
|
- default: '下移知识点'
|
|
|
+ default: () => '下移知识点'
|
|
|
}}
|
|
|
</NTooltip>
|
|
|
)}
|
|
@@ -499,7 +615,7 @@ export default defineComponent({
|
|
|
class={styles.iconCRemove}
|
|
|
onClick={() => onChangePoint('remove', index)}></i>
|
|
|
),
|
|
|
- default: '删除知识点'
|
|
|
+ default: () => '删除知识点'
|
|
|
}}
|
|
|
</NTooltip>
|
|
|
</NSpace>
|
|
@@ -534,6 +650,12 @@ export default defineComponent({
|
|
|
offShelf={item.removeFlag ? true : false}
|
|
|
// onOffShelf={() => onRemove(item)}
|
|
|
item={item}
|
|
|
+ disabledMouseHover={false}
|
|
|
+ onClick={() => {
|
|
|
+ if (item.type === 'IMG') return;
|
|
|
+ forms.show = true;
|
|
|
+ forms.item = item;
|
|
|
+ }}
|
|
|
/>
|
|
|
<div class={styles.itemOperation}>
|
|
|
<img
|
|
@@ -541,7 +663,7 @@ export default defineComponent({
|
|
|
class={styles.iconDelete}
|
|
|
onClick={(e: MouseEvent) => {
|
|
|
e.stopPropagation();
|
|
|
- onDelete(item);
|
|
|
+ onDelete(item, index);
|
|
|
}}
|
|
|
/>
|
|
|
</div>
|
|
@@ -559,12 +681,7 @@ export default defineComponent({
|
|
|
'handle'
|
|
|
]}
|
|
|
onClick={() => {
|
|
|
- // 直接跳转到制谱页面 (临时存储数据)
|
|
|
- sessionStorage.setItem(
|
|
|
- 'notation-open-create',
|
|
|
- '1'
|
|
|
- );
|
|
|
- router.push('/notation');
|
|
|
+ forms.addOtherSource = true;
|
|
|
}}>
|
|
|
<img src={iconAddMusic} />
|
|
|
|
|
@@ -587,12 +704,7 @@ export default defineComponent({
|
|
|
'handle'
|
|
|
]}
|
|
|
onClick={() => {
|
|
|
- // 直接跳转到制谱页面 (临时存储数据)
|
|
|
- sessionStorage.setItem(
|
|
|
- 'notation-open-create',
|
|
|
- '1'
|
|
|
- );
|
|
|
- router.push('/notation');
|
|
|
+ forms.addOtherSource = true;
|
|
|
}}>
|
|
|
<img src={iconAddMusic} />
|
|
|
|
|
@@ -627,22 +739,26 @@ export default defineComponent({
|
|
|
<CardPreview v-model:show={forms.show} item={forms.item} />
|
|
|
|
|
|
<NModal
|
|
|
- v-model:show={forms.removeVisiable}
|
|
|
+ v-model:show={forms.addCoursewareVisiable}
|
|
|
preset="card"
|
|
|
- class={['modalTitle', styles.removeVisiable]}
|
|
|
- title={'提示'}>
|
|
|
- <div class={styles.studentRemove}>
|
|
|
- <p>是否完成编辑?</p>
|
|
|
-
|
|
|
- <NSpace class={styles.btnGroupModal} justify="center">
|
|
|
- <NButton round type="primary" onClick={onOverEdit}>
|
|
|
- 确定
|
|
|
- </NButton>
|
|
|
- <NButton round onClick={() => (forms.removeVisiable = false)}>
|
|
|
- 取消
|
|
|
- </NButton>
|
|
|
- </NSpace>
|
|
|
- </div>
|
|
|
+ class={['modalTitle', styles.addCourseware]}
|
|
|
+ title={'添加知识点'}>
|
|
|
+ <AddItemModel
|
|
|
+ coursewareList={forms.coursewareList}
|
|
|
+ onClose={() => (forms.addCoursewareVisiable = false)}
|
|
|
+ onConfirm={(selects: number[]) => {
|
|
|
+ if (Array.isArray(selects) && selects.length > 0) {
|
|
|
+ selects.forEach(select => {
|
|
|
+ addCoursewareItem({
|
|
|
+ ...forms.addCoursewareItem,
|
|
|
+ index: select
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ forms.addCoursewareVisiable = false;
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ />
|
|
|
</NModal>
|
|
|
|
|
|
<NModal
|
|
@@ -655,7 +771,23 @@ export default defineComponent({
|
|
|
contentDirection={forms.messageOperation.contentDirection}
|
|
|
cancelButtonText={forms.messageOperation.cancelButtonText}
|
|
|
confirmButtonText={forms.messageOperation.confirmButtonText}
|
|
|
- onClose={() => (forms.messageOperation.visiable = false)}
|
|
|
+ loading={forms.messageOperation.loading}
|
|
|
+ onClose={() => {
|
|
|
+ forms.messageOperation.visiable = false;
|
|
|
+ if (
|
|
|
+ forms.messageOperation.type === 'save' ||
|
|
|
+ forms.messageOperation.type === 'pageLive'
|
|
|
+ ) {
|
|
|
+ emit('change', { status: false });
|
|
|
+ eventGlobal.emit('teacher-slideshow', false);
|
|
|
+ if (
|
|
|
+ forms.messageOperation.type === 'pageLive' &&
|
|
|
+ typeof forms.messageCallBack === 'function'
|
|
|
+ ) {
|
|
|
+ forms.messageCallBack();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }}
|
|
|
onConfirm={() => onMessageConfirm()}
|
|
|
/>
|
|
|
</NModal>
|
|
@@ -687,6 +819,15 @@ export default defineComponent({
|
|
|
}}
|
|
|
/>
|
|
|
</NModal>
|
|
|
+
|
|
|
+ {/* 添加其它类型的资源 */}
|
|
|
+ <NModal
|
|
|
+ v-model:show={forms.addOtherSource}
|
|
|
+ preset="card"
|
|
|
+ class={['modalTitle background', styles.addOtherSource]}
|
|
|
+ title={'添加功能'}>
|
|
|
+ <AddOtherSource />
|
|
|
+ </NModal>
|
|
|
</div>
|
|
|
);
|
|
|
}
|