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