123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946 |
- <!-- 数据看板-安全隐患 -->
- <template>
- <view class="hazardSources">
- <!-- 计划列表 -->
- <picker @change="bindPickerChange" :value="pickerIndex" :range="pickerList" range-key="planTitle">
- <view class="small-title">
- <view class="small-title-l">{{pickerList[pickerIndex].planTitle}}</view>
- <img class="small-title-r" src="@/pages/images/dataBoard/icon_06.png">
- </view>
- </picker>
- <view class="chart">
- <!-- 图表选项卡 -->
- <view class="chart-t">
- <view class="chart-t-li" :class="chartIndex==index?'color-A':'color-B'" @click="chartClick(index)"
- v-for="(item,index) in chartTitle">{{item}}</view>
- </view>
- <!-- 安全隐患排行-图表 -->
- <view class="chart-b" v-if="chartIndex==0">
- <qiun-data-charts :canvas2d="true" type="column" :opts="opts" :echartsH5="true" :chartData="chartData" />
- </view>
- <!-- 一级指标排行-图表 -->
- <view class="chart-b2" v-if="chartIndex==0">
- <view class="chart-b2-li" v-for="(item,index) in hiddenChartBottom">
- <view class="chart-b2-li-t">
- <text>{{index+1}}</text>
- <text>{{item.name}}</text>
- </view>
- <view class="chart-b2-li-b">{{item.total}}</view>
- </view>
- </view>
- <!-- 暂无法整改-图表 -->
- <view class="chart-b-tow" v-if="chartIndex==1 || chartIndex==2">
- <qiun-data-charts :canvas2d="true" type="radar" :opts="optsTow" :echartsH5="true" :chartData="chartDataTow" />
- </view>
- </view>
- <!-- 选项卡 -->
- <scroll-view scroll-x @scrolltolower="scrollGet" v-if="chartIndex!=0">
- <view class="tabTitle_tow">
- <view class="tabTitle_tow_li" @tap="tabClickTow(item,index)" :key="index"
- v-for="(item,index) in tabTextTow">
- <view :class="{on:curTabTow==index}" class="tabTitle_tow_text">{{item}}</view>
- <view :class="{on:curTabTow==index}" class="tabTitle_tow_across"></view>
- </view>
- </view>
- </scroll-view>
- <!--安全隐患排行 -->
- <view class="table" v-if="chartIndex==0">
- <uni-card>
- <view style="height: 200px">
- <zb-table :columns="column" :stripe="false" :border="false" :data="dataList"></zb-table>
- </view>
- </uni-card>
- </view>
- <!-- 一级指标排行 -->
- <view class="table-tow" v-if="chartIndex!=0 && curTabTow==0">
- <uni-card>
- <view style="height: 200px">
- <zb-table :columns="column2" :stripe="false" :border="false" :data="dataListTow"></zb-table>
- </view>
- </uni-card>
- </view>
- <!--学院单位 -->
- <view class="table-three" v-if="chartIndex!=0 && curTabTow==1">
- <uni-card>
- <view style="height: 200px">
- <zb-table :columns="column3" :stripe="false" :border="false" :data="dataListThree"></zb-table>
- </view>
- </uni-card>
- </view>
- </view>
- </template>
- <script>
- import {
- config
- } from '@/api/request/config.js'
- import {
- securityCheckPlanPlantList,
- reportAppStatisticsDangerSort,
- securityCheckDangerNotHazardOneCollect,
- securityCheckDangerHazardOneCollect,
- } from '@/pages/api/index.js'
- export default {
- name: "hazardSources",
- components: {
- },
- data() {
- return {
- chartType: 3,
- chartTitle: ['安全隐患排行', '一级指标排行', '暂无法整改'],
- chartIndex: 0,
- opts: {
- color: ["#149F12", "#FF0000", "#FF9D25", ],
- padding: [15, 15, 4, 5],
- enableScroll: false,
- legend: {
- position: 'top',
- fontColor: '#fff',
- },
- xAxis: {
- disableGrid: true,
- disabled: true,
- axisLine: false,
- },
- yAxis: {
- disableGrid: true,
- data: [{
- disabled: true,
- }]
- },
- extra: {
- column: {
- type: "group",
- width: 14,
- linearType: "opacity",
- linearOpacity: 0.6,
- }
- }
- },
- optsTow: {
- color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
- "#ea7ccc"
- ],
- padding: [5, 5, 5, 5],
- dataLabel: false,
- enableScroll: false,
- legend: {
- show: false,
- },
- extra: {
- radar: {
- gridType: "radar",
- gridColor: "#CCCCCC",
- gridCount: 3,
- opacity: 0.2,
- max: 200,
- labelShow: true,
- border: true,
- labelColor: '#fff',
- }
- }
- },
- chartData: {},
- chartDataTow: {},
- // 查询参数
- queryParams: {
- page: 1,
- pageSize: 10,
- },
- column: [{
- type: 'index',
- label: '排行',
- fixed: true,
- width: 60,
- align: 'center',
- },
- {
- name: 'deptSortName',
- label: '学院单位',
- fixed: true,
- width: 80,
- align: 'center',
- },
- {
- name: 'totalNum',
- label: '总隐患',
- align: 'center',
- },
- {
- name: 'rectifyNum',
- label: '已整改',
- align: 'center',
- },
- {
- name: 'notRectifyNum',
- label: '未整改',
- align: 'center',
- },
- {
- name: 'tempNum',
- label: '暂无法整改',
- align: 'center',
- },
- ],
- column2: [{
- type: 'index',
- label: '序号',
- fixed: true,
- width: 60,
- align: 'center',
- },
- {
- name: 'name',
- label: '一级指标',
- fixed: true,
- width: 80,
- align: 'center',
- },
- {
- name: 'num',
- label: '隐患数',
- align: 'center',
- },
- {
- name: 'ratio',
- label: '占比',
- align: 'center',
- },
- ],
- column3: [{
- type: 'index',
- label: '排行',
- fixed: true,
- width: 60,
- align: 'center',
- },
- {
- name: 'deptSortName',
- label: '学院单位',
- fixed: true,
- width: 80,
- align: 'center',
- },
- {
- name: 'hazardNum',
- label: '总隐患',
- align: 'center',
- },
- ],
- dataList: [],
- dataListTow: [],
- dataListThree: [],
- total: 0,
- tabTextTow: ['一级指标', '学院单位'],
- curTabTow: 0,
- pickerList: [],
- pickerIndex:0,
- hiddenChartBottom:[],
- }
- },
- created() {
- },
- beforeMount() {
- },
- mounted() {
- this.securityCheckPlanPlantList();
- },
- methods: {
- scrollGet() {
- },
- bindPickerChange(data) {
- console.log(data)
- this.pickerIndex = data.detail.value;
- if(this.chartIndex==0){
- //安全隐患排行
- this.reportAppStatisticsDangerSort(this.pickerList[this.pickerIndex].planId)
- }else if(this.chartIndex==1){
- //一级指标排行
- this.dataListTow=[];
- this.dataListThree=[];
- this.chartDataTow={};
- this.securityCheckDangerHazardOneCollect(this.pickerList[this.pickerIndex].planId)
- }else if(this.chartIndex==2){
- //暂无法整改
- this.dataListTow=[];
- this.dataListThree=[];
- this.chartDataTow={};
- this.securityCheckDangerNotHazardOneCollect(this.pickerList[this.pickerIndex].planId)
- }
- },
- chartClick(index) {
- this.chartIndex = index;
- if(this.chartIndex==0){
- //安全隐患排行
- this.reportAppStatisticsDangerSort(this.pickerList[this.pickerIndex].planId)
- }else if(this.chartIndex==1){
- //一级指标排行
- this.securityCheckDangerHazardOneCollect(this.pickerList[this.pickerIndex].planId)
- }else if(this.chartIndex==2){
- //暂无法整改
- this.securityCheckDangerNotHazardOneCollect(this.pickerList[this.pickerIndex].planId)
- }
- },
- //顶部tab点击
- tabClickTow(item, index) {
- this.curTabTow = index;
-
- },
- //计划标题
- async securityCheckPlanPlantList() {
- let self = this;
- const {
- data
- } = await securityCheckPlanPlantList();
- if (data.code == 200) {
- this.pickerList = data.data
- this.reportAppStatisticsDangerSort(this.pickerList[0].planId)
-
- }
- },
- //安全隐患列表数据
- async reportAppStatisticsDangerSort(planId) {
- let self = this;
- const {
- data
- } = await reportAppStatisticsDangerSort({'type':'-1','planId':planId});
- if (data.code == 200) {
- this.dataList=data.data;
- if(data.data[0]){
- let name=[];
- let list=[];
- let list2=[];
- let list3=[];
- let num=0;
- self.hiddenChartBottom=[];
- data.data.forEach(function(item,index){
- if(index<3){
- name.push(item.deptSortName)
- list.push(item.rectifyNum)
- list2.push(item.notRectifyNum)
- list3.push(item.tempNum)
- num=item.rectifyNum+item.notRectifyNum+item.tempNum
- self.hiddenChartBottom.push({'name':item.deptSortName,'total':num})
- }
- })
- let res = {
- categories: name,
- series: [{
- name: "已整改",
- textColor: '#fff',
- data: list
-
- },
- {
- name: "未整改",
- textColor: '#fff',
- data: list2
- },
- {
- name: "暂无法整改",
- textColor: '#fff',
- data: list3
- }
- ]
- };
- this.chartData = JSON.parse(JSON.stringify(res));
- }else{
- let res = {
- categories: ['无数据'],
- series: [{
- name: "已整改",
- textColor: '#fff',
- data: [0]
-
- },
- {
- name: "未整改",
- textColor: '#fff',
- data: [0]
- },
- {
- name: "暂无法整改",
- textColor: '#fff',
- data: [0]
- }
- ]
- };
- this.chartData = JSON.parse(JSON.stringify(res));
- }
- }
- },
-
- //一级指标
- async securityCheckDangerHazardOneCollect(planId) {
- let self = this;
- const {
- data
- } = await securityCheckDangerHazardOneCollect({'type':'-1','planId':planId});
- if (data.code == 200) {
- //列表
- this.dataListTow=data.data.head;
- this.dataListThree=data.data.list;
- if(data.data.head[0]){
- let name=[];
- let list=[];
- data.data.head.forEach(function(item,index){
- self.column3.push({
- name: item.code,
- label: item.name,
- align: 'center',
- })
- if(index<5){
- name.push(item.name)
- list.push(item.num)
- }
- })
- //图表
- let res = {
- categories:name,
- series: [{
- name: "",
- data: list
- }, ]
- };
- this.chartDataTow = JSON.parse(JSON.stringify(res));
-
- }else{
-
- //图表
- let res = {
- categories:['无数据'],
- series: [{
- name: "",
- data: [0]
- }]
- };
- this.chartDataTow = JSON.parse(JSON.stringify(res));
- }
-
- }
- },
- //暂无法整改
- async securityCheckDangerNotHazardOneCollect(planId) {
- let self = this;
- const {
- data
- } = await securityCheckDangerNotHazardOneCollect({'type':'-1','planId':planId});
- if (data.code == 200) {
- //列表
- this.dataListTow=data.data.head;
- this.dataListThree=data.data.list;
- if(data.data.head[0]){
- let name=[];
- let list=[];
- data.data.head.forEach(function(item,index){
- self.column3.push({
- name: item.code,
- label: item.name,
- align: 'center',
- })
- if(index<5){
- name.push(item.name)
- list.push(item.num)
- }
- })
- //图表
- let res = {
- categories:name,
- series: [{
- name: "",
- data: list
- }, ]
- };
- this.chartDataTow = JSON.parse(JSON.stringify(res));
-
- }else{
-
- //图表
- let res = {
- categories:['无数据'],
- series: [{
- name: "",
- data: [0]
- }]
- };
- this.chartDataTow = JSON.parse(JSON.stringify(res));
- }
-
- }
- },
- },
- }
- </script>
- <style lang="stylus" scoped>
- .hazardSources {
- height: 100%;
- width: 100%;
- background: #363744;
- .small-title {
- 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-l {
- flex: 1;
- font-weight: 400;
- font-size: 30rpx;
- color: #FFFFFF;
- line-height: 42rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .small-title-r {
- width: 14rpx;
- height: 8rpx;
- }
- }
- .chart {
- width: 690rpx;
- height: 520rpx;
- background: #3E414F;
- border-radius: 20rpx 20rpx 20rpx 20rpx;
- margin: 20rpx 30rpx 0;
- overflow: hidden;
-
- .chart-t {
- width: 570rpx;
- height: 50rpx;
- display: flex;
- justify-content: flex-start;
- border: 1rpx solid #52545F;
- border-radius: 10rpx;
- margin: 30rpx 0 0 72rpx;
- .chart-t-li {
- width: 190rpx;
- font-weight: 400;
- font-size: 28rpx;
- line-height: 50rpx;
- text-align: center;
- background: none;
- }
- .chart-t-li:nth-of-type(1) {
- border-right: 1rpx solid #52545F;
- }
- .chart-t-li:nth-of-type(2) {
- border-right: 1rpx solid #52545F;
- }
- .color-A {
- color: #FFFFFF;
- background: #52545F;
- }
- .color-B {
- color: #999999;
- background: none;
- }
- }
- .chart-b {
- width: 630rpx;
- height: 334rpx;
- margin-left: 30rpx;
- }
- .chart-b2 {
- width: 630rpx;
- margin: 0 30rpx;
- height: 106rx;
- display: flex;
- justify-content: flex-start;
- align-items: center;
- .chart-b2-li {
- flex: 1;
- .chart-b2-li-t {
- margin-top: 10rpx;
- text-align: center;
- >text:nth-of-type(1) {
- display: inline-block;
- width: 24rpx;
- height: 24rpx;
- background: #FF0000;
- border-radius: 6rpx 6rpx 6rpx 6rpx;
- margin-right: 10rpx;
- font-weight: 400;
- font-size: 22rpx;
- color: #FFFFFF;
- line-height: 24rpx;
- text-align: center;
- }
- >text:nth-of-type(2) {
- font-weight: 400;
- font-size: 24rpx;
- color: #FFFFFF;
- line-height: 34rpx;
- }
- }
- .chart-b2-li-b {
- margin-top: 10rpx;
- font-weight: 400;
- font-size: 24rpx;
- color: #FFFFFF;
- line-height: 34rpx;
- text-align: center;
- }
- }
- }
- .chart-b-tow {
- width: 630rpx;
- height: 440rpx;
- margin-left: 30rpx;
- }
- }
- .tabTitle_tow {
- width: 750rpx;
- height: 80rpx;
- white-space: nowrap;
- display: inline-flex;
- background: #3E414F;
- margin-top: 20rpx;
- padding-left: 35rpx;
- .tabTitle_tow_li {
- position: relative;
- width: 152rpx;
- height: 80rpx;
- text-align center;
- padding-top: 18rpx;
- box-sizing: border-box;
- .tabTitle_tow_text {
- display: inline-block;
- font-size: 32rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #FFFFFF;
- line-height: 46rpx;
- position: relative;
- &.on {
- color: #0183FA;
- }
- }
- .tabTitle_tow_across {
- width: 50rpx;
- height: 4rpx;
- background: #0183FA;
- border-radius: 2rpx;
- margin-left: 33%;
- margin-top: 16rpx;
- display none;
- &.on {
- display block;
- }
- }
- }
- }
- .table {
- width: 690rpx;
- margin-top: 20rpx;
- margin-left: 30rpx;
- border-radius: 20rpx 20rpx 0 0;
- overflow: hidden;
- }
- .sortOne {
- display: inline-block;
- width: 40rpx;
- height: 40rpx;
- padding: 4rpx;
- box-sizing: border-box;
- background: rgba(255, 0, 0, 0.2);
- font-weight: 400;
- font-size: 28rpx;
- color: #FF0000;
- line-height: 40rpx;
- text-align: center;
- border-radius: 20rpx;
- }
- .sortTow {
- display: inline-block;
- width: 40rpx;
- height: 40rpx;
- padding: 4rpx;
- box-sizing: border-box;
- background: rgba(255, 153, 0, 0.2);
- font-weight: 400;
- font-size: 28rpx;
- color: #FF9900;
- line-height: 40rpx;
- text-align: center;
- border-radius: 20rpx;
- }
- .sortThree {
- display: inline-block;
- width: 40rpx;
- height: 40rpx;
- padding: 4rpx;
- box-sizing: border-box;
- background: rgba(255, 242, 0, 0.2);
- font-weight: 400;
- font-size: 28rpx;
- color: #FFF200;
- line-height: 40rpx;
- text-align: center;
- border-radius: 20rpx;
- }
- .sortFive {
- display: inline-block;
- width: 40rpx;
- height: 40rpx;
- padding: 4rpx;
- box-sizing: border-box;
- background: rgba(1, 131, 250, 0.2);
- font-weight: 400;
- font-size: 28rpx;
- color: #0183FA;
- line-height: 40rpx;
- text-align: center;
- border-radius: 20rpx;
- }
- .table-tow {
- width: 690rpx;
- margin: 20rpx 0 0 30rpx;
- .table-border {
- width: auto;
- overflow: auto;
- .table-th {
- width: 690rpx;
- padding: 0 30rpx;
- box-sizing: border-box;
- background: rgba(162, 162, 162, 0.2);
- border-radius: 20rpx 20rpx 0rpx 0rpx;
- .table-th-li {
- height: 80rpx;
- display: flex;
- justify-content: flex-start;
- >view {
- font-weight: 400;
- font-size: 30rpx;
- color: #FFFFFF;
- line-height: 80rpx;
- text-align: center;
- margin-right: 38rpx;
- width: 120rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- >view:nth-of-type(1) {
- width: 64rpx;
- text-align: left;
- margin-right: 0;
- }
- >view:nth-of-type(2) {
- width: 270rpx;
- }
- >view:last-child {
- margin-right: 0;
- }
- }
- }
- .table-tb {
- width: 690rpx;
- background: #3E414F;
- padding: 0 30rpx;
- box-sizing: border-box;
- .table-tb-li {
- height: 80rpx;
- border-bottom: 1rpx dashed rgba(216, 216, 216, 0.2);
- display: flex;
- justify-content: flex-start;
- >view {
- font-weight: 400;
- font-size: 28rpx;
- color: #FFFFFF;
- line-height: 80rpx;
- text-align: center;
- margin-right: 38rpx;
- width: 120rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- >view:nth-of-type(1) {
- width: 64rpx;
- text-align: left;
- margin-right: 0;
- }
- >view:nth-of-type(2) {
- width: 270rpx;
- }
- >view:last-child {
- margin-right: 0;
- }
- }
- }
- }
- }
- .table-three {
- width: 720rpx;
- margin: 20rpx 0 0 30rpx;
- .table-border {
- width: auto;
- overflow: auto;
- .table-th {
- width: 1510rpx;
- padding: 0 30rpx;
- box-sizing: border-box;
- background: rgba(162, 162, 162, 0.2);
- border-radius: 20rpx 20rpx 0rpx 0rpx;
- .table-th-li {
- height: 80rpx;
- display: flex;
- justify-content: flex-start;
- >view {
- font-weight: 400;
- font-size: 30rpx;
- color: #FFFFFF;
- line-height: 80rpx;
- text-align: center;
- margin-right: 38rpx;
- width: 120rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- >view:nth-of-type(1) {
- width: 116rpx;
- text-align: left;
- margin-right: 0;
- }
- >view:nth-of-type(2) {
- width: 168rpx;
- }
- >view:last-child {
- margin-right: 0;
- width: 228rpx;
- }
- }
- }
- .table-tb {
- width: 1510rpx;
- background: #3E414F;
- padding: 0 30rpx;
- box-sizing: border-box;
- .table-tb-li {
- height: 80rpx;
- border-bottom: 1rpx dashed rgba(216, 216, 216, 0.2);
- display: flex;
- justify-content: flex-start;
- >view {
- font-weight: 400;
- font-size: 28rpx;
- color: #FFFFFF;
- line-height: 80rpx;
- text-align: center;
- margin-right: 38rpx;
- width: 120rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- >view:nth-of-type(1) {
- width: 116rpx;
- text-align: left;
- margin-right: 0;
- }
- >view:nth-of-type(2) {
- width: 168rpx;
- }
- >view:last-child {
- margin-right: 0;
- width: 228rpx;
- }
- }
- }
- }
- }
- }
- </style>
|