|
@@ -12,9 +12,10 @@
|
|
|
v-model="systemId"
|
|
|
:selectdata="systemList"
|
|
|
:placeholder="'请选择'"
|
|
|
+ hideClear
|
|
|
/>
|
|
|
<div class="system-content">
|
|
|
- <div v-for="(item) in systemContentData" :key="'key_' + item.id" class="item-content" :class="{'active': item.isActive}" @click="changeEquipment(item.id)">
|
|
|
+ <div v-for="(item) in systemContentData" :key="'key_' + item.category_code" class="item-content" :class="{'active': item.isActive}" @click="changeEquipment(item.category_code)">
|
|
|
<div class="first-row">
|
|
|
<div>{{item.name}}</div>
|
|
|
<div>{{item.isMaintenance?'维保中' : ''}}</div>
|
|
@@ -42,13 +43,13 @@
|
|
|
</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?(scope.row.photos_num + '张') : '—' }}</span> -->
|
|
|
- <span style="color: #025BAA" @click="showPicturesDetail(scope.row)">1张</span>
|
|
|
+ <span style="color: #025BAA" @click="showPicturesDetail(scope.row, 'equip')">{{ scope.row.photos_num?(scope.row.photos_num + '张') : '—' }}</span>
|
|
|
+ <!-- <span style="color: #025BAA" @click="showPicturesDetail(scope.row)">1张</span> -->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="attachments_num" label="报告">
|
|
|
<template slot-scope="scope">
|
|
|
- <span style="color: #025BAA">{{ scope.row.attachments_num || scope.row.attachments_num === 0?(scope.row.attachments_num+ '张') : '—'}}</span>
|
|
|
+ <span style="color: #025BAA" @click="showReportDetail(scope.row, 'equip')">{{ scope.row.attachments_num?(scope.row.attachments_num+ '张') : '—'}}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -62,7 +63,7 @@
|
|
|
@current-change="changeTablePage">
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
- <el-dialog title="交换机-照明系统" :visible.sync="dialogTableVisible" width="1260px">
|
|
|
+ <el-dialog :title="equipTitle" :visible.sync="dialogTableVisible" width="1260px">
|
|
|
<el-date-picker
|
|
|
style="margin-bottom: 12px;"
|
|
|
v-model="dialogTime"
|
|
@@ -78,13 +79,13 @@
|
|
|
<el-table-column property="taskName" label="事项名称"></el-table-column>
|
|
|
<el-table-column width="100" property="photosNum" label="照片">
|
|
|
<template slot-scope="scope">
|
|
|
- <!-- <span style="color: #025BAA">{{ scope.row.photosNum || scope.row.photosNum === 0?(scope.row.photosNum + '张') : '—' }}</span> -->
|
|
|
- <span style="color: #025BAA" @click="showPicturesDetail(scope.row)">1张</span>
|
|
|
+ <span style="color: #025BAA" @click="showPicturesDetail(scope.row, 'his')">{{ scope.row.photosNum || scope.row.photosNum === 0?(scope.row.photosNum + '张') : '—' }}</span>
|
|
|
+ <!-- <span style="color: #025BAA" @click="showPicturesDetail(scope.row)">1张</span> -->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column width="100" property="attachmentsNum" label="报告">
|
|
|
<template slot-scope="scope">
|
|
|
- <span style="color: #025BAA">{{ scope.row.attachmentsNum || scope.row.attachmentsNum === 0?(scope.row.attachmentsNum+ '张') : '—'}}</span>
|
|
|
+ <span style="color: #025BAA" @click="showReportDetail(scope.row, 'his')">{{ scope.row.attachmentsNum?(scope.row.attachmentsNum+ '张') : '—'}}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -103,19 +104,13 @@
|
|
|
<el-dialog :title="detailTitle" :visible.sync="showDetail" width="1260px">
|
|
|
<div class="detail-container">
|
|
|
<div class="pictures-menu">
|
|
|
- <!-- <div v-for="(item) in pictureList" :key="'id_' + item.id" class="item"> -->
|
|
|
- <div class="item">
|
|
|
- <!-- <img :src="item.url" alt=""> -->
|
|
|
- <img src="../../assets/images/login_back.png" alt="">
|
|
|
- <div class="name">图层名称1.jpg</div>
|
|
|
- </div>
|
|
|
- <div class="item">
|
|
|
- <img src="../../assets/images/login_back.png" alt="">
|
|
|
- <div class="name">图层名称1.jpg</div>
|
|
|
+ <div v-for="(item) in pictureList" :key="'id_' + item.id" class="item" @click="changeCurImg(item.id)" :class="{'active': item.isActive}">
|
|
|
+ <img :src="item.url" alt="">
|
|
|
+ <div class="name" :title="item.name">{{item.name}}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="cur-img-container">
|
|
|
- <img src="../../assets/images/login_back.png" alt="">
|
|
|
+ <img :src="curImg.url" alt="">
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
@@ -129,6 +124,7 @@ import { Select, Input } from 'meri-design';
|
|
|
import { querySystemList, queryEquipmentList, queryTableData, queryHistoryTableData, queryDetailData } from '../../api/coreDeviceReport';
|
|
|
import _ from 'lodash';
|
|
|
import moment from 'moment';
|
|
|
+import { log } from 'util';
|
|
|
export default {
|
|
|
data () {
|
|
|
return {
|
|
@@ -153,6 +149,7 @@ export default {
|
|
|
dialogTableVisible: false, // 弹窗显示状态
|
|
|
|
|
|
// 核心设备实例
|
|
|
+ equipTitle: '', // 核心设备弹窗名称
|
|
|
assetnum: null, // 设备台账编码
|
|
|
historyTableData: [], // 核心设备实例的所有历史事项信息
|
|
|
dialogTime: null, // 弹框内的时间
|
|
@@ -164,7 +161,12 @@ export default {
|
|
|
|
|
|
showDetail: false, // 显示照片、报告详情
|
|
|
detailTitle: '图片预览', // 弹窗名称
|
|
|
- pictureList: [], // 图片列表
|
|
|
+ pictureList: [
|
|
|
+ // {id: 1, url: require('../../assets/images/login_back.png'), name: '图层名称1.jpg'},
|
|
|
+ // {id: 2, url: require('../../assets/images/matter_pop3.png'), name: '图层名称2.jpg'},
|
|
|
+ // {id: 3, url: require('../../assets/images/login_back.png'), name: '图层名称3.jpg'},
|
|
|
+ ], // 图片列表
|
|
|
+ curImg: {}, // 当前图片
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -177,8 +179,6 @@ export default {
|
|
|
|
|
|
mounted() {
|
|
|
this.getSystemList();
|
|
|
- this.getEquipmentOfSystem();
|
|
|
- this.getTableData();
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
@@ -225,14 +225,45 @@ export default {
|
|
|
param.smsxt = this.systemId;
|
|
|
}
|
|
|
queryEquipmentList('/data/home/querySystemCard', param).then((res) => {
|
|
|
- console.log('res', res)
|
|
|
+ const { result, data } = res;
|
|
|
+ if (result === 'success') {
|
|
|
+ let newData = [], abnormalList = [];
|
|
|
+
|
|
|
+ _.forEach(data[0].assetTypeList, (item, index) => {
|
|
|
+ let itemData = {
|
|
|
+ name: item.category_name,
|
|
|
+ isMaintenance: item.is_detecting,
|
|
|
+ statusNum: item.is_exception_num,
|
|
|
+ num: item.asset_num,
|
|
|
+ abnormal: item.is_exception_num !== 0,
|
|
|
+ category_code: item.category_code
|
|
|
+ }
|
|
|
+ if (!item.category_code) {
|
|
|
+ console.error('without category_code..', item)
|
|
|
+ }
|
|
|
+ if (item.is_exception_num === 0) {
|
|
|
+ newData.push(itemData)
|
|
|
+ } else {
|
|
|
+ abnormalList.push(itemData);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ newData = abnormalList.concat(newData);
|
|
|
+ _.map(newData, (o, i) => {return o.isActive = i === 0});
|
|
|
+ const { query } = this.$route;
|
|
|
+ this.systemContentData = newData;
|
|
|
+ if (!_.isEmpty(query) && query.equipId) {
|
|
|
+ _.map(this.systemContentData, (o) => {return o.isActive = o.category_code == query.equipId});
|
|
|
+ }
|
|
|
+ this.getTableData();
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
/**
|
|
|
* 切换系统下的设备
|
|
|
*/
|
|
|
changeEquipment(id) {
|
|
|
- _.map(this.systemContentData, (o) => {return o.isActive = o.id === id})
|
|
|
+ _.map(this.systemContentData, (o) => {return o.isActive = o.category_code === id});
|
|
|
+ this.getTableData();
|
|
|
},
|
|
|
/**
|
|
|
* 获取表数据
|
|
@@ -241,7 +272,7 @@ export default {
|
|
|
let query = {
|
|
|
category_code: _.find(this.systemContentData, (o) => {return o.isActive}).category_code
|
|
|
}
|
|
|
- let url = `/data/glsms_asset/query?plazaId=1000423&page=${this.curPage}&size=${this.pageSize}`;
|
|
|
+ let url = `/data/glsms_asset/query?plazaId=1000423&page=${this.curPage}&size=${this.pageSize}&orderBy=is_exception,0`;
|
|
|
if (_.trim(this.searchKey) !== '') {
|
|
|
url = `${url}&keyword=${this.searchKey}:sbjc,sbjbm`
|
|
|
}
|
|
@@ -272,6 +303,7 @@ export default {
|
|
|
showEquipmentStatus(row, column, e) {
|
|
|
setTimeout(() => {
|
|
|
if (this.showDetail) return
|
|
|
+ this.equipTitle = row.sbjc;
|
|
|
this.dialogTableVisible = true;
|
|
|
this.assetnum = row.assetnum;
|
|
|
this.initTimePicker();
|
|
@@ -285,12 +317,13 @@ export default {
|
|
|
let param = {
|
|
|
page: this.hisCurPage,
|
|
|
size: this.hisPageSize,
|
|
|
+ plazaId: 1000423,
|
|
|
// assetnum: this.assetnum,
|
|
|
- assetnum: 8952,
|
|
|
+ assetnum: 24071,
|
|
|
// startDate: this.startTime,
|
|
|
- startDate: 20180101000000,
|
|
|
+ startDate: 20000101000000,
|
|
|
// endDate: this.endTime
|
|
|
- endDate: 20180201000000
|
|
|
+ endDate: 20200201000000
|
|
|
}
|
|
|
queryHistoryTableData('/data/base/queryDateByAssetNum', param).then((res) => {
|
|
|
const { result, data, count } = res;
|
|
@@ -300,17 +333,18 @@ export default {
|
|
|
_.forEach(this.historyTableData, (item) => {
|
|
|
let name;
|
|
|
switch (item.type) {
|
|
|
- case '0':
|
|
|
+ case 0:
|
|
|
name = '专维'
|
|
|
break
|
|
|
- case '1':
|
|
|
+ case 1:
|
|
|
name = '维保专业'
|
|
|
break
|
|
|
- case '2':
|
|
|
+ case 2:
|
|
|
name = '第三方视图'
|
|
|
break
|
|
|
}
|
|
|
item.typeName = name;
|
|
|
+ item.finishDate = moment.unix(item.finishDate / 1000).format('YYYY.MM.DD');
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -347,39 +381,78 @@ export default {
|
|
|
/**
|
|
|
* 显示图片详情
|
|
|
*/
|
|
|
- showPicturesDetail(val) {
|
|
|
+ showPicturesDetail(val, type) {
|
|
|
console.log('val', val)
|
|
|
- // if (!val.file_type || !val.file_type_id) {
|
|
|
- // return
|
|
|
- // }
|
|
|
+ if (type === 'equip') {
|
|
|
+ if (!val.file_type || !val.file_type_id) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (!val.photosNum) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
this.showDetail = true;
|
|
|
this.detailTitle = '图片预览';
|
|
|
this.getDetailData(val);
|
|
|
},
|
|
|
/**
|
|
|
+ * 显示附件详情
|
|
|
+ */
|
|
|
+ showReportDetail(val) {
|
|
|
+ console.log('val', val)
|
|
|
+ if (type === 'equip') {
|
|
|
+ if (!val.file_type || !val.file_type_id) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (!val.attachments_num) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.showDetail = true;
|
|
|
+ this.detailTitle = '附件预览';
|
|
|
+ this.getDetailData(val);
|
|
|
+ },
|
|
|
+ /**
|
|
|
* 获取图片/报告详情
|
|
|
*/
|
|
|
- getDetailData(val) {
|
|
|
+ getDetailData(val, type) {
|
|
|
let param = {
|
|
|
- file_type: 0, // val.file_type
|
|
|
- file_type_id: 2914, // val.file_type_id
|
|
|
+ file_type: type === 'equip'?val.file_type : val.type,
|
|
|
+ // file_type: 0,
|
|
|
+ file_type_id: type === 'equip'?val.file_type_id : val.id,
|
|
|
+ // file_type_id: 2914,
|
|
|
type: this.detailTitle === '图片预览'? 0 : 1
|
|
|
}
|
|
|
-
|
|
|
queryDetailData('/data/base/queryFileDetails', param).then((res) => {
|
|
|
console.log('res', res)
|
|
|
const { result, data } = res;
|
|
|
if (result === 'success') {
|
|
|
let newData = [];
|
|
|
- _.forEach(data, (item) => {
|
|
|
+ _.forEach(data, (item, index) => {
|
|
|
newData.push({
|
|
|
id: item.id,
|
|
|
- url: item.urlname
|
|
|
+ url: item.urlname,
|
|
|
+ isActive: index === 0,
|
|
|
+ name: item.description
|
|
|
})
|
|
|
})
|
|
|
- // this.pictureList = newData;
|
|
|
+ if (this.detailTitle === '图片预览') {
|
|
|
+ this.pictureList = newData;
|
|
|
+ this.curImg = this.pictureList[0];
|
|
|
+ } else {
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 切换当前预览大图
|
|
|
+ */
|
|
|
+ changeCurImg(id) {
|
|
|
+ _.map(this.pictureList, (o) => {return o.isActive = o.id === id});
|
|
|
+ this.curImg = _.find(this.pictureList, (o) => {return o.isActive});
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -512,11 +585,17 @@ export default {
|
|
|
line-height: 16px;
|
|
|
margin-top: 12px;
|
|
|
text-align: center;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
}
|
|
|
&:not(:last-of-type){
|
|
|
margin-bottom: 20px;
|
|
|
}
|
|
|
}
|
|
|
+ .active>img{
|
|
|
+ border-color: rgba(31, 35, 41, 0.15);
|
|
|
+ }
|
|
|
}
|
|
|
.cur-img-container{
|
|
|
padding: 20px;
|