From 57b159eb98577f910e586f3cf79356274d68db0f Mon Sep 17 00:00:00 2001
From: wangzhaoqiang <tjwangzhaoqiang@163.com>
Date: 星期一, 16 八月 2021 14:48:34 +0800
Subject: [PATCH] 添加日期范围支持重复添加多组日期范围,请求参数中对象的属性为null、undefined不进行拼接
---
ruoyi-generator/src/main/resources/vm/vue/index.vue.vm | 66 ++++++++-------------------------
1 files changed, 16 insertions(+), 50 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 cbf3e64..6f21c31 100644
--- a/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm
+++ b/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm
@@ -108,6 +108,7 @@
plain
icon="el-icon-download"
size="mini"
+ :loading="exportLoading"
@click="handleExport"
v-hasPermi="['${moduleName}:${businessName}:export']"
>瀵煎嚭</el-button>
@@ -309,51 +310,15 @@
<script>
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName}, export${BusinessName} } from "@/api/${moduleName}/${businessName}";
-#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
-#foreach($column in $columns)
-#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "editor")
-import Editor from '@/components/Editor';
-#break
-#end
-#end
export default {
name: "${BusinessName}",
- components: {
-#foreach($column in $columns)
-#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "imageUpload")
- ImageUpload,
-#break
-#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
-#end
-#end
- },
data() {
return {
// 閬僵灞�
loading: true,
+ // 瀵煎嚭閬僵灞�
+ exportLoading: false,
// 閫変腑鏁扮粍
ids: [],
#if($table.sub)
@@ -587,7 +552,7 @@
}).then(() => {
this.getList();
this.msgSuccess("鍒犻櫎鎴愬姛");
- })
+ }).catch(() => {});
},
#if($table.sub)
/** ${subTable.functionName}搴忓彿 */
@@ -608,19 +573,18 @@
/** ${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
/** 瀵煎嚭鎸夐挳鎿嶄綔 */
@@ -630,11 +594,13 @@
confirmButtonText: "纭畾",
cancelButtonText: "鍙栨秷",
type: "warning"
- }).then(function() {
+ }).then(() => {
+ this.exportLoading = true;
return export${BusinessName}(queryParams);
}).then(response => {
this.download(response.msg);
- })
+ this.exportLoading = false;
+ }).catch(() => {});
}
}
};
--
Gitblit v1.9.3