From 56a943bf48e204f24d0e1bbbf2cb7e82f3eb2662 Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期一, 24 五月 2021 11:24:54 +0800 Subject: [PATCH] 升级druid到最新版本v1.2.6 --- ruoyi-generator/src/main/resources/vm/vue/index.vue.vm | 107 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 103 insertions(+), 4 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 ded7e2d..cbf3e64 100644 --- a/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm +++ b/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm @@ -73,7 +73,7 @@ <el-col :span="1.5"> <el-button type="primary" - plain + plain icon="el-icon-plus" size="mini" @click="handleAdd" @@ -83,7 +83,7 @@ <el-col :span="1.5"> <el-button type="success" - plain + plain icon="el-icon-edit" size="mini" :disabled="single" @@ -94,7 +94,7 @@ <el-col :span="1.5"> <el-button type="danger" - plain + plain icon="el-icon-delete" size="mini" :disabled="multiple" @@ -105,7 +105,7 @@ <el-col :span="1.5"> <el-button type="warning" - plain + plain icon="el-icon-download" size="mini" @click="handleExport" @@ -189,6 +189,10 @@ <el-form-item label="${comment}"> <imageUpload v-model="form.${field}"/> </el-form-item> +#elseif($column.htmlType == "fileUpload") + <el-form-item label="${comment}"> + <fileUpload v-model="form.${field}"/> + </el-form-item> #elseif($column.htmlType == "editor") <el-form-item label="${comment}"> <editor v-model="form.${field}" :min-height="192"/> @@ -262,6 +266,38 @@ #end #end #end +#if($table.sub) + <el-divider content-position="center">${subTable.functionName}信息</el-divider> + <el-row :gutter="10" class="mb8"> + <el-col :span="1.5"> + <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd${subClassName}">添加</el-button> + </el-col> + <el-col :span="1.5"> + <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDelete${subClassName}">删除</el-button> + </el-col> + </el-row> + <el-table :data="${subclassName}List" :row-class-name="row${subClassName}Index" @selection-change="handle${subClassName}SelectionChange" ref="${subclassName}"> + <el-table-column type="selection" width="50" align="center" /> + <el-table-column label="序号" align="center" prop="index" width="50"/> +#foreach($column in $subTable.columns) +#set($javaField=$column.javaField) +#set($parentheseIndex=$column.columnComment.indexOf("(")) +#if($parentheseIndex != -1) +#set($comment=$column.columnComment.substring(0, $parentheseIndex)) +#else +#set($comment=$column.columnComment) +#end +#if($column.pk || $javaField == ${subTableFkclassName}) +#elseif($column.list && "" != $javaField) + <el-table-column label="$comment" prop="${javaField}"> + <template slot-scope="scope"> + <el-input v-model="scope.row.$javaField" placeholder="请输入$comment" /> + </template> + </el-table-column> +#end +#end + </el-table> +#end </el-form> <div slot="footer" class="dialog-footer"> <el-button type="primary" @click="submitForm">确 定</el-button> @@ -276,6 +312,12 @@ #foreach($column in $columns) #if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "imageUpload") import ImageUpload from '@/components/ImageUpload'; +#break +#end +#end +#foreach($column in $columns) +#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "fileUpload") +import FileUpload from '@/components/FileUpload'; #break #end #end @@ -296,6 +338,12 @@ #end #end #foreach($column in $columns) +#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "fileUpload") + FileUpload, +#break +#end +#end +#foreach($column in $columns) #if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "editor") Editor, #break @@ -308,6 +356,10 @@ loading: true, // 选中数组 ids: [], +#if($table.sub) + // 子表选中数据 + checked${subClassName}: [], +#end // 非单个禁用 single: true, // 非多个禁用 @@ -318,6 +370,10 @@ total: 0, // ${functionName}表格数据 ${businessName}List: [], +#if($table.sub) + // ${subTable.functionName}表格数据 + ${subclassName}List: [], +#end // 弹出层标题 title: "", // 是否显示弹出层 @@ -440,6 +496,9 @@ #end #end }; +#if($table.sub) + this.${subclassName}List = []; +#end this.resetForm("form"); }, /** 搜索按钮操作 */ @@ -481,6 +540,9 @@ this.form.$column.javaField = this.form.${column.javaField}.split(","); #end #end +#if($table.sub) + this.${subclassName}List = response.data.${subclassName}List; +#end this.open = true; this.title = "修改${functionName}"; }); @@ -493,6 +555,9 @@ #if($column.htmlType == "checkbox") this.form.$column.javaField = this.form.${column.javaField}.join(","); #end +#end +#if($table.sub) + this.form.${subclassName}List = this.${subclassName}List; #end if (this.form.${pkColumn.javaField} != null) { update${BusinessName}(this.form).then(response => { @@ -524,6 +589,40 @@ this.msgSuccess("删除成功"); }) }, +#if($table.sub) + /** ${subTable.functionName}序号 */ + row${subClassName}Index({ row, rowIndex }) { + row.index = rowIndex + 1; + }, + /** ${subTable.functionName}添加按钮操作 */ + handleAdd${subClassName}() { + let obj = {}; +#foreach($column in $subTable.columns) +#if($column.pk || $column.javaField == ${subTableFkclassName}) +#elseif($column.list && "" != $javaField) + obj.$column.javaField = ""; +#end +#end + this.${subclassName}List.push(obj); + }, + /** ${subTable.functionName}删除按钮操作 */ + handleDelete${subClassName}() { + if (this.checked${subClassName}.length == 0) { + this.$alert("请先选择要删除的${subTable.functionName}数据", "提示", { confirmButtonText: "确定", }); + } else { + this.${subclassName}List.splice(this.checked${subClassName}[0].index - 1, 1); + } + }, + /** 单选框选中数据 */ + handle${subClassName}SelectionChange(selection) { + if (selection.length > 1) { + this.$refs.${subclassName}.clearSelection(); + this.$refs.${subclassName}.toggleRowSelection(selection.pop()); + } else { + this.checked${subClassName} = selection; + } + }, +#end /** 导出按钮操作 */ handleExport() { const queryParams = this.queryParams; -- Gitblit v1.9.2