From f1a10730cf5ff807f86229799a82a59219e6d8b3 Mon Sep 17 00:00:00 2001 From: zhaoxiao Date: Tue, 14 Dec 2021 15:03:03 +0800 Subject: [PATCH] =?UTF-8?q?[add]=20=E5=88=86=E6=A0=87=E5=A7=94=E5=9C=A8?= =?UTF-8?q?=E7=A0=94=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/util.js | 19 +++++++++++++++++++ .../CommitteeUnderStudyProject.vue | 6 ++---- .../modules/CommitteeUnderStudyFilesModal.vue | 8 +++++++- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/utils/util.js b/src/utils/util.js index 9313aaa..26c6099 100644 --- a/src/utils/util.js +++ b/src/utils/util.js @@ -660,3 +660,22 @@ export function isAllEqual(array) { return true } } + +/** + * 将时间戳转换为YYYY-MM-DD HH:mm:ss格式 + */ +export function processingTimestamp(value) { + let data = new Date(value) + let y = data.getFullYear() + let m = data.getMonth() + 1 + m = m < 10 ? ('0' + m) : m + let d = data.getDate() + d = d < 10 ? ('0' + d) : d + let h = data.getHours() + h = h < 10 ? ('0' + h) : h + let minute = data.getMinutes() + let second = data.getSeconds() + minute = minute < 10 ? ('0' + minute) : minute + second = second < 10 ? ('0' + second) : second + return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second +} \ No newline at end of file diff --git a/src/views/projectManagement/CommitteeUnderStudyProject.vue b/src/views/projectManagement/CommitteeUnderStudyProject.vue index bb745f0..6e7bcc4 100644 --- a/src/views/projectManagement/CommitteeUnderStudyProject.vue +++ b/src/views/projectManagement/CommitteeUnderStudyProject.vue @@ -160,10 +160,8 @@ export default { if (res.success) { //update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------ this.dataSource = res.result.result.records - if (res.result.total) { - this.ipagination.total = res.result.total - //清空列表选中 - this.onClearSelected() + if (res.result.result.total) { + this.ipagination.total = res.result.result.total } else { this.ipagination.total = 0 } diff --git a/src/views/projectManagement/modules/CommitteeUnderStudyFilesModal.vue b/src/views/projectManagement/modules/CommitteeUnderStudyFilesModal.vue index bc881d5..8c5ec08 100644 --- a/src/views/projectManagement/modules/CommitteeUnderStudyFilesModal.vue +++ b/src/views/projectManagement/modules/CommitteeUnderStudyFilesModal.vue @@ -13,7 +13,6 @@ ref="table" size="middle" bordered - :rowKey="record => record.id || record.childrenId" :columns="columns" :dataSource="dataSource" :pagination="false" @@ -24,6 +23,10 @@ + + 下载 @@ -43,6 +46,7 @@ import { downloadFile } from '../../../api/manage' import Vue from 'vue' import { ACCESS_TOKEN } from '../../../store/mutation-types' +import { processingTimestamp } from '../../../utils/util' const columns = [ { @@ -76,6 +80,7 @@ export default { } }, methods: { + processingTimestamp, /** * 下载 * @param record @@ -100,6 +105,7 @@ export default { } }, handleCancel() { + this.dataSource = [] this.visible = false } }