smodule8.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <div class="module-main">
  3. <div class="module-box">
  4. <div class="main-box">
  5. <div class="module-title">
  6. 任务数据总览
  7. <select v-model="mode" class="module-select" @change="updateData">
  8. <option value="1">报修</option>
  9. <option value="2">保洁</option>
  10. <option value="3">运送</option>
  11. <option value="4">应急</option>
  12. <option value="5">陪护</option>
  13. </select>
  14. </div>
  15. <div class="echarts">
  16. <dv-scroll-board v-if="flag" :config="config" style="width:100%;height:100%" />
  17. </div>
  18. </div>
  19. </div>
  20. </div>
  21. </template>
  22. <script>
  23. import Vue from 'vue';
  24. import Component from 'vue-class-component';
  25. import echarts from '@/common/components/echarts.vue';
  26. import api from '../../api';
  27. @Component({
  28. props: {
  29. data: {
  30. type: Object,
  31. default: null,
  32. },
  33. },
  34. components: {
  35. echarts,
  36. },
  37. })
  38. export default class smodule8 extends Vue {
  39. mode = 1;
  40. flag = false;
  41. config = {
  42. header: [],
  43. data: [],
  44. rowNum: 2,
  45. // index: true,
  46. // columnWidth: [80],
  47. align: ['center', 'center', 'center', 'center', 'center', 'center', 'center', 'center'],
  48. headerBGC: 'rgba(17, 43, 117, 2.5)',
  49. oddRowBGC: 'rgba(17, 43, 117, 0.5)',
  50. evenRowBGC: 'rgba(9, 32, 99, 0.5)',
  51. }
  52. created() {
  53. this.updateData();
  54. }
  55. updateData() {
  56. if (this.timer) { // 清除定时器
  57. clearInterval(this.timer);
  58. }
  59. this.getTaskList();
  60. this.timer = setInterval(() => {
  61. this.getTaskList();
  62. }, 1000 * 60 * 1);
  63. }
  64. getTaskList() {
  65. api.getTaskList({
  66. mode: this.mode,
  67. }).then((res) => {
  68. this.flag = false;
  69. this.$nextTick(() => {
  70. this.config.header = res.data.header;
  71. this.config.data = res.data.data;
  72. this.flag = true;
  73. });
  74. }).catch(() => {}).finally(() => {
  75. this.flag = true;
  76. });
  77. }
  78. }
  79. </script>
  80. <style lang="css">
  81. .line1 {
  82. overflow: hidden;
  83. text-overflow: ellipsis;
  84. display: box;
  85. display: -webkit-box;
  86. line-clamp: 1;
  87. box-orient: vertical;
  88. -webkit-line-clamp: 1;
  89. -webkit-box-orient: vertical;
  90. word-break: break-all;
  91. }
  92. </style>
  93. <style scoped lang="scss">
  94. *{
  95. box-sizing:border-box;
  96. color: #fff;
  97. }
  98. .text-right{
  99. text-align: right;
  100. }
  101. .pull-right{
  102. float: right !important;
  103. }
  104. .module-title{
  105. position: relative;
  106. height: 40px;
  107. line-height: 40px;
  108. font-size: 16px;
  109. }
  110. .module-title::before{
  111. content: '';
  112. position: absolute;
  113. z-index: 1;
  114. height: 8px;
  115. width: 72px;
  116. top: 32px;
  117. left: 0;
  118. background-image: url(../../images/smodule/org-title.png);
  119. background-size: 100% 100%;
  120. }
  121. .main-box{
  122. width: 100%;
  123. height: 100%;
  124. padding: 10px;
  125. position: relative;
  126. padding-top: 0;
  127. }
  128. .module-select{
  129. width: 80px;
  130. height: 20px;
  131. color: #A6D6FF;
  132. background-color: #061A3B;
  133. outline: none;
  134. border: 1px solid #A6D6FF;
  135. float: right;
  136. vertical-align: middle;
  137. margin-top: 15px;
  138. margin-right: 5px;
  139. }
  140. .echarts{
  141. width: auto;
  142. height: calc(100% - 50px);
  143. margin-top: 10px;
  144. }
  145. </style>