systemMod.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <div class="asides">
  3. <div class="aside-item" :class="act_sys.systemid == item.systemid?'onSystem':''" v-for="item in system" :key="item.index" @click="onSystemClick(item)">
  4. <span v-if="collapsed" class="menu-icon uncollapsed"><span class="aside-menu-icon">{{item.systemname.substr(0, 1)}}</span></span>
  5. <span class="collapsed" v-if="!collapsed">
  6. <span class="aside-menu-icon">{{item.systemname.substr(0, 1)}}</span>
  7. {{item.systemname}}
  8. </span>
  9. </div>
  10. </div>
  11. </template>
  12. <script setup>
  13. import Api from '@/api/api'
  14. import { defineComponent,ref, reactive,onMounted,watch} from 'vue';
  15. import { useAuthStore } from '@/stores/modules/auth'
  16. import { storeToRefs } from 'pinia'
  17. import { useRouter } from "vue-router"
  18. import { MenuFoldOutlined,MenuUnfoldOutlined} from '@ant-design/icons-vue'
  19. const router = useRouter()
  20. const store = useAuthStore()
  21. const act_sys = ref({})
  22. let { system,mods } = storeToRefs(store)
  23. const siteInfo = ref({})
  24. const collapsed = ref(true)
  25. const onSystemClick = (system)=>{
  26. act_sys.value = system
  27. // mods.value = item.modules
  28. // router.push({path:item.modules[0].apps[0].path})
  29. store.modulesData(system)
  30. }
  31. const siteData = async ()=>{
  32. const res = await Api.requested({
  33. classname:'manager.site.site',
  34. method:'querySite',
  35. content:{}
  36. })
  37. siteInfo.value = res.data
  38. }
  39. const onCollapsed = ()=>{
  40. collapsed.value = !collapsed.value
  41. }
  42. onMounted (()=>{
  43. store.systemData()
  44. siteData()
  45. })
  46. watch (()=>system.value,() => {
  47. act_sys.value = system.value[0]
  48. })
  49. </script>
  50. <style less scoped>
  51. .asides{
  52. position: relative;
  53. width:79px;
  54. background: #fff;
  55. transition: .1s ease-out all;
  56. border-right: 1px solid #f1f2f3;
  57. }
  58. .aside-item {
  59. cursor: pointer;
  60. color: #333;
  61. margin:10px 0 35px 0;
  62. transition: .1s linear;
  63. overflow: hidden;
  64. }
  65. .logo-panel{
  66. padding: 10px;
  67. margin-bottom:10px ;
  68. border-bottom:1px solid #f1f2f3;
  69. background: #fff;
  70. }
  71. .logo-panel h4{
  72. color: #333;
  73. margin:0 0 0 10px;
  74. }
  75. .flex{
  76. display: flex;
  77. align-items: center;
  78. justify-content: space-between;
  79. }
  80. .showCollapse{
  81. position: absolute;
  82. bottom: 0px;
  83. height: 40px;
  84. width: 79px;
  85. text-align: center;
  86. }
  87. .menu-icon{
  88. display: inline-block;
  89. height: 30px;
  90. width: 100%;
  91. font-size: 14px;
  92. text-align: center;
  93. line-height: 30px;
  94. }
  95. .collapsed{
  96. display: block;
  97. padding: 0px 20px;
  98. }
  99. .onSystem .uncollapsed{
  100. color:#333;
  101. }
  102. </style>