diff --git a/src/components/ElementUpdate.vue b/src/components/ElementUpdate.vue index 88bf299e..29bfbf1b 100644 --- a/src/components/ElementUpdate.vue +++ b/src/components/ElementUpdate.vue @@ -9,8 +9,10 @@ const props = defineProps({ projectId: Number, elementId: Number, elementObj: Object, + isRemotePage: Boolean, + checkLoading: Boolean, }); -const emit = defineEmits(['flush']); +const emit = defineEmits(['flush', 'checkLocation']); const element = ref({ id: null, eleName: '', @@ -76,6 +78,9 @@ const saveElement = () => { } }); }; +const testElement = () => { + emit('checkLocation', element.value); +}; const moduleList = ref([]); const getModuleList = () => { axios @@ -216,6 +221,15 @@ onMounted(() => {
+ {{ $t('form.test') }} {{ $t('form.save') }} 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 = { diff --git a/src/views/RemoteEmulator/AndroidRemote.vue b/src/views/RemoteEmulator/AndroidRemote.vue index 2c2db040..0cba02bf 100644 --- a/src/views/RemoteEmulator/AndroidRemote.vue +++ b/src/views/RemoteEmulator/AndroidRemote.vue @@ -69,6 +69,7 @@ import { Service, VideoCamera, Postcard, + Location, } 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); @@ -557,30 +559,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'); } }; @@ -867,6 +862,7 @@ const websocketOnmessage = (message) => { } case 'status': { debugLoading.value = false; + checkElementLoading.value = false; ElMessage.info({ message: $t('androidRemoteTS.runOver'), }); @@ -1370,6 +1366,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( @@ -1825,7 +1833,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" /> { @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'] }} + + + { ) }} + + +