|
@@ -1,171 +1,156 @@
|
|
|
<!-- 核心设备报表 -->
|
|
|
<template>
|
|
|
- <div class='core-device-report'>
|
|
|
- <div class='main-left'>
|
|
|
- <Select
|
|
|
- class='system-select'
|
|
|
- width='217'
|
|
|
- :isReadOnly='true'
|
|
|
- tipPlace='top'
|
|
|
- caption='系统名称:'
|
|
|
- @change='changeCurSystem'
|
|
|
- v-model='systemId'
|
|
|
- :selectdata='systemList'
|
|
|
- :placeholder='"请选择"'
|
|
|
- />
|
|
|
- <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 class='first-row'>
|
|
|
- <div>{{item.name}}</div>
|
|
|
- <div>{{item.isMaintenance?'维保中' : ''}}</div>
|
|
|
- </div>
|
|
|
- <div class='sec-row'>
|
|
|
- <div>
|
|
|
- {{item.num}}
|
|
|
- <span>台</span>
|
|
|
- </div>
|
|
|
- <span :class='{"abnormal": item.abnormal}'>{{item.statusNum !== 0?item.statusNum : ''}}</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <div class="core-device-report">
|
|
|
+ <div class="main-left">
|
|
|
+ <Select
|
|
|
+ class="system-select"
|
|
|
+ width="217"
|
|
|
+ :isReadOnly="true"
|
|
|
+ tipPlace="top"
|
|
|
+ caption="系统名称:"
|
|
|
+ @change="changeCurSystem"
|
|
|
+ v-model="systemId"
|
|
|
+ :selectdata="systemList"
|
|
|
+ :placeholder="'请选择'"
|
|
|
+ />
|
|
|
+ <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 class="first-row">
|
|
|
+ <div>{{item.name}}</div>
|
|
|
+ <div>{{item.isMaintenance?'维保中' : ''}}</div>
|
|
|
+ </div>
|
|
|
+ <div class="sec-row">
|
|
|
+ <div>{{item.num}}<span>台</span></div>
|
|
|
+ <span :class="{'abnormal': item.abnormal}">{{item.statusNum !== 0?item.statusNum : ''}}</span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div class='main-right'>
|
|
|
- <div class='search-container'>
|
|
|
- <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 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.is_exception?'正常' : '异常' }}</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?(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>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <div class='page'>
|
|
|
- <el-pagination
|
|
|
- background
|
|
|
- layout='prev, pager, next'
|
|
|
- :total='tatol'
|
|
|
- :current-page='curPage'
|
|
|
- :page-size='pageSize'
|
|
|
- @current-change='changeTablePage'
|
|
|
- ></el-pagination>
|
|
|
- </div>
|
|
|
- <el-dialog title='交换机-照明系统' :visible.sync='dialogTableVisible' width='1260px'>
|
|
|
- <el-date-picker
|
|
|
- style='margin-bottom: 12px;'
|
|
|
- v-model='dialogTime'
|
|
|
- type='daterange'
|
|
|
- range-separator='至'
|
|
|
- @change='changeTime'
|
|
|
- start-placeholder='开始日期'
|
|
|
- end-placeholder='结束日期'
|
|
|
- ></el-date-picker>
|
|
|
- <el-table :data='historyTableData' style='margin-bottom: 55px;' max-height='500'>
|
|
|
- <el-table-column width='200' property='finishDate' label='日期'></el-table-column>
|
|
|
- <el-table-column width='100' property='typeName' label='事项类型'></el-table-column>
|
|
|
- <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>
|
|
|
- </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>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <div class='page'>
|
|
|
- <el-pagination
|
|
|
- background
|
|
|
- layout='prev, pager, next'
|
|
|
- :current-page='hisCurPage'
|
|
|
- :page-size='hisPageSize'
|
|
|
- :total='hisTotal'
|
|
|
- @current-change='changeHisTablePage'
|
|
|
- ></el-pagination>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
- <el-dialog :title='detailTitle' :visible.sync='showDetail' width='1260px'>
|
|
|
- <div class='detail-container'>
|
|
|
- <div class='pictures-menu'></div>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="main-right">
|
|
|
+ <div class="search-container">
|
|
|
+ <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 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.is_exception?'正常' : '异常' }}</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?(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>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="page">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ layout="prev, pager, next"
|
|
|
+ :total="tatol"
|
|
|
+ :current-page="curPage"
|
|
|
+ :page-size="pageSize"
|
|
|
+ @current-change="changeTablePage">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ <el-dialog title="交换机-照明系统" :visible.sync="dialogTableVisible" width="1260px">
|
|
|
+ <el-date-picker
|
|
|
+ style="margin-bottom: 12px;"
|
|
|
+ v-model="dialogTime"
|
|
|
+ type="daterange"
|
|
|
+ range-separator="至"
|
|
|
+ @change="changeTime"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期">
|
|
|
+ </el-date-picker>
|
|
|
+ <el-table :data="historyTableData" style="margin-bottom: 55px;" max-height="500">
|
|
|
+ <el-table-column width="200" property="finishDate" label="日期"></el-table-column>
|
|
|
+ <el-table-column width="100" property="typeName" label="事项类型"></el-table-column>
|
|
|
+ <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>
|
|
|
+ </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>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="page">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ layout="prev, pager, next"
|
|
|
+ :current-page="hisCurPage"
|
|
|
+ :page-size="hisPageSize"
|
|
|
+ :total="hisTotal"
|
|
|
+ @current-change="changeHisTablePage">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog :title="detailTitle" :visible.sync="showDetail" width="1260px">
|
|
|
+ <div class="detail-container">
|
|
|
+ <div class="pictures-menu">
|
|
|
+
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { Select, Input } from 'meri-design'
|
|
|
-import { querySystemList, queryEquipmentList, queryTableData, queryHistoryTableData, queryDetailData } from '../../api/coreDeviceReport'
|
|
|
-import _ from 'lodash'
|
|
|
-import moment from 'moment'
|
|
|
+import { Select, Input } from 'meri-design';
|
|
|
+import { querySystemList, queryEquipmentList, queryTableData, queryHistoryTableData, queryDetailData } from '../../api/coreDeviceReport';
|
|
|
+import _ from 'lodash';
|
|
|
+import moment from 'moment';
|
|
|
export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- systemId: '', // 当前系统Id
|
|
|
- systemList: [], // 系统
|
|
|
- systemContentData: [
|
|
|
- { 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: '正常', 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},
|
|
|
- ], // 表数据
|
|
|
- curPage: 1, // 当前页码
|
|
|
- pageSize: 10, // 每页条数
|
|
|
- tatol: 0, // 总数据
|
|
|
- dialogTableVisible: false, // 弹窗显示状态
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ systemId: '', // 当前系统Id
|
|
|
+ systemList: [], // 系统
|
|
|
+ systemContentData: [
|
|
|
+ {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: '正常', 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},
|
|
|
+ ], // 表数据
|
|
|
+ curPage: 1, // 当前页码
|
|
|
+ pageSize: 10, // 每页条数
|
|
|
+ tatol: 0, // 总数据
|
|
|
+ dialogTableVisible: false, // 弹窗显示状态
|
|
|
|
|
|
- // 核心设备实例
|
|
|
- assetnum: null, // 设备台账编码
|
|
|
- historyTableData: [], // 核心设备实例的所有历史事项信息
|
|
|
- dialogTime: null, // 弹框内的时间
|
|
|
- hisCurPage: 1, // 当前页码
|
|
|
- hisPageSize: 8, // 当前页码
|
|
|
- hisTotal: 0, // 总条数
|
|
|
- startTime: null, // 开始时间
|
|
|
- endTime: null, // 结束事件
|
|
|
+ // 核心设备实例
|
|
|
+ assetnum: null, // 设备台账编码
|
|
|
+ historyTableData: [], // 核心设备实例的所有历史事项信息
|
|
|
+ dialogTime: null, // 弹框内的时间
|
|
|
+ hisCurPage: 1, // 当前页码
|
|
|
+ hisPageSize: 8, // 当前页码
|
|
|
+ hisTotal: 0, // 总条数
|
|
|
+ startTime: null, // 开始时间
|
|
|
+ endTime: null, // 结束事件
|
|
|
|
|
|
- showDetail: false, // 显示照片、报告详情
|
|
|
- detailTitle: '图片预览' // 弹窗名称
|
|
|
- }
|
|
|
- },
|
|
|
+ showDetail: false, // 显示照片、报告详情
|
|
|
+ detailTitle: '图片预览', // 弹窗名称
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
components: {
|
|
|
Select,
|
|
@@ -174,193 +159,191 @@ export default {
|
|
|
|
|
|
computed: {},
|
|
|
|
|
|
- mounted() {
|
|
|
- this.getSystemList()
|
|
|
- this.getEquipmentOfSystem()
|
|
|
- this.getTableData()
|
|
|
- },
|
|
|
+ mounted() {
|
|
|
+ this.getSystemList();
|
|
|
+ this.getEquipmentOfSystem();
|
|
|
+ this.getTableData();
|
|
|
+ },
|
|
|
|
|
|
- methods: {
|
|
|
- /**
|
|
|
- * 获取系统列表数据
|
|
|
- */
|
|
|
- getSystemList() {
|
|
|
- querySystemList().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
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- /**
|
|
|
- * 切换系统名称
|
|
|
- */
|
|
|
- changeCurSystem(val) {
|
|
|
- console.log('val', val)
|
|
|
- },
|
|
|
- /**
|
|
|
- * 获取系统下的设备
|
|
|
- */
|
|
|
- getEquipmentOfSystem() {
|
|
|
- let param = {
|
|
|
- plazaId: 1000423,
|
|
|
- ccode: 1002347
|
|
|
- }
|
|
|
- if (this.systemId !== '') {
|
|
|
- param.smsxt = this.systemId
|
|
|
- }
|
|
|
- queryEquipmentList('/data/home/querySystemCard', param).then(res => {
|
|
|
- console.log('res', res)
|
|
|
- })
|
|
|
- },
|
|
|
- /**
|
|
|
- * 切换系统下的设备
|
|
|
- */
|
|
|
- changeEquipment(id) {
|
|
|
- _.map(this.systemContentData, o => {
|
|
|
- return (o.isActive = o.id === id)
|
|
|
+ methods: {
|
|
|
+ /**
|
|
|
+ * 获取系统列表数据
|
|
|
+ */
|
|
|
+ getSystemList() {
|
|
|
+ querySystemList().then((res) => {
|
|
|
+ if (res.result === 'success') {
|
|
|
+ let data = res.data;
|
|
|
+ let newData = [];
|
|
|
+ _.forEach(data, (item) => {
|
|
|
+ newData.push({
|
|
|
+ id: item.code,
|
|
|
+ name: item.name
|
|
|
})
|
|
|
- },
|
|
|
- /**
|
|
|
- * 获取表数据
|
|
|
- */
|
|
|
- getTableData() {
|
|
|
- let query = {
|
|
|
- category_code: 'gdc'
|
|
|
- }
|
|
|
- queryTableData(`/data/glsms_asset/query?plazaId=1000423&page=${this.curPage}&size=${this.pageSize}`, query).then(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()
|
|
|
- },
|
|
|
- /**
|
|
|
- * 显示设备实例的维保、专维等状态
|
|
|
- */
|
|
|
- showEquipmentStatus(row, column, e) {
|
|
|
- setTimeout(() => {
|
|
|
- if (this.showDetail) return
|
|
|
- this.dialogTableVisible = true
|
|
|
- this.assetnum = row.assetnum
|
|
|
- this.initTimePicker()
|
|
|
- }, 36)
|
|
|
- },
|
|
|
- /**
|
|
|
- * 获取核心设备实例的所有历史事项信息
|
|
|
- */
|
|
|
- getEquipmentHistoryMsg() {
|
|
|
- this.historyTableData = []
|
|
|
- let param = {
|
|
|
- page: this.hisCurPage,
|
|
|
- size: this.hisPageSize,
|
|
|
- // assetnum: this.assetnum,
|
|
|
- assetnum: 8952,
|
|
|
- // startDate: this.startTime,
|
|
|
- startDate: 20180101000000,
|
|
|
- // endDate: this.endTime
|
|
|
- endDate: 20180201000000
|
|
|
- }
|
|
|
- queryHistoryTableData('/data/base/queryDateByAssetNum', param).then(res => {
|
|
|
- const { result, data, count } = res
|
|
|
- if (result === 'success') {
|
|
|
- this.historyTableData = data
|
|
|
- this.hisTotal = count
|
|
|
- _.forEach(this.historyTableData, item => {
|
|
|
- let name
|
|
|
- switch (item.type) {
|
|
|
- case '0':
|
|
|
- name = '专维'
|
|
|
- break
|
|
|
- case '1':
|
|
|
- name = '维保'
|
|
|
- break
|
|
|
- case '2':
|
|
|
- name = '第三方检测'
|
|
|
- break
|
|
|
- }
|
|
|
- item.typeName = name
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- /**
|
|
|
- * 初始化时间选择器
|
|
|
- */
|
|
|
- initTimePicker() {
|
|
|
- let endTime = new Date(),
|
|
|
- startTime = new Date(endTime.getTime() - 1000 * 60 * 60 * 24 * 30)
|
|
|
- this.dialogTime = [startTime, endTime]
|
|
|
- this.changeTime()
|
|
|
- },
|
|
|
- /**
|
|
|
- * 切换时间
|
|
|
- */
|
|
|
- changeTime() {
|
|
|
- this.hisCurPage = 1
|
|
|
- if (this.dialogTime) {
|
|
|
- this.startTime = moment.unix(new Date(this.dialogTime[0]).getTime() / 1000).format('YYYYMMDDHHmmss')
|
|
|
- this.endTime = moment.unix(new Date(this.dialogTime[1]).getTime() / 1000).format('YYYYMMDDHHmmss')
|
|
|
- } else {
|
|
|
- this.initTimePicker()
|
|
|
- }
|
|
|
- this.getEquipmentHistoryMsg()
|
|
|
- },
|
|
|
- /**
|
|
|
- * 切换设备台账下所有历史事项信息页码
|
|
|
- */
|
|
|
- changeHisTablePage(page) {
|
|
|
- this.hisCurPage = page
|
|
|
- this.getEquipmentHistoryMsg()
|
|
|
- },
|
|
|
- /**
|
|
|
- * 显示图片详情
|
|
|
- */
|
|
|
- showPicturesDetail(val) {
|
|
|
- console.log('val', val)
|
|
|
- // if (!val.file_type || !val.file_type_id) {
|
|
|
- // return
|
|
|
- // }
|
|
|
- this.showDetail = true
|
|
|
- this.detailTitle = '图片预览'
|
|
|
- this.getDetailData(val)
|
|
|
- },
|
|
|
- /**
|
|
|
- * 获取图片/报告详情
|
|
|
- */
|
|
|
- getDetailData(val) {
|
|
|
- let param = {
|
|
|
- file_type: 1, // val.file_type
|
|
|
- file_type_id: 2467908, // val.file_type_id
|
|
|
- type: this.detailTitle === '图片预览' ? 0 : 1
|
|
|
+ })
|
|
|
+ this.systemList = newData;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 切换系统名称
|
|
|
+ */
|
|
|
+ changeCurSystem(val) {
|
|
|
+ console.log('val', val)
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 获取系统下的设备
|
|
|
+ */
|
|
|
+ getEquipmentOfSystem() {
|
|
|
+ let param = {
|
|
|
+ plazaId: 1000423,
|
|
|
+ ccode: 1002347,
|
|
|
+ }
|
|
|
+ if (this.systemId !== '') {
|
|
|
+ param.smsxt = this.systemId;
|
|
|
+ }
|
|
|
+ queryEquipmentList('/data/home/querySystemCard', param).then((res) => {
|
|
|
+ console.log('res', res)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 切换系统下的设备
|
|
|
+ */
|
|
|
+ changeEquipment(id) {
|
|
|
+ _.map(this.systemContentData, (o) => {return o.isActive = o.id === id})
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 获取表数据
|
|
|
+ */
|
|
|
+ getTableData() {
|
|
|
+ let query = {
|
|
|
+ category_code: 'gdc'
|
|
|
+ }
|
|
|
+ queryTableData(`/data/glsms_asset/query?plazaId=1000423&page=${this.curPage}&size=${this.pageSize}`, query).then((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();
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 显示设备实例的维保、专维等状态
|
|
|
+ */
|
|
|
+ showEquipmentStatus(row, column, e) {
|
|
|
+ setTimeout(() => {
|
|
|
+ if (this.showDetail) return
|
|
|
+ this.dialogTableVisible = true;
|
|
|
+ this.assetnum = row.assetnum;
|
|
|
+ this.initTimePicker();
|
|
|
+ }, 36)
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 获取核心设备实例的所有历史事项信息
|
|
|
+ */
|
|
|
+ getEquipmentHistoryMsg() {
|
|
|
+ this.historyTableData = [];
|
|
|
+ let param = {
|
|
|
+ page: this.hisCurPage,
|
|
|
+ size: this.hisPageSize,
|
|
|
+ // assetnum: this.assetnum,
|
|
|
+ assetnum: 8952,
|
|
|
+ // startDate: this.startTime,
|
|
|
+ startDate: 20180101000000,
|
|
|
+ // endDate: this.endTime
|
|
|
+ endDate: 20180201000000
|
|
|
+ }
|
|
|
+ queryHistoryTableData('/data/base/queryDateByAssetNum', param).then((res) => {
|
|
|
+ const { result, data, count } = res;
|
|
|
+ if (result === 'success') {
|
|
|
+ this.historyTableData = data;
|
|
|
+ this.hisTotal = count;
|
|
|
+ _.forEach(this.historyTableData, (item) => {
|
|
|
+ let name;
|
|
|
+ switch (item.type) {
|
|
|
+ case '0':
|
|
|
+ name = '专维'
|
|
|
+ break
|
|
|
+ case '1':
|
|
|
+ name = '维保专业'
|
|
|
+ break
|
|
|
+ case '2':
|
|
|
+ name = '第三方视图'
|
|
|
+ break
|
|
|
}
|
|
|
-
|
|
|
- queryDetailData('/data/base/queryFileDetails', param).then(res => {
|
|
|
- console.log('res', res)
|
|
|
- })
|
|
|
+ item.typeName = name;
|
|
|
+ })
|
|
|
}
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 初始化时间选择器
|
|
|
+ */
|
|
|
+ initTimePicker() {
|
|
|
+ let endTime = new Date(),
|
|
|
+ startTime = new Date(endTime.getTime() - 1000*60*60*24*30);
|
|
|
+ this.dialogTime = [startTime, endTime];
|
|
|
+ this.changeTime();
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 切换时间
|
|
|
+ */
|
|
|
+ changeTime() {
|
|
|
+ this.hisCurPage = 1;
|
|
|
+ if (this.dialogTime) {
|
|
|
+ this.startTime = moment.unix(new Date(this.dialogTime[0]).getTime() / 1000).format('YYYYMMDDHHmmss');
|
|
|
+ this.endTime = moment.unix(new Date(this.dialogTime[1]).getTime() / 1000).format('YYYYMMDDHHmmss');
|
|
|
+ } else {
|
|
|
+ this.initTimePicker();
|
|
|
+ }
|
|
|
+ this.getEquipmentHistoryMsg();
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 切换设备台账下所有历史事项信息页码
|
|
|
+ */
|
|
|
+ changeHisTablePage(page) {
|
|
|
+ this.hisCurPage = page;
|
|
|
+ this.getEquipmentHistoryMsg();
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 显示图片详情
|
|
|
+ */
|
|
|
+ showPicturesDetail(val) {
|
|
|
+ console.log('val', val)
|
|
|
+ // if (!val.file_type || !val.file_type_id) {
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ this.showDetail = true;
|
|
|
+ this.detailTitle = '图片预览';
|
|
|
+ this.getDetailData(val);
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 获取图片/报告详情
|
|
|
+ */
|
|
|
+ getDetailData(val) {
|
|
|
+ let param = {
|
|
|
+ file_type: 1, // val.file_type
|
|
|
+ file_type_id: 2467908, // val.file_type_id
|
|
|
+ type: this.detailTitle === '图片预览'? 0 : 1
|
|
|
+ }
|
|
|
+
|
|
|
+ queryDetailData('/data/base/queryFileDetails', param).then((res) => {
|
|
|
+ console.log('res', res)
|
|
|
+ })
|
|
|
}
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
|
|
@@ -464,17 +447,19 @@ export default {
|
|
|
display: flex;
|
|
|
justify-content: flex-end;
|
|
|
}
|
|
|
- .el-dialog {
|
|
|
- min-height: 600px;
|
|
|
- }
|
|
|
- .detail-container {
|
|
|
- display: flex;
|
|
|
- min-height: 600px;
|
|
|
- }
|
|
|
- .pictures-menu {
|
|
|
- margin-right: 21px;
|
|
|
- width: 180px;
|
|
|
- }
|
|
|
}
|
|
|
-}
|
|
|
+ .el-dialog{
|
|
|
+ min-height: 600px;
|
|
|
+ }
|
|
|
+ .detail-container{
|
|
|
+ display: flex;
|
|
|
+ min-height: 600px
|
|
|
+ }
|
|
|
+ .pictures-menu{
|
|
|
+ margin-right: 21px;
|
|
|
+ width: 180px;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
</style>
|