From b1573930415903bcb9dc3a92d1482699de0f07cf Mon Sep 17 00:00:00 2001
From: admin <15939171744@163.com>
Date: 星期五, 22 十一月 2024 13:24:19 +0800
Subject: [PATCH] -数据采集优化

---
 billion-ui/src/views/main/da/tightenCollection/index.vue                                        |  195 ++++++++++++++++++--------------
 billion-main/src/main/java/com/billion/main/da/service/impl/DaTightenCollectionServiceImpl.java |    7 +
 billion-main/src/main/resources/mapper/da/DaTightenCollectionMapper.xml                         |    2 
 billion-ui/src/views/main/da/paramCollection/index.vue                                          |   93 +++++----------
 billion-main/src/main/java/com/billion/main/da/domain/DaTightenCollection.java                  |   10 +
 5 files changed, 161 insertions(+), 146 deletions(-)

diff --git a/billion-main/src/main/java/com/billion/main/da/domain/DaTightenCollection.java b/billion-main/src/main/java/com/billion/main/da/domain/DaTightenCollection.java
index f768b09..2b807e7 100644
--- a/billion-main/src/main/java/com/billion/main/da/domain/DaTightenCollection.java
+++ b/billion-main/src/main/java/com/billion/main/da/domain/DaTightenCollection.java
@@ -1,6 +1,8 @@
 package com.billion.main.da.domain;
 
 import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import org.apache.commons.lang3.builder.ToStringBuilder;
@@ -59,5 +61,13 @@
     @Excel(name = "閲囬泦鏃堕棿", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date collectTime;
 
+    @TableField(exist = false)
+    private String[] timeQuery;
+
+    @TableField(exist = false)
+    private String startTime;
+
+    @TableField(exist = false)
+    private String stopTime;
 
 }
diff --git a/billion-main/src/main/java/com/billion/main/da/service/impl/DaTightenCollectionServiceImpl.java b/billion-main/src/main/java/com/billion/main/da/service/impl/DaTightenCollectionServiceImpl.java
index 34382cd..1f4809f 100644
--- a/billion-main/src/main/java/com/billion/main/da/service/impl/DaTightenCollectionServiceImpl.java
+++ b/billion-main/src/main/java/com/billion/main/da/service/impl/DaTightenCollectionServiceImpl.java
@@ -1,7 +1,9 @@
 package com.billion.main.da.service.impl;
 
+import java.util.Date;
 import java.util.List;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -42,6 +44,10 @@
     @Override
     public List<DaTightenCollection> selectDaTightenCollectionList(DaTightenCollection daTightenCollection)
     {
+        if(ObjectUtil.isNotNull(daTightenCollection.getTimeQuery())){
+            daTightenCollection.setStartTime(daTightenCollection.getTimeQuery()[0]);
+            daTightenCollection.setStopTime(daTightenCollection.getTimeQuery()[1]);
+        }
         return daTightenCollectionMapper.selectDaTightenCollectionList(daTightenCollection);
     }
 
@@ -54,6 +60,7 @@
     @Override
     public int insertDaTightenCollection(DaTightenCollection daTightenCollection)
     {
+        daTightenCollection.setCollectTime(new Date());
         return daTightenCollectionMapper.insertDaTightenCollection(daTightenCollection);
     }
 
diff --git a/billion-main/src/main/resources/mapper/da/DaTightenCollectionMapper.xml b/billion-main/src/main/resources/mapper/da/DaTightenCollectionMapper.xml
index 021f163..dbd33c4 100644
--- a/billion-main/src/main/resources/mapper/da/DaTightenCollectionMapper.xml
+++ b/billion-main/src/main/resources/mapper/da/DaTightenCollectionMapper.xml
@@ -30,7 +30,7 @@
             <if test="paramSetName != null  and paramSetName != ''"> and param_set_name like concat('%', #{paramSetName}, '%')</if>
             <if test="torqueStatus != null  and torqueStatus != ''"> and torque_status = #{torqueStatus}</if>
             <if test="angleStatus != null  and angleStatus != ''"> and angle_status = #{angleStatus}</if>
-            <if test="collectTime != null "> and collect_time = #{collectTime}</if>
+            <if test="startTime != null"> and collect_time BETWEEN #{startTime} and #{stopTime}</if>
         </where>
     </select>
     
diff --git a/billion-ui/src/views/main/da/paramCollection/index.vue b/billion-ui/src/views/main/da/paramCollection/index.vue
index 1e8d026..f42a756 100644
--- a/billion-ui/src/views/main/da/paramCollection/index.vue
+++ b/billion-ui/src/views/main/da/paramCollection/index.vue
@@ -50,14 +50,6 @@
               @keyup.enter.native="handleQuery"
             />
           </el-form-item>
-<!--          <el-form-item label="閲囬泦鏃堕棿" prop="collectTime">-->
-<!--            <el-date-picker-->
-<!--              v-model="queryParams.collectTime"-->
-<!--              type="datetime"-->
-<!--              placeholder="璇烽�夋嫨閲囬泦鏃堕棿"-->
-<!--              value-format="yyyy-MM-dd HH:mm:ss"-->
-<!--            />-->
-<!--          </el-form-item>-->
           <!-- 鍙互缁х画娣诲姞鍏朵粬楂樼骇鏌ヨ鏉′欢 -->
           <el-row>
             <el-col :span="24" style="text-align: right;">
@@ -69,38 +61,38 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
-          type="primary"
-          plain
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['da:paramCollection:add']"
-        >鏂板</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="success"
-          plain
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-          v-hasPermi="['da:paramCollection:edit']"
-        >淇敼</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          plain
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['da:paramCollection:remove']"
-        >鍒犻櫎</el-button>
-      </el-col>
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="primary"-->
+<!--          plain-->
+<!--          icon="el-icon-plus"-->
+<!--          size="mini"-->
+<!--          @click="handleAdd"-->
+<!--          v-hasPermi="['da:paramCollection:add']"-->
+<!--        >鏂板</el-button>-->
+<!--      </el-col>-->
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="success"-->
+<!--          plain-->
+<!--          icon="el-icon-edit"-->
+<!--          size="mini"-->
+<!--          :disabled="single"-->
+<!--          @click="handleUpdate"-->
+<!--          v-hasPermi="['da:paramCollection:edit']"-->
+<!--        >淇敼</el-button>-->
+<!--      </el-col>-->
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="danger"-->
+<!--          plain-->
+<!--          icon="el-icon-delete"-->
+<!--          size="mini"-->
+<!--          :disabled="multiple"-->
+<!--          @click="handleDelete"-->
+<!--          v-hasPermi="['da:paramCollection:remove']"-->
+<!--        >鍒犻櫎</el-button>-->
+<!--      </el-col>-->
       <el-col :span="1.5">
         <el-button
           type="warning"
@@ -123,24 +115,6 @@
       <el-table-column label="鍙傛暟鍚嶇О" align="center" prop="paramName" />
       <el-table-column label="鍙傛暟鍊�" align="center" prop="paramValue" />
       <el-table-column label="閲囬泦鏃堕棿" align="center" prop="collectTime" width="180">
-      </el-table-column>
-      <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
-        <template slot-scope="scope">
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['da:paramCollection:edit']"
-          >淇敼</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['da:paramCollection:remove']"
-          >鍒犻櫎</el-button>
-        </template>
       </el-table-column>
     </el-table>
 
@@ -271,13 +245,10 @@
         paramValue: null,
         collectTime: null
       };
