From 3f3d35d6d6445f9cc90a8cf7bb496bee7f465542 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期二, 06 一月 2026 17:12:09 +0800
Subject: [PATCH] fix: 会议管理页面合并
---
src/components/Dialog/FileListDialog.vue | 164 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 164 insertions(+), 0 deletions(-)
diff --git a/src/components/Dialog/FileListDialog.vue b/src/components/Dialog/FileListDialog.vue
new file mode 100644
index 0000000..ea269d7
--- /dev/null
+++ b/src/components/Dialog/FileListDialog.vue
@@ -0,0 +1,164 @@
+<template>
+ <el-dialog
+ v-model="dialogVisible"
+ :title="title"
+ :width="width"
+ :before-close="handleClose"
+ >
+ <el-table :data="tableData" border :height="tableHeight">
+ <el-table-column
+ :label="nameColumnLabel"
+ :prop="nameColumnProp"
+ :min-width="nameColumnMinWidth"
+ show-overflow-tooltip
+ />
+ <el-table-column
+ v-if="showActions"
+ fixed="right"
+ label="鎿嶄綔"
+ :width="actionColumnWidth"
+ align="center"
+ >
+ <template #default="scope">
+ <el-button
+ v-if="showDownload"
+ link
+ type="primary"
+ size="small"
+ @click="handleDownload(scope.row)"
+ >
+ 涓嬭浇
+ </el-button>
+ <el-button
+ v-if="showPreview"
+ link
+ type="primary"
+ size="small"
+ @click="handlePreview(scope.row)"
+ >
+ 棰勮
+ </el-button>
+ <slot name="actions" :row="scope.row"></slot>
+ </template>
+ </el-table-column>
+ <slot name="columns"></slot>
+ </el-table>
+ </el-dialog>
+ <filePreview v-if="showPreview" ref="filePreviewRef" />
+</template>
+
+<script setup>
+import { ref, computed, getCurrentInstance } from 'vue'
+import filePreview from '@/components/filePreview/index.vue'
+
+const props = defineProps({
+ modelValue: {
+ type: Boolean,
+ default: false
+ },
+ title: {
+ type: String,
+ default: '闄勪欢'
+ },
+ width: {
+ type: String,
+ default: '40%'
+ },
+ tableHeight: {
+ type: String,
+ default: '40vh'
+ },
+ nameColumnLabel: {
+ type: String,
+ default: '闄勪欢鍚嶇О'
+ },
+ nameColumnProp: {
+ type: String,
+ default: 'name'
+ },
+ nameColumnMinWidth: {
+ type: [String, Number],
+ default: 400
+ },
+ actionColumnWidth: {
+ type: [String, Number],
+ default: 100
+ },
+ showActions: {
+ type: Boolean,
+ default: true
+ },
+ showDownload: {
+ type: Boolean,
+ default: true
+ },
+ showPreview: {
+ type: Boolean,
+ default: true
+ },
+ urlField: {
+ type: String,
+ default: 'url'
+ },
+ downloadMethod: {
+ type: Function,
+ default: null
+ },
+ previewMethod: {
+ type: Function,
+ default: null
+ }
+})
+
+const emit = defineEmits(['update:modelValue', 'close', 'download', 'preview'])
+
+const { proxy } = getCurrentInstance()
+const filePreviewRef = ref(null)
+
+const dialogVisible = computed({
+ get: () => props.modelValue,
+ set: (val) => emit('update:modelValue', val)
+})
+
+const tableData = ref([])
+
+const handleClose = () => {
+ emit('close')
+ dialogVisible.value = false
+}
+
+const handleDownload = (row) => {
+ if (props.downloadMethod) {
+ props.downloadMethod(row)
+ } else {
+ // 榛樿涓嬭浇鏂规硶
+ proxy.$download.name(row[props.urlField])
+ }
+ emit('download', row)
+}
+
+const handlePreview = (row) => {
+ if (props.previewMethod) {
+ props.previewMethod(row)
+ } else {
+ // 榛樿棰勮鏂规硶
+ if (filePreviewRef.value) {
+ filePreviewRef.value.open(row[props.urlField])
+ }
+ }
+ emit('preview', row)
+}
+
+const open = (list) => {
+ dialogVisible.value = true
+ tableData.value = list || []
+}
+
+defineExpose({
+ open
+})
+</script>
+
+<style scoped>
+</style>
+
--
Gitblit v1.9.3