zouyu
2025-11-14 989d547833c94ffc4e7395b0023ec24ee09f5ab6
src/views/collaborativeApproval/approvalProcess/fileList.vue
对比新文件
@@ -0,0 +1,43 @@
<template>
  <el-dialog v-model="dialogVisible" title="闄勪欢" width="40%" :before-close="handleClose">
    <el-table :data="tableData" border height="40vh" stripe>
      <el-table-column label="闄勪欢鍚嶇О" prop="name" min-width="400" show-overflow-tooltip />
      <el-table-column fixed="right" label="鎿嶄綔" width="100" align="center">
        <template #default="scope">
          <el-button link type="primary" size="small" @click="downLoadFile(scope.row)">涓嬭浇</el-button>
          <el-button link type="primary" size="small" @click="lookFile(scope.row)">棰勮</el-button>
        </template>
      </el-table-column>
    </el-table>
  </el-dialog>
  <filePreview ref="filePreviewRef" />
</template>
<script setup>
import { ref } from 'vue'
import filePreview from '@/components/filePreview/index.vue'
const dialogVisible = ref(false)
const tableData = ref([])
const { proxy } = getCurrentInstance();
const filePreviewRef = ref()
const handleClose = () => {
  dialogVisible.value = false
}
const open = (list) => {
  dialogVisible.value = true
  tableData.value = list
}
const downLoadFile = (row) => {
  proxy.$download.name(row.url);
}
const lookFile = (row) => {
  filePreviewRef.value.open(row.url)
}
defineExpose({
  open
})
</script>
<style></style>