From 00d4082a1709e7c32e7fdefc815266a58d87bf8e Mon Sep 17 00:00:00 2001
From: shj <1790240199@qq.com>
Date: 星期一, 01 八月 2022 10:26:48 +0800
Subject: [PATCH] 对接

---
 src/views/facilityManagement/ProductionEquipment/index.vue        |    9 ++--
 src/views/facilityManagement/InstrumentationInformation/index.vue |   28 +++++++-------
 src/views/facilityManagement/EquipmentStatistics/index.vue        |   36 +++++++++++++++---
 src/views/facilityManagement/safetyEquipment/index.vue            |    9 ++--
 4 files changed, 54 insertions(+), 28 deletions(-)

diff --git a/src/views/facilityManagement/EquipmentStatistics/index.vue b/src/views/facilityManagement/EquipmentStatistics/index.vue
index 65cda52..07a359f 100644
--- a/src/views/facilityManagement/EquipmentStatistics/index.vue
+++ b/src/views/facilityManagement/EquipmentStatistics/index.vue
@@ -7,10 +7,36 @@
 <script lang="ts">
 import { defineComponent, onMounted, ref } from 'vue';
 import * as echarts from 'echarts';
+import { ElMessage } from 'element-plus';
+import { facilityManagementApi } from '/@/api/facilityManagement';
 export default defineComponent({
 	setup() {
+		const listApi = () => {
+			facilityManagementApi()
+				.getequipmentInfoStatistics()
+				.then((res) => {
+					if (res.data.code == 200) {
+						let arr=[]
+						arr=res.data.data
+						let date=[]
+						for (let i = 0; i < arr.length; i++) {
+							date.push(arr[i].count)
+						}
+						init(date);
+					} else {
+						ElMessage({
+							showClose: true,
+							message: res.data.msg,
+							type: 'error',
+						});
+					}
+				});
+		};
+		onMounted(() => {
+			listApi();
+		});
 		const main = ref();
-		const init = () => {
+		const init = (data:any) => {
 			var myChart = echarts.init(main.value);
 			var option = {
 				tooltip: {},
@@ -35,7 +61,7 @@
 				color: ['#6394f9'],
 				series: [
 					{
-						data: [120, 200, 150, 80, 70, 110, 130],
+						data: data,
 						type: 'bar',
 					},
 				],
@@ -43,13 +69,11 @@
 
 			myChart.setOption(option);
 		};
-		onMounted(() => {
-			init();
-		});
 		return {
 			init,
 			onMounted,
 			main,
+			listApi,
 		};
 	},
 });
@@ -57,7 +81,7 @@
 <style scoped>
 .box {
 	background-color: #fff;
-    box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
+	box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
 }
 .title {
 	font-size: 16px;
diff --git a/src/views/facilityManagement/InstrumentationInformation/index.vue b/src/views/facilityManagement/InstrumentationInformation/index.vue
index 3a43231..55bcddd 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,7 +183,7 @@
 		// 弹窗
 		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) => {
@@ -226,13 +226,13 @@
 			}
 			deletAll.value = arr.toString();
 			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 +272,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 +286,7 @@
 			label: 'typeName',
 			children: 'childList',
 			value: 'id',
-		}
+		};
 		watch(filterText, (val) => {
 			treeRef.value!.filter(val);
 		});
@@ -295,18 +295,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=()=>{
diff --git a/src/views/facilityManagement/ProductionEquipment/index.vue b/src/views/facilityManagement/ProductionEquipment/index.vue
index c932fbc..ebe63db 100644
--- a/src/views/facilityManagement/ProductionEquipment/index.vue
+++ b/src/views/facilityManagement/ProductionEquipment/index.vue
@@ -38,7 +38,7 @@
 					</div>
 				</div>
 				<div style="padding-left: 10px">
-					<el-table ref="multipleTableRef" :data="tableData" style="width: 100%">
+					<el-table ref="multipleTableRef" :data="tableData"  @selection-change="handleSelectionChange" style="width: 100%">
 						<el-table-column type="selection" align="center" width="55" />
 						<el-table-column type="expand">
 							<template #default="scope">
@@ -142,6 +142,7 @@
 		// 重置
 		const resetForm = () => {
 			ruleForm.searchParams.qName = '';
+			ruleForm.searchParams.positionNum = '';
 			listApi();
 		};
 		const listApi = () => {
@@ -226,13 +227,13 @@
 			}
 			deletAll.value = arr.toString();
 			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;
 			}
 		};
diff --git a/src/views/facilityManagement/safetyEquipment/index.vue b/src/views/facilityManagement/safetyEquipment/index.vue
index 62aa834..66fd3aa 100644
--- a/src/views/facilityManagement/safetyEquipment/index.vue
+++ b/src/views/facilityManagement/safetyEquipment/index.vue
@@ -38,7 +38,7 @@
 					</div>
 				</div>
 				<div style="padding-left: 10px">
-					<el-table ref="multipleTableRef" :data="tableData" style="width: 100%">
+					<el-table ref="multipleTableRef" :data="tableData"  @selection-change="handleSelectionChange" style="width: 100%">
 						<el-table-column type="selection" align="center" width="55" />
 						<el-table-column type="expand">
 							<template #default="scope">
@@ -142,6 +142,7 @@
 		// 重置
 		const resetForm = () => {
 			ruleForm.searchParams.qName = '';
+			ruleForm.searchParams.positionNum = '';
 			listApi();
 		};
 		const listApi = () => {
@@ -226,13 +227,13 @@
 			}
 			deletAll.value = arr.toString();
 			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;
 			}
 		};

--
Gitblit v1.9.2