Commit d02f8e7b authored by 何远江's avatar 何远江

添加文件链接跳转

parent d656e85e
......@@ -11,6 +11,7 @@ import { Download } from '@element-plus/icons-vue'
import { onMounted, onUnmounted, ref, watch } from 'vue'
import LuckyExcel from 'luckyexcel'
import { getOrderFileById } from '@/api/order'
import { getOrderFileById as getVarOrderFileById } from '@/api/var'
import {
cellRightClickConfig,
sheetRightClickConfig,
......@@ -21,7 +22,7 @@ import { useRoute } from 'vue-router'
import { isFunction } from '@/utils/is'
const filePath = ref('')
const props = defineProps(['fileId'])
const props = defineProps(['fileId', 'type'])
const luckysheet = (window as any).luckysheet
const loading = ref(false)
const route = useRoute()
......@@ -60,8 +61,10 @@ const getFilePath = async () => {
try {
loading.value = true
const fileId = props.fileId || route.query.fileId
const type = props.type || route.query.type
if (fileId) {
const { data } = await getOrderFileById(fileId)
const { data } =
type === 'var' ? await getVarOrderFileById(fileId) : await getOrderFileById(fileId)
if (data.code == 200) {
generateExcel(data.result.mergeFilePath)
}
......
......@@ -32,14 +32,14 @@
v-for="item in row.filePath.split(';')"
:key="item"
target="_blank"
:href="'/preview-excel?filePath=' + item"
:href="'/preview-excel?filePath=' + item + '&type=var'"
>{{ item }}</el-link
>
</template>
</vxe-column>
<vxe-column title="标注文件地址">
<template #default="{ row }">
<el-link target="_blank" :href="'/preview-excel?fileId=' + row.orderFileId">{{
<el-link target="_blank" :href="'/preview-excel?fileId=' + row.orderFileId + '&type=var'">{{
row.mergeFilePath
}}</el-link>
</template>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment