update 文档拆分-编辑-导出
This commit is contained in:
@@ -187,7 +187,7 @@ export default {
|
|||||||
clickEvent: 'subscribe',
|
clickEvent: 'subscribe',
|
||||||
has: 'documentComparison:publishWithdraw',
|
has: 'documentComparison:publishWithdraw',
|
||||||
show: (record) => {
|
show: (record) => {
|
||||||
return (record.createBy === this.userInfo.username || this.administrators) && (!record.releaseState || record.releaseState === 'draft')
|
return (record.createBy === this.userInfo.id || this.administrators) && (!record.releaseState || record.releaseState === 'draft')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 撤回
|
// 撤回
|
||||||
@@ -196,7 +196,7 @@ export default {
|
|||||||
clickEvent: 'subscribe',
|
clickEvent: 'subscribe',
|
||||||
has: 'documentComparison:publishWithdraw',
|
has: 'documentComparison:publishWithdraw',
|
||||||
show: (record) => {
|
show: (record) => {
|
||||||
return (record.createBy === this.userInfo.username || this.administrators) && !(!record.releaseState || record.releaseState === 'draft')
|
return (record.createBy === this.userInfo.id || this.administrators) && !(!record.releaseState || record.releaseState === 'draft')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 编辑
|
// 编辑
|
||||||
@@ -205,7 +205,7 @@ export default {
|
|||||||
clickEvent: 'edit',
|
clickEvent: 'edit',
|
||||||
has: 'documentComparison:edit',
|
has: 'documentComparison:edit',
|
||||||
show: (record) => {
|
show: (record) => {
|
||||||
// return (record.createBy === this.userInfo.username || this.administrators) && record.releaseState === 'draft'
|
// return (record.createBy === this.userInfo.id || this.administrators) && record.releaseState === 'draft'
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -125,6 +125,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="box-button">
|
<div class="box-button">
|
||||||
|
<!--发起文档对比-->
|
||||||
<a-button type="primary" @click="submit" v-has="'docComparsion:initiate:initiateComparison'">{{ $t('docTool.comparison.initiateDocumentComparison') }}</a-button>
|
<a-button type="primary" @click="submit" v-has="'docComparsion:initiate:initiateComparison'">{{ $t('docTool.comparison.initiateDocumentComparison') }}</a-button>
|
||||||
</div>
|
</div>
|
||||||
<div id="images">
|
<div id="images">
|
||||||
|
|||||||
@@ -89,7 +89,7 @@
|
|||||||
type="primary"
|
type="primary"
|
||||||
ghost
|
ghost
|
||||||
v-has="'split:sarFileSplitItems:export'"
|
v-has="'split:sarFileSplitItems:export'"
|
||||||
@click="handleExportXls($t('standardRegulationLibrary.domesticStandard.exportFileName'), 'zip')">
|
@click="handleExportXls($t('standardRegulationLibrary.domesticStandard.exportFileName'), '.zip')">
|
||||||
{{ $t('export') }}
|
{{ $t('export') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
<!--批量删除-->
|
<!--批量删除-->
|
||||||
@@ -195,7 +195,7 @@ import {
|
|||||||
import Search from '../../../components/customField/Search.vue'
|
import Search from '../../../components/customField/Search.vue'
|
||||||
import { isHasPermission } from '../../../utils/hasPermission.js'
|
import { isHasPermission } from '../../../utils/hasPermission.js'
|
||||||
import SplitDetailBatchEditDrawer from './modules/SplitDetailBatchEditDrawer.vue'
|
import SplitDetailBatchEditDrawer from './modules/SplitDetailBatchEditDrawer.vue'
|
||||||
import { postAction } from '../../../api/manage'
|
import { downFile, postAction } from '../../../api/manage'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'DocumentSplitDetail',
|
name: 'DocumentSplitDetail',
|
||||||
@@ -564,7 +564,56 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
|
/**
|
||||||
|
* 导出
|
||||||
|
* @param fileName
|
||||||
|
* @param fileSuffix
|
||||||
|
*/
|
||||||
|
handleExportXls (fileName, fileSuffix = '.xls') {
|
||||||
|
if (!fileName || typeof fileName !== 'string') {
|
||||||
|
fileName = '导出文件'
|
||||||
|
}
|
||||||
|
const param = this.getQueryParams()
|
||||||
|
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
|
||||||
|
param.idList = this.selectedRowKeys.join(',')
|
||||||
|
}
|
||||||
|
param.exportName = fileName + fileSuffix
|
||||||
|
param.parameter = this.infoId
|
||||||
|
// 加一个大的提示
|
||||||
|
const modalLoading = this.$info({
|
||||||
|
title: this.$t('tips'),
|
||||||
|
content: <span>{this.$t('exportTip')}
|
||||||
|
<a-spin size="small" /></span>,
|
||||||
|
keyboard: false
|
||||||
|
})
|
||||||
|
// 把知道了这个按钮去掉
|
||||||
|
this.$nextTick(() => {
|
||||||
|
document.getElementsByClassName('ant-modal-confirm-btns')[0].style = 'display:none'
|
||||||
|
})
|
||||||
|
downFile(this.url.exportXlsUrl, param).then((data) => {
|
||||||
|
if (!data) {
|
||||||
|
this.$message.warning(this.$t('fileDownloadFail'))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
||||||
|
window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + fileSuffix)
|
||||||
|
} else {
|
||||||
|
const url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
|
||||||
|
const link = document.createElement('a')
|
||||||
|
link.style.display = 'none'
|
||||||
|
link.href = url
|
||||||
|
link.setAttribute('download', fileName + fileSuffix)
|
||||||
|
document.body.appendChild(link)
|
||||||
|
link.click()
|
||||||
|
document.body.removeChild(link) // 下载完成移除元素
|
||||||
|
window.URL.revokeObjectURL(url) // 释放掉blob对象
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
// 销毁这个提示
|
||||||
|
modalLoading.destroy()
|
||||||
|
})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user