|
@@ -1,6 +1,6 @@
|
|
|
|
|
|
-<script setup>
|
|
|
|
-import { SearchIcon } from 'tdesign-icons-vue-next';
|
|
|
|
|
|
+<script setup lang="jsx">
|
|
|
|
+import { SearchIcon,CaretRightSmallIcon,CaretDownSmallIcon } from 'tdesign-icons-vue-next';
|
|
import {apiSystemHelpCenter} from '@/api/system'
|
|
import {apiSystemHelpCenter} from '@/api/system'
|
|
import { useTemplateRef } from 'vue';
|
|
import { useTemplateRef } from 'vue';
|
|
import EditClassify from './components/EditClassify.vue'
|
|
import EditClassify from './components/EditClassify.vue'
|
|
@@ -37,8 +37,10 @@ async function getClassifyData(){
|
|
}
|
|
}
|
|
getClassifyData()
|
|
getClassifyData()
|
|
|
|
|
|
|
|
+let canDrag=true
|
|
async function handleSort({newData,current,target,targetIndex}){
|
|
async function handleSort({newData,current,target,targetIndex}){
|
|
console.log(newData,current,target,targetIndex);
|
|
console.log(newData,current,target,targetIndex);
|
|
|
|
+ if(!canDrag) return
|
|
const params={
|
|
const params={
|
|
ClassifyId:current.ClassifyId,
|
|
ClassifyId:current.ClassifyId,
|
|
ParentClassifyId:target.ParentId,
|
|
ParentClassifyId:target.ParentId,
|
|
@@ -80,6 +82,10 @@ async function handleSort({newData,current,target,targetIndex}){
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function handleAbnormalDragSort(e){
|
|
function handleAbnormalDragSort(e){
|
|
|
|
+ canDrag=false
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ canDrag=true
|
|
|
|
+ }, 500);
|
|
if (e.code === 1001) {
|
|
if (e.code === 1001) {
|
|
MessagePlugin.warning('不同层级的元素,不允许调整顺序');
|
|
MessagePlugin.warning('不同层级的元素,不允许调整顺序');
|
|
}
|
|
}
|
|
@@ -110,6 +116,10 @@ function handleShowAuthSetClassify(item){
|
|
showAuthSetClassify.value=true
|
|
showAuthSetClassify.value=true
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+function treeExpandAndFoldIconRender (h, { type, row }) {
|
|
|
|
+ return type === 'expand' ? <CaretDownSmallIcon /> : <CaretRightSmallIcon />;
|
|
|
|
+}
|
|
|
|
+
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<template>
|
|
<template>
|
|
@@ -134,6 +144,7 @@ function handleShowAuthSetClassify(item){
|
|
drag-sort="row"
|
|
drag-sort="row"
|
|
:data="classifyData"
|
|
:data="classifyData"
|
|
:columns="tableCol"
|
|
:columns="tableCol"
|
|
|
|
+ :tree-expand-and-fold-icon="treeExpandAndFoldIconRender"
|
|
:tree="{
|
|
:tree="{
|
|
childrenKey:'Children',
|
|
childrenKey:'Children',
|
|
treeNodeColumnIndex: 0,
|
|
treeNodeColumnIndex: 0,
|