From 36e8795b59c7f7393758ca96e0c2438eddaee8be Mon Sep 17 00:00:00 2001 From: zhangherong <571457620@qq.com> Date: 星期五, 07 三月 2025 16:14:41 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue | 950 ++++++++++++++++++++++++++++------------------------------- 1 files changed, 453 insertions(+), 497 deletions(-) diff --git a/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue b/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue index 760f961..25eb0c4 100644 --- a/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue +++ b/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue @@ -16,7 +16,7 @@ @change="selectChange($event,'equipmentType')" > <a-select-option v-for="(item,index) in equipmentTypeList" :value="item.value" :key="index"> - {{item.label}} + {{ item.label }} </a-select-option> </a-select> </a-form-item> @@ -32,7 +32,7 @@ @change="selectChange($event,'driveType')" > <a-select-option v-for="(item,index) in driveTypeList" :value="item.value" :key="index"> - {{item.label}} + {{ item.label }} </a-select-option> </a-select> </a-form-item> @@ -76,7 +76,7 @@ @change="selectChange($event,'deviceLevel')" > <a-select-option v-for="(item,index) in device_level_list" :value="item.value" :key="index"> - {{item.label}} + {{ item.label }} </a-select-option> </a-select> </a-form-item> @@ -114,16 +114,13 @@ <a-col :md="6" :sm="6" :xs="6"> <a-form-item label="閲嶈绋嬪害"> <a-select - :value="queryParams.deviceImportanceLevel" - mode="multiple" + v-model="queryParam.deviceImportanceLevel" placeholder="璇烽�夋嫨璁惧閲嶈绋嬪害" allow-clear - :maxTagCount="1" - @change="selectChange($event,'deviceImportanceLevel')" > <a-select-option v-for="(item,index) in device_importance_level_list" :value="item.value" :key="index"> - {{item.label}} + {{ item.label }} </a-select-option> </a-select> </a-form-item> @@ -141,7 +138,7 @@ > <a-select-option v-for="(item,index) in percentage_level_list" :value="item.value" :key="index"> - {{item.label}} + {{ item.label }} </a-select-option> </a-select> </a-form-item> @@ -174,537 +171,496 @@ <!--</template>--> </a-table> </div> - <!--<div class="pagination">--> - <!--<a-pagination--> - <!--:total=dataSource.total--> - <!--:show-total="(total, range) => `${range[0]}-${range[1]} 鍏� ${total} 鏉"--> - <!--:page-size="+queryParam.pageSize"--> - <!--:default-current="1"--> - <!--:current=+queryParam.pageNo--> - <!--show-size-changer--> - <!--:pageSizeOptions="['20','30','40','50']"--> - <!--@change="handlePageNoChange"--> - <!--@showSizeChange="handlePageSizeChange"--> - <!--/>--> - <!--</div>--> </div> </template> <script> - import moment from 'moment' - import { putAction, getAction } from '@/api/manage' - import $ from 'jquery' - import '@/components/table2excel/table2excel' - import { ajaxGetDictItems, getDictItemsFromCache, duplicateCheck } from '@/api/api' - import api from '@api/mdc' +import moment from 'moment' +import { getAction } from '@/api/manage' +import $ from 'jquery' +import '@/components/table2excel/table2excel' +import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api' +import api from '@api/mdc' - // import EditableCell from './EditableCell.vue' +// import EditableCell from './EditableCell.vue' - export default { - name: 'OEEAnalysisList', - components: {}, - data() { - return { - dates: [moment().subtract('month', 1), moment().subtract('month', 1)], - queryParam: { - pageSize: 10000, - pageNo: 1 +export default { + name: 'OEEAnalysisList', + components: {}, + data() { + return { + dates: [moment().subtract('month', 1), moment().subtract('month', 1)], + queryParam: { + pageSize: 10000, + pageNo: 1 + }, + queryParams: { + equipmentType: [], + driveType: [], + deviceLevel: [], + percentageLevel: [] + }, + queryParamEquip: {}, + queryParamPeople: {}, + url: { + list: '/mdc/mdcOverallEquipmentEfficiency/list', + queryEquipmentType: '/mdc/mdcEquipmentType/queryEquipmentType' + }, + columns: [ + { + title: '搴忓彿', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } }, - queryParams: { - equipmentType: [], - driveType: [], - deviceLevel: [], - deviceCategory: [], - deviceImportanceLevel: [], - percentageLevel: [] + { + title: '杞﹂棿', + align: 'center', + dataIndex: 'productionName', + width: 110 }, - queryParamEquip: {}, - queryParamPeople: {}, - url: { - list: '/mdc/mdcOverallEquipmentEfficiency/list', - queryEquipmentType: '/mdc/mdcEquipmentType/queryEquipmentType' + { + title: '璁惧缂栧彿', + align: 'center', + dataIndex: 'equipmentId', + width: 120 }, - columns: [ - { - title: '搴忓彿', - dataIndex: '', - key: 'rowIndex', - width: 60, - align: 'center', - customRender: function(t, r, index) { - return parseInt(index) + 1 + { + title: '璁惧鍚嶇О', + align: 'center', + width: 120, + dataIndex: 'equipmentName' + }, + { + title: '璁惧鍨嬪彿', + align: 'center', + width: 120, + dataIndex: 'equipmentModel', + scopedSlots: { customRender: 'equipmentModel' } + }, + { + title: '鏃ユ湡', + align: 'center', + width: 100, + dataIndex: 'validDate' + }, + { + title: '鐝', + align: 'center', + width: 100, + dataIndex: 'shift' + }, + { + title: '姣忕彮灏忔椂', + dataIndex: 'shiftTimeCount', + align: 'center', + width: 100 + }, + { + title: '鍔犵彮鏃堕棿锛堝垎閽燂級', + dataIndex: 'overtime', + align: 'center', + width: 100 + }, + { + title: '瀹為檯鐝骇澶╂暟', + dataIndex: 'actualWorkDayCount', + align: 'center', + width: 100 + }, + { + title: '鏈堝害瀹為檯鐝骇鎬绘椂闂达紙鍒嗛挓锛�', + dataIndex: 'monthActualWorkDayTimeCount', + align: 'center', + width: 100 + }, + { + title: '闈炶鍒掑仠鏈烘崯澶憋紙鍒嗛挓锛夛紙涓�涓湀锛�', + children: [ + { + title: '鏁呴殰鍋滄満', + dataIndex: 'breakdownDownDuration', + align: 'center', + width: 100 + }, + { + title: '鎹㈠瀷璋冭瘯', + dataIndex: 'conversionDebugDuration', + align: 'center', + width: 100 + }, + { + title: '鐗╂枡鐭己', + dataIndex: 'materialShortageDuration', + align: 'center', + width: 100 + }, + { + title: '璁″垝绛変换鍔�', + dataIndex: 'plannedTaskDuration', + align: 'center', + width: 100 + }, + { + title: '妫�楠�', + dataIndex: 'inspectDuration', + align: 'center', + width: 100 + }, + { + title: '鍏朵粬', + dataIndex: 'otherDuration', + align: 'center', + width: 100 } - }, - { - title: '杞﹂棿', - align: 'center', - dataIndex: 'productionName', - width: 110 - }, - { - title: '璁惧缂栧彿', - align: 'center', - dataIndex: 'equipmentId', - width: 120 - }, - { - title: '璁惧鍚嶇О', - align: 'center', - width: 120, - dataIndex: 'equipmentName' - }, - { - title: '璁惧鍨嬪彿', - align: 'center', - width: 120, - dataIndex: 'equipmentModel', - scopedSlots: { customRender: 'equipmentModel' } - }, - { - title: '鏃ユ湡', - align: 'center', - width: 100, - dataIndex: 'validDate' - }, - { - title: '鐝', - align: 'center', - width: 100, - dataIndex: 'shift' - }, - { - title: '姣忕彮灏忔椂', - dataIndex: 'shiftTimeCount', - align: 'center', - width: 100 - }, - { - title: '鍔犵彮鏃堕棿锛堝垎閽燂級', - dataIndex: 'overtime', - align: 'center', - width: 100 - }, - { - title: '瀹為檯鐝骇澶╂暟', - dataIndex: 'actualWorkDayCount', - align: 'center', - width: 100 - }, - { - title: '鏈堝害瀹為檯鐝骇鎬绘椂闂达紙鍒嗛挓锛�', - dataIndex: 'monthActualWorkDayTimeCount', - align: 'center', - width: 100 - }, - { - title: '闈炶鍒掑仠鏈烘崯澶憋紙鍒嗛挓锛夛紙涓�涓湀锛�', - children: [ - { - title: '鏁呴殰鍋滄満', - dataIndex: 'breakdownDownDuration', - align: 'center', - width: 100 - }, - { - title: '鎹㈠瀷璋冭瘯', - dataIndex: 'conversionDebugDuration', - align: 'center', - width: 100 - }, - { - title: '鐗╂枡鐭己', - dataIndex: 'materialShortageDuration', - align: 'center', - width: 100 - }, - { - title: '璁″垝绛変换鍔�', - dataIndex: 'plannedTaskDuration', - align: 'center', - width: 100 - }, - { - title: '妫�楠�', - dataIndex: 'inspectDuration', - align: 'center', - width: 100 - }, - { - title: '鍏朵粬', - dataIndex: 'otherDuration', - align: 'center', - width: 100 - } - ] - }, - { - title: '璁″垝鍋滄満鏃堕棿锛堝垎閽燂級锛堜竴涓湀锛�', - children: [ - { - title: '璁″垝淇濆吇', - dataIndex: 'plannedMaintenanceDuration', - align: 'center', - width: 100 - }, - { - title: '浼氳/鍩硅', - dataIndex: 'conferenceTrainingDuration', - align: 'center', - width: 100 - }, - { - title: '鍏朵粬浼戞伅绛�', - dataIndex: 'otherRestDuration', - align: 'center', - width: 100 - }] - }, - { - title: '璐熻嵎鏃堕棿锛堝皬鏃讹級', - dataIndex: 'loadTime', - align: 'center', - width: 100 - }, - { - title: '鏃堕棿寮�鍔ㄧ巼', - dataIndex: 'timeActuationRate', - align: 'center', - width: 100, - customRender: text => text != 0 ? parseFloat((text * 100).toFixed(2)) + '%' : 0 - }, - // { - // title: '鍔犲伐闆朵欢鏁帮紙浠讹級', - // dataIndex: 'processQuantity', - // align: 'center', - // width: 120 - // }, - // { - // title: '鏍囧噯鍔犲伐鏃堕棿锛堝垎閽燂級', - // dataIndex: 'standardProcessDuration', - // align: 'center', - // width: 120 - // }, - { - title: '鎬ц兘寮�鍔ㄧ巼', - dataIndex: 'performanceRate', - align: 'center', - width: 100, - customRender: text => text != 0 ? parseFloat((text * 100).toFixed(2)) + '%' : 0 - }, - { - title: '搴熷搧鏁�', - dataIndex: 'unqualifiedQuantity', - align: 'center', - width: 100 - }, - { - title: '鍚堟牸鐜�', - dataIndex: 'passRate', - align: 'center', - width: 100, - customRender: text => text != 0 ? parseFloat((text * 100).toFixed(2)) + '%' : 0 - }, - { - title: '璁惧缁煎悎鏁堢巼', - dataIndex: 'overallEquipmentEfficiency', - align: 'center', - width: 100, - customRender: text => text != 0 ? parseFloat((text * 100).toFixed(2)) + '%' : 0 - } - ], - dataSource: [], - driveTypeList: [], - equipmentTypeList: [], - device_level_list: [], - device_category_list: [], - percentage_level_list: [], - scrollY: 465, - tableLoading: false, - toggleSearchStatus: false - } - }, - props: { nodeTree: '', Type: '', nodePeople: '' }, - created() { - const { isEquipment, productionId } = this.$route.params - if (productionId) { - console.log('productionId', productionId) - console.log('isEquipment', isEquipment) - if (!isEquipment) this.queryParam.parentId = productionId - else this.queryParam.equipmentId = productionId - } + ] + }, + { + title: '璁″垝鍋滄満鏃堕棿锛堝垎閽燂級锛堜竴涓湀锛�', + children: [ + { + title: '璁″垝淇濆吇', + dataIndex: 'plannedMaintenanceDuration', + align: 'center', + width: 100 + }, + { + title: '浼氳/鍩硅', + dataIndex: 'conferenceTrainingDuration', + align: 'center', + width: 100 + }, + { + title: '鍏朵粬浼戞伅绛�', + dataIndex: 'otherRestDuration', + align: 'center', + width: 100 + }] + }, + { + title: '璐熻嵎鏃堕棿锛堝皬鏃讹級', + dataIndex: 'loadTime', + align: 'center', + width: 100 + }, + { + title: '鏃堕棿寮�鍔ㄧ巼', + dataIndex: 'timeActuationRate', + align: 'center', + width: 100, + customRender: text => text != 0 ? parseFloat((text * 100).toFixed(2)) + '%' : 0 + }, + // { + // title: '鍔犲伐闆朵欢鏁帮紙浠讹級', + // dataIndex: 'processQuantity', + // align: 'center', + // width: 120 + // }, + // { + // title: '鏍囧噯鍔犲伐鏃堕棿锛堝垎閽燂級', + // dataIndex: 'standardProcessDuration', + // align: 'center', + // width: 120 + // }, + { + title: '鎬ц兘寮�鍔ㄧ巼', + dataIndex: 'performanceRate', + align: 'center', + width: 100, + customRender: text => text != 0 ? parseFloat((text * 100).toFixed(2)) + '%' : 0 + }, + { + title: '搴熷搧鏁�', + dataIndex: 'unqualifiedQuantity', + align: 'center', + width: 100 + }, + { + title: '鍚堟牸鐜�', + dataIndex: 'passRate', + align: 'center', + width: 100, + customRender: text => text != 0 ? parseFloat((text * 100).toFixed(2)) + '%' : 0 + }, + { + title: '璁惧缁煎悎鏁堢巼', + dataIndex: 'overallEquipmentEfficiency', + align: 'center', + width: 100, + customRender: text => text != 0 ? parseFloat((text * 100).toFixed(2)) + '%' : 0 + } + ], + dataSource: [], + driveTypeList: [], + equipmentTypeList: [], + device_level_list: [], + device_importance_level_list: [], + percentage_level_list: [], + scrollY: 465, + tableLoading: false, + toggleSearchStatus: false + } + }, + props: { nodeTree: '', Type: '', nodePeople: '' }, + created() { + const { isEquipment, productionId } = this.$route.params + if (productionId) { + console.log('productionId', productionId) + console.log('isEquipment', isEquipment) + if (!isEquipment) this.queryParam.parentId = productionId + else this.queryParam.equipmentId = productionId + } - this.queryParam.startTime = moment(this.dates[0]).format('YYYY-MM') - this.queryParam.endTime = moment(this.dates[1]).format('YYYY-MM') - this.queryParam.typeTree = '1' - this.loadData() - this.getDriveTypeByApi() - this.queryGroup() - this.initDictData('device_level') - this.initDictData('device_category') - this.initDictData('device_importance_level') - this.initDictData('percentage_level') + this.queryParam.startTime = moment(this.dates[0]).format('YYYY-MM') + this.queryParam.endTime = moment(this.dates[1]).format('YYYY-MM') + this.queryParam.typeTree = '1' + this.loadData() + this.getDriveTypeByApi() + this.queryGroup() + this.initDictData('device_level') + this.initDictData('device_category') + this.initDictData('device_importance_level') + this.initDictData('percentage_level') + }, + mounted() { + window.addEventListener('resize', this.handleWindowResize) + // this.handleWindowResize() + }, + beforeDestroy() { + window.removeEventListener('resize', this.handleWindowResize) + }, + watch: { + Type(valmath) { + this.dataList = [] + this.queryParam.typeTree = valmath }, - mounted() { - window.addEventListener('resize', this.handleWindowResize) - // this.handleWindowResize() - }, - beforeDestroy() { - window.removeEventListener('resize', this.handleWindowResize) - }, - watch: { - Type(valmath) { - this.dataList = [] - this.queryParam.typeTree = valmath - }, - nodeTree(val) { //鐩戝惉currSelected 鍙樺寲锛屽皢鍙樺寲鍚庣殑鏁板�间紶閫掔粰 getCurrSelected 浜嬩欢 - console.log(val) - if (JSON.stringify(val) != '{}') { - if (val.equipmentId != null) { - this.queryParamEquip.parentId = '' - this.queryParamEquip.equipmentId = val.equipmentId - } else { - this.queryParamEquip.parentId = val.key - this.queryParamEquip.equipmentId = '' - } - this.searchQuery() + nodeTree(val) { //鐩戝惉currSelected 鍙樺寲锛屽皢鍙樺寲鍚庣殑鏁板�间紶閫掔粰 getCurrSelected 浜嬩欢 + console.log(val) + if (JSON.stringify(val) != '{}') { + if (val.equipmentId != null) { + this.queryParamEquip.parentId = '' + this.queryParamEquip.equipmentId = val.equipmentId + } else { + this.queryParamEquip.parentId = val.key + this.queryParamEquip.equipmentId = '' } - }, - nodePeople(val) { - if (JSON.stringify(val) != '{}') { - if (val.equipmentId != null) { - this.queryParamPeople.parentId = val.equipmentId - this.queryParamPeople.equipmentId = '' - } else { - this.queryParamPeople.parentId = val.key - this.queryParamPeople.equipmentId = '' - } - this.searchQuery() - } + this.searchQuery() } }, - methods: { - initDictData(dictCode) { - // //浼樺厛浠庣紦瀛樹腑璇诲彇瀛楀吀閰嶇疆 - if (getDictItemsFromCache(dictCode)) { - this[dictCode + '_list'] = getDictItemsFromCache(dictCode) + nodePeople(val) { + if (JSON.stringify(val) != '{}') { + if (val.equipmentId != null) { + this.queryParamPeople.parentId = val.equipmentId + this.queryParamPeople.equipmentId = '' + } else { + this.queryParamPeople.parentId = val.key + this.queryParamPeople.equipmentId = '' + } + this.searchQuery() + } + } + }, + methods: { + initDictData(dictCode) { + // //浼樺厛浠庣紦瀛樹腑璇诲彇瀛楀吀閰嶇疆 + if (getDictItemsFromCache(dictCode)) { + this[dictCode + '_list'] = getDictItemsFromCache(dictCode) + return + } + //鏍规嵁瀛楀吀Code, 鍒濆鍖栧瓧鍏告暟缁� + ajaxGetDictItems(dictCode, null).then((res) => { + if (res.success) { + this[dictCode + '_list'] = res.result return } - //鏍规嵁瀛楀吀Code, 鍒濆鍖栧瓧鍏告暟缁� - ajaxGetDictItems(dictCode, null).then((res) => { - if (res.success) { - this[dictCode + '_list'] = res.result - return - } - }) - }, - selectChange(value, key) { - this.queryParams[key] = value - }, - 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') - }, + }) + }, + selectChange(value, key) { + this.queryParams[key] = value + }, + 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 = [] - } - }, - - exportExcel() { - $('#EfficiencyShift').table2excel({ - exclude: '.noExl', - name: 'Excel Document Name', - filename: '璁惧缁煎悎鏁堢巼鍒嗘瀽', - exclude_img: true, - fileext: '.xls', - exclude_links: true, - exclude_inputs: true - }) - }, - - searchQuery() { - if (this.queryParam.typeTree == '1') { - this.queryParam.parentId = this.queryParamEquip.parentId - this.queryParam.equipmentId = this.queryParamEquip.equipmentId - } else { - this.queryParam.parentId = this.queryParamPeople.parentId - this.queryParam.equipmentId = '' - } - Object.keys(this.queryParams).forEach(item => { - if (Array.isArray(this.queryParams[item])) { - // 姝ゅ涓轰繚璇佹帴鍙e弬鏁颁笉澶氫綑锛屽彲鐪佺暐 - this.queryParam[item] = this.queryParams[item].join() - if (this.queryParams[item].length === 0) delete this.queryParam[item] - console.log('this.queryParam', this.queryParam) - } - }) - this.loadData() - }, - - searchReset() { - this.queryParam = { - pageSize: 10000, - pageNo: 1, - typeTree: 1 - } - this.queryParams = { - equipmentType: [], - driveType: [], - deviceLevel: [], - deviceCategory: [] - } + handleDateChange(value) { + console.log('handleDateChangeValue', value) + if (!value.length) { + delete this.queryParam.startTime + delete this.queryParam.endTime this.dates = [] - this.loadData() - }, + } + }, - /** - * 璋冪敤鎺ュ彛鑾峰彇鎺у埗绯荤粺绫诲瀷 - */ - getDriveTypeByApi() { - api.getDriveTypeApi().then((res) => { - if (res.success) this.driveTypeList = res.result - }) - }, + exportExcel() { + $('#EfficiencyShift').table2excel({ + exclude: '.noExl', + name: 'Excel Document Name', + filename: '璁惧缁煎悎鏁堢巼鍒嗘瀽', + exclude_img: true, + fileext: '.xls', + exclude_links: true, + exclude_inputs: true + }) + }, - queryGroup() { - getAction(this.url.queryEquipmentType).then(res => { - if (res.success) { - this.equipmentTypeList = res.result.map(item => { - return { - label: item.equipmentTypeName, - value: item.equipmentTypeName - } - }) - } else { - this.$notification.warning({ - message: '娑堟伅', - description: res.message - }) - } - }) - }, + searchQuery() { + if (this.queryParam.typeTree == '1') { + this.queryParam.parentId = this.queryParamEquip.parentId + this.queryParam.equipmentId = this.queryParamEquip.equipmentId + } else { + this.queryParam.parentId = this.queryParamPeople.parentId + this.queryParam.equipmentId = '' + } + Object.keys(this.queryParams).forEach(item => { + if (Array.isArray(this.queryParams[item])) { + // 姝ゅ涓轰繚璇佹帴鍙e弬鏁颁笉澶氫綑锛屽彲鐪佺暐 + this.queryParam[item] = this.queryParams[item].join() + if (this.queryParams[item].length === 0) delete this.queryParam[item] + } + }) + this.loadData() + }, - loadData() { - this.tableLoading = true - getAction(this.url.list, this.queryParam) - .then(res => { - if (res.success && res.result) { - this.dataSource = res.result - this.tableLoading = false + searchReset() { + this.queryParam = { + pageSize: 10000, + pageNo: 1, + typeTree: 1 + } + this.queryParams = { + equipmentType: [], + driveType: [], + deviceLevel: [] + } + this.dates = [] + this.loadData() + }, + + /** + * 璋冪敤鎺ュ彛鑾峰彇鎺у埗绯荤粺绫诲瀷 + */ + getDriveTypeByApi() { + api.getDriveTypeApi().then((res) => { + if (res.success) this.driveTypeList = res.result + }) + }, + + queryGroup() { + getAction(this.url.queryEquipmentType).then(res => { + if (res.success) { + this.equipmentTypeList = res.result.map(item => { + return { + label: item.equipmentTypeName, + value: item.equipmentTypeName } }) - .finally(() => { - this.tableLoading = false - this.handleWindowResize() + } else { + this.$notification.warning({ + message: '娑堟伅', + description: res.message }) - }, + } + }) + }, - /** - * 鍒嗛〉鍣ㄩ〉鏁板彂鐢熸敼鍙樻椂瑙﹀彂 - * @param page 鏀瑰彉鍚庨〉鏁� - * @param pageSize 鏀瑰彉鍚庢瘡椤靛睍绀烘暟鎹潯鏁� - */ - handlePageNoChange(page, pageSize) { - this.queryParam.pageNo = page - this.loadData() - }, + loadData() { + this.tableLoading = true + getAction(this.url.list, this.queryParam) + .then(res => { + if (res.success && res.result) { + this.dataSource = res.result + this.tableLoading = false + } + }) + .finally(() => { + this.tableLoading = false + this.handleWindowResize() + }) + }, - /** - * 鍒嗛〉鍣ㄦ瘡椤靛睍绀烘暟鎹潯鏁板彂鐢熸敼鍙樻椂瑙﹀彂 - * @param current 鏀瑰彉鍚庨〉鏁� - * @param size 鏀瑰彉鍚庢瘡椤靛睍绀烘暟鎹潯鏁� - */ - handlePageSizeChange(current, size) { - this.queryParam.pageSize = size - this.loadData() - }, - - onCellChange(key, dataIndex, value) { - console.log('瑙﹀彂onCellChange', key, dataIndex, value) - }, - - /** - * 褰撴祻瑙堝櫒鍙绐楀彛灏哄鍙戠敓鏀瑰彉鏃惰Е鍙� - */ - handleWindowResize() { - const devicePixelRatio = window.devicePixelRatio // 娴忚鍣ㄧ缉鏀炬瘮 - console.log('devicePixelRatio', devicePixelRatio) - if (devicePixelRatio < 1) return // 缂╂斁姣斿皬浜�1鏃朵笉杩涜楂樺害閲嶆柊璁剧疆锛屽洜涓簊crollY鍙樺ぇ鍚庤〃鏍艰秴鍑洪儴鍒嗕細琚殣钘忓鑷存粴鍔ㄦ潯涓嶅彲瑙� - const clientHeight = document.body.clientHeight || document.documentElement.clientHeight// 娴忚鍣ㄥ彲瑙嗗尯鍩熼珮搴� - console.log('clientHeight', clientHeight) - const containerTopToClientTopHeight = document.getElementById('EfficiencyShift').getBoundingClientRect().top // 琛ㄦ牸瀹瑰櫒椤堕儴鍒版祻瑙堝櫒鍙鍖哄煙椤堕儴鐨勯棿璺� - console.log('containerTopToClientTopHeight', containerTopToClientTopHeight) - // const tableHeadHeight = +window.getComputedStyle(document.querySelector('.ant-table-thead th')).height.slice(0, -2) // 琛ㄦ牸琛ㄥご楂樺害 - const tableHeadHeight = document.querySelector('.ant-table-thead th').offsetHeight // 琛ㄦ牸琛ㄥご楂樺害 - console.log('tableHeadHeight', tableHeadHeight) - // this.scrollY = clientHeight - containerTopToClientTopHeight - tableHeadHeight - const tableSuitableScrollY = clientHeight - containerTopToClientTopHeight - tableHeadHeight // 琛ㄦ牸鍨傜洿婊氬姩鏉″悎閫傞珮搴︼紙琛ㄦ牸姘村钩婊氬姩鏉″垰濂藉湪鍙鍖哄煙鏈�涓嬫柟锛� - // const tableSuitableScrollY = 600 - console.log('tableSuitableScrollY', tableSuitableScrollY) - const tableContainerHeight = document.getElementById('EfficiencyShift').offsetHeight - console.log('tableContainerHeight', tableContainerHeight) - const tableMaxScrollY = tableContainerHeight - tableHeadHeight // 琛ㄦ牸鍨傜洿婊氬姩鏉℃渶澶ч珮搴︼紙鑻ヨ秴鍑哄垯姘村钩婊氬姩鏉¤閬尅锛� - console.log('tableMaxScrollY', tableMaxScrollY) - if (tableSuitableScrollY && tableSuitableScrollY < tableMaxScrollY) this.scrollY = tableSuitableScrollY - else this.scrollY = tableMaxScrollY - console.log('scrollY', this.scrollY) - } + /** + * 褰撴祻瑙堝櫒鍙绐楀彛灏哄鍙戠敓鏀瑰彉鏃惰Е鍙� + */ + handleWindowResize() { + const devicePixelRatio = window.devicePixelRatio // 娴忚鍣ㄧ缉鏀炬瘮 + console.log('devicePixelRatio', devicePixelRatio) + if (devicePixelRatio < 1) return // 缂╂斁姣斿皬浜�1鏃朵笉杩涜楂樺害閲嶆柊璁剧疆锛屽洜涓簊crollY鍙樺ぇ鍚庤〃鏍艰秴鍑洪儴鍒嗕細琚殣钘忓鑷存粴鍔ㄦ潯涓嶅彲瑙� + const clientHeight = document.body.clientHeight || document.documentElement.clientHeight// 娴忚鍣ㄥ彲瑙嗗尯鍩熼珮搴� + console.log('clientHeight', clientHeight) + const containerTopToClientTopHeight = document.getElementById('EfficiencyShift').getBoundingClientRect().top // 琛ㄦ牸瀹瑰櫒椤堕儴鍒版祻瑙堝櫒鍙鍖哄煙椤堕儴鐨勯棿璺� + console.log('containerTopToClientTopHeight', containerTopToClientTopHeight) + // const tableHeadHeight = +window.getComputedStyle(document.querySelector('.ant-table-thead th')).height.slice(0, -2) // 琛ㄦ牸琛ㄥご楂樺害 + const tableHeadHeight = document.querySelector('.ant-table-thead th').offsetHeight // 琛ㄦ牸琛ㄥご楂樺害 + console.log('tableHeadHeight', tableHeadHeight) + // this.scrollY = clientHeight - containerTopToClientTopHeight - tableHeadHeight + const tableSuitableScrollY = clientHeight - containerTopToClientTopHeight - tableHeadHeight // 琛ㄦ牸鍨傜洿婊氬姩鏉″悎閫傞珮搴︼紙琛ㄦ牸姘村钩婊氬姩鏉″垰濂藉湪鍙鍖哄煙鏈�涓嬫柟锛� + // const tableSuitableScrollY = 600 + console.log('tableSuitableScrollY', tableSuitableScrollY) + const tableContainerHeight = document.getElementById('EfficiencyShift').offsetHeight + console.log('tableContainerHeight', tableContainerHeight) + const tableMaxScrollY = tableContainerHeight - tableHeadHeight // 琛ㄦ牸鍨傜洿婊氬姩鏉℃渶澶ч珮搴︼紙鑻ヨ秴鍑哄垯姘村钩婊氬姩鏉¤閬尅锛� + console.log('tableMaxScrollY', tableMaxScrollY) + if (tableSuitableScrollY && tableSuitableScrollY < tableMaxScrollY) this.scrollY = tableSuitableScrollY + else this.scrollY = tableMaxScrollY + console.log('scrollY', this.scrollY) } } +} </script> <style scoped lang="less"> - .pagination { - display: flex; - justify-content: end; - margin: 20px 0; - } +.pagination { + display: flex; + justify-content: end; + margin: 20px 0; +} +.device_list { + overflow: hidden; + display: flex; + flex-direction: column; +} + +@media screen and (min-width: 1920px) { .device_list { - overflow: hidden; - display: flex; - flex-direction: column; + height: 811px !important; } +} - @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: 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: 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 (min-width: 1280px) and (max-width: 1400px) { - .device_list { - height: 564px !important; - } +@media screen and (max-width: 1280px) { + .device_list { + height: 564px !important; } +} - @media screen and (max-width: 1280px) { - .device_list { - height: 564px !important; - } +/deep/ .ant-table-body { + &::-webkit-scrollbar { + height: 12px; } - - /deep/ .ant-table-body { - &::-webkit-scrollbar { - height: 12px; - } - } +} </style> \ No newline at end of file -- Gitblit v1.9.3