fix : 优化需求征集详情页面

This commit is contained in:
2024-06-04 16:41:28 +08:00
parent 6597506435
commit 1d66c44edb
16 changed files with 162 additions and 429 deletions

View File

@@ -1,7 +1,7 @@
<template>
<el-form-item label="需求上报附件" v-if="fileListShow === 'READ' || fileListShow === 'EDIT'">
<el-form-item :label="title" v-if="fileListShow === 'READ' || fileListShow === 'EDIT'">
<file-upload @getFile="getOtherFile" v-if="fileListShow === 'EDIT'"/>
<fvTable style="width: 100%;max-height: 400px;" v-if="processViewer" :tableConfig="tableConfig"
<fvTable style="width: 100%;max-height: 300px;" v-if="processViewer" :tableConfig="tableConfig"
:data="_value" :isSettingCol="false" :pagination="false">
<template #empty>
<el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
@@ -11,10 +11,8 @@
</template>
<script setup lang="jsx">
import {downloadFile, deleteFile} from "@/api/project-demand";
import {ElMessage, ElMessageBox} from "element-plus";
import {ElMessageBox, ElNotification} from "element-plus";
const props = defineProps({
title: {
@@ -38,9 +36,7 @@ const props = defineProps({
default: false
},
})
const emit = defineEmits(['update:value'])
const tableConfig = reactive({
columns: [
{
@@ -123,11 +119,18 @@ const compositeParam = (item, type) => {
fileType: item.fileType,
url: item.url,
newFile: true,
tag: '需求上报'
tag: props.tag
}
}
const handleDownload = (row) => {
downloadFile(row.fileId).then(res => {
const blob = new Blob([res])
let a = document.createElement('a')
a.href = URL.createObjectURL(blob)
a.download = row.originalFileName
a.click()
})
}
const handleDelete = (row) => {
ElMessageBox.confirm(`确认删除名称为${row.originalFileName}的表格吗?`, '系统提示', {
confirmButtonText: '确定',
@@ -135,13 +138,21 @@ const handleDelete = (row) => {
type: 'warning'
}).then(() => {
deleteFile(row.fileId).then(res => {
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
if (res.code === 1000) {
ElMessage.success("删除成功");
_value.splice(_value.findIndex((item) => item.id === row.fileId), 1);
_value.value.splice(_value.value.findIndex((item) => item.id === row.fileId), 1);
}
});
}).catch(() => {
ElMessage.warning("用户取消删除! ");
ElNotification({
title: '提示',
message: '用户取消删除! ',
type: 'warning'
})
})
}
@@ -151,5 +162,7 @@ watch(() => props.processViewer, (newVal) => {
</script>
<style scoped>
:deep(.el-table--fit ) {
height: 300px !important;
}
</style>