husq
2023-09-18 c71f0ccaff9d445bc3458f1118c3d9657e5b2f1c
Merge branch 'demo' of http://s16s652780.51mypc.cn:49896/r/yskj/iot_drone_web into demo
2 files modified
599 ■■■■ changed files
src/pages/page-web/projects/task.vue 596 ●●●● patch | view | raw | blame | history
src/types/device.ts 3 ●●●● patch | view | raw | blame | history
src/pages/page-web/projects/task.vue
@@ -26,159 +26,379 @@
    <div v-else>
      <!--机场-->
      <a-collapse :bordered="false" expandIconPosition="right" accordion style="background: #232323;">
        <a-collapse-panel :key="EDeviceTypeName.Dock" header="机场" style="border-bottom: 1px solid #4f4f4f;">
          <div v-if="onlineDocks.data.length === 0" style="height: 150px; color: white;">
            <a-empty style="color: #fff;" :image="simpleImage" description="暂无数据" :image-style="{ height: '60px' }" />
          </div>
          <div v-else class="fz12" style="color: white;">
            <div v-for="dock in onlineDocks.data" :key="dock.sn"
                 style="background: #3c3c3c; height: 90px; margin-bottom: 10px;">
              <div style="border-radius: 2px; height: 100%; width: 100%;"
                   class="flex-row flex-justify-between flex-align-center">
                <div style="float: left; padding: 0px 5px 8px 8px; width: 88%">
                  <!-- // 机场设备标题 -->
                  <div style="width: 80%; height: 30px; line-height: 30px; font-size: 16px;">
                    <a-tooltip :title="`${dock.gateway.callsign} - ${dock.callsign ?? 'No Drone'}`">
                      <div class="text-hidden" style="max-width: 200px;">{{ dock.gateway.callsign }} - {{ dock.callsign ??
                      'No Drone' }}</div>
                    </a-tooltip>
                  </div>
                  <!-- // 机场设备状态 -->
                  <div class="mt5 flex-align-center flex-row flex-justify-between" style="background: #595959;">
                    <div class="flex-align-center flex-row">
                      <span class="ml5 mr5">
                        <RobotOutlined />
                      </span>
                      <div class="font-bold text-hidden" style="max-width: 80px;"
                           :style="dockInfo[dock.gateway.sn] && dockInfo[dock.gateway.sn].basic_osd?.mode_code !== EDockModeCode.Disconnected ? 'color: #00ee8b' : 'color: red;'">
                        {{ dockInfo[dock.gateway.sn] ? EDockModeText[dockInfo[dock.gateway.sn].basic_osd?.mode_code] :
                          EDockModeText[EDockModeCode.Disconnected] }}
                      </div>
                    </div>
                    <div class="mr5 flex-align-center flex-row" style="width: 85px; margin-right: 0; height: 18px;">
                      <div v-if="hmsInfo[dock.gateway.sn]" class="flex-align-center flex-row">
                        <div :class="hmsInfo[dock.gateway.sn][0].level === EHmsLevel.CAUTION ? 'caution-blink' :
                          hmsInfo[dock.gateway.sn][0].level === EHmsLevel.WARN ? 'warn-blink' : 'notice-blink'"
                             style="width: 18px; height: 16px; text-align: center;">
                          <span :style="hmsInfo[dock.gateway.sn].length > 99 ? 'font-size: 11px' : 'font-size: 12px'">{{
                              hmsInfo[dock.gateway.sn].length }}</span>
                          <span class="fz10">{{ hmsInfo[dock.gateway.sn].length > 99 ? '+' : '' }}</span>
                        </div>
                        <a-popover trigger="click" placement="bottom" color="black"
                                   v-model:visible="hmsVisible[dock.gateway.sn]"
                                   @visibleChange="readHms(hmsVisible[dock.gateway.sn], dock.gateway.sn)"
                                   :overlayStyle="{ width: '200px', height: '300px' }">
                          <div :class="hmsInfo[dock.gateway.sn][0].level === EHmsLevel.CAUTION ? 'caution' :
                            hmsInfo[dock.gateway.sn][0].level === EHmsLevel.WARN ? 'warn' : 'notice'"
                               style="margin-left: 3px; width: 62px; height: 16px;">
                            <span class="word-loop">{{ hmsInfo[dock.gateway.sn][0].message_zh }}</span>
                          </div>
                          <template #content>
                            <a-collapse style="background: black; height: 300px; overflow-y: auto;" :bordered="false"
                                        expand-icon-position="right" :accordion="true">
                              <a-collapse-panel v-for="hms in hmsInfo[dock.gateway.sn]" :key="hms.hms_id"
                                                :showArrow="false"
                                                style=" margin: 0 auto 3px auto; border: 0; width: 140px; border-radius: 3px"
                                                :class="hms.level === EHmsLevel.CAUTION ? 'caution' : hms.level === EHmsLevel.WARN ? 'warn' : 'notice'">
                                <template #header="{ isActive }">
                                  <div class="flex-row flex-align-center" style="width: 130px;">
                                    <div style="width: 110px;">
                                      <span class="word-loop">{{ hms.message_zh }}</span>
                                    </div>
                                    <div style="width: 20px; height: 15px; font-size: 10px; z-index: 2 "
                                         class="flex-row flex-align-center flex-justify-center"
                                         :class="hms.level === EHmsLevel.CAUTION ? 'caution' : hms.level === EHmsLevel.WARN ? 'warn' : 'notice'">
                                      <DoubleRightOutlined :rotate="isActive ? 90 : 0" />
                                    </div>
                                  </div>
                                </template>
      <div>
        <a-row style="padding: 15px 0">
          <a-col :span="1"></a-col>
          <a-col :span="14">
            当前设备
          </a-col>
          <a-col :span="8">
            <a-checkbox v-model:checked="onlineCheck" @change="onlineCheckBoxChange">
              <span style="color: #ffffff">全选({{ onlineCheckArr.data.length }}/{{ onlineDocks.data.length }})</span>
            </a-checkbox>
          </a-col>
          <a-col :span="1"></a-col>
                                <a-tooltip :title="hms.create_time">
                                  <div style="color: white;" class="text-hidden">{{ hms.create_time }}</div>
                                </a-tooltip>
                              </a-collapse-panel>
                            </a-collapse>
                          </template>
                        </a-popover>
                      </div>
                      <div v-else class="width-100" style="height: 90%; background: rgba(0, 0, 0, 0.35)"></div>
                    </div>
                  </div>
                  <!-- // 机场是否启动 -->
                  <div class="mt5 flex-align-center flex-row flex-justify-between" style="background: #595959;">
                    <div class="flex-row">
                      <span class="ml5 mr5">
                        <RocketOutlined />
                      </span>
                      <div class="font-bold text-hidden" style="max-width: 80px"
                           :style="deviceInfo[dock.sn] && deviceInfo[dock.sn].mode_code !== EModeCode.Disconnected ? 'color: #00ee8b' : 'color: red;'">
                        {{ deviceInfo[dock.sn] ? EModeText[deviceInfo[dock.sn].mode_code] :
                          EModeText[EModeCode.Disconnected] }}
                      </div>
                    </div>
                    <div class="mr5 flex-align-center flex-row" style="width: 85px; margin-right: 0; height: 18px;">
                      <div v-if="hmsInfo[dock.sn]" class="flex-align-center flex-row">
                        <div :class="hmsInfo[dock.sn][0].level === EHmsLevel.CAUTION ? 'caution-blink' :
                          hmsInfo[dock.sn][0].level === EHmsLevel.WARN ? 'warn-blink' : 'notice-blink'"
                             style="width: 18px; height: 16px; text-align: center;">
                          <span :style="hmsInfo[dock.sn].length > 99 ? 'font-size: 11px' : 'font-size: 12px'">{{
                              hmsInfo[dock.sn].length }}</span>
                          <span class="fz10">{{ hmsInfo[dock.sn].length > 99 ? '+' : '' }}</span>
                        </div>
                        <a-popover trigger="click" placement="bottom" color="black" v-model:visible="hmsVisible[dock.sn]"
                                   @visibleChange="readHms(hmsVisible[dock.sn], dock.sn)"
                                   :overlayStyle="{ width: '200px', height: '300px' }">
                          <div :class="hmsInfo[dock.sn][0].level === EHmsLevel.CAUTION ? 'caution' :
                            hmsInfo[dock.sn][0].level === EHmsLevel.WARN ? 'warn' : 'notice'"
                               style="margin-left: 3px; width: 62px; height: 16px;">
                            <span class="word-loop">{{ hmsInfo[dock.sn][0].message_en }}</span>
                          </div>
                          <template #content>
                            <a-collapse style="background: black; height: 300px; overflow-y: auto;" :bordered="false"
                                        expand-icon-position="right" :accordion="true">
                              <a-collapse-panel v-for="hms in hmsInfo[dock.sn]" :key="hms.hms_id" :showArrow="false"
                                                style=" margin: 0 auto 3px auto; border: 0; width: 140px; border-radius: 3px"
                                                :class="hms.level === EHmsLevel.CAUTION ? 'caution' : hms.level === EHmsLevel.WARN ? 'warn' : 'notice'">
                                <template #header="{ isActive }">
                                  <div class="flex-row flex-align-center" style="width: 130px;">
                                    <div style="width: 110px;">
                                      <span class="word-loop">{{ hms.message_en }}</span>
                                    </div>
                                    <div style="width: 20px; height: 15px; font-size: 10px; z-index: 2 "
                                         class="flex-row flex-align-center flex-justify-center"
                                         :class="hms.level === EHmsLevel.CAUTION ? 'caution' : hms.level === EHmsLevel.WARN ? 'warn' : 'notice'">
                                      <DoubleRightOutlined :rotate="isActive ? 90 : 0" />
                                    </div>
                                  </div>
                                </template>
        </a-row>
                                <a-tooltip :title="hms.create_time">
                                  <div style="color: white;" class="text-hidden">{{ hms.create_time }}</div>
                                </a-tooltip>
                              </a-collapse-panel>
                            </a-collapse>
                          </template>
                        </a-popover>
                      </div>
                      <div v-else class="width-100" style="height: 90%; background: rgba(0, 0, 0, 0.35)"></div>
                    </div>
        <a-row>
          <a-col :span="1"></a-col>
          <a-col :span="22">
            <div v-if="onlineDocks.data.length === 0" style="height: 150px; color: white;">
              <a-empty style="color: #fff;" :image="simpleImage" description="暂无数据"
                       :image-style="{ height: '60px' }"/>
            </div>
            <div v-else class="fz12" style="color: white;">
              <div @click="selectOnlineDock(dock)" v-for="dock in onlineDocks.data" :key="dock.sn"
                   :style="{cursor:'pointer', background: '#3c3c3c', height: '130px', 'margin-bottom': '10px',border:dock.selected?'2px solid #2b85e4':''}">
                <div class="job-info">
                  <div class="job-status">
                    <FileTextOutlined /> 执行失败
                  </div>
                  <div class="job-name">
                    任务标题
                  </div>
                </div>
                <div style="border-radius: 2px; height: 60%; width: 100%;" class="flex-row flex-justify-between flex-align-center">
                  <div style="float: left; padding: 0px 5px 8px 8px; width: 88%">
                    <!-- // 机场设备标题 -->
                    <div style="width: 80%; height: 30px; line-height: 30px; font-size: 16px;">
                      <a-tooltip :title="`${dock.gateway.callsign} - ${dock.callsign ?? 'No Drone'}`">
                        <div class="text-hidden" style="max-width: 200px;">{{ dock.gateway.callsign }} - {{
                            dock.callsign ??
                            'No Drone'
                          }}
                        </div>
                      </a-tooltip>
                    </div>
                    <!-- // 机场设备状态 -->
                    <div class="mt5 flex-align-center flex-row flex-justify-between" style="background: #595959;">
                      <div class="flex-align-center flex-row">
                      <span class="ml5 mr5">
                        <RobotOutlined/>
                      </span>
                        <div class="font-bold text-hidden" style="max-width: 80px;"
                             :style="dockInfo[dock.gateway.sn] && dockInfo[dock.gateway.sn].basic_osd?.mode_code !== EDockModeCode.Disconnected ? 'color: #00ee8b' : 'color: red;'">
                          {{
                            dockInfo[dock.gateway.sn] ? EDockModeText[dockInfo[dock.gateway.sn].basic_osd?.mode_code] :
                                EDockModeText[EDockModeCode.Disconnected]
                          }}
                        </div>
                      </div>
                      <div class="mr5 flex-align-center flex-row" style="width: 85px; margin-right: 0; height: 18px;">
                        <div v-if="hmsInfo[dock.gateway.sn]" class="flex-align-center flex-row">
                          <div :class="hmsInfo[dock.gateway.sn][0].level === EHmsLevel.CAUTION ? 'caution-blink' :
                          hmsInfo[dock.gateway.sn][0].level === EHmsLevel.WARN ? 'warn-blink' : 'notice-blink'"
                               style="width: 18px; height: 16px; text-align: center;">
                          <span :style="hmsInfo[dock.gateway.sn].length > 99 ? 'font-size: 11px' : 'font-size: 12px'">{{
                              hmsInfo[dock.gateway.sn].length
                            }}</span>
                            <span class="fz10">{{ hmsInfo[dock.gateway.sn].length > 99 ? '+' : '' }}</span>
                          </div>
                          <a-popover trigger="click" placement="bottom" color="black"
                                     v-model:visible="hmsVisible[dock.gateway.sn]"
                                     @visibleChange="readHms(hmsVisible[dock.gateway.sn], dock.gateway.sn)"
                                     :overlayStyle="{ width: '200px', height: '300px' }">
                            <div :class="hmsInfo[dock.gateway.sn][0].level === EHmsLevel.CAUTION ? 'caution' :
                            hmsInfo[dock.gateway.sn][0].level === EHmsLevel.WARN ? 'warn' : 'notice'"
                                 style="margin-left: 3px; width: 62px; height: 16px;">
                              <span class="word-loop">{{ hmsInfo[dock.gateway.sn][0].message_zh }}</span>
                            </div>
                            <template #content>
                              <a-collapse style="background: black; height: 300px; overflow-y: auto;" :bordered="false"
                                          expand-icon-position="right" :accordion="true">
                                <a-collapse-panel v-for="hms in hmsInfo[dock.gateway.sn]" :key="hms.hms_id"
                                                  :showArrow="false"
                                                  style=" margin: 0 auto 3px auto; border: 0; width: 140px; border-radius: 3px"
                                                  :class="hms.level === EHmsLevel.CAUTION ? 'caution' : hms.level === EHmsLevel.WARN ? 'warn' : 'notice'">
                                  <template #header="{ isActive }">
                                    <div class="flex-row flex-align-center" style="width: 130px;">
                                      <div style="width: 110px;">
                                        <span class="word-loop">{{ hms.message_zh }}</span>
                                      </div>
                                      <div style="width: 20px; height: 15px; font-size: 10px; z-index: 2 "
                                           class="flex-row flex-align-center flex-justify-center"
                                           :class="hms.level === EHmsLevel.CAUTION ? 'caution' : hms.level === EHmsLevel.WARN ? 'warn' : 'notice'">
                                        <DoubleRightOutlined :rotate="isActive ? 90 : 0"/>
                                      </div>
                                    </div>
                                  </template>
                                  <a-tooltip :title="hms.create_time">
                                    <div style="color: white;" class="text-hidden">{{ hms.create_time }}</div>
                                  </a-tooltip>
                                </a-collapse-panel>
                              </a-collapse>
                            </template>
                          </a-popover>
                        </div>
                        <div v-else class="width-100" style="height: 90%; background: rgba(0, 0, 0, 0.35)"></div>
                      </div>
                    </div>
                    <!-- // 机场是否启动 -->
                    <div class="mt5 flex-align-center flex-row flex-justify-between" style="background: #595959;">
                      <div class="flex-row">
                      <span class="ml5 mr5">
                        <RocketOutlined/>
                      </span>
                        <div class="font-bold text-hidden" style="max-width: 80px"
                             :style="deviceInfo[dock.sn] && deviceInfo[dock.sn].mode_code !== EModeCode.Disconnected ? 'color: #00ee8b' : 'color: red;'">
                          {{
                            deviceInfo[dock.sn] ? EModeText[deviceInfo[dock.sn].mode_code] :
                                EModeText[EModeCode.Disconnected]
                          }}
                        </div>
                      </div>
                      <div class="mr5 flex-align-center flex-row" style="width: 85px; margin-right: 0; height: 18px;">
                        <div v-if="hmsInfo[dock.sn]" class="flex-align-center flex-row">
                          <div :class="hmsInfo[dock.sn][0].level === EHmsLevel.CAUTION ? 'caution-blink' :
                          hmsInfo[dock.sn][0].level === EHmsLevel.WARN ? 'warn-blink' : 'notice-blink'"
                               style="width: 18px; height: 16px; text-align: center;">
                          <span :style="hmsInfo[dock.sn].length > 99 ? 'font-size: 11px' : 'font-size: 12px'">{{
                              hmsInfo[dock.sn].length
                            }}</span>
                            <span class="fz10">{{ hmsInfo[dock.sn].length > 99 ? '+' : '' }}</span>
                          </div>
                          <a-popover trigger="click" placement="bottom" color="black"
                                     v-model:visible="hmsVisible[dock.sn]"
                                     @visibleChange="readHms(hmsVisible[dock.sn], dock.sn)"
                                     :overlayStyle="{ width: '200px', height: '300px' }">
                            <div :class="hmsInfo[dock.sn][0].level === EHmsLevel.CAUTION ? 'caution' :
                            hmsInfo[dock.sn][0].level === EHmsLevel.WARN ? 'warn' : 'notice'"
                                 style="margin-left: 3px; width: 62px; height: 16px;">
                              <span class="word-loop">{{ hmsInfo[dock.sn][0].message_en }}</span>
                            </div>
                            <template #content>
                              <a-collapse style="background: black; height: 300px; overflow-y: auto;" :bordered="false"
                                          expand-icon-position="right" :accordion="true">
                                <a-collapse-panel v-for="hms in hmsInfo[dock.sn]" :key="hms.hms_id" :showArrow="false"
                                                  style=" margin: 0 auto 3px auto; border: 0; width: 140px; border-radius: 3px"
                                                  :class="hms.level === EHmsLevel.CAUTION ? 'caution' : hms.level === EHmsLevel.WARN ? 'warn' : 'notice'">
                                  <template #header="{ isActive }">
                                    <div class="flex-row flex-align-center" style="width: 130px;">
                                      <div style="width: 110px;">
                                        <span class="word-loop">{{ hms.message_en }}</span>
                                      </div>
                                      <div style="width: 20px; height: 15px; font-size: 10px; z-index: 2 "
                                           class="flex-row flex-align-center flex-justify-center"
                                           :class="hms.level === EHmsLevel.CAUTION ? 'caution' : hms.level === EHmsLevel.WARN ? 'warn' : 'notice'">
                                        <DoubleRightOutlined :rotate="isActive ? 90 : 0"/>
                                      </div>
                                    </div>
                                  </template>
                                  <a-tooltip :title="hms.create_time">
                                    <div style="color: white;" class="text-hidden">{{ hms.create_time }}</div>
                                  </a-tooltip>
                                </a-collapse-panel>
                              </a-collapse>
                            </template>
                          </a-popover>
                        </div>
                        <div v-else class="width-100" style="height: 90%; background: rgba(0, 0, 0, 0.35)"></div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </a-collapse-panel>
      </a-collapse>
          </a-col>
        </a-row>
        <a-row style="padding: 15px 0">
          <a-col :span="1"></a-col>
          <a-col :span="14">
            历史设备
          </a-col>
          <a-col :span="8">
            <a-checkbox v-model:checked="historyCheck" @change="historyCheckBoxChange">
              <span style="color: #ffffff">全选({{ historyCheckArr.data.length }}/{{ historyDocks.data.length }})</span>
            </a-checkbox>
          </a-col>
          <a-col :span="1"></a-col>
        </a-row>
        <a-row>
          <a-col :span="1"></a-col>
          <a-col :span="22">
            <div v-if="historyDocks.data.length === 0" style="height: 150px; color: white;">
              <a-empty style="color: #fff;" :image="simpleImage" description="暂无数据"
                       :image-style="{ height: '60px' }"/>
            </div>
            <div v-else class="fz12" style="color: white;">
              <div @click="selectHistoryDock(dock)" v-for="dock in historyDocks.data" :key="dock.sn"
                   :style="{cursor:'pointer', background: '#3c3c3c', height: '90px', 'margin-bottom': '10px',border:dock.selected?'2px solid #2b85e4':''}">
                <div style="border-radius: 2px; height: 100%; width: 100%;"
                     class="flex-row flex-justify-between flex-align-center">
                  <div style="float: left; padding: 0px 5px 8px 8px; width: 88%">
                    <!-- // 机场设备标题 -->
                    <div style="width: 80%; height: 30px; line-height: 30px; font-size: 16px;">
                      <a-tooltip :title="`${dock.gateway.callsign} - ${dock.callsign ?? 'No Drone'}`">
                        <div class="text-hidden" style="max-width: 200px;">{{ dock.gateway.callsign }} - {{
                            dock.callsign ??
                            'No Drone'
                          }}
                        </div>
                      </a-tooltip>
                    </div>
                    <!-- // 机场设备状态 -->
                    <div class="mt5 flex-align-center flex-row flex-justify-between" style="background: #595959;">
                      <div class="flex-align-center flex-row">
                      <span class="ml5 mr5">
                        <RobotOutlined/>
                      </span>
                        <div class="font-bold text-hidden" style="max-width: 80px;"
                             :style="dockInfo[dock.gateway.sn] && dockInfo[dock.gateway.sn].basic_osd?.mode_code !== EDockModeCode.Disconnected ? 'color: #00ee8b' : 'color: red;'">
                          {{
                            dockInfo[dock.gateway.sn] ? EDockModeText[dockInfo[dock.gateway.sn].basic_osd?.mode_code] :
                                EDockModeText[EDockModeCode.Disconnected]
                          }}
                        </div>
                      </div>
                      <div class="mr5 flex-align-center flex-row" style="width: 85px; margin-right: 0; height: 18px;">
                        <div v-if="hmsInfo[dock.gateway.sn]" class="flex-align-center flex-row">
                          <div :class="hmsInfo[dock.gateway.sn][0].level === EHmsLevel.CAUTION ? 'caution-blink' :
                          hmsInfo[dock.gateway.sn][0].level === EHmsLevel.WARN ? 'warn-blink' : 'notice-blink'"
                               style="width: 18px; height: 16px; text-align: center;">
                          <span :style="hmsInfo[dock.gateway.sn].length > 99 ? 'font-size: 11px' : 'font-size: 12px'">{{
                              hmsInfo[dock.gateway.sn].length
                            }}</span>
                            <span class="fz10">{{ hmsInfo[dock.gateway.sn].length > 99 ? '+' : '' }}</span>
                          </div>
                          <a-popover trigger="click" placement="bottom" color="black"
                                     v-model:visible="hmsVisible[dock.gateway.sn]"
                                     @visibleChange="readHms(hmsVisible[dock.gateway.sn], dock.gateway.sn)"
                                     :overlayStyle="{ width: '200px', height: '300px' }">
                            <div :class="hmsInfo[dock.gateway.sn][0].level === EHmsLevel.CAUTION ? 'caution' :
                            hmsInfo[dock.gateway.sn][0].level === EHmsLevel.WARN ? 'warn' : 'notice'"
                                 style="margin-left: 3px; width: 62px; height: 16px;">
                              <span class="word-loop">{{ hmsInfo[dock.gateway.sn][0].message_zh }}</span>
                            </div>
                            <template #content>
                              <a-collapse style="background: black; height: 300px; overflow-y: auto;" :bordered="false"
                                          expand-icon-position="right" :accordion="true">
                                <a-collapse-panel v-for="hms in hmsInfo[dock.gateway.sn]" :key="hms.hms_id"
                                                  :showArrow="false"
                                                  style=" margin: 0 auto 3px auto; border: 0; width: 140px; border-radius: 3px"
                                                  :class="hms.level === EHmsLevel.CAUTION ? 'caution' : hms.level === EHmsLevel.WARN ? 'warn' : 'notice'">
                                  <template #header="{ isActive }">
                                    <div class="flex-row flex-align-center" style="width: 130px;">
                                      <div style="width: 110px;">
                                        <span class="word-loop">{{ hms.message_zh }}</span>
                                      </div>
                                      <div style="width: 20px; height: 15px; font-size: 10px; z-index: 2 "
                                           class="flex-row flex-align-center flex-justify-center"
                                           :class="hms.level === EHmsLevel.CAUTION ? 'caution' : hms.level === EHmsLevel.WARN ? 'warn' : 'notice'">
                                        <DoubleRightOutlined :rotate="isActive ? 90 : 0"/>
                                      </div>
                                    </div>
                                  </template>
                                  <a-tooltip :title="hms.create_time">
                                    <div style="color: white;" class="text-hidden">{{ hms.create_time }}</div>
                                  </a-tooltip>
                                </a-collapse-panel>
                              </a-collapse>
                            </template>
                          </a-popover>
                        </div>
                        <div v-else class="width-100" style="height: 90%; background: rgba(0, 0, 0, 0.35)"></div>
                      </div>
                    </div>
                    <!-- // 机场是否启动 -->
                    <div class="mt5 flex-align-center flex-row flex-justify-between" style="background: #595959;">
                      <div class="flex-row">
                      <span class="ml5 mr5">
                        <RocketOutlined/>
                      </span>
                        <div class="font-bold text-hidden" style="max-width: 80px"
                             :style="deviceInfo[dock.sn] && deviceInfo[dock.sn].mode_code !== EModeCode.Disconnected ? 'color: #00ee8b' : 'color: red;'">
                          {{
                            deviceInfo[dock.sn] ? EModeText[deviceInfo[dock.sn].mode_code] :
                                EModeText[EModeCode.Disconnected]
                          }}
                        </div>
                      </div>
                      <div class="mr5 flex-align-center flex-row" style="width: 85px; margin-right: 0; height: 18px;">
                        <div v-if="hmsInfo[dock.sn]" class="flex-align-center flex-row">
                          <div :class="hmsInfo[dock.sn][0].level === EHmsLevel.CAUTION ? 'caution-blink' :
                          hmsInfo[dock.sn][0].level === EHmsLevel.WARN ? 'warn-blink' : 'notice-blink'"
                               style="width: 18px; height: 16px; text-align: center;">
                          <span :style="hmsInfo[dock.sn].length > 99 ? 'font-size: 11px' : 'font-size: 12px'">{{
                              hmsInfo[dock.sn].length
                            }}</span>
                            <span class="fz10">{{ hmsInfo[dock.sn].length > 99 ? '+' : '' }}</span>
                          </div>
                          <a-popover trigger="click" placement="bottom" color="black"
                                     v-model:visible="hmsVisible[dock.sn]"
                                     @visibleChange="readHms(hmsVisible[dock.sn], dock.sn)"
                                     :overlayStyle="{ width: '200px', height: '300px' }">
                            <div :class="hmsInfo[dock.sn][0].level === EHmsLevel.CAUTION ? 'caution' :
                            hmsInfo[dock.sn][0].level === EHmsLevel.WARN ? 'warn' : 'notice'"
                                 style="margin-left: 3px; width: 62px; height: 16px;">
                              <span class="word-loop">{{ hmsInfo[dock.sn][0].message_en }}</span>
                            </div>
                            <template #content>
                              <a-collapse style="background: black; height: 300px; overflow-y: auto;" :bordered="false"
                                          expand-icon-position="right" :accordion="true">
                                <a-collapse-panel v-for="hms in hmsInfo[dock.sn]" :key="hms.hms_id" :showArrow="false"
                                                  style=" margin: 0 auto 3px auto; border: 0; width: 140px; border-radius: 3px"
                                                  :class="hms.level === EHmsLevel.CAUTION ? 'caution' : hms.level === EHmsLevel.WARN ? 'warn' : 'notice'">
                                  <template #header="{ isActive }">
                                    <div class="flex-row flex-align-center" style="width: 130px;">
                                      <div style="width: 110px;">
                                        <span class="word-loop">{{ hms.message_en }}</span>
                                      </div>
                                      <div style="width: 20px; height: 15px; font-size: 10px; z-index: 2 "
                                           class="flex-row flex-align-center flex-justify-center"
                                           :class="hms.level === EHmsLevel.CAUTION ? 'caution' : hms.level === EHmsLevel.WARN ? 'warn' : 'notice'">
                                        <DoubleRightOutlined :rotate="isActive ? 90 : 0"/>
                                      </div>
                                    </div>
                                  </template>
                                  <a-tooltip :title="hms.create_time">
                                    <div style="color: white;" class="text-hidden">{{ hms.create_time }}</div>
                                  </a-tooltip>
                                </a-collapse-panel>
                              </a-collapse>
                            </template>
                          </a-popover>
                        </div>
                        <div v-else class="width-100" style="height: 90%; background: rgba(0, 0, 0, 0.35)"></div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </a-col>
        </a-row>
      </div>
    </div>
  </div>
