Przeglądaj źródła

feat: transmitter supports the configuration of the recovery card

Casper Dai 3 lat temu
rodzic
commit
504edf590b

+ 2 - 1
src/constant.js

@@ -80,7 +80,8 @@ export const Camera = {
 export const Transmitter = {
   IS_ASYNC: 1,
   SUPPORT_DETECTION: 1 << 1,
-  SUPPORT_CONTENT_PROTECTION: 1 << 2
+  SUPPORT_CONTENT_PROTECTION: 1 << 2,
+  RECOVERY_CARD: 1 << 3
 }
 
 export const Access = {

+ 13 - 0
src/views/device/detail/components/external/Transmitter/index.vue

@@ -58,6 +58,13 @@
                 <div class="l-flex__fill c-info__value">{{ supportContentProtection }}</div>
               </div>
             </div>
+            <div class="l-flex--row c-info__block">
+              <div class="l-flex--row l-flex__fill c-info__item">
+                <div class="l-flex__none c-info__title">回采卡</div>
+                <div class="l-flex__fill c-info__value">{{ recoveryCard }}</div>
+              </div>
+              <div class="l-flex--row l-flex__fill c-info__item" />
+            </div>
           </div>
         </template>
         <template v-else>
@@ -136,6 +143,9 @@ export default {
             if (flag & Transmitter.SUPPORT_CONTENT_PROTECTION) {
               tags.push({ type: 'success', label: '内容保护' })
             }
+            if (flag & Transmitter.RECOVERY_CARD) {
+              tags.push({ type: 'success', label: '回采卡' })
+            }
             return tags
           }, on: this.onClickTag },
           { prop: 'remark', label: '备注' }
@@ -155,6 +165,9 @@ export default {
     },
     supportContentProtection () {
       return this.transmitter && this.transmitter.flag & Transmitter.SUPPORT_CONTENT_PROTECTION ? '支持' : '不支持'
+    },
+    recoveryCard () {
+      return this.transmitter && this.transmitter.flag & Transmitter.RECOVERY_CARD ? '包含' : '不包含'
     }
   },
   created () {

+ 24 - 5
src/views/external/transmitter/index.vue

@@ -35,9 +35,13 @@
           maxlength="50"
           clearable
         />
-        <span class="c-grid-form__label">异步盒:</span>
+        <span class="c-grid-form__label">特性:</span>
         <div class="l-flex--row c-grid-form__option">
-          <el-switch
+          <el-checkbox v-model="flag.async">异步盒</el-checkbox>
+          <el-checkbox v-model="flag.detection">设备监测</el-checkbox>
+          <el-checkbox v-model="flag.contentProtection">内容保护</el-checkbox>
+          <el-checkbox v-model="flag.recoveryCard">回采卡</el-checkbox>
+          <!-- <el-switch
             v-model="flag.async"
             class="c-sibling-item"
             active-color="#13ce66"
@@ -57,6 +61,13 @@
             active-color="#13ce66"
             inactive-color="#ff4949"
           />
+          <span class="c-sibling-item far">回采卡:</span>
+          <el-switch
+            v-model="flag.recoveryCard"
+            class="c-sibling-item"
+            active-color="#13ce66"
+            inactive-color="#ff4949"
+          /> -->
         </div>
         <span class="c-grid-form__label">备注:</span>
         <el-input
@@ -120,6 +131,9 @@ export default {
             if (flag & Transmitter.SUPPORT_CONTENT_PROTECTION) {
               tags.push({ type: 'success', label: '内容保护' })
             }
+            if (flag & Transmitter.RECOVERY_CARD) {
+              tags.push({ type: 'success', label: '回采卡' })
+            }
             return tags
           }, on: this.onClickTag },
           { prop: 'remark', label: '备注' },
@@ -147,7 +161,8 @@ export default {
       this.flag = {
         async: false,
         detection: false,
-        contentProtection: false
+        contentProtection: false,
+        recoveryCard: false
       }
       this.$refs.editDialog.show()
     },
@@ -157,7 +172,8 @@ export default {
       this.flag = {
         async: !!(flag & Transmitter.IS_ASYNC),
         detection: !!(flag & Transmitter.SUPPORT_DETECTION),
-        contentProtection: !!(flag & Transmitter.SUPPORT_CONTENT_PROTECTION)
+        contentProtection: !!(flag & Transmitter.SUPPORT_CONTENT_PROTECTION),
+        recoveryCard: !!(flag & Transmitter.RECOVERY_CARD)
       }
       this.$refs.editDialog.show()
     },
@@ -183,7 +199,7 @@ export default {
         })
         return
       }
-      const { async: isAsync, detection, contentProtection } = this.flag
+      const { async: isAsync, detection, contentProtection, recoveryCard } = this.flag
       let flag = 0
       if (isAsync) {
         flag |= Transmitter.IS_ASYNC
@@ -194,6 +210,9 @@ export default {
       if (contentProtection) {
         flag |= Transmitter.SUPPORT_CONTENT_PROTECTION
       }
+      if (recoveryCard) {
+        flag |= Transmitter.RECOVERY_CARD
+      }
       const transmitter = {
         ...this.transmitter,
         flag