From 5b480b77ffbffb4cb0eeef1b1b954ac7b8ec50e8 Mon Sep 17 00:00:00 2001 From: wangshuqin Date: Tue, 21 Nov 2023 11:38:06 +0800 Subject: [PATCH 1/3] drown select --- src/assets/icons/success-color.svg | 19 +++++ .../components/ImportGitRepository.vue | 77 +++++++++++++++++-- 2 files changed, 90 insertions(+), 6 deletions(-) create mode 100644 src/assets/icons/success-color.svg diff --git a/src/assets/icons/success-color.svg b/src/assets/icons/success-color.svg new file mode 100644 index 00000000..277289ac --- /dev/null +++ b/src/assets/icons/success-color.svg @@ -0,0 +1,19 @@ + + + 形状结合 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/views/projects/projectsCreat/components/ImportGitRepository.vue b/src/views/projects/projectsCreat/components/ImportGitRepository.vue index 1c95f8d9..f69b57ec 100644 --- a/src/views/projects/projectsCreat/components/ImportGitRepository.vue +++ b/src/views/projects/projectsCreat/components/ImportGitRepository.vue @@ -9,18 +9,64 @@
- +
Add Github Account
-
+ + --> +
+ +
+ +
+ {{ selectValue }} +
+
+ + +
+
+ +
+ +
@@ -146,6 +192,7 @@ const apiUrl = ref(import.meta.env.VITE_HAMSTER_URL); const githubAccountList = ref([]); const selectValue = ref(''); const selsectInstallId = ref(''); +const selectAvatarUrl = ref(''); const repositorySelection = ref(''); @@ -157,6 +204,8 @@ const searchInputValue = ref('') let importUrl = ref([]) let nameDupErrInfo = ref('') +const installationsData = ref({}) + const VNodes: any = (_, { attrs }) => { return attrs.vnodes; @@ -265,8 +314,11 @@ const adjustGithubPremission = () => { const myWindow = window.open(url, 'select_target', 'modal=yes,toolbar=no,titlebar=no,menuba=no,location=no,top=100,left=500,width=800,height=700') } -const selectGithubAccount = (value: any, item: any) => { - console.log(value, item, '9090') +const selectGithubAccount = (item: any) => { + console.log(item, '9090') + // installationsData.value = item; + selectValue = item.name; + selectAvatarUrl.value = item.avatarUrl; selsectInstallId.value = item.installId; repositorySelection.value = item.repositorySelection; searchLoading.value = true; @@ -279,8 +331,10 @@ const getInstallationsAccount = async () => { const { data } = await getInstallations(); githubAccountList.value = data; selectValue.value = data[0].name; + selectAvatarUrl.value = data[0].avatarUrl; selsectInstallId.value = data[0].installId; repositorySelection.value = data[0].repositorySelection; + // installationsData.value = data[0] console.log(data, '999') } catch (err: any) { // message.error(err.message) @@ -416,6 +470,7 @@ onMounted(async () => { .search-btn { :deep(.ant-input-affix-wrapper) { + height: 52px !important; border-radius: 8px 0px 0px 8px !important; } @@ -432,6 +487,12 @@ onMounted(async () => { // border: 1px solid #EBEBEB; border-radius: 0px 8px 8px 0px !important; } + + +} + +:deep(.ant-dropdown-content .ant-dropdown-menu) { + border-radius: 8px !important; } :deep(.ant-radio-wrapper span) { @@ -446,6 +507,10 @@ onMounted(async () => { color: #C3C4C7; } +.plus-outlined { + border-top: 1px solid #F4F4F4; +} + :deep(.ant-radio-wrapper-checked span .radio-sub) { color: #E2B578; } From 4ed3708a70bd98e34588c3e09ef8149f591672b3 Mon Sep 17 00:00:00 2001 From: wangshuqin Date: Tue, 21 Nov 2023 11:40:34 +0800 Subject: [PATCH 2/3] selectValue.value --- .../projects/projectsCreat/components/ImportGitRepository.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/projects/projectsCreat/components/ImportGitRepository.vue b/src/views/projects/projectsCreat/components/ImportGitRepository.vue index f69b57ec..66b1b8a4 100644 --- a/src/views/projects/projectsCreat/components/ImportGitRepository.vue +++ b/src/views/projects/projectsCreat/components/ImportGitRepository.vue @@ -317,7 +317,7 @@ const adjustGithubPremission = () => { const selectGithubAccount = (item: any) => { console.log(item, '9090') // installationsData.value = item; - selectValue = item.name; + selectValue.value = item.name; selectAvatarUrl.value = item.avatarUrl; selsectInstallId.value = item.installId; repositorySelection.value = item.repositorySelection; From f919d46ad8d50d4d17ec4976eeff080b6562eda4 Mon Sep 17 00:00:00 2001 From: wangshuqin Date: Tue, 21 Nov 2023 13:27:58 +0800 Subject: [PATCH 3/3] add Github Account --- .env.development | 4 ++-- .../projectsCreat/components/ImportGitRepository.vue | 10 +++------- src/views/projects/projectsCreat/metaMaskAuth.vue | 3 --- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.env.development b/.env.development index d150752b..55f6f839 100644 --- a/.env.development +++ b/.env.development @@ -5,8 +5,8 @@ VITE_APP_TITLE=Hamster # VITE_APP_CLIENTID="9fce2a15f6df21849e20" VITE_APP_CLIENTID="Iv1.6d9972fa6afd1c02" # 02projects 14middleWare -VITE_BASE_API="http://61.172.179.6:30302/api" -# VITE_BASE_API="http://172.16.10.43:8080/api" +# VITE_BASE_API="http://61.172.179.6:30302/api" +VITE_BASE_API="http://172.16.10.43:8080/api" VITE_WS_API="ws://61.172.179.6:30302/api" diff --git a/src/views/projects/projectsCreat/components/ImportGitRepository.vue b/src/views/projects/projectsCreat/components/ImportGitRepository.vue index 66b1b8a4..95cc804e 100644 --- a/src/views/projects/projectsCreat/components/ImportGitRepository.vue +++ b/src/views/projects/projectsCreat/components/ImportGitRepository.vue @@ -211,7 +211,6 @@ const VNodes: any = (_, { attrs }) => { return attrs.vnodes; }; - const importVisible = ref(false); const repositoryVisible = ref(false); const importFormRef = ref(); @@ -272,16 +271,14 @@ const pagination = reactive({ }); const addGithubAccount = () => { - // console.log('jkjkjk') - // window.addEventListener('message', resetRepositoryData, false) + window.addEventListener('message', resetRepositoryData, false) const state = new Date().getTime(); const url = `${selectTargetUrl.value}?state=${state}&redirect_uri=${apiUrl.value}/projects/installations`; - // const myWindow = window.open(url, 'select_target', 'modal=yes,toolbar=no,titlebar=no,menuba=no,location=no,top=100,left=500,width=800,height=700s') - const myWindow = window.open('http://localhost:5173/projects/installations?setup_action=install'); + const myWindow = window.open(url, 'select_target', 'modal=yes,toolbar=no,titlebar=no,menuba=no,location=no,top=100,left=500,width=800,height=700s') + } const resetRepositoryData = async (event: Event) => { - if (event.data.origin == apiUrl.value) return // await getInstallationsAccount() console.log(event, 'RepositoryData更新列表1111') // pagination.current = 1; @@ -455,7 +452,6 @@ const handleDone = async () => { } onMounted(async () => { - await getGithubInstallCheck() }) diff --git a/src/views/projects/projectsCreat/metaMaskAuth.vue b/src/views/projects/projectsCreat/metaMaskAuth.vue index 596ef499..c4fce756 100644 --- a/src/views/projects/projectsCreat/metaMaskAuth.vue +++ b/src/views/projects/projectsCreat/metaMaskAuth.vue @@ -43,9 +43,6 @@ const initGithubInstallAuth = async () => { } } - - - onMounted(() => { initGithubInstallAuth() })