forked from drone/command-center-dashboard

chenyao
2025-03-31 295eb3cc87aaa5176d64a4ef985cdad0bfefae9a
src/views/Home/components/HomeLeft/OverviewNext.vue
@@ -1,48 +1,48 @@
<!-- 机巢概况 -->
<template>
    <div class="overview-next">
        <div class="next-num">
            <div class="total">
                <div class="value">88</div>
                <div class="name">机巢总数</div>
            </div>
            <div class="status">
               <div v-for="item in list">
                    <div :style="{ color: item.color }" class="value">{{ item.value }}</div>
                    <div class="name">{{ item.name }}</div>
               </div>
            </div>
  <common-title :style="{ marginLeft: pxToRem(14) }" @details="detailsFun"></common-title>
  <div class="overview-next">
    <div class="next-num">
      <div class="total">
        <div class="value">88</div>
        <div class="name">机巢总数</div>
      </div>
      <div class="status">
        <div v-for="item in list">
          <div :style="{ color: item.color }" class="value">{{ item.value }}</div>
          <div class="name">{{ item.name }}</div>
        </div>
        <div class="search-box">
            <el-input
                v-model="searchText"
                placeholder="请输入搜索内容"
                class="input-with-select">
                <template #append>
                    <el-button :icon="Search" />
                </template>
            </el-input>
        </div>
        <div class="table-list">
            <div class="table-header">
                <div class="name">机巢名称</div>
                <div class="status">机巢状态</div>
            </div>
            <div class="table-item" v-for="item in tableList">
                <div class="name">
                    <img class="yjzx-img" width="10" height="10" src="@/assets/images/table-zx.png" alt="">
                    <img width="13" height="15"  src="@/assets/images/table-icon.png" alt="">
                    {{item.name}}
                </div>
                <div class="status">{{ item.status }}</div>
            </div>
        </div>
      </div>
    </div>
    <div class="search-box">
      <el-input v-model="searchText" placeholder="请输入搜索内容" class="input-with-select">
        <template #append>
          <el-button :icon="Search" />
        </template>
      </el-input>
    </div>
    <div class="table-list">
      <div class="table-header">
        <div class="name">机巢名称</div>
        <div class="status">机巢状态</div>
      </div>
      <div class="table-item" v-for="item in tableList">
        <div class="name">
          <img class="yjzx-img" width="10" height="10" src="@/assets/images/home/homeLeft/table-zx.png" alt="" />
          <img width="13" height="15" src="@/assets/images/home/homeLeft/table-icon.png" alt="" />
          {{ item.name }}
        </div>
        <div class="status" @click="signMachineNestClick">{{ item.status }}</div>
      </div>
    </div>
  </div>
