|
@@ -2389,7 +2389,7 @@ import { GetCompetencyList,GetQuestionList,GenerateQuestions,
|
|
GetOpeningSpeech,GetVideo,BatchBind,BatchUnbind,UpdateObj,
|
|
GetOpeningSpeech,GetVideo,BatchBind,BatchUnbind,UpdateObj,
|
|
GenerateCompetency,SaveCompetency,GetPositionTags,
|
|
GenerateCompetency,SaveCompetency,GetPositionTags,
|
|
UpdateQuestion,GetPositionQuestions,CreateCompetency,
|
|
UpdateQuestion,GetPositionQuestions,CreateCompetency,
|
|
- BatchUpdateTags} from './api';
|
|
|
|
|
|
+ BatchUpdateTags,GetQuestionDetail} from './api';
|
|
import draggable from 'vuedraggable';
|
|
import draggable from 'vuedraggable';
|
|
import { updateFieldConfig } from './utils';
|
|
import { updateFieldConfig } from './utils';
|
|
import type { ProfileFieldsConfig } from './types';
|
|
import type { ProfileFieldsConfig } from './types';
|
|
@@ -3941,7 +3941,7 @@ const handleImportQuestion = () => {
|
|
isEditingQuestion.value = false;
|
|
isEditingQuestion.value = false;
|
|
showQuestionBankFormDialog.value = true;
|
|
showQuestionBankFormDialog.value = true;
|
|
};
|
|
};
|
|
-
|
|
|
|
|
|
+
|
|
// QuestionBankForm 提交处理
|
|
// QuestionBankForm 提交处理
|
|
const handleQuestionBankFormSubmit = async (formData: any) => {
|
|
const handleQuestionBankFormSubmit = async (formData: any) => {
|
|
try {
|
|
try {
|
|
@@ -3950,7 +3950,7 @@ const handleQuestionBankFormSubmit = async (formData: any) => {
|
|
...formData,
|
|
...formData,
|
|
tenant_id: Session.get('tenant_id')
|
|
tenant_id: Session.get('tenant_id')
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+ console.log(formData);
|
|
if (response && response.code === 2000) {
|
|
if (response && response.code === 2000) {
|
|
ElMessage.success('题目创建成功');
|
|
ElMessage.success('题目创建成功');
|
|
console.log(response);
|
|
console.log(response);
|
|
@@ -3959,9 +3959,11 @@ const handleQuestionBankFormSubmit = async (formData: any) => {
|
|
const newQuestion = {
|
|
const newQuestion = {
|
|
id: response.data.id || response.data,
|
|
id: response.data.id || response.data,
|
|
title: formData.question,
|
|
title: formData.question,
|
|
|
|
+ content: formData.question,
|
|
question_form: formData.question_form,
|
|
question_form: formData.question_form,
|
|
question_form_name: getQuestionFormName(formData.question_form),
|
|
question_form_name: getQuestionFormName(formData.question_form),
|
|
scoring_reference: formData.scoring_reference || '',
|
|
scoring_reference: formData.scoring_reference || '',
|
|
|
|
+ competency_tag_info: formData.competency_tags || [],
|
|
competency_tags: formData.competency_tags || [],
|
|
competency_tags: formData.competency_tags || [],
|
|
options: formData.options || [],
|
|
options: formData.options || [],
|
|
enable_follow_up: false,
|
|
enable_follow_up: false,
|
|
@@ -4008,11 +4010,22 @@ const getQuestionFormName = (questionForm: number) => {
|
|
|
|
|
|
// 在 script setup 中添加
|
|
// 在 script setup 中添加
|
|
const editQuestion = (index: number) => {
|
|
const editQuestion = (index: number) => {
|
|
- // 编辑问题的逻辑
|
|
|
|
- const question = chatQuestions.value[index];
|
|
|
|
- console.log(question);
|
|
|
|
- Object.assign(questionForm, question);
|
|
|
|
- console.log(chatQuestions);
|
|
|
|
|
|
+ if(chatQuestions.value[index].source!=='ai_generated'){
|
|
|
|
+ console.log(chatQuestions.value[index].id);
|
|
|
|
+ GetQuestionDetail(chatQuestions.value[index].id).then((res:any)=>{
|
|
|
|
+ console.log(res);
|
|
|
|
+ if(res.code===2000){
|
|
|
|
+ Object.assign(questionForm, res.data);
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ // 编辑问题的逻辑
|
|
|
|
+ const question = chatQuestions.value[index];
|
|
|
|
+ console.log(question);
|
|
|
|
+ Object.assign(questionForm, question);
|
|
|
|
+ console.log(chatQuestions);
|
|
|
|
+ }
|
|
|
|
+
|
|
showQuestionDialog.value = true;
|
|
showQuestionDialog.value = true;
|
|
distributeWeightsEvenly()
|
|
distributeWeightsEvenly()
|
|
};
|
|
};
|