index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <!-- 企业信息设置 -->
  2. <template>
  3. <div>
  4. <!-- v-if="completeNum !== tabList?.length" -->
  5. <div class="white-bgc mb-3">
  6. <ProgressBar
  7. label="企业信息填写完成度:"
  8. :num="completeNum"
  9. :total="tabList?.length"
  10. :fontSize="14"
  11. :inlineDisplay="true"
  12. style="width: 350px;"
  13. ></ProgressBar>
  14. </div>
  15. <v-card class="card-box pa-5" style="min-height: 500px">
  16. <v-tabs v-model="tab" @update:model-value="handleTabClick" align-tabs="start" color="primary" bg-color="#f7f8fa">
  17. <v-tab v-for="val in tabList" :key="val.value" :value="val.value" >
  18. {{ val.label }}
  19. <template v-slot:append>
  20. <template v-if="val.status === false">
  21. <v-icon color="orange">mdi-information-outline</v-icon>
  22. <v-tooltip activator="parent" location="top">请完善{{ val.label }}</v-tooltip>
  23. </template>
  24. </template>
  25. </v-tab>
  26. </v-tabs>
  27. <div class="mt-3">
  28. <template v-for="item in tabList" :key="item.id">
  29. <div v-show="item.value === tab">
  30. <component
  31. ref="tabRef"
  32. class="mb-3"
  33. :is="item.path"
  34. @complete="complete"
  35. @change="val => tab = val"
  36. />
  37. </div>
  38. </template>
  39. </div>
  40. <!-- <v-window v-model="tab" class="mt-3">
  41. <v-window-item :value="val.value" v-for="val in tabList" :key="val.value">
  42. <component :is="val.path" ref="tabRef"></component>
  43. </v-window-item>
  44. </v-window> -->
  45. </v-card>
  46. </div>
  47. </template>
  48. <script setup>
  49. defineOptions({ name: 'enterprise-system-management-information-settings'})
  50. import basicInfo from './informationSettingsComponents/basicInfo.vue'
  51. import enterpriseLogo from './informationSettingsComponents/enterpriseLogo.vue'
  52. import enterpriseAlbum from './informationSettingsComponents/enterpriseAlbum.vue'
  53. import welfareLabel from './informationSettingsComponents/welfareLabel.vue'
  54. import enterpriseLabel from './informationSettingsComponents/enterpriseLabel.vue'
  55. import businessInformation from './informationSettingsComponents/businessInformation.vue'
  56. import authentication from './informationSettingsComponents/authentication.vue'
  57. import ProgressBar from '@/components/ProgressBar'
  58. import { ref, shallowRef, watch } from 'vue'
  59. import {
  60. useRoute,
  61. // useRouter
  62. } from 'vue-router'
  63. import { useI18n } from '@/hooks/web/useI18n'
  64. const route = useRoute()
  65. // const router = useRouter()
  66. const { t } = useI18n()
  67. // tab
  68. const tabRef = shallowRef()
  69. const tab = ref(1)
  70. const tabList = ref([
  71. { label: t('enterprise.infoSetting.basicInfo'), value: 1, path: basicInfo, id: 'basicInfo' },
  72. { label: t('enterprise.infoSetting.enterpriseLogo'), value: 2, path: enterpriseLogo, id: 'enterpriseLogo' },
  73. { label: t('enterprise.infoSetting.enterpriseAlbum'), value: 3, path: enterpriseAlbum, id: 'enterpriseAlbum' },
  74. { label: t('enterprise.infoSetting.welfareLabel'), value: 4, path: welfareLabel, id: 'welfareLabel' },
  75. { label: t('enterprise.infoSetting.enterpriseLabel'), value: 7, path: enterpriseLabel, id: 'enterpriseLabel' },
  76. { label: t('enterprise.infoSetting.businessInformation'), value: 5, path: businessInformation, id: 'businessInformation' },
  77. { label: t('setting.realNameAuthentication'), value: 6, path: authentication, id: 'authentication' },
  78. ])
  79. watch(() => route?.query?.tabKey, (newVal) => { // newQuery, oldQuery
  80. if (newVal) tab.value = newVal - 0
  81. }, { deep: true, immediate: true })
  82. const handleTabClick = () => {
  83. // 基本信息-获取企业管理员实名认证信息
  84. // if (tab.value === 1) {
  85. // tabRef.value[0].getAuthInfo()
  86. // }
  87. // router.push(`${route.path}?tabKey=${tab.value.toString()}`)
  88. }
  89. const completeNum = ref(0)
  90. const complete = (val) => {
  91. if (!val?.id) return
  92. completeNum.value = 0
  93. tabList.value.forEach(e => {
  94. if (e.id === val.id) {
  95. e.status = val.status || false
  96. }
  97. if (e.status) {
  98. completeNum.value++
  99. }
  100. })
  101. }
  102. </script>
  103. <style scoped lang="scss">
  104. .topTip {
  105. background-color: #f7f8fa;
  106. color: #2f3640;
  107. padding: 12px 20px;
  108. margin: 10px 0 20px;
  109. font-size: 14px;
  110. }
  111. </style>