From 29d0819159ba4a474b7328ec3750b50176995935 Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期四, 04 九月 2025 16:06:00 +0800 Subject: [PATCH] 倍率报表页面增加日期禁选功能 --- src/views/mdc/base/modules/MagnificationReport/MagnificationReportList.vue | 213 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 213 insertions(+), 0 deletions(-) diff --git a/src/views/mdc/base/modules/MagnificationReport/MagnificationReportList.vue b/src/views/mdc/base/modules/MagnificationReport/MagnificationReportList.vue new file mode 100644 index 0000000..595be3c --- /dev/null +++ b/src/views/mdc/base/modules/MagnificationReport/MagnificationReportList.vue @@ -0,0 +1,213 @@ +<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 value-format="YYYY-MM-DD" v-model="queryParam.dates" @change="dateParamChange" + :disabled-date="disabledDate"/> + </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 :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: 'MagnificationReportList', + 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 + }, + queryParam: { + dates: [moment().subtract(1, 'day').startOf('day'), moment().subtract(1, 'day').endOf('day')] + }, + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '璁惧缂栧彿', + align: 'center', + dataIndex: 'equipmentId', + width: 300 + }, + { + title: '涓昏酱鍊嶇巼骞冲潎鍊�', + align: 'center', + dataIndex: 'spindlebeilv' + }, + { + title: '杩涚粰鍊嶇巼骞冲潎鍊�', + align: 'center', + dataIndex: 'feedbeilv' + }, + { + title: '鏃ユ湡', + align: 'center', + dataIndex: 'theDate', + width: 300 + } + ], + scrollY: 465, + url: { + list: '/mdc/magnification/list', + exportXlsUrl: '/mdc/magnification/exportXls' + } + } + }, + watch: { + Type(valmath) { + this.dataList = [] + this.queryParam.typeTree = valmath + }, + 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() + } + } + }, + created() { + this.queryParam.startTime = moment(this.queryParam.dates[0]).format('YYYY-MM-DD') + this.queryParam.endTime = moment(this.queryParam.dates[1]).format('YYYY-MM-DD') + this.loadData(1) + }, + mounted() { + window.addEventListener('resize', this.handleWindowResize) + this.handleWindowResize() + }, + beforeDestroy() { + window.removeEventListener('resize', this.handleWindowResize) + }, + methods: { + dateParamChange(dateArray) { + this.queryParam.startTime = dateArray[0] + this.queryParam.endTime = dateArray[1] + }, + + disabledDate(current) { + // Can not select days before today and today + return current > moment().subtract(1, 'day').endOf('day') + }, + + /** + * 褰撴祻瑙堝櫒鍙绐楀彛灏哄鍙戠敓鏀瑰彉鏃惰Е鍙� + */ + 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 - 100 + } + } + } +</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> \ No newline at end of file -- Gitblit v1.9.3