workbench.vue 5.9 KB

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