|
@@ -8,20 +8,20 @@
|
|
|
:isReadOnly="true"
|
|
|
tipPlace="top"
|
|
|
caption="系统名称:"
|
|
|
- @change="testClick"
|
|
|
+ @change="changeCurSystem"
|
|
|
v-model="systemName"
|
|
|
- :selectdata="systemList"
|
|
|
+ :selectdata="systemList"
|
|
|
:placeholder="'请选择'"
|
|
|
/>
|
|
|
<div class="system-content">
|
|
|
- <div v-for="(item) in systemContentData" :key="'key_' + item.id" class="item-content" :class="{'active': item.isActive}">
|
|
|
+ <div v-for="(item) in systemContentData" :key="'key_' + item.id" class="item-content" :class="{'active': item.isActive}" @click="changeEquipment(item.id)">
|
|
|
<div class="first-row">
|
|
|
<div>{{item.name}}</div>
|
|
|
<div>{{item.isMaintenance?'维保中' : ''}}</div>
|
|
|
</div>
|
|
|
<div class="sec-row">
|
|
|
<div>{{item.num}}<span>台</span></div>
|
|
|
- <div :class="{'abnormal': item.abnormal}">{{item.status}}</div>
|
|
|
+ <span :class="{'abnormal': item.abnormal}">{{item.statusNum !== 0?item.statusNum : ''}}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -31,18 +31,34 @@
|
|
|
<Input iconType="search" v-model="searchKey" placeholder="搜索" width="192"/>
|
|
|
</div>
|
|
|
<el-table :data="tableData" style="width: 100%;margin-bottom: 63px;" @row-click="showEquipmentStatus">
|
|
|
- <el-table-column prop="serialNumber" label="序号"></el-table-column>
|
|
|
- <el-table-column prop="equipmentName" label="设备简称"></el-table-column>
|
|
|
- <el-table-column prop="equipmentNumber" label="设备编号"></el-table-column>
|
|
|
- <el-table-column prop="status" label="状态"></el-table-column>
|
|
|
- <el-table-column prop="photo" label="照片"></el-table-column>
|
|
|
- <el-table-column prop="report" label="报告"></el-table-column>
|
|
|
+ <el-table-column label="序号" type="index" :index="indexMethod"></el-table-column>
|
|
|
+ <el-table-column prop="sbjc" label="设备简称"></el-table-column>
|
|
|
+ <el-table-column prop="assetnum" label="设备编号"></el-table-column>
|
|
|
+ <el-table-column prop="is_exception" label="状态">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span style="display: inline-block;width: 6px;height:6px;border-radius: 3px;background: #0091FF;" :style="{'background': !scope.row.is_exception?'#0091FF' : '#F54E45'}"></span>
|
|
|
+ <span style="margin-left: 10px">{{ !scope.row.status?'正常' : '异常' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="photos_num" label="照片">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span style="color: #025BAA">{{ scope.row.photos_num?scope.row.photos_num : 0 }}张</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="report" label="报告">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span style="color: #025BAA">{{ scope.row.report }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
<div class="page">
|
|
|
<el-pagination
|
|
|
background
|
|
|
layout="prev, pager, next"
|
|
|
- :total="tatol">
|
|
|
+ :total="tatol"
|
|
|
+ :current-page="curPage"
|
|
|
+ :page-size="pageSize"
|
|
|
+ @current-change="changeTablePage">
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
<el-dialog title="交换机-照明系统" :visible.sync="dialogTableVisible">
|
|
@@ -58,8 +74,16 @@
|
|
|
<el-table-column property="serialNumber" label="日期"></el-table-column>
|
|
|
<el-table-column property="equipmentName" label="事项类型"></el-table-column>
|
|
|
<el-table-column property="equipmentNumber" label="事项名称"></el-table-column>
|
|
|
- <el-table-column property="photo" label="照片"></el-table-column>
|
|
|
- <el-table-column property="report" label="报告"></el-table-column>
|
|
|
+ <el-table-column property="photos_num" label="照片">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span style="color: #025BAA">{{ scope.row.photos_num?scope.row.photos_num : 0 }}张</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column property="report" label="报告">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span style="color: #025BAA">{{ scope.row.report }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
<div class="page">
|
|
|
<el-pagination
|
|
@@ -75,25 +99,29 @@
|
|
|
|
|
|
<script>
|
|
|
import { Select, Input } from 'meri-design';
|
|
|
+import { queryEquipmentList, queryTableData } from '../../api/coreDeviceReport';
|
|
|
+import _ from 'lodash';
|
|
|
export default {
|
|
|
data () {
|
|
|
return {
|
|
|
systemName: '', // 系统名称
|
|
|
systemList: [], // 系统
|
|
|
systemContentData: [
|
|
|
- {id: 1, name: '高压配电柜', isMaintenance: true, num: 95, status: '正常', abnormal: false, isActive: true},
|
|
|
- {id: 2, name: '变压器', isMaintenance: false, num: 256, status: '异常: 323', abnormal: true, isActive: false},
|
|
|
- {id: 3, name: '低压配电柜', isMaintenance: false, num: 354, status: '正常', abnormal: false, isActive: false},
|
|
|
- {id: 4, name: '直流屏', isMaintenance: false, num: 175, status: '正常', abnormal: false, isActive: false},
|
|
|
- {id: 5, name: '柴油发电机组', isMaintenance: false, num: 186, status: '正常', abnormal: false, isActive: false},
|
|
|
+ {id: 1, name: '高压配电柜', isMaintenance: true, num: 95, statusNum: 0, abnormal: false, isActive: true},
|
|
|
+ {id: 2, name: '变压器', isMaintenance: false, num: 256, statusNum: 12, abnormal: true, isActive: false},
|
|
|
+ {id: 3, name: '低压配电柜', isMaintenance: false, num: 354, statusNum: 0, abnormal: false, isActive: false},
|
|
|
+ {id: 4, name: '直流屏', isMaintenance: false, num: 175, statusNum: 0, abnormal: false, isActive: false},
|
|
|
+ {id: 5, name: '柴油发电机组', isMaintenance: false, num: 186, status: 0, abnormal: false, isActive: false},
|
|
|
], // 系统下的各种组成
|
|
|
searchKey: '', // 搜索关键字
|
|
|
tableData: [
|
|
|
- {serialNumber: 1, equipmentName: 2, equipmentNumber: 3, status: 4, photo: 5, report: 6},
|
|
|
- {serialNumber: 1, equipmentName: 2, equipmentNumber: 3, status: 4, photo: 5, report: 6},
|
|
|
- {serialNumber: 1, equipmentName: 2, equipmentNumber: 3, status: 4, photo: 5, report: 6},
|
|
|
+ // {serialNumber: 1, equipmentName: 2, equipmentNumber: 3, status: '正常', photo: 5, report: 6},
|
|
|
+ // {serialNumber: 1, equipmentName: 2, equipmentNumber: 3, status: '异常', photo: 5, report: 6},
|
|
|
+ // {serialNumber: 1, equipmentName: 2, equipmentNumber: 3, status: '正常', photo: 5, report: 6},
|
|
|
], // 表数据
|
|
|
- tatol: 100, // 总数据
|
|
|
+ curPage: 1, // 当前页码
|
|
|
+ pageSize: 10, // 每页条数
|
|
|
+ tatol: 0, // 总数据
|
|
|
dialogTableVisible: false, // 弹窗显示状态
|
|
|
dialogTime: '', // 弹框内的时间
|
|
|
}
|
|
@@ -106,11 +134,72 @@ export default {
|
|
|
|
|
|
computed: {},
|
|
|
|
|
|
- mounted() {},
|
|
|
+ mounted() {
|
|
|
+ this.getSystemList();
|
|
|
+ this.getTableData();
|
|
|
+ },
|
|
|
|
|
|
methods: {
|
|
|
- testClick() {
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 获取系统列表数据
|
|
|
+ */
|
|
|
+ getSystemList() {
|
|
|
+ queryEquipmentList().then((res) => {
|
|
|
+ if (res.result === 'success') {
|
|
|
+ let data = res.data;
|
|
|
+ let newData = [];
|
|
|
+ _.forEach(data, (item) => {
|
|
|
+ newData.push({
|
|
|
+ id: item.code,
|
|
|
+ name: item.name
|
|
|
+ })
|
|
|
+ })
|
|
|
+ this.systemList = newData;
|
|
|
+ }
|
|
|
+ }).catch((err) => {
|
|
|
+ console.err(err)
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 切换系统名称
|
|
|
+ */
|
|
|
+ changeCurSystem(val) {
|
|
|
+ console.log('val', val)
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 切换系统下的设备
|
|
|
+ */
|
|
|
+ changeEquipment(id) {
|
|
|
+ _.map(this.systemContentData, (o) => {return o.isActive = o.id === id})
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 获取表数据
|
|
|
+ */
|
|
|
+ getTableData() {
|
|
|
+ let query = {
|
|
|
+ category_code: 'gdc'
|
|
|
+ }
|
|
|
+ queryTableData(`/data/data/glsms_asset/query?plazaId=1000423&page=${this.curPage}&size=${this.pageSize}`, query).then((res) => {
|
|
|
+ console.log('res', res)
|
|
|
+ const { result, count, data } = res;
|
|
|
+ if (result === 'success') {
|
|
|
+ this.tatol = count;
|
|
|
+ this.tableData = data;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 表第一列序号
|
|
|
+ */
|
|
|
+ indexMethod(index) {
|
|
|
+ return index + 1;
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 切换页码
|
|
|
+ */
|
|
|
+ changeTablePage(page) {
|
|
|
+ this.curPage = page;
|
|
|
+ this.getTableData();
|
|
|
},
|
|
|
/**
|
|
|
* 显示设备实例的维保、专维等状态
|
|
@@ -118,7 +207,7 @@ export default {
|
|
|
showEquipmentStatus(row, column, e) {
|
|
|
console.log('row', row)
|
|
|
this.dialogTableVisible = true;
|
|
|
- }
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -144,11 +233,15 @@ export default {
|
|
|
padding-right: 21px;
|
|
|
padding-top: 7px;
|
|
|
padding-bottom: 8px;
|
|
|
+ border-bottom: 1px solid #E4E6E7;
|
|
|
+ cursor: pointer;
|
|
|
>div{
|
|
|
display: flex;
|
|
|
}
|
|
|
.first-row{
|
|
|
margin-bottom: 6px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
>div:first-child{
|
|
|
font-size: 14px;
|
|
|
color: #1F2429;
|
|
@@ -160,11 +253,10 @@ export default {
|
|
|
color: #CD981D;
|
|
|
line-height: 20px;
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
.sec-row{
|
|
|
margin-bottom: 6px;
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
>div:first-child{
|
|
|
font-size: 14px;
|
|
|
color: #1F2429;
|
|
@@ -174,17 +266,22 @@ export default {
|
|
|
color: #646C73;
|
|
|
}
|
|
|
}
|
|
|
- >div:nth-of-type(2){
|
|
|
- padding-left: 8px;
|
|
|
- padding-right: 8px;
|
|
|
- font-size: 12px;
|
|
|
- color: #0065B3;
|
|
|
- line-height: 22px;
|
|
|
- background: #E1F2FF;
|
|
|
- }
|
|
|
+ // >div:nth-of-type(2){
|
|
|
+ // padding-left: 8px;
|
|
|
+ // padding-right: 8px;
|
|
|
+ // font-size: 12px;
|
|
|
+ // color: #0065B3;
|
|
|
+ // line-height: 22px;
|
|
|
+ // background: #E1F2FF;
|
|
|
+ // }
|
|
|
.abnormal{
|
|
|
+ margin-left: 11px;
|
|
|
+ padding-left: 3px;
|
|
|
+ padding-right: 3px;
|
|
|
+ font-size: 12px;
|
|
|
+ color: #F54E45!important;
|
|
|
background: #FDE3E2!important;
|
|
|
- color: #AC2F28!important;
|
|
|
+ border-radius:9px;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -195,6 +292,9 @@ export default {
|
|
|
.first-row>div:first-child,
|
|
|
.sec-row>div{
|
|
|
color: #025BAA;
|
|
|
+ >span{
|
|
|
+ color: #025BAA;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|