123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603 |
- <!-- 数据看板-设备管控 -->
- <template>
- <view class="equipmentControl">
- <view class="statistics">
- <view class="statistics-b">
- <view class="statistics-b-li">
- <view class="statistics-b-li-t color-A">{{totalDeviceNum}}</view>
- <view class="statistics-b-li-b">设备总数</view>
- </view>
- <view class="line"></view>
- <view class="statistics-b-li">
- <view class="statistics-b-li-t color-B">{{newlyAddToday}}</view>
- <view class="statistics-b-li-b">今日新增设备</view>
- </view>
- <view class="line"></view>
- <view class="statistics-b-li">
- <view class="statistics-b-li-t color-C">{{overdueDeviceNum}}</view>
- <view class="statistics-b-li-b">超期服役设备</view>
- </view>
- </view>
- </view>
- <view class="small-title">
- <view class="small-title-l">超期服役排行TOP5</view>
- <img class="small-title-r" @click="goPage('overdue')" :src="imagesUrl('commonality/icon_wdwg_gd.png')">
- </view>
- <view class="chart">
- <view class="chart-b">
- <qiun-data-charts :tapLegend="false" :tooltipShow="false" :canvas2d="true" type="bar" :opts="opts" :echartsH5="true" :chartData="chartData" />
- </view>
- </view>
- <view class="small-title">
- <view class="small-title-l">设备使用寿命</view>
- <img class="small-title-r" @click="goPage('life')" :src="imagesUrl('commonality/icon_wdwg_gd.png')">
- </view>
- <view class="chart-tow">
- <view class="chart-tow-b">
- <qiun-data-charts :canvas2d="true" type="funnel" :opts="optsTow" :echartsH5="true" :chartData="chartDataTow" />
- </view>
- </view>
- <view class="small-title">
- <view class="small-title-l">特种设备与常规冷热设备安全隐患统计</view>
- </view>
- <view class="chart-three">
- <view class="small-title-three">
- <view class="small-title-l"></view>
- <viwe class="chart-tab-tow">
- <view class="chart-tab-li" :class="chartTabIndexThree==index?'tab-A':'tab-B'"
- v-for="(item,index) in chartTabListThree" :key="index" @click="chartTabClickThree(index)">
- {{item}}
- </view>
- </viwe>
- </view>
- <view class="chart-three-b">
- <qiun-data-charts :canvas2d="true" type="pie" :opts="optsThree" :echartsH5="true" :chartData="chartDataThree" />
- </view>
- </view>
- <view class="chart-title">
- <view class="chart-title-l">安全检查指标</view>
- <view class="chart-title-r">占比</view>
- </view>
- <view class="list" v-for="(item,index) in dataList" :key="index">
- <view class="list-title">
- <view class="list-title-l">{{item.code}}{{item.name}}</view>
- <view class="list-title-r">{{item.rate}}%</view>
- </view>
- <view class="list-li" v-for="(item2,index2) in item.childList" :key="index2">{{item2.code}}{{item2.name}}
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- config
- } from '@/api/request/config.js'
- import {
- reportAppletReportApiDeviceStatGetDeviceStat,
- reportAppletReportBsEquipDangerCheckList,
- reportAppletReportBsEquipDangerList,
- reportAppletReportApiEquipOverdueList,
- reportAppletReportApiEquipLifeList,
- } from '@/pages/api/index.js'
- export default {
- name: "equipmentControl",
- components: {
- },
- data() {
- return {
- opts: {
- color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
- "#ea7ccc"
- ],
- padding: [15, 30, 0, 5],
- enableScroll: false,
- legend: {
- show: false,
- },
- xAxis: {
- disabled: true,
- disableGrid: true,
- axisLine: false,
- fontColor: '#fff',
- },
- yAxis: {
- disabled: false,
- disableGrid: true,
- data: [{
- type: 'categories',
- fontColor: '#fff',
- }],
- },
- extra: {
- bar: {
- type: "group",
- width: 12,
- meterBorde: 1,
- meterFillColor: "#FFFFFF",
- activeBgColor: "#000000",
- activeBgOpacity: 0.08,
- linearType: "custom",
- barBorderCircle: true,
- seriesGap: 2,
- categoryGap: 2
- }
- }
- },
- chartData: {},
- optsTow: {
- color: ["#0183FA", "#38F0F0", "#2CCA73", "#FC6E21", "#FF4646", ],
- legend: {
- show: false,
- },
- padding: [15, 95, 10, 0],
- enableScroll: false,
- extra: {
- funnel: {
- type: 'triangle',
- border: false,
- labelAlign: "right",
- }
- }
- },
- chartDataTow: {},
- optsThree: {
- color: ["#10C139", "#FF8400", "#00FFE6", "#0183FA", "#73C0DE", "#3CA272", ],
- legend: {
- show: false,
- },
- padding: [5, 5, 5, 5],
- enableScroll: false,
- extra: {
- pie: {
- offsetAngle: 0,
- labelWidth: 15,
- border: true,
- borderWidth: 3,
- borderColor: "#3E414F",
- }
- }
- },
- chartDataThree: {},
- // 查询参数
- queryParams: {
- page: 1,
- pageSize: 10,
- },
- dataList: [],
- total: 0,
- newlyAddToday: 0,
- overdueDeviceNum: 0,
- totalDeviceNum: 0,
- statisticsType: 1, //1.年度2.季度3.月度
- chartTabListThree: ['年度', '季度', '月度'],
- chartTabIndexThree: 0,
- }
- },
- created() {
- },
- beforeMount() {
- },
- mounted() {
- this.reportAppletReportApiDeviceStatGetDeviceStat();
- this.reportAppletReportBsEquipDangerCheckList();
- this.reportAppletReportBsEquipDangerList();
- this.reportAppletReportApiEquipOverdueList();
- this.reportAppletReportApiEquipLifeList();
- },
- methods: {
- //隐患统计
- async reportAppletReportBsEquipDangerList() {
- let self = this;
- const {
- data
- } = await reportAppletReportBsEquipDangerList({
- dangerType: '1',
- statisticsType: this.statisticsType
- });
- if (data.code == 200) {
- let list = [];
- data.data.subjectList.forEach(function(item, index) {
- if (index < 5) {
- list.push({
- "name": item.subjectName,
- "value": item.dangerNum,
- "textColor": "#fff",
- })
- }
- })
- let res = {
- series: [{
- data: list
- }]
- };
- this.chartDataThree = JSON.parse(JSON.stringify(res));
- }
- },
- //超期服役统计
- async reportAppletReportApiEquipOverdueList() {
- let self = this;
- const {
- data
- } = await reportAppletReportApiEquipOverdueList();
- if (data.code == 200) {
- let list = [];
- let list2 = [];
- data.data.forEach(function(item, index) {
- if(index<5){
- let newName = item.deptName;
- if(newName.length > 6){
- newName = newName.slice(0, 6) + '..';
- }
- list.push(newName)
- // list.push(item.deptName)
- list2.push(item.deviceNum)
- }
- })
- let res = {
- categories: list,
- series: [{
- name: "目标值",
- textColor: '#fff',
- data: list2
- }, ]
- };
- this.chartData = JSON.parse(JSON.stringify(res));
- }
- },
- //设备使用寿命统计
- async reportAppletReportApiEquipLifeList() {
- let self = this;
- const {
- data
- } = await reportAppletReportApiEquipLifeList();
- if (data.code == 200) {
- let list = [];
- data.data.forEach(function(item, index) {
- list.push({
- "name":item.lifeInterval,
- "value": item.deviceNum,
- "labelText":item.lifeInterval+' '+item.deviceNum+item.unit+' '+item.deviceRate+'%',
- "textColor": "#fff",
- })
- })
-
- let res = {
- series: [{
- data: list
- }]
- };
- this.chartDataTow = JSON.parse(JSON.stringify(res));
- }
- },
- async reportAppletReportApiDeviceStatGetDeviceStat() {
- let self = this;
- const {
- data
- } = await reportAppletReportApiDeviceStatGetDeviceStat();
- if (data.code == 200) {
- this.$set(self, 'newlyAddToday', data.data.newlyAddToday);
- this.$set(self, 'overdueDeviceNum', data.data.overdueDeviceNum);
- this.$set(self, 'totalDeviceNum', data.data.totalDeviceNum)
- }
- },
- //安全检查指标
- async reportAppletReportBsEquipDangerCheckList() {
- let self = this;
- const {
- data
- } = await reportAppletReportBsEquipDangerCheckList();
- if (data.code == 200) {
- this.$set(self, 'dataList', data.data);
- }
- },
- dateClick(index) {
- this.dateIndex = index;
- },
- goPage(type) {
- if (type == 'overdue') {
- uni.navigateTo({
- url: '/pages/views/dataBoard/equipmentControlOverdue?pageType=1'
- });
- } else if (type == 'life') {
- uni.navigateTo({
- url: '/pages/views/dataBoard/equipmentControlOverdue?pageType=2'
- });
- }
- },
- chartTabClickThree(index) {
- this.chartTabIndexThree = index;
- this.statisticsType = index + 1;
- this.reportAppletReportBsEquipDangerList();
- },
- },
- }
- </script>
- <style lang="stylus" scoped>
- .equipmentControl {
- height: 100%;
- width: 100%;
- background: #363744;
- padding: 2rpx 0rpx 0;
- box-sizing: border-box;
- .statistics {
- width: 750rpx;
- height: 120rpx;
- background: #3E414F;
- .statistics-b {
- display: flex;
- justify-content: space-between;
- align-items: center;
- .statistics-b-li {
- flex: 1;
- text-align: center;
- .statistics-b-li-t {
- font-weight: 400;
- font-size: 36rpx;
- line-height: 50rpx;
- margin-top: 10rpx;
- }
- .statistics-b-li-b {
- font-weight: 400;
- font-size: 24rpx;
- color: #FFFFFF;
- line-height: 34rpx;
- margin-top: 9rpx;
- }
- }
- .line {
- width: 2rpx;
- height: 30rpx;
- background: #D8D8D8;
- }
- .color-A {
- color: #0183FA;
- }
- .color-B {
- color: #FF0000;
- }
- .color-C {
- color: #FFAA00;
- }
- }
- }
- .small-title {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin: 0 30rpx;
- .small-title-l {
- font-weight: 400;
- font-size: 32rpx;
- color: #FFFFFF;
- line-height: 45rpx;
- text-align: left;
- margin: 28rpx 0;
- }
- .small-title-r {
- width: 15rpx;
- height: 18rpx;
- }
- }
- .chart {
- width: 690rpx;
- height: 476rpx;
- background: #3E414F;
- border-radius: 20rpx 20rpx 20rpx 20rpx;
- margin: 0 30rpx;
- .chart-b {
- width: 690rpx;
- height: 476rpx;
- }
- }
- .chart-tow {
- width: 690rpx;
- height: 436rpx;
- background: #3E414F;
- border-radius: 20rpx 20rpx 20rpx 20rpx;
- margin: 0 30rpx;
- .chart-tow-b {
- width: 690rpx;
- height: 436rpx;
- }
- }
- .small-title-tow {
- width: 750rpx;
- height: 80rpx;
- background: #3E414F;
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 0 20rpx 0 30rpx;
- box-sizing: border-box;
- margin-top: 2rpx;
- .small-title-tow-l {
- flex: 1;
- font-weight: 400;
- font-size: 30rpx;
- color: #FFFFFF;
- line-height: 42rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .small-title-tow-r {
- width: 14rpx;
- height: 8rpx;
- }
- }
- .small-title-three {
- height: 50rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin: 24rpx 30rpx;
- .small-title-l {
- font-weight: 400;
- font-size: 32rpx;
- color: #FFFFFF;
- line-height: 45rpx;
- }
- .chart-tab-tow {
- width: 300rpx;
- height: 50rpx;
- border-radius: 25rpx;
- overflow: hidden;
- border: 1rpx solid #52545F;
- display: flex;
- justify-content: flex-start;
- .chart-tab-li {
- width: 100rpx;
- font-weight: 400;
- font-size: 28rpx;
- color: #999999;
- line-height: 50rpx;
- text-align: center;
- }
- .chart-tab-li:nth-of-type(1) {
- border-right: 1rpx solid #52545F;
- }
- .chart-tab-li:nth-of-type(2) {
- border-right: 1rpx solid #52545F;
- }
- .tab-A {
- color: #FFFFFF;
- background: #0183FA;
- }
- .tab-B {
- color: #999999;
- background: none;
- }
- }
- }
- .chart-three {
- width: 690rpx;
- height: 509rpx;
- background: #3E414F;
- border-radius: 20rpx 20rpx 0rpx 0rpx;
- margin: 34rpx 30rpx 0;
- overflow: hidden;
- .chart-three-b {
- width: 690rpx;
- height: 394rpx;
- }
- }
- .chart-title {
- width: 689rpx;
- height: 80rpx;
- background: rgba(162, 162, 162, 0.2);
- border-radius: 0rpx 0rpx 0rpx 0rpx;
- padding: 0 70rpx 0 38rpx;
- box-sizing: border-box;
- margin: 0 30rpx;
- display: flex;
- justify-content: space-between;
- .chart-title-l {
- font-weight: 400;
- font-size: 30rpx;
- color: #FFFFFF;
- line-height: 80rpx;
- }
- .chart-title-r {
- font-weight: 400;
- font-size: 30rpx;
- color: #FFFFFF;
- line-height: 80rpx;
- }
- }
- .list {
- margin: 0 30rpx;
- padding: 0 30rpx;
- box-sizing: border-box;
- .list-title {
- height: 80rpx;
- display: flex;
- justify-content: space-between;
- border-bottom: 1rpx dashed rgba(216, 216, 216, 0.2);
- padding: 0 38rpx 0 10rpx;
- box-sizing: border-box;
- .list-title-l {
- font-weight: 400;
- font-size: 28rpx;
- color: #FFFFFF;
- line-height: 80rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .list-title-r {
- font-weight: 400;
- font-size: 28rpx;
- color: #0183FA;
- line-height: 80rpx;
- }
- }
- .list-li {
- min-height: 80rpx;
- display: flex;
- justify-content: space-between;
- padding: 0 38rpx 0 10rpx;
- box-sizing: border-box;
- font-weight: 400;
- font-size: 28rpx;
- color: #999999;
- line-height: 40rpx;
- text-align: left;
- padding: 20rpx 0;
- box-sizing: border-box;
- }
- }
- }
- </style>
|