|
|
|
@ -275,6 +275,12 @@ async function getfield() {
|
|
|
|
const userInfo = userStore.getUserInfo;
|
|
|
|
const userInfo = userStore.getUserInfo;
|
|
|
|
res = await getfieldList(3, userInfo.id)
|
|
|
|
res = await getfieldList(3, userInfo.id)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function onMove(e) {
|
|
|
|
|
|
|
|
// 这里的e表示即将停靠的元素。
|
|
|
|
|
|
|
|
if (e?.related?.className?.indexOf('fix') !== -1) {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
onMounted(() => {
|
|
|
|
getfield();
|
|
|
|
getfield();
|
|
|
|
@ -342,18 +348,14 @@ onMounted(() => {
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</n-input>
|
|
|
|
</n-input>
|
|
|
|
<n-scrollbar style="max-height: 500px;border: 1px solid #cad2dd;border-radius: 2px;" class="scroll">
|
|
|
|
<n-scrollbar style="max-height: 500px;border: 1px solid #cad2dd;border-radius: 2px;" class="scroll">
|
|
|
|
<!-- filter=".draggable-li[draggable='false']" -->
|
|
|
|
<VueDraggable v-model="onList" filter=".fix" class="draggable-ul" :animation="150" group="shared"
|
|
|
|
<VueDraggable v-model="onList" class="draggable-ul" :animation="150" group="shared">
|
|
|
|
:onMove="onMove">
|
|
|
|
<div
|
|
|
|
<div v-for="item in onList" v-show="item.name.includes(onKeyword)" :key="item.id"
|
|
|
|
v-for="item in onList" v-show="item.name.includes(onKeyword)" :key="item.id" :draggable="!item.fix" :class="{ fix: item.fix }"
|
|
|
|
:draggable="!item.fix" :class="{ move: !item.fix, fix: item.fix }" class="cursor-move draggable-li">
|
|
|
|
class="cursor-move draggable-li"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<SvgIcon v-show="!item.fix" name="drag" size="24" />
|
|
|
|
<SvgIcon v-show="!item.fix" name="drag" size="24" />
|
|
|
|
<span class="ml-2">{{ item.name }}</span>
|
|
|
|
<span class="ml-2">{{ item.name }}</span>
|
|
|
|
<SvgIcon
|
|
|
|
<SvgIcon v-if="!item.fix" size="16px" style="display:block;margin-left: auto;cursor: pointer;"
|
|
|
|
v-if="!item.fix" size="16px" style="display:block;margin-left: auto;cursor: pointer;"
|
|
|
|
name="clear" @click="removeHandler(item.id)" />
|
|
|
|
name="clear" @click="removeHandler(item.id)"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</VueDraggable>
|
|
|
|
</VueDraggable>
|
|
|
|
</n-scrollbar>
|
|
|
|
</n-scrollbar>
|
|
|
|
@ -444,6 +446,10 @@ onMounted(() => {
|
|
|
|
align-items: center;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.fix {
|
|
|
|
|
|
|
|
cursor: default !important;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.disable-check {
|
|
|
|
.disable-check {
|
|
|
|
color: gainsboro;
|
|
|
|
color: gainsboro;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|