Quellcode durchsuchen

fix: 流量查询中添加测流时间

hum vor 1 Jahr
Ursprung
Commit
558a856ee0

+ 13 - 3
ruoyi-ui/src/views/analysis/water-flow/index.vue

@@ -52,8 +52,8 @@
       </div>
     </div>
     <div class="hum-page-section">
-      <Chart v-if="mode === 'chart'" :queryParams="queryParams" />
-      <Table v-if="mode === 'table'" :queryParams="queryParams" />
+      <Chart ref="chart" v-if="mode === 'chart'" :queryParams="queryParams" />
+      <Table ref="table" v-if="mode === 'table'" :queryParams="queryParams" />
     </div>
   </div>
 </template>
@@ -95,8 +95,18 @@ export default {
   },
   methods: {
     handleQuery() {
+      if (this.mode === 'chart') {
+        this.$refs.chart.setOptions()
+      } else {
+        this.$refs.table.getList()
+      }
+    },
+    resetQuery() {
+      const dateRange = initDateRange(1);
+      this.dateRange = dateRange
+      this.queryParams.startTime = dateRange[0]
+      this.queryParams.endTime = dateRange[1]
     },
-    resetQuery() {},
     init() {
       this.loading = true;
       listSite({ page: 1, size: 1000 }).then(response => {

+ 1 - 0
ruoyi-ui/src/views/analysis/water-flow/table.vue

@@ -3,6 +3,7 @@
     <el-table v-loading="loading" :data="list" border>
       <el-table-column label="瞬时总流量" prop="flowsum" />
       <el-table-column label="水位" prop="waterlevel" />
+      <el-table-column label="测流时间" prop="createTime" />
     </el-table>
   </div>
 </template>

+ 14 - 4
ruoyi-ui/src/views/analysis/water-time/index.vue

@@ -64,8 +64,8 @@
       </div>
     </div>
     <div class="hum-page-section">
-      <Chart v-if="mode === 'chart'" :queryParams="queryParams" />
-      <Table v-if="mode === 'table'" :queryParams="queryParams" />
+      <Chart ref="chart" v-if="mode === 'chart'" :queryParams="queryParams" />
+      <Table ref="table" v-if="mode === 'table'" :queryParams="queryParams" />
     </div>
   </div>
 </template>
@@ -138,9 +138,19 @@ export default {
   },
   methods: {
     handleQuery() {
-      this.getList()
+      if (this.mode === 'chart') {
+        this.$refs.chart.setOptions()
+      } else {
+        this.$refs.table.getList()
+      }
+    },
+    resetQuery() {
+      const dateRange = initDateRangeByType(1);
+      this.dateRange = dateRange
+      this.queryParams.type = 1
+      this.queryParams.startTime = dateRange[0]
+      this.queryParams.endTime = dateRange[1]
     },
-    resetQuery() {},
     init() {
       this.loading = true;
       listSite({ page: 1, size: 1000 }).then(response => {