index.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <template>
  2. <div class="flex-column-page-wrap pageWrap">
  3. <div style="padding: 10px">
  4. <!-- 快捷入口 -->
  5. <el-row :gutter="10" style="margin-bottom: 10px">
  6. <el-col :span="6">
  7. <div class="left-item-box box">
  8. <div class="launch-todo" @click="jumpOtherPage('待审批')">
  9. <el-row :gutter="5">
  10. <el-col :span="12" class="mt-icon">
  11. <img style="width: 45px; height: 45px" src="@/assets/icons/processInfo/lingdang.svg" />
  12. </el-col>
  13. <el-col :span="12">
  14. <div class="flex flex-v">
  15. <div class="mt-title">待审批的</div>
  16. <div class="mt-value">{{ countNum }}</div>
  17. </div>
  18. </el-col>
  19. </el-row>
  20. </div>
  21. </div>
  22. </el-col>
  23. <el-col :span="18">
  24. <div class="right-item-box box">
  25. <el-row>
  26. <el-col :span="6">
  27. <div class="app-task" @click="jumpOtherPage('我的申请')">
  28. <div class="app-task-icon">
  29. <img style="width: 30px; height: 30px" src="@/assets/icons/processInfo/tuiguangzhong.svg" />
  30. </div>
  31. <div class="app-task-title">我申请的</div>
  32. </div>
  33. </el-col>
  34. <el-col :span="6">
  35. <div class="app-task" @click="jumpOtherPage('我收到的')">
  36. <div class="app-task-icon">
  37. <img style="width: 30px; height: 30px" src="@/assets/icons/processInfo/horn.svg" />
  38. </div>
  39. <div class="app-task-title">我收到的</div>
  40. </div>
  41. </el-col>
  42. <el-col :span="6">
  43. <div class="app-task" @click="jumpOtherPage('认领任务')">
  44. <div class="app-task-icon">
  45. <img style="width: 30px; height: 30px" src="@/assets/icons/processInfo/lingqu.svg" />
  46. </div>
  47. <div class="app-task-title">认领任务</div>
  48. </div>
  49. </el-col>
  50. <el-col :span="6">
  51. <div class="app-task" @click="jumpOtherPage('已审批')">
  52. <div class="app-task-icon">
  53. <img style="width: 30px; height: 30px" src="@/assets/icons/processInfo/wanjie.svg" />
  54. </div>
  55. <div class="app-task-title">已审批的</div>
  56. </div>
  57. </el-col>
  58. </el-row>
  59. </div>
  60. </el-col>
  61. </el-row>
  62. <!-- 审批列表 -->
  63. <el-card class="box-card" shadow="never">
  64. <el-collapse v-model="activeNames" @change="handleChange">
  65. <el-collapse-item v-for="item in startList" :key="item.categoryId" :title="item.categoryName" :name="item.categoryName">
  66. <el-row>
  67. <el-col
  68. v-for="process in item.processList"
  69. :key="process.processId"
  70. :span="6"
  71. style="padding-left: 8px; padding-right: 8px; margin-bottom: 12px; cursor: pointer"
  72. >
  73. <div class="card-in" @click="testEv(process)">
  74. <LeIcon class="flow-icon" :icon-class="`${flowIconPrefix}${process.processIcon}`" />
  75. <!-- <div class="flow-icon">
  76. <img :src="getAssetsFile(process.processIcon + '.svg')" />
  77. </div>-->
  78. <div class="space space-vertical">
  79. <div class="space-item">
  80. <div class="first-edit">
  81. <strong>{{ process.processName }}</strong>
  82. </div>
  83. </div>
  84. <div class="space-item">
  85. <div>{{ process.createTime }}</div>
  86. </div>
  87. <div class="space-item">
  88. <div>{{ process.processKey }}</div>
  89. </div>
  90. </div>
  91. </div>
  92. </el-col>
  93. </el-row>
  94. </el-collapse-item>
  95. </el-collapse>
  96. </el-card>
  97. </div>
  98. <ItemDrawer v-if="drawerVisible" v-model="drawerVisible" :record="record" />
  99. </div>
  100. </template>
  101. <script setup name="flow_modal">
  102. import router from '@/router'
  103. import { ref, onMounted } from 'vue'
  104. import ItemDrawer from './ItemDrawer.vue'
  105. const input = ref('')
  106. const activeNames = ref(['1'])
  107. import model from '@/api/flow/process'
  108. import { countTaskApi } from '@/api/flow/processTask'
  109. import { flowIconPrefix /*, getAssetsFile*/ } from '@/utils/index'
  110. const startList = ref([])
  111. const drawerVisible = ref(false)
  112. const record = ref({})
  113. const countNum = ref(0)
  114. const handleChange = val => {
  115. console.log(val)
  116. }
  117. // 列表
  118. const listEv = async () => {
  119. const res = await model.launchProcessListApi()
  120. startList.value = res || []
  121. activeNames.value = startList.value.map(v => v.categoryName)
  122. }
  123. // 我的待办数量
  124. const getCountTask = async () => {
  125. const count = await countTaskApi()
  126. countNum.value = count
  127. }
  128. // 跳转页面
  129. const jumpOtherPage = item => {
  130. const obj = {
  131. 待审批: '/approve/pending-approval',
  132. 我的申请: '/approve/my-application',
  133. 我收到的: '/approve/my-received',
  134. 认领任务: '/approve/pending-claim',
  135. 已审批: '/approve/approved'
  136. }
  137. router.push(obj[item])
  138. }
  139. const testEv = process => {
  140. record.value = process
  141. drawerVisible.value = true
  142. }
  143. onMounted(() => {
  144. listEv()
  145. getCountTask()
  146. })
  147. </script>
  148. <style scoped lang="scss">
  149. .pageWrap {
  150. //height: 100%;
  151. //overflow-x: scroll;
  152. background: var(--el-bg-color-page);
  153. .box {
  154. padding: 15px;
  155. background: var(--el-bg-color);
  156. }
  157. }
  158. .card-in {
  159. height: 100px;
  160. border-radius: 8px;
  161. padding: 16px;
  162. display: flex;
  163. flex-direction: row;
  164. width: 100%;
  165. border: 1px solid #d9d9d9;
  166. background: var(--component-background);
  167. cursor: pointer;
  168. > div:nth-child(1) {
  169. vertical-align: middle;
  170. }
  171. > div:nth-child(2) {
  172. flex: 0 1 100%;
  173. margin-left: 12px;
  174. text-overflow: ellipsis;
  175. overflow: hidden;
  176. .first-edit {
  177. font-size: 14px;
  178. display: flex;
  179. flex-direction: row;
  180. justify-content: space-between;
  181. align-items: center;
  182. cursor: pointer;
  183. }
  184. > div {
  185. cursor: default;
  186. width: 100%;
  187. white-space: nowrap;
  188. text-overflow: ellipsis;
  189. overflow: hidden;
  190. font-size: 12px;
  191. }
  192. }
  193. .flow-icon {
  194. font-size: 66px;
  195. flex-shrink: 0;
  196. }
  197. .space {
  198. display: inline-flex;
  199. }
  200. .space-vertical {
  201. flex-direction: column;
  202. }
  203. &:hover {
  204. border: 1px solid var(--el-color-primary);
  205. box-shadow: 0 0 4px #ddd;
  206. }
  207. .el-dropdown-link {
  208. cursor: pointer;
  209. color: var(--el-color-primary);
  210. display: flex;
  211. align-items: center;
  212. }
  213. }
  214. .mt-icon {
  215. text-align: center;
  216. line-height: 80px;
  217. font-size: 42px;
  218. }
  219. .launch-todo {
  220. cursor: pointer;
  221. border-radius: 4px;
  222. &:hover {
  223. background-color: #f5f4f3;
  224. }
  225. .mt-title {
  226. font-size: 18px;
  227. padding: 10px 0 0;
  228. }
  229. .mt-value {
  230. font-size: 32px;
  231. font-weight: 700;
  232. }
  233. }
  234. .app-task {
  235. cursor: pointer;
  236. border-radius: 10px;
  237. text-align: center;
  238. padding: 0 0 6px;
  239. &:hover {
  240. background-color: #f5f4f3;
  241. }
  242. &-icon {
  243. font-size: 32px;
  244. padding: 9px 0 4px;
  245. }
  246. &-title {
  247. font-size: 16px;
  248. }
  249. }
  250. </style>