android-midscene-automation 1.1.4 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.md +11 -0
- package/artemis-main/apps/admin_console/server.py +33 -0
- package/package.json +1 -1
- package/server/appium-recorder/ai-recognition.ts +9 -0
- package/server/appium-recorder/appium-runner.ts +9 -1
- package/src/appium-recorder/components/AiRecognitionSettings.vue +141 -84
- package/src/appium-recorder/components/ComponentTree.vue +72 -10
- package/src/appium-recorder/components/FlowCanvas.vue +39 -1
- package/src/appium-recorder/components/FlowNodeCard.vue +11 -1
- package/src/appium-recorder/components/FlowStepEditor.vue +114 -85
- package/src/appium-recorder/components/LoopSettings.vue +12 -10
- package/src/appium-recorder/components/NestedConditionBranches.vue +5 -1
- package/src/appium-recorder/components/NodeDetail.vue +129 -52
- package/src/appium-recorder/components/RecordedSteps.vue +12 -0
- package/src/appium-recorder/components/TextClickSettings.vue +11 -11
- package/src/appium-recorder/components/VariableExtractionSettings.vue +6 -4
- package/src/appium-recorder/flow-graph.ts +9 -3
- package/src/components/config/AiDeduplicationSettings.vue +0 -1
- package/src/components/config/MidsceneConfigPanel.vue +12 -2
- package/src/style.css +157 -4
|
@@ -65,6 +65,8 @@ let internalsFrame = 0;
|
|
|
65
65
|
let resetViewFrame = 0;
|
|
66
66
|
let pendingResetView = false;
|
|
67
67
|
let searchFrame = 0;
|
|
68
|
+
let focusFrame = 0;
|
|
69
|
+
let focusedNodeId = '';
|
|
68
70
|
watch(() => [props.searchFocusToken, props.searchTargetId, props.searchActive, paneReady.value], async () => {
|
|
69
71
|
if (searchFrame) cancelAnimationFrame(searchFrame);
|
|
70
72
|
if (!props.searchActive || !props.searchTargetId || !paneReady.value) return;
|
|
@@ -107,9 +109,37 @@ function handleNodeResize(payload: { id: string; height: number }) {
|
|
|
107
109
|
[payload.id]: height,
|
|
108
110
|
};
|
|
109
111
|
void nextTick(scheduleNodeInternalsUpdate);
|
|
112
|
+
if (payload.id === focusedNodeId) void nextTick(() => scheduleNodeFocus(payload.id));
|
|
110
113
|
if (props.readonly) void nextTick(() => scheduleResetView());
|
|
111
114
|
}
|
|
112
115
|
|
|
116
|
+
function scheduleNodeFocus(nodeId: string) {
|
|
117
|
+
if (!paneReady.value || !nodeId) return;
|
|
118
|
+
if (focusFrame) window.cancelAnimationFrame(focusFrame);
|
|
119
|
+
focusFrame = window.requestAnimationFrame(() => {
|
|
120
|
+
updateNodeInternals([nodeId]);
|
|
121
|
+
focusFrame = window.requestAnimationFrame(() => {
|
|
122
|
+
focusFrame = 0;
|
|
123
|
+
if (focusedNodeId !== nodeId) return;
|
|
124
|
+
const node = findNode(nodeId);
|
|
125
|
+
if (!node) return;
|
|
126
|
+
const zoom = Math.min(1.8, Math.max(1.2, viewport.value.zoom));
|
|
127
|
+
void setCenter(
|
|
128
|
+
node.position.x + node.dimensions.width / 2,
|
|
129
|
+
node.position.y + node.dimensions.height / 2,
|
|
130
|
+
{ zoom, duration: 260 },
|
|
131
|
+
);
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function handleNodeClick(index: number) {
|
|
137
|
+
const step = props.steps[index];
|
|
138
|
+
if (step) focusedNodeId = `step:${step.id}`;
|
|
139
|
+
emit('nodeClick', index);
|
|
140
|
+
if (focusedNodeId) void nextTick(() => scheduleNodeFocus(focusedNodeId));
|
|
141
|
+
}
|
|
142
|
+
|
|
113
143
|
function scheduleNodeInternalsUpdate() {
|
|
114
144
|
if (internalsFrame) window.cancelAnimationFrame(internalsFrame);
|
|
115
145
|
internalsFrame = window.requestAnimationFrame(() => {
|
|
@@ -165,12 +195,20 @@ watch(graph, () => {
|
|
|
165
195
|
void nextTick(scheduleNodeInternalsUpdate);
|
|
166
196
|
});
|
|
167
197
|
|
|
198
|
+
watch(() => props.expandedStepIndex, () => {
|
|
199
|
+
if (focusedNodeId) void nextTick(() => scheduleNodeFocus(focusedNodeId));
|
|
200
|
+
});
|
|
201
|
+
|
|
168
202
|
watch(() => props.resetViewToken, () => {
|
|
203
|
+
focusedNodeId = '';
|
|
204
|
+
if (focusFrame) window.cancelAnimationFrame(focusFrame);
|
|
205
|
+
focusFrame = 0;
|
|
169
206
|
void nextTick(scheduleResetView);
|
|
170
207
|
});
|
|
171
208
|
|
|
172
209
|
onBeforeUnmount(() => {
|
|
173
210
|
if (searchFrame) cancelAnimationFrame(searchFrame);
|
|
211
|
+
if (focusFrame) cancelAnimationFrame(focusFrame);
|
|
174
212
|
if (internalsFrame) window.cancelAnimationFrame(internalsFrame);
|
|
175
213
|
if (resetViewFrame) window.cancelAnimationFrame(resetViewFrame);
|
|
176
214
|
pendingResetView = false;
|
|
@@ -225,7 +263,7 @@ function handleInsert(payload: {
|
|
|
225
263
|
:data="data"
|
|
226
264
|
:readonly="props.readonly"
|
|
227
265
|
:search-highlighted="nodeId === `step:${searchTargetId}`"
|
|
228
|
-
@node-click="
|
|
266
|
+
@node-click="handleNodeClick"
|
|
229
267
|
@copy="emit('copy', [$event])"
|
|
230
268
|
@remove="emit('remove', $event)"
|
|
231
269
|
@edit-input="emit('editInput', $event)"
|
|
@@ -181,7 +181,10 @@ watch(() => props.data, () => {
|
|
|
181
181
|
</el-icon>
|
|
182
182
|
</el-tooltip>
|
|
183
183
|
<strong :title="`${data.index + 1}. ${data.title}`"><span class="appium-flow-node-number">{{ data.index + 1 }}.</span> {{ data.title }}</strong>
|
|
184
|
-
<small
|
|
184
|
+
<small
|
|
185
|
+
:class="{ 'appium-flow-step-card__meta--clamped': data.step.type === 'aiRecognition' }"
|
|
186
|
+
:title="data.meta"
|
|
187
|
+
>{{ data.meta }}</small>
|
|
185
188
|
<em v-if="data.note" :title="data.note">{{ data.note }}</em>
|
|
186
189
|
</span>
|
|
187
190
|
</button>
|
|
@@ -274,4 +277,11 @@ watch(() => props.data, () => {
|
|
|
274
277
|
.appium-flow-step-shell--delete-selected .appium-flow-step-card__content small { color: #fee2e2; }
|
|
275
278
|
.appium-node-action-tooltip { display: inline-flex; }
|
|
276
279
|
.appium-ai-model-warning { float: left; margin: 2px 6px 0 0; font-size: 16px; }
|
|
280
|
+
.appium-flow-step-card__meta--clamped {
|
|
281
|
+
display: -webkit-box;
|
|
282
|
+
overflow: hidden;
|
|
283
|
+
text-overflow: ellipsis;
|
|
284
|
+
-webkit-box-orient: vertical;
|
|
285
|
+
-webkit-line-clamp: 3;
|
|
286
|
+
}
|
|
277
287
|
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue';
|
|
2
|
+
import { computed, ref } from 'vue';
|
|
3
3
|
import CoordinatePointPicker from './CoordinatePointPicker.vue';
|
|
4
4
|
import type { AppiumRecordedStep, AppiumSelector } from '../types';
|
|
5
5
|
import { normalizeVisualChangeConfig } from '../visual-change';
|
|
@@ -51,6 +51,16 @@ const invalidTapCoordinates = computed(() => (
|
|
|
51
51
|
&& Number(props.step.fallback?.centerX) === 0
|
|
52
52
|
&& Number(props.step.fallback?.centerY) === 0
|
|
53
53
|
));
|
|
54
|
+
const editorSections = ref<string[]>([]);
|
|
55
|
+
const selectorSummary = computed(() => {
|
|
56
|
+
const selector = props.step.selector;
|
|
57
|
+
if (!selector) return '未设置';
|
|
58
|
+
const value = selector.value?.trim() || '未填写';
|
|
59
|
+
return `${selector.strategy} · ${value}${props.step.contextSelector ? ' · 含父级' : ''}`;
|
|
60
|
+
});
|
|
61
|
+
const supportsTimeout = computed(() => ![
|
|
62
|
+
'delay', 'longPress', 'stopApp', 'log', 'openGallery', 'endFlow', 'loop', 'breakLoop', 'continueLoop', 'aiRecognition',
|
|
63
|
+
].includes(props.step.type));
|
|
54
64
|
|
|
55
65
|
function defaultKind(): FlowKind {
|
|
56
66
|
return defaultFlowKind(props.step);
|
|
@@ -154,55 +164,27 @@ function patchSelector(patch: Partial<AppiumSelector>) {
|
|
|
154
164
|
<template>
|
|
155
165
|
<div class="appium-flow-editor">
|
|
156
166
|
<el-form label-position="top" size="small">
|
|
157
|
-
<el-form-item label="节点名称">
|
|
158
|
-
<el-input
|
|
159
|
-
:model-value="step.label"
|
|
160
|
-
:disabled="disabled"
|
|
161
|
-
@update:model-value="patchStep({ label: String($event) })"
|
|
162
|
-
/>
|
|
163
|
-
</el-form-item>
|
|
164
|
-
<el-form-item label="备注">
|
|
165
|
-
<el-input
|
|
166
|
-
:model-value="step.note || ''"
|
|
167
|
-
:disabled="disabled"
|
|
168
|
-
maxlength="100"
|
|
169
|
-
placeholder="例如:登录按钮、账号输入框"
|
|
170
|
-
@update:model-value="patchStep({ note: String($event) || undefined })"
|
|
171
|
-
/>
|
|
172
|
-
</el-form-item>
|
|
173
|
-
<div>
|
|
174
|
-
<el-form-item v-if="step.type === 'aiRecognition'">
|
|
175
|
-
<el-checkbox :model-value="step.aiTimeoutEnabled === true" :disabled="disabled" @update:model-value="patchStep({ aiTimeoutEnabled: $event === true })">启用超时</el-checkbox>
|
|
176
|
-
</el-form-item>
|
|
177
|
-
<el-form-item v-if="!['longPress', 'stopApp', 'log', 'openGallery', 'endFlow', 'loop', 'breakLoop', 'continueLoop'].includes(step.type) && (step.type !== 'aiRecognition' || step.aiTimeoutEnabled === true)" :label="step.type === 'aiRecognition' && step.aiObservation ? '模型请求超时 ms' : '超时时间 ms'">
|
|
178
|
-
<el-input-number
|
|
179
|
-
:model-value="step.timeoutMs ?? (step.type === 'delay' ? 1000 : DEFAULT_NODE_TIMEOUT_MS)"
|
|
180
|
-
:disabled="disabled"
|
|
181
|
-
:min="0"
|
|
182
|
-
:max="999999"
|
|
183
|
-
:step="1000"
|
|
184
|
-
controls-position="right"
|
|
185
|
-
@update:model-value="patchTimeout($event)"
|
|
186
|
-
/>
|
|
187
|
-
</el-form-item>
|
|
188
|
-
<BranchTimeoutSettings v-if="defaultKind() === 'condition' && (step.type !== 'aiRecognition' || step.aiTimeoutEnabled === true)" :step="step" :disabled="disabled" @update="patchStep({ timeoutBranch: $event })" />
|
|
189
|
-
</div>
|
|
190
167
|
<LongPressSettings v-if="step.type === 'longPress'" :step="step" :disabled="disabled" @update="patchStep" />
|
|
191
168
|
<el-form-item v-if="['waitActivity', 'launchApp', 'stopApp', 'clearAppData'].includes(step.type)" :label="step.type === 'waitActivity' ? '目标 Activity' : '目标 APP 包名'">
|
|
192
169
|
<el-input :model-value="step.value || ''" :disabled="disabled" @update:model-value="patchStep({ value: String($event) })" />
|
|
193
170
|
</el-form-item>
|
|
171
|
+
<el-form-item v-if="step.type === 'delay'" label="延时时长 ms">
|
|
172
|
+
<el-input-number :model-value="step.timeoutMs ?? 1000" :disabled="disabled" :min="0" :max="999999" :step="1000" controls-position="right" @update:model-value="patchTimeout($event)" />
|
|
173
|
+
</el-form-item>
|
|
194
174
|
<template v-if="step.type === 'pinch'">
|
|
195
175
|
<el-form-item label="缩放方向">
|
|
196
176
|
<el-select :model-value="step.pinch?.direction || 'out'" :disabled="disabled" @update:model-value="patchPinch({ direction: $event })">
|
|
197
177
|
<el-option label="放大" value="out" /><el-option label="缩小" value="in" />
|
|
198
178
|
</el-select>
|
|
199
179
|
</el-form-item>
|
|
200
|
-
<
|
|
201
|
-
<el-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
<el-
|
|
205
|
-
|
|
180
|
+
<div class="appium-flow-editor__grid">
|
|
181
|
+
<el-form-item v-for="axis in (['centerX', 'centerY'] as const)" :key="axis" :label="axis === 'centerX' ? '中心 X' : '中心 Y'">
|
|
182
|
+
<el-input-number :model-value="step.pinch?.[axis] ?? 0" :disabled="disabled" :min="0" :max="99999" :precision="0" controls-position="right" @update:model-value="patchPinch({ [axis]: $event ?? 0 })" />
|
|
183
|
+
</el-form-item>
|
|
184
|
+
<el-form-item label="缩放比例">
|
|
185
|
+
<el-input-number :model-value="step.pinch?.percent ?? 0.5" :disabled="disabled" :min="0.01" :max="1" :step="0.05" controls-position="right" @update:model-value="patchPinch({ percent: $event ?? 0.5 })" />
|
|
186
|
+
</el-form-item>
|
|
187
|
+
</div>
|
|
206
188
|
</template>
|
|
207
189
|
<StageLogSettings v-if="step.type === 'log'" :step="step" :disabled="disabled" @update="patchStep" />
|
|
208
190
|
<VariableExtractionSettings v-if="step.type === 'extractVariable'" :step="step" :disabled="disabled" @update="patchStep" />
|
|
@@ -210,7 +192,25 @@ function patchSelector(patch: Partial<AppiumSelector>) {
|
|
|
210
192
|
<LoopSettings v-if="step.type === 'loop'" :step="step" :disabled="disabled" @update="patchStep" />
|
|
211
193
|
<BreakLoopSettings v-if="step.type === 'breakLoop' || step.type === 'continueLoop'" :step="step" :steps="steps" :disabled="disabled" :mode="step.type === 'continueLoop' ? 'continue' : 'break'" @update="patchStep" />
|
|
212
194
|
<TextClickSettings v-if="step.type === 'textClick'" :step="step" :disabled="disabled" @update="patchStep" />
|
|
213
|
-
<AiRecognitionSettings v-if="step.type === 'aiRecognition'" :step="step" :steps="steps" :disabled="disabled" @update="patchStep"
|
|
195
|
+
<AiRecognitionSettings v-if="step.type === 'aiRecognition'" :step="step" :steps="steps" :disabled="disabled" @update="patchStep">
|
|
196
|
+
<template #other>
|
|
197
|
+
<el-form-item label="节点名称">
|
|
198
|
+
<el-input :model-value="step.label" :disabled="disabled" @update:model-value="patchStep({ label: String($event) })" />
|
|
199
|
+
</el-form-item>
|
|
200
|
+
<el-form-item label="备注">
|
|
201
|
+
<el-input :model-value="step.note || ''" :disabled="disabled" maxlength="100" placeholder="例如:播放画面检测" @update:model-value="patchStep({ note: String($event) || undefined })" />
|
|
202
|
+
</el-form-item>
|
|
203
|
+
<el-form-item>
|
|
204
|
+
<el-checkbox :model-value="step.aiTimeoutEnabled === true" :disabled="disabled" @update:model-value="patchStep({ aiTimeoutEnabled: $event === true })">启用超时</el-checkbox>
|
|
205
|
+
</el-form-item>
|
|
206
|
+
<template v-if="step.aiTimeoutEnabled === true">
|
|
207
|
+
<el-form-item :label="step.aiObservation ? '模型请求超时 ms' : '超时时间 ms'">
|
|
208
|
+
<el-input-number :model-value="step.timeoutMs ?? DEFAULT_NODE_TIMEOUT_MS" :disabled="disabled" :min="0" :max="999999" :step="1000" controls-position="right" @update:model-value="patchTimeout($event)" />
|
|
209
|
+
</el-form-item>
|
|
210
|
+
<BranchTimeoutSettings v-if="defaultKind() === 'condition'" :step="step" :disabled="disabled" @update="patchStep({ timeoutBranch: $event })" />
|
|
211
|
+
</template>
|
|
212
|
+
</template>
|
|
213
|
+
</AiRecognitionSettings>
|
|
214
214
|
<el-form-item
|
|
215
215
|
v-if="step.type === 'input' || step.type === 'inputIfExists' || step.type === 'assertText'"
|
|
216
216
|
label="文本内容"
|
|
@@ -363,50 +363,39 @@ function patchSelector(patch: Partial<AppiumSelector>) {
|
|
|
363
363
|
/>
|
|
364
364
|
</el-form-item>
|
|
365
365
|
</div>
|
|
366
|
-
<
|
|
367
|
-
<el-
|
|
368
|
-
<
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
<el-option label="xpath" value="xpath" />
|
|
400
|
-
</el-select>
|
|
401
|
-
</el-form-item>
|
|
402
|
-
<el-form-item label="父级上下文值">
|
|
403
|
-
<el-input
|
|
404
|
-
:model-value="step.contextSelector?.value || ''"
|
|
405
|
-
:disabled="disabled || !step.contextSelector"
|
|
406
|
-
@update:model-value="patchStep({ contextSelector: { ...(step.contextSelector || { strategy: 'xpath' }), value: String($event) } })"
|
|
407
|
-
/>
|
|
408
|
-
</el-form-item>
|
|
409
|
-
</div>
|
|
366
|
+
<el-collapse v-if="showSelector" v-model="editorSections" class="appium-flow-editor__groups">
|
|
367
|
+
<el-collapse-item name="selector">
|
|
368
|
+
<template #title>
|
|
369
|
+
<span class="appium-flow-editor__group-title"><strong>组件定位</strong><small>{{ selectorSummary }}</small></span>
|
|
370
|
+
</template>
|
|
371
|
+
<div v-if="step.selector" class="appium-flow-editor__grid">
|
|
372
|
+
<el-form-item label="Selector 类型">
|
|
373
|
+
<el-select :model-value="step.selector.strategy" :disabled="disabled" @update:model-value="patchSelector({ strategy: $event as AppiumSelector['strategy'] })">
|
|
374
|
+
<el-option label="accessibility id" value="accessibilityId" />
|
|
375
|
+
<el-option label="id" value="id" />
|
|
376
|
+
<el-option label="android uiAutomator" value="androidUiAutomator" />
|
|
377
|
+
<el-option label="xpath" value="xpath" />
|
|
378
|
+
</el-select>
|
|
379
|
+
</el-form-item>
|
|
380
|
+
<el-form-item label="Selector 值">
|
|
381
|
+
<el-input :model-value="step.selector.value || ''" :disabled="disabled" @update:model-value="patchSelector({ value: String($event) })" />
|
|
382
|
+
</el-form-item>
|
|
383
|
+
</div>
|
|
384
|
+
<div class="appium-flow-editor__grid">
|
|
385
|
+
<el-form-item label="父级上下文类型">
|
|
386
|
+
<el-select :model-value="step.contextSelector?.strategy || ''" :disabled="disabled" clearable placeholder="不使用父级" @update:model-value="patchStep({ contextSelector: $event ? { ...(step.contextSelector || { value: '' }), strategy: $event as AppiumSelector['strategy'] } : undefined })">
|
|
387
|
+
<el-option label="accessibility id" value="accessibilityId" />
|
|
388
|
+
<el-option label="id" value="id" />
|
|
389
|
+
<el-option label="android uiAutomator" value="androidUiAutomator" />
|
|
390
|
+
<el-option label="xpath" value="xpath" />
|
|
391
|
+
</el-select>
|
|
392
|
+
</el-form-item>
|
|
393
|
+
<el-form-item label="父级上下文值">
|
|
394
|
+
<el-input :model-value="step.contextSelector?.value || ''" :disabled="disabled || !step.contextSelector" @update:model-value="patchStep({ contextSelector: { ...(step.contextSelector || { strategy: 'xpath' }), value: String($event) } })" />
|
|
395
|
+
</el-form-item>
|
|
396
|
+
</div>
|
|
397
|
+
</el-collapse-item>
|
|
398
|
+
</el-collapse>
|
|
410
399
|
<div v-if="defaultKind() === 'condition' && step.type !== 'loop' && !isBooleanCondition(step)" class="appium-flow-editor__grid">
|
|
411
400
|
<el-form-item label="指定文本(可选)">
|
|
412
401
|
<el-input
|
|
@@ -447,6 +436,23 @@ function patchSelector(patch: Partial<AppiumSelector>) {
|
|
|
447
436
|
/>
|
|
448
437
|
<CoordinatePointPicker :disabled="disabled" @select="applyTapPoint" />
|
|
449
438
|
</section>
|
|
439
|
+
<el-collapse v-if="step.type !== 'aiRecognition'" v-model="editorSections" class="appium-flow-editor__groups appium-flow-editor__groups--meta">
|
|
440
|
+
<el-collapse-item name="meta">
|
|
441
|
+
<template #title>
|
|
442
|
+
<span class="appium-flow-editor__group-title"><strong>节点信息与超时</strong><small>{{ step.label }}</small></span>
|
|
443
|
+
</template>
|
|
444
|
+
<el-form-item label="节点名称">
|
|
445
|
+
<el-input :model-value="step.label" :disabled="disabled" @update:model-value="patchStep({ label: String($event) })" />
|
|
446
|
+
</el-form-item>
|
|
447
|
+
<el-form-item label="备注">
|
|
448
|
+
<el-input :model-value="step.note || ''" :disabled="disabled" maxlength="100" placeholder="例如:登录按钮、账号输入框" @update:model-value="patchStep({ note: String($event) || undefined })" />
|
|
449
|
+
</el-form-item>
|
|
450
|
+
<el-form-item v-if="supportsTimeout" label="超时时间 ms">
|
|
451
|
+
<el-input-number :model-value="step.timeoutMs ?? (step.type === 'delay' ? 1000 : DEFAULT_NODE_TIMEOUT_MS)" :disabled="disabled" :min="0" :max="999999" :step="1000" controls-position="right" @update:model-value="patchTimeout($event)" />
|
|
452
|
+
</el-form-item>
|
|
453
|
+
<BranchTimeoutSettings v-if="defaultKind() === 'condition' && supportsTimeout" :step="step" :disabled="disabled" @update="patchStep({ timeoutBranch: $event })" />
|
|
454
|
+
</el-collapse-item>
|
|
455
|
+
</el-collapse>
|
|
450
456
|
</el-form>
|
|
451
457
|
</div>
|
|
452
458
|
</template>
|
|
@@ -460,6 +466,8 @@ function patchSelector(patch: Partial<AppiumSelector>) {
|
|
|
460
466
|
border-top: 1px solid var(--el-border-color-lighter);
|
|
461
467
|
}
|
|
462
468
|
|
|
469
|
+
.appium-flow-editor :deep(.el-form-item) { margin-bottom: 10px; }
|
|
470
|
+
|
|
463
471
|
.appium-flow-editor__fallback :deep(.el-form-item) {
|
|
464
472
|
margin-bottom: 0;
|
|
465
473
|
}
|
|
@@ -472,4 +480,25 @@ function patchSelector(patch: Partial<AppiumSelector>) {
|
|
|
472
480
|
font-size: 13px;
|
|
473
481
|
line-height: 20px;
|
|
474
482
|
}
|
|
483
|
+
|
|
484
|
+
.appium-flow-editor__groups {
|
|
485
|
+
overflow: hidden;
|
|
486
|
+
margin-top: 8px;
|
|
487
|
+
border: 1px solid var(--el-border-color-lighter);
|
|
488
|
+
border-radius: 10px;
|
|
489
|
+
background: #fff;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
.appium-flow-editor__groups :deep(.el-collapse-item__header) {
|
|
493
|
+
height: 42px;
|
|
494
|
+
padding: 0 10px;
|
|
495
|
+
border-bottom: 0;
|
|
496
|
+
font-size: 12px;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
.appium-flow-editor__groups :deep(.el-collapse-item__wrap) { border-bottom: 0; }
|
|
500
|
+
.appium-flow-editor__groups :deep(.el-collapse-item__content) { padding: 8px 10px 2px; }
|
|
501
|
+
.appium-flow-editor__group-title { display: flex; align-items: center; justify-content: space-between; min-width: 0; width: 100%; padding-right: 8px; gap: 8px; }
|
|
502
|
+
.appium-flow-editor__group-title strong { flex: none; color: var(--ui-text); font-size: 12px; }
|
|
503
|
+
.appium-flow-editor__group-title small { min-width: 0; overflow: hidden; color: var(--ui-text-muted); font-size: 11px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
|
|
475
504
|
</style>
|
|
@@ -13,16 +13,18 @@ function selector(patch: Partial<AppiumSelector>) {
|
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
15
|
<template>
|
|
16
|
-
<
|
|
17
|
-
<el-
|
|
18
|
-
<el-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<el-
|
|
25
|
-
|
|
16
|
+
<div class="appium-flow-editor__grid">
|
|
17
|
+
<el-form-item label="循环方式">
|
|
18
|
+
<el-select :model-value="step.loop?.exitWhen || 'never'" :disabled="disabled" @update:model-value="patch({ exitWhen: $event })">
|
|
19
|
+
<el-option value="never" label="固定次数" />
|
|
20
|
+
<el-option value="exists" label="元素出现时退出" />
|
|
21
|
+
<el-option value="notExists" label="元素消失时退出" />
|
|
22
|
+
</el-select>
|
|
23
|
+
</el-form-item>
|
|
24
|
+
<el-form-item :label="step.loop?.exitWhen === 'never' ? '执行次数' : '最大执行次数'" required>
|
|
25
|
+
<el-input-number :model-value="step.loop?.maxIterations" :disabled="disabled" :min="1" :max="MAX_LOOP_ITERATIONS" :precision="0" controls-position="right" @update:model-value="patch({ maxIterations: Number($event) })" />
|
|
26
|
+
</el-form-item>
|
|
27
|
+
</div>
|
|
26
28
|
<template v-if="step.loop?.exitWhen && step.loop.exitWhen !== 'never'">
|
|
27
29
|
<el-form-item label="退出条件定位方式">
|
|
28
30
|
<el-select :model-value="step.selector?.strategy || 'id'" :disabled="disabled" @update:model-value="selector({ strategy: $event })">
|
|
@@ -298,7 +298,11 @@ function branchSplitPath() {
|
|
|
298
298
|
>
|
|
299
299
|
<span class="appium-flow-node__body">
|
|
300
300
|
<span class="appium-flow-node__title"><span class="appium-flow-node-number">{{ item.index + 1 }}.</span> {{ item.step.label }}</span>
|
|
301
|
-
<span
|
|
301
|
+
<span
|
|
302
|
+
class="appium-flow-node__meta"
|
|
303
|
+
:class="{ 'appium-flow-node__meta--clamped': item.step.type === 'aiRecognition' }"
|
|
304
|
+
:title="item.step.type === 'aiRecognition' ? stepMeta(item.step) : undefined"
|
|
305
|
+
>
|
|
302
306
|
{{ kindLabel(defaultKind(item.step)) }} · {{ typeLabel(item.step) }}
|
|
303
307
|
<template v-if="stepMeta(item.step)"> · {{ stepMeta(item.step) }}</template>
|
|
304
308
|
</span>
|