From 0488495a3436fefa43535d9335e7e00f5c5f30bc Mon Sep 17 00:00:00 2001
From: 疯狂的狮子Li <15040126243@163.com>
Date: 星期三, 23 三月 2022 17:36:59 +0800
Subject: [PATCH] !164 fix 修复swagger描述错误 Merge pull request !164 from Yjoioooo/auto-5403234-dev-1648027721128
---
ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm | 42 ++++++++++++++++++++++++++----------------
1 files changed, 26 insertions(+), 16 deletions(-)
diff --git a/ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm
index a363ef3..6c9cdd6 100644
--- a/ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm
+++ b/ruoyi-generator/src/main/resources/vm/vue/v3/index.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}"
@@ -119,7 +119,7 @@
#set($comment=$column.columnComment)
#end
#if($column.pk)
- <el-table-column label="${comment}" align="center" prop="${javaField}" />
+ <el-table-column label="${comment}" align="center" prop="${javaField}" v-if="${column.list}"/>
#elseif($column.list && $column.htmlType == "datetime")
<el-table-column label="${comment}" align="center" prop="${javaField}" width="180">
<template #default="scope">
@@ -128,11 +128,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")
@@ -163,7 +163,7 @@
</template>
</el-table-column>
</el-table>
-
+
<pagination
v-show="total>0"
:total="total"
@@ -178,7 +178,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))
@@ -258,8 +257,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>
@@ -267,7 +266,6 @@
<el-form-item label="${comment}" prop="${field}">
<el-input v-model="form.${field}" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" />
</el-form-item>
-#end
#end
#end
#end
@@ -338,7 +336,7 @@
</el-form>
<template #footer>
<div class="dialog-footer">
- <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
+ <el-button :loading="buttonLoading" type="primary" @click="submitForm">纭� 瀹�</el-button>
<el-button @click="cancel">鍙� 娑�</el-button>
</div>
</template>
@@ -360,6 +358,7 @@
const ${subclassName}List = ref([]);
#end
const open = ref(false);
+const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
@@ -382,14 +381,14 @@
queryParams: {
pageNum: 1,
pageSize: 10,
- #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)
@@ -491,9 +490,11 @@
/** 淇敼鎸夐挳鎿嶄綔 */
function handleUpdate(row) {
+ loading.value = true
reset();
const ${pkColumn.javaField} = row.${pkColumn.javaField} || ids.value
get${BusinessName}(${pkColumn.javaField}).then(response => {
+ loading.value = false;
form.value = response.data;
#foreach ($column in $columns)
#if($column.htmlType == "checkbox")
@@ -512,6 +513,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(",");
@@ -525,12 +527,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;
});
}
}
@@ -541,11 +547,15 @@
function handleDelete(row) {
const ${pkColumn.javaField}s = row.${pkColumn.javaField} || ids.value;
proxy.#[[$modal]]#.confirm('鏄惁纭鍒犻櫎${functionName}缂栧彿涓�"' + ${pkColumn.javaField}s + '"鐨勬暟鎹」锛�').then(function() {
+ loading.value = true;
return del${BusinessName}(${pkColumn.javaField}s);
}).then(() => {
+ loading.value = true;
getList();
proxy.#[[$modal]]#.msgSuccess("鍒犻櫎鎴愬姛");
- }).catch(() => {});
+ }).finally(() => {
+ loading.value = false;
+ });
}
#if($table.sub)
--
Gitblit v1.9.3