flow-done.vue 1.7 KB
<template>
  <workbench-card title="已办事宜" subtitle="累计已办流程" icon="el-icon-circle-check" tone="purple" :loading="loading">
    <div class="done">
      <div class="done__icon"><i class="el-icon-circle-check" /></div>
      <div class="done__num">{{ flowDone }}</div>
      <div class="done__label">累计已办流程</div>
      <el-button type="primary" plain size="mini" @click="goMore">查看已办</el-button>
    </div>
  </workbench-card>
</template>

<script>
import WorkbenchCard from '../workbench-card.vue'
import { fetchFlowWorkbenchCounts } from '../flow-counts'

export default {
  name: 'WidgetFlowDone',
  components: { WorkbenchCard },
  data() {
    return { loading: false, flowDone: 0 }
  },
  mounted() {
    this.load()
  },
  methods: {
    async load() {
      this.loading = true
      try {
        const d = await fetchFlowWorkbenchCounts()
        this.flowDone = d.flowDone || 0
      } catch (e) {
        this.flowDone = 0
      } finally {
        this.loading = false
      }
    },
    goMore() {
      this.$router.push('/workFlow/flowDone').catch(() => {})
    }
  }
}
</script>

<style lang="scss" scoped>
.done {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 0;
}
.done__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #f5f3ff;
  color: #8b5cf6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 8px;
}
.done__num {
  font-size: 32px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.done__label {
  margin: 6px 0 14px;
  font-size: 13px;
  color: #64748b;
}
</style>