vue-element-admin目录数字

vue-element-admin目录数字
在这里插入图片描述
创建allTypeNum.js

// 导入页面api
import { listWaitTasks } from '@/api/project'
import {queryDraftList} from '@/api/project'
import {listBusinessInfo} from '@/api/project'
const state = {
  allTypeNum: {
    bpmnDrafts: 0,
    bpmnToDoWork: 0,
    bpmnWorkDone: 0,
    bpmnProcessSubmitted: 0,
    bpmnProcessRevoked: 0,
    bpmnProcessPassed: 0
  }
}

// 监听事件
const mutations = {
  // 待办
  bpmnToDoWork_num: (state, num) => {
    state.allTypeNum.bpmnToDoWork = num
  },
  // 草稿箱
  draft_num: (state, num) => {
    state.allTypeNum.bpmnDrafts = num
  },
  // 全部
  listBusinessInfo_num: (state, num) => {
    state.allTypeNum.bpmnWorkDone = num
  }

}
// 流程任务中心数据调用
const actions = {
  // 待办
  bg_leftBadge({ commit }) {
    listWaitTasks().then(response => {
      if (response.status === 'success') {
          commit('bpmnToDoWork_num', response.total)
      }
    })
  },

  // 草稿箱
  draft_leftBadge({ commit }) {
    queryDraftList().then(response => {
      if (response.status === 'success') {
        commit('draft_num', response.total)
      }
    })
  },

  // 全部
  listBusinessInfo_leftBadge({ commit }) {
    listBusinessInfo().then(response => {
      if (response.status === 'success') {
        commit('listBusinessInfo_num', response.total)
      }
    })
  }

}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}

<template>

</template>
<script>
  import {mapGetters} from 'vuex'
  export default {
 			 data(){
  			}
		    computed: {
      			...mapGetters(['allTypeNum'])
    },
       mounted() {
     	 this.my()
    },
    methods: {
      my(){
        // 待办
        this.$store.dispatch('allTypeNum/bg_leftBadge')

        // 草稿箱
        this.$store.dispatch('allTypeNum/draft_leftBadge')

        // 全部
        this.$store.dispatch('allTypeNum/listBusinessInfo_leftBadge')
      }

    }
}
</script>


<!--
 * @Description: 草稿箱页面
 * @Author: lijinghailjh@163.com
 * @Date: 2021/8/19
 -->
<template>
  <div class="app-container">
<!--    表格v2.0-->
    <el-row class="formBox" style="height: 500px">
      <dms-table
        id="pbTable"
        ref="pbTable"
        :data = "gridData"
        url="bpm/work/flowCtrl/queryDraftList.do"
        :columns="tableColumns"
        :toolbar="nullConfig">

        <template v-slot:operation="{row, column}">
          <el-button @click="handleModify(row)">编辑</el-button>
        </template>
      </dms-table>
    </el-row>

    <create-supply-source :dialogShow="supplySourceDialogInfo.visible"
                          v-if="supplySourceDialogInfo.visible"
                          :openmode="supplySourceDialogInfo.openmode"
                          :draft-id="supplySourceDialogInfo.draftId"
                          @dialogShowChange="supplySourceDialogInfo.visible=false"></create-supply-source>

    <create-supply-HT :dialogShow="supplyHTDialogInfo.visible"
                      v-if="supplyHTDialogInfo.visible"
                      :openmode="supplyHTDialogInfo.openmode"
                      :draft-id="supplyHTDialogInfo.draftId"
                      @dialogShowChange="supplyHTDialogInfo.visible=false"></create-supply-HT>

  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import createSupplySource from '@/views/gf/components/createSupplySource'
import {
  queryDraftList
} from '@/api/project'
import waves from '@/directive/waves' // waves directive
import Pagination from '@/components/Pagination'
import dmsTable from '@/components/DmsTable/DmsTable'
import createSupplyHT from '@/views/gf/components/createSupplyHT'

export default {
  name: 'draft',
  components: { Pagination, createSupplySource, dmsTable, createSupplyHT },
directives: { waves },
  filters: {

  },
  computed: {
    ...mapGetters(['allTypeNum'])
  },
  data() {
    return {
      myNum: null,
      gridData: [],
      tableData: null,
      nullConfig: null,
      tableColumns: [
        {
          field: 'type',
          title: '流程类型',
          width: 100,
          fixed: 'left',
          align: 'center'
        },
        {
          field: 'title',
          title: '主题',
          fixed: 'left',
          align: 'center'
        },
        {
          field: 'description',
          title: '描述',
          fixed: 'left',
          align: 'center'
        },
        {
          field: 'createTime',
          title: '创建日期',
          fixed: 'left',
          align: 'center'
        },
        {
          field: 'lastUpdateTime',
          title: '最近修改',
          fixed: 'left',
          align: 'center'
        },
        {
          field: 'currentTask',
          title: '当前状态',
          fixed: 'left',
          align: 'center'
        },
        {
          field: 'operation',
          title: '操作',
          slots: {
            default: 'operation'
          },
          align: 'center'
        }
      ],
      draftList: [],
      queryCondition: {
        keys: '',
        pageSize: -1,
        pageIndex: 1,
        total: 0
      },
      listLoading: false,
      supplySourceDialogInfo: {
        visible: false,
        openmode: 'draft',
        draftId: ''
      },
      supplyHTDialogInfo: {
        visible: false,
        openmode: 'draft',
        draftId: ''
      }
    }
  },
  mounted() {
    // this.myqueryDraftList()
    this.queryDraftList()
  },
  methods: {
    onQuery() {
      this.$refs.draftTable.reload()
    },

    setLeftBadge(num) {
      var a = this.allTypeNum
      a.bpmnDrafts = num
      this.$store.commit('allTypeNum/draft_num', a)
    },
    queryDraftList() {
      const self = this
      queryDraftList(this.queryCondition).then(function(res) {
        self.draftList = res.data
        self.setLeftBadge(res.tooltip)
      })
    },

    handleModify(row) {
      if (row.processKey === 'supplierProjectReview') {
        this.supplySourceDialogInfo.draftId = row.id
        this.supplySourceDialogInfo.visible = true
      } else if (row.processKey === 'homeProjectReview') {
        console.log(row)
        this.supplyHTDialogInfo.draftId = row.id
        this.supplyHTDialogInfo.visible = true
      }
    },
    handleDelete(row) {

    }
  }
}
</script>
<style scoped>
.el-row {
  margin-bottom: 200px;
}
.minusWidthTo60 {
  width: 80%;
  margin-right: 10px;
}
.el-dialog__header {
  text-align: center;
}
.el-form-item__content {
  margin-right: 20px;
}

.el-dialog__wrapper .el-select,
.el-dialog__wrapper .el-date-editor {
  width: 100% !important;
}
.line {
  text-align: center;
}
.powerDialog /deep/ .el-dialog .el-dialog__body {
  padding: 0 20px 30px !important;
}
.powerHeadLine.el-divider--horizontal {
  margin: 0 0 24px;
}
</style>


效果图
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值