Browse Source

库位视图页面--增加选择刷新时间间隔功能

LZH 2 years ago
parent
commit
1e658c8820
1 changed files with 40 additions and 4 deletions
  1. 40 4
      ruoyi-ui/src/views/ams/inv/locationView/index.vue

+ 40 - 4
ruoyi-ui/src/views/ams/inv/locationView/index.vue

@@ -43,6 +43,17 @@
             />
           </el-select>
         </el-form-item>
+        <el-form-item label="刷新时间间隔">
+          <el-select v-model="value" @change="change()"  placeholder="请选择刷新时间" clearable size="small" style="width: 100%" >
+              <el-option
+                v-for="item in options"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+
+          </el-select>
+        </el-form-item>
         <el-form-item>
           <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>
@@ -115,6 +126,27 @@ import { clearLocRequest,locationInvView,queryLocationZoneDict,lockLocRequest,lo
   export default {
     data () {
       return {
+        options: [{
+          value: 60000,
+          label: '1min'
+        }, {
+          value: 300000,
+          label: '5min'
+        }, {
+          value: 600000,
+          label: '10min'
+        }, {
+          value: 900000,
+          label: '15min'
+        }, {
+          value: 1200000,
+          label: '20min'
+        },
+          {
+            value: 5000,
+            label: '5s'
+          }],
+        value: 5000,
         open: false,
         showSearch: true,
         dataForm: {
@@ -161,12 +193,16 @@ import { clearLocRequest,locationInvView,queryLocationZoneDict,lockLocRequest,lo
       this.getBasZoneList()
       this.getDataList()
       this.getItemopention()
-      this.timer = setInterval(this.getDataList, 5000)
-    },
-    beforeDestroy () {
-      clearInterval(this.timer)
+      this.timer = setInterval(this.getDataList, this.value);
     },
     methods: {
+      beforeDestroy () {
+        clearInterval(this.timer)
+      },
+      change(){
+        this.beforeDestroy ();
+        this.timer = setInterval(this.getDataList, this.value);
+      },
       getItemopention(){
         lotattConfigList().then(response => {
           let data = response.data