Skip to content

Commit

Permalink
feat: 新增 action
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Nov 24, 2023
1 parent f08d5dd commit 9e270cb
Showing 1 changed file with 25 additions and 17 deletions.
42 changes: 25 additions & 17 deletions src/views/DevicePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
NModal,
NRadioGroup,
NRadio,
NCheckboxGroup,
NSelect,
NCheckbox,
} from 'naive-ui';
import { SortState } from 'naive-ui/es/data-table/src/interface';
Expand Down Expand Up @@ -206,10 +206,19 @@ const updateSubs = useTask(async () => {
const showSelectorModel = shallowRef(false);
const actionOptions = [
'click',
'clickNode',
'clickCenter',
'back',
'longClick',
'longClickNode',
'longClickCenter',
].map((s) => ({ value: s, label: s }));
const clickAction = shallowReactive({
selector: ``,
selectorValid: false,
action: `click`,
action: actionOptions[0].value,
quickFind: false,
});
const checkSelectorValid = useDebounceFn(() => {
Expand Down Expand Up @@ -290,21 +299,20 @@ const execSelector = useTask(async () => {
</a>
</NSpace>
<div h-10px></div>
<NRadioGroup v-model:value="clickAction.action">
<NSpace>
<NRadio value="click"> click </NRadio>
<NRadio value="clickNode"> clickNode </NRadio>
<NRadio value="clickCenter"> clickCenter </NRadio>
<NRadio value="back"> back </NRadio>
<a
href="https://github.com/gkd-kit/subscription/blob/main/src/types.ts"
target="_blank"
rel="noopener noreferrer"
>
操作说明
</a>
</NSpace>
</NRadioGroup>
<div flex gap-10px flex-items-center>
<NSelect
v-model:value="clickAction.action"
:options="actionOptions"
class="w-150px"
/>
<a
href="https://github.com/gkd-kit/subscription/blob/main/src/types.ts"
target="_blank"
rel="noopener noreferrer"
>
操作说明
</a>
</div>
</NModal>
<div flex flex-col p-10px gap-10px h-full>
<NSpace>
Expand Down

0 comments on commit 9e270cb

Please sign in to comment.