yangg 2 ماه پیش
والد
کامیت
b8bcfc95a8

+ 1 - 1
.env.development

@@ -3,7 +3,7 @@ ENV = 'development'
 #https://minlong.raycos.com.cn
 #线下:http://192.168.66.187:8083
 # 本地环境接口地址 121.36.251.245
-VITE_API_URL = 'http://192.168.66.187:8083'
+VITE_API_URL = 'https://minlong.raycos.com.cn'
 
 # 是否启用按钮权限
 VITE_PM_ENABLED = true

+ 3 - 2
src/views/questionBank/list/crud.tsx

@@ -91,7 +91,7 @@ export const createCrudOptions = function ({ crudExpose, context }: CreateCrudOp
 				}, */
 				id: {
 					title: 'ID',
-					column: { show: false },
+					column: { show: true ,width:80,},
 					search: { show: false },
 					form: { show: false },
 				},
@@ -99,7 +99,8 @@ export const createCrudOptions = function ({ crudExpose, context }: CreateCrudOp
 					title: '题目内容',
 					search: { show: true },
 					column: {
-						minWidth: 120,
+						showOverflowTooltip: true, // 超出显示提示
+						width: 300 ,// 固定列宽
 						sortable: 'custom',
 					},
 					form: {

+ 11 - 2
src/views/questionBank/positionList/api.ts

@@ -13,9 +13,9 @@ export function GetDocumentList(query: UserPageQuery) {
 
 export function AddDocument(obj: AddReq) {
   return request({
-    url: '/system/job/add_question',
+    url: 'api/system/job/add_question',
     method: 'post',
-    data: {...obj,position_id:"1"},
+    data: {...obj,tenant_id:"1"},
   });
 }
 
@@ -77,4 +77,13 @@ export function DeleteDocumentCategory(id: any) {
     url: `/api/system/document-categories/${id}/`,
     method: 'delete'
   });
+}
+
+// 添加获取面试问题的方法
+export function GetInterviewQuestions(params: any) {
+    return request({
+        url: '/api/system/interview_question/list',
+        method: 'get',
+        params
+    });
 }

+ 77 - 49
src/views/questionBank/positionList/crud.tsx

@@ -10,20 +10,20 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 	const router = useRouter(); // 添加这行来获取router实例
 	const pageRequest = async (query: any) => {
 		// 确保查询参数正确传递
-		api.GetDocumentTree({}).then((ret: any) => {
+		/* api.GetDocumentTree({}).then((ret: any) => { */
 			// 构建请求参数,确保category参数被正确传递
 		const params = {
 			...query,
 			tenant_id: '1',
 			// 如果 query.form 中有 category,使用它,否则使用 query.category
 			category: (query.form && query.form.category) || query.category || '',
-			job_id: ret.data[0].id
+			job_id: 1//ret.data[0].id
 		};
 
 		console.log('Request params:', params); // 添加日志以便调试
 
 		return  api.GetDocumentList(params);
-		});
+		/* }); */
 		
 	};
 
@@ -75,7 +75,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 							window.dispatchEvent(event);
 						}
 					},
-					preview: {
+					/* preview: {
 						text: '预览',
 						type: 'success',
 						size: 'small',
@@ -102,7 +102,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 							const previewUrl = `/#/preview?url=${encodeURIComponent(filePath)}&type=${fileType}`;
 							window.open(previewUrl, '_blank');
 						}
-					},
+					}, */
 					edit: {
 						type: 'primary',
 						size: 'small',
@@ -130,44 +130,75 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						columnSetDisabled: true, //禁止在列设置中选择
 					},
 				}, */
+				id: {
+					title: 'ID',
+					column: { show: true ,width:80, },
+					search: { show: false },
+					form: { show: false },
+				},
 				position_id: {
 					title: '职位',
 					search: { show: true },
 					type: 'dict-select',
+					dict:dict({
+                        url({form}){
+                            return  '/api/job/list?tenant_id=1'
+                        },
+                        label:'title',
+                        value:'id'
+                        }),
 					column: {
 						value: '1',
 						minWidth: 120,
 						show: false,
 					},
-					form: { show: false },
+					form: { show: true },
 				},
 				question_id: {
-					title: 'ID',
+					title: '职位问题',
 					search: { show: false },
+					type: 'dict-select',
+					dict:dict({
+						url: '/api/categories', // 获取数据的接口
+						// 或者使用方法
+						getData: async () => {
+						  const res = await api.GetInterviewQuestions({page:1,limit:1000,tenant_id:1});
+						  return res.data.items;
+						},
+						label: 'question',
+						value: 'id'
+					}),
 					column: {
 						value: '1',
 						show: false
 					},
-					form: { show: false },
-				},
-				id: {
-					title: 'ID',
-					column: { show: false },
-					search: { show: false },
-					form: { show: false },
+					form: { 
+						show: true,
+						component: {
+							props: {
+								filterable: true,
+								clearable: true,
+								placeholder: '请选择职位问题',
+							}
+						}
+					},
 				},