-
-
       this.resetForm("form");
     },
     /** 鎼滅储鎸夐挳鎿嶄綔 */
     handleQuery() {
-      console.log(this.value1)
       this.queryParams.pageNum = 1;
       this.getList();
       this.advancedSearchVisible = false
diff --git a/billion-ui/src/views/main/da/tightenCollection/index.vue b/billion-ui/src/views/main/da/tightenCollection/index.vue
index 84171aa..e48efb2 100644
--- a/billion-ui/src/views/main/da/tightenCollection/index.vue
+++ b/billion-ui/src/views/main/da/tightenCollection/index.vue
@@ -9,78 +9,89 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="宸ヤ綅缂栫爜" prop="locationCode">
-        <el-input
-          v-model="queryParams.locationCode"
-          placeholder="璇疯緭鍏ュ伐浣嶇紪鐮�"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
+      <el-form-item label-width="120" label="閲囬泦鏃堕棿" prop="timeQuery">
+        <el-date-picker
+          v-model="queryParams.timeQuery"
+          type="datetimerange"
+          range-separator="鑷�"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          start-placeholder="寮�濮嬫棩鏈�"
+          end-placeholder="缁撴潫鏃ユ湡">
+        </el-date-picker>
       </el-form-item>
-<!--      <el-form-item label="鍙傛暟闆嗙紪鐮�" prop="paramSetCode">-->
-<!--        <el-input-->
-<!--          v-model="queryParams.paramSetCode"-->
-<!--          placeholder="璇疯緭鍏ュ弬鏁伴泦缂栫爜"-->
-<!--          clearable-->
-<!--          @keyup.enter.native="handleQuery"-->
-<!--        />-->
-<!--      </el-form-item>-->
-<!--      <el-form-item label="鍙傛暟闆嗗悕绉�" prop="paramSetName">-->
-<!--        <el-input-->
-<!--          v-model="queryParams.paramSetName"-->
-<!--          placeholder="璇疯緭鍏ュ弬鏁伴泦鍚嶇О"-->
-<!--          clearable-->
-<!--          @keyup.enter.native="handleQuery"-->
-<!--        />-->
-<!--      </el-form-item>-->
-<!--      <el-form-item label="閲囬泦鏃堕棿" prop="collectTime">-->
-<!--        <el-date-picker clearable-->
-<!--          v-model="queryParams.collectTime"-->
-<!--          type="date"-->
-<!--          value-format="yyyy-MM-dd"-->
-<!--          placeholder="璇烽�夋嫨閲囬泦鏃堕棿">-->
-<!--        </el-date-picker>-->
-<!--      </el-form-item>-->
       <el-form-item style="float: right">
         <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-button icon="el-icon-setting" size="mini" @click="toggleAdvancedSearch">楂樼骇鏌ヨ</el-button>-->
+        <el-button icon="el-icon-setting" size="mini" @click="toggleAdvancedSearch">楂樼骇鏌ヨ</el-button>
       </el-form-item>
+      <transition name="fade">
+        <div v-if="advancedSearchVisible" class="advanced-search">
+          <el-form-item label-width="100" label="鍙傛暟闆嗙紪鐮�" prop="paramSetCode">
+            <el-input
+              v-model="queryParams.paramSetCode"
+              placeholder="璇疯緭鍏ュ弬鏁伴泦缂栫爜"
+              clearable
+              @keyup.enter.native="handleQuery"
+            />
+          </el-form-item>
+          <el-form-item label-width="100" label="鍙傛暟闆嗗悕绉�" prop="paramSetName">
+            <el-input
+              v-model="queryParams.paramSetName"
+              placeholder="璇疯緭鍏ュ弬鏁伴泦鍚嶇О"
+              clearable
+              @keyup.enter.native="handleQuery"
+            />
+          </el-form-item>
+          <el-form-item label="宸ヤ綅缂栫爜" prop="locationCode">
+            <el-input
+              v-model="queryParams.locationCode"
+              placeholder="璇疯緭鍏ュ伐浣嶇紪鐮�"
+              clearable
+              @keyup.enter.native="handleQuery"
+            />
+          </el-form-item>
+          <el-row>
+            <el-col :span="24" style="text-align: right;">
+              <el-button type="primary" icon="el-icon-close" size="mini" @click="toggleAdvancedSearch">鍏抽棴</el-button>
+            </el-col>
+          </el-row>
+        </div>
+      </transition>
     </el-form>
 
     <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
-          type="primary"
-          plain
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['da:tightenCollection:add']"
-        >鏂板</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="success"
-          plain
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-          v-hasPermi="['da:tightenCollection:edit']"
-        >淇敼</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          plain
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['da:tightenCollection:remove']"
-        >鍒犻櫎</el-button>
-      </el-col>
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="primary"-->
+<!--          plain-->
+<!--          icon="el-icon-plus"-->
+<!--          size="mini"-->
+<!--          @click="handleAdd"-->
+<!--          v-hasPermi="['da:tightenCollection:add']"-->
+<!--        >鏂板</el-button>-->
+<!--      </el-col>-->
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="success"-->
+<!--          plain-->
+<!--          icon="el-icon-edit"-->
+<!--          size="mini"-->
+<!--          :disabled="single"-->
+<!--          @click="handleUpdate"-->
+<!--          v-hasPermi="['da:tightenCollection:edit']"-->
+<!--        >淇敼</el-button>-->
+<!--      </el-col>-->
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="danger"-->
+<!--          plain-->
+<!--          icon="el-icon-delete"-->
+<!--          size="mini"-->
+<!--          :disabled="multiple"-->
+<!--          @click="handleDelete"-->
+<!--          v-hasPermi="['da:tightenCollection:remove']"-->
+<!--        >鍒犻櫎</el-button>-->
+<!--      </el-col>-->
       <el-col :span="1.5">
         <el-button
           type="warning"
@@ -91,7 +102,7 @@
           v-hasPermi="['da:tightenCollection:export']"
         >瀵煎嚭</el-button>
       </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+<!--      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
     </el-row>
 
     <el-table border v-loading="loading" :data="tightenCollectionList" @selection-change="handleSelectionChange">
@@ -106,24 +117,6 @@
       <el-table-column label="瑙掑害鍊�" align="center" prop="angle" />
       <el-table-column label="瑙掑害鐘舵��" align="center" prop="angleStatus" />
       <el-table-column label="閲囬泦鏃堕棿" align="center" prop="collectTime" width="180">
-      </el-table-column>
-      <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
-        <template slot-scope="scope">
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['da:tightenCollection:edit']"
-          >淇敼</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['da:tightenCollection:remove']"
-          >鍒犻櫎</el-button>
-        </template>
       </el-table-column>
     </el-table>
 
@@ -172,6 +165,7 @@
   name: "TightenCollection",
   data() {
     return {
+      advancedSearchVisible: false,
       // 閬僵灞�
       loading: true,
       // 閫変腑鏁扮粍
@@ -200,7 +194,8 @@
         paramSetName: null,
         torqueStatus: null,
         angleStatus: null,
-        collectTime: null
+        collectTime: null,
+        timeQuery: []
       },
       // 琛ㄥ崟鍙傛暟
       form: {},
@@ -250,9 +245,11 @@
     handleQuery() {
       this.queryParams.pageNum = 1;
       this.getList();
+      this.advancedSearchVisible = false
     },
     /** 閲嶇疆鎸夐挳鎿嶄綔 */
     resetQuery() {
+      this.clearQueryParams()
       this.resetForm("queryForm");
       this.handleQuery();
     },
@@ -261,6 +258,11 @@
       this.ids = selection.map(item => item.id)
       this.single = selection.length!==1
       this.multiple = !selection.length
+    },
+    clearQueryParams(){
+      this.queryParams.paramSetName = null
+      this.queryParams.paramSetName = null
+      this.queryParams.locationCode = null
     },
     /** 鏂板鎸夐挳鎿嶄綔 */
     handleAdd() {
@@ -317,3 +319,28 @@
   }
 };
 </script>
