Explorar o código

feat: adjust some styles

Casper Dai %!s(int64=2) %!d(string=hai) anos
pai
achega
4d1b901468

+ 38 - 24
src/views/device/detail/components/DeviceRuntime/OnlineDuration.vue

@@ -46,6 +46,7 @@
       size="lg fixed"
     >
       <div class="l-flex__none l-flex c-sibling-item--v">
+        <div class="l-flex--row u-bold">总时长:{{ total }}小时</div>
         <div class="l-flex__fill" />
         <el-select
           v-if="power"
@@ -71,6 +72,7 @@
           start-placeholder="开始日期"
           end-placeholder="结束日期"
           :picker-options="pickerOptions"
+          :clearable="false"
           @change="getOnlineDurationReport"
         />
       </div>
@@ -151,6 +153,14 @@ export default {
         map[data.sumDate] = seconds ? (seconds / 3600).toFixed(1) : '0'
       }
       return this.xData.map(date => map[date] || '0')
+    },
+    total () {
+      const val = this.valueData.reduce((total, val) => total + Number(val), 0)
+      const integer = val | 0
+      if (integer === val) {
+        return val
+      }
+      return val.toFixed(1)
     }
   },
   watch: {
@@ -175,32 +185,36 @@ export default {
       if (!this.$running) {
         return
       }
-      getOnlineDurationByDevice(this.device.id).then(({ data }) => {
-        if (data) {
-          const amounts = []
-          if (data.onlineSecondsUpdateTime) {
-            amounts.push({
-              key: 'online',
-              label: '播控器在线时长',
-              value: this.transformDuration(data.onlineSeconds),
-              timestamp: data.onlineSecondsUpdateTime
-            })
-          }
-          if (data.powerSecondsUpdateTime) {
-            amounts.push({
-              key: 'power',
-              label: '电源开启时长',
-              value: this.transformDuration(data.powerSeconds),
-              timestamp: data.powerSecondsUpdateTime
-            })
+      getOnlineDurationByDevice(this.device.id).then(
+        ({ data }) => {
+          if (data) {
+            const amounts = []
+            if (data.onlineSeconds) {
+              amounts.push({
+                key: 'online',
+                label: '播控器在线时长',
+                value: this.transformDuration(data.onlineSeconds),
+                timestamp: data.onlineSecondsUpdateTime
+              })
+            }
+            if (data.powerSeconds && data.powerSeconds !== '0') {
+              amounts.push({
+                key: 'power',
+                label: '电源开启时长',
+                value: this.transformDuration(data.powerSeconds),
+                timestamp: data.powerSecondsUpdateTime
+              })
+            }
+            this.amounts = amounts
+          } else {
+            this.amounts = []
           }
-          this.amounts = amounts
-        } else {
-          this.amounts = []
-        }
-      }).finally(() => {
+          return 60000
+        },
+        () => 2000
+      ).then(delay => {
         if (this.$running) {
-          this.$timer = setTimeout(this.startRun, 60000)
+          this.$timer = setTimeout(this.startRun, delay)
         }
       })
     },

+ 1 - 1
src/views/screen/review/workflow/audit/index.vue

@@ -230,7 +230,7 @@ export default {
           { prop: 'priority', label: '优先级', width: 100, align: 'center' },
           { prop: 'type', label: '上播内容', width: 80, align: 'center' },
           { prop: 'name', label: '' },
-          { prop: 'ratio', label: '适配', width: 120, align: 'center' },
+          { prop: 'ratio', label: '适配', width: 120 },
           { prop: 'user', label: '申请人', width: 160, align: 'center' },
           { type: 'invoke', render: [
             this.needView && { label: '查看', on: this.onView },

+ 2 - 2
src/views/screen/review/workflow/history/index.vue

@@ -41,8 +41,8 @@ export default {
           { prop: 'priority', label: '优先级', width: 100, align: 'center' },
           { prop: 'type', label: '上播内容', width: 80, align: 'center' },
           { prop: 'name', label: '' },
-          { prop: 'createByUsername', label: '发布人', width: 120, align: 'center' },
-          { prop: 'createTime', label: '发布时间', width: 160 },
+          { prop: 'createByUsername', label: '发布人', width: 160, align: 'center' },
+          { prop: 'createTime', label: '发布时间', width: 160, align: 'center' },
           { type: 'tag', render: ({ status, remark }) => {
             switch (status) {
               case State.SUBMITTED:

+ 1 - 1
src/views/screen/review/workflow/index.vue

@@ -37,7 +37,7 @@ export default {
           { prop: 'flowDesc', label: '优先级', width: 100, align: 'center' },
           { prop: 'flowName', label: '上播内容' },
           { prop: 'createUser', label: '申请人', width: 160, align: 'center' },
-          { prop: 'updateTime', label: '提交时间', width: 160, align: 'center' },
+          { prop: 'createTime', label: '提交时间', width: 160, align: 'center' },
           { type: 'invoke', render: [
             { label: '审核', on: this.onAudit }
           ] }

+ 2 - 3
src/views/screen/review/workflow/mine/index.vue

@@ -19,7 +19,7 @@
         name="3"
       />
       <el-tab-pane
-        label="已审核"
+        label="通过"
         name="2"
       />
     </el-tabs>
@@ -74,10 +74,9 @@ export default {
           { prop: 'flowDesc', label: '优先级', width: 100, align: 'center' },
           { prop: 'flowName', label: '上播内容' },
           isSubmitted && { label: '当前节点', render: ({ currentSeveralReviewed }) => WorkflowStateInfo[currentSeveralReviewed], width: 100, align: 'center' },
-          isRejected && { prop: 'updateBy', label: '审核人', width: 120, align: 'center' },
           isRejected && { prop: 'reason', label: '驳回原因', 'min-width': 60 },
+          { prop: 'updateTime', label: isSubmitted ? '最近审核' : '审核时间', width: 160, align: 'center' },
           { prop: 'createTime', label: '提交时间', width: 160, align: 'center' },
-          { prop: 'updateTime', label: '更新时间', width: 160, align: 'center' },
           { type: 'invoke', render: [
             { label: '详情', on: this.onView },
             { label: '流程历史', on: this.onViewHistory }