From b27a8afc3bdd809d9610a47b50a5ecc2f7f6e41a Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期二, 14 九月 2021 12:03:58 +0800 Subject: [PATCH] fix 修复多主键代码生成bug --- ruoyi-generator/src/main/resources/vm/vue/index.vue.vm | 42 +++++++++++++++--------------------------- 1 files changed, 15 insertions(+), 27 deletions(-) diff --git a/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm index 9cde389..4b055fa 100644 --- a/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm +++ b/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm @@ -108,7 +108,7 @@ plain icon="el-icon-download" size="mini" - :loading="exportLoading" + :loading="exportLoading" @click="handleExport" v-hasPermi="['${moduleName}:${businessName}:export']" >瀵煎嚭</el-button> @@ -135,7 +135,11 @@ </template> </el-table-column> #elseif($column.list && $column.dictType && "" != $column.dictType) - <el-table-column label="${comment}" align="center" prop="${javaField}" :formatter="${javaField}Format" /> + <el-table-column label="${comment}" align="center" prop="${javaField}"> + <template slot-scope="scope"> + <dict-tag :options="${javaField}Options" :value="scope.row.${javaField}"/> + </template> + </el-table-column> #elseif($column.list && "" != $javaField) <el-table-column label="${comment}" align="center" prop="${javaField}" /> #end @@ -308,7 +312,6 @@ <script> import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}"; -import { downLoadExcel } from "@/utils/download"; export default { name: "${BusinessName}", @@ -427,20 +430,6 @@ this.loading = false; }); }, -#foreach ($column in $columns) -#if(${column.dictType} && ${column.dictType} != '') -#set($parentheseIndex=$column.columnComment.indexOf("锛�")) -#if($parentheseIndex != -1) -#set($comment=$column.columnComment.substring(0, $parentheseIndex)) -#else -#set($comment=$column.columnComment) -#end - // $comment瀛楀吀缈昏瘧 - ${column.javaField}Format(row, column) { - return this.selectDictLabel#if($column.htmlType == "checkbox")s#end(this.${column.javaField}Options, row.${column.javaField}); - }, -#end -#end // 鍙栨秷鎸夐挳 cancel() { this.open = false; @@ -585,24 +574,23 @@ /** ${subTable.functionName}鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete${subClassName}() { if (this.checked${subClassName}.length == 0) { - this.$alert("璇峰厛閫夋嫨瑕佸垹闄ょ殑${subTable.functionName}鏁版嵁", "鎻愮ず", { confirmButtonText: "纭畾", }); + this.msgError("璇峰厛閫夋嫨瑕佸垹闄ょ殑${subTable.functionName}鏁版嵁"); } else { - this.${subclassName}List.splice(this.checked${subClassName}[0].index - 1, 1); + const ${subclassName}List = this.${subclassName}List; + const checked${subClassName} = this.checked${subClassName}; + this.${subclassName}List = ${subclassName}List.filter(function(item) { + return checked${subClassName}.indexOf(item.index) == -1 + }); } }, - /** 鍗曢�夋閫変腑鏁版嵁 */ + /** 澶嶉�夋閫変腑鏁版嵁 */ handle${subClassName}SelectionChange(selection) { - if (selection.length > 1) { - this.$refs.${subclassName}.clearSelection(); - this.$refs.${subclassName}.toggleRowSelection(selection.pop()); - } else { - this.checked${subClassName} = selection; - } + this.checked${subClassName} = selection.map(item => item.index) }, #end /** 瀵煎嚭鎸夐挳鎿嶄綔 */ handleExport() { - downLoadExcel('/${moduleName}/${businessName}/export', this.queryParams); + this.downLoadExcel('/${moduleName}/${businessName}/export', this.queryParams); } } }; -- Gitblit v1.9.3