workbench.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <template>
  2. <view>
  3. <cu-custom bgColor="bg-blue">
  4. <block slot="content"> 工作台</block>
  5. </cu-custom>
  6. <swiper class="screen-swiper square-dot bg-blue" :indicator-dots="true" :circular="true"
  7. :autoplay="true" interval="2000" duration="500">
  8. <swiper-item v-for="(item,index) in swiperList" :key="index">
  9. <image :src="item.url" mode="aspectFill" v-if="item.type=='image'"></image>
  10. <video :src="item.url" autoplay loop muted :show-play-btn="false" :controls="false" objectFit="cover" v-if="item.type=='video'"></video>
  11. </swiper-item>
  12. </swiper>
  13. <view class="cu-list grid col-4 no-border fixed">
  14. <view @tap="toTodoList" class="circle-button-box">
  15. <view class="cuIcon-time text-blue circle-button font-size-35"></view>
  16. <text>待办事项</text>
  17. </view>
  18. <view @tap="toHistoryList" class="circle-button-box">
  19. <view class="cuIcon-roundcheck text-blue circle-button font-size-35"></view>
  20. <text>已办事项</text>
  21. </view>
  22. <view @tap="toApplyList" class="circle-button-box">
  23. <view class="cuIcon-peoplelist text-blue circle-button font-size-35"></view>
  24. <text>我发起的</text>
  25. </view>
  26. <view @tap="toFlowCopyList" class="circle-button-box">
  27. <view class="cuIcon-copy text-blue circle-button font-size-35"></view>
  28. <text>抄送给我</text>
  29. </view>
  30. </view>
  31. <scroll-view scroll-y class="page">
  32. <template v-for="key in processMap.keys()">
  33. <view class="cu-bar bg-white solid-bottom margin-top">
  34. <view class="action">
  35. <text class=" text-orange font-b">{{key}}</text>
  36. </view>
  37. </view>
  38. <view class="cu-list grid col-4 no-border">
  39. <view class="circle-button-box" @click="start(act)" v-for="(act, index) in processMap.get(key)" :key="index">
  40. <view class="cuIcon-calendar bg-blue text-white circle-button font-size-35"></view>
  41. <text class="ellipsis-description">{{act.name}}</text>
  42. </view>
  43. </view>
  44. </template>
  45. <u-gap height="80" bgColor="#fff"></u-gap>
  46. </scroll-view>
  47. </view>
  48. </template>
  49. <script>
  50. import moment from 'moment'
  51. import {mapState, mapMutations, mapActions} from 'vuex'
  52. import actCategoryService from "@/api/flowable/actCategoryService"
  53. import processService from "@/api/flowable/processService"
  54. import taskService from "@/api/flowable/taskService"
  55. export default {
  56. data() {
  57. return {
  58. cardCur: 0,
  59. dataList: [],
  60. categoryList: [],
  61. processMap: new Map(),
  62. swiperList: [{
  63. id: 0,
  64. type: 'image',
  65. url: '/static/swiper/1.svg'
  66. }, {
  67. id: 1,
  68. type: 'image',
  69. url: '/static/swiper/2.svg'
  70. }, {
  71. id: 2,
  72. type: 'image',
  73. url: '/static/swiper/3.svg'
  74. }, {
  75. id: 3,
  76. type: 'image',
  77. url: '/static/swiper/4.svg'
  78. }, {
  79. id: 4,
  80. type: 'image',
  81. url: '/static/swiper/5.svg'
  82. }, {
  83. id: 5,
  84. type: 'image',
  85. url: '/static/swiper/6.svg'
  86. }, {
  87. id: 6,
  88. type: 'image',
  89. url: '/static/swiper/7.svg'
  90. }],
  91. dotStyle: false,
  92. towerStart: 0,
  93. direction: ''
  94. };
  95. },
  96. computed: mapState({
  97. username: (state) => state.user.username
  98. }),
  99. async mounted() {
  100. let res = await actCategoryService.treeData()
  101. let data = await processService.list({current: 1, size: -1})
  102. this.processMap = new Map()
  103. res.forEach((item)=>{
  104. this.processMap.set(item.name, [])
  105. })
  106. let list = data.records
  107. list.forEach((item)=>{
  108. if(this.processMap.has(item.category)){
  109. let list = this.processMap.get(item.category)
  110. list.push(item)
  111. }else{
  112. this.processMap.set(item.category, [item])
  113. }
  114. })
  115. for(let [key,value] of this.processMap){
  116. console.log(key,value);
  117. }
  118. },
  119. created() {
  120. if(!this.username) {
  121. this.refreshUserInfo()
  122. }
  123. },
  124. methods: {
  125. ...mapActions(['refreshUserInfo']),
  126. toApplyList (mail) {
  127. uni.navigateTo({
  128. url: '/pages/workbench/task/ApplyList'
  129. })
  130. },
  131. toTodoList (mail) {
  132. uni.navigateTo({
  133. url: '/pages/workbench/task/TodoList'
  134. })
  135. },
  136. toHistoryList (mail) {
  137. uni.navigateTo({
  138. url: '/pages/workbench/task/HistoryList'
  139. })
  140. },
  141. toFlowCopyList (mail) {
  142. uni.navigateTo({
  143. url: '/pages/workbench/task/FlowCopyList'
  144. })
  145. },
  146. start (row) {
  147. // 读取流程表单
  148. taskService.getTaskDef({
  149. procDefId: row.id,
  150. status: 'start'
  151. }).then((data) => {
  152. let processTitle = `${this.username} 在 ${moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [${row.name}]`
  153. let query = {procDefId: row.id, procDefKey: row.key, status: 'start', title: `发起流程【${row.name}】`, formType: data.formType, formUrl: data.formUrl, formTitle: processTitle}
  154. uni.navigateTo({
  155. url: '/pages/workbench/task/TaskForm?flow='+JSON.stringify(query)
  156. })
  157. })
  158. }
  159. }
  160. }
  161. </script>
  162. <style>
  163. .cu-list.card-menu {
  164. overflow: hidden;
  165. margin-right: 5px;
  166. margin-left: 5px;
  167. border-radius: 7px;
  168. }
  169. .cu-list.card-menu.margin-top-20 {
  170. margin-top: -20px;
  171. }
  172. .cu-list.menu>.cu-item .content>uni-view:first-child {
  173. display: -webkit-box;
  174. display: -webkit-flex;
  175. display: flex;
  176. -webkit-box-align: center;
  177. /* -webkit-align-items: center; */
  178. /* align-items: center; */
  179. display: inline-block;
  180. margin-right: 5px;
  181. width: 1.6em;
  182. text-align: center;
  183. }
  184. .font-size-35{
  185. font-size: 35px!important;
  186. }
  187. .circle-button{
  188. width: 44px;
  189. height: 44px;
  190. border-radius: 18px;
  191. padding-top: 4px;
  192. }
  193. .circle-button-box{
  194. width: 25%;
  195. margin-top: 10px;
  196. display: -webkit-box;
  197. display: -webkit-flex;
  198. display: flex;
  199. -webkit-box-orient: vertical;
  200. -webkit-box-direction: normal;
  201. -webkit-flex-direction: column;
  202. flex-direction: column;
  203. -webkit-box-align: center;
  204. -webkit-align-items: center;
  205. align-items: center;
  206. -webkit-box-pack: center;
  207. -webkit-justify-content: center;
  208. justify-content: center;
  209. box-sizing: border-box;
  210. }
  211. .font-b {
  212. vertical-align: middle;
  213. font-size: 18px;
  214. font-weight: 500;
  215. color: #3a3a3a;
  216. }
  217. </style>