yangg vor 1 Monat
Ursprung
Commit
d5907038ae

+ 42 - 0
src/views/JobApplication/list/crud.tsx

@@ -186,6 +186,29 @@ export const createCrudOptions = function ({ crudExpose, context}: CreateCrudOpt
 
 	return {
 		crudOptions: {
+			toolbar:{
+				buttons:{
+					search:{show:false},
+					// 刷新按钮
+					refresh:{show:false},
+					// 紧凑模式
+					compact:{show:false},
+					// 导出按钮
+					export:{
+						text: '导出',
+						type: 'primary',
+						size: 'small',
+						icon: 'upload',
+						circle: false,
+						display: true
+					},
+					// 列设置按钮
+					columns:{
+						show:false
+					},
+				}
+			},
+			
 			request: {
 				pageRequest,
 				addRequest,
@@ -223,6 +246,7 @@ export const createCrudOptions = function ({ crudExpose, context}: CreateCrudOpt
 						type: 'primary',
 						show: true,
 						order: 1,
+						size: 'small',
 						click: () => {
 							const selection = context.selectedRows || [];
 							
@@ -288,6 +312,14 @@ export const createCrudOptions = function ({ crudExpose, context}: CreateCrudOpt
 			search: {
 				show: true,
 				layout: 'auto',
+				buttons: {
+					search: {
+						size: 'small', // 设置查询按钮大小为small
+					},
+					reset: {
+						size: 'small', // 设置重置按钮大小为small
+					}
+				},
 				resetBtn: {
 					show: true,
 					click: () => {
@@ -340,6 +372,8 @@ export const createCrudOptions = function ({ crudExpose, context}: CreateCrudOpt
 						component: {
 							placeholder: '请输入报告编号',
 						},
+						size: 'small',
+						col:{ span:3},
 					},
 					type: 'input',
 					column: {
@@ -358,6 +392,8 @@ export const createCrudOptions = function ({ crudExpose, context}: CreateCrudOpt
 						component: {
 							placeholder: '请输入申请人姓名',
 						},
+						size: 'small',
+						col:{ span:3},
 					},
 					type: 'input',
 					column: {
@@ -376,6 +412,8 @@ export const createCrudOptions = function ({ crudExpose, context}: CreateCrudOpt
 						component: {
 							placeholder: '请输入申请人电话',
 						},
+						size: 'small',
+						col:{ span:3},
 					},
 					type: 'input',
 					column: {
@@ -394,6 +432,8 @@ export const createCrudOptions = function ({ crudExpose, context}: CreateCrudOpt
 						component: {
 							placeholder: '请输入申请职位',
 						},
+						size: 'small',
+						col:{ span:3},
 					},
 					type: 'input',
 					column: {
@@ -410,6 +450,8 @@ export const createCrudOptions = function ({ crudExpose, context}: CreateCrudOpt
 					search: {
 						show: true,
 						placeholder: '请选择申请状态',
+						size: 'small',
+						col:{ span:3},
 						/* component: {
 							name: 'el-select',
 							

+ 37 - 0
src/views/digitalHuman/list/crud.tsx

@@ -54,6 +54,28 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 
 	return {
 		crudOptions: {
+			toolbar:{
+				buttons:{
+					search:{show:false},
+					// 刷新按钮
+					refresh:{show:false},
+					// 紧凑模式
+					compact:{show:false},
+					// 导出按钮
+					export:{
+						text: '导出',
+						type: 'primary',
+						size: 'small',
+						icon: 'upload',
+						circle: false,
+						display: true
+					},
+					// 列设置按钮
+					columns:{
+						show:false
+					},
+				}
+			},
 			request: {
 				pageRequest,
 				addRequest,
@@ -64,6 +86,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 				buttons: {
 					add: {
 						show: true,
+						size: 'small',
 						click: () => {
 							crudExpose.emit('add-digital-human');
 						}
@@ -113,6 +136,14 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 			search: {
 				show: true,
 				layout: 'auto',
+				buttons: {
+					search: {
+						size: 'small', // 设置查询按钮大小为small
+					},
+					reset: {
+						size: 'small', // 设置重置按钮大小为small
+					}
+				}
 			},
 			columns: {
 				_index: {
@@ -132,6 +163,8 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						component: {
 							placeholder: '请输入数字人名称',
 						},
+						size: 'small',
+						col:{ span:3},
 					},
 					type: 'input',
 					column: {
@@ -147,6 +180,8 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					title: '描述',
 					search: {
 						show: false,
+						size: 'small',
+						col:{ span:3},
 					},
 					type: 'textarea',
 					column: {
@@ -272,6 +307,8 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 							name: 'el-select',
 							placeholder: '请选择状态',
 						},
+						size: 'small',
+						col:{ span:3},
 					},
 					type: 'dict-select',
 					column: {

+ 22 - 0
src/views/position/list/crud.tsx

@@ -28,6 +28,28 @@ export const createCrudOptions = function ({ crudExpose, context }: CreateCrudOp
 
 	return {
 		crudOptions: {
+			toolbar:{
+				buttons:{
+					search:{show:false},
+					// 刷新按钮
+					refresh:{show:false},
+					// 紧凑模式
+					compact:{show:false},
+					// 导出按钮
+					export:{
+						text: '导出',
+						type: 'primary',
+						size: 'small',
+						icon: 'upload',
+						circle: false,
+						display: true
+					},
+					// 列设置按钮
+					columns:{
+						show:false
+					},
+				}
+			},
 			request: {
 				pageRequest,
 				addRequest,

+ 34 - 1
src/views/questionBank/classList/crud.tsx

@@ -37,6 +37,28 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 
 	return {
 		crudOptions: {
+			toolbar:{
+				buttons:{
+					search:{show:false},
+					// 刷新按钮
+					refresh:{show:false},
+					// 紧凑模式
+					compact:{show:false},
+					// 导出按钮
+					export:{
+						text: '导出',
+						type: 'primary',
+						size: 'small',
+						icon: 'upload',
+						circle: false,
+						display: true
+					},
+					// 列设置按钮
+					columns:{
+						show:false
+					},
+				}
+			},
 			request: {
 				pageRequest,
 				addRequest,
@@ -78,7 +100,14 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 			},
 			search: {
 				show: true,
-				layout: 'auto',
+				buttons: {
+					search: {
+						size: 'small', // 设置查询按钮大小为small
+					},
+					reset: {
+						size: 'small', // 设置重置按钮大小为small
+					}
+				}
 			},
 			columns: {
 				_index: {
@@ -98,6 +127,8 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						component: {
 							placeholder: '请输入分类名称',
 						},
+						size: 'small',
+						col:{ span:3},
 					},
 					type: 'input',
 					column: {
@@ -116,6 +147,8 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						component: {
 							placeholder: '请输入描述',
 						},
+						size: 'small',
+						col:{ span:3},
 					},
 					type: 'textarea',
 					column: {

+ 35 - 2
src/views/questionBank/labelList/crud.tsx

@@ -37,6 +37,28 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 
 	return {
 		crudOptions: {
+			toolbar:{
+				buttons:{
+					search:{show:false},
+					// 刷新按钮
+					refresh:{show:false},
+					// 紧凑模式
+					compact:{show:false},
+					// 导出按钮
+					export:{
+						text: '导出',
+						type: 'primary',
+						size: 'small',
+						icon: 'upload',
+						circle: false,
+						display: true
+					},
+					// 列设置按钮
+					columns:{
+						show:false
+					},
+				}
+			},
 			request: {
 				pageRequest,
 				addRequest,
@@ -78,7 +100,14 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 			},
 			search: {
 				show: true,
-				layout: 'auto',
+				buttons: {
+					search: {
+						size: 'small', // 设置查询按钮大小为small
+					},
+					reset: {
+						size: 'small', // 设置重置按钮大小为small
+					}
+				}
 			},
 			columns: {
 				/* _index: {
@@ -105,6 +134,8 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						component: {
 							placeholder: '请输入标签名称',
 						},
+						size: 'small',
+						col:{ span:3},
 					},
 					type: 'input',
 					column: {
@@ -120,6 +151,8 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					title: '分类',
 					search: {
 						show: true,
+						size: 'small',
+						col:{ span:3},
 					},
 					type: 'dict-select',
 					column: {
@@ -229,7 +262,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 				description: {
 					title: '描述',
 					search: {
-						show: true,
+						show: false,
 						component: {
 							placeholder: '请输入描述',
 						},

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

@@ -195,7 +195,14 @@ export const createCrudOptions = function ({ crudExpose, context }: CreateCrudOp
 					// 紧凑模式
 					compact:{show:false},
 					// 导出按钮
-					export:{},
+					export:{
+						text: '导出',
+						type: 'primary',
+						size: 'small',
+						icon: 'upload',
+						circle: false,
+						display: true
+					},
 					// 列设置按钮
 					columns:{
 						show:false

+ 47 - 6
src/views/questionBank/positionList/crud.tsx

@@ -46,6 +46,28 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 
 	return {
 		crudOptions: {
+			toolbar:{
+				buttons:{
+					search:{show:false},
+					// 刷新按钮
+					refresh:{show:false},
+					// 紧凑模式
+					compact:{show:false},
+					// 导出按钮
+					export:{
+						text: '导出',
+						type: 'primary',
+						size: 'small',
+						icon: 'upload',
+						circle: false,
+						display: true
+					},
+					// 列设置按钮
+					columns:{
+						show:false
+					},
+				}
+			},
 			request: {
 				pageRequest,
 				addRequest,
@@ -59,6 +81,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						show: true,
 						text: '新增职位问题',
 						icon: 'Plus',
+						size: 'small',
 						click: () => {
 							// 触发自定义事件,让父组件处理弹窗显示
 							const event = new CustomEvent('openPositionQuestionDialog');
@@ -69,9 +92,15 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 			},
 			search: {
 				show: true,
+				buttons: {
+					search: {
+						size: 'small', // 设置查询按钮大小为small
+					},
+					reset: {
+						size: 'small', // 设置重置按钮大小为small
+					}
+				},
 				onSearch: (params: any) => {
-					console.log('Search params:', params);
-					return params;
 				},
 				columns: {
 					category: {
@@ -153,7 +182,10 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 				},
 				position_id: {
 					title: '职位',
-					search: { show: true },
+					search: { show: true,
+						size: 'small',
+						col:{ span:3},
+					 },
 					type: 'dict-select',
 					dict:dict({
                         url({form}){
@@ -201,7 +233,10 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 			
 				question: {
 					title: '题目内容',
-					search: { show: true },
+					search: { show: true,
+						size: 'small',
+						col:{ span:3},
+					 },
 					column: {
 						
 						sortable: 'custom',
@@ -241,7 +276,10 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 				}, */
 				question_form: {
 					title: '题目形式',
-					search: { show: true },
+					search: { show: true,
+						size: 'small',
+						col:{ span:3},
+					 },
 					type: 'dict-select',
 					column: {
 						minWidth: 100,
@@ -324,7 +362,10 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 				}, */
 				difficulty: {
 					title: '难度等级',
-					search: { show: true },
+					search: { show: true,
+						size: 'small',
+						col:{ span:3},
+					 },
 					type: 'dict-select',
 					column: {
 						minWidth: 80,

+ 7 - 0
src/views/talent/list/api.ts

@@ -75,3 +75,10 @@ export function updateBatchStatus(data: any) {
 		data
 	});
 } */
+	export function getApplicationStatusSummary() {
+		return request({
+			url: '/api/system/job/application_status_summary/?tenant_id=1',
+			method: 'get',
+		});
+	}
+	

+ 40 - 0
src/views/talent/list/crud.tsx

@@ -193,6 +193,28 @@ export const createCrudOptions = function ({ crudExpose, context}: CreateCrudOpt
 
 	return {
 		crudOptions: {
+			toolbar:{
+				buttons:{
+					search:{show:false},
+					// 刷新按钮
+					refresh:{show:false},
+					// 紧凑模式
+					compact:{show:false},
+					// 导出按钮
+					export:{
+						text: '导出',
+						type: 'primary',
+						size: 'small',
+						icon: 'upload',
+						circle: false,
+						display: true
+					},
+					// 列设置按钮
+					columns:{
+						show:false
+					},
+				}
+			},
 			request: {
 				pageRequest,
 				addRequest,
@@ -280,6 +302,14 @@ export const createCrudOptions = function ({ crudExpose, context}: CreateCrudOpt
 			search: {
 				show: true,
 				layout: 'auto',
+				buttons: {
+					search: {
+						size: 'small', // 设置查询按钮大小为small
+					},
+					reset: {
+						size: 'small', // 设置重置按钮大小为small
+					}
+				},		
 				resetBtn: {
 					show: true,
 					click: () => {
@@ -330,6 +360,8 @@ export const createCrudOptions = function ({ crudExpose, context}: CreateCrudOpt
 						component: {
 							placeholder: '请输入姓名',
 						},
+						size: 'small',
+						col:{ span:3},
 					},
 					type: 'input',
 					column: {
@@ -346,6 +378,8 @@ export const createCrudOptions = function ({ crudExpose, context}: CreateCrudOpt
 						component: {
 							placeholder: '请输入电话',
 						},
+						size: 'small',
+						col:{ span:3},
 					},
 					type: 'input',
 					column: {
@@ -367,6 +401,8 @@ export const createCrudOptions = function ({ crudExpose, context}: CreateCrudOpt
 								{ value: '未知', label: '未知' },
 							]
 						},
+						size: 'small',
+						col:{ span:3},
 					},
 					type: 'input',
 					column: {
@@ -430,6 +466,8 @@ export const createCrudOptions = function ({ crudExpose, context}: CreateCrudOpt
 						component: {
 							placeholder: '请输入职位',
 						},
+						size: 'small',
+						col:{ span:3},
 					},
 					type: 'input',
 					column: {
@@ -452,6 +490,8 @@ export const createCrudOptions = function ({ crudExpose, context}: CreateCrudOpt
 								{ value: '已拒绝', label: '已拒绝' },
 							]
 						},
+						size: 'small',
+						col:{ span:3},
 					},
 					type: 'input',
 					column: {

+ 104 - 26
src/views/talent/list/index.vue

@@ -13,7 +13,7 @@
 					</div>
 					
 					<!-- 待安排 -->
-					<div class="tree-item" :class="{ active: activeNode === 'status-1' }" @click="handleNodeClick({ type: 'status', value: 1, id: 'status-1' })">
+					<div class="tree-item" :class="{ active: activeNode === 'status-1' }" @click="handleNodeClick({ type: 'status', value: 0, id: 'status-1' })">
 						<div class="item-content">
 							<el-icon><Clock /></el-icon>
 							<span>待面试</span>
@@ -90,6 +90,7 @@
 			</div>
 		</div>
 		<BatchTagsDialog ref="batchTagsDialogRef" :crudExpose="crudExpose" />
+		<!-- <BatchStatusDialog ref="batchStatusDialogRef" :crudExpose="crudExpose" @success="handleBatchStatusSuccess" /> -->
 	</fs-page>
 </template>
 
@@ -101,16 +102,24 @@ import { GetPermission } from './api';
 import { handleColumnPermission } from '/@/utils/columnPermission';
 import { Grid, Clock, ArrowRight, Check, RefreshRight, Briefcase } from '@element-plus/icons-vue';
 import BatchTagsDialog from './components/index.vue';
+/* import BatchStatusDialog from './components/BatchStatusDialog.vue'; */
+import { getApplicationStatusSummary } from './api';
+
 const { crudBinding, crudRef, crudExpose, crudOptions, resetCrudOptions } = useFs({ 
 	createCrudOptions,
 	context: {
 		openBatchTagsDialog: (selection: any) => {
 			batchTagsDialogRef.value.open(selection);
-		}
+		},
+		openBatchStatusDialog: (selection: any) => {
+			batchStatusDialogRef.value.open(selection);
+		},
+		selectedRows: [] // 存储选中的行
 	}
 });
 
 const batchTagsDialogRef = ref();
+const batchStatusDialogRef = ref();
 
 // 状态计数
 const totalCount = ref(0);
@@ -123,9 +132,69 @@ const statusCounts = reactive<Record<number, number>>({
 
 // 职位列表
 const showPositionList = ref(true);
-const positions = ref<Array<{id: number|string, title: string, count?: number}>>([
-	{ id: 1, title: '流水线操作工', count: 0 },
-]);
+const positions = ref<Array<{id: number|string, title: string, count?: number}>>([]);
+
+// 获取职位列表
+const fetchPositions = async () => {
+	try {
+		const res = await fetch(`${import.meta.env.VITE_API_URL}/api/system/job/list?page=1&limit=100&tenant_id=1`);
+		const data = await res.json();
+		
+		if (data.code === 2000 && data.data ) {
+			positions.value = data.data.map((item: any) => ({
+				id: item.id,
+				title: item.title || item.name || item.job_name,
+				count: 0
+			}));
+		} else {
+			console.error('获取职位列表失败:', data.msg || '未知错误');
+		}
+	} catch (error) {
+		console.error('获取职位列表异常:', error);
+		// 设置默认职位,以防接口失败
+		positions.value = [{ id: 1, title: '流水线操作工', count: 0 }];
+	}
+};
+
+// 获取申请状态统计数据
+const fetchStatusSummary = async () => {
+	try {
+		const res = await getApplicationStatusSummary();
+		const data = res;
+		console.log(data)
+		if (data.code === 2000 && data.data) {
+			totalCount.value = data.data.total || 0;
+			
+			// 更新状态计数
+			if (data.data.status_data && Array.isArray(data.data.status_data)) {
+				data.data.status_data.forEach((item: any) => {
+					// 注意:API返回的status可能与前端定义的不完全一致,需要映射
+					const statusMap: Record<number, number> = {
+						0: 1, // API中的0对应前端的1(待面试)
+						2: 2, // 已面试
+						3: 3, // 已录用
+						4: 4  // 已拒绝
+					};
+					
+					const frontendStatus = statusMap[item.status];
+					if (frontendStatus && frontendStatus in statusCounts) {
+						statusCounts[frontendStatus] = item.count;
+					}
+				});
+			} else {
+				// 如果没有status_data,则使用单独的字段
+				statusCounts[1] = data.data.pending || 0;
+				statusCounts[2] = data.data.interviewed || 0;
+				statusCounts[3] = data.data.hired || 0;
+				statusCounts[4] = data.data.rejected || 0;
+			}
+		} else {
+			console.error('获取申请状态统计失败:', data.message || '未知错误');
+		}
+	} catch (error) {
+		console.error('获取申请状态统计异常:', error);
+	}
+};
 
 // 切换职位列表显示
 const togglePositionList = () => {
@@ -140,14 +209,25 @@ const handleNodeClick = (data: any) => {
 	activeNode.value = data.id || 'all';
 	
 	if (data.type === 'all') {
-		// 清除所有筛选条件
-		crudExpose.getSearchRef().resetFields();
-		crudExpose.doRefresh();
+		try {
+			// 尝试重置表单,如果方法存在的话
+			const searchRef = crudExpose.getSearchRef();
+			if (searchRef && typeof searchRef.resetFields === 'function') {
+				searchRef.resetFields();
+			}
+		} catch (error) {
+			console.warn('重置表单失败:', error);
+		}
+		
+		// 无论如何都执行搜索,确保数据刷新
+		crudExpose.doSearch({
+			form: {}
+		});
 	} else if (data.type === 'status') {
 		// 按状态筛选
 		crudExpose.doSearch({
 			form: {
-				latest_status: data.value
+				status: data.value
 			}
 		});
 	} else if (data.type === 'position') {
@@ -164,21 +244,6 @@ const handleNodeClick = (data: any) => {
 const updateCounts = (data: any) => {
 	if (!data || !data.records) return;
 	
-	totalCount.value = data.total || 0;
-	
-	// 重置计数
-	Object.keys(statusCounts).forEach(key => {
-		statusCounts[Number(key)] = 0;
-	});
-	
-	// 统计各状态数量
-	data.records.forEach((record: any) => {
-		const status = record.status;
-		if (status && typeof status === 'number' && status in statusCounts) {
-			statusCounts[status]++;
-		}
-	});
-	
 	// 统计各职位数量
 	// 重置职位计数
 	positions.value.forEach(position => {
@@ -196,12 +261,25 @@ const updateCounts = (data: any) => {
 	});
 };
 
+// 处理批量状态修改成功
+const handleBatchStatusSuccess = () => {
+	// 刷新数据和状态统计
+	crudExpose.doRefresh();
+	fetchStatusSummary();
+};
+
 // 页面打开后获取列表数据
 onMounted(async () => {
+	// 获取职位列表
+	await fetchPositions();
+	
+	// 获取申请状态统计
+	await fetchStatusSummary();
+	
 	// 设置列权限
 	const newOptions = await handleColumnPermission(GetPermission, crudOptions);
 	
-	// 添加数据加载后的回调,用于更新计数
+	// 添加数据加载后的回调,用于更新职位计数
 	if (newOptions && newOptions.crudOptions && newOptions.crudOptions.request) {
 		const originalPageRequest = newOptions.crudOptions.request.pageRequest;
 		newOptions.crudOptions.request.pageRequest = async (query: any) => {
@@ -228,7 +306,7 @@ onMounted(async () => {
 .sidebar {
 	margin-top: 10px;
 	width: 200px;
-	margin-right: 16px;
+	margin-right: 5px;
 	flex-shrink: 0;
 	background-color: #fff;
 	border-right: 1px solid #ebeef5;