From 30f0bdc754cc1d85a72c5cb86b84ca20a67ef20c Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期六, 16 四月 2022 14:08:11 +0800 Subject: [PATCH] update 使用 spring cglib 替换 停止维护的 cglib --- ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm | 60 +++++++++++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 45 insertions(+), 15 deletions(-) diff --git a/ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm index d57bbdf..6776687 100644 --- a/ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm +++ b/ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm @@ -11,7 +11,7 @@ #else #set($comment=$column.columnComment) #end -#if($column.htmlType == "input") +#if($column.htmlType == "input" || $column.htmlType == "textarea") <el-form-item label="${comment}" prop="${column.javaField}"> <el-input v-model="queryParams.${column.javaField}" @@ -76,14 +76,23 @@ v-hasPermi="['${moduleName}:${businessName}:add']" >鏂板</el-button> </el-col> + <el-col :span="1.5"> + <el-button + type="info" + plain + icon="Sort" + @click="toggleExpandAll" + >灞曞紑/鎶樺彔</el-button> + </el-col> <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> </el-row> <el-table + v-if="refreshTable" v-loading="loading" :data="${businessName}List" row-key="${treeCode}" - default-expand-all + :default-expand-all="isExpandAll" :tree-props="{children: 'children', hasChildren: 'hasChildren'}" > #foreach($column in $columns) @@ -103,11 +112,11 @@ </el-table-column> #elseif($column.list && $column.htmlType == "imageUpload") <el-table-column label="${comment}" align="center" prop="${javaField}" width="100"> - <template #default="scope"> - <image-preview :src="scope.row.${javaField}" :width="50" :height="50"/> - </template> + <template #default="scope"> + <image-preview :src="scope.row.${javaField}" :width="50" :height="50"/> + </template> </el-table-column> -#elseif($column.list && "" != $column.dictType) +#elseif($column.list && $column.dictType && "" != $column.dictType) <el-table-column label="${comment}" align="center" prop="${javaField}"> <template #default="scope"> #if($column.htmlType == "checkbox") @@ -155,7 +164,6 @@ #foreach($column in $columns) #set($field=$column.javaField) #if($column.insert && !$column.pk) -#if(($column.usableColumn) || (!$column.superColumn)) #set($parentheseIndex=$column.columnComment.indexOf("锛�")) #if($parentheseIndex != -1) #set($comment=$column.columnComment.substring(0, $parentheseIndex)) @@ -244,8 +252,8 @@ <el-form-item label="${comment}" prop="${field}"> <el-date-picker clearable v-model="form.${field}" - type="date" - value-format="YYYY-MM-DD" + type="datetime" + value-format="YYYY-MM-DD HH:mm:ss" placeholder="閫夋嫨${comment}"> </el-date-picker> </el-form-item> @@ -253,7 +261,6 @@ <el-form-item label="${comment}" prop="${field}"> <el-input v-model="form.${field}" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" /> </el-form-item> -#end #end #end #end @@ -280,9 +287,12 @@ const ${businessName}List = ref([]); const ${businessName}Options = ref([]); const open = ref(false); +const buttonLoading = ref(false); const loading = ref(true); const showSearch = ref(true); const title = ref(""); +const isExpandAll = ref(true); +const refreshTable = ref(true); #foreach ($column in $columns) #if($column.htmlType == "datetime" && $column.queryType == "BETWEEN") #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) @@ -293,14 +303,14 @@ const data = reactive({ form: {}, queryParams: { - #foreach ($column in $columns) +#foreach ($column in $columns) #if($column.query) - $column.javaField: null#if($foreach.count != $columns.size()),#end + $column.javaField: undefined#if($foreach.count != $columns.size()),#end #end #end }, rules: { - #foreach ($column in $columns) +#foreach ($column in $columns) #if($column.required) #set($parentheseIndex=$column.columnComment.indexOf("锛�")) #if($parentheseIndex != -1) @@ -351,7 +361,7 @@ ${businessName}Options.value.push(data); }); } - + // 鍙栨秷鎸夐挳 function cancel() { open.value = false; @@ -405,14 +415,25 @@ title.value = "娣诲姞${functionName}"; } +/** 灞曞紑/鎶樺彔鎿嶄綔 */ +function toggleExpandAll() { + refreshTable.value = false; + isExpandAll.value = !isExpandAll.value; + nextTick(() => { + refreshTable.value = true; + }); +} + /** 淇敼鎸夐挳鎿嶄綔 */ async function handleUpdate(row) { + loading.value = true; reset(); await getTreeselect(); if (row != null) { form.value.${treeParentCode} = row.${treeCode}; } get${BusinessName}(row.${pkColumn.javaField}).then(response => { + loading.value = false; form.value = response.data; #foreach ($column in $columns) #if($column.htmlType == "checkbox") @@ -428,6 +449,7 @@ function submitForm() { proxy.#[[$]]#refs["${businessName}Ref"].validate(valid => { if (valid) { + buttonLoading.value = true; #foreach ($column in $columns) #if($column.htmlType == "checkbox") form.value.$column.javaField = form.value.${column.javaField}.join(","); @@ -438,12 +460,16 @@ proxy.#[[$modal]]#.msgSuccess("淇敼鎴愬姛"); open.value = false; getList(); + }).finally(() => { + buttonLoading.value = false; }); } else { add${BusinessName}(form.value).then(response => { proxy.#[[$modal]]#.msgSuccess("鏂板鎴愬姛"); open.value = false; getList(); + }).finally(() => { + buttonLoading.value = false; }); } } @@ -453,11 +479,15 @@ /** 鍒犻櫎鎸夐挳鎿嶄綔 */ function handleDelete(row) { proxy.#[[$modal]]#.confirm('鏄惁纭鍒犻櫎${functionName}缂栧彿涓�"' + row.${pkColumn.javaField} + '"鐨勬暟鎹」锛�').then(function() { + loading.value = true; return del${BusinessName}(row.${pkColumn.javaField}); }).then(() => { + loading.value = false; getList(); proxy.#[[$modal]]#.msgSuccess("鍒犻櫎鎴愬姛"); - }).catch(() => {}); + }).finally(() => { + loading.value = false; + }); } getList(); -- Gitblit v1.9.3