</template>
<script setup>
import { hToV, wToR } from '@/utils/pxConver';
import { Search } from '@element-plus/icons-vue';
import CommonTitle from '@/components/CommonTitle.vue';
import { getDeviceInfoNum } from '@/api/home/machineNest.js'
import { useStore } from 'vuex';
const searchText = ref('')
const list = ref([
  { name: '执行中', value: 89, color: '#FFA768' },
  { name: '在线', value: 100, color: '#8EFFAC' },
@@ -56,106 +56,140 @@
  { name: '小兰工业园3号', status: '预计执行' },
  { name: '小兰工业园3号', status: '预计执行' },
]);
// 获取机巢列表
const getList = () => {
  getDeviceInfoNum().then((res) => {
    console.log(res);
  });
}
const store = useStore();
// 单个机巢详情
const signMachineNestClick = () => {
  store.commit('setSingleUavHome', {
    id: '123'
  });
}
const detailsFun = () => {
  console.log('details');
};
onMounted(() => {
  getList();
});
</script>
<style scoped lang="scss">
.overview-next {
    font-family: YouSheBiaoTiHei, YouSheBiaoTiHei;
    margin-left: 29px;
    padding: hToV(16) 16px;
    width: 390px;
    height: hToV(414);
    background: linear-gradient( 270deg, rgba(31,62,122,0) 0%, rgba(31,62,122,0.35) 21%, #1F3E7A 100%);
    border-radius: 0px 0px 0px 0px;
    opacity: 0.85;
    .next-num {
        width: 358px;
        height: hToV(92);
        background: url(@/assets/images/next-num.png) no-repeat center / 100% 100%;;
        position: relative;
        .total {
            position: absolute;
            left: 22px;
            top: hToV(18);
            font-weight: 500;
            font-size: 14px;
            color: #FFFFFF;
            .value {
                margin-left: 8px;
                font-size: 26px;
            }
        }
        .status {
            position: absolute;
            top: hToV(16);
            right: 30px;
            width: 200px;
            display: flex;
            justify-content: space-between;
            line-height: hToV(30);
            .name {
                font-weight: 400;
                font-size: 14px;
                color: #FFFFFF;
            }
            .value {
                font-family: Source Han Sans CN, Source Han Sans CN;
                font-weight: 400;
                font-size: 26px;
            }
        }
  font-family: YouSheBiaoTiHei, YouSheBiaoTiHei;
  margin-left: 29px;
  padding: 16px 16px;
  width: 390px;
  height: 414px;
  background: linear-gradient(
    270deg,
    rgba(31, 62, 122, 0) 0%,
    rgba(31, 62, 122, 0.35) 21%,
    #1f3e7a 100%
  );
  border-radius: 0px 0px 0px 0px;
  opacity: 0.85;
  margin-bottom: 10px;
  .next-num {
    width: 358px;
    height: 92px;
    background: url(@/assets/images/home/homeLeft/next-num.png) no-repeat center / 100% 100%;
    position: relative;
    .total {
      position: absolute;
      left: 22px;
      top: 28px;
      font-weight: 500;
      font-size: 14px;
      color: #ffffff;
      font-family: Source Han Sans CN, Source Han Sans CN;
      line-height: 19px;
      .value {
        font-family: YouSheBiaoTiHei, YouSheBiaoTiHei;
        margin-left: 8px;
        font-size: 26px;
      }
    }
    .search-box {
        margin-top: hToV(19);
        margin-right: 16px;
        :deep(.el-input__wrapper) {
            background-color: rgba(0, 112, 255, 0.1);
            background: rgba(0,15,34,0.5);
            box-shadow: 0 0 0 1px #0070FF inset;
        }
    .status {
      position: absolute;
      top: 16px;
      right: 30px;
      width: 200px;
      display: flex;
      justify-content: space-between;
      line-height: 30px;
      .name {
        font-family: Source Han Sans CN, Source Han Sans CN;
        font-weight: 400;
        font-size: 14px;
        color: #ffffff;
      }
      .value {
        font-weight: 400;
        font-size: 26px;
      }
    }
  }
  .search-box {
    margin-top: 19px;
    margin-right: 16px;
    :deep(.el-input__wrapper) {
      background-color: rgba(0, 112, 255, 0.1);
      background: rgba(0, 15, 34, 0.5);
      box-shadow: 0 0 0 1px #0070ff inset;
    }
        :deep(.el-input-group__append) {
            background: rgba(0,112,255,0.38);
            .el-button {
                background-color: transparent;
                border: 1px solid #0070FF;
                border-left: none;
                color: #fff;
            }
        }
    :deep(.el-input-group__append) {
      background: rgba(0, 112, 255, 0.38);
      .el-button {
        background-color: transparent;
        border: 1px solid #0070ff;
        border-left: none;
        color: #fff;
      }
    }
        :deep(.el-input__inner) {
            color: #fff;
            &::placeholder {
                color: rgba(255, 255, 255, 0.6);
            }
        }
    :deep(.el-input__inner) {
      color: #fff;
      &::placeholder {
        color: rgba(255, 255, 255, 0.6);
      }
    }
    .table-list {
        margin: 16px;
        font-weight: 500;
        font-size: 16px;
        .table-header, .table-item {
            display: flex;
            justify-content: space-between;
            height: hToV(36);
            line-height: hToV(36);
            padding: 0 20px;
        }
        .table-item {
            position: relative;
            .yjzx-img {
                position: absolute;
                top: hToV(16);
                left: 10px;
            }
            .status {
                color: #6FC3FF;
            }
            .atcive {
                color: #04F020;
            }
        }
  }
  .table-list {
    font-family: Source Han Sans CN, Source Han Sans CN;
    margin: 16px;
    font-weight: 500;
    font-size: 16px;
    .table-header,
    .table-item {
      display: flex;
      justify-content: space-between;
      height: 36px;
      line-height: 36px;
      padding: 0 20px;
    }
    .table-item {
      position: relative;
      .yjzx-img {
        position: absolute;
        top: 14px;
        left: 10px;
      }
      .status {
        color: #6fc3ff;
        cursor: pointer;
      }
      .atcive {
        color: #04f020;
      }
    }
  }
}
</style>
</style>