+<style scoped>.fade-enter-active, .fade-leave-active {
+  transition: opacity 0.3s;
+}
+.fade-enter, .fade-leave-to /* .fade-leave-active in <2.1.8 */ {
+  opacity: 0;
+}
+
+.advanced-search {
+  position: absolute;
+  background: #FFFFFF; /* 璁剧疆涓轰笌椤甸潰鑳屾櫙鑹茬浉鍚屾垨鐩歌繎鐨勯鑹� */
+  border-left: 1px solid #dcdfe6;
+  border-right: 1px solid #dcdfe6;
+  border-bottom: 1px solid #dcdfe6;
+  /*border: none;*/
+  box-shadow: none; /* 绉婚櫎闃村奖 */
+  padding: 10px;
+  z-index: 1000; /* 纭繚娴姩鍦ㄥ叾浠栧厓绱犱箣涓� */
+  top: 70px; /* 璋冩暣椤堕儴浣嶇疆锛屼娇鍏朵笌椤甸潰鍏朵粬鍏冪礌鏇村崗璋� */
+  left: 20px; /* 璋冩暣宸︿晶浣嶇疆 */
+  width: 97%; /* 璋冩暣瀹藉害 */
+  /*max-width: 1296px; !* 鏈�澶у搴� *!*/
+  /*max-width: 1296px; !* 鏈�澶у搴� *!*/
+  margin: 0 auto; /* 灞呬腑瀵归綈 */
+}
+</style>

--
Gitblit v1.9.3