myTodo.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <div class="container" @click="handleNewPageJump">
  3. <section class="lefticon">
  4. <img src="../../assets/images/topTodo.png" alt=""/>
  5. </section>
  6. <section class="righticon">
  7. <p>{{ t('workplace.todoMessage') }}</p>
  8. <span>{{documentTodos}}</span>
  9. </section>
  10. </div>
  11. </template>
  12. <script setup lang="ts">
  13. import * as Agent from '@/api/system/notify/agent'
  14. const router=useRouter()
  15. const { t } = useI18n()
  16. const queryParams = reactive({
  17. pageNum: 1,
  18. pageSize: -1,
  19. queryType: '0', // 默认全部
  20. startTime: '',
  21. endTime: ''
  22. })
  23. const documentTodos = ref(null)
  24. onMounted(() => {
  25. getAgentNum()
  26. })
  27. // 获取待办数量
  28. const getAgentNum = async () => {
  29. const agentData = await Agent.getMyAgent(queryParams)
  30. documentTodos.value = agentData.handleAgent.length
  31. console.log(agentData.handleAgent.length, 'agentData')
  32. }
  33. // 代办:处理跳转逻辑
  34. const handleNewPageJump = () => {
  35. router.push({ name: 'Agent' })
  36. }
  37. </script>
  38. <style scoped lang="scss">
  39. .container{
  40. width: 320px;
  41. height: 150px;
  42. border: 2px solid #0b0b0b;
  43. background: #ffffff;
  44. border-radius: 15px;
  45. display: flex;
  46. .lefticon{
  47. width: 50%;
  48. height: 90%;
  49. margin:5px 20px;
  50. //background: #000;
  51. img{
  52. width:100%;
  53. height:100%;
  54. }
  55. }
  56. .righticon{
  57. width:50%;
  58. height: 100px;
  59. margin:30px 15px;
  60. text-align:right;
  61. p{
  62. font-size: 20px;
  63. font-weight: bold;
  64. }
  65. span{
  66. font-size: 30px;
  67. font-weight: bold;
  68. color: #cc0b0b;
  69. }
  70. }
  71. }
  72. </style>