|
@@ -13,7 +13,7 @@
|
|
|
</h1>
|
|
|
<p>{{$t("index.normalTenant")}}</p>
|
|
|
</div>
|
|
|
-
|
|
|
+
|
|
|
</el-col>
|
|
|
<!-- 待生产订单 -->
|
|
|
<el-col :xs="24" :sm="12" :lg="6">
|
|
@@ -37,7 +37,7 @@
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
-
|
|
|
+
|
|
|
<!-- 中-echarts表 -->
|
|
|
<el-row class="rowCls">
|
|
|
<el-col>
|
|
@@ -104,13 +104,13 @@
|
|
|
</el-row>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
-
|
|
|
+
|
|
|
<!-- 下- 功能按钮 -->
|
|
|
- <el-row :gutter="20">
|
|
|
+<!-- <el-row :gutter="20">
|
|
|
<el-col :xs="24" :sm="14" :lg="16">
|
|
|
<div class="colCls">
|
|
|
<div class="lastRow">
|
|
|
- <!-- 常用功能 -->
|
|
|
+ <!– 常用功能 –>
|
|
|
<h3>{{ $t("index.comBtn") }}</h3>
|
|
|
<el-row :gutter="20" class="menuRow">
|
|
|
<el-col :span="6"><div class="grid-content bg-purple-light"><a @click="meunClk('')">组织管理</a></div></el-col>
|
|
@@ -132,18 +132,78 @@
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </el-col>
|
|
|
- <el-col :xs="24" :sm="10" :lg="8">
|
|
|
+ </el-col>-->
|
|
|
+<!-- <el-col :xs="24" :sm="10" :lg="8">
|
|
|
+ <div class="colCls">
|
|
|
+ <div class="lastRow">
|
|
|
+ <!– 登录监控 –>
|
|
|
+ <h3>{{ $t("index.loginInfo") }}</h3>
|
|
|
+ <template>
|
|
|
+ <el-table :data="tableData" border height="150" size="mini" style="width: 100%;" v-loading="loading">
|
|
|
+ <el-table-column prop="userName" width="130" :label='$t("index.table.userName")' align="center"></el-table-column>
|
|
|
+ <el-table-column prop="requestIp" width="90" :label='$t("index.table.requestIp")' align="center"></el-table-column>
|
|
|
+ <el-table-column prop="createTime" :label='$t("index.table.createTime")' align="center"></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-col>-->
|
|
|
+ <el-col :xs="24" :sm="10" :lg="6">
|
|
|
+ <div class="colCls">
|
|
|
+ <div class="lastRow" >
|
|
|
+ <!-- 登录监控 -->
|
|
|
+ <h3>机床1-10.161.30.245-预警</h3>
|
|
|
+ <template>
|
|
|
+ <el-table :data="toolTableData1" border height="150" size="mini" style="width: 100%;" v-loading="loading" :cell-style="cellStyle">
|
|
|
+ <el-table-column prop="name" width="130" label='提示' align="center" ></el-table-column>
|
|
|
+ <el-table-column prop="code" width="90" label="编码" align="center"></el-table-column>
|
|
|
+ <el-table-column prop="createTime" :label='$t("index.table.createTime")' align="center"></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="24" :sm="10" :lg="6">
|
|
|
+ <div class="colCls">
|
|
|
+ <div class="lastRow">
|
|
|
+ <!-- 登录监控 -->
|
|
|
+ <h3>机床2-10.161.30.246-预警</h3>
|
|
|
+ <template>
|
|
|
+ <el-table :data="toolTableData2" border height="150" size="mini" style="width: 100%;" v-loading="loading" :cell-style="cellStyle">
|
|
|
+ <el-table-column prop="name" width="130" label='提示' align="center" ></el-table-column>
|
|
|
+ <el-table-column prop="code" width="90" label="编码" align="center"></el-table-column>
|
|
|
+ <el-table-column prop="createTime" :label='$t("index.table.createTime")' align="center"></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="24" :sm="10" :lg="6">
|
|
|
+ <div class="colCls">
|
|
|
+ <div class="lastRow">
|
|
|
+ <!-- 登录监控 -->
|
|
|
+ <h3>机床3-10.161.30.247-预警</h3>
|
|
|
+ <template>
|
|
|
+ <el-table :data="toolTableData3" border height="150" size="mini" style="width: 100%;" v-loading="loading" :cell-style="cellStyle">
|
|
|
+ <el-table-column prop="name" width="130" label='提示' align="center" ></el-table-column>
|
|
|
+ <el-table-column prop="code" width="90" label="编码" align="center"></el-table-column>
|
|
|
+ <el-table-column prop="createTime" :label='$t("index.table.createTime")' align="center"></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="24" :sm="10" :lg="6">
|
|
|
<div class="colCls">
|
|
|
<div class="lastRow">
|
|
|
<!-- 登录监控 -->
|
|
|
- <h3>{{ $t("index.loginInfo") }}</h3>
|
|
|
+ <h3>自动化产线PLC-预警</h3>
|
|
|
<template>
|
|
|
- <el-table :data="tableData" border height="150" size="mini" style="width: 100%;" v-loading="loading">
|
|
|
- <el-table-column prop="userName" width="130" :label='$t("index.table.userName")' align="center"></el-table-column>
|
|
|
- <el-table-column prop="requestIp" width="90" :label='$t("index.table.requestIp")' align="center"></el-table-column>
|
|
|
- <el-table-column prop="createTime" :label='$t("index.table.createTime")' align="center"></el-table-column>
|
|
|
- </el-table>
|
|
|
+ <el-table :data="plcTableData" border height="150" size="mini" style="width: 100%;" v-loading="loading" :cell-style="cellStyle">
|
|
|
+ <el-table-column prop="name" width="130" label='提示' align="center" ></el-table-column>
|
|
|
+ <el-table-column prop="code" width="90" label="编码" align="center"></el-table-column>
|
|
|
+ <el-table-column prop="createTime" :label='$t("index.table.createTime")' align="center"></el-table-column>
|
|
|
+ </el-table>
|
|
|
</template>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -151,6 +211,8 @@
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</template>
|
|
|
+
|
|
|
+
|
|
|
<script>
|
|
|
// 加载Echarts组件
|
|
|
import echarts from 'echarts'
|
|
@@ -162,9 +224,11 @@
|
|
|
import indexApi from '@/api/index/index'
|
|
|
// 【登录监控】-API
|
|
|
import loginLogApi from '@/api/LoginLog';
|
|
|
+
|
|
|
+ import taskMgrApi from "@/api/runManageCenter/taskMgr";
|
|
|
// 加载【共通】函数
|
|
|
import { initQueryParams } from '@/utils/commons'
|
|
|
-
|
|
|
+
|
|
|
export default {
|
|
|
name: 'Dashboard',
|
|
|
components: {countTo, BarChart},
|
|
@@ -178,6 +242,11 @@
|
|
|
loading: false,
|
|
|
queryParams: initQueryParams(),
|
|
|
tableData: [],
|
|
|
+ toolTableData1: [],
|
|
|
+ toolTableData2: [],
|
|
|
+ toolTableData3: [],
|
|
|
+ plcTableData: [],
|
|
|
+ warningData: [],
|
|
|
// 企业用户新增数量统计-数据
|
|
|
barData: {
|
|
|
name: '企业用户',
|
|
@@ -194,13 +263,17 @@
|
|
|
// 查询企业生产资源数量排名
|
|
|
this.searchResourceNum()
|
|
|
// 查询[登录监控]数据
|
|
|
- this.getLoginData()
|
|
|
+ //this.getLoginData()
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
// 查询【企产线运行时间统计】
|
|
|
// this.getTaskCountStatistics()
|
|
|
},
|
|
|
computed: {
|
|
|
},
|
|
|
mounted() {
|
|
|
+ this.startPolling();
|
|
|
},
|
|
|
methods: {
|
|
|
// 【今日、本周、本月、全年】按钮-事件
|
|
@@ -212,11 +285,21 @@
|
|
|
// 查询数据
|
|
|
this.searchBarData(flag)
|
|
|
},
|
|
|
- radioClick(val){
|
|
|
+ radioClick(val){
|
|
|
this.isMachine = val;
|
|
|
this.searchBarData(this.btnActive);
|
|
|
},
|
|
|
-
|
|
|
+ startPolling() {
|
|
|
+ // 使用 setInterval 每 5 秒调用一次接口
|
|
|
+ this.interval = setInterval(() => {
|
|
|
+ this.getWarning()
|
|
|
+
|
|
|
+ }, 5000);
|
|
|
+
|
|
|
+ // 立即调用一次接口以初始化数据
|
|
|
+ this.getWarning();
|
|
|
+ },
|
|
|
+
|
|
|
// 【日期期间】值变化-事件
|
|
|
changeDate(val){
|
|
|
// 日期区间,被选中
|
|
@@ -237,7 +320,7 @@
|
|
|
// 查询数据
|
|
|
this.searchBarData("date", val);
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
// 【常用功能】点击-事件
|
|
|
meunClk(urls){
|
|
|
if(!!urls){
|
|
@@ -302,20 +385,41 @@
|
|
|
console.log("【企业生产资源数量排名】统计数据123456:",res)
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
// [登录监控]数据
|
|
|
getLoginData(params = {}) {
|
|
|
this.loading = true;
|
|
|
this.queryParams.current = params.current ? params.current : this.queryParams.current;
|
|
|
this.queryParams.size = params.size ? params.size : this.queryParams.size;
|
|
|
loginLogApi.page(this.queryParams).then(response => {
|
|
|
- const res = response.data;
|
|
|
+ const res = response.data;
|
|
|
if (res.isSuccess) {
|
|
|
this.tableData = res.data.records;
|
|
|
}
|
|
|
}).finally(() => this.loading = false);
|
|
|
},
|
|
|
-
|
|
|
+ getWarning(params = {}) {
|
|
|
+ this.loading = true;
|
|
|
+ /*this.queryParams.current = params.current ? params.current : this.queryParams.current;
|
|
|
+ this.queryParams.size = params.size ? params.size : this.queryParams.size;*/
|
|
|
+
|
|
|
+ taskMgrApi.chfToolWarning().then(response => {
|
|
|
+ const res = response.data;
|
|
|
+ if (res.isSuccess) {
|
|
|
+ this.toolTableData1 = this.getCollectionByIp('10.161.30.245',res);
|
|
|
+ this.toolTableData2 = this.getCollectionByIp('10.161.30.246',res);
|
|
|
+ this.toolTableData3 = this.getCollectionByIp('10.161.30.247',res);
|
|
|
+ }
|
|
|
+ }).finally(() => this.loading = false);
|
|
|
+
|
|
|
+ taskMgrApi.chfPlcWarning().then(response => {
|
|
|
+ const res = response.data;
|
|
|
+ console.log(res)
|
|
|
+ if (res.isSuccess) {
|
|
|
+ this.plcTableData = res.data;
|
|
|
+ }
|
|
|
+ }).finally(() => this.loading = false);
|
|
|
+ },
|
|
|
// 【企产线运行时间统计】数据
|
|
|
getTaskCountStatistics(){
|
|
|
let datas = ['','','','',''];
|
|
@@ -329,7 +433,28 @@
|
|
|
this.indexTable = res.data;
|
|
|
console.log("【企产线运行时间统计】数据:",res)
|
|
|
})
|
|
|
+ },
|
|
|
+ // 定义一个函数,通过 IP 地址获取对应的数据集合
|
|
|
+ getCollectionByIp(ip,responseData) {
|
|
|
+ // 遍历 data 数组,查找匹配的 IP 地址
|
|
|
+ for (let item of responseData.data) {
|
|
|
+ if (item[ip]) {
|
|
|
+ return item[ip];
|
|
|
+ }
|
|
|
}
|
|
|
+ return null; // 如果没有找到,返回 null
|
|
|
+ },
|
|
|
+ cellStyle(row, column, rowIndex, columnIndex) {
|
|
|
+ //根据报警级别显示颜色
|
|
|
+ // console.log(row);
|
|
|
+ // console.log(row.column);
|
|
|
+ console.log("row"+row)
|
|
|
+ if (
|
|
|
+ row.column.label === "提示" || row.column.label === "编码"
|
|
|
+ ) {
|
|
|
+ return "color:#ff0000";
|
|
|
+ }
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -457,6 +582,9 @@
|
|
|
opacity: 0.7;
|
|
|
color: #1890ff;
|
|
|
}
|
|
|
+ .red-text .cell {
|
|
|
+ color: red !important;
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
-</style>
|
|
|
+
|
|
|
+</style>
|