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