代码生成新增加排序字段
This commit is contained in:
parent
5a03ce182b
commit
31b2681028
@ -101,7 +101,7 @@ namespace ZR.Admin.WebApi.Controllers
|
|||||||
{
|
{
|
||||||
var tableColumns = GenTableColumnService.GenTableColumns(tableId);
|
var tableColumns = GenTableColumnService.GenTableColumns(tableId);
|
||||||
var tableInfo = GenTableService.GetGenTableInfo(tableId);
|
var tableInfo = GenTableService.GetGenTableInfo(tableId);
|
||||||
return SUCCESS(new { result = tableColumns, info = tableInfo });
|
return SUCCESS(new { cloumns = tableColumns, info = tableInfo });
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -188,7 +188,12 @@ namespace ZR.Admin.WebApi.Controllers
|
|||||||
if (genTableDto == null) throw new CustomException("请求参数错误");
|
if (genTableDto == null) throw new CustomException("请求参数错误");
|
||||||
var genTable = genTableDto.Adapt<GenTable>().ToUpdate(HttpContext);
|
var genTable = genTableDto.Adapt<GenTable>().ToUpdate(HttpContext);
|
||||||
|
|
||||||
genTable.Options = JsonConvert.SerializeObject(new { parentMenuId = genTableDto.ParentMenuId });
|
genTable.Options = JsonConvert.SerializeObject(new
|
||||||
|
{
|
||||||
|
parentMenuId = genTableDto.ParentMenuId,
|
||||||
|
sortField = genTableDto.SortField,
|
||||||
|
sortType = genTable.SortType
|
||||||
|
});
|
||||||
int rows = GenTableService.UpdateGenTable(genTable);
|
int rows = GenTableService.UpdateGenTable(genTable);
|
||||||
if (rows > 0)
|
if (rows > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -7,19 +7,19 @@ SELECT @menuId := LAST_INSERT_ID();
|
|||||||
|
|
||||||
|
|
||||||
INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_time)
|
INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_time)
|
||||||
VALUES ('${genTable.functionName}查询', @menuId, 1, '#', NULL, 0, 0, 'F', '0', '0', '${replaceDto.PermissionPrefix}:query', '', sysdate());
|
VALUES ('查询', @menuId, 1, '#', NULL, 0, 0, 'F', '0', '0', '${replaceDto.PermissionPrefix}:query', '', sysdate());
|
||||||
|
|
||||||
INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_time)
|
INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_time)
|
||||||
VALUES ('${genTable.functionName}新增', @menuId, 2, '#', NULL, 0, 0, 'F', '0', '0', '${replaceDto.PermissionPrefix}:add', '', sysdate());
|
VALUES ('新增', @menuId, 2, '#', NULL, 0, 0, 'F', '0', '0', '${replaceDto.PermissionPrefix}:add', '', sysdate());
|
||||||
|
|
||||||
INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_time)
|
INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_time)
|
||||||
VALUES ('${genTable.functionName}删除', @menuId, 3, '#', NULL, 0, 0, 'F', '0', '0', '${replaceDto.PermissionPrefix}:delete', '', sysdate());
|
VALUES ('删除', @menuId, 3, '#', NULL, 0, 0, 'F', '0', '0', '${replaceDto.PermissionPrefix}:delete', '', sysdate());
|
||||||
|
|
||||||
INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_time)
|
INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_time)
|
||||||
VALUES ('${genTable.functionName}修改', @menuId, 4, '#', NULL, 0, 0, 'F', '0', '0', '${replaceDto.PermissionPrefix}:update', '', sysdate());
|
VALUES ('修改', @menuId, 4, '#', NULL, 0, 0, 'F', '0', '0', '${replaceDto.PermissionPrefix}:update', '', sysdate());
|
||||||
|
|
||||||
INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_time)
|
INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_time)
|
||||||
VALUES ('${genTable.functionName}导出', @menuId, 5, '#', NULL, 0, 0, 'F', '0', '0', '${replaceDto.PermissionPrefix}:export', '', sysdate());
|
VALUES ('导出', @menuId, 5, '#', NULL, 0, 0, 'F', '0', '0', '${replaceDto.PermissionPrefix}:export', '', sysdate());
|
||||||
|
|
||||||
SELECT * FROM sys_menu WHERE parentId = @menuId;
|
SELECT * FROM sys_menu WHERE parentId = @menuId;
|
||||||
SELECT * FROM sys_menu WHERE menuId = @menuId;
|
SELECT * FROM sys_menu WHERE menuId = @menuId;
|
||||||
@ -7,19 +7,19 @@ declare @menuId int = @@identity
|
|||||||
|
|
||||||
|
|
||||||
INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time)
|
INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time)
|
||||||
VALUES ('${genTable.functionName}查询', @menuId, 1, '#', NULL, 0, 0, 'F', '0', '0', '${replaceDto.PermissionPrefix}:query', '', '', GETDATE());
|
VALUES ('查询', @menuId, 1, '#', NULL, 0, 0, 'F', '0', '0', '${replaceDto.PermissionPrefix}:query', '', '', GETDATE());
|
||||||
|
|
||||||
INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time)
|
INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time)
|
||||||
VALUES ('${genTable.functionName}新增', @menuId, 2, '#', NULL, 0, 0, 'F', '0', '0', '${replaceDto.PermissionPrefix}:add', '', '', GETDATE());
|
VALUES ('新增', @menuId, 2, '#', NULL, 0, 0, 'F', '0', '0', '${replaceDto.PermissionPrefix}:add', '', '', GETDATE());
|
||||||
|
|
||||||
INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time)
|
INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time)
|
||||||
VALUES ('${genTable.functionName}删除', @menuId, 3, '#', NULL, 0, 0, 'F', '0', '0', '${replaceDto.PermissionPrefix}:delete', '', '', GETDATE());
|
VALUES ('删除', @menuId, 3, '#', NULL, 0, 0, 'F', '0', '0', '${replaceDto.PermissionPrefix}:delete', '', '', GETDATE());
|
||||||
|
|
||||||
INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time)
|
INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time)
|
||||||
VALUES ('${genTable.functionName}修改', @menuId, 4, '#', NULL, 0, 0, 'F', '0', '0', '${replaceDto.PermissionPrefix}:update', '', '', GETDATE());
|
VALUES ('修改', @menuId, 4, '#', NULL, 0, 0, 'F', '0', '0', '${replaceDto.PermissionPrefix}:update', '', '', GETDATE());
|
||||||
|
|
||||||
INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time)
|
INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by,create_time)
|
||||||
VALUES ('${genTable.functionName}导出', @menuId, 5, '#', NULL, 0, 0, 'F', '0', '0', '${replaceDto.PermissionPrefix}:export', '', '', GETDATE());
|
VALUES ('导出', @menuId, 5, '#', NULL, 0, 0, 'F', '0', '0', '${replaceDto.PermissionPrefix}:export', '', '', GETDATE());
|
||||||
|
|
||||||
SELECT * FROM sys_menu WHERE parentId = @menuId;
|
SELECT * FROM sys_menu WHERE parentId = @menuId;
|
||||||
SELECT * FROM sys_menu WHERE menuId = @menuId;
|
SELECT * FROM sys_menu WHERE menuId = @menuId;
|
||||||
@ -50,11 +50,14 @@ namespace ${options.ApiControllerNamespace}.Controllers
|
|||||||
//开始拼装查询条件
|
//开始拼装查询条件
|
||||||
var predicate = Expressionable.Create<${replaceDto.ModelTypeName}>();
|
var predicate = Expressionable.Create<${replaceDto.ModelTypeName}>();
|
||||||
|
|
||||||
//TODO 自己实现搜索条件查询语法参考Sqlsugar,默认查询所有
|
//搜索条件查询语法参考Sqlsugar
|
||||||
//predicate = predicate.And(m => m.Name.Contains(parm.Name));
|
//predicate = predicate.And(m => m.Name.Contains(parm.Name));
|
||||||
${QueryCondition}
|
${QueryCondition}
|
||||||
|
$if(genTable.SortField != "")
|
||||||
|
var response = _${replaceDto.ModelTypeName}Service.GetPages(predicate.ToExpression(), parm, x => x.${genTable.SortField}, "${genTable.SortType}");
|
||||||
|
$else
|
||||||
var response = _${replaceDto.ModelTypeName}Service.GetPages(predicate.ToExpression(), parm);
|
var response = _${replaceDto.ModelTypeName}Service.GetPages(predicate.ToExpression(), parm);
|
||||||
|
$end
|
||||||
return SUCCESS(response);
|
return SUCCESS(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -25,6 +25,8 @@ namespace ZR.Model.System.Dto
|
|||||||
/// 上级菜单id
|
/// 上级菜单id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? ParentMenuId { get; set; }
|
public int? ParentMenuId { get; set; }
|
||||||
|
public string SortField { get; set; }
|
||||||
|
public string SortType { get; set; }
|
||||||
public List<GenTableColumnDto> Columns { get; set; }
|
public List<GenTableColumnDto> Columns { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -73,8 +73,14 @@ namespace ZR.Model.System.Generate
|
|||||||
/** 表列信息 */
|
/** 表列信息 */
|
||||||
[SqlSugar.SugarColumn(IsIgnore = true)]
|
[SqlSugar.SugarColumn(IsIgnore = true)]
|
||||||
public List<GenTableColumn> Columns { get; set; }
|
public List<GenTableColumn> Columns { get; set; }
|
||||||
|
|
||||||
|
//以下 Options扩展字段
|
||||||
[SqlSugar.SugarColumn(IsIgnore = true)]
|
[SqlSugar.SugarColumn(IsIgnore = true)]
|
||||||
public string ParentMenuId { get; set; }
|
public object ParentMenuId { get; set; }
|
||||||
|
[SqlSugar.SugarColumn(IsIgnore = true)]
|
||||||
|
public object SortType { get; set; } = "asc";
|
||||||
|
[SqlSugar.SugarColumn(IsIgnore = true)]
|
||||||
|
public object SortField { get; set; } = "";
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -330,6 +330,10 @@ namespace ZR.Service
|
|||||||
{
|
{
|
||||||
return baseRepository.GetPages(where, parm, order, orderEnum);
|
return baseRepository.GetPages(where, parm, order, orderEnum);
|
||||||
}
|
}
|
||||||
|
public PagedInfo<T> GetPages(Expression<Func<T, bool>> where, PagerInfo parm, Expression<Func<T, object>> order, string orderByType)
|
||||||
|
{
|
||||||
|
return baseRepository.GetPages(where, parm, order, orderByType == "desc" ? OrderByType.Desc : OrderByType.Asc);
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查询所有数据(无分页,请慎用)
|
/// 查询所有数据(无分页,请慎用)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -99,7 +99,7 @@ namespace ZR.Service
|
|||||||
PagedInfo<T> GetPages(Expression<Func<T, bool>> where, PagerInfo parm);
|
PagedInfo<T> GetPages(Expression<Func<T, bool>> where, PagerInfo parm);
|
||||||
|
|
||||||
PagedInfo<T> GetPages(Expression<Func<T, bool>> where, PagerInfo parm, Expression<Func<T, object>> order, OrderByType orderEnum = OrderByType.Asc);
|
PagedInfo<T> GetPages(Expression<Func<T, bool>> where, PagerInfo parm, Expression<Func<T, object>> order, OrderByType orderEnum = OrderByType.Asc);
|
||||||
|
PagedInfo<T> GetPages(Expression<Func<T, bool>> where, PagerInfo parm, Expression<Func<T, object>> order, string orderType);
|
||||||
bool Any(Expression<Func<T, bool>> expression);
|
bool Any(Expression<Func<T, bool>> expression);
|
||||||
|
|
||||||
ISugarQueryable<T> Queryable();
|
ISugarQueryable<T> Queryable();
|
||||||
|
|||||||
@ -70,7 +70,9 @@ namespace ZR.Service.System
|
|||||||
if (!string.IsNullOrEmpty(genTable?.Options))
|
if (!string.IsNullOrEmpty(genTable?.Options))
|
||||||
{
|
{
|
||||||
Dictionary<string, object> options = JsonConvert.DeserializeObject<Dictionary<string, object>>(genTable.Options);
|
Dictionary<string, object> options = JsonConvert.DeserializeObject<Dictionary<string, object>>(genTable.Options);
|
||||||
genTable.ParentMenuId = Convert.ToString(options.GetValueOrDefault("parentMenuId"));
|
genTable.ParentMenuId = options.GetValueOrDefault("parentMenuId") ?? null;
|
||||||
|
genTable.SortType = options.GetValueOrDefault("sortType") ?? "asc";
|
||||||
|
genTable.SortField = options.GetValueOrDefault("sortField") ?? null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -10,6 +10,6 @@ namespace ZR.Service.System.IService
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
//public int AddTaskLog(string jobId);
|
//public int AddTaskLog(string jobId);
|
||||||
public SysTasksLog AddTaskLog(string jobId, SysTasksLog tasksLog);
|
SysTasksLog AddTaskLog(string jobId, SysTasksLog tasksLog);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
using Infrastructure.Attribute;
|
using Infrastructure.Attribute;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Linq.Expressions;
|
||||||
|
using ZR.Model;
|
||||||
using ZR.Model.System;
|
using ZR.Model.System;
|
||||||
using ZR.Repository;
|
using ZR.Repository;
|
||||||
using ZR.Service.System.IService;
|
using ZR.Service.System.IService;
|
||||||
@ -34,5 +36,10 @@ namespace ZR.Service.System
|
|||||||
Add(logModel);
|
Add(logModel);
|
||||||
return logModel;
|
return logModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PagedInfo<SysTasksLog> GetPages(Expression<Func<SysTasksLog, bool>> where, PagerInfo parm, Expression<Func<SysTasksLog, object>> order, string orderType)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -109,18 +109,15 @@
|
|||||||
<span>更新日志</span>
|
<span>更新日志</span>
|
||||||
</div>
|
</div>
|
||||||
<el-collapse accordion>
|
<el-collapse accordion>
|
||||||
<el-collapse-item title="v3.7.1 - 2021-12-01">
|
<el-collapse-item title="v3.7.0 - 2021-12-01">
|
||||||
<ol>
|
<ol>
|
||||||
|
<li>代码生成新增加排序字段</li>
|
||||||
<li>新增加登录验证码开关</li>
|
<li>新增加登录验证码开关</li>
|
||||||
<li>替换代码生成器模板引擎</li>
|
<li>替换代码生成器模板引擎</li>
|
||||||
<li>富文本组件Editor改用全局注册</li>
|
<li>富文本组件Editor改用全局注册</li>
|
||||||
<li>新增加上传文件到阿里云</li>
|
<li>新增加上传文件到阿里云</li>
|
||||||
<li>fix gen_table_column表表名字段长度不够</li>
|
<li>fix gen_table_column表表名字段长度不够</li>
|
||||||
<li>其他功能优化</li>
|
<li>代码生成新增排序字段</li>
|
||||||
</ol>
|
|
||||||
</el-collapse-item>
|
|
||||||
<el-collapse-item title="v3.7.0 - 2021-11-28">
|
|
||||||
<ol>
|
|
||||||
<li>fix 代码生成编辑表信息选择上级菜单bug</li>
|
<li>fix 代码生成编辑表信息选择上级菜单bug</li>
|
||||||
<li>新增下拉框组件代码生成查询模块</li>
|
<li>新增下拉框组件代码生成查询模块</li>
|
||||||
<li>优化代码生成模板</li>
|
<li>优化代码生成模板</li>
|
||||||
@ -130,6 +127,7 @@
|
|||||||
<li>代码生成查询新增一键生成、可支持input、select、时间</li>
|
<li>代码生成查询新增一键生成、可支持input、select、时间</li>
|
||||||
<li>修改代码生成数据库连接字符串</li>
|
<li>修改代码生成数据库连接字符串</li>
|
||||||
<li>优化数据仓储</li>
|
<li>优化数据仓储</li>
|
||||||
|
<li>其他功能优化</li>
|
||||||
</ol>
|
</ol>
|
||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
<el-collapse-item title="v3.6.0 - 2021-11-21">
|
<el-collapse-item title="v3.6.0 - 2021-11-21">
|
||||||
@ -178,7 +176,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const defaultSettings = require('@/settings.js')
|
const defaultSettings = require("@/settings.js");
|
||||||
export default {
|
export default {
|
||||||
name: "index",
|
name: "index",
|
||||||
data() {
|
data() {
|
||||||
|
|||||||
@ -101,7 +101,7 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="生成信息" name="genInfo">
|
<el-tab-pane label="生成信息" name="genInfo">
|
||||||
<gen-info-form ref="genInfo" :info="info" :tables="tables" :menus="menus" />
|
<gen-info-form ref="genInfo" :info="info" :tables="tables" :menus="menus" :columns="cloumns"/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<el-form label-width="100px">
|
<el-form label-width="100px">
|
||||||
@ -155,9 +155,9 @@ export default {
|
|||||||
if (tableId) {
|
if (tableId) {
|
||||||
// 获取表详细信息
|
// 获取表详细信息
|
||||||
queryColumnInfo(tableId).then((res) => {
|
queryColumnInfo(tableId).then((res) => {
|
||||||
this.cloumns = res.data.result;
|
this.cloumns = res.data.cloumns;
|
||||||
this.info = res.data.info;
|
this.info = res.data.info;
|
||||||
this.tables = res.data.tables;
|
// this.tables = res.data.tables;/子表
|
||||||
});
|
});
|
||||||
/** 查询字典下拉列表 */
|
/** 查询字典下拉列表 */
|
||||||
listType().then((response) => {
|
listType().then((response) => {
|
||||||
|
|||||||
@ -68,7 +68,23 @@
|
|||||||
<i class="el-icon-question"></i>
|
<i class="el-icon-question"></i>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</span>
|
</span>
|
||||||
<treeselect :append-to-body="true" v-model="info.parentMenuId" :options="menus" :normalizer="normalizer" :show-count="true" placeholder="请选择系统菜单" />
|
<treeselect :append-to-body="true" v-model="info.parentMenuId" :options="menus" :normalizer="normalizer" :show-count="true"
|
||||||
|
placeholder="请选择系统菜单" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item>
|
||||||
|
<span slot="label">
|
||||||
|
排序字段
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<el-select v-model="info.sortField" placeholder="请选择字段" class="mr10">
|
||||||
|
<el-option v-for="item in columns" :key="item.columnId" :label="item.csharpField" :value="item.csharpField">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
|
||||||
|
<el-radio v-model="info.sortType" label="asc">正序</el-radio>
|
||||||
|
<el-radio v-model="info.sortType" label="desc">倒序</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
@ -119,7 +135,8 @@
|
|||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</span>
|
</span>
|
||||||
<el-select v-model="info.treeCode" placeholder="请选择">
|
<el-select v-model="info.treeCode" placeholder="请选择">
|
||||||
<el-option v-for="(column, index) in info.columns" :key="index" :label="column.columnName + ':' + column.columnComment" :value="column.columnName"></el-option>
|
<el-option v-for="(column, index) in info.columns" :key="index" :label="column.columnName + ':' + column.columnComment"
|
||||||
|
:value="column.columnName"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -132,7 +149,8 @@
|
|||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</span>
|
</span>
|
||||||
<el-select v-model="info.treeParentCode" placeholder="请选择">
|
<el-select v-model="info.treeParentCode" placeholder="请选择">
|
||||||
<el-option v-for="(column, index) in info.columns" :key="index" :label="column.columnName + ':' + column.columnComment" :value="column.columnName"></el-option>
|
<el-option v-for="(column, index) in info.columns" :key="index" :label="column.columnName + ':' + column.columnComment"
|
||||||
|
:value="column.columnName"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -145,7 +163,8 @@
|
|||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</span>
|
</span>
|
||||||
<el-select v-model="info.treeName" placeholder="请选择">
|
<el-select v-model="info.treeName" placeholder="请选择">
|
||||||
<el-option v-for="(column, index) in info.columns" :key="index" :label="column.columnName + ':' + column.columnComment" :value="column.columnName"></el-option>
|
<el-option v-for="(column, index) in info.columns" :key="index" :label="column.columnName + ':' + column.columnComment"
|
||||||
|
:value="column.columnName"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -161,7 +180,8 @@
|
|||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</span>
|
</span>
|
||||||
<el-select v-model="info.subTableName" placeholder="请选择" @change="subSelectChange">
|
<el-select v-model="info.subTableName" placeholder="请选择" @change="subSelectChange">
|
||||||
<el-option v-for="(table, index) in tables" :key="index" :label="table.tableName + ':' + table.tableComment" :value="table.tableName"></el-option>
|
<el-option v-for="(table, index) in tables" :key="index" :label="table.tableName + ':' + table.tableComment" :value="table.tableName">
|
||||||
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -174,7 +194,8 @@
|
|||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</span>
|
</span>
|
||||||
<el-select v-model="info.subTableFkName" placeholder="请选择">
|
<el-select v-model="info.subTableFkName" placeholder="请选择">
|
||||||
<el-option v-for="(column, index) in subColumns" :key="index" :label="column.columnName + ':' + column.columnComment" :value="column.columnName"></el-option>
|
<el-option v-for="(column, index) in subColumns" :key="index" :label="column.columnName + ':' + column.columnComment"
|
||||||
|
:value="column.columnName"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -193,6 +214,7 @@ export default {
|
|||||||
type: Object,
|
type: Object,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
// 字表
|
||||||
tables: {
|
tables: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: null,
|
default: null,
|
||||||
@ -201,6 +223,11 @@ export default {
|
|||||||
type: Array,
|
type: Array,
|
||||||
default: [],
|
default: [],
|
||||||
},
|
},
|
||||||
|
// 列
|
||||||
|
columns: {
|
||||||
|
type: Array,
|
||||||
|
default: [],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -221,7 +248,9 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {},
|
created() {
|
||||||
|
console.log(this.columns);
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
"info.subTableName": function (val) {
|
"info.subTableName": function (val) {
|
||||||
this.setSubTableColumns(val);
|
this.setSubTableColumns(val);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user