</template>
<script lang="ts" setup>
import { PlusOutlined, MinusOutlined, RocketOutlined, EyeInvisibleOutlined, EyeOutlined, RobotOutlined, DoubleRightOutlined } from '@ant-design/icons-vue'
import {
  PlusOutlined,
  MinusOutlined,
  RocketOutlined,
  EyeInvisibleOutlined,
  EyeOutlined,
  RobotOutlined,
  DoubleRightOutlined,
  FileTextOutlined,
} from '@ant-design/icons-vue'
import { useRoute } from 'vue-router'
import { ERouterName, EHmsLevel } from '/@/types/enums'
import { computed, onMounted, reactive, ref, watch, WritableComputedRef } from 'vue'
@@ -210,11 +430,26 @@
const onlineDocks = reactive({
  data: [] as OnlineDevice[]
})
const onlineCheckArr = reactive({
  data: [] as OnlineDevice[]
})
const onlineDevices = reactive({
  data: [] as OnlineDevice[]
})
const osdVisible = ref({} as OSDVisible)
const historyCheckArr = reactive({
  data: [] as OnlineDevice[]
})
const historyDocks = reactive({
  data: [] as OnlineDevice[]
})
const osdVisible = ref({} as OSDVisible)
const onlineCheck = ref(false)
const historyCheck = ref(false)
onMounted(() => {
  getOnlineTopo()
  setTimeout(() => {
@@ -235,6 +470,58 @@
  const parent = element?.parentNode as HTMLDivElement
  scorllHeight.value = parent?.clientHeight - parent?.firstElementChild?.clientHeight
})
// 在线设备全选
function onlineCheckBoxChange (item: any) {
  onlineDocks.data.forEach(e => {
    e.selected = !e.selected
  })
  if (item.target.checked) {
    onlineCheckArr.data = onlineDocks.data
  } else {
    onlineCheckArr.data = []
  }
}
function historyCheckBoxChange (item: any) {
  historyDocks.data.forEach(e => {
    e.selected = !e.selected
  })
  historyCheckArr.data = historyDocks.data
}
// 在线机场点击
function selectOnlineDock (item: OnlineDevice) {
  // 当前已被选中,排除
  if (item.selected) {
    onlineCheckArr.data = onlineCheckArr.data.filter(e => e.sn !== item.sn)
  } else {
    // 当前未被选中,push
    onlineCheckArr.data.push(item)
  }
  item.selected = !item.selected
  if (onlineCheckArr.data.length === onlineDocks.data.length) {
    onlineCheck.value = true
  } else {
    onlineCheck.value = false
  }
}
function selectHistoryDock (item: OnlineDevice) {
  // 当前已被选中,排除
  if (item.selected) {
    historyCheckArr.data = historyCheckArr.data.filter(e => e.sn !== item.sn)
  } else {
    // 当前未被选中,push
    historyCheckArr.data.push(item)
  }
  item.selected = !item.selected
  if (historyCheckArr.data.length === historyDocks.data.length) {
    historyCheck.value = true
  }
}
// 监听ws 消息
// useConnectWebSocket(messageHandler)
@@ -258,7 +545,10 @@
          sn: gateway?.device_sn,
          domain: gateway?.domain
        },
        payload: []
        payload: [],
        // 是否选中
        selected: false
      }
      child?.payloads_list.forEach((payload: any) => {
        device.payload.push({
@@ -337,4 +627,26 @@
  color: #fff;
  font-size: 16px;
}
.job-info{
  height: 30%;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #c1c1c1;
  margin-bottom: 6px;
  .job-status{
    height: 100%;
    display: flex;
    align-items: center;
    background: red;
  }
  .job-name{
    height: 100%;
    display: flex;
    align-items: center;
    padding-left: 5px;
  }
}
</style>
src/types/device.ts
@@ -163,7 +163,8 @@
    sn: string,
    domain: string,
  },
  payload: PayloadInfo[]
  payload: PayloadInfo[],
  selected?:boolean,
}
// 固件升级类型