瀏覽代碼

修改部分bug

yangg 1 周之前
父節點
當前提交
4629cde450

+ 13 - 2
src/components/avatarSelector/index.vue

@@ -51,6 +51,7 @@ import { useUserInfo } from '/@/stores/userInfo';
 import { getCurrentInstance, nextTick, reactive, ref, computed, onMounted, defineExpose } from 'vue';
 import { base64ToFile } from '/@/utils/tools';
 const userStore = useUserInfo();
+import { ElMessage, ElMessageBox, ElDrawer } from 'element-plus';
 const { proxy } = getCurrentInstance();
 
 const open = ref(false);
@@ -109,10 +110,19 @@ function changeScale(num) {
 	num = num || 1;
 	proxy.$refs.cropper.changeScale(num);
 }
+/** 检查文件是否为图片 */
+function isImageFile(fileName) {
+  const allowedExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.bmp', '.webp'];
+  const extension = fileName.toLowerCase().substring(fileName.lastIndexOf('.'));
+  return allowedExtensions.includes(extension);
+}
+
 /** 上传预处理 */
 function beforeUpload(file) {
-	if (file.type.indexOf('image/') == -1) {
-		proxy.$modal.msgError('文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。');
+	console.log(isImageFile(file.name))
+	if (!isImageFile(file.name)) {
+		ElMessage.error('文件格式错误,请上传图片类型,如:JPG,PNG等后缀的文件。');
+		return false;
 	} else {
 		const reader = new FileReader();
 		reader.readAsDataURL(file);
@@ -120,6 +130,7 @@ function beforeUpload(file) {
 			options.img = reader.result;
 			options.fileName = file.name;
 		};
+		return true;
 	}
 }
 /** 上传图片 */

+ 4 - 2
src/settings.ts

@@ -81,8 +81,10 @@ export default {
                     form: {
                         afterSubmit(ctx: any) {
                             // 增加crud提示
-                            if (ctx.res.code == 2000) {
-                                successNotification(ctx.res.msg || '操作成功');
+                            if (ctx.mode !== 'view') {  // 只在非查看模式下显示提示
+                                if (ctx.res.code == 2000) {
+                                    successNotification(ctx.res.msg || '操作成功');
+                                }
                             }
                         },
                     },

+ 1 - 1
src/views/digitalHuman/list/crud.tsx

@@ -194,6 +194,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 			search: {
 				show: true,
 				layout: 'auto',
+				autoSearch:false,
 				buttons: {
 					search: {
 						size: 'small', // 设置查询按钮大小为small
@@ -357,7 +358,6 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					search: {
 						show: true,
 						component: {
-							name: 'el-select',
 							placeholder: '请选择状态',
 						},
 						size: 'small',

+ 10 - 7
src/views/digitalHuman/list/index.vue

@@ -67,8 +67,8 @@
 							{{ formData.status === 1 ? '启用' : '禁用' }}
 						</el-tag>
 					</el-descriptions-item>
-					<el-descriptions-item label="语音ID">
-						{{ getVoiceName(formData.config.voice_type) }}
+					<el-descriptions-item label="语音">
+						{{ formData.voice_type_display }}<!-- getVoiceName() -->
 					</el-descriptions-item>
 					<el-descriptions-item label="风格">
 						{{ getStyleName(formData.config.style) }}
@@ -98,7 +98,7 @@
 							<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
 						</el-upload>
 					</el-form-item>
-					<el-form-item label="模板视频" prop="template_video_url">
+					<el-form-item label="模板视频" prop="template_video_url" :rules="[{ required: true, message: '请上传模板视频', trigger: 'change' }]">
 						<el-upload
 							class="video-uploader"
 							:action="`${apiBaseUrl}/api/system/admin_upload/`"
@@ -284,16 +284,18 @@ const handleVideoSuccess = (res: any, file: any) => {
 
 // 视频上传前验证
 const beforeVideoUpload = (file: any) => {
-	const isVideo = file.type.startsWith('video/');
+	const isMp4 = file.type === 'video/mp4';
 	const isLt50M = file.size / 1024 / 1024 < 50;
 
-	if (!isVideo) {
-		ElMessage.error('请上传视频格式文件!');
+	if (!isMp4) {
+		ElMessage.error('请上传MP4格式的视频文件!');
+		return false;
 	}
 	if (!isLt50M) {
 		ElMessage.error('上传视频大小不能超过 50MB!');
+		return false;
 	}
-	return isVideo && isLt50M;
+	return true;
 };
 
 // 提交表单
@@ -445,6 +447,7 @@ const getStyleName = (style: string) => {
 
 /* 移除侧边栏相关样式,添加弹窗相关样式 */
 .avatar-uploader {
+	height: 100px;
 	text-align: center;
 	border: 1px dashed #d9d9d9;
 	border-radius: 6px;

+ 10 - 5
src/views/position/create/index.vue

@@ -111,19 +111,21 @@
               <el-option label="日薪" value="日薪" />
               <el-option label="时薪" value="时薪" />
             </el-select>
-            <el-input 
+            <el-input-number
               v-model="formData.start_salary" 
               placeholder="起始薪资" 
               class="salary-input"
               type="number"
+              controls-position="right"
               min="0"
               @input="updateSalaryRange"
             />
             <span class="salary-separator">-</span>
-            <el-input 
+            <el-input-number
               v-model="formData.end_salary" 
               placeholder="最高薪资" 
               class="salary-input"
+              controls-position="right"
               type="number"
               min="0"
               @input="updateSalaryRange"
@@ -729,12 +731,14 @@ const submitForm = async () => {
 }
 
 .salary-type-select {
-  width: 100px;
+  width: 100%;
+  min-width: 120px;
   margin-right: 10px;
 }
 
 .salary-input {
-  width: 120px;
+  width: 100%;
+  min-width: 90px;
 }
 
 .salary-separator {
@@ -747,6 +751,7 @@ const submitForm = async () => {
 }
 
 .condition-select {
-  width: 200px;
+  width: 100%;
+  min-width: 150px;
 }
 </style> 

+ 2 - 2
src/views/position/list/crud.tsx

@@ -257,9 +257,9 @@ export const createCrudOptions = function ({ crudExpose, context }: CreateCrudOp
 						sortable: 'custom',
 					},
 					form: {
-						rules: [{ required: true, message: '角色名称必填' }],
+						rules: [{ required: true, message: '职位名称必填' }],
 						component: {
-							placeholder: '请输入角色名称',
+							placeholder: '请输入职位名称',
 						},
 					},
 				},

+ 3 - 0
src/views/questionBank/list/components/treeList.vue

@@ -144,12 +144,15 @@
     flex: 1;
     min-width: 0;
     position: relative;
+    width: 100%;
     
     .ml-2 {
       overflow: hidden;
       white-space: nowrap;
       text-overflow: ellipsis;
       flex: 1;
+      width: 135px; /* 减去图标的宽度 */
+      display: inline-block;
     }
   }
   

+ 1 - 1
src/views/questionBank/list/index.vue

@@ -228,7 +228,7 @@ const getTreeData = () => {
 	GetDocumentTree({}).then((ret: any) => {
 		console.log('ret', ret);
 		const responseData = ret.data;
-		GetCategoryList({}).then((res: any) => {
+		GetCategoryList({page:1,limit:50}).then((res: any) => {
 			console.log('res', res);
 			const categoryList = res.data.items.filter((item: any) => 
 				!['技术能力', '服务意识', '职业素质','基本常识','色盲检测','内容铺垫','心理测试','心理测试1'].includes(item.name)

+ 4 - 3
src/views/system/home/index.vue

@@ -74,7 +74,7 @@
 									v-for="position in positions" 
 									:key="position.id" 
 									:label="position.title" 
-									:value="position.id" 
+									:value="position.title" 
 								/>
 							</el-select>
 							<el-select 
@@ -848,7 +848,8 @@ export default defineComponent({
 			
 			// 职位筛选
 			if (state.selectedPosition !== '') {
-				params.position_id = state.selectedPosition;
+				console.log(state.selectedPosition)
+				params.position_title = state.selectedPosition;
 			}
 			
 			// 时间筛选
@@ -859,7 +860,7 @@ export default defineComponent({
 					params.date_to = timeFilter.to;
 				}
 			}
-			
+			console.log(params)
 			fetchCandidates(params);
 		};
 		

+ 5 - 0
src/views/system/personal/index.vue

@@ -333,6 +333,11 @@ const passwordRules = reactive({
 const settingPassword = () => {
 	userPasswordFormRef.value.validate((valid) => {
 		if (valid) {
+			/* console.log(userPasswordInfo)
+			return */
+			/* userPasswordInfo.oldPassword = Md5.hashStr(userPasswordInfo.oldPassword); */
+			userPasswordInfo.newPassword = Md5.hashStr(userPasswordInfo.newPassword);
+			userPasswordInfo.newPassword2 = Md5.hashStr(userPasswordInfo.newPassword2);
 			api.UpdatePassword(userPasswordInfo).then((res: any) => {
 				ElMessage.success('密码修改成功');
         setTimeout(() => {

+ 5 - 6
src/views/talent/list/crud.tsx

@@ -107,11 +107,7 @@ export const createCrudOptions = function ({ crudExpose, context}: CreateCrudOpt
 									createVNode(ElDescriptionsItem, { label: '是否有子女' }, { default: () => profile?.has_children !== undefined ? (profile.has_children ? '是' : '否') : '未填写' }),
 									createVNode(ElDescriptionsItem, { label: '期望薪资' }, { default: () => profile?.expected_salary || '未填写' }),
 									createVNode(ElDescriptionsItem, { label: '紧急联系人' }, { default: () => profile?.emergency_contact || '未填写' }),
-									createVNode(ElDescriptionsItem, { label: '紧急联系电话' }, { default: () => profile?.emergency_phone || '未填写' }),
-									createVNode(ElDescriptionsItem, { label: '特长' }, { default: () => profile?.specialties || '未填写' }),
-									createVNode(ElDescriptionsItem, { label: '人生格言' }, { default: () => profile?.life_motto || '未填写' }),
-									createVNode(ElDescriptionsItem, { label: '招聘来源' }, { default: () => profile?.recruitment_source_name || '未填写' }),
-									createVNode(ElDescriptionsItem, { label: '招聘来源详情' }, { default: () => profile?.recruitment_source_detail || '未填写' }),
+									createVNode(ElDescriptionsItem, { label: '紧急联系电话' }, { default: () => profile?.emergency_phone || '未填写' })
 								]
 							})
 						}),
@@ -269,7 +265,9 @@ export const createCrudOptions = function ({ crudExpose, context}: CreateCrudOpt
 						iconRight: 'User',
 						show: true,
 						type: 'text',
-						
+						click: ({ row }) => {
+							showUserProfileDialog(row.user.id);
+						}
 					},
 					profile: { // 添加查看个人信息按钮
 						text: '查看报告',
@@ -314,6 +312,7 @@ export const createCrudOptions = function ({ crudExpose, context}: CreateCrudOpt
 			search: {
 				show: true,
 				layout: 'auto',
+				autoSearch:false,
 				buttons: {
 					search: {
 						size: 'small', // 设置查询按钮大小为small

+ 1 - 0
src/views/talent/list/index.vue

@@ -397,6 +397,7 @@ onMounted(async () => {
 }
 
 .sidebar {
+	overflow: auto;
 	margin-top: 10px;
 	width: 200px;
 	margin-right: 5px;

+ 7 - 3
src/views/talent/overseas/components/BatchStatusDialog.vue

@@ -9,8 +9,8 @@
     <el-form :model="form" label-width="100px">
       <el-form-item label="选择状态">
         <el-select v-model="form.status" placeholder="请选择状态" style="width: 100%">
-          <el-option label="状态6" :value="6" />
-          <el-option label="状态7" :value="7" />
+          <el-option label="曾就职" :value="6" />
+          <el-option label="转入在外人才库" :value="7" />
           <el-option label="待面试" :value="0" />
           <el-option label="已面试" :value="1" />
           <el-option label="已录用" :value="2" />
@@ -62,10 +62,14 @@ const handleConfirm = async () => {
   loading.value = true;
   try {
     // 这里需要替换为实际的API调用
-    const response = await axios.post(`${import.meta.env.VITE_API_URL}/api/talent/batch-update-status`, {
+    const response = await axios.post(`${import.meta.env.VITE_API_URL}/api/system/talent_pool/batch-update-status/`, {
       ids: selectedRows.value.map(row => row.id),
       status: form.status,
       tenant_id: Session.get('tenant_id')
+    },{
+      headers:{
+        'authorization':'JWT '+ Session.get('token'),
+      },
     });
 
     if (response.data.code === 2000) {

+ 21 - 5
src/views/talent/overseas/components/BatchTagsDialog.vue

@@ -41,7 +41,16 @@
 import { ref, reactive, onMounted } from 'vue';
 import { successMessage, warningMessage } from '/@/utils/message';
 import axios from 'axios';
+import { request } from '/@/utils/service';
 import { Session } from '/@/utils/storage';
+import { updateBatchTags } from '../api';
+
+const props = defineProps({
+  crudExpose: {
+    type: Object,
+    required: true
+  }
+});
 
 const dialogVisible = ref(false);
 const loading = ref(false);
@@ -57,20 +66,22 @@ const emit = defineEmits(['success']);
 // 获取标签列表
 const getTagList = async () => {
   try {
-    // 这里需要替换为实际的API调用
-    const response = await axios.get(`${import.meta.env.VITE_API_URL}/api/system/talent_tag/`, {
+    const response = await request({
+      url: '/api/system/talent_tag/',
+      method: 'get',
       params: {
         tenant_id: Session.get('tenant_id')
       }
     });
-    if (response.data.code === 2000) {
-      tagOptions.value = response.data.data.map((tag: any) => ({
+    if (response.code === 2000) {
+      tagOptions.value = response.data.map((tag: any) => ({
         value: tag.id,
         label: tag.name
       }));
     }
   } catch (error) {
     console.error('获取标签列表失败:', error);
+    warningMessage('获取标签列表失败');
   }
 };
 
@@ -91,16 +102,21 @@ const handleConfirm = async () => {
   loading.value = true;
   try {
     // 这里需要替换为实际的API调用
-    const response = await axios.post(`${import.meta.env.VITE_API_URL}/api/talent/batch-add-tags`, {
+    const response = await axios.post(`${import.meta.env.VITE_API_URL}/api/system/talent_pool/batch-bind-tags/`, {
       ids: selectedRows.value.map(row => row.id),
       tag_ids: form.tags,
       tenant_id: Session.get('tenant_id')
+    },{
+      headers:{
+        'authorization':'JWT '+ Session.get('token'),
+      },
     });
 
     if (response.data.code === 2000) {
       successMessage('标签添加成功');
       dialogVisible.value = false;
       emit('success');
+      props.crudExpose.doRefresh();
     } else {
       warningMessage(response.data.message || '操作失败');
     }

+ 11 - 7
src/views/talent/overseas/crud.tsx

@@ -14,7 +14,10 @@ export const createCrudOptions = function ({ crudExpose, context}: CreateCrudOpt
 	const router = useRouter();
 	
 	const pageRequest = async (query: UserPageQuery) => {
-		console.log(query);
+		console.log(query.status);
+		if(query.status==undefined){
+			query.status='6,7'
+		}
 		return await api.GetList(query);
 	};
 	const editRequest = async ({ form, row }: EditReq) => {
@@ -108,10 +111,6 @@ export const createCrudOptions = function ({ crudExpose, context}: CreateCrudOpt
 									createVNode(ElDescriptionsItem, { label: '期望薪资' }, { default: () => profile?.expected_salary || '未填写' }),
 									createVNode(ElDescriptionsItem, { label: '紧急联系人' }, { default: () => profile?.emergency_contact || '未填写' }),
 									createVNode(ElDescriptionsItem, { label: '紧急联系电话' }, { default: () => profile?.emergency_phone || '未填写' }),
-									createVNode(ElDescriptionsItem, { label: '特长' }, { default: () => profile?.specialties || '未填写' }),
-									createVNode(ElDescriptionsItem, { label: '人生格言' }, { default: () => profile?.life_motto || '未填写' }),
-									createVNode(ElDescriptionsItem, { label: '招聘来源' }, { default: () => profile?.recruitment_source_name || '未填写' }),
-									createVNode(ElDescriptionsItem, { label: '招聘来源详情' }, { default: () => profile?.recruitment_source_detail || '未填写' }),
 								]
 							})
 						}),
@@ -269,6 +268,9 @@ export const createCrudOptions = function ({ crudExpose, context}: CreateCrudOpt
 						iconRight: 'User',
 						show: true,
 						type: 'text',
+						click: ({ row }) => {
+							showUserProfileDialog(row.user.id);
+						}
 						
 					},
 					profile: { // 添加查看个人信息按钮
@@ -314,6 +316,7 @@ export const createCrudOptions = function ({ crudExpose, context}: CreateCrudOpt
 			search: {
 				show: true,
 				layout: 'auto',
+				autoSearch:false,
 				buttons: {
 					search: {
 						size: 'small', // 设置查询按钮大小为small
@@ -622,11 +625,12 @@ export const createCrudOptions = function ({ crudExpose, context}: CreateCrudOpt
 					type: 'dict-select',
 					dict: dict({
 						data: [
-							{ value: 1, label: '试用期' },
+							/* { value: 1, label: '试用期' },
 							{ value: 2, label: '考察期' },
 							{ value: 3, label: '在职' },
 							{ value: 4, label: '已离职' },
-							{ value: 5, label: '在职已盘点' },
+							{ value: 5, label: '在职已盘点' }, */
+							{ value: 6, label: '曾就职' },
 							{ value: 7, label: '转入在外人才库' },
 						
 						]

+ 6 - 5
src/views/talent/overseas/index.vue

@@ -12,17 +12,15 @@
 							<ArrowRight />
 						</el-icon>
 					</div>
-					
+					<!-- 全部职位 -->
 					<!-- 职位列表 -->
 					<div v-if="showPositionList" class="position-list">
-						<!-- 全部职位 -->
+						
 						<div class="tree-item" :class="{ active: activeNode === 'position-all' }" @click="handleNodeClick({ type: 'all', id: 'position-all' })">
 							<div class="item-content">
 								<span>全部</span>
 							</div>
 						</div>
-						
-						<!-- 职位列表项 -->
 						<div 
 							v-for="position in positions" 
 							:key="'position-' + position.id" 
@@ -214,7 +212,9 @@ const handleNodeClick = (data: any) => {
 		}
 		
 		crudExpose.doSearch({
-			form: {}
+			form: {
+				status:'6,7'
+			}
 		});
 	} else if (data.type === 'status') {
 		crudExpose.doSearch({
@@ -295,6 +295,7 @@ onMounted(async () => {
 }
 
 .sidebar {
+	overflow: auto;
 	margin-top: 10px;
 	width: 200px;
 	margin-right: 5px;

+ 21 - 0
src/views/talent/tagsList/crud.tsx

@@ -37,6 +37,14 @@ export const createCrudOptions = function ({crudExpose}: CreateCrudOptionsProps)
                 editRequest,
                 delRequest,
             },
+            view: {
+                // 配置查看操作的对话框
+                dialog: {
+                  footer: false, // 直接隐藏整个底部区域
+                  // 或自定义底部插槽(二选一)
+                  footerBuild: () => null // 返回 null 不渲染底部
+                }
+              },
             actionbar: {
                 buttons: {
                     add: {
@@ -47,6 +55,19 @@ export const createCrudOptions = function ({crudExpose}: CreateCrudOptionsProps)
                     }
                 }
             },
+            search: {
+				show: true,
+				layout: 'auto',
+				autoSearch:false,
+				buttons: {
+					search: {
+						size: 'small', // 设置查询按钮大小为small
+					},
+					reset: {
+						size: 'small', // 设置重置按钮大小为small
+					}
+				},		
+            },
             rowHandle: {
                 fixed: 'right',
                 width: 260,

+ 11 - 1
src/views/talent/tagsList/index.vue

@@ -1,6 +1,16 @@
 <template>
     <fs-page>
-        <fs-crud ref="crudRef" v-bind="crudBinding"></fs-crud>
+        <fs-crud ref="crudRef" v-bind="crudBinding">
+             <!-- 自定义查看对话框底部 -->
+                <template #view-dialog-footer="{ dialog }">
+                <div v-if="dialog.type !== 'view'">
+                    <!-- 仅非查看模式显示默认按钮 -->
+                    <el-button @click="dialog.close">取消</el-button>
+                    <el-button type="primary" @click="dialog.submit">确定</el-button>
+                </div>
+                <!-- 查看模式不显示任何按钮 -->
+                </template>
+        </fs-crud>
     </fs-page>
 </template>