{
method: 'get',
});
}
+#end
diff --git a/quick-boot-generate/src/main/resources/vm/vue/views/dataForm.vue.vm b/quick-boot-generate/src/main/resources/vm/vue/views/dataForm.vue.vm
index 25ab8d5334cfa9a3e15594bc6335b1c159aff00b..889e8c6d2e83eeea7466dbe4fc0f6e7a56ba9165 100644
--- a/quick-boot-generate/src/main/resources/vm/vue/views/dataForm.vue.vm
+++ b/quick-boot-generate/src/main/resources/vm/vue/views/dataForm.vue.vm
@@ -1,8 +1,8 @@
-
+
-
+
-
+
#foreach($column in ${columnList})
#if(${column.isForm})
@@ -21,7 +21,7 @@
- 取消
+ 取消
提交
@@ -34,17 +34,16 @@ import {reactive} from "vue";
import {isNull} from "~/framwork/object";
import {save${table.entity}, update${table.entity}} from "~/api/${table.module}/${table.business}";
import {Result} from "~/framwork/request";
-import {errorTip, isSuccess, successTip} from "~/framwork/global";
+import {isSuccess, successTip} from "~/framwork/global";
const props = defineProps({
- visible: Boolean,
title: String,
form: Object,
- close: Function,
});
-const emits = defineEmits(['ok', 'reset']);
+const emits = defineEmits(['ok', 'close']);
const formRules: FormRules = reactive({
#foreach($column in ${columnList})
+ #if(!${column.isPk} && !${column.isLogicDelete})
#if(${column.htmlType} == 'input')
#if(!${column.isRequired})//#end ${column.javaField}: [{required: true, trigger: ['blur', 'change'], message: "请输入${column.columnComment}"}],
#end
@@ -52,46 +51,36 @@ const formRules: FormRules = reactive({
#if(!${column.isRequired})//#end ${column.javaField}: [{required: true, trigger: ['blur', 'change'], message: "请选择${column.columnComment}"}],
#end
#end
+ #end
});
const formRef = ref();
-/** 重置 */
-const resetFields = () => {
- formRef.value && formRef.value.resetFields();
-}
-
-/** 事件 */
-const commonBack = () => {
- emits('ok');
- emits('reset');
- resetFields();
+/** 关闭 */
+const handleClose = () => {
+ emits('close');
}
/** 点击提交 */
const onSubmit = async () => {
- try {
- const valid: boolean = formRef.value ? await formRef.value.validate() : false;
- if (valid === true) {
- if (isNull(props.form!.id)) {
- const res: Result = await save${table.entity}(props.form);
- if (isSuccess(res)) {
- successTip(res.msg);
- commonBack();
- } else {
- errorTip(res.msg);
- }
+ const valid: boolean = formRef.value ? await formRef.value.validate() : false;
+ if (valid) {
+ if (isNull(props.form!.${table.pkJavaField})) {
+ const res: Result = await save${table.entity}(props.form);
+ if (isSuccess(res)) {
+ successTip(res.msg);
+ emits('ok');
+ } else {
+ emits('close');
+ }
+ } else {
+ const res: Result = await update${table.entity}(props.form);
+ if (isSuccess(res)) {
+ successTip(res.msg);
+ emits('ok');
} else {
- const res: Result = await update${table.entity}(props.form);
- if (isSuccess(res)) {
- successTip(res.msg);
- commonBack();
- } else {
- errorTip(res.msg);
- }
+ emits('close');
}
}
- } catch (error) {
- console.log(error);
}
}
diff --git a/quick-boot-generate/src/main/resources/vm/vue/views/index.vue.vm b/quick-boot-generate/src/main/resources/vm/vue/views/index.vue.vm
index c558bf1b0b934e21f7c9d0eddc0be9458bdf617c..28d68c61ff91baee9e03b3e36264b299ee811c97 100644
--- a/quick-boot-generate/src/main/resources/vm/vue/views/index.vue.vm
+++ b/quick-boot-generate/src/main/resources/vm/vue/views/index.vue.vm
@@ -4,7 +4,7 @@
#foreach($column in ${columnList})
#if(${column.isQuery})
-
+ 3)v-if="data.searchOpen"#end label="${column.columnComment}" prop="${column.javaField}">
#if(${column.htmlType} == 'input')
#end
@@ -14,12 +14,11 @@
#end
- #end
- #end
+ #if($velocityCount == 3)
查询
重置
-
+
收起
@@ -28,16 +27,27 @@
+ #end
+ #end
+ #end
+ #if(${table.isSave})
新增
- 导出
- 批量删除
+ #end
+ #if(${table.isImport})
+ 导入
+ #end
+ #if(${table.isExport})
+ 导出
+ #end
+ #if(${table.isRemoveBatch})
+ 批量删除
+ #end
-
+
-
#foreach($column in ${columnList})
#if(${column.isTable})
@@ -45,47 +55,81 @@
#end
- 修改
- 删除
+ #if(${table.isUpdate})
+ 编辑
+ #end
+ #if(${table.isRemove})
+ 删除
+ #end
-
+
+
+ #if(${table.isSave} || ${table.isUpdate})
+
+ v-if="data.visible"
+ :title="data.title"
+ :form="data.form"
+ @ok="handleClose"
+ @close="data.visible = false"/>
+ #end
+
+ #if(${table.isImport})
+
+
+
+
+
+
+ 将文件拖到此处,或点击上传
+
+
+ 仅允许导入xls、xlsx格式文件。
+
+
+
+
+
+
+
+ #end