更新页面

This commit is contained in:
2025-07-18 10:54:07 +08:00
parent e1c84d9b27
commit 20cb6743cd
10 changed files with 47 additions and 34 deletions

View File

@ -20,6 +20,7 @@ import { COMPONENT_WIDTH } from "@/constant";
import { qcckPost, qcckGet, qcckFlvGet } from "@/api/qcckApi.js";
import { ref, defineProps, defineEmits, defineExpose, computed, onMounted, watch } from "vue";
import { selectDeptPage } from "@/api/user-manage";
import { tr } from "element-plus/es/locale.mjs";
const props = defineProps({
//获取组件传值
placeholder: {
@ -41,9 +42,13 @@ const props = defineProps({
width: {
default: COMPONENT_WIDTH,
type: String
},
isAll:{
default: false,
type: Boolean
}
});
const modelShow = ref(false);
const firstLoad = ref(true)
const oldmodelValue = ref([]);
const listQuery = ref({
deptname: "",
@ -61,7 +66,12 @@ const endProps = {
lazy: true,
lazyLoad(node, resolve) {
listQuery.value.parentid = node.data.id;
selectDeptPage(listQuery.value).then((res) => {
let params = { ...listQuery.value };
if(props.isAll && firstLoad.value) {
params.parentid = 1;
firstLoad.value = false;
}
selectDeptPage(params).then((res) => {
depList.value = depList.value.concat(res)
//处理部门是否包含下级
for (let i = 0; i < res.length; i++) {
@ -73,7 +83,11 @@ const endProps = {
};
const tableData = ref([]);
const getSysMenuTree = async () => {
const res = await selectDeptPage(listQuery.value);
let params = { ...listQuery.value }
if(props.isAll) params.parentid = 1;
console.log('初始化-----');
const res = await selectDeptPage(params);
tableData.value = res;
depList.value = res
};