黄何裕
2024-08-08 cbe714cf3c16c2c6d39ac62ff9d30ed99771bdfd
最终章
4个文件已修改
195 ■■■■■ 已修改文件
src/api/newpage.js 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/screen/components/screen-table/index.vue 148 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/screen/newPage/index.vue 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/newpage.js
@@ -1,17 +1,25 @@
import request from '@/utils/request'
import request from "@/utils/request";
// 设备数据
export function getDeviceData() {
  return request({
    url: '/dashboard/monitor',
    method: 'get',
  })
    url: "/dashboard/monitor/total",
    method: "get",
  });
}
// 工单数据
export function getWorkOrderData() {
  return request({
    url: '/dashboard/workOrder',
    method: 'get',
  })
}
    url: "/dashboard/workOrder/total",
    method: "get",
  });
}
//设备正常率
export function getNormalRate(id) {
  return request({
    url: "/dashboard/monitor/rate?dataScope=" + id,
    method: "get",
  });
}
src/views/screen/components/screen-table/index.vue
@@ -13,7 +13,7 @@
          :max-height="tableHeight"
          class="rank-table"
        >
          <el-table-column prop="name" label="地区" align="center" width="100">
          <el-table-column prop="area" label="地区" align="center" width="100">
          </el-table-column>
          <el-table-column label="人脸设备" align="center">
@@ -22,14 +22,25 @@
                <div slot="content">
                  <div class="tip-item">
                    <div class="tip-label">设备正常数:</div>
                    <div class="tip-info tip-success">12</div>
                    <div class="tip-info tip-success">
                      {{ scope.row.faceNormalNum }}
                    </div>
                  </div>
                  <div class="tip-item">
                    <div class="tip-label">设备异常数:</div>
                    <div class="tip-info tip-danger">4</div>
                    <div class="tip-info tip-danger">
                      {{ scope.row.faceErrorNum }}
                    </div>
                  </div>
                </div>
                <div class="tip-num">75%</div>
                <div class="tip-num">
                  {{
                    scope.row.faceRate?(
                      (scope.row.faceNormalNum / scope.row.faceRate) *
                      100
                    ).toFixed(0)+'%':'--'
                  }}
                </div>
              </el-tooltip>
            </template>
          </el-table-column>
@@ -40,14 +51,25 @@
                <div slot="content">
                  <div class="tip-item">
                    <div class="tip-label">设备正常数:</div>
                    <div class="tip-info tip-success">12</div>
                    <div class="tip-info tip-success">
                      {{ scope.row.carNormalNum }}
                    </div>
                  </div>
                  <div class="tip-item">
                    <div class="tip-label">设备异常数:</div>
                    <div class="tip-info tip-danger">4</div>
                    <div class="tip-info tip-danger">
                      {{ scope.row.carNormalNum }}
                    </div>
                  </div>
                </div>
                <div class="tip-num">75%</div>
                <div class="tip-num">
                  {{
                      scope.row.carRate?(
                      (scope.row.carNormalNum / scope.row.carRate) *
                      100
                    ).toFixed(0)+'%':'--'
                  }}
                </div>
              </el-tooltip>
            </template>
          </el-table-column>
@@ -58,14 +80,25 @@
                <div slot="content">
                  <div class="tip-item">
                    <div class="tip-label">设备正常数:</div>
                    <div class="tip-info tip-success">12</div>
                    <div class="tip-info tip-success">
                      {{ scope.row.videoNormalNum }}
                    </div>
                  </div>
                  <div class="tip-item">
                    <div class="tip-label">设备异常数:</div>
                    <div class="tip-info tip-danger">4</div>
                    <div class="tip-info tip-danger">
                      {{ scope.row.videoNormalNum }}
                    </div>
                  </div>
                </div>
                <div class="tip-num">75%</div>
                <div class="tip-num">
                  {{
                    scope.row.videoRate?(
                      (scope.row.videoNormalNum / scope.row.videoRate) *
                      100
                    ).toFixed(0)+'%':'--'
                  }}
                </div>
              </el-tooltip>
            </template>
          </el-table-column>
