index.vue 11 KB

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