瀏覽代碼

代码模板,列固定

CzRger 9 月之前
父節點
當前提交
cf98abc147

+ 14 - 0
snowy-admin-web/src/views/gen/config.vue

@@ -51,6 +51,13 @@
 				<template v-if="column.dataIndex === 'whetherSort'">
 					<a-checkbox v-model:checked="record.whetherSort" :disabled="!record.whetherTable" />
 				</template>
+				<template v-if="column.dataIndex === 'whetherFixed'">
+				  <a-radio-group v-model:value="record.whetherFixed" button-style="solid" size="small">
+            <a-radio-button :value="1">左</a-radio-button>
+            <a-radio-button :value="0">默认</a-radio-button>
+            <a-radio-button :value="2">右</a-radio-button>
+				  </a-radio-group>
+				</template>
 				<template v-if="column.dataIndex === 'whetherAddUpdate'">
 					<a-checkbox v-model:checked="record.whetherAddUpdate" :disabled="toFieldEstimate(record)" />
 				</template>
@@ -144,6 +151,12 @@
 			width: 80
 		},
 		{
+			title: '列固定',
+			align: 'center',
+			dataIndex: 'whetherFixed',
+			width: 140
+		},
+		{
 			title: '增改',
 			align: 'center',
 			dataIndex: 'whetherAddUpdate',
@@ -387,6 +400,7 @@
 			record.whetherTable = false
 			record.whetherRetract = false
 			record.whetherSort = false
+			record.whetherFixed = 0
 			record.queryWhether = 'N'
 			record.queryType = null
 		}

+ 3 - 0
snowy-plugin/snowy-plugin-gen/src/main/java/vip/xiaonuo/gen/modular/basic/service/impl/GenBasicServiceImpl.java

@@ -244,6 +244,7 @@ public class GenBasicServiceImpl extends ServiceImpl<GenBasicMapper, GenBasic> i
             }
             addParam.setWhetherRetract(GenYesNoEnum.N.getValue());
             addParam.setWhetherSort(GenYesNoEnum.N.getValue());
+            addParam.setWhetherFixed(0);
             addParam.setWhetherRequired(GenYesNoEnum.N.getValue());
             addParam.setQueryWhether(GenYesNoEnum.N.getValue());
             addParam.setSortCode(i);
@@ -725,6 +726,8 @@ public class GenBasicServiceImpl extends ServiceImpl<GenBasicMapper, GenBasic> i
                     configItem.set("whetherRetract", genConfig.getWhetherRetract().equalsIgnoreCase(GenYesNoEnum.Y.getValue()));
                     // 列排序
                     configItem.set("whetherSort", genConfig.getWhetherSort().equalsIgnoreCase(GenYesNoEnum.Y.getValue()));
+                    // 列固定
+                    configItem.set("whetherFixed", genConfig.getWhetherFixed());
                     // 增改
                     configItem.set("whetherAddUpdate", genConfig.getWhetherAddUpdate().equalsIgnoreCase(GenYesNoEnum.Y.getValue()));
                     // 作用类型

+ 4 - 0
snowy-plugin/snowy-plugin-gen/src/main/java/vip/xiaonuo/gen/modular/config/entity/GenConfig.java

@@ -77,6 +77,10 @@ public class GenConfig extends CommonEntity {
     @Schema(description = "列排序")
     private String whetherSort;
 
+    /** 列固定 */
+    @Schema(description = "列固定")
+    private Integer whetherFixed;
+
     /** 增改 */
     @Schema(description = "增改")
     private String whetherAddUpdate;

+ 4 - 0
snowy-plugin/snowy-plugin-gen/src/main/java/vip/xiaonuo/gen/modular/config/param/GenConfigAddParam.java

@@ -76,6 +76,10 @@ public class GenConfigAddParam {
     @Schema(description = "列排序")
     private String whetherSort;
 
+    /** 列固定 */
+    @Schema(description = "列固定")
+    private Integer whetherFixed;
+
     /** 增改 */
     @Schema(description = "增改")
     private String whetherAddUpdate;

+ 5 - 0
snowy-plugin/snowy-plugin-gen/src/main/java/vip/xiaonuo/gen/modular/config/param/GenConfigEditParam.java

@@ -86,6 +86,11 @@ public class GenConfigEditParam {
     @NotBlank(message = "whetherSort不能为空")
     private String whetherSort;
 
+    /** 列省略 */
+    @Schema(description = "列固定", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotBlank(message = "whetherFixed不能为空")
+    private String whetherFixed;
+
     /** 增改 */
     @Schema(description = "增改", requiredMode = Schema.RequiredMode.REQUIRED)
     @NotBlank(message = "whetherAddUpdate不能为空")

+ 6 - 1
snowy-plugin/snowy-plugin-gen/src/main/resources/frontend/index.vue.btl

@@ -90,6 +90,7 @@
 			:tool-config="toolConfig"
 			:row-selection="options.rowSelection"
 			v-model:filterParam="filterParam"
+			:scroll="{ x: 2000 }"
 		>
 			<template #operator class="table-operator">
 				<a-space>
@@ -194,6 +195,9 @@
 			<% if(configList[i].whetherSort) { %>
                 sorter: true,
             <% } %>
+            <% if(configList[i].whetherFixed) { %>
+                fixed: ${configList[i].whetherFixed == 1 ? 'left' : 'right'},
+            <% } %>
 		},
 	<% } %>
 	<% } %>
@@ -204,7 +208,8 @@
 			title: '操作',
 			dataIndex: 'action',
 			align: 'center',
-			width: 150
+			width: 150,
+			fixed: 'right',
 		})
 	}
 	const selectedRowKeys = ref([])

+ 6 - 1
snowy-plugin/snowy-plugin-gen/src/main/resources/frontend/index_inside.vue.btl

@@ -90,6 +90,7 @@
 			:tool-config="toolConfig"
 			:row-selection="options.rowSelection"
 			v-model:filterParam="filterParam"
+			:scroll="{ x: 2000 }"
 		>
 			<template #operator class="table-operator">
 				<a-space>
@@ -195,6 +196,9 @@
             <% if(configList[i].whetherSort) { %>
                 sorter: true,
             <% } %>
+            <% if(configList[i].whetherFixed) { %>
+                fixed: ${configList[i].whetherFixed == 1 ? 'left' : 'right'},
+            <% } %>
 		},
 	<% } %>
 	<% } %>
@@ -205,7 +209,8 @@
 			title: '操作',
 			dataIndex: 'action',
 			align: 'center',
-			width: 150
+			width: 150,
+			fixed: 'right',
 		})
 	}
 	const selectedRowKeys = ref([])