zhaoke 2 éve
szülő
commit
e5c7ddd9a2

+ 17 - 3
src/views/systemSettings/views/newMachine/components/table.vue

@@ -34,6 +34,11 @@
                 </span>
               </template>
             </el-table-column>
+            <el-table-column label="任务类型">
+              <template slot-scope="scope">
+                <div>{{ scope.row.taskType == 1 ? '轮询方式' :'CRON表达式' }}</div>
+              </template>
+            </el-table-column>
             <el-table-column label="服务类型">
               <template slot-scope="scope">
                 <div>{{ scope.row.serviceType == 1 ? '接收' :'采集' }}</div>
@@ -41,7 +46,7 @@
             </el-table-column>
             <el-table-column label="采集频率单位">
               <template slot-scope="scope">
-                <div>{{ scope.row.frequencyUnit ? scope.row.frequencyUnit + '秒' :'' }}</div>
+                <div>{{ scope.row.frequencyUnit ? formatTime(scope.row.frequencyUnit) + '秒' :'' }}</div>
               </template>
             </el-table-column>
             <el-table-column label="状态">
@@ -478,6 +483,16 @@ export default {
     toggleRowSelection (row, isSelected) {
       this.$refs["table"].toggleRowSelection(row, isSelected);
     },
+    formatTime (sc) {
+      const type = typeof (sc) === 'string' ? sc : `${sc}`
+      if (type && type.length) {
+        if (type.length <= 4) {
+          return Number(type) / 1000
+        } else {
+          return Number(type) / (1000 * 60)
+        }
+      }
+    },
     // 表格初始勾选
     selectTableRows (tableData, selectFlagName) {
       tableData.forEach((row) => {
@@ -491,11 +506,10 @@ export default {
       this.tableColsCopy = this.tableCols.filter((item) => item.needShow);
       this.tableColsCopy = _.orderBy(this.tableColsCopy, ['orderNumber'], ['asc']);
       this.tableColsCopy.map((item, index) => {
-        if (item.columnName == 'serviceType' || item.columnName == 'frequencyUnit' || item.columnName == 'runState') {
+        if (item.columnName == 'serviceType' || item.columnName == 'frequencyUnit' || item.columnName == 'runState' || item.columnName == 'taskType') {
           this.tableColsCopy.splice(index, 1)
         }
       })
-      console.log(this.tableColsCopy)
       this.tableDataCopy = _.cloneDeep(this.tableData);
       const datas = _.cloneDeep(this.tableColsCopy);
       // const reqUts = [];

+ 7 - 1
src/views/table/index.vue

@@ -501,8 +501,14 @@ export default {
     },
     //获取高级查询条件
     getColData (val) {
+      const arr = [...val]
+      if (arr && arr.length) {
+        arr.forEach(item => {
+          item.value = item.value.replace(/\s*/g, "")
+        })
+      }
       this.resetTable()
-      this.getQuery(this.queryId, val);
+      this.getQuery(this.queryId, arr);
     },
     //获取表格数据
     async getQuery (id, dataContent = this.dataContent) {