index.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  1. <template>
  2. <div class="app-container home">
  3. <div class="stat-warp">
  4. <ul>
  5. <li class="theme1" @click="toUrl('DealWith',1)">
  6. <div class="num">{{toBeProcessedData.total}}</div>
  7. <div class="label">我的待审批</div>
  8. <div class="icon-box">
  9. <i class="icon iconfont icon-iconm_waixht"></i>
  10. </div>
  11. </li>
  12. <li class="theme2" @click="toUrl('DealWith',1)">
  13. <div class="num">{{haveInitiatedData.total}}</div>
  14. <div class="label">我的发起(未结束)</div>
  15. <div class="icon-box">
  16. <i class="icon iconfont icon-iconm_wofqd"></i>
  17. </div>
  18. </li>
  19. <li class="theme3">
  20. <div class="num">3</div>
  21. <div class="label">未读消息</div>
  22. <div class="icon-box">
  23. <i class="icon iconfont icon-iconm_unread"></i>
  24. </div>
  25. </li>
  26. </ul>
  27. </div>
  28. <div class="table-warp">
  29. <div class="card">
  30. <div class="commons-title">
  31. 我的待审批
  32. </div>
  33. <el-table :data="toBeProcessedData.rows" style="width: 100%">
  34. <el-table-column prop="flowName" label="流程类型" />
  35. <el-table-column prop="title" label="流程标题" />
  36. <el-table-column prop="createUserName" label="发起人" />
  37. <el-table-column prop="createTime" label="发起时间" />
  38. <el-table-column fixed="right" label="操作" width="120">
  39. <template #default="scope">
  40. <el-button
  41. link
  42. type="primary"
  43. size="small"
  44. @click="pushProcessApproval(scope.row)"
  45. >
  46. 审批
  47. </el-button>
  48. </template>
  49. </el-table-column>
  50. </el-table>
  51. </div>
  52. <div class="card">
  53. <div class="commons-title">
  54. 业务提醒
  55. </div>
  56. </div>
  57. <div class="card">
  58. <div class="commons-title">
  59. 我的发起(未结束)
  60. </div>
  61. <el-table :data="haveInitiatedData.rows" style="width: 100%">
  62. <el-table-column prop="flowName" label="流程类型" />
  63. <el-table-column prop="title" label="流程标题" />
  64. <el-table-column prop="createUserName" label="审批人" />
  65. <el-table-column prop="createTime" label="发起时间" />
  66. <el-table-column fixed="right" label="操作" width="120">
  67. <template #default="scope">
  68. <el-button
  69. link
  70. type="primary"
  71. size="small"
  72. @click="pushProcessApproval(scope.row)"
  73. >
  74. 查看
  75. </el-button>
  76. </template>
  77. </el-table-column>
  78. </el-table>
  79. </div>
  80. <div class="card">
  81. <div class="commons-title">
  82. 系统公告
  83. </div>
  84. <ul class="announcement">
  85. <li v-for="i in sendMegData.rows" :key="i.id">
  86. <div class="time">{{i.createTime}} <span>系统公告</span></div>
  87. <div class="content">{{i.content}}</div>
  88. </li>
  89. </ul>
  90. </div>
  91. </div>
  92. <!-- <byTableDemo></byTableDemo> -->
  93. <!-- <el-input type="number" v-model='aaa' v-mousewheel></el-input> -->
  94. <!-- 111112132131211 -->
  95. </div>
  96. </template>
  97. <script setup name="Index">
  98. import { createApp, onMounted, ref } from 'vue'
  99. import byTableDemo from '../components/byTable/demo'
  100. import html2canvas from 'html2canvas'
  101. import JsPDF from 'jspdf'
  102. const aaa = ref(1)
  103. function goTarget(url) {
  104. window.open(url, '__blank')
  105. }
  106. let toBeProcessedData = ref({
  107. total:0,
  108. rows:[]
  109. })
  110. let haveInitiatedData = ref({
  111. total:0,
  112. rows:[]
  113. })
  114. const sendMegData = ref({
  115. total:0,
  116. rows:[]
  117. })
  118. const pushProcessApproval = (row) => {
  119. if(row.status != 1 && row.status != 0) {
  120. proxy.$router.push({
  121. path: "/platform_manage/process/processApproval",
  122. query: {
  123. flowKey: row.flowKey,
  124. id: row.id,
  125. processType:20,
  126. version:row.version
  127. },
  128. });
  129. return
  130. }
  131. proxy.post('flowExample/getApprovalRecord',{id:row.id}).then(res=>{
  132. if(res.recordList.length > 0) {
  133. let data = res.recordList.filter(item => item.status === 2)
  134. let nodeType= 0
  135. if (data && data.length > 0) {
  136. nodeType = data[0].nodeType
  137. }
  138. proxy.$router.push({
  139. path: "/platform_manage/process/processApproval",
  140. query: {
  141. flowKey: row.flowKey,
  142. id: row.id,
  143. processType:nodeType == 1 ? 30 : 10,
  144. version:row.version
  145. },
  146. });
  147. }
  148. })
  149. }
  150. const { proxy } = getCurrentInstance();
  151. const getData = (() => {
  152. proxy.post('flowExample/getToBeProcessedPage',{
  153. pageNum:1,
  154. pageSize:4,
  155. status:'1'
  156. }).then(res=>{
  157. toBeProcessedData.value = res
  158. })
  159. proxy.post('flowExample/getHaveInitiatedPage',{
  160. pageNum:1,
  161. pageSize:4,
  162. status:'1'
  163. }).then(res=>{
  164. haveInitiatedData.value = res
  165. })
  166. proxy.post('sendMeg/page',{
  167. pageNum:1,
  168. pageSize:3,
  169. }).then(res=>{
  170. sendMegData.value = res
  171. })
  172. })
  173. const toUrl = (name,type) => {
  174. //获取name为name的路由的基础信息
  175. const route = proxy.$router.resolve({ name: name, params: { } })
  176. console.log(route)
  177. proxy.$router.push(route.path + '?type=' + type)
  178. }
  179. getData()
  180. // ​
  181. onMounted(() => {})
  182. </script>
  183. <style>
  184. .table-warp .el-table .cell{
  185. line-height: 24px!important;
  186. }
  187. </style>
  188. <style scoped lang="scss">
  189. .app-container {
  190. height: 100%;
  191. .announcement{
  192. padding: 0;
  193. margin: 0;
  194. li{
  195. list-style: none;
  196. border-radius: 2px;
  197. padding: 14px 20px;
  198. background: #EEEEEE;
  199. margin-bottom:10px;
  200. font-size: 14px;
  201. cursor: pointer;
  202. .time{
  203. color:#999;
  204. }
  205. .content{
  206. margin-top:10px;
  207. color:#333;
  208. }
  209. }
  210. li:hover{
  211. background: #EFF6FF;
  212. }
  213. }
  214. .table-warp{
  215. //页面全屏,占据剩下的位置
  216. height: calc(100% - 157px);
  217. border-radius: 5px;
  218. .card{
  219. width: calc(50% - 10px);
  220. height: calc(50% - 10px);
  221. background: #fff;
  222. float: left;
  223. border-radius: 5px;
  224. padding:20px;
  225. overflow-y:auto;
  226. }
  227. .card:nth-child(2n + 1){
  228. margin-right: 20px;
  229. }
  230. .card:nth-child(1){
  231. margin-bottom: 20px;
  232. }
  233. .card:nth-child(2){
  234. margin-bottom: 20px;
  235. }
  236. }
  237. .stat-warp {
  238. margin-bottom: 20px;
  239. background: #fff;
  240. padding: 20px;
  241. overflow: hidden;
  242. position: relative;
  243. border-radius: 5px;
  244. .title {
  245. height: 60px;
  246. select {
  247. height: 60px;
  248. border: none;
  249. outline: none;
  250. -webkit-appearance: none;
  251. appearance: none;
  252. font-size: 14px;
  253. font-weight: bold;
  254. background: url('@/assets/images/sanjiao.png') no-repeat right
  255. center;
  256. padding-right: 20px;
  257. }
  258. div {
  259. height: 60px;
  260. font-size: 14px;
  261. font-weight: bold;
  262. line-height: 60px;
  263. }
  264. }
  265. ul {
  266. padding: 0;
  267. overflow: hidden;
  268. margin: 0;
  269. li {
  270. list-style: none;
  271. min-width: 285px;
  272. box-sizing: border-box;
  273. margin-right: 20px;
  274. background: linear-gradient(360deg, #C7E3FE 0%, #DFECFF 100%);
  275. float: left;
  276. overflow: hidden;
  277. padding: 20px;
  278. color: #333333;
  279. position: relative;
  280. border-radius: 10px;
  281. .label {
  282. font-size: 14px;
  283. margin-top: 10px;
  284. }
  285. .label::before {
  286. // width: 10px;
  287. // height: 10px;
  288. // content: '';
  289. // border-radius: 50%;
  290. // background: #0084ff;
  291. // display: inline-block;
  292. // margin-right: 10px;
  293. }
  294. .num {
  295. font-size: 24px;
  296. font-weight: bold;
  297. }
  298. .icon-box{
  299. position: absolute;
  300. height: 40px;
  301. width: 40px;
  302. right: 20px;
  303. top: 20px;
  304. background: #fff;
  305. border-radius: 10px;
  306. text-align: center;
  307. line-height: 40px;
  308. i{
  309. font-size: 20px;
  310. color:#0084FF;
  311. }
  312. }
  313. }
  314. //#F5F3FF #9E64ED
  315. .theme2 {
  316. background: linear-gradient(180deg, #EAE8FB 0%, #DED9FF 100%);
  317. .label::before {
  318. background: #7566F0;
  319. }
  320. .icon-box i {
  321. color: #7566F0;
  322. }
  323. }
  324. //#FFF1E1 #FF9315
  325. .theme3 {
  326. background: #fff1e1;
  327. .label::before {
  328. background: #ff9315;
  329. }
  330. .icon-box i {
  331. color: #FF9315;
  332. }
  333. }
  334. //#E2FBE8 #39C55A
  335. .theme4 {
  336. background: #e2fbe8;
  337. .label::before {
  338. background: #39c55a;
  339. }
  340. }
  341. .theme5 {
  342. background: #ffebe9;
  343. .label::before {
  344. background: #f94539;
  345. }
  346. }
  347. .theme6 {
  348. background: #e4f9f9;
  349. .label::before {
  350. background: #53cbcb;
  351. }
  352. }
  353. .multi-data {
  354. .label::before {
  355. display: none;
  356. }
  357. .label {
  358. font-size: 14px;
  359. font-weight: bold;
  360. color: #333;
  361. margin-bottom: 8px;
  362. }
  363. .num-warp {
  364. overflow: hidden;
  365. .num-box {
  366. float: left;
  367. min-width: 80px;
  368. margin-right: 20px;
  369. .num-small {
  370. font-size: 16px;
  371. font-weight: bold;
  372. margin-bottom: 8px;
  373. }
  374. .label-small {
  375. color: #666;
  376. font-size: 14px;
  377. }
  378. }
  379. }
  380. }
  381. }
  382. }
  383. }
  384. </style>