TaskStatistics.vue 6 KB
Newer Older
潘际乾 committed
1
<template>
潘际乾 committed
2 3
  <CellWrapper title="任务统计" :cellContentHeight="cellContentHeight">
    <template v-slot:header>
潘际乾 committed
4
      <span class="el-icon-refresh" title="刷新"></span>
5
      <!-- <span class="el-icon-more" title="操作"></span> -->
潘际乾 committed
6 7 8
    </template>

    <div class="statistics-container">
潘际乾 committed
9
      <div class="task-stat-display total">
10
        <div class="display-wrapper">
潘际乾 committed
11 12 13 14 15 16
          <div
            class="stat-item"
            v-for="(item, idx) in total"
            :key="idx"
            :style="{ width: item.name === '来报待处理' ? '20%' : 'unset' }"
          >
17
            <div class="stat-name" @click="goToTaskPage(item.name)">{{ item.name }}</div>
18 19
            <div class="stat-count">{{ item.count }}</div>
          </div>
潘际乾 committed
20 21 22 23 24 25 26
        </div>
      </div>
      <div class="task-sign mime">
        <span class="el-icon-s-custom"></span>
        我的工作
      </div>
      <div class="task-stat-display mime">
27 28
        <div class="display-wrapper">
          <div class="stat-item" v-for="(item, idx) in mime" :key="idx">
29
            <div class="stat-name" @click="goToTaskPage(item.name)">{{ item.name }}</div>
30 31
            <div class="stat-count">{{ item.count }}</div>
          </div>
潘际乾 committed
32 33 34 35 36 37 38
        </div>
      </div>
      <div class="task-sign pty">
        <span class="el-icon-s-platform"></span>
        机构工作
      </div>
      <div class="task-stat-display pty">
39 40
        <div class="display-wrapper">
          <div class="stat-item" v-for="(item, idx) in pty" :key="idx">
41
            <div class="stat-name" @click="goToTaskPage(item.name)">{{ item.name }}</div>
42 43
            <div class="stat-count">{{ item.count }}</div>
          </div>
潘际乾 committed
44 45 46
        </div>
      </div>
    </div>
潘际乾 committed
47
  </CellWrapper>
潘际乾 committed
48 49 50
</template>

<script>
wangren committed
51 52
import CellHeader from "../common/CellHeader.vue";
import CellWrapper  from "../common/CellWrapper.vue";
wangren committed
53 54
import { all,my,ins } from "~/service/report";

潘际乾 committed
55 56 57

export default {
  name: "TaskStatistics",
潘际乾 committed
58 59
  props: ["cellContentHeight"],
  components: { CellWrapper },
潘际乾 committed
60 61 62
  data() {
    return {
      total: [
63 64 65 66 67 68
        // { name: "待经办", count: "5454" },
        // { name: "来报待处理", count: "4231" },
        // { name: "待复核", count: "652" },
        // { name: "待授权", count: "2" },
        // { name: "待匹配", count: "5" },
        // { name: "待打印", count: "1235" },
潘际乾 committed
69 70
      ],
      mime: [
71 72 73 74 75 76 77
        // { name: "待经办", count: "154" },
        // { name: "待修改", count: "1254" },
        // { name: "待复核", count: "5" },
        // { name: "待授权", count: "0" },
        // { name: "待回复", count: "0" },
        // { name: "待打印", count: "4564" },
        // { name: "已完结", count: "3212" },
潘际乾 committed
78
      ],
79 80 81 82 83 84 85 86 87 88 89 90
      pty: [

      ],
      mapping: {
        '待经办': 'sptsel',
        '来报待处理': 'sptsel',
        '待复核': 'trnrel',
        '待授权': 'trnrel',
        '待匹配': 'sptsel',
        '待打印': 'trnfnd',
        '待修改': 'sptsel',
        '待回复': '',
91
        '已完结': 'trnfnd',
92
      }
潘际乾 committed
93 94
    };
  },
liuxin committed
95
  created() {
潘际乾 committed
96
      all().then(res => {
97
          this.total=res;
wangren committed
98 99
      }),
      my().then(res =>{
100
         this.mime = res;
wangren committed
101 102
      }),
      ins().then(res =>{
103
        this.pty = res;
liuxin committed
104
      })
105
  },
106 107 108 109 110 111 112 113 114 115 116
  //点击对应的文字 跳转
  methods: {
    goToTaskPage(name) {
      if(!this.mapping[name]) {
        return;
      }
      this.$router.push('/taskList').then(() => {
        this.$store.commit('setTaskListTabVal', this.mapping[name])
      })
    }
  }
潘际乾 committed
117 118 119 120
};
</script>

