From 22210f95f3bbe588bd7e1bcff7de34aaf150aa1c Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期三, 06 一月 2021 10:59:34 +0800
Subject: [PATCH] 代码生成支持文件上传组件

---
 src/main/resources/vm/vue/index-tree.vue.vm |   55 ++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 48 insertions(+), 7 deletions(-)

diff --git a/src/main/resources/vm/vue/index-tree.vue.vm b/src/main/resources/vm/vue/index-tree.vue.vm
index e81c203..501de87 100644
--- a/src/main/resources/vm/vue/index-tree.vue.vm
+++ b/src/main/resources/vm/vue/index-tree.vue.vm
@@ -64,7 +64,7 @@
 #end
 #end
       <el-form-item>
-	    <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button>
+	    <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button>
       </el-form-item>
     </el-form>
@@ -73,6 +73,7 @@
       <el-col :span="1.5">
         <el-button
           type="primary"
+		  plain
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
@@ -152,9 +153,13 @@
         <el-form-item label="${comment}" prop="${field}">
           <el-input v-model="form.${field}" placeholder="璇疯緭鍏�${comment}" />
         </el-form-item>
-#elseif($column.htmlType == "uploadImage")
+#elseif($column.htmlType == "imageUpload")
         <el-form-item label="${comment}">
-          <uploadImage v-model="form.${field}"/>
+          <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}">
@@ -243,8 +248,13 @@
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 #foreach($column in $columns)
-#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "uploadImage")
-import UploadImage from '@/components/UploadImage';
+#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "imageUpload")
+import ImageUpload from '@/components/ImageUpload';
+#break
+#end
+#end
+#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "fileUpload")
+import FileUpload from '@/components/FileUpload';
 #break
 #end
 #end
@@ -259,8 +269,14 @@
   name: "${BusinessName}",
   components: {
 #foreach($column in $columns)
-#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "uploadImage")
-    UploadImage,
+#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
@@ -296,6 +312,10 @@
 #if(${column.dictType} != '')
       // $comment瀛楀吀
       ${column.javaField}Options: [],
+#elseif($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
+#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
+      // $comment鏃堕棿鑼冨洿
+      daterange${AttrName}: [],
 #end
 #end
       // 鏌ヨ鍙傛暟
@@ -342,6 +362,21 @@
     /** 鏌ヨ${functionName}鍒楄〃 */
     getList() {
       this.loading = true;
+#foreach ($column in $columns)
+#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
+      this.queryParams.params = {};
+#break
+#end
+#end
+#foreach ($column in $columns)
+#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
+#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
+      if (null != this.daterange${AttrName} && '' != this.daterange${AttrName}) {
+        this.queryParams.params["begin${AttrName}"] = this.daterange${AttrName}[0];
+        this.queryParams.params["end${AttrName}"] = this.daterange${AttrName}[1];
+      }
+#end
+#end
       list${BusinessName}(this.queryParams).then(response => {
         this.${businessName}List = this.handleTree(response.data, "${treeCode}", "${treeParentCode}");
         this.loading = false;
@@ -410,6 +445,12 @@
     },
     /** 閲嶇疆鎸夐挳鎿嶄綔 */
     resetQuery() {
+#foreach ($column in $columns)
+#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
+#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
+      this.daterange${AttrName} = [];
+#end
+#end
       this.resetForm("queryForm");
       this.handleQuery();
     },

--
Gitblit v1.9.3