|
@@ -1,5 +1,5 @@
|
|
|
<script setup lang="ts">
|
|
|
-import { onMounted, useTemplateRef } from 'vue';
|
|
|
+import { inject, onMounted, useTemplateRef } from 'vue';
|
|
|
import { message } from 'ant-design-vue';
|
|
|
|
|
|
import SvgIcon from '@/components/SvgIcon.vue';
|
|
@@ -7,6 +7,7 @@ import { useRequest } from '@/hooks/request';
|
|
|
import { t } from '@/i18n';
|
|
|
import { completeProtocolConfig, downloadUserProtocol, getProtocolBaseInfo, updateProtocolBaseInfo } from '@/api';
|
|
|
import { downloadBlob } from '@/utils';
|
|
|
+import { FINISH_MODAL_GUIDANCE } from '@/constants/inject-key';
|
|
|
|
|
|
import ProtocolContent from './ProtocolContent.vue';
|
|
|
|
|
@@ -54,12 +55,14 @@ const goBack = () => {
|
|
|
};
|
|
|
|
|
|
const protocolContentRef = useTemplateRef('protocolContent');
|
|
|
+const finishModalGuidance = inject(FINISH_MODAL_GUIDANCE, undefined);
|
|
|
|
|
|
const finish = async () => {
|
|
|
await protocolContentRef.value?.validateProtocolInfo();
|
|
|
await protocolContentRef.value?.isAtLeastOneParam();
|
|
|
await updateProtocolBaseInfo(props.form.protocolInfo);
|
|
|
await completeProtocolConfig(props.form.protocolInfo.id as number);
|
|
|
+ finishModalGuidance?.();
|
|
|
};
|
|
|
|
|
|
defineExpose<UseGuideStepItemExpose>({
|