mirror of https://github.com/certd/certd
chore:
parent
92c6c45e77
commit
d6c7326467
|
@ -49,7 +49,7 @@ const doTest = async () => {
|
|||
type: pluginType,
|
||||
typeName: form.type,
|
||||
action: props.action,
|
||||
input: form
|
||||
input: pluginType === "plugin" ? form.input : form
|
||||
},
|
||||
{
|
||||
onError(err: any) {
|
||||
|
|
|
@ -87,7 +87,7 @@ const getOptions = async () => {
|
|||
type: pluginType,
|
||||
typeName: form.type,
|
||||
action: props.action,
|
||||
input: form
|
||||
input: pluginType === "plugin" ? form.input : form
|
||||
},
|
||||
{
|
||||
onError(err: any) {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="tsx" setup>
|
||||
import { defineProps, ref, useAttrs } from "vue";
|
||||
import { defineProps, inject, ref, useAttrs } from "vue";
|
||||
import { Modal } from "ant-design-vue";
|
||||
import { ComponentPropsType, doRequest } from "/@/components/plugins/lib";
|
||||
|
||||
|
@ -26,16 +26,21 @@ const emit = defineEmits<{
|
|||
const attrs = useAttrs();
|
||||
|
||||
const otpCodeRef = ref("");
|
||||
const getScope: any = inject("get:scope");
|
||||
const getPluginType: any = inject("get:plugin:type");
|
||||
|
||||
async function loginWithOTPCode(otpCode: string) {
|
||||
const { form } = getScope();
|
||||
const pluginType = getPluginType();
|
||||
|
||||
return await doRequest({
|
||||
type: props.type,
|
||||
typeName: props.typeName,
|
||||
type: pluginType,
|
||||
typeName: form.type,
|
||||
action: "LoginWithOPTCode",
|
||||
data: {
|
||||
otpCode
|
||||
},
|
||||
input: props.form
|
||||
input: form
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -149,14 +149,7 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
|
|||
}),
|
||||
component: {
|
||||
name: "api-test",
|
||||
type: "notification",
|
||||
typeName: compute(({ form }) => {
|
||||
return form.type;
|
||||
}),
|
||||
action: "TestRequest",
|
||||
form: compute(({ form }) => {
|
||||
return form;
|
||||
})
|
||||
action: "TestRequest"
|
||||
},
|
||||
order: 999
|
||||
},
|
||||
|
|
|
@ -86,13 +86,13 @@
|
|||
},
|
||||
rules: [{ required: true, message: '此项必填' }]
|
||||
}"
|
||||
:get-context-fn="blankFn"
|
||||
:get-context-fn="getScopeFunc"
|
||||
/>
|
||||
<template v-for="(item, key) in currentPlugin.input" :key="key">
|
||||
<fs-form-item v-if="item.show !== false" v-model="currentStep.input[key]" :item="item" :get-context-fn="blankFn" />
|
||||
<fs-form-item v-if="item.show !== false" v-model="currentStep.input[key]" :item="item" :get-context-fn="getScopeFunc" />
|
||||
</template>
|
||||
|
||||
<fs-form-item v-model="currentStep.strategy.runStrategy" :item="runStrategyProps" :get-context-fn="blankFn" />
|
||||
<fs-form-item v-model="currentStep.strategy.runStrategy" :item="runStrategyProps" :get-context-fn="getScopeFunc" />
|
||||
</a-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
|
@ -305,8 +305,10 @@ export default {
|
|||
stepDrawerClose();
|
||||
};
|
||||
|
||||
const blankFn = () => {
|
||||
return {};
|
||||
const getScopeFunc = () => {
|
||||
return {
|
||||
form: currentStep.value
|
||||
};
|
||||
};
|
||||
|
||||
const pluginSearch = ref({
|
||||
|
@ -362,7 +364,7 @@ export default {
|
|||
stepSave,
|
||||
stepDelete,
|
||||
rules,
|
||||
blankFn,
|
||||
getScopeFunc,
|
||||
stepCopy,
|
||||
fullscreen
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue