todoList.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <div class="todo-list">
  3. <Header />
  4. <div class="content mt-15">
  5. <div class="flex gap-5 items-center mb-4 bg-[#f9f9f9] py-2">
  6. <p class="flex items-center">
  7. <Icon
  8. icon="mynaui:arrow-up-down"
  9. class="icon pr-1 h-6 w-6"
  10. color="#014099"
  11. />待办任务列表
  12. </p>
  13. <el-button
  14. type="primary"
  15. round
  16. size="default"
  17. color="#02409b"
  18. @click="router.back()"
  19. ><Icon
  20. icon="mynaui:corner-up-left"
  21. class="icon pr-1"
  22. width="20"
  23. height="20"
  24. />返回</el-button
  25. >
  26. </div>
  27. <el-table
  28. :data="oaTasks"
  29. style="width: 100%"
  30. :empty-text="loading ? '加载中...' : '暂无数据'"
  31. height="80vh"
  32. :header-cell-style="{
  33. backgroundColor: '#e9f7ff',
  34. color: 'black',
  35. fontWeight: '400',
  36. }"
  37. :cell-style="{
  38. color: 'black',
  39. }"
  40. >
  41. <el-table-column
  42. type="index"
  43. label="序号"
  44. width="80"
  45. fixed="left"
  46. align="center"
  47. />
  48. <el-table-column
  49. prop="requestName"
  50. label="请求标题"
  51. min-width="220"
  52. fixed="left"
  53. align="center"
  54. />
  55. <el-table-column
  56. prop="workflowBaseInfo.workflowTypeName"
  57. label="流程类型"
  58. width="140"
  59. align="center"
  60. />
  61. <el-table-column
  62. prop="requestLevel"
  63. label="紧急程度"
  64. width="100"
  65. align="center"
  66. />
  67. <el-table-column
  68. prop="status"
  69. label="路径状态"
  70. width="100"
  71. align="center"
  72. />
  73. <el-table-column
  74. prop="sysName"
  75. label="系统名称"
  76. width="140"
  77. align="center"
  78. />
  79. <el-table-column
  80. prop="createTime"
  81. label="创建时间"
  82. width="180"
  83. align="center"
  84. />
  85. <el-table-column
  86. prop="creatorName"
  87. label="创建人名称"
  88. width="120"
  89. align="center"
  90. />
  91. <el-table-column
  92. prop="currentNodeName"
  93. label="当前节点名称"
  94. width="140"
  95. align="center"
  96. />
  97. <el-table-column
  98. prop="lastOperateTime"
  99. label="最后操作时间"
  100. width="180"
  101. align="center"
  102. />
  103. <el-table-column
  104. prop="lastOperatorName"
  105. label="最后操作人名称"
  106. width="140"
  107. align="center"
  108. />
  109. <el-table-column
  110. prop="receiveTime"
  111. label="接收时间"
  112. width="180"
  113. align="center"
  114. />
  115. <el-table-column
  116. prop="workflowBaseInfo.workflowName"
  117. label="流程名称"
  118. min-width="200"
  119. align="center"
  120. />
  121. <el-table-column label="操作" width="120" fixed="right" align="center">
  122. <template #default="scope">
  123. <span
  124. class="text-[#02409b] cursor-pointer"
  125. @click="goBackPage(scope.row)"
  126. >处理</span
  127. >
  128. </template>
  129. </el-table-column>
  130. </el-table>
  131. </div>
  132. <Footer />
  133. </div>
  134. </template>
  135. <script setup>
  136. import Header from "@components/home/header.vue";
  137. import { ref, onMounted } from "vue";
  138. import { getOATasks, ssoLogin } from "@/api/user";
  139. import { useUserStore } from "@/stores/useUserStore";
  140. import { Icon } from "@iconify/vue";
  141. import router from "@/router";
  142. const userStore = useUserStore();
  143. const oaTasks = ref([]);
  144. const loading = ref(false);
  145. const goBackPage = async (row) => {
  146. const res = await ssoLogin({
  147. username: userStore.getUser.username,
  148. });
  149. if (res) {
  150. const newTab = window.open("", "_blank");
  151. newTab.location.href =
  152. "https://yfoa.keruioil.com/wui/index.html" +
  153. "?ssoToken=" +
  154. res +
  155. "#/main";
  156. setTimeout(function () {
  157. newTab.location.href = `https://yfoa.keruioil.com/spa/workflow/static4form/index.html?_rdm=1776063595284#/main/workflow/req?requestid=${row.requestId}`;
  158. }, 50);
  159. }
  160. };
  161. onMounted(async () => {
  162. if (userStore.getUser.username) {
  163. loading.value = true;
  164. try {
  165. const res = await getOATasks(userStore.getUser.username);
  166. oaTasks.value = res.todoList;
  167. } finally {
  168. loading.value = false;
  169. }
  170. }
  171. });
  172. </script>
  173. <style scoped>
  174. .todo-list {
  175. display: flex;
  176. flex-direction: column;
  177. min-height: 100%;
  178. }
  179. .content {
  180. padding: 16px 20px;
  181. margin-top: 100px;
  182. }
  183. </style>