diff --git a/src/utils/zipdownload.ts b/src/utils/zipdownload.ts index d6e6762..08dfeec 100644 --- a/src/utils/zipdownload.ts +++ b/src/utils/zipdownload.ts @@ -1,5 +1,5 @@ import axios from 'axios' -import {getToken} from "/@/utils/gfast" +import {baseURL, getToken} from "/@/utils/gfast" import { ElMessage,ElLoading } from 'element-plus'; const mimeMap = { xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', @@ -22,9 +22,17 @@ export function downLoadZip(str:string, filename:string) { }) } +const getHost = ():string=>{ + return window.location.origin +} + // 下载插件 export function downLoadXml (url:string,params:any,rType='get') { - url = baseUrl + url + if (baseUrl=='' ||baseURL=='/'){ + url = getHost() + url + }else{ + url = baseUrl + url + } const loading = ElLoading.service({ lock: true, text: '正在生成导出数据...', diff --git a/src/views/system/tools/gen/component/genInfoForm.vue b/src/views/system/tools/gen/component/genInfoForm.vue index 6a611a2..b475dc5 100644 --- a/src/views/system/tools/gen/component/genInfoForm.vue +++ b/src/views/system/tools/gen/component/genInfoForm.vue @@ -19,26 +19,12 @@ - - - - - - - - + @@ -135,6 +121,19 @@ + + + + + + @@ -156,12 +155,13 @@ import {defineComponent, inject, reactive, ref, unref} from 'vue'; import type { FormInstance, FormRules } from 'element-plus'; import { TableDataInfo } from '/@/views/system/tools/gen/component/model'; import {ElMessage} from "element-plus"; +import {Ref, UnwrapRef} from "@vue/reactivity"; export default defineComponent({ name: 'genInfoForm', emits:['goNext','close'], setup(props,{emit}) { const genInfoFormRef = ref(); - const info = inject('tableData') as TableDataInfo; + const info = inject>>('tableData') as Ref>; const rules = reactive({ tplCategory: [{ required: true, message: '请选择生成模板', trigger: 'blur' }], packageName: [{ required: true, message: '请输入生成包路径', trigger: 'blur' }], @@ -186,11 +186,23 @@ export default defineComponent({ } const close = ()=>{ emit('close') + } + const getLastSubstring = (str:string):string => { + let lastIndex = str.lastIndexOf('/'); + if (lastIndex !== -1) { + return str.substring(lastIndex + 1); + } else { + return str; + } + } + const setModuleName = (value:string)=>{ + info.value.moduleName = getLastSubstring(value) } return { genInfoFormRef, info, rules, + setModuleName, nextTip, close }; diff --git a/src/views/system/tools/gen/component/model.ts b/src/views/system/tools/gen/component/model.ts index af8994e..144f0db 100644 --- a/src/views/system/tools/gen/component/model.ts +++ b/src/views/system/tools/gen/component/model.ts @@ -74,6 +74,7 @@ export interface TableDataInfo extends TableData{ businessName:string; functionName:string; linkTableName:string; + useVirtual:boolean; columns:TableColumns[] } export interface TableDataState {