浏览代码

fix(power): power action filter

Casper Dai 2 年之前
父节点
当前提交
289c270582
共有 1 个文件被更改,包括 7 次插入4 次删除
  1. 7 4
      src/views/device/detail/components/DeviceInvoke/MultifunctionCardPowerSwitch.vue

+ 7 - 4
src/views/device/detail/components/DeviceInvoke/MultifunctionCardPowerSwitch.vue

@@ -193,8 +193,8 @@ export default {
         filters: [
           this.typeSelectSchema.options.length > 1 && { key: 'type', type: 'select', placeholder: '电源类型', options: this.typeSelectSchema.options },
           { key: 'action', type: 'select', placeholder: '执行动作', options: [
-            { value: PowerAction.OPEN, label: '开启' },
-            { value: PowerAction.CLOSE, label: '关闭' }
+            { value: PowerAction.OPEN, label: '包含开启' },
+            { value: PowerAction.CLOSE, label: '包含关闭' }
           ] },
           { key: 'enable', type: 'select', placeholder: '状态', options: [
             { value: true, label: '启用' },
@@ -635,8 +635,11 @@ export default {
               if (type && type !== task.type) {
                 return false
               }
-              if (action !== '' && action !== task.action) {
-                return false
+              if (action !== '') {
+                const key = action === PowerAction.OPEN ? 'start' : 'end'
+                if (!task.executeTime.some(time => time[key])) {
+                  return false
+                }
               }
               if (enable !== '' && enable !== task.enable) {
                 return false