From ac8a6ed24749ed9232ba1f22681871aa3dfa88fc Mon Sep 17 00:00:00 2001 From: YeungHoiChiu <1005935991@qq.com> Date: Tue, 3 Sep 2024 18:53:23 +0800 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=85=83=E7=B4=A0=E6=8E=A7=E4=BB=B6=E5=89=8D=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=82=B9=E5=87=BB=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ElementUpdate.vue | 13 ++++++++++- src/views/RemoteEmulator/AndroidRemote.vue | 26 +++++++++++++--------- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/src/components/ElementUpdate.vue b/src/components/ElementUpdate.vue index 88bf299e..b3403e49 100644 --- a/src/components/ElementUpdate.vue +++ b/src/components/ElementUpdate.vue @@ -9,8 +9,9 @@ const props = defineProps({ projectId: Number, elementId: Number, elementObj: Object, + isRemotePage: Boolean, }); -const emit = defineEmits(['flush']); +const emit = defineEmits(['flush', 'checkLocation']); const element = ref({ id: null, eleName: '', @@ -76,6 +77,9 @@ const saveElement = () => { } }); }; +const testElement = () => { + emit('checkLocation', element.value); +}; const moduleList = ref([]); const getModuleList = () => { axios @@ -216,6 +220,13 @@ onMounted(() => {
+ {{ '测试' }} {{ $t('form.save') }} diff --git a/src/views/RemoteEmulator/AndroidRemote.vue b/src/views/RemoteEmulator/AndroidRemote.vue index 2c2db040..96d4823d 100644 --- a/src/views/RemoteEmulator/AndroidRemote.vue +++ b/src/views/RemoteEmulator/AndroidRemote.vue @@ -557,30 +557,23 @@ const stopLogcat = () => { ); }; const saveLogcat = () => { - if (logcatOutPut && Array.isArray(logcatOutPut.value)) { - + if (logcatOutPut.value && Array.isArray(logcatOutPut.value)) { const logContent = logcatOutPut.value.join('\n'); - const blob = new Blob([logContent], { type: 'text/plain;charset=utf-8' }); - const url = URL.createObjectURL(blob); - const now = new Date(); const formattedDate = now.toISOString().replace(/:/g, '-').split('.')[0]; - const modelName = device.value['model']; + const modelName = device.value.model; const fileName = `${modelName}_${formattedDate}.log`; - const a = document.createElement('a'); a.href = url; - a.download = fileName; document.body.appendChild(a); a.click(); - document.body.removeChild(a); URL.revokeObjectURL(url); } else { - console.error("logcatOutPut or logcatOutPut.value not expect"); + console.error('logcatOutPut or logcatOutPut.value not expect'); } }; @@ -1370,6 +1363,17 @@ const runStep = () => { }) ); }; +const checkLocation = (data) => { + websocket.send( + JSON.stringify({ + type: 'debug', + detail: 'checkLocation', + element: data.eleValue, + eleType: data.eleType, + pwd: device.value.password, + }) + ); +}; const stopStep = () => { debugLoading.value = false; websocket.send( @@ -1825,7 +1829,9 @@ const checkAlive = () => { :project-id="project['id']" :element-id="0" :element-obj="element" + :is-remote-page="true" @flush="dialogElement = false" + @check-location="checkLocation" /> Date: Wed, 4 Sep 2024 20:45:37 +0800 Subject: [PATCH 2/4] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=85=83=E7=B4=A0=E6=8E=A7=E4=BB=B6=E5=89=8D=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=82=B9=E5=87=BB=E4=BA=8B=E4=BB=B6--2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ElementUpdate.vue | 5 +- src/views/RemoteEmulator/AndroidRemote.vue | 95 ++++++++++++++++ src/views/RemoteEmulator/IOSRemote.vue | 124 +++++++++++++++++++++ 3 files changed, 223 insertions(+), 1 deletion(-) diff --git a/src/components/ElementUpdate.vue b/src/components/ElementUpdate.vue index b3403e49..29bfbf1b 100644 --- a/src/components/ElementUpdate.vue +++ b/src/components/ElementUpdate.vue @@ -10,6 +10,7 @@ const props = defineProps({ elementId: Number, elementObj: Object, isRemotePage: Boolean, + checkLoading: Boolean, }); const emit = defineEmits(['flush', 'checkLocation']); const element = ref({ @@ -224,8 +225,10 @@ onMounted(() => { v-if="isRemotePage" size="small" type="warning" + :loading="checkLoading" + :disabled="checkLoading" @click="testElement" - >{{ '测试' }}{{ $t('form.test') }} {{ $t('form.save') diff --git a/src/views/RemoteEmulator/AndroidRemote.vue b/src/views/RemoteEmulator/AndroidRemote.vue index 96d4823d..0bc29cde 100644 --- a/src/views/RemoteEmulator/AndroidRemote.vue +++ b/src/views/RemoteEmulator/AndroidRemote.vue @@ -69,6 +69,7 @@ import { Service, VideoCamera, Postcard, + Aim, } from '@element-plus/icons'; import { useI18n } from 'vue-i18n'; @@ -148,6 +149,7 @@ const activeTab = ref('main'); const activeTab2 = ref('step'); const stepLog = ref([]); const debugLoading = ref(false); +const checkElementLoading = ref(false); const dialogElement = ref(false); const dialogImgElement = ref(false); const imgElementUrl = ref(null); @@ -860,6 +862,7 @@ const websocketOnmessage = (message) => { } case 'status': { debugLoading.value = false; + checkElementLoading.value = false; ElMessage.info({ message: $t('androidRemoteTS.runOver'), }); @@ -1364,6 +1367,7 @@ const runStep = () => { ); }; const checkLocation = (data) => { + checkElementLoading.value = true; websocket.send( JSON.stringify({ type: 'debug', @@ -1830,6 +1834,7 @@ const checkAlive = () => { :element-id="0" :element-obj="element" :is-remote-page="true" + :check-loading="checkElementLoading" @flush="dialogElement = false" @check-location="checkLocation" /> @@ -3705,6 +3710,23 @@ const checkAlive = () => { @click="copy(elementDetail['resource-id'])" >{{ elementDetail['resource-id'] }} + + + { @click="copy(scope.row)" >{{ scope.row }} + + + { {{ elementDetail['xpath'] }} + + + { @click="copy(elementDetail['content-desc'])" >{{ elementDetail['content-desc'] }} + + + { ) }} + + + { } case 'status': { debugLoading.value = false; + checkElementLoading.value = false; ElMessage.info({ message: $t('androidRemoteTS.runOver'), }); @@ -1086,6 +1088,18 @@ const runStep = () => { }) ); }; +const checkLocation = (data) => { + checkElementLoading.value = true; + websocket.send( + JSON.stringify({ + type: 'debug', + detail: 'checkLocation', + element: data.eleValue, + eleType: data.eleType, + pwd: device.value.password, + }) + ); +}; const stopStep = () => { debugLoading.value = false; websocket.send( @@ -1360,7 +1374,10 @@ const checkAlive = () => { :project-id="project['id']" :element-id="0" :element-obj="element" + :is-remote-page="true" + :check-loading="checkElementLoading" @flush="dialogElement = false" + @check-location="checkLocation" /> { {{ elementDetail['name'] }} + + + { @click="copy(scope.row)" >{{ scope.row }} + + + { @click="copy(scope.row)" >{{ scope.row }} + + + { @click="copy(scope.row)" >{{ scope.row }} + + + { {{ elementDetail['xpath'] }} + + + { ) }} + + + Date: Wed, 4 Sep 2024 21:03:59 +0800 Subject: [PATCH 3/4] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=85=83=E7=B4=A0=E6=8E=A7=E4=BB=B6=E5=89=8D=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=82=B9=E5=87=BB=E4=BA=8B=E4=BB=B6--3=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locales/lang/en_US.js | 1 + src/locales/lang/ja_JP.js | 1 + src/locales/lang/zh_CN.js | 1 + src/locales/lang/zh_TW.js | 1 + 4 files changed, 4 insertions(+) diff --git a/src/locales/lang/en_US.js b/src/locales/lang/en_US.js index fa2af66f..1cf4081b 100644 --- a/src/locales/lang/en_US.js +++ b/src/locales/lang/en_US.js @@ -374,6 +374,7 @@ const form = { inputNewPasswordAgain: 'Please input your new password again', confirm: 'Confirm', cancel: 'Cancel', + test: 'Test', }; // 弹窗相关 const dialog = { diff --git a/src/locales/lang/ja_JP.js b/src/locales/lang/ja_JP.js index f6443727..806cd682 100644 --- a/src/locales/lang/ja_JP.js +++ b/src/locales/lang/ja_JP.js @@ -317,6 +317,7 @@ const form = { inputNewPasswordAgain: '新パスワードを再度入力してください', confirm: '確定', cancel: 'キャンセル', + test: 'テスト', }; // 弹窗相关 const dialog = { diff --git a/src/locales/lang/zh_CN.js b/src/locales/lang/zh_CN.js index 94388aa3..844f23a1 100644 --- a/src/locales/lang/zh_CN.js +++ b/src/locales/lang/zh_CN.js @@ -370,6 +370,7 @@ const form = { inputNewPasswordAgain: '请再次输入新密码', confirm: '确定', cancel: '取消', + test: '测试', }; // 弹窗相关 const dialog = { diff --git a/src/locales/lang/zh_TW.js b/src/locales/lang/zh_TW.js index 429b9b61..10b16ddb 100644 --- a/src/locales/lang/zh_TW.js +++ b/src/locales/lang/zh_TW.js @@ -315,6 +315,7 @@ const form = { inputNewPasswordAgain: '請再次輸入新密碼', confirm: '確定', cancel: '取消', + test: '測試', }; // 彈出型視窗相關 const dialog = { From 7db8ef0469b2abc3ef71dd3a5c62c3f9855ef00d Mon Sep 17 00:00:00 2001 From: YeungHoiChiu <1005935991@qq.com> Date: Wed, 4 Sep 2024 21:19:11 +0800 Subject: [PATCH 4/4] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=85=83=E7=B4=A0=E6=8E=A7=E4=BB=B6=E5=89=8D=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=82=B9=E5=87=BB=E4=BA=8B=E4=BB=B6--icon=E6=9B=B4?= =?UTF-8?q?=E6=8D=A2=E4=B8=BAlocation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/RemoteEmulator/AndroidRemote.vue | 12 ++++++------ src/views/RemoteEmulator/IOSRemote.vue | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/views/RemoteEmulator/AndroidRemote.vue b/src/views/RemoteEmulator/AndroidRemote.vue index 0bc29cde..0cba02bf 100644 --- a/src/views/RemoteEmulator/AndroidRemote.vue +++ b/src/views/RemoteEmulator/AndroidRemote.vue @@ -69,7 +69,7 @@ import { Service, VideoCamera, Postcard, - Aim, + Location, } from '@element-plus/icons'; import { useI18n } from 'vue-i18n'; @@ -3725,7 +3725,7 @@ const checkAlive = () => { }) " > - + { }) " > - + { }) " > - + { }) " > - + { }) " > - + { }) " > - + { }) " > - + { }) " > - + { }) " > - + { }) " > - + { }) " > - +