CzRger před 8 měsíci
rodič
revize
c1e44848e5

+ 21 - 0
snowy-admin-web/src/views/gen/index.vue

@@ -27,6 +27,9 @@
 				<template v-if="column.dataIndex === 'generateType'">
 					{{ generateTypeFilter(record.generateType) }}
 				</template>
+				<template v-if="column.dataIndex === 'formMode'">
+					{{ formModeFilter(record.formMode) }}
+				</template>
 				<template v-if="column.dataIndex === 'action'">
 					<a @click="genPreviewRef.onOpen(record)">预览</a>
 					<a-divider type="vertical" />
@@ -96,6 +99,11 @@
 			ellipsis: true
 		},
 		{
+			title: '表单模式',
+			dataIndex: 'formMode',
+			ellipsis: true
+		},
+		{
 			title: '操作',
 			dataIndex: 'action',
 			align: 'center',
@@ -136,6 +144,19 @@
 		]
 		return array.find((f) => f.value === text).label
 	}
+	const formModeFilter = (text) => {
+		const array = [
+			{
+				label: '弹窗',
+				value: 'dialog'
+			},
+			{
+				label: '内嵌',
+				value: 'inside'
+			}
+		]
+		return array.find((f) => f.value === text)?.label || text
+	}
 	const tablePrefixFilter = (text) => {
 		const array = [
 			{

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

@@ -108,4 +108,9 @@ public class GenBasicAddParam {
     /** 包名 */
     @Schema(description = "包名", requiredMode = Schema.RequiredMode.REQUIRED)
     private String packageName;
+
+    /** 表单模式 */
+    @Schema(description = "表单模式", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotNull(message = "formMode不能为空")
+    private String formMode;
 }

+ 6 - 1
snowy-plugin/snowy-plugin-gen/src/main/java/vip/xiaonuo/gen/modular/basic/param/GenBasicEditParam.java

@@ -112,6 +112,11 @@ public class GenBasicEditParam {
     private String authorName;
 
     /** 包名 */
-    @Schema(description = "包名 */", requiredMode = Schema.RequiredMode.REQUIRED)
+    @Schema(description = "包名", requiredMode = Schema.RequiredMode.REQUIRED)
     private String packageName;
+
+    /** 表单模式 */
+    @Schema(description = "表单模式", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotNull(message = "formMode不能为空")
+    private String formMode;
 }

+ 8 - 2
snowy-plugin/snowy-plugin-gen/src/main/resources/frontend/detail.vue.btl

@@ -1,12 +1,18 @@
 <template>
     <a-card :bordered="false">
 		<a-page-header
-			:title="formData.${configList[i].fieldNameCamelCase} ? '编辑${functionName}' : '增加${functionName}'"
+			<% for(var i = 0; i < configList.~size; i++) { %>
+            <% if(configList[i].needTableId) { %>
+            :title="formData.${configList[i].fieldNameCamelCase} ? '编辑${functionName}' : '增加${functionName}'"
+            <% } %>
+            <% } %>
 			@back="onClose"
 		>
 			<template #extra>
 				<a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
-				<a-button type="primary" @click="onSubmit" :loading="submitLoading">保存</a-button>
+				<a-popconfirm title="请确认是否保存?" @confirm="onSubmit">
+                    <a-button type="primary" :loading="submitLoading">保存</a-button>
+                </a-popconfirm>
 			</template>
 		</a-page-header>
 		<a-form ref="formRef" :model="formData" :rules="formRules" layout="${formLayout}">

+ 3 - 1
snowy-plugin/snowy-plugin-gen/src/main/resources/frontend/form.vue.btl

@@ -83,7 +83,9 @@
 		</a-form>
 		<template #footer>
 			<a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
-			<a-button type="primary" @click="onSubmit" :loading="submitLoading">保存</a-button>
+			<a-popconfirm title="请确认是否保存?" @confirm="onSubmit">
+                <a-button type="primary" :loading="submitLoading">保存</a-button>
+            </a-popconfirm>
 		</template>
 	</xn-form-container>
 </template>