fix : 修复细节

This commit is contained in:
2024-05-14 17:11:59 +08:00
parent 18caa0ee58
commit bead5edc86
3 changed files with 117 additions and 51 deletions

View File

@@ -163,7 +163,6 @@ const handleView = (row) => {
})
}
}
</script>
<style lang="scss" scoped>

View File

@@ -33,29 +33,14 @@
</div>
</el-form>
<baseTitle title="征集说明"></baseTitle>
<Tinymce image-url="/notice/file" file-url="/notice/file" v-model:value="formData.collectExplain" height="300"/>
<Tinymce image-url="/notice/file" file-url="/notice/file" v-model:value="formData.collectExplain" height="300" v-if="showTinymce"/>
<baseTitle title="申请文件"></baseTitle>
<file-upload @getFile="getFile"/>
<el-table :data="formData.fileList" style="width: 100%">
<el-table-column label="序号" type="index" align="center" width="80"/>
<el-table-column prop="originalFileName" label="文件名" align="center"/>
<el-table-column prop="tag" label="标签" align="center"/>
<el-table-column prop="size" label="文件大小" align="center">
<template #default="scope">
{{ parseInt(scope.row.size / 1024) }}KB
</template>
</el-table-column>
<el-table-column align="center" label="操作">
<template #default="scope">
<a :href="scope.row.url">
下载
</a>
<el-button link type="primary" size="small" @click="beforeRemove(scope.row)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<fvTable style="width: 100%;max-height: 200px" v-if="showTable" :tableConfig="tableConfig" :data="formData.fileList" :isSettingCol="false" :pagination="false">
<template #empty>
<el-empty :image-size="90" description="暂无待办" style="padding: 0"/>
</template>
</fvTable>
<div class="approval-record">
<baseTitle title="流程"></baseTitle>
<process-diagram-viewer mode="view" v-if="processDiagramViewer"/>
@@ -95,6 +80,7 @@ const formData = ref({
deadline: '',
collectExplain: ''
})
const showTinymce = ref(false)
const processDiagramViewer = ref(false)
const typeOption = ref([
{
@@ -106,6 +92,7 @@ const companyOption = ref([])
const form = ref(null)
const fileList = ref(null)
const loading = ref(false)
const showTable = ref(false)
const processStore = useProcessStore()
const processInstanceData = ref()
const rules = reactive({
@@ -114,6 +101,48 @@ const rules = reactive({
collectType: [{required: true, message: '请选择征集类型', trigger: 'blur'}],
deadline: [{required: true, message: '请选择截止时间', trigger: 'blur'}],
})
const tableConfig = reactive({
columns: [
{
prop: 'index',
type: 'index',
label: '序号',
align: 'center',
width: '80',
},
{
prop: 'originalFileName',
label: '文件名',
align: 'center',
},
{
prop: 'tag',
label: '标签',
align: 'center'
},
{
prop: 'size',
label: '文件大小',
align: 'center',
currentRender: ({row, index}) => (parseInt(row.size / 1024) + 'KB')
},
{
prop: 'oper',
label: '操作',
align: 'center',
showOverflowTooltip: false,
currentRender: ({row, index}) => {
return (
<div>
<a style="cursor: pointer;font-size: 14px;color: #2a99ff;" href={row.url}>下载</a>
<el-button type="primary" size="large" link onClick={() => beforeRemove(row)}>删除</el-button>
</div>
)
}
}
]
})
const compositeParam=(item)=>{
return {
fileId: item.id,
@@ -128,6 +157,10 @@ const compositeParam=(item)=>{
}
const getFile = (val) => {
console.log('上传文件',val)
showTable.value = false
nextTick(() => {
showTable.value = true
})
let fileObj = {}
let newFileArray = []
if (route.query.isAdd === undefined) {
@@ -145,6 +178,7 @@ const getFile = (val) => {
formData.value.fileList = newFileArray
fileList.value = newFileArray
}
}
const init = async () => {
@@ -210,6 +244,10 @@ const getDetailInfo = async () => {
console.log(res)
ElMessage.success(res.msg)
formData.value = res.data
showTinymce.value = false
nextTick(() => {
showTinymce.value = true
})
} else {
ElMessage.error(res.msg)
}
@@ -245,13 +283,18 @@ onMounted(async () => {
if (route.query.id) {
await getDetailInfo()
}
nextTick(() => {
showTable.value = true
})
loading.value = false
})
</script>
<style lang="scss" scoped>
:deep(.el-empty__description){
margin-top: 0;
}
.add-block {
//display: flex;
//justify-content: space-between;

View File

@@ -36,23 +36,12 @@
<baseTitle title="附件列表"></baseTitle>
<el-col :span="24">
<el-form-item>
<el-table :data="formData.fileList" style="width: 100%">
<el-table-column label="序号" type="index" align="center" width="80"/>
<el-table-column prop="originalFileName" label="文件名" align="center"/>
<el-table-column prop="tag" label="标签" align="center"/>
<el-table-column prop="size" label="文件大小" align="center">
<template #default="scope">
{{ parseInt(scope.row.size / 1024) }}KB
</template>
</el-table-column>
<el-table-column align="center" label="操作">
<template #default="scope">
<a :href="scope.row.url">
下载
</a>
</template>
</el-table-column>
</el-table>
<fvTable style="width: 100%;max-height: 200px" v-if="showTable" :tableConfig="tableConfig"
:data="formData.fileList" :isSettingCol="false" :pagination="false">
<template #empty>
<el-empty :image-size="90" description="暂无待办" style="padding: 0"/>
</template>
</fvTable>
</el-form-item>
</el-col>
<el-col :span="24">
@@ -104,6 +93,7 @@ const demandForm = ref()
const processStore = useProcessStore()
const companyOption = ref([])
const processInstanceData = ref({})
const showTable = ref(false)
const processDiagramViewer = ref(false)
const processTree = ref()
const companyNameArray = ref([])
@@ -111,6 +101,41 @@ const formData = ref({})
const rules = reactive({
auditOpinion: [{required: true, message: '请输入审核意见', trigger: 'blur'}],
})
const tableConfig = reactive({
columns: [
{
prop: 'index',
type: 'index',
label: '序号',
align: 'center',
width: '80',
},
{
prop: 'originalFileName',
label: '文件名',
align: 'center',
},
{
prop: 'tag',
label: '标签',
align: 'center'
},
{
prop: 'size',
label: '文件大小',
align: 'center',
currentRender: ({row, index}) => (parseInt(row.size / 1024) + 'KB')
},
{
prop: 'oper',
label: '操作',
align: 'center',
currentRender: ({row, index}) => {
return (<a style="cursor: pointer;font-size: 14px;color: #2a99ff;" href={row.url}>下载</a>)
}
}
]
})
const handleSubmit = () => {
let approve = {
taskId: processInstanceData.value.taskId,
@@ -124,7 +149,7 @@ const handleSubmit = () => {
router.push({
path: '/projectdemand/demandcollection'
})
}else {
} else {
ElMessage.error(res.msg)
}
})
@@ -144,7 +169,7 @@ const handleReject = (instance) => {
router.push({
path: '/projectdemand/demandcollection'
})
}else {
} else {
ElMessage.error(res.msg)
}
})
@@ -156,7 +181,7 @@ const getCompanyOption = async () => {
}
const matterTree = (data, id) => {
if(id){
if (id) {
for (let i = 0; i < data.length; i++) {
if (data[i].value == id) {
companyNameArray.value.push(data[i].label);
@@ -172,18 +197,18 @@ const matterTree = (data, id) => {
const getDataSourceOptionItem = (val) => {
if (val !== undefined) {
val.forEach(item => {
matterTree(companyOption.value,item)
matterTree(companyOption.value, item)
})
}
return companyNameArray.value.join('');
}
const init = async () => {
if(!route.query.id)return;
if (!route.query.id) return;
await getCompanyOption()
getInfo(route.query.id).then(res => {
let data = res.data
formData.value = data.formData;
data.formData.companyIds= getDataSourceOptionItem(data.formData.companyIds)
data.formData.companyIds = getDataSourceOptionItem(data.formData.companyIds)
processInstanceData.value = data
processStore.setDesign(data)
processStore.runningList.value = data.runningList;
@@ -193,6 +218,7 @@ const init = async () => {
processStore.passList.value = data.passList;
nextTick(() => {
processDiagramViewer.value = true
showTable.value = true
})
})
}
@@ -200,12 +226,9 @@ init()
</script>
<style lang="scss" scoped>
a {
cursor: pointer;
font-size: 14px;
color: #2a99ff;
:deep(.el-empty__description){
margin-top: 0;
}
.detail-block {
overflow: hidden;
padding-right: 10px;
@@ -231,6 +254,7 @@ a {
.approval-record {
padding-bottom: 30px;
.process {
position: relative;
}