Skip to content

Commit

Permalink
feat: quickFind
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Oct 4, 2023
1 parent 07afcc4 commit cfb7d89
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ export const useDeviceApi = (initOrigin?: string) => {
},
});
},
execSelector: async (data: { selector: string; action?: string }) => {
execSelector: async (data: {
selector: string;
action?: string;
quickFind?: boolean;
}) => {
return jsonRpc<{ message: string; action: string; result: boolean }>(
`execSelector`,
{
Expand Down
14 changes: 14 additions & 0 deletions src/views/DevicePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import {
NModal,
NRadioGroup,
NRadio,
NCheckboxGroup,
NCheckbox,
} from 'naive-ui';
import { SortState } from 'naive-ui/es/data-table/src/interface';
import pLimit from 'p-limit';
Expand Down Expand Up @@ -208,6 +210,7 @@ const clickAction = shallowReactive({
selector: ``,
selectorValid: false,
action: `click`,
quickFind: false,
});
const checkSelectorValid = useDebounceFn(() => {
clickAction.selectorValid = checkSelector(clickAction.selector);
Expand Down Expand Up @@ -276,6 +279,17 @@ const execSelector = useTask(async () => {
placeholder="请输入合法的选择器"
/>
<div h-15px></div>
<NSpace>
<NCheckbox v-model:checked="clickAction.quickFind"> 快速查找 </NCheckbox>
<a
href="https://github.com/gkd-kit/subscription/blob/main/src/types.ts"
target="_blank"
rel="noopener noreferrer"
>
查找说明
</a>
</NSpace>
<div h-10px></div>
<NRadioGroup v-model:value="clickAction.action">
<NSpace>
<NRadio value="click"> click </NRadio>
Expand Down

0 comments on commit cfb7d89

Please sign in to comment.