From 769c555e33ec9977ad5235a650637d0ce9bea01d Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期二, 18 八月 2020 18:18:10 +0800 Subject: [PATCH] 代码生成添加select必填选项 --- src/main/resources/vm/vue/index-tree.vue.vm | 9 ++++----- src/main/resources/vm/vue/index.vue.vm | 11 +++++------ src/main/java/com/ruoyi/framework/config/SecurityConfig.java | 2 +- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/src/main/java/com/ruoyi/framework/config/SecurityConfig.java index 4c3b136..b78ee04 100644 --- a/src/main/java/com/ruoyi/framework/config/SecurityConfig.java +++ b/src/main/java/com/ruoyi/framework/config/SecurityConfig.java @@ -88,7 +88,7 @@ protected void configure(HttpSecurity httpSecurity) throws Exception { httpSecurity - // CRSF绂佺敤锛屽洜涓轰笉浣跨敤session + // CSRF绂佺敤锛屽洜涓轰笉浣跨敤session .csrf().disable() // 璁よ瘉澶辫触澶勭悊绫� .exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and() diff --git a/src/main/resources/vm/vue/index-tree.vue.vm b/src/main/resources/vm/vue/index-tree.vue.vm index 7130327..b52c6f2 100644 --- a/src/main/resources/vm/vue/index-tree.vue.vm +++ b/src/main/resources/vm/vue/index-tree.vue.vm @@ -140,7 +140,7 @@ <el-input v-model="form.${field}" placeholder="璇疯緭鍏�${comment}" /> </el-form-item> #elseif($column.htmlType == "select" && "" != $dictType) - <el-form-item label="${comment}"> + <el-form-item label="${comment}" prop="${field}"> <el-select v-model="form.${field}" placeholder="璇烽�夋嫨${comment}"> <el-option v-for="dict in ${field}Options" @@ -152,7 +152,7 @@ </el-select> </el-form-item> #elseif($column.htmlType == "select" && $dictType) - <el-form-item label="${comment}"> + <el-form-item label="${comment}" prop="${field}"> <el-select v-model="form.${field}" placeholder="璇烽�夋嫨${comment}"> <el-option label="璇烽�夋嫨瀛楀吀鐢熸垚" value="" /> </el-select> @@ -272,9 +272,8 @@ #else #set($comment=$column.columnComment) #end -#set($comment=$column.columnComment) $column.javaField: [ - { required: true, message: "$comment涓嶈兘涓虹┖", trigger: "blur" } + { required: true, message: "$comment涓嶈兘涓虹┖", trigger: "#if($column.htmlType == "select")"change"#else"blur"#end" } ]#if($velocityCount != $columns.size()),#end #end @@ -436,4 +435,4 @@ } } }; -</script> \ No newline at end of file +</script> diff --git a/src/main/resources/vm/vue/index.vue.vm b/src/main/resources/vm/vue/index.vue.vm index e2a457d..b5e45f5 100644 --- a/src/main/resources/vm/vue/index.vue.vm +++ b/src/main/resources/vm/vue/index.vue.vm @@ -95,7 +95,7 @@ v-hasPermi="['${moduleName}:${businessName}:export']" >瀵煎嚭</el-button> </el-col> - <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> </el-row> <el-table v-loading="loading" :data="${businessName}List" @selection-change="handleSelectionChange"> @@ -169,7 +169,7 @@ <el-input v-model="form.${field}" placeholder="璇疯緭鍏�${comment}" /> </el-form-item> #elseif($column.htmlType == "select" && "" != $dictType) - <el-form-item label="${comment}"> + <el-form-item label="${comment}" prop="${field}"> <el-select v-model="form.${field}" placeholder="璇烽�夋嫨${comment}"> <el-option v-for="dict in ${field}Options" @@ -181,7 +181,7 @@ </el-select> </el-form-item> #elseif($column.htmlType == "select" && $dictType) - <el-form-item label="${comment}"> + <el-form-item label="${comment}" prop="${field}"> <el-select v-model="form.${field}" placeholder="璇烽�夋嫨${comment}"> <el-option label="璇烽�夋嫨瀛楀吀鐢熸垚" value="" /> </el-select> @@ -306,9 +306,8 @@ #else #set($comment=$column.columnComment) #end -#set($comment=$column.columnComment) $column.javaField: [ - { required: true, message: "$comment涓嶈兘涓虹┖", trigger: "blur" } + { required: true, message: "$comment涓嶈兘涓虹┖", trigger: #if($column.htmlType == "select")"change"#else"blur"#end } ]#if($velocityCount != $columns.size()),#end #end @@ -468,4 +467,4 @@ } } }; -</script> \ No newline at end of file +</script> -- Gitblit v1.9.3