南昌市物联网技防平台-前端
Administrator
2021-04-02 e78c2fa41193782137051dcaf61a0ada926ce6b7
Merge branch 'master' of http://192.168.0.105:10010/r/jfpt-Vue
6 files modified
232 ■■■■ changed files
src/api/supervisory/data.js 18 ●●●●● patch | view | raw | blame | history
src/page/index/top/index.vue 9 ●●●●● patch | view | raw | blame | history
src/page/index/top/top-menu.vue 2 ●●● patch | view | raw | blame | history
src/store/modules/common.js 2 ●●● patch | view | raw | blame | history
src/views/supervisoryConsole/data.vue 194 ●●●●● patch | view | raw | blame | history
src/views/system/user.vue 7 ●●●●● patch | view | raw | blame | history
src/api/supervisory/data.js
@@ -6,4 +6,20 @@
    method: 'get',
    params: {}
  })
}
}
export const getEquipmentList = () => {
  return request({
    url: '/api/blade-jfpts/alarm/alarm/selectEq',
    method: 'get',
    params: {}
  })
}
export const getDayWarnList = () => {
  return request({
    url: '/api/blade-jfpts/alarm/alarm/selectAlertScount',
    method: 'get',
    params: {}
  })
}
src/page/index/top/index.vue
@@ -13,10 +13,11 @@
           v-if="showMenu">
        <top-menu ref="topMenu"></top-menu>
      </div>
      <span class="top-bar__item"
            v-if="showSearch">
        <top-search></top-search>
      </span>
      <!--去除顶部搜索栏-->
<!--      <span class="top-bar__item"-->
<!--            v-if="showSearch">-->
<!--        <top-search></top-search>-->
<!--      </span>-->
    </div>
    <div class="top-bar__right">
