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 } }