|
|
@@ -10,6 +10,7 @@
|
|
|
placeholder="选择相关知识点"
|
|
|
/>
|
|
|
<div v-else class="mt-24">知识点加载中...</div>
|
|
|
+ {{recommended}}
|
|
|
<slide-in-same-transition>
|
|
|
<keep-alive>
|
|
|
<choice-question-editor @input="handleInput" v-if="kind === QuestionKind.choice" :initValue="initValue"
|
|
|
@@ -32,7 +33,7 @@ import Treeselect from '@riophae/vue-treeselect'
|
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
|
import { constructTree } from '@/utils/construct-tree'
|
|
|
import debounce from '@/utils/debounce'
|
|
|
-// import { recommendKnowledge } from '@/server/ml-recommend'
|
|
|
+import { recommendKnowledge } from '@/server/ml-recommend'
|
|
|
|
|
|
export default {
|
|
|
name: 'QuestionEditorFactory',
|
|
|
@@ -55,9 +56,11 @@ export default {
|
|
|
knowledgeTree: null,
|
|
|
selectedKnowledgeIdList: this.initValue.knowledgeId,
|
|
|
stem: null,
|
|
|
+ recommended: null,
|
|
|
|
|
|
debounceRecommend: debounce(() => {
|
|
|
- // recommendKnowledge({ text: JSON.stringify(this.stem) })
|
|
|
+ recommendKnowledge({ text: JSON.stringify(this.stem) })
|
|
|
+ .then(res => { this.recommended = res })
|
|
|
}, 500),
|
|
|
QuestionKind
|
|
|
}
|