[update 标准解读流程] 完善

This commit is contained in:
danshihao
2024-07-11 15:45:19 +08:00
parent 8cc3371698
commit 074deb26b7
8 changed files with 135 additions and 69 deletions
@@ -12,6 +12,10 @@
@change="handleImport">
<a-button type="primary" icon="download" ghost>{{ $t('import') }}</a-button>
</a-upload>
<!-- 批量编辑解读人填写 -->
<a-button type="primary" ghost @click="handleBatchEdit" v-if="showBatchEditBtn">
{{$t('workCenter.standardInterpretationProcess.batchEdit')}}
</a-button>
<!-- 导出 -->
<a-button icon="upload" type="primary" ghost @click="handleExport" v-if="showExportBtn">
{{ $t('export') }}
@@ -391,7 +395,11 @@ export default {
selectionRows: [],
url: {
// 导入
importExcelUrl: ''
importExcelUrl: '/process/standardInterpretFlow/importExcelByUnDistribute',
// 标准主解读人节点选择分发的导出
exportDistribute: '/process/standardInterpretFlow/exportExcelByDistribute',
// 标准主解读人节点选择不分发的导出
exportUnDistribute: '/process/standardInterpretFlow/exportExcelByUnDistribute'
}
}
},
@@ -468,6 +476,13 @@ export default {
...mainInterpreterDistributeNodes // 标准主解读人分发节点
].includes(this.currentNodeId)
},
// 显示批量编辑按钮
showBatchEditBtn () {
return [
StandardInterpretationNodes.interpreterFillInfoOne.value, // 解读人填写信息
StandardInterpretationNodes.interpreterFillInfoTwo.value // 解读人填写信息
].includes(this.currentNodeId)
},
// 是否显示编辑按钮
showEditBtn () {
// 标准主解读人分发节点 && 不分发 显示编辑按钮
@@ -558,13 +573,13 @@ export default {
}
// 前端存储,没有id的数据,前端加上uuid
const data = info.file.response.result || []
this.dataSource.push(...data.map((item, index) => {
this.dataSource = data.map(item => {
// 导入的时候生成前端id,不用索引防止禁用出错
item.id = randomUUID()
// 有该标识返回数据的时候把id给去掉,这里的id前端生成的
item[uuidFlag] = true
return item
}))
})
} else {
if (Array.isArray(info.file.response.result) && info.file.response.result.length > 0) {
this.messageLineFeed(this.$t('fileImportError'), info.file.response.result)
@@ -605,7 +620,11 @@ export default {
if (!fileName || typeof fileName !== 'string') {
fileName = '导出文件'
}
const param = {}
const param = {
projectId: this.$route.query.projectId,
nodeId: this.$route.query.nodeId,
taskId: this.$route.query.taskId
}
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
param.selections = this.selectedRowKeys.join(',')
}
@@ -620,7 +639,12 @@ export default {
style: 'display: none'
}
})
const url = ''
let url = ''
// 解读人分发节点
if (this.isMainInterpreterDistribute) {
// 根据是否分发选择对应的接口
url = this.isDistribute ? this.url.exportDistribute : this.url.exportUnDistribute
}
downFile(url, param).then((data) => {
if (!data) {
this.$message.warning('文件下载失败')
@@ -693,7 +717,7 @@ export default {
const row = this.dataSource.find(item => item[this.rowKey] === formData[this.rowKey])
Object.assign(row, form)
} else {
this.selectedRows.forEach(item => {
this.selectionRows.forEach(item => {
Object.assign(item, form)
})
}