+			
 				question: {
 					title: '题目内容',
 					search: { show: true },
 					column: {
-						minWidth: 120,
+						
 						sortable: 'custom',
+						showOverflowTooltip: true, // 超出显示提示
+						width: 300 // 固定列宽
 					},
 					form: {
 						rules: [{ required: true, message: '题目内容必填' }],
 						component: {
 							placeholder: '请输入题目内容',
 						},
+						show: false
 					},
 				},
 				question_type: {
@@ -190,6 +221,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 							placeholder: '请选择问题类型',
 						},
 						helper: '选择问题的类型分类',
+						show: false
 					},
 				},
 				question_form: {
@@ -225,9 +257,10 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 							}
 						},
 						helper: '选择题目的形式:开放问题、单选题或多选题',
+						show: false
 					},
 				},
-				position_types: {
+				/* position_types: {
 					title: '适用职位',
 					search: { show: true },
 					type: 'dict-select',
@@ -242,18 +275,14 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					}),
 					form: {
 						component: {
-							/* 	name: 'el-select', */
 							props: {
 								multiple: true,
 								filterable: true,
 								placeholder: '请选择适用职位类型',
-								/* options: [
-									{ value: '0', label: '技术' },
-									{ value: '1', label: '管理' },
-								] */
 							}
 						},
-						helper: '选择题目适用的职位类型,可多选'
+						helper: '选择题目适用的职位类型,可多选',
+						show: false
 					}
 				},
 				recommended_duration: {
@@ -271,9 +300,10 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 								step: 10
 							}
 						},
-						helper: '建议回答此题目的时长,单位为秒'
+						helper: '建议回答此题目的时长,单位为秒',
+						show: false
 					}
-				},
+				}, */
 				difficulty: {
 					title: '难度等级',
 					search: { show: true },
@@ -290,17 +320,21 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					}),
 					form: {
 						rules: [{ required: true, message: '难度等级必填' }],
-						helper: '选择题目的难度级别'
+						helper: '选择题目的难度级别',
+						show: false
 					},
 				},
-				is_system: {
+				/* is_system: {
 					title: '系统题目',
 					search: { show: true },
+					dict: dict({
+						data: [
+							{ value: 0, label: '停用' },
+							{ value: 1, label: '启用' }
+						]
+					}),
 					column: {
-						width: 80,
-						component: {
-							name: 'el-switch'
-						}
+						width: 120,
 					},
 					form: {
 						component: {
@@ -310,26 +344,16 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 								inactiveText: '否'
 							}
 						},
-						helper: '是否为系统预设题目'
+						helper: '是否为系统预设题目',
+						show: false
 					}
-				},
-				status: {
+				}, */
+				/* status: {
 					title: '状态',
 					search: { show: true },
 					type: 'dict-select',
 					column: {
 						width: 80,
-						/* component: {
-							name: 'fs-dict-label',
-							props: {
-								dict: dict({
-									data: [
-										{ value: 0, label: '停用' },
-										{ value: 1, label: '启用' }
-									]
-								})
-							}
-						} */
 					},
 					dict: dict({
 						data: [
@@ -342,7 +366,8 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						component: {
 							placeholder: '请选择状态',
 						},
-						helper: '题目的启用状态'
+						helper: '题目的启用状态',
+						show: false
 					},
 				},
 				sort: {
@@ -359,17 +384,18 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 								max: 999
 							}
 						},
-						helper: '题目的排序值,值越小排序越靠前'
+						helper: '题目的排序值,值越小排序越靠前',
+						show: false
 					}
-				},
+				}, */
 				option_items: {
 					title: '选项列表',
 					search: { show: false },
 					column: { show: false },
 					form: {
-						show: compute(({ form }) => {
+						/* show: compute(({ form }) => {
 							return form && (form.question_form === 1 || form.question_form === 2);
-						}),
+						}), */
 						component: {
 							name: 'el-card',
 							children: {
@@ -460,6 +486,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 								}
 							}
 						},
+						show: false,
 						helper: compute(({ form }) => {
 							if (form.question_form === 1) {
 								return '添加单选题的选项,并标记正确答案(只能有一个正确答案)';
@@ -481,6 +508,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 							rows: 4,
 							placeholder: '请输入答案解析'
 						},
+						show:false
 					},
 				},