index.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <home-container :customStyle="{ background: 'none', backgroundColor: '#f5f5f5' }">
  3. <view class="profile-manage-container">
  4. <view class="grid-body">
  5. <uni-section title="画像管理" type="line" class="uni-section-custom"></uni-section>
  6. <uni-grid :column="3" :showBorder="false">
  7. <uni-grid-item v-for="(item, index) in items" :key="index">
  8. <view class="grid-item-box" @click="handleGridClick(item.appUrl)">
  9. <img alt="" :src="item.workbenchIcon">
  10. <text class="text">{{ item.appName }}</text>
  11. </view>
  12. </uni-grid-item>
  13. </uni-grid>
  14. </view>
  15. </view>
  16. </home-container>
  17. </template>
  18. <script>
  19. import HomeContainer from '@/components/HomeContainer.vue'
  20. import { getAppList } from '@/api/system/user'
  21. const profileAppNames = ['全站综合信息', '部门画像', '班组画像', '小组画像', '员工画像']
  22. export default {
  23. components: { HomeContainer },
  24. data() {
  25. return {
  26. appList: []
  27. }
  28. },
  29. computed: {
  30. items() {
  31. return this.appList.filter(item => profileAppNames.includes(item.appName))
  32. }
  33. },
  34. onLoad() {
  35. this.loadAppList()
  36. },
  37. methods: {
  38. async loadAppList() {
  39. try {
  40. const res = await getAppList({ homePage: 0 })
  41. if (res.code === 200) {
  42. this.appList = res.data || []
  43. }
  44. } catch (error) {
  45. console.error('获取画像应用列表失败:', error)
  46. this.appList = []
  47. }
  48. },
  49. handleGridClick(url) {
  50. if (!url) return
  51. uni.navigateTo({ url })
  52. }
  53. }
  54. }
  55. </script>
  56. <style lang="scss" scoped>
  57. .profile-manage-container {
  58. padding: 20rpx;
  59. background-color: #f5f5f5;
  60. }
  61. .grid-body {
  62. background-color: #fff;
  63. border-radius: 16rpx;
  64. padding: 20rpx;
  65. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
  66. .uni-section-custom {
  67. ::v-deep .uni-section-header {
  68. padding: 12rpx 10rpx !important;
  69. }
  70. }
  71. }
  72. .grid-item-box {
  73. flex: 1;
  74. display: flex;
  75. flex-direction: column;
  76. align-items: center;
  77. justify-content: center;
  78. padding: 30rpx 0;
  79. img {
  80. display: inline-block;
  81. width: 88rpx;
  82. height: 88rpx;
  83. }
  84. &:active {
  85. background-color: #f5f5f5;
  86. border-radius: 12rpx;
  87. }
  88. }
  89. .text {
  90. text-align: center;
  91. font-size: 25rpx;
  92. margin-top: 15rpx;
  93. color: #333;
  94. }
  95. </style>