提交 2473956e 编写于 作者: 水晶土豆

Tue Nov 21 15:33:00 CST 2023 inscode

上级 b2fe6fe4
<script setup> <script setup>
import { onMounted, ref, provide, reactive, watch } from 'vue' import { onMounted, ref, provide, reactive, watch, toRefs } from 'vue'
import { deepClone } from '@/util/deepCode' import { deepClone } from '@/util/deepCode'
import { TreeToFlat, FlatToTree } from '@/util/toTree' import { TreeToFlat, FlatToTree } from '@/util/toTree'
import { computed } from '@vue/reactivity'; import { computed } from '@vue/reactivity';
...@@ -37,11 +37,9 @@ const defExpandedKey = computed(() => { ...@@ -37,11 +37,9 @@ const defExpandedKey = computed(() => {
return return_s; return return_s;
}) })
const treeInstance = ref([]) const treeInstance = ref([])
const treeValue = reactive(["人事部", "财务部", "市场部", "销售一部", "销售三部", "技术部", "产品部", "设计部", "研发部", "客服部", "客服一部", "客服二部"]); const treeValue = ref(["人事部", "财务部", "市场部", "销售一部", "销售三部", "技术部", "产品部", "设计部", "研发部", "客服部", "客服一部", "客服二部"]);
const treeCheckChange = () => { const treeCheckChange = () => {
console.log(treeValue); treeValue.value = treeInstance.value?.getCheckedKeys(false);
treeValue = treeInstance.value?.getCheckedKeys(false);
console.log(treeValue);
} }
// pagination // pagination
...@@ -51,7 +49,7 @@ const tablePagination = reactive({ ...@@ -51,7 +49,7 @@ const tablePagination = reactive({
total: 1 total: 1
}); });
const getData = () => { const getData = () => {
getEmpList({ page: tablePagination.currentPage, limit: tablePagination.pageSize, deptName: JSON.stringify(treeValue) }).then((res) => { getEmpList({ page: tablePagination.currentPage, limit: tablePagination.pageSize, deptName: JSON.stringify(treeValue.value) }).then((res) => {
if (res.data.data.code === 10000) { if (res.data.data.code === 10000) {
console.log(res.data.data); console.log(res.data.data);
tableData.value = res.data.data.data; tableData.value = res.data.data.data;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册