From 4f0cb97a09ee88f106c4b8b0875ae611bae4b9a2 Mon Sep 17 00:00:00 2001 From: Lius <Lius2225@163.com> Date: 星期五, 01 三月 2024 16:02:42 +0800 Subject: [PATCH] 开启支持清除功能 --- src/views/mdc/base/modules/DeviceProcessReport/DeviceProcessReportList.vue | 86 ++++++++++++++++++++---------------------- 1 files changed, 41 insertions(+), 45 deletions(-) diff --git a/src/views/mdc/base/modules/DeviceProcessReport/DeviceProcessReportList.vue b/src/views/mdc/base/modules/DeviceProcessReport/DeviceProcessReportList.vue index 3f87906..f6ae0f2 100644 --- a/src/views/mdc/base/modules/DeviceProcessReport/DeviceProcessReportList.vue +++ b/src/views/mdc/base/modules/DeviceProcessReport/DeviceProcessReportList.vue @@ -12,6 +12,7 @@ :data-source="driveTypeList" placeholder="璇烽�夋嫨椹卞姩绫诲瀷" :filter-option="filterOption" + allowClear /> </a-form-item> </a-col> @@ -41,23 +42,23 @@ </div> <div class="container" id="EfficiencyShift" style="flex:1;overflow: hidden"> - <a-table :columns="columns" rowKey="equipmentId" :dataSource="dataSource.records" :scroll="{x:'max-content',y:scrollY}" :pagination="false" bordered> + <a-table :columns="columns" rowKey="equipmentId" :dataSource="dataSource" :scroll="{x:'max-content',y:scrollY}" :pagination="false" bordered> <span slot="duration" slot-scope="text">{{getFormattedTime(text)}}</span> </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 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> @@ -95,7 +96,7 @@ title: '搴忓彿', dataIndex: '', key: 'rowIndex', - width: 70, + width: 60, align: 'center', customRender: function(t, r, index) { return parseInt(index) + 1 @@ -106,18 +107,18 @@ title: '璁惧缁熶竴缂栧彿', align: 'center', dataIndex: 'equipmentId', - width: 120 + width: 200 }, { title: '璁惧鍚嶇О', align: 'center', - width: 150, + width: 200, dataIndex: 'equipmentName' }, { title: '椹卞姩绫诲瀷', align: 'center', - width: 110, + width: 100, dataIndex: 'driveType' }, { @@ -129,7 +130,7 @@ { title: '鍔犲伐浠舵暟', align: 'center', - width: 80, + width: 100, dataIndex: 'processCount' }, { @@ -137,14 +138,14 @@ dataIndex: 'duration', align: 'center', scopedSlots: { customRender: 'duration' }, - width: 110 + width: 150 }, - { - title: '鏃ユ湡', - dataIndex: 'theDate', - align: 'center', - width: 110 - } + // { + // title: '鏃ユ湡', + // dataIndex: 'theDate', + // align: 'center', + // width: 110 + // } ], dataSource: [], driveTypeList: [], @@ -209,9 +210,13 @@ methods: { dateParamChange(value) { this.dates = value - console.log('value', value) - this.queryParam.startTime = moment(this.dates[0]).format('YYYYMMDD') - this.queryParam.endTime = moment(this.dates[1]).format('YYYYMMDD') + if(!value.length) { + delete this.queryParam.startTime + delete this.queryParam.endTime + }else{ + this.queryParam.startTime = moment(this.dates[0]).format('YYYYMMDD') + this.queryParam.endTime = moment(this.dates[1]).format('YYYYMMDD') + } }, exportExcel() { @@ -227,24 +232,15 @@ }, searchQuery() { - if (this.dates != '') { - 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 = '' - } - this.queryParam.pageNo = 1 - this.loadData() + if (this.queryParam.typeTree == '1') { + this.queryParam.parentId = this.queryParamEquip.parentId + this.queryParam.equipmentId = this.queryParamEquip.equipmentId } else { - // this.$message.warning("璇烽�夋嫨鏃堕棿") - this.$notification.warning({ - message: '娑堟伅', - description: '璇烽�夋嫨鏃堕棿' - }) + this.queryParam.parentId = this.queryParamPeople.parentId + this.queryParam.equipmentId = '' } - // this.onClearSelected() + this.queryParam.pageNo = 1 + this.loadData() }, searchReset() { -- Gitblit v1.9.3