[update] 修改企标和内部工作组左侧树样式,企标新增增加稽查内容部分

This commit is contained in:
lideqin
2023-09-22 15:12:37 +08:00
parent 89573aef30
commit 6ca2e31211
4 changed files with 75 additions and 39 deletions
@@ -26,21 +26,21 @@
</template>
<span class="tree-node-custom-title">{{ record.title }}</span>
</a-tooltip>
<div class="tree-operate-node-btn-box" :class="{'tree-operate-node-btn-box-hide': record.key !== mouseInNodeKey}">
<!-- 新增-->
<div class="tree-operate-node-btn-box" :class="{'tree-operate-node-btn-box-hide': record.key !== mouseInNodeKey || record.key === 'myCollect'}">
<!-- 新增 -->
<a-button icon="plus" class="tree-operate-node-btn" v-has="'enterpriseStandard:tree:add'"
@click="handleTreeAdd(record)"></a-button>
<!-- 编辑-->
<!-- 编辑 -->
<a-button v-if="record.nodeType !== StandardSystemTreeNodeType.ROOT_NODE.value"
v-has="'enterpriseStandard:tree:edit'"
class="tree-operate-node-btn" @click="handleTreeEdit(record)">
<i class="iconfont icon-bianji" style="color: #D52C26"></i>
<i class="iconfont icon-bianji"></i>
</a-button>
<!-- 删除-->
<!-- 删除 -->
<a-button v-if="record.nodeType !== StandardSystemTreeNodeType.ROOT_NODE.value"
v-has="'enterpriseStandard:tree:delete'"
class="tree-operate-node-btn" @click="handleTreeDelete(record.id)">
<i class="iconfont icon-shanchu_" style="color: #D52C26"></i>
<i class="iconfont icon-shanchu_"></i>
</a-button>
</div>
</div>
@@ -11,7 +11,7 @@
<div class="content">
<!-- 左侧文件预览 -->
<div class="content-left">
<iframe></iframe>
<iframe :src="iframeSrc" width="100%" frameborder="0"></iframe>
</div>
<!-- 右侧表单区域 -->
<div class="content-right">
@@ -37,6 +37,8 @@
<script>
import pick from 'lodash.pick'
import { getFileInfo } from '@/api/api'
import { previewPdf } from '@/utils/previewPdf'
export default {
name: 'CheckContentModal',
@@ -69,15 +71,22 @@ export default {
validateTrigger: 'blur'
}
},
index: undefined // 编辑的表格的下标
index: undefined, // 编辑的表格的下标
iframeSrc: '' // 左侧预览的路径
}
},
methods: {
add () {
add (publishOriginal) {
this.getFileInfo(publishOriginal).then(res => {
this.handlePreview(res)
})
this.visible = true
this.form.resetFields()
},
edit (record, index) {
edit (publishOriginal, record, index) {
this.getFileInfo(publishOriginal).then(res => {
this.handlePreview(res)
})
this.visible = true
this.index = index
this.form.resetFields()
@@ -86,6 +95,23 @@ export default {
this.form.setFieldsValue(pick(this.model, 'subjectToClause', 'standardContentOrRequirements'))
})
},
getFileInfo (fileId) {
return new Promise(resolve => {
let fileInfo
getFileInfo({ id: fileId }).then(res => {
if (res.success) {
fileInfo = res.result
}
}).finally(() => {
resolve(fileInfo)
})
})
},
handlePreview (file) {
// pdf预览
const url = previewPdf(file.id)
this.iframeSrc = url
},
close () {
this.visible = false
this.model = {}
@@ -119,6 +145,9 @@ export default {
width: 60%;
height: 100%;
overflow-y: scroll;
iframe {
height: calc(100% - 20px) !important;
}
}
.content-right {
width: 40%;
@@ -129,14 +129,23 @@ export default {
},
// 稽查内容的添加
handleAdd () {
const value = this.$refs.addForm.formInline
let publishOriginal = ''
if (value.publish_of_original) {
publishOriginal = value.publish_of_original
}
this.$refs.checkContentModal.title = this.$t('newlyAdded')
this.$refs.checkContentModal.add()
this.$refs.checkContentModal.add(publishOriginal)
},
// 稽查内容的编辑
handleEdit (record, index) {
console.log(record, index)
const value = this.$refs.addForm.formInline
let publishOriginal = ''
if (value.publish_of_original) {
publishOriginal = value.publish_of_original
}
this.$refs.checkContentModal.title = this.$t('edit')
this.$refs.checkContentModal.edit(record, index)
this.$refs.checkContentModal.edit(publishOriginal, record, index)
},
// 稽查内容的删除
handleDelete (index) {
@@ -165,7 +174,9 @@ export default {
} else {
url = this.url.add
}
postAction(url, formInline).then((res) => {
const param = Object.assign({}, formInline)
param.checkList = this.dataSource
postAction(url, param).then((res) => {
if (res.success) {
this.$message.success(this.$t('operationSuccessful'))
this.$emit('ok')