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