|
@@ -84,6 +84,7 @@ export default defineComponent({
|
|
}
|
|
}
|
|
] as any,
|
|
] as any,
|
|
loadingStatus: false,
|
|
loadingStatus: false,
|
|
|
|
+ dragLoadingStatus: false, // 拖动时
|
|
showAttendClass: false,
|
|
showAttendClass: false,
|
|
attendClassType: 'change', //
|
|
attendClassType: 'change', //
|
|
removeIds: [] as any, // 临时删除的编号
|
|
removeIds: [] as any, // 临时删除的编号
|
|
@@ -431,6 +432,7 @@ export default defineComponent({
|
|
// 拖拽添加数据
|
|
// 拖拽添加数据
|
|
const addDragCoursewareItem = async (item: any, newIndex: number) => {
|
|
const addDragCoursewareItem = async (item: any, newIndex: number) => {
|
|
clearTimeout(timer);
|
|
clearTimeout(timer);
|
|
|
|
+ forms.dragLoadingStatus = true;
|
|
const materialList: any[] = [];
|
|
const materialList: any[] = [];
|
|
try {
|
|
try {
|
|
const { data } = await api_materialDetail(item.materialId);
|
|
const { data } = await api_materialDetail(item.materialId);
|
|
@@ -455,7 +457,6 @@ export default defineComponent({
|
|
} catch {
|
|
} catch {
|
|
//
|
|
//
|
|
}
|
|
}
|
|
-
|
|
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
const array: any = forms.coursewareList[item.index || 0].list || [];
|
|
const array: any = forms.coursewareList[item.index || 0].list || [];
|
|
array[newIndex] = item;
|
|
array[newIndex] = item;
|
|
@@ -463,7 +464,6 @@ export default defineComponent({
|
|
array.splice(newIndex + 1, 0, m);
|
|
array.splice(newIndex + 1, 0, m);
|
|
});
|
|
});
|
|
forms.coursewareList[item.index || 0].list = array;
|
|
forms.coursewareList[item.index || 0].list = array;
|
|
-
|
|
|
|
if(item.isError) {
|
|
if(item.isError) {
|
|
message.error('您添加的资源与适用乐器不符')
|
|
message.error('您添加的资源与适用乐器不符')
|
|
}
|
|
}
|
|
@@ -472,6 +472,8 @@ export default defineComponent({
|
|
// 内容有更新 - 相关资源会刷新
|
|
// 内容有更新 - 相关资源会刷新
|
|
eventGlobal.emit('onCoursewareUpdate');
|
|
eventGlobal.emit('onCoursewareUpdate');
|
|
}, 100);
|
|
}, 100);
|
|
|
|
+
|
|
|
|
+ forms.dragLoadingStatus = false;
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
|
|
@@ -889,8 +891,9 @@ export default defineComponent({
|
|
group="description"
|
|
group="description"
|
|
scroll={true}
|
|
scroll={true}
|
|
animation={200}
|
|
animation={200}
|
|
- onAdd={(evt: any) => {
|
|
|
|
- // console.log(
|
|
|
|
|
|
+ onAdd={async (evt: any) => {
|
|
|
|
+ // 锁
|
|
|
|
+ if(forms.dragLoadingStatus) return
|
|
const list = forms.coursewareList[index].list;
|
|
const list = forms.coursewareList[index].list;
|
|
const dropItem = list[evt.newDraggableIndex];
|
|
const dropItem = list[evt.newDraggableIndex];
|
|
if (dropItem.sourceForm === 'resource-item') {
|
|
if (dropItem.sourceForm === 'resource-item') {
|
|
@@ -900,8 +903,8 @@ export default defineComponent({
|
|
eventGlobal.emit('checkCoursewareForm', 'subject')
|
|
eventGlobal.emit('checkCoursewareForm', 'subject')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
-
|
|
|
|
- addDragCoursewareItem(
|
|
|
|
|
|
+
|
|
|
|
+ await addDragCoursewareItem(
|
|
{
|
|
{
|
|
materialId: dropItem.id,
|
|
materialId: dropItem.id,
|
|
coverImg: dropItem.coverImg,
|
|
coverImg: dropItem.coverImg,
|
|
@@ -1075,7 +1078,6 @@ export default defineComponent({
|
|
index: select
|
|
index: select
|
|
});
|
|
});
|
|
});
|
|
});
|
|
- console.log(forms.addCoursewareItem, '----', forms.subjects)
|
|
|
|
forms.addCoursewareVisiable = false;
|
|
forms.addCoursewareVisiable = false;
|
|
|
|
|
|
checkCurrentInstrumentTip(forms.addCoursewareItem.isError)
|
|
checkCurrentInstrumentTip(forms.addCoursewareItem.isError)
|