<style scoped>
潘际乾 committed
121 122
.statistics-container {
  height: 100%;
潘际乾 committed
123 124 125 126
  padding: 0px 8px;
}
.task-stat-display {
  height: 25%;
潘际乾 committed
127
  /* max-height: 90px; */
潘际乾 committed
128 129 130
  display: flex;
  justify-content: space-around;
  color: #f3f3f3;
131 132
  border-radius: 10px;
  box-sizing: border-box;
潘际乾 committed
133
  padding: 8px;
134
  background-color: #e7eaef;
潘际乾 committed
135
}
136 137 138 139 140
.task-stat-display .display-wrapper {
  width: 100%;
  display: flex;
}
.task-stat-display .display-wrapper .stat-item {
潘际乾 committed
141
  flex: auto;
142 143 144 145 146 147 148 149 150
}
.task-stat-display.total .display-wrapper {
  border: 1px solid rgb(17 106 153 / 60%);
}
.task-stat-display.mime .display-wrapper {
  border: 1px solid rgb(215 40 40 / 60%);
}
.task-stat-display.pty .display-wrapper {
  border: 1px solid rgb(17 124 74 / 60%);
潘际乾 committed
151
}
152 153
.task-stat-display.total .stat-name {
  background-color: rgb(17 106 153 / 60%);
潘际乾 committed
154
}
155 156
.task-stat-display.mime .stat-name {
  background-color: rgb(215 40 40 / 60%);
潘际乾 committed
157
}
158 159 160 161 162
.task-stat-display.pty .stat-name {
  background-color: rgb(17 124 74 / 60%);
}
.task-stat-display .stat-count {
  height: 50%;
潘际乾 committed
163 164 165
  display: flex;
  justify-content: center;
  align-items: center;
166
  color: #606266;
潘际乾 committed
167
}
168 169 170 171 172 173 174 175
.task-stat-display.total .display-wrapper .stat-item .stat-count {
  border-right: 1px solid rgb(17 106 153 / 60%);
}
.task-stat-display.mime .display-wrapper .stat-item .stat-count {
  border-right: 1px solid rgb(215 40 40 / 60%);
}
.task-stat-display.pty .display-wrapper .stat-item .stat-count {
  border-right: 1px solid rgb(17 124 74 / 60%);
潘际乾 committed
176 177
}
.task-stat-display .stat-name {
178
  border-bottom: 1px solid;
潘际乾 committed
179 180
  font-size: 14px;
  font-weight: 400;
181 182 183 184 185
  height: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  border-right: 1px solid;
186
  /* 鼠标改为指针可以跳转 */
187
  cursor: pointer;
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205
}
.task-stat-display.total .display-wrapper .stat-item:last-child .stat-count {
  border-right: 0;
}
.task-stat-display.total .display-wrapper .stat-item:last-child .stat-name {
  border-right: 0;
}
.task-stat-display.mime .display-wrapper .stat-item:last-child .stat-count {
  border-right: 0;
}
.task-stat-display.mime .display-wrapper .stat-item:last-child .stat-name {
  border-right: 0;
}
.task-stat-display.pty .display-wrapper .stat-item:last-child .stat-count {
  border-right: 0;
}
.task-stat-display.pty .display-wrapper .stat-item:last-child .stat-name {
  border-right: 0;
潘际乾 committed
206 207
}
.task-sign {
潘际乾 committed
208
  height: 12.5%;
潘际乾 committed
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
  display: flex;
  align-items: center;
  padding-left: 15px;
  font-size: 14px;
  font-weight: 400;
}
.task-sign [class^="el-icon-"] {
  font-size: 25px;
  margin-right: 10px;
}
.task-sign.mime [class^="el-icon-"] {
  color: #e56649;
}
.task-sign.pty [class^="el-icon-"] {
  color: #0e63a2;
}
</style>