代码生成:支持树形表结构的配置

This commit is contained in:
YunaiV 2023-11-16 00:11:23 +08:00
parent 40b1522ed0
commit 3d0c4f4422

View File

@ -182,50 +182,33 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row v-show="formData.tplCategory === 'tree'"> <!-- 树表信息 -->
<h4 class="form-header">其他信息</h4> <el-row v-show="formData.templateType == 2">
<el-col :span="12"> <el-col :span="24">
<el-form-item> <h4 class="form-header">树表信息</h4>
<template #label>
<span>
树编码字段
<el-tooltip content="树显示的编码字段名, 如dept_id" placement="top">
<Icon icon="ep:question-filled" />
</el-tooltip>
</span>
</template>
<el-select v-model="formData.treeCode" placeholder="请选择">
<el-option
v-for="(column, index) in formData.columns"
:key="index"
:label="column.columnName + '' + column.columnComment"
:value="column.columnName"
/>
</el-select>
</el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item> <el-form-item prop="treeParentColumnId">
<template #label> <template #label>
<span> <span>
树父编码字段 父编号字段
<el-tooltip content="树显示的父编码字段名, 如parent_Id" placement="top"> <el-tooltip content="树显示的父编码字段名, 如parent_Id" placement="top">
<Icon icon="ep:question-filled" /> <Icon icon="ep:question-filled" />
</el-tooltip> </el-tooltip>
</span> </span>
</template> </template>
<el-select v-model="formData.treeParentCode" placeholder="请选择"> <el-select v-model="formData.treeParentColumnId" placeholder="请选择">
<el-option <el-option
v-for="(column, index) in formData.columns" v-for="(column, index) in props.columns"
:key="index" :key="index"
:label="column.columnName + '' + column.columnComment" :label="column.columnName + '' + column.columnComment"
:value="column.columnName" :value="column.id"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item> <el-form-item prop="treeNameColumnId">
<template #label> <template #label>
<span> <span>
树名称字段 树名称字段
@ -234,13 +217,12 @@
</el-tooltip> </el-tooltip>
</span> </span>
</template> </template>
<el-select v-model="formData.treeNameColumnId" placeholder="请选择">
<el-select v-model="formData.treeName" placeholder="请选择">
<el-option <el-option
v-for="(column, index) in formData.columns" v-for="(column, index) in props.columns"
:key="index" :key="index"
:label="column.columnName + '' + column.columnComment" :label="column.columnName + '' + column.columnComment"
:value="column.columnName" :value="column.id"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -248,7 +230,7 @@
</el-row> </el-row>
<!-- 主表信息 --> <!-- 主表信息 -->
<el-row v-if="formData.templateType === 15"> <el-row v-if="formData.templateType == 15">
<el-col :span="24"> <el-col :span="24">
<h4 class="form-header">主表信息</h4> <h4 class="form-header">主表信息</h4>
</el-col> </el-col>
@ -343,14 +325,12 @@ const formData = ref({
classComment: '', classComment: '',
parentMenuId: null, parentMenuId: null,
genPath: '', genPath: '',
treeCode: '',
treeParentCode: '',
treeName: '',
tplCategory: '',
genType: '', genType: '',
masterTableId: undefined, masterTableId: undefined,
subJoinColumnId: undefined, subJoinColumnId: undefined,
subJoinMany: undefined subJoinMany: undefined,
treeParentColumnId: undefined,
treeNameColumnId: undefined
}) })
const rules = reactive({ const rules = reactive({
@ -364,7 +344,9 @@ const rules = reactive({
classComment: [required], classComment: [required],
masterTableId: [required], masterTableId: [required],
subJoinColumnId: [required], subJoinColumnId: [required],
subJoinMany: [required] subJoinMany: [required],
treeParentColumnId: [required],
treeNameColumnId: [required]
}) })
const tables = ref([]) // const tables = ref([]) //