¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="device_list"> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="设å¤ç¼å·"> |
| | | <a-input placeholder="请è¾å
¥è®¾å¤ç¼å·" v-model="queryParam.equipmentId"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="æä»½"> |
| | | <a-range-picker |
| | | :placeholder="['å¼å§æ¶é´', 'ç»ææ¶é´']" |
| | | format="YYYY-MM" |
| | | :value="dates" |
| | | :mode="['month', 'month']" |
| | | @panelChange="dateParamChange" |
| | | @change="handleDateChange" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-space> |
| | | <a-button type="primary" @click="searchQuery" icon="search">æ¥è¯¢</a-button> |
| | | <a-button type="primary" @click="searchReset" icon="reload">éç½®</a-button> |
| | | </a-space> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <!-- æ¥è¯¢åºå-END --> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator"> |
| | | <a-button type="primary" icon="download" @click="handleExportXls('è®¾å¤æ
éç»´ä¿®æ¥è¡¨')">导åº</a-button> |
| | | </div> |
| | | |
| | | <!-- tableåºå-begin --> |
| | | <div id="DeviceList" style="flex: 1;overflow: hidden"> |
| | | <a-table |
| | | ref="table" |
| | | :scroll="{x:'max-content',y:scrollY}" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | @change="handleTableChange" |
| | | /> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import moment from 'moment' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | |
| | | export default { |
| | | name: 'EquipmentFailureRepaireReportList', |
| | | mixins: [JeecgListMixin], |
| | | components: { }, |
| | | props: { nodeTree: '', Type: '', nodePeople: '' }, |
| | | data() { |
| | | return { |
| | | disableMixinCreated: true, |
| | | /* å页忰 */ |
| | | ipagination: { |
| | | current: 1, |
| | | pageSize: 30, |
| | | pageSizeOptions: ['30', '50', '100'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + '-' + range[1] + ' å
±' + total + 'æ¡' |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0 |
| | | }, |
| | | dates: [moment().subtract('month', 1), moment().subtract('month', 1)], |
| | | queryParam: {}, |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: '设å¤ç¼å·', |
| | | align: 'center', |
| | | dataIndex: 'equipmentId', |
| | | width: 200 |
| | | }, |
| | | { |
| | | title: 'æ»æ
鿬¡æ°', |
| | | align: 'center', |
| | | dataIndex: 'totalDownCount', |
| | | width: 100 |
| | | }, { |
| | | title: 'æ»æ
éåæºæ¶é´(hour)', |
| | | align: 'center', |
| | | dataIndex: 'totalDownLong', |
| | | width: 150 |
| | | }, |
| | | { |
| | | title: 'æ»ç»´ä¿®æ¬¡æ°', |
| | | align: 'center', |
| | | dataIndex: 'totalRepairCount', |
| | | width: 100 |
| | | }, { |
| | | title: 'æ»ç»´ä¿®æ¶é´(hour)', |
| | | align: 'center', |
| | | dataIndex: 'totalRepairLong', |
| | | width: 150 |
| | | }, |
| | | { |
| | | title: 'MTBF(hour)', |
| | | align: 'center', |
| | | dataIndex: 'mtbf', |
| | | width: 150 |
| | | }, { |
| | | title: 'MTTR(hour)', |
| | | align: 'center', |
| | | dataIndex: 'mttr', |
| | | width: 150 |
| | | }, |
| | | { |
| | | title: 'æ¥æ', |
| | | align: 'center', |
| | | dataIndex: 'theDate', |
| | | width: 150 |
| | | } |
| | | ], |
| | | scrollY: 465, |
| | | url: { |
| | | list: '/mdc/mdcMttrInfo/list', |
| | | exportXlsUrl: '/mdc/mdcMttrInfo/exportXls' |
| | | } |
| | | } |
| | | }, |
| | | watch: { |
| | | Type(valmath) { |
| | | this.dataList = [] |
| | | this.queryParam.typeTree = valmath |
| | | // console.log(this.queryParam.typeTree) |
| | | }, |
| | | nodeTree(val) { //çå¬currSelected ååï¼å°åååçæ°å¼ä¼ éç» getCurrSelected äºä»¶ |
| | | if (JSON.stringify(val) != '{}') { |
| | | if (val.equipmentId) { |
| | | this.queryParam.parentId = '' |
| | | this.queryParam.equipmentId = val.equipmentId |
| | | } else { |
| | | this.queryParam.parentId = val.key |
| | | this.queryParam.equipmentId = '' |
| | | } |
| | | this.searchQuery() |
| | | } |
| | | }, |
| | | nodePeople(val) { |
| | | if (JSON.stringify(val) != '{}') { |
| | | if (val.equipmentId) { |
| | | this.queryParam.parentId = '' |
| | | this.queryParam.equipmentId = val.equipmentId |
| | | } else { |
| | | this.queryParam.parentId = val.key |
| | | this.queryParam.equipmentId = '' |
| | | } |
| | | this.searchQuery() |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | handleComputeModalOpen() { |
| | | this.$refs.computeEquipmentFailureCloseTimeModalRef.visible = true |
| | | }, |
| | | |
| | | dateParamChange(value) { |
| | | console.log('dateParamChangeValue', value) |
| | | this.dates = value |
| | | this.queryParam.startTime = moment(this.dates[0]).format('YYYY-MM') |
| | | this.queryParam.endTime = moment(this.dates[1]).format('YYYY-MM') |
| | | }, |
| | | |
| | | handleDateChange(value) { |
| | | console.log('handleDateChangeValue', value) |
| | | if (!value.length) { |
| | | delete this.queryParam.startTime |
| | | delete this.queryParam.endTime |
| | | this.dates = [] |
| | | } |
| | | }, |
| | | |
| | | searchReset() { |
| | | this.queryParam = {} |
| | | this.dates = [] |
| | | this.loadData(1) |
| | | }, |
| | | |
| | | /** |
| | | * 彿µè§å¨å¯è§çªå£å°ºå¯¸åçæ¹åæ¶è§¦å |
| | | */ |
| | | handleWindowResize() { |
| | | const boxHeight = +window.getComputedStyle(document.getElementById('DeviceList')).height.slice(0, -2) |
| | | const tableHeadHeight = +window.getComputedStyle(document.querySelector('.ant-table-thead th')).height.slice(0, -2) |
| | | this.scrollY = boxHeight - tableHeadHeight - 50 |
| | | } |
| | | }, |
| | | created() { |
| | | this.queryParam.startTime = moment(this.dates[0]).format('YYYY-MM') |
| | | this.queryParam.endTime = moment(this.dates[1]).format('YYYY-MM') |
| | | this.loadData() |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.handleWindowResize) |
| | | this.handleWindowResize() |
| | | }, |
| | | beforeDestroy() { |
| | | window.removeEventListener('resize', this.handleWindowResize) |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | |
| | | .device_list { |
| | | display: flex; |
| | | flex-direction: column; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | @media screen and (min-width: 1920px) { |
| | | .device_list { |
| | | height: 811px !important; |
| | | } |
| | | } |
| | | |
| | | @media screen and (min-width: 1680px) and (max-width: 1920px) { |
| | | .device_list { |
| | | height: 811px !important; |
| | | } |
| | | } |
| | | |
| | | @media screen and (min-width: 1400px) and (max-width: 1680px) { |
| | | .device_list { |
| | | height: 663px !important; |
| | | } |
| | | } |
| | | |
| | | @media screen and (min-width: 1280px) and (max-width: 1400px) { |
| | | .device_list { |
| | | height: 564px !important; |
| | | } |
| | | } |
| | | |
| | | @media screen and (max-width: 1280px) { |
| | | .device_list { |
| | | height: 564px !important; |
| | | } |
| | | } |
| | | </style> |