Ver código fonte

联络员 组织架构树

Luka 1 mês atrás
pai
commit
bdd7eaad83

+ 1 - 2
.env.development

@@ -16,8 +16,7 @@ VITE_APP_TOKEN =  6617e72a5a7e41eb6c30aa4fa3000022
 
 # 开发接口地址
 # VITE_APP_API_URL = "http://libai1024.gnway.cc:80"
-# VITE_APP_API_URL = "http://172.33.7.60:7070/"
-VITE_APP_API_URL = "http://192.168.101.73:7070"
+VITE_APP_API_URL = "http://106.75.213.212:7070"
 
 # 是否在打包时开启压缩,支持 gzip 和 brotli
 VITE_BUILD_COMPRESS = gzip

+ 4 - 1
src/views/notificationInfoManage/contactsmanage/components/treeSelect.vue

@@ -14,10 +14,10 @@
 				v-model:checkedKeys="checkedKeys"
 				:data="treeData"
 				:props="treeProps"
-				default-expand-all
 				highlight-current
 				show-checkbox
 				check-on-click-node
+				:default-expanded-keys="expandedKeys"
 				node-key="id"
 				:filter-node-method="filterNode"
 				@check-change="handleCheckChange"
@@ -48,8 +48,11 @@ const checkedKeys = ref<(string | number)[]>([]);
 const treeRef = ref<InstanceType<typeof ElTree>>();
 
 const treeData = ref<TreeOptions[]>();
+const expandedKeys: any = ref([]);
 onMounted(async () => {
 	treeData.value = await outDeptTree();
+	expandedKeys.value = treeData.value.map(node => node.id);
+	emit('treeCheck', '');
 });
 
 // 过滤节点(搜索功能)

+ 13 - 2
src/views/notificationInfoManage/contactsmanage/index.vue

@@ -1,6 +1,12 @@
 <template>
 	<el-tabs type="card" v-model="activeTab" style="height: 100%" @tab-click="handleClick">
-		<el-tab-pane v-for="tab in tabs" :key="tab.key" :label="tab.label" :name="tab.key">
+		<el-tab-pane
+			v-for="tab in tabs"
+			:key="tab.key"
+			:label="tab.label"
+			:name="tab.key"
+			v-loading="treeLoading"
+		>
 			<div class="sensitive-words flex">
 				<TreeSelect class="mr20" ref="treeSelectdRef" @treeCheck="getTreeCheck"></TreeSelect>
 				<div class="table-box">
@@ -122,8 +128,12 @@ const searchTableRef: any = ref<InstanceType<typeof pageSearch>>();
 import usePageModal from '@/components/components/hooks/usePageDetails';
 const { modalRef, handleNewDataClick, handleEditDataClick, handleCheckDataClick, handlePageDetail } =
 	usePageModal();
-
+const treeLoading = ref(true);
 const getTreeCheck = async data => {
+	treeLoading.value = false;
+	if (!data) {
+		return;
+	}
 	if (activeTab.value == '1') {
 		searchConfig.pageListParams.belongsDeptIds = data.join();
 	} else {
@@ -147,6 +157,7 @@ const handleQuery = async () => {
 
 const treeSelectdRef = ref<InstanceType<typeof TreeSelect>>();
 const loading = ref(false);
+
 const handleClick = async (tab: TabsPaneContext) => {
 	loading.value = true;
 	setTimeout(() => {