From ae787e9cff35032207f580ca12881228d1461e44 Mon Sep 17 00:00:00 2001
From: lideqin <694785430@qq.com>
Date: Fri, 22 Sep 2023 14:12:47 +0800
Subject: [PATCH] =?UTF-8?q?[update]=20=E4=BF=AE=E6=94=B9=E4=BC=81=E6=A0=87?=
=?UTF-8?q?=E5=AF=BC=E5=87=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../lang/enterpriseStandardLibrary/en.js | 2 +
.../lang/enterpriseStandardLibrary/zh.js | 2 +
.../standard/EnterpriseStandardList.vue | 52 +++++++------------
3 files changed, 24 insertions(+), 32 deletions(-)
diff --git a/src/common/lang/enterpriseStandardLibrary/en.js b/src/common/lang/enterpriseStandardLibrary/en.js
index d8493d12..af75c8bc 100644
--- a/src/common/lang/enterpriseStandardLibrary/en.js
+++ b/src/common/lang/enterpriseStandardLibrary/en.js
@@ -8,6 +8,8 @@ module.exports = {
temporaryPermissionSet: 'Temporary Permission Setting',
collection: 'Collect',
cancelCollection: 'Cancel Collection',
+ exportExcelFile: 'Enterprise Standard Table',
+ exportZipFile: 'Enterprise Standard Document',
templateExport: 'Enterprise Standard Template',
pleaseSelectLeastOneNode: 'Please select Level 2 and below system first',
authorizationDepart: '授权部门',
diff --git a/src/common/lang/enterpriseStandardLibrary/zh.js b/src/common/lang/enterpriseStandardLibrary/zh.js
index 71a2da1f..c84a138e 100644
--- a/src/common/lang/enterpriseStandardLibrary/zh.js
+++ b/src/common/lang/enterpriseStandardLibrary/zh.js
@@ -8,6 +8,8 @@ module.exports = {
temporaryPermissionSet: '临时权限设置',
collection: '收藏',
cancelCollection: '取消收藏',
+ exportExcelFile: '企业标准表',
+ exportZipFile: '企业标准文件',
templateExport: '企业标准模板',
pleaseSelectLeastOneNode: '请先选择企业标准下体系',
authorizationDepart: '授权部门',
diff --git a/src/views/enterpriseStandardLibrary/standard/EnterpriseStandardList.vue b/src/views/enterpriseStandardLibrary/standard/EnterpriseStandardList.vue
index 0331a289..0acac972 100644
--- a/src/views/enterpriseStandardLibrary/standard/EnterpriseStandardList.vue
+++ b/src/views/enterpriseStandardLibrary/standard/EnterpriseStandardList.vue
@@ -14,13 +14,12 @@
:tree-data="treeData"
:selectedKeys="currentTreeNode"
:default-expand-all="defaultExpandAll">
-
-
-
+
+
{{ record.title }}
@@ -64,8 +63,8 @@
{{ $t('import') }}
- {{ $t('export') }}
- {{ $t('exportWithFile') }}
+ {{ $t('export') }}
+ {{ $t('exportWithFile') }}
{{ $t('templateDownload') }}
{{ $t('batchDelete') }}
{{ $t('enterpriseStandardLibrary.standard.allocationStandard') }}
@@ -172,6 +171,7 @@ import UserSelectModal from '../../../components/selection/UserSelectModal'
// 配置标准弹框
import AllocationStandardDrawer from './modules/AllocationStandardDrawer'
import { postDownFile } from '@/api/manage'
+import Vue from 'vue'
export default {
name: 'EnterpriseStandardList',
@@ -239,7 +239,7 @@ export default {
this.treeLoading = true
getTreeList(params).then(res => {
if (res.success) {
- this.treeData = this.dealTreeData(res.result)
+ this.treeData = res.result || []
} else {
this.treeData = []
}
@@ -250,20 +250,6 @@ export default {
this.treeLoading = false
})
},
- // 处理左侧树数据结构
- dealTreeData (treeData) {
- return treeData.map(item => {
- if (item.children && item.children.length > 0) {
- item.scopedSlots = { icon: 'folder', title: 'custom' }
- item.children = this.dealTreeData(item.children)
- } else if (item.nodeType === StandardSystemTreeNodeType.ROOT_NODE.value) {
- item.scopedSlots = { icon: 'folder', title: 'custom' }
- } else {
- item.scopedSlots = { icon: 'file', title: 'custom' }
- }
- return item
- })
- },
// 左侧树搜索
handleTreeSearch () {
this.treeData = []
@@ -351,18 +337,18 @@ export default {
document.getElementsByClassName('ant-modal-confirm-btns')[0].style = 'display:none'
})
postDownFile(this.url.exportXlsUrl, param).then((data) => {
- if (!data) {
- this.$message.warning('文件下载失败')
+ if (!data || data.size === 0) {
+ Vue.prototype.$message.warning('文件下载失败')
return
}
if (typeof window.navigator.msSaveBlob !== 'undefined') {
- window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xlsx')
+ window.navigator.msSaveBlob(new Blob([data]), fileName + '.zip')
} else {
- const url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
+ const url = window.URL.createObjectURL(new Blob([data]))
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
- link.setAttribute('download', fileName + '.xlsx')
+ link.setAttribute('download', fileName + '.zip')
document.body.appendChild(link)
link.click()
document.body.removeChild(link) // 下载完成移除元素
@@ -396,21 +382,21 @@ export default {
postDownFile(this.url.exportZipUrl, param).then((data) => {
if (!data) {
this.$message.warning('文件下载失败')
- return
}
if (typeof window.navigator.msSaveBlob !== 'undefined') {
- window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xlsx')
+ window.navigator.msSaveBlob(new Blob([data]), fileName + '.zip')
} else {
- const url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
+ const url = window.URL.createObjectURL(new Blob([data]))
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
- link.setAttribute('download', fileName + '.xlsx')
+ link.setAttribute('download', fileName + '.zip')
document.body.appendChild(link)
link.click()
document.body.removeChild(link) // 下载完成移除元素
window.URL.revokeObjectURL(url) // 释放掉blob对象
}
+ // }
}).finally(() => {
// 销毁这个提示
modalLoading.destroy()
@@ -562,11 +548,13 @@ export default {