yangg 2 months ago
parent
commit
53c98fbee5

+ 8 - 2
src/views/JobApplication/report/report.vue

@@ -2403,11 +2403,17 @@ export default {
     },
     formatTextWithBrackets(text) {
       if (!text) return '';
-      return text.replace(/【(.*?)】/g, '<span  style="color:#81b337; font-weight: 500;">【$1】</span>');
+      // 精确去除中间的分类标签,保留【能力标题】和具体分析内容
+      // 匹配模式:【能力标题】分类标签:具体内容
+      let cleanText = text.replace(/】[^【:]*:[^:]*:/, '】').replace(/】[^【:]*:/, '】');
+      return cleanText.replace(/【(.*?)】/g, '<span  style="color:#81b337; font-weight: 500;">【$1】</span>');
     },
     formatTextWithBrackets2(text) {
       if (!text) return '';
-      return text.replace(/【(.*?)】/g, '<span  style="color:#fb752f; font-weight: 500;">【$1】</span>');
+      // 精确去除中间的分类标签,保留【能力标题】和具体分析内容
+      // 匹配模式:【能力标题】分类标签:具体内容
+      let cleanText = text.replace(/】[^【:]*:[^:]*:/, '】').replace(/】[^【:]*:/, '】');
+      return cleanText.replace(/【(.*?)】/g, '<span  style="color:#fb752f; font-weight: 500;">【$1】</span>');
     },
     // 添加处理答案文本的方法
     getAnswerText(answer) {

+ 13 - 4
src/views/position/detail/index.vue

@@ -4232,10 +4232,19 @@ const handleImportQuestion = () => {
 const handleQuestionBankFormSubmit = async (formData: any) => {
   try {
     // 调用题库API创建题目
-    const response = await questionBankApi.AddObj({
-      ...formData,
-      tenant_id: Session.get('tenant_id')
-    });
+    let response
+    if(formData.question_form==6){
+     response = await questionBankApi.AddObjBlank({
+          ...formData,
+          tenant_id: Session.get('tenant_id')
+        });
+    }else{
+     response = await questionBankApi.AddObj({
+        ...formData,
+        tenant_id: Session.get('tenant_id')
+      });
+    }
+   
     console.log(formData);
     if (response && response.code === 2000) {
       ElMessage.success('题目创建成功');

+ 18 - 0
src/views/questionBank/list/api.ts

@@ -137,4 +137,22 @@ export function UpdateScoringStandard(data: any) {
 		method: 'put',
 		data: { ...data, tenant_id: Session.get('tenant_id') }
 	});
+}
+
+/* 添加填空题 */
+export function AddObjBlank(obj: AddReq) {
+	return request({
+		url: "/api/system/interview_question/blank/create",
+		method: 'post',
+		data: {...obj,tenant_id: Session.get('tenant_id')},/* Session.get('tenant_id').tenant_id ||,tenant_id: '1' */
+	});
+}
+
+/* 编辑填空题 /api/system/interview_question/blank/update*/
+export function editObjBlank(obj: AddReq) {
+	return request({
+		url: "/api/system/interview_question/blank/update",
+		method: 'post',
+		data: {...obj,tenant_id: Session.get('tenant_id')},/* Session.get('tenant_id').tenant_id ||,tenant_id: '1' */
+	});
 }

+ 7 - 1
src/views/questionBank/list/crud.tsx

@@ -54,7 +54,13 @@ export const createCrudOptions = function ({ crudExpose, context }: CreateCrudOp
 		}
 		
 		// 调用更新题目的接口
-		const editResult = await api.UpdateObj(form);
+		let editResult
+		if (form.question_form === 6) { // 填空题
+			editResult = await api.editObjBlank(form);
+		} else {
+			editResult = await api.UpdateObj(form);
+
+		}
 		
 		// 如果更新成功且题目形式为0(开放题)或5,异步触发视频生成
 		if (editResult.code === 2000 && (form.question_form === 0 || form.question_form === 5)) {