gaoluyang
3 天以前 f41f726df15733c4cc161881168e19f62bf060b3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<template>
  <el-dialog v-model="dialogVisible" title="附件" width="30%" :before-close="handleClose">
    <el-table :data="tableData" border height="40vh">
      <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>
        </template>
      </el-table-column>
    </el-table>
  </el-dialog>
</template>
 
<script setup>
import { ref } from 'vue'
 
const dialogVisible = ref(false)
const tableData = ref([])
const { proxy } = getCurrentInstance();
const handleClose = () => {
  dialogVisible.value = false
}
const open = (list) => {
  dialogVisible.value = true
  tableData.value = list
}
const downLoadFile = (row) => {
  proxy.$download.name(row.url);
 
}
defineExpose({
  open
})
</script>
 
<style></style>