|
25 | 25 | </el-button> |
26 | 26 |
|
27 | 27 | <el-tooltip |
28 | | - v-if="!platformType.length" |
| 28 | + v-if="!platformType.length && showSyncBtn" |
29 | 29 | effect="dark" |
30 | 30 | :content="$t('sync.integration')" |
31 | 31 | placement="left" |
|
38 | 38 | </el-button> |
39 | 39 | </el-tooltip> |
40 | 40 |
|
41 | | - <el-popover v-else popper-class="sync-platform" placement="bottom-start"> |
| 41 | + <el-popover |
| 42 | + v-if="platformType.length && showSyncBtn" |
| 43 | + popper-class="sync-platform" |
| 44 | + placement="bottom-start" |
| 45 | + > |
42 | 46 | <template #reference> |
43 | 47 | <el-button secondary> |
44 | 48 | <template #icon> |
|
50 | 54 | <div class="popover"> |
51 | 55 | <div class="popover-content"> |
52 | 56 | <div |
53 | | - @click="handleSyncUser(ele)" |
54 | 57 | v-for="ele in platformType" |
55 | 58 | :key="ele.name" |
56 | 59 | class="popover-item" |
| 60 | + @click="handleSyncUser(ele)" |
57 | 61 | > |
58 | 62 | <img height="24" width="24" :src="ele.icon" /> |
59 | 63 | <div class="model-name">{{ $t(ele.name) }}</div> |
|
415 | 419 | :filter-options="filterOption" |
416 | 420 | @trigger-filter="searchCondition" |
417 | 421 | /> |
418 | | - <SyncUserDing @refresh="refresh" ref="syncUserRef"></SyncUserDing> |
| 422 | + <SyncUserDing ref="syncUserRef" @refresh="refresh"></SyncUserDing> |
419 | 423 | </template> |
420 | 424 |
|
421 | 425 | <script setup lang="ts"> |
@@ -935,8 +939,18 @@ const formatUserOrigin = (origin?: number) => { |
935 | 939 | ] |
936 | 940 | return originArray[origin - 1] |
937 | 941 | } |
| 942 | +
|
| 943 | +const showSyncBtn = ref(false) |
938 | 944 | onMounted(() => { |
939 | | - loadData() |
| 945 | + // eslint-disable-next-line no-undef |
| 946 | + const obj = LicenseGenerator.getLicense() |
| 947 | + if (obj?.status === 'valid') { |
| 948 | + showSyncBtn.value = true |
| 949 | + loadData() |
| 950 | + } else { |
| 951 | + platformType.value = [] |
| 952 | + } |
| 953 | +
|
940 | 954 | workspaceList().then((res) => { |
941 | 955 | options.value = res || [] |
942 | 956 | filterOption.value[2].option = [...options.value] |
|
0 commit comments