iam-todo-tabs.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <template>
  2. <a-tabs ref="tabs" v-model="type" :class="[$style.todotabs, 'sd-has-table']">
  3. <template>
  4. <a-icon slot="tabBarExtraContent" :class="$style.syncbtn" type="sync" @click="refresh" />
  5. <span slot="tabBarExtraContent" :class="$style.morebtn" @click="mored(type)">查看更多 ></span>
  6. </template>
  7. <a-tab-pane key="todo" :class="$style.panel">
  8. <span slot="tab">
  9. 待办<span :class="$style.todonums">({{ userInfo.todoNumbers }})</span></span
  10. >
  11. <iam-todo-list-card
  12. :items="todoData"
  13. typelist="todo"
  14. @golistUrl="awaitHandleUrl"
  15. ></iam-todo-list-card>
  16. </a-tab-pane>
  17. <a-tab-pane key="inform" :class="$style.panel">
  18. <span slot="tab">
  19. 待阅<span :class="$style.todonums">({{ userInfo.toReadNumbers }})</span></span
  20. >
  21. <iam-todo-list-card
  22. :items="informData"
  23. typelist="inform"
  24. @golistUrl="awaitHandleUrl"
  25. ></iam-todo-list-card>
  26. </a-tab-pane>
  27. <a-tab-pane key="processed" tab="已办" :class="$style.panel">
  28. <!-- <iam-todo-list-card
  29. :items="processedData"
  30. typelist="processed"
  31. @golistUrl="awaitHandleUrl"
  32. ></iam-todo-list-card> -->
  33. <todo-list ref="processed" list-type="processed" />
  34. </a-tab-pane>
  35. <a-tab-pane key="replied-inform" tab="已阅" :class="$style.panel">
  36. <!-- <iam-todo-list-card
  37. :items="repliedData"
  38. typelist="replied-inform"
  39. @golistUrl="awaitHandleUrl"
  40. ></iam-todo-list-card> -->
  41. <todo-list ref="replied-inform" list-type="replied-inform" />
  42. </a-tab-pane>
  43. </a-tabs>
  44. </template>
  45. <script>
  46. import crossWindowWatcher from '@/common/services/cross-window-watcher'
  47. import TodoListService from '@/todo/todo-list-service'
  48. import { getUserInfo } from '@/common/store-mixin'
  49. import loginService from '@/login/login-service'
  50. import list from '@/todo/sd-todo-list'
  51. import components from './_import-components/iam-todo-tabs-import'
  52. import listCard from './todo/iam-todo-list-card.vue'
  53. export default {
  54. name: 'IamTodoTabs',
  55. components: {
  56. ...components,
  57. 'iam-todo-list-card': listCard,
  58. 'todo-list': list,
  59. },
  60. mixins: [],
  61. data() {
  62. return {
  63. type: 'todo',
  64. todoData: [], // 待办数据
  65. processedData: [], // 已办数据
  66. informData: [], // 待阅数据
  67. repliedData: [], // 已阅数据
  68. userInfo: null,
  69. }
  70. },
  71. created() {
  72. // loginService.getUserInfo()
  73. this.userInfo = getUserInfo()
  74. this.getHandleListFn('todo') // 待办
  75. this.getHandleListFn('processed') // 已办
  76. this.getHandleListFn('inform') // 待阅
  77. this.getHandleListFn('replied-inform') // 已阅
  78. },
  79. methods: {
  80. mored(type) {
  81. if (type === 'todo' || type === 'processed') {
  82. this.$router.push(`/sd-frame/sd-mytodolist?type=${type}`)
  83. } else if (type === 'inform' || type === 'replied-inform') {
  84. this.$router.push(`/sd-frame/sd-mytoreadlist?type=${type}`)
  85. }
  86. },
  87. // 刷新工作台列表数据
  88. refresh() {
  89. this.getHandleListFn(this.type)
  90. },
  91. // 获取列表数据
  92. getHandleListFn(listType) {
  93. let expressions
  94. if (listType === 'todo' || listType === 'processed') {
  95. expressions = []
  96. } else {
  97. expressions = [
  98. {
  99. dataType: 'str',
  100. name: 'status',
  101. op: 'ne',
  102. stringValue: '2',
  103. },
  104. ]
  105. }
  106. const params = {
  107. columns: 'title',
  108. expressions: expressions,
  109. orderBy: 'sentDate desc',
  110. creatorDeptLevel: 'DEPARTMENT',
  111. }
  112. if (listType === 'processed') {
  113. params.orderBy = 'processDate desc'
  114. }
  115. TodoListService.getList({ current: 1, pageSize: 10, listType: listType, ...params }).then(
  116. (res) => {
  117. // this.updateTaskNumber({ total: res.total, type: listType })
  118. this.isskeleton = false
  119. if (listType === 'todo') {
  120. this.todoData = res.datas
  121. if (res.datas) {
  122. this.userInfo.todoNumbers = res.datas.length
  123. } else {
  124. this.userInfo.todoNumbers = 0
  125. }
  126. } else if (listType === 'processed') {
  127. this.processedData = res.datas
  128. } else if (listType === 'inform') {
  129. this.informData = res.datas
  130. if (res.datas) {
  131. this.userInfo.toReadNumbers = res.datas.length
  132. } else {
  133. this.userInfo.toReadNumbers = 0
  134. }
  135. } else if (listType === 'replied-inform') {
  136. this.repliedData = res.datas
  137. }
  138. }
  139. )
  140. },
  141. // 卡片列表详情
  142. awaitHandleUrl(data, type) {
  143. let url = TodoListService.makePath(data, type)
  144. url = `/sd-webflow/${url}`
  145. const p = TodoListService.openTaskItem(data, type)
  146. p.then((refreshFlag) => {
  147. if (refreshFlag) {
  148. // 处理后刷新对应列表
  149. // this.getHandleListFn(type) // todo 待办事项 inform 待阅文件
  150. this.getHandleListFn('todo') // 待办
  151. this.getHandleListFn('processed') // 已办
  152. this.getHandleListFn('inform') // 待阅
  153. this.getHandleListFn('replied-inform') // 已阅
  154. }
  155. })
  156. },
  157. },
  158. }
  159. </script>
  160. <style module lang="scss">
  161. @use '@/common/design' as *;
  162. $iconfont: 20px;
  163. .todotabs {
  164. :global(.ant-table-placeholder) {
  165. padding: 31px 16px;
  166. }
  167. :global(.ant-tabs-extra-content) {
  168. position: relative;
  169. z-index: 1;
  170. }
  171. :global(.ant-tabs-bar) {
  172. border-bottom: none;
  173. }
  174. :global(.ant-tabs-ink-bar-animated) {
  175. height: 5px;
  176. border-radius: 13px;
  177. }
  178. :global(.ant-tabs-nav) {
  179. height: 45px;
  180. }
  181. :global(.ant-tabs-tab-active) {
  182. font-weight: 600;
  183. color: #000;
  184. }
  185. :global(.ant-tabs-tab:hover) {
  186. color: #000;
  187. }
  188. }
  189. .syncbtn {
  190. margin-right: 10px;
  191. font-size: 14px;
  192. cursor: pointer;
  193. }
  194. .morebtn {
  195. // font-size: $iconfont;
  196. font-size: 14px;
  197. cursor: pointer;
  198. }
  199. .todonums {
  200. font-size: 12px;
  201. color: #959595;
  202. }
  203. </style>