Commit 818bdc05 authored by 何远江's avatar 何远江

功能优化

parent d603cd21
...@@ -12,8 +12,8 @@ import { ...@@ -12,8 +12,8 @@ import {
showsheetbarConfig, showsheetbarConfig,
showstatisticBarConfig showstatisticBarConfig
} from '@/constants/excelConfig' } from '@/constants/excelConfig'
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router'
import { isFunction } from '@/utils/is'; import { isFunction } from '@/utils/is'
const props = defineProps(['fileId']) const props = defineProps(['fileId'])
const luckysheet = (window as any).luckysheet const luckysheet = (window as any).luckysheet
...@@ -47,9 +47,15 @@ const generateExcel = (path: string) => { ...@@ -47,9 +47,15 @@ const generateExcel = (path: string) => {
const getFilePath = async () => { const getFilePath = async () => {
try { try {
loading.value = true loading.value = true
const { data } = await getOrderFileById((props.fileId || route.query.fileId) as string) const fileId = props.fileId || route.query.fileId
if (data.code == 200) { if (fileId) {
generateExcel(data.result.mergeFilePath) const { data } = await getOrderFileById(fileId)
if (data.code == 200) {
generateExcel(data.result.mergeFilePath)
}
} else {
const path = (route.query.filePath || '') as string
!!path && generateExcel(path)
} }
} catch {} } catch {}
loading.value = false loading.value = false
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<vxe-column field="customerId_dictText" title="客户名称" width="200"></vxe-column> <vxe-column field="customerId_dictText" title="客户名称" width="200"></vxe-column>
<vxe-column field="filePath" title="订单文件"> <vxe-column field="filePath" title="订单文件">
<template #default="{ row }"> <template #default="{ row }">
<el-link target="_blank" :href="'/api/sys/static/' + row.filePath">{{ <el-link target="_blank" :href="'/preview-excel?path=' + row.filePath">{{
row.filePath row.filePath
}}</el-link> }}</el-link>
</template> </template>
......
...@@ -182,11 +182,12 @@ ...@@ -182,11 +182,12 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</template> </template>
<el-col :span="24" v-if="currentConfigColumn.scriptName"> <el-col :span="24" v-if="currentConfigColumn.scriptName && !!currentConfigColumn.content">
<el-form-item label="脚本语句"> <el-form-item label="脚本语句">
<el-input <el-input
style="width: 220px" style="width: 220px"
rows="3" rows="3"
disabled
type="textarea" type="textarea"
v-model.trim="currentConfigColumn.content" v-model.trim="currentConfigColumn.content"
></el-input> ></el-input>
...@@ -373,6 +374,7 @@ const resetConfigForm = () => { ...@@ -373,6 +374,7 @@ const resetConfigForm = () => {
/** 脚本参数List */ /** 脚本参数List */
const currentScriptParamsList = computed(() => { const currentScriptParamsList = computed(() => {
const item: any = scriptList.value.find((v) => v.srciptName == currentConfigColumn.scriptName) const item: any = scriptList.value.find((v) => v.srciptName == currentConfigColumn.scriptName)
Reflect.set(currentConfigColumn, 'content', item?.scriptContent || '')
// 生成脚本参数表单 // 生成脚本参数表单
gScriptPs(item?.paramsName) gScriptPs(item?.paramsName)
return item?.paramsName != null ? item.paramsName : [] return item?.paramsName != null ? item.paramsName : []
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<vxe-column field="customerId_dictText" title="客户名称" width="120"></vxe-column> <vxe-column field="customerId_dictText" title="客户名称" width="120"></vxe-column>
<vxe-column title="原始文件地址"> <vxe-column title="原始文件地址">
<template #default="{ row }"> <template #default="{ row }">
<el-link target="_blank" :href="'/api/sys/static/' + row.filePath">{{ <el-link target="_blank" :href="'/preview-excel?filePath=' + row.filePath">{{
row.filePath row.filePath
}}</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