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

添加文件链接跳转

parent d656e85e
...@@ -11,6 +11,7 @@ import { Download } from '@element-plus/icons-vue' ...@@ -11,6 +11,7 @@ import { Download } from '@element-plus/icons-vue'
import { onMounted, onUnmounted, ref, watch } from 'vue' import { onMounted, onUnmounted, ref, watch } from 'vue'
import LuckyExcel from 'luckyexcel' import LuckyExcel from 'luckyexcel'
import { getOrderFileById } from '@/api/order' import { getOrderFileById } from '@/api/order'
import { getOrderFileById as getVarOrderFileById } from '@/api/var'
import { import {
cellRightClickConfig, cellRightClickConfig,
sheetRightClickConfig, sheetRightClickConfig,
...@@ -21,7 +22,7 @@ import { useRoute } from 'vue-router' ...@@ -21,7 +22,7 @@ import { useRoute } from 'vue-router'
import { isFunction } from '@/utils/is' import { isFunction } from '@/utils/is'
const filePath = ref('') const filePath = ref('')
const props = defineProps(['fileId']) const props = defineProps(['fileId', 'type'])
const luckysheet = (window as any).luckysheet const luckysheet = (window as any).luckysheet
const loading = ref(false) const loading = ref(false)
const route = useRoute() const route = useRoute()
...@@ -60,8 +61,10 @@ const getFilePath = async () => { ...@@ -60,8 +61,10 @@ const getFilePath = async () => {
try { try {
loading.value = true loading.value = true
const fileId = props.fileId || route.query.fileId const fileId = props.fileId || route.query.fileId
const type = props.type || route.query.type
if (fileId) { if (fileId) {
const { data } = await getOrderFileById(fileId) const { data } =
type === 'var' ? await getVarOrderFileById(fileId) : await getOrderFileById(fileId)
if (data.code == 200) { if (data.code == 200) {
generateExcel(data.result.mergeFilePath) generateExcel(data.result.mergeFilePath)
} }
......
...@@ -32,14 +32,14 @@ ...@@ -32,14 +32,14 @@
v-for="item in row.filePath.split(';')" v-for="item in row.filePath.split(';')"
:key="item" :key="item"
target="_blank" target="_blank"
:href="'/preview-excel?filePath=' + item" :href="'/preview-excel?filePath=' + item + '&type=var'"
>{{ item }}</el-link >{{ item }}</el-link
> >
</template> </template>
</vxe-column> </vxe-column>
<vxe-column title="标注文件地址"> <vxe-column title="标注文件地址">
<template #default="{ row }"> <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 row.mergeFilePath
}}</el-link> }}</el-link>
</template> </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