Просмотр исходного кода

增加代码生成的字段支持排序

林海波 2 лет назад
Родитель
Сommit
73cc848ffd

+ 6 - 0
Admin.NET/Admin.NET.Core/Entity/SysCodeGenConfig.cs

@@ -167,4 +167,10 @@ public class SysCodeGenConfig : EntityBase
     [SugarColumn(ColumnDescription = "父级字段", Length = 128)]
     [MaxLength(128)]
     public string? PidColumn { get; set; }
+    
+    /// <summary>
+    /// 排序
+    /// </summary>
+    [SugarColumn(ColumnDescription = "排序",DefaultValue = "100")]
+    public int OrderNo { get; set; } = 100;
 }

+ 5 - 0
Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/CodeGenConfig.cs

@@ -166,4 +166,9 @@ public class CodeGenConfig
     /// 父级字段
     /// </summary>
     public string PidColumn { get; set; }
+
+    /// <summary>
+    /// 排序
+    /// </summary>
+    public int OrderNo { get; set; }
 }

+ 1 - 0
Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenConfigService.cs

@@ -38,6 +38,7 @@ public class SysCodeGenConfigService : IDynamicApiController, ITransient
             {
                 u.NetType = (u.EffectType == "EnumSelector" ? u.DictTypeCode : u.NetType);
             })
+            .OrderBy(u=>u.OrderNo)
             .ToListAsync();
     }
 

+ 6 - 1
Web/src/views/system/codeGen/component/genConfigDialog.vue

@@ -1,6 +1,6 @@
 <template>
 	<div class="sys-codeGenConfig-container">
-		<el-dialog v-model="state.isShowDialog" draggable :close-on-click-modal="false" width="1400px">
+		<el-dialog v-model="state.isShowDialog" draggable :close-on-click-modal="false" width="1500px">
 			<template #header>
 				<div style="color: #fff">
 					<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Edit /> </el-icon>
@@ -58,6 +58,11 @@
 						</el-select>
 					</template>
 				</el-table-column>
+				<el-table-column prop="orderNo" label="排序" width="70" show-overflow-tooltip>
+					<template #default="scope">
+						<el-input v-model="scope.row.orderNo" autocomplete="off" type="number"  />
+					</template>
+				</el-table-column>
 			</el-table>
 			<template #footer>
 				<span class="dialog-footer">