| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- <template>
- <div class="module-main">
- <div class="module-box">
- <div class="main-box">
- <div class="module-title">
- 三级品控
- <span class="pull-right">
- <div class="subname" :class="{cur:type ==3}" @click="timeClick(3)">集团巡检</div>
- <div class="subname" :class="{cur:type ==2}" @click="timeClick(2)">区域抽检</div>
- <div class="subname" :class="{cur:type ==1}" @click="timeClick(1)">项目自检</div>
- </span>
- </div>
- <div class="echarts">
- <dv-scroll-board v-if="flag" :config="config" style="width:100%;height:100%" />
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import Vue from 'vue';
- import Component from 'vue-class-component';
- import echarts from '@/common/components/echarts.vue';
- import Bus from '../../../../common/components/bus';
- import api from '../../api';
- @Component({
- props: {
- data: {
- type: Object,
- default: null,
- },
- },
- components: {
- echarts,
- },
- })
- export default class smodule87 extends Vue {
- flag = false;
- type = 1;
- timeInfo = {}
- config = {
- header: [],
- data: [],
- rowNum: 2,
- // index: true,
- columnWidth: [40],
- align: ['center', 'center', 'center', 'center'],
- headerBGC: 'rgba(17, 43, 117, 0.5)',
- oddRowBGC: 'rgba(17, 43, 117, 0.5)',
- evenRowBGC: 'rgba(9, 32, 99, 0.5)',
- }
- created() {
- Bus.$on('dateTypeInfo', this.getDateInfo);
- this.threeTypeList();
- setInterval(() => {
- this.threeTypeList();
- }, 1000 * 60 * 5);
- }
- threeTypeList() {
- const dd = {
- type: this.type,
- dateType: this.timeInfo ? this.timeInfo.type : 0,
- date: this.timeInfo ? this.timeInfo.date : '',
- };
- api.threeTypeList(dd).then((res) => {
- this.flag = false;
- this.$nextTick(() => {
- this.config.header = res.data.header;
- this.config.data = res.data.list;
- this.flag = true;
- });
- }).catch(() => {}).finally(() => {
- this.flag = true;
- });
- }
- timeClick(e) {
- if (e === 1) {
- this.type = 1;
- } else if (e === 2) {
- this.type = 2;
- } else {
- this.type = 3;
- }
- this.threeTypeList();
- }
- getDateInfo(e) {
- this.timeInfo = e;
- this.threeTypeList();
- }
- }
- </script>
- <style lang="css">
- .line1 {
- overflow: hidden;
- text-overflow: ellipsis;
- display: box;
- display: -webkit-box;
- line-clamp: 1;
- box-orient: vertical;
- -webkit-line-clamp: 1;
- -webkit-box-orient: vertical;
- word-break: break-all;
- }
- </style>
- <style scoped lang="scss">
- *{
- box-sizing:border-box;
- color: #fff;
- }
- .text-right{
- text-align: right;
- }
- .pull-right{
- float: right !important;
- }
- .module-title{
- position: relative;
- height: 40px;
- line-height: 40px;
- font-size: 16px;
- }
- .main-box{
- width: 100%;
- height: 100%;
- padding: 10px;
- position: relative;
- padding-top: 0;
- }
- .module-select{
- width: 80px;
- height: 20px;
- color: #A6D6FF;
- background-color: #061A3B;
- outline: none;
- border: 1px solid #A6D6FF;
- float: right;
- vertical-align: middle;
- margin-top: 10px;
- margin-right: 5px;
- }
- .echarts{
- width: auto;
- height: calc(100% - 50px);
- margin-top: 10px;
- }
- .pull-right .subname{
- height: 30px;
- line-height: 30px;
- margin-top: 5px;
- padding: 0 0.5vw;
- text-align: center;
- font-size: 12px;
- color: #B1CDEF;
- background: #002862;
- border-radius: 2px;
- border: 1px solid #1B68A9;
- display: inline-block;
- float: right;
- margin-right: 0.2vw;
- cursor: pointer;
- }
- .pull-right .cur{
- color: #fff !important;
- background-image: url(../../images/smodule/cur-bg.png) !important;
- background-repeat: no-repeat;
- background-size: 100% 100%;
- }
- </style>
|