From f931c3a8fe0a7bf5c59c3cd75b9f3b017d1d84be Mon Sep 17 00:00:00 2001
From: 13937891274 <kxc0822>
Date: 星期三, 03 八月 2022 17:22:21 +0800
Subject: [PATCH] 数据对接

---
 src/views/facilityManagement/InstrumentationInformation/index.vue |   34 ++++++++++++++++++----------------
 1 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/src/views/facilityManagement/InstrumentationInformation/index.vue b/src/views/facilityManagement/InstrumentationInformation/index.vue
index 3a43231..e64297f 100644
--- a/src/views/facilityManagement/InstrumentationInformation/index.vue
+++ b/src/views/facilityManagement/InstrumentationInformation/index.vue
@@ -17,9 +17,8 @@
 		</el-form>
 		<el-row>
 			<el-col :span="4">
-			<el-input v-model="filterText" style="height: 30px" placeholder="请输入关键字" />
+				<el-input v-model="filterText" style="height: 30px" placeholder="请输入关键字" />
 				<div class="tree">
-					
 					<!-- <el-tree ref="treeRef" class="filter-tree" :data="data" :props="props" :filter-node-method="filterNode" /> -->
 					<el-tree ref="treeRef" :data="data" :props="props" @node-click="handleNodeClick" :filter-node-method="filterNode" />
 				</div>
@@ -38,7 +37,7 @@
 					</div>
 				</div>
 				<div style="padding-left: 10px">
-					<el-table ref="multipleTableRef" :data="tableData" style="width: 100%">
+					<el-table ref="multipleTableRef" :data="tableData" style="width: 100%"  @selection-change="handleSelectionChange">
 						<el-table-column type="selection" align="center" width="55" />
 						<el-table-column type="expand">
 							<template #default="scope">
@@ -142,6 +141,7 @@
 		// 重置
 		const resetForm = () => {
 			ruleForm.searchParams.qName = '';
+			ruleForm.searchParams.positionNum = '';
 			listApi();
 		};
 		const listApi = () => {
@@ -183,10 +183,12 @@
 		// 弹窗
 		const openAdd = ref();
 		const openD = (title: String, id: number) => {
-			openAdd.value.openDailog(title,false,id,0);
+			openAdd.value.openDailog(title, false, id, 0);
 		};
 		// 删除
 		const onDelete = (id: number) => {
+			let arr=[]
+			arr.push(id)
 			ElMessageBox.confirm('确定删除所选项吗?', 'Warning', {
 				confirmButtonText: '确定',
 				cancelButtonText: '取消',
@@ -194,7 +196,7 @@
 			})
 				.then(() => {
 					facilityManagementApi()
-						.getequipmentInfoDelete(id)
+						.getequipmentInfoDelete(arr)
 						.then((res) => {
 							if (res.data.code == 200) {
 								ElMessage({
@@ -224,15 +226,15 @@
 			for (let i = 0; i < valId.length; i++) {
 				arr.push(valId[i].id);
 			}
-			deletAll.value = arr.toString();
+			deletAll.value = arr
 			if (val.length == 1) {
-				// warning.value = false;
+				warning.value = false;
 				danger.value = false;
 			} else if (val.length == 0) {
-				// warning.value = true;
+				warning.value = true;
 				danger.value = true;
 			} else {
-				// warning.value = true;
+				warning.value = true;
 				danger.value = false;
 			}
 		};
@@ -272,7 +274,7 @@
 				.getequipmentTypeMngTreeData()
 				.then((res) => {
 					if (res.data.code == 200) {
-						data.value= res.data.data;
+						data.value = res.data.data;
 					} else {
 						ElMessage({
 							showClose: true,
@@ -286,7 +288,7 @@
 			label: 'typeName',
 			children: 'childList',
 			value: 'id',
-		}
+		};
 		watch(filterText, (val) => {
 			treeRef.value!.filter(val);
 		});
@@ -295,18 +297,18 @@
 			if (!value) return true;
 			return data.typeName.includes(value);
 		};
-       const handleNodeClick=(data: Tree)=>{
-			ruleForm.searchParams.positionNum=data.id
+		const handleNodeClick = (data: Tree) => {
+			ruleForm.searchParams.positionNum = data.id;
 			listApi();
-	   }
-		const data=ref([])
+		};
+		const data = ref([]);
 		onMounted(() => {
 			listApiTree();
 		});
 		const handleClicks = (tab: TabsPaneContext, event: Event) => {
 			console.log(tab, event);
 		};
-		
+
 		const activeName = ref('first');
 		// const Show=ref()
 		// const openUp=()=>{

--
Gitblit v1.9.2