|
|
@@ -6,7 +6,7 @@
|
|
|
<text class="text-32 text-fore-title font-bold">添加定向院校</text>
|
|
|
<text class="ml-10 text-32 text-fore-light">({{ directedSchoolList.length }}/3)</text>
|
|
|
</view>
|
|
|
- <view class="text-24 text-primary">添加后无法更改</view>
|
|
|
+ <view class="text-24 text-fore-light">添加后无法更改</view>
|
|
|
</view>
|
|
|
<view class="px-48 pt-52 pb-32 flex items-center justify-between">
|
|
|
<view class="text-32 text-fore-title font-bold">我的定向院校</view>
|
|
|
@@ -16,8 +16,8 @@
|
|
|
</view> -->
|
|
|
</view>
|
|
|
<view v-if="hasDirectedSchool" class="px-30">
|
|
|
- <l-drag ref="dragRef" :list="directedSchoolList" :column="1" gridHeight="104px" :touchHandle="touchHandle" ghost handle
|
|
|
- @change="changeSort">
|
|
|
+ <l-drag ref="dragRef" :list="directedSchoolList" :column="1" gridHeight="104px" :touchHandle="touchHandle" ghost
|
|
|
+ handle @change="changeSort">
|
|
|
<!-- // 每一项的插槽 grid 的 content 您传入的数据 -->
|
|
|
<template #grid="{ active, content, index }">
|
|
|
<!-- // grid.active 是否为当前拖拽项目 根据自己需要写样式 -->
|
|
|
@@ -82,6 +82,7 @@ const handleSetDirectedSchool = async (item: DirectedSchool, index: number) => {
|
|
|
directedSchoolList.value.unshift(item);
|
|
|
save(directedSchoolList.value);
|
|
|
}
|
|
|
+const dragRef = ref();
|
|
|
const handleAdd = () => {
|
|
|
transferTo('/pagesStudy/pages/targeted-add/targeted-add', {
|
|
|
data: {
|
|
|
@@ -89,17 +90,22 @@ const handleAdd = () => {
|
|
|
}
|
|
|
}).then(async res => {
|
|
|
if (res) {
|
|
|
- directedSchoolList.value.push({
|
|
|
- ...res,
|
|
|
- code: (res as SelectedUniversityMajor).universityId
|
|
|
- } as DirectedSchool);
|
|
|
+
|
|
|
setTimeout(() => {
|
|
|
- save(directedSchoolList.value);
|
|
|
- }, 300);
|
|
|
+ dragRef.value.push({
|
|
|
+ ...res,
|
|
|
+ code: (res as SelectedUniversityMajor).universityId
|
|
|
+ } as DirectedSchool);
|
|
|
+ // directedSchoolList.value = [...directedSchoolList.value, {
|
|
|
+ // ...res,
|
|
|
+ // code: (res as SelectedUniversityMajor).universityId
|
|
|
+ // } as DirectedSchool];
|
|
|
+ // save(directedSchoolList.value);
|
|
|
+ }, 500);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
-const dragRef = ref();
|
|
|
+
|
|
|
const changeSort = (e: any) => {
|
|
|
const list = e.map((item: any) => item.content);
|
|
|
save(list);
|