|
8 | 8 | :before-close="close" |
9 | 9 | > |
10 | 10 | <div style="height: calc(100% - 57px)" v-loading="loading"> |
11 | | - <keep-alive> |
| 11 | + <keep-alive :key="key" :include="['data_source', 'knowledge_base']"> |
12 | 12 | <component |
13 | 13 | ref="ActionRef" |
14 | 14 | :is="ak[active]" |
|
20 | 20 | </keep-alive> |
21 | 21 | </div> |
22 | 22 | <template #footer> |
23 | | - <el-button :loading="loading" @click="close">{{ $t('common.cancel') }}</el-button> |
24 | | - <!-- <el-button v-if="active == 'result'" @click="continueImporting" :loading="loading"> |
| 23 | + <el-button v-if="active == 'result'" @click="continueImporting"> |
25 | 24 | {{ $t('views.document.buttons.continueImporting') }} |
26 | | - </el-button> --> |
| 25 | + </el-button> |
27 | 26 | <el-button |
28 | 27 | v-if="base_form_list.length > 0 && active == 'knowledge_base'" |
29 | 28 | :loading="loading" |
|
46 | 45 | > |
47 | 46 | {{ $t('views.document.buttons.import') }} |
48 | 47 | </el-button> |
49 | | - <!-- <el-button |
50 | | - v-if="active == 'result'" |
51 | | - type="primary" |
52 | | - @click=" |
53 | | - router.push({ |
54 | | - path: `/knowledge/${id}/${folderId}/4/document`, |
55 | | - }) |
56 | | - " |
57 | | - >{{ $t('views.knowledge.ResultSuccess.buttons.toDocument') }}</el-button |
58 | | - > --> |
| 48 | + <el-button v-if="active == 'result'" type="primary" @click="goDocument">{{ |
| 49 | + $t('views.knowledge.ResultSuccess.buttons.toDocument') |
| 50 | + }}</el-button> |
59 | 51 | </template> |
60 | 52 | </el-drawer> |
61 | 53 | </template> |
62 | 54 | <script setup lang="ts"> |
63 | | -import { computed, ref, provide, type Ref } from 'vue' |
| 55 | +import { computed, ref, provide, type Ref, nextTick } from 'vue' |
64 | 56 | import DataSource from '@/views/knowledge-workflow/component/action/DataSource.vue' |
65 | 57 | import Result from '@/views/knowledge-workflow/component/action/Result.vue' |
66 | 58 | import applicationApi from '@/api/application/application' |
67 | 59 | import KnowledgeBase from '@/views/knowledge-workflow/component/action/KnowledgeBase.vue' |
68 | 60 | import { WorkflowType } from '@/enums/application' |
69 | | -import { loadSharedApi } from '@/utils/dynamics-api/shared-api.ts' |
| 61 | +
|
| 62 | +import { loadSharedApi } from '@/utils/dynamics-api/shared-api' |
70 | 63 | import permissionMap from '@/permission' |
71 | 64 | import { MsgError } from '@/utils/message' |
72 | 65 | import { t } from '@/locales' |
73 | | -
|
74 | 66 | import { useRoute, useRouter } from 'vue-router' |
75 | 67 | provide('upload', (file: any, loading?: Ref<boolean>) => { |
76 | 68 | return applicationApi.postUploadFile(file, id, 'KNOWLEDGE', loading) |
77 | 69 | }) |
| 70 | +const key = ref<number>(0) |
78 | 71 | const router = useRouter() |
79 | 72 | const route = useRoute() |
80 | 73 | const { |
@@ -153,8 +146,21 @@ const upload = () => { |
153 | 146 | } |
154 | 147 | } |
155 | 148 | const continueImporting = () => { |
156 | | - action_id.value = undefined |
157 | 149 | active.value = 'data_source' |
| 150 | + key.value++ |
| 151 | + action_id.value = undefined |
| 152 | + const c_workflow = _workflow.value |
| 153 | + _workflow.value = null |
| 154 | + form_data.value = {} |
| 155 | + nextTick(() => { |
| 156 | + _workflow.value = c_workflow |
| 157 | + }) |
| 158 | +} |
| 159 | +const goDocument = () => { |
| 160 | + const newUrl = router.resolve({ |
| 161 | + path: `/knowledge/${id}/${folderId}/4/document`, |
| 162 | + }).href |
| 163 | + window.open(newUrl) |
158 | 164 | } |
159 | 165 | defineExpose({ close, open }) |
160 | 166 | </script> |
|
0 commit comments