workbench.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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. <view class="cu-tabbar-height"></view>
  46. </scroll-view>
  47. <view class="cu-tabbar-height"></view>
  48. </view>
  49. </template>
  50. <script>
  51. import moment from 'moment'
  52. import {mapState} from 'vuex'
  53. import ActCategoryService from "@/api/flowable/ActCategoryService"
  54. import ProcessService from "@/api/flowable/ProcessService"
  55. import TaskService from "@/api/flowable/TaskService"
  56. export default {
  57. actCategoryService: null,
  58. processService: null,
  59. taskService: null,
  60. created() {
  61. this.actCategoryService = new ActCategoryService()
  62. this.processService = new ProcessService()
  63. this.taskService = new TaskService()
  64. },
  65. data() {
  66. return {
  67. cardCur: 0,
  68. dataList: [],
  69. categoryList: [],
  70. processMap: new Map(),
  71. swiperList: [{
  72. id: 0,
  73. type: 'image',
  74. url: '/static/swiper/1.svg'
  75. }, {
  76. id: 1,
  77. type: 'image',
  78. url: '/static/swiper/2.svg'
  79. }, {
  80. id: 2,
  81. type: 'image',
  82. url: '/static/swiper/3.svg'
  83. }, {
  84. id: 3,
  85. type: 'image',
  86. url: '/static/swiper/4.svg'
  87. }, {
  88. id: 4,
  89. type: 'image',
  90. url: '/static/swiper/5.svg'
  91. }, {
  92. id: 5,
  93. type: 'image',
  94. url: '/static/swiper/6.svg'
  95. }, {
  96. id: 6,
  97. type: 'image',
  98. url: '/static/swiper/7.svg'
  99. }],
  100. dotStyle: false,
  101. towerStart: 0,
  102. direction: ''
  103. };
  104. },
  105. computed: mapState({
  106. username: (state) => state.user.username
  107. }),
  108. async mounted() {
  109. let res = await this.actCategoryService.treeData()
  110. let {data} = await this.processService.list({current: 1, size: -1})
  111. this.processMap = new Map()
  112. res.data.forEach((item)=>{
  113. this.processMap.set(item.name, [])
  114. })
  115. let list = data.records
  116. list.forEach((item)=>{
  117. if(this.processMap.has(item.category)){
  118. let list = this.processMap.get(item.category)
  119. list.push(item)
  120. }else{
  121. this.processMap.set(item.category, [item])
  122. }
  123. })
  124. for(let [key,value] of this.processMap){
  125. console.log(key,value);
  126. }
  127. },
  128. methods: {
  129. toApplyList (mail) {
  130. uni.navigateTo({
  131. url: '/pages/workbench/task/ApplyList'
  132. })
  133. },
  134. toTodoList (mail) {
  135. uni.navigateTo({
  136. url: '/pages/workbench/task/TodoList'
  137. })
  138. },
  139. toHistoryList (mail) {
  140. uni.navigateTo({
  141. url: '/pages/workbench/task/HistoryList'
  142. })
  143. },
  144. toFlowCopyList (mail) {
  145. uni.navigateTo({
  146. url: '/pages/workbench/task/FlowCopyList'
  147. })
  148. },
  149. start (row) {
  150. // 读取流程表单
  151. this.taskService.getTaskDef({
  152. procDefId: row.id,
  153. status: 'start'
  154. }).then(({data}) => {
  155. let processTitle = `${this.username} 在 ${moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [${row.name}]`
  156. let query = {procDefId: row.id, procDefKey: row.key, status: 'start', title: `发起流程【${row.name}】`, formType: data.formType, formUrl: data.formUrl, formTitle: processTitle}
  157. uni.navigateTo({
  158. url: '/pages/workbench/task/TaskForm?flow='+JSON.stringify(query)
  159. })
  160. })
  161. }
  162. }
  163. }
  164. </script>
  165. <style>
  166. .cu-list.card-menu {
  167. overflow: hidden;
  168. margin-right: 5px;
  169. margin-left: 5px;
  170. border-radius: 7px;
  171. }
  172. .cu-list.card-menu.margin-top-20 {
  173. margin-top: -20px;
  174. }
  175. .cu-list.menu>.cu-item .content>uni-view:first-child {
  176. display: -webkit-box;
  177. display: -webkit-flex;
  178. display: flex;
  179. -webkit-box-align: center;
  180. /* -webkit-align-items: center; */
  181. /* align-items: center; */
  182. display: inline-block;
  183. margin-right: 5px;
  184. width: 1.6em;
  185. text-align: center;
  186. }
  187. .font-size-35{
  188. font-size: 35px!important;
  189. }
  190. .circle-button{
  191. width: 44px;
  192. height: 44px;
  193. border-radius: 18px;
  194. padding-top: 4px;
  195. }
  196. .circle-button-box{
  197. width: 25%;
  198. margin-top: 10px;
  199. display: -webkit-box;
  200. display: -webkit-flex;
  201. display: flex;
  202. -webkit-box-orient: vertical;
  203. -webkit-box-direction: normal;
  204. -webkit-flex-direction: column;
  205. flex-direction: column;
  206. -webkit-box-align: center;
  207. -webkit-align-items: center;
  208. align-items: center;
  209. -webkit-box-pack: center;
  210. -webkit-justify-content: center;
  211. justify-content: center;
  212. box-sizing: border-box;
  213. }
  214. .font-b {
  215. vertical-align: middle;
  216. font-size: 18px;
  217. font-weight: 500;
  218. color: #3a3a3a;
  219. }
  220. </style>