diff --git a/src/components/SearchFilesByTag.vue b/src/components/SearchFilesByTag.vue
index 3ae67af..a6730f6 100644
--- a/src/components/SearchFilesByTag.vue
+++ b/src/components/SearchFilesByTag.vue
@@ -2,7 +2,7 @@
-
+
@@ -21,13 +21,15 @@
-
+
@@ -35,7 +37,7 @@
import {downloadFile} from "@/api/project-demand";
import {ElNotification} from "element-plus";
import {getTags} from "@/api/project-manage";
-import {computed} from "vue";
+import {computed, ref} from "vue";
const route = useRoute()
const router = useRouter()
@@ -71,8 +73,10 @@ const tableConfig = reactive({
},
{
prop: 'originalFileName',
- label: '附件名称',
+ label: '文件名',
align: 'center',
+ currentRender: ({row, index}) => (clickToPreview(row)}>{row.originalFileName}
)
+
},
{
prop: 'tag',
@@ -114,6 +118,23 @@ const _value = computed({
emit('update:modelValue', value)
}
})
+const filePreviewParam = ref({
+ fileUrl: '',
+ fileName: '',
+ fileType: 'pdf'
+})
+const filePreviewShow = ref(false)
+const clickToPreview=(row)=>{
+ filePreviewShow.value = false
+ filePreviewParam.value = {
+ fileUrl: row.url,
+ fileName: row.originalFileName,
+ fileType: row.fileType
+ }
+ nextTick(()=>{
+ filePreviewShow.value = true
+ })
+}
const getTagsOption = () => {
if (!route.query.id) return
getTags(route.query.id).then(res => {
@@ -172,6 +193,6 @@ onActivated(()=>{
diff --git a/src/components/TagAndFileUpload.vue b/src/components/TagAndFileUpload.vue
index fbf5b64..fde2db7 100644
--- a/src/components/TagAndFileUpload.vue
+++ b/src/components/TagAndFileUpload.vue
@@ -59,7 +59,7 @@ const tableConfig = reactive({
},
{
prop: 'originalFileName',
- label: '附件名称',
+ label: '文件名',
align: 'center',
},
{
diff --git a/src/views/project-management/filing/upload.vue b/src/views/project-management/filing/upload.vue
index c80ca53..2eb7ff3 100644
--- a/src/views/project-management/filing/upload.vue
+++ b/src/views/project-management/filing/upload.vue
@@ -1,21 +1,24 @@
-
-
-
baseForm = e" label-position="left" label-width="left" style="margin-left: 15px">
-
-
-
-
-
-
-
-
-
-
- 提交
-
-
+
+
+
baseForm = e" label-position="left" label-width="left"
+ style="margin-left: 15px;margin-bottom: -18px">
+
+
+
+
+
+
+
+
+
+
+ 提交
+
+
+
-
diff --git a/src/views/project-management/implementation/attachment.vue b/src/views/project-management/implementation/attachment.vue
index a86c2e6..a38ce58 100644
--- a/src/views/project-management/implementation/attachment.vue
+++ b/src/views/project-management/implementation/attachment.vue
@@ -19,14 +19,14 @@
上传附件
-
-
-
+
@@ -250,7 +250,7 @@ const schema = computed(() => {
const baseForm = ref()
const tagsOption = ref([])
-const tableConfig = reactive({
+const implementationAttachmentTableConfig = reactive({
columns: [
{
prop: 'index',
@@ -263,6 +263,7 @@ const tableConfig = reactive({
prop: 'originalFileName',
label: '文件名',
align: 'center',
+ currentRender: ({row, index}) => (clickToPreview(row)}>{row.originalFileName}
)
},
{
prop: 'tag',
@@ -292,6 +293,23 @@ const tableConfig = reactive({
})
const showTable = ref(true)
const otherFileList = ref([])
+const filePreviewParam = ref({
+ fileUrl: '',
+ fileName: '',
+ fileType: 'pdf'
+})
+const filePreviewShow = ref(false)
+const clickToPreview=(row)=>{
+ filePreviewShow.value = false
+ filePreviewParam.value = {
+ fileUrl: row.url,
+ fileName: row.originalFileName,
+ fileType: row.fileType
+ }
+ nextTick(()=>{
+ filePreviewShow.value = true
+ })
+}
//匹配字典值,返回对应值的字典标签
const filterDict = (data, value) => {
if (data === undefined || value === undefined) return;
diff --git a/src/views/project-management/implementation/upload.vue b/src/views/project-management/implementation/upload.vue
index 539a4fd..631138c 100644
--- a/src/views/project-management/implementation/upload.vue
+++ b/src/views/project-management/implementation/upload.vue
@@ -20,7 +20,7 @@
-
@@ -29,6 +29,8 @@
提交
+
@@ -266,8 +268,10 @@ const tableConfig = reactive({
},
{
prop: 'originalFileName',
- label: '附件名称',
+ label: '文件名',
align: 'center',
+ currentRender: ({row, index}) => (clickToPreview(row)}>{row.originalFileName}
)
+
},
{
prop: 'tag',
@@ -290,7 +294,6 @@ const tableConfig = reactive({
handleDownload(row)}>下载
handleDelete(row)}/>
)
@@ -304,6 +307,23 @@ const name = ref(router.currentRoute.value.name)
const rules = reactive({
tagName: [{required: true, message: '请输入标签名称', trigger: ['blur', 'change']}],
})
+const filePreviewParam = ref({
+ fileUrl: '',
+ fileName: '',
+ fileType: 'pdf'
+})
+const filePreviewShow = ref(false)
+const clickToPreview=(row)=>{
+ filePreviewShow.value = false
+ filePreviewParam.value = {
+ fileUrl: row.url,
+ fileName: row.originalFileName,
+ fileType: row.fileType
+ }
+ nextTick(()=>{
+ filePreviewShow.value = true
+ })
+}
onActivated(() => {
console.log('onActivated')
formData.value.tagName = '';
@@ -476,7 +496,7 @@ getTagsOption()