fix : 修复审核意见位置

This commit is contained in:
2024-06-05 00:51:27 +08:00
parent df6f49caeb
commit a7d91a8f32
11 changed files with 252 additions and 69 deletions

View File

@@ -1,27 +1,37 @@
<template>
<div v-loading="loading">
<div v-loading="loading">
<fvForm :schema="schema" @getInstance="(e)=>form = e"></fvForm>
<el-form :model="formData" label-width="auto" >
<el-form :model="formData" label-width="auto">
<file-component :title="getTagName(type)+'附件'" :tag="getTagName(type)"
v-model:value="formData.fileList" :processViewer="processViewer"
:file-list-show="fileListShow"/>
</el-form>
<div v-if="data.taskId">
<baseTitle title="审核意见"></baseTitle>
<el-form-item prop="_value">
<el-input
v-model="_value"
:rows="3"
type="textarea"
placeholder="请输入审核意见"
/>
</el-form-item>
</div>
<div class="approval-record">
<baseTitle title="审批记录"></baseTitle>
<div class="process">
<operation-render v-if="processViewer" :operation-list="data.operationList"
:state="data.state"/>
<process-diagram-viewer v-if="processViewer" :id-name="type"/>
</div>
<baseTitle title="审批记录"></baseTitle>
<div class="process">
<operation-render v-if="processViewer" :operation-list="data.operationList"
:state="data.state"/>
<process-diagram-viewer v-if="processViewer" :id-name="type"/>
</div>
</div>
</div>
</template>
<script setup lang="jsx">
import { computed, markRaw, reactive, ref, watchEffect } from 'vue';
import OperationRender from '@/views/workflow/common/OperationRender.vue'
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
import { ElLoading } from 'element-plus';
import {ElLoading} from 'element-plus';
import {downloadFile} from "@/api/project-demand";
const props = defineProps({
@@ -53,12 +63,16 @@ const props = defineProps({
loading: {
type: Boolean,
default: false
},
value: {
type: String,
default: ''
}
})
const form = ref()
const schema = computed(()=>{
const schema = computed(() => {
let arr
if(props.type == 'approval') {
if (props.type == 'approval') {
arr = [
{
label: '前置流程',
@@ -73,24 +87,24 @@ const schema = computed(()=>{
colProps: {
span: 24
},
component: ()=>(
<div>
{
props.formData.singleFile?.originalFileName?
<span
style={{color: '#409EFF', cursor: 'pointer'}}
onClick={()=>handleDownload(props.formData.singleFile)}
>
component: () => (
<div>
{
props.formData.singleFile?.originalFileName ?
<span
style={{color: '#409EFF', cursor: 'pointer'}}
onClick={() => handleDownload(props.formData.singleFile)}
>
{props.formData.singleFile?.originalFileName}
</span> :
<span>{'--'}</span>
}
</div>
<span>{'--'}</span>
}
</div>
)
},
]
} else if(props.type == 'execute') {
} else if (props.type == 'execute') {
arr = [
{
label: '前置流程',
@@ -105,13 +119,13 @@ const schema = computed(()=>{
colProps: {
span: 24
},
component: ()=>(
component: () => (
<div>
{
props.formData.singleFile?.originalFileName?
props.formData.singleFile?.originalFileName ?
<span
style={{color: '#409EFF', cursor: 'pointer'}}
onClick={()=>handleDownload(props.formData.singleFile)}
onClick={() => handleDownload(props.formData.singleFile)}
>
{props.formData.singleFile?.originalFileName}
</span> :
@@ -122,7 +136,7 @@ const schema = computed(()=>{
)
},
]
} else if(props.type == 'archivist'){
} else if (props.type == 'archivist') {
arr = [
{
label: '项目归档附件',
@@ -130,13 +144,13 @@ const schema = computed(()=>{
colProps: {
span: 24
},
component: ()=>(
component: () => (
<div>
{
props.formData.singleFile?.originalFileName?
props.formData.singleFile?.originalFileName ?
<span
style={{color: '#409EFF', cursor: 'pointer'}}
onClick={()=>handleDownload(props.formData.singleFile)}
onClick={() => handleDownload(props.formData.singleFile)}
>
{props.formData.singleFile?.originalFileName}
</span> :
@@ -147,7 +161,7 @@ const schema = computed(()=>{
)
},
]
} else if(props.type == 'phase'){
} else if (props.type == 'phase') {
arr = [
{
label: '阶段变更附件',
@@ -155,13 +169,13 @@ const schema = computed(()=>{
colProps: {
span: 24
},
component: ()=>(
component: () => (
<div>
{
props.formData.singleFile?.originalFileName?
props.formData.singleFile?.originalFileName ?
<span
style={{color: '#409EFF', cursor: 'pointer'}}
onClick={()=>handleDownload(props.formData.singleFile)}
onClick={() => handleDownload(props.formData.singleFile)}
>
{props.formData.singleFile?.originalFileName}
</span> :
@@ -175,6 +189,17 @@ const schema = computed(()=>{
}
return arr
})
const emit = defineEmits(['update:value'])
const _value = computed({
get() {
return props.value;
},
set(val) {
emit("update:value", val);
}
})
const getTagName = (type) => {
switch (type) {
case 'approval':
@@ -198,7 +223,7 @@ const handleDownload = (row) => {
loading.close()
})
}
watchEffect(()=>{
watchEffect(() => {
Object.keys(props.formData).length && (form.value.setValues(props.formData))
})