File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed
web/src/components/exportExcel Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 55</template >
66
77<script setup>
8+ import {getUrl } from " @/utils/image" ;
9+
810 const props = defineProps ({
911 templateId: {
1012 type: String ,
3537 ElMessage .error (' 组件未设置模板ID' )
3638 return
3739 }
38- const baseUrl = import .meta.env.VITE_BASE_API
40+ let baseUrl = import .meta.env.VITE_BASE_API
41+ if (baseUrl === " /" ){
42+ baseUrl = " "
43+ }
3944 const paramsCopy = JSON .parse (JSON .stringify (props .condition ))
4045 if (props .limit ) {
4146 paramsCopy .limit = props .limit
5257 ` ${ encodeURIComponent (key)} =${ encodeURIComponent (value)} `
5358 )
5459 .join (' &' )
60+
5561 const url = ` ${ baseUrl} /sysExportTemplate/exportExcel?templateID=${ props .templateId }${ params ? ' &' + params : ' ' } `
5662
5763 window .open (url, ' _blank' )
Original file line number Diff line number Diff line change 1919 ElMessage .error (' 组件未设置模板ID' )
2020 return
2121 }
22- const baseUrl = import .meta.env.VITE_BASE_API
22+ let baseUrl = import .meta.env.VITE_BASE_API
23+ if (baseUrl === " /" ){
24+ baseUrl = " "
25+ }
2326 const url = ` ${ baseUrl} /sysExportTemplate/exportTemplate?templateID=${ props .templateId } `
2427 window .open (url, ' _blank' )
2528 }
Original file line number Diff line number Diff line change 1212<script setup>
1313 import { ElMessage } from ' element-plus'
1414
15- const baseUrl = import .meta.env.VITE_BASE_API
15+ let baseUrl = import .meta.env.VITE_BASE_API
16+ if (baseUrl === " /" ){
17+ baseUrl = " "
18+ }
1619
1720 const props = defineProps ({
1821 templateId: {
You can’t perform that action at this time.
0 commit comments