workbench.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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 class="circle-button-box">
  15. <view class="text-primary text_font_size">26</view>
  16. <text>总数</text>
  17. </view>
  18. <view class="circle-button-box">
  19. <view class="text-danger text_font_size">5</view>
  20. <text>待办</text>
  21. </view>
  22. <view class="circle-button-box">
  23. <view class="text-success text_font_size">26</view>
  24. <text>已办</text>
  25. </view>
  26. <view class="circle-button-box">
  27. <view class="text-warning text_font_size">26</view>
  28. <text>归档</text>
  29. </view>
  30. </view>
  31. <scroll-view scroll-y class="page">
  32. <view class="cu-bar bg-white solid-bottom margin-top">
  33. <view class="action">
  34. <text class=" text-orange font-b">快捷入口</text>
  35. </view>
  36. </view>
  37. <view class="cu-list grid col-4 no-border">
  38. <view @tap="add" class="circle-button-box">
  39. <view ><u--image src="/static/index/icon4.png" width="40px" height="40px"></u--image></view>
  40. <text>新增</text>
  41. </view>
  42. <view @tap="toList(1)" class="circle-button-box">
  43. <view ><u--image src="/static/index/icon1.png" width="40px" height="40px"></u--image></view>
  44. <text>待办</text>
  45. </view>
  46. <view @tap="toList(4)" class="circle-button-box">
  47. <view ><u--image src="/static/index/icon5.png" width="40px" height="40px"></u--image></view>
  48. <text>已办</text>
  49. </view>
  50. <view @tap="toList(3)" class="circle-button-box">
  51. <view ><u--image src="/static/index/icon2.png" width="40px" height="40px"></u--image></view>
  52. <text>已归档</text>
  53. </view>
  54. <view @tap="" class="circle-button-box">
  55. <view ><u--image src="/static/index/icon3.png" width="40px" height="40px"></u--image></view>
  56. <text>通讯录</text>
  57. </view>
  58. <view @tap="toApplyList" class="circle-button-box">
  59. <view ><u--image src="/static/index/icon6.png" width="40px" height="40px"></u--image></view>
  60. <text>公文统计</text>
  61. </view>
  62. </view>
  63. <u-gap height="80" bgColor="#fff"></u-gap>
  64. </scroll-view>
  65. </view>
  66. </template>
  67. <script>
  68. import moment from 'moment'
  69. import {mapState, mapMutations, mapActions} from 'vuex'
  70. import actCategoryService from "@/api/flowable/actCategoryService"
  71. import processService from "@/api/flowable/processService"
  72. import taskService from "@/api/flowable/taskService"
  73. export default {
  74. data() {
  75. return {
  76. cardCur: 0,
  77. dataList: [],
  78. categoryList: [],
  79. processMap: new Map(),
  80. swiperList: [{
  81. id: 0,
  82. type: 'image',
  83. url: '/static/swiper/1.svg'
  84. }, {
  85. id: 1,
  86. type: 'image',
  87. url: '/static/swiper/2.svg'
  88. }, {
  89. id: 2,
  90. type: 'image',
  91. url: '/static/swiper/3.svg'
  92. }, {
  93. id: 3,
  94. type: 'image',
  95. url: '/static/swiper/4.svg'
  96. }, {
  97. id: 4,
  98. type: 'image',
  99. url: '/static/swiper/5.svg'
  100. }, {
  101. id: 5,
  102. type: 'image',
  103. url: '/static/swiper/6.svg'
  104. }, {
  105. id: 6,
  106. type: 'image',
  107. url: '/static/swiper/7.svg'
  108. }],
  109. dotStyle: false,
  110. towerStart: 0,
  111. direction: ''
  112. };
  113. },
  114. computed: mapState({
  115. username: (state) => state.user.username
  116. }),
  117. async mounted() {
  118. let res = await actCategoryService.treeData()
  119. let data = await processService.list({current: 1, size: -1})
  120. this.processMap = new Map()
  121. res.forEach((item)=>{
  122. this.processMap.set(item.name, [])
  123. })
  124. let list = data.records
  125. list.forEach((item)=>{
  126. if(this.processMap.has(item.category)){
  127. let list = this.processMap.get(item.category)
  128. list.push(item)
  129. }else{
  130. this.processMap.set(item.category, [item])
  131. }
  132. })
  133. for(let [key,value] of this.processMap){
  134. console.log(key,value);
  135. }
  136. },
  137. created() {
  138. if(!this.username) {
  139. this.refreshUserInfo()
  140. }
  141. },
  142. methods: {
  143. ...mapActions(['refreshUserInfo']),
  144. toApplyList (mail) {
  145. uni.navigateTo({
  146. url: '/pages/fileTransmit/statistics'
  147. })
  148. },
  149. add (mail) {
  150. uni.navigateTo({
  151. url: '/pages/fileTransmit/addFileTransmit'
  152. })
  153. },
  154. examine (mail) {
  155. uni.navigateTo({
  156. url: '/pages/fileTransmit/examineFile'
  157. })
  158. },
  159. toList (type) {
  160. uni.navigateTo({
  161. url: '/pages/fileTransmit/fileTransmitList?type='+type
  162. })
  163. },
  164. start (row) {
  165. // 读取流程表单
  166. taskService.getTaskDef({
  167. procDefId: row.id,
  168. status: 'start'
  169. }).then((data) => {
  170. let processTitle = `${this.username} 在 ${moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [${row.name}]`
  171. let query = {procDefId: row.id, procDefKey: row.key, status: 'start', title: `发起流程【${row.name}】`, formType: data.formType, formUrl: data.formUrl, formTitle: processTitle}
  172. uni.navigateTo({
  173. url: '/pages/workbench/task/TaskForm?flow='+JSON.stringify(query)
  174. })
  175. })
  176. }
  177. }
  178. }
  179. </script>
  180. <style>
  181. .cu-list.card-menu {
  182. overflow: hidden;
  183. margin-right: 5px;
  184. margin-left: 5px;
  185. border-radius: 7px;
  186. }
  187. .cu-list.card-menu.margin-top-20 {
  188. margin-top: -20px;
  189. }
  190. .cu-list.menu>.cu-item .content>uni-view:first-child {
  191. display: -webkit-box;
  192. display: -webkit-flex;
  193. display: flex;
  194. -webkit-box-align: center;
  195. /* -webkit-align-items: center; */
  196. /* align-items: center; */
  197. display: inline-block;
  198. margin-right: 5px;
  199. width: 1.6em;
  200. text-align: center;
  201. }
  202. .text_font_size{
  203. font-size: 28px!important;
  204. margin-bottom: 10px;
  205. }
  206. .circle-button{
  207. width: 44px;
  208. height: 44px;
  209. border-radius: 18px;
  210. padding-top: 4px;
  211. }
  212. .circle-button-box{
  213. width: 25%;
  214. margin-top: 10px;
  215. display: -webkit-box;
  216. display: -webkit-flex;
  217. display: flex;
  218. -webkit-box-orient: vertical;
  219. -webkit-box-direction: normal;
  220. -webkit-flex-direction: column;
  221. flex-direction: column;
  222. -webkit-box-align: center;
  223. -webkit-align-items: center;
  224. align-items: center;
  225. -webkit-box-pack: center;
  226. -webkit-justify-content: center;
  227. justify-content: center;
  228. box-sizing: border-box;
  229. }
  230. .font-b {
  231. vertical-align: middle;
  232. font-size: 18px;
  233. font-weight: 500;
  234. color: #3a3a3a;
  235. }
  236. </style>