fix 代码生成树形虚拟表
This commit is contained in:
parent
48639c8bae
commit
ca368c89cb
@ -1,5 +1,5 @@
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import {getToken} from "/@/utils/gfast"
|
import {baseURL, getToken} from "/@/utils/gfast"
|
||||||
import { ElMessage,ElLoading } from 'element-plus';
|
import { ElMessage,ElLoading } from 'element-plus';
|
||||||
const mimeMap = {
|
const mimeMap = {
|
||||||
xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
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') {
|
export function downLoadXml (url:string,params:any,rType='get') {
|
||||||
|
if (baseUrl=='' ||baseURL=='/'){
|
||||||
|
url = getHost() + url
|
||||||
|
}else{
|
||||||
url = baseUrl + url
|
url = baseUrl + url
|
||||||
|
}
|
||||||
const loading = ElLoading.service({
|
const loading = ElLoading.service({
|
||||||
lock: true,
|
lock: true,
|
||||||
text: '正在生成导出数据...',
|
text: '正在生成导出数据...',
|
||||||
|
@ -19,26 +19,12 @@
|
|||||||
<template #label>
|
<template #label>
|
||||||
<span>
|
<span>
|
||||||
生成包路径
|
生成包路径
|
||||||
<el-tooltip content="生成在哪个包下,例如 gfast/app/system" placement="top">
|
<el-tooltip content="生成在哪个包下,例如 gfast/app/system,不可/结尾" placement="top">
|
||||||
<el-icon><ele-QuestionFilled /></el-icon>
|
<el-icon><ele-QuestionFilled /></el-icon>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<el-input v-model="info.packageName" />
|
<el-input v-model="info.packageName" @input="setModuleName"/>
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col class="mb20" :span="12">
|
|
||||||
<el-form-item prop="moduleName">
|
|
||||||
<template #label>
|
|
||||||
<span>
|
|
||||||
生成模块名
|
|
||||||
<el-tooltip content="可理解为子系统名,例如 system" placement="top">
|
|
||||||
<el-icon><ele-QuestionFilled /></el-icon>
|
|
||||||
</el-tooltip>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
<el-input v-model="info.moduleName" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
@ -135,6 +121,19 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col class="mb20" :span="8">
|
||||||
|
<el-form-item>
|
||||||
|
<template #label>
|
||||||
|
<span>
|
||||||
|
使用虚拟化树表
|
||||||
|
<el-tooltip content="如果该表数据量较大,请选择使用虚拟表,否则请勿选择,因为虚拟表会增加代码复杂度,后续如果修改所生成的页面会增加工作量" placement="top">
|
||||||
|
<el-icon><ele-QuestionFilled /></el-icon>
|
||||||
|
</el-tooltip>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<el-checkbox v-model="info.useVirtual" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
@ -156,12 +155,13 @@ import {defineComponent, inject, reactive, ref, unref} from 'vue';
|
|||||||
import type { FormInstance, FormRules } from 'element-plus';
|
import type { FormInstance, FormRules } from 'element-plus';
|
||||||
import { TableDataInfo } from '/@/views/system/tools/gen/component/model';
|
import { TableDataInfo } from '/@/views/system/tools/gen/component/model';
|
||||||
import {ElMessage} from "element-plus";
|
import {ElMessage} from "element-plus";
|
||||||
|
import {Ref, UnwrapRef} from "@vue/reactivity";
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'genInfoForm',
|
name: 'genInfoForm',
|
||||||
emits:['goNext','close'],
|
emits:['goNext','close'],
|
||||||
setup(props,{emit}) {
|
setup(props,{emit}) {
|
||||||
const genInfoFormRef = ref<FormInstance>();
|
const genInfoFormRef = ref<FormInstance>();
|
||||||
const info = inject<TableDataInfo>('tableData') as TableDataInfo;
|
const info = inject<Ref<UnwrapRef<TableDataInfo>>>('tableData') as Ref<UnwrapRef<TableDataInfo>>;
|
||||||
const rules = reactive<FormRules>({
|
const rules = reactive<FormRules>({
|
||||||
tplCategory: [{ required: true, message: '请选择生成模板', trigger: 'blur' }],
|
tplCategory: [{ required: true, message: '请选择生成模板', trigger: 'blur' }],
|
||||||
packageName: [{ required: true, message: '请输入生成包路径', trigger: 'blur' }],
|
packageName: [{ required: true, message: '请输入生成包路径', trigger: 'blur' }],
|
||||||
@ -186,11 +186,23 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
const close = ()=>{
|
const close = ()=>{
|
||||||
emit('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 {
|
return {
|
||||||
genInfoFormRef,
|
genInfoFormRef,
|
||||||
info,
|
info,
|
||||||
rules,
|
rules,
|
||||||
|
setModuleName,
|
||||||
nextTip,
|
nextTip,
|
||||||
close
|
close
|
||||||
};
|
};
|
||||||
|
@ -74,6 +74,7 @@ export interface TableDataInfo extends TableData{
|
|||||||
businessName:string;
|
businessName:string;
|
||||||
functionName:string;
|
functionName:string;
|
||||||
linkTableName:string;
|
linkTableName:string;
|
||||||
|
useVirtual:boolean;
|
||||||
columns:TableColumns[]
|
columns:TableColumns[]
|
||||||
}
|
}
|
||||||
export interface TableDataState {
|
export interface TableDataState {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user