smodule87.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <div class="module-main">
  3. <div class="module-box">
  4. <div class="main-box">
  5. <div class="module-title">
  6. 三级品控
  7. <span class="pull-right">
  8. <div class="subname" :class="{cur:type ==3}" @click="timeClick(3)">集团巡检</div>
  9. <div class="subname" :class="{cur:type ==2}" @click="timeClick(2)">区域抽检</div>
  10. <div class="subname" :class="{cur:type ==1}" @click="timeClick(1)">项目自检</div>
  11. </span>
  12. </div>
  13. <div class="echarts">
  14. <dv-scroll-board v-if="flag" :config="config" style="width:100%;height:100%" />
  15. </div>
  16. </div>
  17. </div>
  18. </div>
  19. </template>
  20. <script>
  21. import Vue from 'vue';
  22. import Component from 'vue-class-component';
  23. import echarts from '@/common/components/echarts.vue';
  24. import Bus from '../../../../common/components/bus';
  25. import api from '../../api';
  26. @Component({
  27. props: {
  28. data: {
  29. type: Object,
  30. default: null,
  31. },
  32. },
  33. components: {
  34. echarts,
  35. },
  36. })
  37. export default class smodule87 extends Vue {
  38. flag = false;
  39. type = 1;
  40. timeInfo = {}
  41. config = {
  42. header: [],
  43. data: [],
  44. rowNum: 2,
  45. // index: true,
  46. columnWidth: [40],
  47. align: ['center', 'center', 'center', 'center'],
  48. headerBGC: 'rgba(17, 43, 117, 0.5)',
  49. oddRowBGC: 'rgba(17, 43, 117, 0.5)',
  50. evenRowBGC: 'rgba(9, 32, 99, 0.5)',
  51. }
  52. created() {
  53. Bus.$on('dateTypeInfo', this.getDateInfo);
  54. this.threeTypeList();
  55. setInterval(() => {
  56. this.threeTypeList();
  57. }, 1000 * 60 * 5);
  58. }
  59. threeTypeList() {
  60. const dd = {
  61. type: this.type,
  62. dateType: this.timeInfo ? this.timeInfo.type : 0,
  63. date: this.timeInfo ? this.timeInfo.date : '',
  64. };
  65. api.threeTypeList(dd).then((res) => {
  66. this.flag = false;
  67. this.$nextTick(() => {
  68. this.config.header = res.data.header;
  69. this.config.data = res.data.list;
  70. this.flag = true;
  71. });
  72. }).catch(() => {}).finally(() => {
  73. this.flag = true;
  74. });
  75. }
  76. timeClick(e) {
  77. if (e === 1) {
  78. this.type = 1;
  79. } else if (e === 2) {
  80. this.type = 2;
  81. } else {
  82. this.type = 3;
  83. }
  84. this.threeTypeList();
  85. }
  86. getDateInfo(e) {
  87. this.timeInfo = e;
  88. this.threeTypeList();
  89. }
  90. }
  91. </script>
  92. <style lang="css">
  93. .line1 {
  94. overflow: hidden;
  95. text-overflow: ellipsis;
  96. display: box;
  97. display: -webkit-box;
  98. line-clamp: 1;
  99. box-orient: vertical;
  100. -webkit-line-clamp: 1;
  101. -webkit-box-orient: vertical;
  102. word-break: break-all;
  103. }
  104. </style>
  105. <style scoped lang="scss">
  106. *{
  107. box-sizing:border-box;
  108. color: #fff;
  109. }
  110. .text-right{
  111. text-align: right;
  112. }
  113. .pull-right{
  114. float: right !important;
  115. }
  116. .module-title{
  117. position: relative;
  118. height: 40px;
  119. line-height: 40px;
  120. font-size: 16px;
  121. }
  122. .main-box{
  123. width: 100%;
  124. height: 100%;
  125. padding: 10px;
  126. position: relative;
  127. padding-top: 0;
  128. }
  129. .module-select{
  130. width: 80px;
  131. height: 20px;
  132. color: #A6D6FF;
  133. background-color: #061A3B;
  134. outline: none;
  135. border: 1px solid #A6D6FF;
  136. float: right;
  137. vertical-align: middle;
  138. margin-top: 10px;
  139. margin-right: 5px;
  140. }
  141. .echarts{
  142. width: auto;
  143. height: calc(100% - 50px);
  144. margin-top: 10px;
  145. }
  146. .pull-right .subname{
  147. height: 30px;
  148. line-height: 30px;
  149. margin-top: 5px;
  150. padding: 0 0.5vw;
  151. text-align: center;
  152. font-size: 12px;
  153. color: #B1CDEF;
  154. background: #002862;
  155. border-radius: 2px;
  156. border: 1px solid #1B68A9;
  157. display: inline-block;
  158. float: right;
  159. margin-right: 0.2vw;
  160. cursor: pointer;
  161. }
  162. .pull-right .cur{
  163. color: #fff !important;
  164. background-image: url(../../images/smodule/cur-bg.png) !important;
  165. background-repeat: no-repeat;
  166. background-size: 100% 100%;
  167. }
  168. </style>