src/page/index/top/top-menu.vue
@@ -35,7 +35,7 @@
    data() {
      return {
        itemHome: {
          name: '首页',
          name: '数据模式',
          source: 'el-icon-menu',
        },
        ZHAJ: {
src/store/modules/common.js
@@ -17,7 +17,7 @@
  state: {
    language: getStore({name: 'language'}) || 'zh',
    isCollapse: false,
    isCollapse: true,
    isFullScren: false,
    isMenu: true,
    isShade: false,
src/views/supervisoryConsole/data.vue
@@ -124,16 +124,12 @@
          <div class="alarm-bar">
            <div class="alarm-bar-title">
              <div class="title-left ng-binding">日累计预警事件数</div>
              <div class="title-right week ng-scope" ng-if="$ctrl.barRate >= 1">
              <div class="title-right week">
                <span class="ng-binding">0</span
                ><span class="ng-binding">1.00</span>
              </div>
            </div>
            <div
              class="week-alarm-bar ng-isolate-scope"
              data="$ctrl.weekAlarm"
              alarm-bar="alarmBarEvent(chart)"
            ></div>
            <div class="week-alarm-bar" id="day_warn_echarts"></div>
          </div>
          <div class="border-line"></div>
          <div class="alarm-line">
@@ -141,22 +137,12 @@
              <div class="title-left change-flex-alarm ng-binding">
                日累计预警设备数
              </div>
              <!-- ngIf: $ctrl.deviceRate >= 1 -->
              <div
                class="title-right week ng-scope"
                ng-if="$ctrl.deviceRate >= 1"
              >
              <div class="title-right week">
                <span class="ng-binding">0</span
                ><span class="ng-binding">1.00</span>
              </div>
              <!-- end ngIf: $ctrl.deviceRate >= 1 -->
              <!-- ngIf: $ctrl.deviceRate < 1 -->
            </div>
            <div
              class="week-device-line ng-isolate-scope"
              data="$ctrl.weekDevice"
              device-line="deviceLineEvent(chart)"
            ></div>
            <div class="week-device-line" id="day_equipment_echarts"></div>
          </div>
        </div>
      </div>
@@ -165,7 +151,11 @@
</template>
<script>
import { getList } from "@/api/supervisory/data";
import {
  getList,
  getEquipmentList,
  getDayWarnList,
} from "@/api/supervisory/data";
export default {
  data() {
@@ -189,6 +179,14 @@
          alarmPeople: item.alarmPeople,
        });
      });
    });
    getEquipmentList().then((res) => {
      that.drawLine(res.data.data);
    });
    getDayWarnList().then((res) => {
      that.drawPillar(res.data.data);
    });
  },
  mounted() {
@@ -289,6 +287,164 @@
      };
      myChart.setOption(option);
    },
    drawLine(result) {
      var myChart = this.$echarts.init(
        document.getElementById("day_equipment_echarts")
      );
      var xData = [];
      var yData = [];
      result.forEach((item) => {
        xData.push(item.time.substr(5));
        yData.push(item.Coun);
      });
      var option = {
        color: "#A58ABF",
        tooltip: {
          trigger: "axis",
          axisPointer: {
            label: {
              show: false,
            },
            lineStyle: {
              width: 0,
            },
          },
          formatter: function (parms) {
            var str =
              parms[0].axisValue +
              "</br>" +
              parms[0].marker +
              "设备数:" +
              parms[0].value;
            return str;
          },
          textStyle: {
            color: "#fff",
          },
          backgroundColor: "rgba(0, 0, 0, 0.7)",
          borderWidth: 0,
        },
        xAxis: {
          type: "category",
          data: xData,
          boundaryGap: false,
          axisTick: {
            show: false,
          },
          axisLine: {
            show: true,
            lineStyle: {
              color: "#F0F0F0",
            },
          },
          axisLabel: {
            color: "#6E6E6E",
          },
        },
        yAxis: {
          type: "value",
          show: false,
          axisLine: {
            show: false,
          },
          axisTick: {
            show: false,
          },
          // boundaryGap: [0, "40%"],
        },
        series: [
          {
            type: "line",
            smooth: 0.8,
            // symbol: "none",
            data: yData,
            areaStyle: {},
          },
        ],
      };
      myChart.setOption(option);
    },
    drawPillar(data) {
      var myChart = this.$echarts.init(
        document.getElementById("day_warn_echarts")
      );
      var xData = [];
      var yData = [];
      data.times.forEach((item) => {
        xData.push(item.substr(5));
      });
      data.dataList.forEach((item) => {
        if (item.name == "一键求助") {
          yData = item.alarmData
        }
      });
      var option = {
        color: "#F34A4A",
        tooltip: {
          trigger: "axis",
          axisPointer: {
            label: {
              show: false,
            },
            lineStyle: {
              width: 0,
            },
          },
          formatter: function (parms) {
            var str =
              parms[0].axisValue +
              "</br>" +
              parms[0].marker +
              "事件数:" +
              parms[0].value;
            return str;
          },
          textStyle: {
            color: "#fff",
          },
          backgroundColor: "rgba(0, 0, 0, 0.7)",
          borderWidth: 0,
        },
        xAxis: {
          type: "category",
          data: xData,
          boundaryGap: false,
          axisTick: {
            show: false,
          },
          axisLine: {
            show: true,
            lineStyle: {
              color: "#F0F0F0",
            },
          },
          axisLabel: {
            color: "#6E6E6E",
          },
        },
        yAxis: {
          type: "value",
          show: false,
          boundaryGap: [0, "40%"],
        },
        series: [
          {
            data: yData,
            type: "bar",
          },
        ],
      };
      myChart.setOption(option);
    },
  },
};
</script>
src/views/system/user.vue
@@ -315,6 +315,13 @@
              display: false
            },
            {
              label: "工作状态",
              prop: "work_status",
              slot: true,
              hide: true,
              display: false
            },
            {
              label: "用户平台",
              type: "select",
              dicUrl: "/api/blade-system/dict/dictionary?code=user_type",