| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- <template>
- <div class="module-main">
- <div class="module-box">
- <div class="main-box">
- <div class="module-title">
- 任务数据总览
- <select v-model="mode" class="module-select" @change="updateData">
- <option value="1">报修</option>
- <option value="2">保洁</option>
- <option value="3">运送</option>
- <option value="4">应急</option>
- <option value="5">陪护</option>
- </select>
- </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 api from '../../api';
- @Component({
- props: {
- data: {
- type: Object,
- default: null,
- },
- },
- components: {
- echarts,
- },
- })
- export default class smodule8 extends Vue {
- mode = 1;
- flag = false;
- config = {
- header: [],
- data: [],
- rowNum: 2,
- // index: true,
- // columnWidth: [80],
- align: ['center', 'center', 'center', 'center', 'center', 'center', 'center', 'center'],
- headerBGC: 'rgba(17, 43, 117, 2.5)',
- oddRowBGC: 'rgba(17, 43, 117, 0.5)',
- evenRowBGC: 'rgba(9, 32, 99, 0.5)',
- }
- created() {
- this.updateData();
- }
- updateData() {
- if (this.timer) { // 清除定时器
- clearInterval(this.timer);
- }
- this.getTaskList();
- this.timer = setInterval(() => {
- this.getTaskList();
- }, 1000 * 60 * 1);
- }
- getTaskList() {
- api.getTaskList({
- mode: this.mode,
- }).then((res) => {
- this.flag = false;
- this.$nextTick(() => {
- this.config.header = res.data.header;
- this.config.data = res.data.data;
- this.flag = true;
- });
- }).catch(() => {}).finally(() => {
- this.flag = true;
- });
- }
- }
- </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;
- }
- .module-title::before{
- content: '';
- position: absolute;
- z-index: 1;
- height: 8px;
- width: 72px;
- top: 32px;
- left: 0;
- background-image: url(../../images/smodule/org-title.png);
- background-size: 100% 100%;
- }
- .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: 15px;
- margin-right: 5px;
- }
- .echarts{
- width: auto;
- height: calc(100% - 50px);
- margin-top: 10px;
- }
- </style>
|