@@ -80,57 +113,62 @@
export default {
  name: "ScreenTable",
  props: {
    tableData: {
      type: Array,
      default: null,
    },
  },
  components: {
    WrapperTitle,
  },
  data() {
    return {
      tableHeight: 40,
      tableData: [
        {
          name: "富顺县",
          data1: 1123,
          data2: 1123,
          data3: 1123,
        },
        {
          name: "荣县",
          data1: 1123,
          data2: 1123,
          data3: 1123,
        },
        {
          name: "高新区",
          data1: 1123,
          data2: 1123,
          data3: 1123,
        },
        {
          name: "自流井区",
          data1: 1123,
          data2: 1123,
          data3: 1123,
        },
        {
          name: "贡井区",
          data1: 1123,
          data2: 1123,
          data3: 1123,
        },
        {
          name: "大安区",
          data1: 1123,
          data2: 1123,
          data3: 1123,
        },
        {
          name: "沿滩区",
          data1: 1123,
          data2: 1123,
          data3: 1123,
        },
      ],
      // tableData: [
      //   {
      //     name: "富顺县",
      //     data1: 1123,
      //     data2: 1123,
      //     data3: 1123,
      //   },
      //   {
      //     name: "荣县",
      //     data1: 1123,
      //     data2: 1123,
      //     data3: 1123,
      //   },
      //   {
      //     name: "高新区",
      //     data1: 1123,
      //     data2: 1123,
      //     data3: 1123,
      //   },
      //   {
      //     name: "自流井区",
      //     data1: 1123,
      //     data2: 1123,
      //     data3: 1123,
      //   },
      //   {
      //     name: "贡井区",
      //     data1: 1123,
      //     data2: 1123,
      //     data3: 1123,
      //   },
      //   {
      //     name: "大安区",
      //     data1: 1123,
      //     data2: 1123,
      //     data3: 1123,
      //   },
      //   {
      //     name: "沿滩区",
      //     data1: 1123,
      //     data2: 1123,
      //     data3: 1123,
      //   },
      // ],
    };
  },
  methods: {
src/views/screen/newPage/index.vue
@@ -3,7 +3,7 @@
    <div style="display: flex; justify-content: center">
      <div class="header_box">
        <div class="tabs-box">
          <el-tabs v-model="activeName" @tab-click="handleClick">
          <el-tabs v-model="activeName" @tab-click="tabChange">
            <el-tab-pane
              v-for="item in testData1"
              :label="item.name"
@@ -74,7 +74,7 @@
          <div class="card_header">
            <div class="title">设备正常率</div>
            <div style="margin: 10px 10px">
              <ScreenTable></ScreenTable>
              <ScreenTable :tableData="tableData"></ScreenTable>
            </div>
          </div>
        </div>
@@ -125,7 +125,7 @@
import ExamineChart from "../components/screen-examine/components/examine-chart.vue";
import ScreenData from "../components/screen-data/index.vue";
import NewMap from "./components/newMap.vue";
import { getDeviceData, getWorkOrderData } from "@/api/newpage";
import { getDeviceData, getWorkOrderData, getNormalRate } from "@/api/newpage";
export default {
  name: "Newpage",
  components: {
@@ -179,6 +179,7 @@
          totalNum: 28,
        },
      },
      tableData: [],
    };
  },
  mounted() {
@@ -194,16 +195,26 @@
    getData() {
      getDeviceData()
        .then((res) => {
          this.deviceList = res.data.monitorTotal;
          this.deviceList = res.data;
        })
        .catch((err) => {});
      getWorkOrderData()
        .then((res) => {
          this.workOrderData = res.data;
          console.log(res, "zxczxczxcxc");
        })
        .catch((err) => {});
      this.getTableList();
    },
    getTableList() {
      getNormalRate(this.activeName)
        .then((res) => {
          this.tableData = res.data;
        })
        .catch((err) => {});
    },
    tabChange(){
      this. getTableList()
    }
  },
};
</script>
vue.config.js
@@ -41,7 +41,7 @@
        // target: `http://192.168.3.64:8080`,
        // 龚焕茏
        target: `http://192.168.3.87:8080`,
        target: `http://192.168.137.227:8080`,
        
        // 向培
        // target: `http://192.168.3.88:8085`,