iam-quick-nav.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <div :class="$style.navWrap">
  3. <a-card :bordered="false">
  4. <a-icon slot="extra" type="setting" :class="$style.navsetting" @click="openNavConfig" />
  5. <template v-slot:title>
  6. <a-icon type="sd-appstore" :class="$style.theme" />
  7. 快捷导航
  8. </template>
  9. <div :class="$style.quickNav">
  10. <iam-quick-link v-for="(link, index) in quicklinks" :key="index" v-bind="link">
  11. </iam-quick-link>
  12. <a-skeleton v-if="loading" :loading="loading" />
  13. <a-empty v-if="emptyloading" description="暂无快捷导航~"> </a-empty>
  14. </div>
  15. </a-card>
  16. <sd-quick-config
  17. v-if="visible"
  18. ref="quickmodal"
  19. :visible="visible"
  20. :is-sys="false"
  21. :form-id="formid"
  22. :quicklinks="quicklinks"
  23. @handleCancel="handleCancel"
  24. @navDataClick="saveNav"
  25. ></sd-quick-config>
  26. </div>
  27. </template>
  28. <script>
  29. import navMenuService from '@/frame/nav-menu-service'
  30. import sdQuickConfig from '@/workbench/sd-quick-config'
  31. import components from './_import-components/iam-quick-nav-import'
  32. export default {
  33. name: 'IamQuickNav',
  34. components: {
  35. ...components,
  36. sdQuickConfig,
  37. },
  38. data() {
  39. return {
  40. formid: 'oaPersonalQuickMenu',
  41. quicklinks: [],
  42. selectorData: [],
  43. visible: false,
  44. loading: true,
  45. emptyloading: false,
  46. }
  47. },
  48. created() {
  49. this.getQuicksList()
  50. },
  51. methods: {
  52. getQuicksList() {
  53. navMenuService.getQuickMenus().then((data) => {
  54. this.loading = false
  55. if (data === '' || data === [] || data.length === 0) {
  56. this.quicklinks = []
  57. this.emptyloading = true
  58. } else {
  59. this.quicklinks = data
  60. this.emptyloading = false
  61. }
  62. })
  63. },
  64. // 打开快捷导航配置
  65. openNavConfig() {
  66. this.visible = true
  67. },
  68. // 快捷导航数据处理
  69. saveNav(data) {
  70. this.getQuicksList()
  71. this.handleCancel()
  72. },
  73. handleCancel() {
  74. this.visible = false
  75. },
  76. },
  77. }
  78. </script>
  79. <style module lang="scss">
  80. @use '@/common/design' as *;
  81. .quick-nav {
  82. display: flex;
  83. flex-wrap: wrap;
  84. justify-content: space-around;
  85. min-height: 165px;
  86. }
  87. .nav-wrap {
  88. height: 100%;
  89. :global(.ant-card-head-title) {
  90. padding: 20px 0;
  91. }
  92. }
  93. </style>