mirror of
https://github.com/certd/certd.git
synced 2026-05-15 20:47:31 +08:00
chore: 1
This commit is contained in:
@@ -13,13 +13,21 @@ const emit = defineEmits<{
|
||||
}>();
|
||||
|
||||
const optionsRef = ref([]);
|
||||
const message = ref("");
|
||||
const getOptions = async () => {
|
||||
return await doRequest({
|
||||
type: props.type,
|
||||
typeName: props.typeName,
|
||||
action: props.action,
|
||||
input: props.form
|
||||
});
|
||||
return await doRequest(
|
||||
{
|
||||
type: props.type,
|
||||
typeName: props.typeName,
|
||||
action: props.action,
|
||||
input: props.form
|
||||
},
|
||||
{
|
||||
onError(err) {
|
||||
message.value = err.message;
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
const filterOption = (input: string, option: any) => {
|
||||
@@ -53,7 +61,8 @@ watch(
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<a-select
|
||||
<div>
|
||||
<a-select
|
||||
class="remote-select"
|
||||
show-search
|
||||
:filter-option="filterOption"
|
||||
@@ -62,6 +71,10 @@ watch(
|
||||
@click="onClick"
|
||||
@update:value="emit('update:value', $event)"
|
||||
/>
|
||||
<div class="helper">
|
||||
{{ message }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less"></style>
|
||||
|
||||
@@ -14,7 +14,7 @@ export type RequestHandleReq<T = any> = {
|
||||
input: T;
|
||||
};
|
||||
|
||||
export async function doRequest(req: RequestHandleReq) {
|
||||
export async function doRequest(req: RequestHandleReq, opts?: any = {}) {
|
||||
const url = req.type === "access" ? "/pi/handle/access" : "/pi/handle/plugin";
|
||||
const { typeName, action, data, input } = req;
|
||||
const res = await request({
|
||||
@@ -25,7 +25,8 @@ export async function doRequest(req: RequestHandleReq) {
|
||||
action,
|
||||
data,
|
||||
input
|
||||
}
|
||||
},
|
||||
...opts
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<contextHolder />
|
||||
<a-input :value="value" :allow-clear="true" @update:value="emit('update:value', $event)">
|
||||
<a-input v-bind="attrs" :value="value" :allow-clear="true" @update:value="emit('update:value', $event)">
|
||||
<template #suffix>
|
||||
<a-tag class="cursor-pointer" @click="getDeviceId">获取设备ID</a-tag>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user