优化代码生成额外参数保存
This commit is contained in:
parent
3dc8acca1f
commit
11d48ef020
@ -9,15 +9,15 @@
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="字段信息" name="cloum">
|
||||
<el-table ref="dragTableRef" v-loading="loading" :data="columns" row-key="columnId" min-height="80px" :max-height="tableHeight">
|
||||
<el-table-column label="序号" type="index" class-name="allowDrag" fixed />
|
||||
<el-table-column label="字段列名" prop="columnName" :show-overflow-tooltip="true" fixed />
|
||||
<el-table-column label="字段描述" fixed>
|
||||
<el-table-column label="#" type="index" class-name="allowDrag" width="60" fixed />
|
||||
<el-table-column label="字段列名" prop="columnName" :show-overflow-tooltip="true" width="90" fixed />
|
||||
<el-table-column label="字段描述" fixed width="120">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.columnComment" :ref="setColumnsRef" @keydown="nextFocus(scope.row, scope.$index, $event)"> </el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物理类型" prop="columnType" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="C#类型">
|
||||
<el-table-column label="物理类型" prop="columnType" :show-overflow-tooltip="true" width="90" />
|
||||
<el-table-column label="C#类型" width="110">
|
||||
<template #default="scope">
|
||||
<el-select v-model="scope.row.csharpType">
|
||||
<el-option label="int" value="int" />
|
||||
@ -30,7 +30,7 @@
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="C#属性">
|
||||
<el-table-column label="C#属性" width="100">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.csharpField"></el-input>
|
||||
</template>
|
||||
@ -45,6 +45,13 @@
|
||||
<el-checkbox v-model="scope.row.isEdit" :disabled="scope.row.isPk || scope.row.isIncrement"></el-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="排序" width="60" align="center">
|
||||
<template #default="scope">
|
||||
<el-checkbox
|
||||
v-model="scope.row.isSort"
|
||||
:disabled="scope.row.htmlType == 'imageUpload' || scope.row.htmlType == 'fileUpload'"></el-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="列表" width="60" align="center">
|
||||
<template #default="scope">
|
||||
<el-checkbox v-model="scope.row.isList"></el-checkbox>
|
||||
@ -75,7 +82,7 @@
|
||||
<el-checkbox v-model="scope.row.isRequired"></el-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="表单显示类型" width="120">
|
||||
<el-table-column label="表单显示类型" width="140">
|
||||
<template #default="scope">
|
||||
<el-select v-model="scope.row.htmlType">
|
||||
<el-option label="文本框" value="input" />
|
||||
@ -92,7 +99,7 @@
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="字典类型" min-width="100">
|
||||
<el-table-column label="字典类型" min-width="140">
|
||||
<template #default="scope">
|
||||
<el-select
|
||||
v-model="scope.row.dictType"
|
||||
@ -155,7 +162,7 @@ function handleQuery() {
|
||||
getGenTable(tableId).then((res) => {
|
||||
loading.value = false
|
||||
columns.value = res.data.info.columns
|
||||
info.value = res.data.info
|
||||
info.value = { ...res.data.info, ...res.data.info.options }
|
||||
tables.value = res.data.tables // 子表
|
||||
})
|
||||
}
|
||||
@ -180,7 +187,7 @@ function submitForm() {
|
||||
parentMenuId: info.value.parentMenuId,
|
||||
sortField: info.value.sortField,
|
||||
sortType: info.value.sortType,
|
||||
checkedBtn: info.value.checkedBtn?.toString(),
|
||||
checkedBtn: info.value.checkedBtn,
|
||||
permissionPrefix: info.value.permissionPrefix,
|
||||
}
|
||||
console.log('genForm', genTable)
|
||||
|
||||
@ -87,8 +87,7 @@
|
||||
:props="{ checkStrictly: true, value: 'menuId', label: 'menuName', emitPath: false }"
|
||||
placeholder="请选择上级菜单"
|
||||
clearable
|
||||
v-model="info.parentMenuId"
|
||||
>
|
||||
v-model="info.parentMenuId">
|
||||
<template #default="{ node, data }">
|
||||
<span>{{ data.menuName }}</span>
|
||||
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
|
||||
@ -97,7 +96,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="查询排序字段">
|
||||
<el-form-item label="默认查询排序字段">
|
||||
<el-select v-model="info.sortField" placeholder="请选择字段" class="mr10" clearable="">
|
||||
<el-option v-for="item in columns" :key="item.columnId" :label="item.csharpField" :value="item.csharpField"> </el-option>
|
||||
</el-select>
|
||||
@ -164,6 +163,11 @@
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :lg="12">
|
||||
<el-form-item prop="vuePath" label="Vue路径">
|
||||
<el-input v-model="info.vuePath" placeholder="Vue项目所在绝对路径到项目根目录,eg:D:/ZRAdmin-vue"></el-input>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :lg="24" v-show="info.tplCategory != 'select'">
|
||||
<el-form-item label="显示按钮">
|
||||
<el-checkbox-group v-model="info.checkedBtn" @change="checkedBtnSelect">
|
||||
@ -201,8 +205,7 @@
|
||||
v-for="(column, index) in columns"
|
||||
:key="index"
|
||||
:label="column.csharpField + ':' + column.columnComment"
|
||||
:value="column.csharpField"
|
||||
></el-option>
|
||||
:value="column.csharpField"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -221,8 +224,7 @@
|
||||
v-for="(column, index) in columns"
|
||||
:key="index"
|
||||
:label="column.csharpField + ':' + column.columnComment"
|
||||
:value="column.csharpField"
|
||||
></el-option>
|
||||
:value="column.csharpField"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -241,8 +243,7 @@
|
||||
v-for="(column, index) in columns"
|
||||
:key="index"
|
||||
:label="column.csharpField + ':' + column.columnComment"
|
||||
:value="column.csharpField"
|
||||
></el-option>
|
||||
:value="column.csharpField"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -279,12 +280,7 @@
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<el-select v-model="info.subTableFkName">
|
||||
<el-option
|
||||
v-for="(column, index) in subColumns"
|
||||
:key="index"
|
||||
:label="column.csharpField"
|
||||
:value="column.csharpField"
|
||||
>
|
||||
<el-option v-for="(column, index) in subColumns" :key="index" :label="column.csharpField" :value="column.csharpField">
|
||||
<span style="float: left">{{ column.csharpField }}</span>
|
||||
<span style="float: right">{{ column.columnComment }}</span>
|
||||
</el-option>
|
||||
@ -301,7 +297,6 @@ import { queryColumnInfo } from '@/api/tool/gen'
|
||||
|
||||
const subColumns = ref([])
|
||||
const menuOptions = ref([])
|
||||
// const checkedBtn = ref([])
|
||||
|
||||
const props = defineProps({
|
||||
info: {
|
||||
@ -361,7 +356,6 @@ function setSubTableColumns(value) {
|
||||
for (var item in props.tables) {
|
||||
const obj = props.tables[item]
|
||||
if (value === obj.tableName) {
|
||||
// subColumns.value = props.tables[item].columns
|
||||
queryColumnInfo(obj.tableId).then((res) => {
|
||||
if (res.code == 200) {
|
||||
subColumns.value = res.data.columns
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user