index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <script>
  2. import { handleTree } from '@/utils/publicMethods' //将列表转坏为树形
  3. import { nextTick } from 'vue'
  4. import { doDelete, getList } from './api/index'
  5. import { Plus, Sort, Search, Refresh } from '@element-plus/icons-vue'
  6. export default defineComponent({
  7. name: 'MenuManagement',
  8. components: {
  9. Edit: defineAsyncComponent(() => import('./components/NoticeEdit.vue')),
  10. },
  11. setup() {
  12. const $baseConfirm = inject('$baseConfirm')
  13. const $baseMessage = inject('$baseMessage')
  14. const state = reactive({
  15. editRef: null,
  16. dataTreeList: null,
  17. refreshTable: true,
  18. expand: false, //列表展开收起
  19. data: [],
  20. defaultProps: {
  21. children: 'children',
  22. label: 'label',
  23. },
  24. list: [],
  25. listLoading: true,
  26. queryForm: {
  27. sortedBy: 'desc',
  28. orderBy: 'sort',
  29. },
  30. })
  31. //点击查看站内信
  32. const lookNotice = () => {
  33. state['editRef'].showEdit()
  34. }
  35. return {
  36. ...toRefs(state),
  37. lookNotice,
  38. Plus,
  39. Sort,
  40. Search,
  41. Refresh,
  42. }
  43. },
  44. })
  45. </script>
  46. <template>
  47. <!-- v-if="theme.showNotice" -->
  48. <el-badge type="danger" :value="badge">
  49. <div @click="lookNotice"><vab-icon icon="mail-unread-line" /></div>
  50. <edit ref="editRef" @fetch-data="fetchData" />
  51. </el-badge>
  52. </template>
  53. <style lang="scss" scoped>
  54. :deep() {
  55. .el-drawer__body {
  56. padding: 0px;
  57. }
  58. }
  59. .notice-list {
  60. height: 29vh;
  61. ul {
  62. padding: 0 15px 0 0;
  63. margin: 0;
  64. li {
  65. display: flex;
  66. align-items: center;
  67. padding: 10px 0 10px 0;
  68. :deep() {
  69. .el-avatar {
  70. flex-shrink: 0;
  71. width: 50px;
  72. height: 50px;
  73. border-radius: 50%;
  74. }
  75. }
  76. span {
  77. margin-left: 10px;
  78. }
  79. }
  80. }
  81. }
  82. .notice-clear {
  83. display: flex;
  84. align-items: center;
  85. justify-content: center;
  86. padding: 10px 0 0 0;
  87. font-size: 14px;
  88. text-align: center;
  89. cursor: pointer;
  90. border-top: 1px solid #e8eaec;
  91. i {
  92. margin-right: 3px;
  93. }
  94. }
  95. </style>