Newer
Older
HuangJiPC / src / pages / views / prevention / components / WorkingAnalysis.vue
@zhangdeliang zhangdeliang on 21 Jun 6 KB update
<template>
  <div class="workingAnalysis">
    <n-radio-group v-model:value="selectedValue" size="small">
      <n-radio-button v-for="v in tongdaoList" :key="v.value" :value="v.value">
        {{ v.label }}
      </n-radio-button>
    </n-radio-group>
    <div class="card_list">
      <div class="card one">
        <div class="text">
          <span>泵机</span>
          <span>1#</span>
        </div>
        <img src="../../../../assets/Imgs/fangxunMap/beng.png" alt="" />
      </div>
      <div class="card two">
        <div class="text">
          <span>本次运行时长</span>
          <span>35天20小时</span>
        </div>
        <img src="../../../../assets/Imgs/fangxunMap/time2.png" alt="" />
      </div>
      <div class="card thr">
        <div class="text">
          <span>累计运行时长</span>
          <span>75天20小时</span>
        </div>
        <img src="../../../../assets/Imgs/fangxunMap/time.png" alt="" />
      </div>
      <div class="fou">运行中</div>
    </div>
    <img class="big_img" src="../../../../assets/Imgs/weixiufenxi1.png" alt="" />
    <ul class="detailed">
      <li v-for="item in detailedList" :key="item.id">
        <div class="left">
          <img :src="`/src/assets/Imgs/fangxunMap/${item.icon}.png`" alt="" />
        </div>
        <div class="right">
          <span
            class="value"
            :class="[item.id === 1 ? 'blue' : item.id === 2 ? 'red' : 'green']"
            >{{ item.value }}</span
          >
          <span class="name">{{ item.name }}</span>
        </div>
      </li>
    </ul>
    <div class="table_box">
      <n-data-table
        ref="tableRef"
        size="small"
        :bordered="false"
        :max-height="170"
        :columns="columns"
        :data="data"
      ></n-data-table>
    </div>
  </div>
</template>

<script>
import { reactive, toRefs, onMounted,h} from "vue";
import { NButton} from "naive-ui";

export default {
  name: "extractionAnalysis",
  setup() {
    const state = reactive({
      selectedValue: 0,
      tongdaoList: [
        { label: "后湖二期泵站", value: 0 },
        { label: "铁路桥泵站", value: 1 },
        { label: "机场河补水泵站", value: 2 },
      ],
      detailedList: [
        { name: "泵站机组抽水水位..", value: "86.63M",icon:'work_one' ,id: 0 },
        { name: "泵机流量每秒", value: "2M³",icon:'work_two' , id: 1 },
        { name: "预计前池水位抽水深..", value: "60CM",icon:'work_thr' , id: 2 },
        { name: "泵站应开泵机进行处理", value: "",icon:'work_four' , id: 3 },
      ],
      //   表格相关
      columns: [
        {
          title: "堤防名称",
          key: "name",
          align: "center",
        },
        {
          title: "堤防级别",
          key: "level",
          align: "center",
        },
        {
          title: "堤防长度m",
          key: "length",
          align: "center",
          width:'90'
        },
        {
          title: "堤顶高程m",
          key: "height",
          align: "center",
          width:'90'

        },
        {
          title: "设防水位m",
          key: "fortification",
          align: "center",
          width:'90'

        },
        {
          title: "警戒水位m",
          key: "alert",
          align: "center",
          width:'90'

        },
        {
          title: "操作 ",
          key: "actions",
          align: "center",
          render(row) {
            return h(
              NButton,
              {
                size: "small",
                 text: true,
                 type:'primary',
                onClick: () => handleClick(row),
              },
              { default: () => "巡查记录" }
            );
          },
        },
      ],
      data: [],
    });
    //获取工况分析表格数据
    const getTableData = () => {
      state.data = Array.apply(null, { length: 10 }).map((v, j) => ({
        name: "堤防1",
        level: "1级",
        length: "2000-2200 ",
        height: "32.2-32.7 ",
        fortification: "25.0",
        alert: "27",
      }));
    };
    const handleClick=(row)=>{

    }
    onMounted(() => {
      getTableData();
    });
    return {
      ...toRefs(state),
      getTableData,
      handleClick
    };
  },
};
</script>

<style lang='less' scoped>
.workingAnalysis {
  padding: 10px;
  .card_list {
    margin: 10px 0;
    display: flex;
    .card {
      margin-right: 20px;
      width: 162px;
      height: 64px;
      border-radius: 3px;
      box-shadow: 0px 2px 9px 0px rgba(190, 190, 212, 0.93);
      display: flex;
      justify-content: space-around;
      align-items: center;
      .text {
        display: flex;
        flex-direction: column;
        span {
          color: #fff;
        }
        &:first-child {
          font-size: 14px;
        }
        &:last-child {
          font-size: 16px;
        }
      }
      img {
        width: 36px;
        height: 36px;
      }
    }
    .one {
      background: linear-gradient(120deg, #5abff3, #5095eb);
    }
    .two {
      background: linear-gradient(120deg, #e39df0, #a759f7);
    }
    .thr {
      background: linear-gradient(120deg, #f0c2a0, #eb7bad);
    }
    .fou {
      padding: 0 10px;
      width: 42px;
      height: 64px;
      border: 1px solid #38b037;
      border-radius: 5px;
      font-size: 12px;
      font-family: Source Han Sans CN;
      font-weight: 500;
      color: #38b037;
      text-align: center;
    }
  }
  .big_img {
    width: 100%;
    height: 285px;
  }
  .detailed {
    margin: 10px 0;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    li {
      margin-bottom: 10px;
      width: 50%;
      height: 46px;
      display: flex;
      justify-content: center;
      align-items: center;
    }
    .left {
      margin-right: 20px;
      width: 44px;
      height: 44px;
      // background: linear-gradient(0deg, #3d8cf1, #6db4ff);
      border-radius: 50%;
      display: flex;
      justify-content: center;
      align-items: center;
    }
    .right {
      width: 160px;
      display: flex;
      flex-direction: column;
      align-items: center;
      .value {
        font-size: 16px;
        font-family: DIN;
        font-weight: bold;
        color: #e0b225;
      }
      .name {
        font-size: 16px;
        font-family: Source Han Sans CN;
        color: #828282;
      }
      .blue {
        color: #4da1ff;
      }
      .red {
        color: #dc5163;
      }
      .green {
        color: #5bc056;
      }
    }
  }
}
::v-deep(.n-data-table-td) {
  background: var(--bg-menu);
}
::v-deep(.n-data-table-table) {
  background: var(--bg-menu);
}
::v-deep(.n-data-table-thead){
   background: var(--bg-menu);

}
::v-deep(.n-data-table-th){
   background: var( --color-odd);

}
</style>