|
@@ -33,6 +33,9 @@
|
|
<script setup>
|
|
<script setup>
|
|
import { ref, watch, nextTick } from 'vue';
|
|
import { ref, watch, nextTick } from 'vue';
|
|
import { SearchIcon } from 'tdesign-icons-vue-next';
|
|
import { SearchIcon } from 'tdesign-icons-vue-next';
|
|
|
|
+import { useRoute } from 'vue-router'
|
|
|
|
+
|
|
|
|
+const route = useRoute()
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
isShowFoot: {
|
|
isShowFoot: {
|
|
type: Boolean,
|
|
type: Boolean,
|
|
@@ -80,7 +83,7 @@ const treeKeys = reactive({
|
|
|
|
|
|
const filterNodes = (arr) => {
|
|
const filterNodes = (arr) => {
|
|
arr.length && arr.forEach((item) => {
|
|
arr.length && arr.forEach((item) => {
|
|
- console.log(item);
|
|
|
|
|
|
+ // console.log(item);
|
|
props.allCheckedList.includes(item.ChartClassifyId) && (item.expanded = true);
|
|
props.allCheckedList.includes(item.ChartClassifyId) && (item.expanded = true);
|
|
item.Children&&item.Children.length && containsAnyValue(item.Children, props.allCheckedList) && (item.expanded = true);
|
|
item.Children&&item.Children.length && containsAnyValue(item.Children, props.allCheckedList) && (item.expanded = true);
|
|
item.Children&&item.Children.length && filterNodes(item.Children);
|
|
item.Children&&item.Children.length && filterNodes(item.Children);
|
|
@@ -134,7 +137,7 @@ watch(
|
|
watch(
|
|
watch(
|
|
() => props.currentStep,
|
|
() => props.currentStep,
|
|
(newValue) => {
|
|
(newValue) => {
|
|
- if (newValue === 3) {
|
|
|
|
|
|
+ if (newValue === 3 && route.name !== 'addBusiness') {
|
|
emit('getSearch', searchTxt.value);
|
|
emit('getSearch', searchTxt.value);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -165,7 +168,7 @@ const onChange = (checked, context) => {
|
|
} else { // 如果当前节点有子节点,则直接加上该节点的id
|
|
} else { // 如果当前节点有子节点,则直接加上该节点的id
|
|
actuallyAllChecked.value = [...new Set([...actuallyAllChecked.value, node.value])];
|
|
actuallyAllChecked.value = [...new Set([...actuallyAllChecked.value, node.value])];
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
|
|
+ } else {
|
|
if (node.data.Children.length) { // 如果当前节点有子节点,则直接去掉该节点和子节点的所有id
|
|
if (node.data.Children.length) { // 如果当前节点有子节点,则直接去掉该节点和子节点的所有id
|
|
const temp = [...getAllChildIds(node.data.Children), node.value];
|
|
const temp = [...getAllChildIds(node.data.Children), node.value];
|
|
allChecked.value = removeChildren(allChecked.value, temp);
|
|
allChecked.value = removeChildren(allChecked.value, temp);
|