Merge remote-tracking branch 'origin/thirdStage' into thirdStage

This commit is contained in:
赵霄
2024-01-12 15:04:16 +08:00
2 changed files with 45 additions and 16 deletions
@@ -527,18 +527,16 @@ export default {
},
// 新增修改单
handleAdd () {
// 不知道左侧要预览哪个文件
const file = ''
const standardId = this.$refs.baseInfoForm.formInline.standardId || ''
this.$refs.updateListModal.title = this.$t('newlyAdded')
this.$refs.updateListModal.add(file)
this.$refs.updateListModal.add(standardId)
},
// 修改单的编辑
handleEdit (record, index) {
// 不知道左侧要预览哪个文件
const file = ''
const standardId = this.$refs.baseInfoForm.formInline.standardId || ''
this.$refs.updateListModal.title = this.$t('edit')
const dataIndex = (Number(this.ipagination.current) - 1) * Number(this.ipagination.pageSize) + index
this.$refs.updateListModal.edit(file, record, dataIndex)
this.$refs.updateListModal.edit(standardId, record, dataIndex)
},
// 修改单的删除
handleDelete (index) {
@@ -10,8 +10,10 @@
<div class="content">
<!-- 左侧文件预览 -->
<div class="content-left">
<iframe v-if="iframeSrc" :src="iframeSrc" width="100%" frameborder="0"></iframe>
<a-empty class="empty-file" v-else description="当前文件类型暂不支持预览"></a-empty>
<a-spin :spinning="leftLoading" class="left-spin">
<iframe v-if="iframeSrc" :src="iframeSrc" width="100%" frameborder="0"></iframe>
<a-empty class="empty-file" v-else description="当前文件类型暂不支持预览"></a-empty>
</a-spin>
</div>
<!-- 右侧表单区域 -->
<div class="content-right">
@@ -81,6 +83,7 @@ import { getFileInfo } from '@/api/api'
import { previewPdf } from '@/utils/previewPdf'
import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import { getEnterpriseStandardInfoById } from '@/api/enterpriseStandardLibraryApi'
const Base64 = require('js-base64').Base64
@@ -90,6 +93,7 @@ export default {
return {
title: '',
visible: false,
leftLoading: true,
confirmLoading: false,
form: this.$form.createForm(this),
model: {},
@@ -144,18 +148,14 @@ export default {
}
},
methods: {
add (file) {
this.getFileInfo(file).then(res => {
this.handlePreview(res)
})
add (standardId) {
this.getStandardFile(standardId)
this.isAdd = true
this.visible = true
this.form.resetFields()
},
edit (file, record, index) {
this.getFileInfo(file).then(res => {
this.handlePreview(res)
})
edit (standardId, record, index) {
this.getStandardFile(standardId)
this.visible = true
this.index = index
this.form.resetFields()
@@ -164,6 +164,31 @@ export default {
this.form.setFieldsValue(pick(this.model, 'clauseNumber', 'clauseName', 'beforeUpdate', 'afterUpdate', 'updateReason'))
})
},
// 根据企标id查询标准详情数据,为了获取发布稿,修改单左侧预览
getStandardFile (standardId) {
if (!standardId) {
return
}
this.leftLoading = true
getEnterpriseStandardInfoById({ id: standardId, type: '2' }).then(res => {
if (res.success) {
// 过程稿件id 发布稿>修改单>报批稿>送审稿>征求意见稿>草稿
const fieldArr = ['publish_of_original', 'modification_list', 'draft_for_review', 'draft_for_comment', 'draft']
let fileId = ''
for (const item of fieldArr) {
if (!fileId) {
fileId = res.result[item] ? res.result[item].split(',')[0] : ''
}
}
if (fileId)
this.getFileInfo(fileId).then(res => {
this.handlePreview(res)
})
}
}).finally(() => {
this.leftLoading = false
})
},
getFileInfo (fileId) {
return new Promise(resolve => {
let fileInfo
@@ -240,6 +265,12 @@ export default {
width: 60%;
height: 100%;
overflow-y: scroll;
.left-spin {
height: 100%;
}
/deep/ .ant-spin-container {
height: 100%;
}
iframe {
height: calc(100% - 20px) !important;
}