yangg 2 týždňov pred
rodič
commit
77c5f0377d

+ 1 - 1
src/theme/element.scss

@@ -366,7 +366,7 @@
 /* Table 表格样式增强
 ------------------------------- */
 .el-table {
-	font-size: 12px !important;
+	font-size: 14px !important;
 	/* 表头样式 */
 	th.el-table__cell {
 		background-color: #f5f7fa !important;

+ 14 - 5
src/views/system/allusers/crud.tsx

@@ -469,13 +469,16 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						show: true,
 						minWidth: 200,
 						formatter: ({ row, value }: { row: any; value: any }) => {
+							const isValidValue = (val: any) => {
+								return val !== null && val !== undefined && val !== '' && val !== 'nan' && !Number.isNaN(val);
+							};
 							// 如果有 organization_detail 对象,显示 parent_chain 的第二项(专业)
 							if(row.user_type !==0) {
 								if (row.organization_detail && row.organization_detail.name) {
 									return row.organization_detail.name;
 								}
 								// 否则显示原始值
-								return value || row.class_or_group;
+								return isValidValue(value) ? value : (isValidValue(row.class_or_group) ? row.class_or_group : '');
 							}else{
 								if (row.organization_detail && row.organization_detail.parent_chain && row.organization_detail.parent_chain.length >= 2) {
 								if(!row.organization_detail.parent_chain[1]) return
@@ -483,7 +486,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 								return major.name || major.code || '';
 							}
 							// 否则显示原始值
-							return value || row.sub_organization;
+							return isValidValue(value) ? value : (isValidValue(row.sub_organization) ? row.sub_organization : '');
 							}
 							
 						},
@@ -518,6 +521,9 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						show: true,
 						minWidth: 120,
 						formatter: ({ row, value }: { row: any; value: any }) => {
+							const isValidValue = (val: any) => {
+								return val !== null && val !== undefined && val !== '' && val !== 'nan' && !Number.isNaN(val);
+							};
 							// 如果有 organization_detail 对象,显示 parent_chain 的第二项(专业)
 							if (row.organization_detail && row.organization_detail.parent_chain && row.organization_detail.parent_chain.length >= 2) {
 								if(!row.organization_detail.parent_chain[2]) return
@@ -525,7 +531,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 								return major.name || major.code || '';
 							}
 							// 否则显示原始值
-							return value || row.sub_organization;
+							return isValidValue(value) ? value : (isValidValue(row.sub_organization) ? row.sub_organization : '');
 						},
 					},
 					form: {
@@ -541,7 +547,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					} */
 				},
                 grade_or_level:{
-					title: '级',
+					title: '级',
 					type: 'input',
 					search:{
 						show:false
@@ -550,6 +556,9 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						show: true,
 						minWidth: 120,
 						formatter: ({ row, value }: { row: any; value: any }) => {
+							const isValidValue = (val: any) => {
+								return val !== null && val !== undefined && val !== '' && val !== 'nan' && !Number.isNaN(val);
+							};
 							// 如果有 organization_detail 对象,显示 parent_chain 的第二项(专业)
 						/* 	if (row.organization_detail && row.organization_detail.parent_chain && row.organization_detail.parent_chain.length >= 2) {
 								if(!row.organization_detail.parent_chain[2]) return
@@ -563,7 +572,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 								return row.organization_detail.name;
 							}
 							// 否则显示原始值
-							return value || row.class_or_group;
+							return isValidValue(value) ? value : (isValidValue(row.class_or_group) ? row.class_or_group : '');
 						},
 					},
                     form: {

+ 1 - 1
src/views/system/allusers/index.vue

@@ -6,7 +6,7 @@
 				<el-button type="primary" @click="handleDownloadTemplate">下载模板</el-button>
 				<el-button type="primary" @click="handleBatchExport">批量导出</el-button>
 			</template>
-         <template #form_organization_ref="scope"><!-- :show-all-levels="false" -->
+         <template #form_organization_ref="scope"><!-- :show-all-levels="false" 1-->
             <template v-if="scope.form.user_type === 0">
               <div style="display:flex; gap:8px; width:100%">
                 <el-select

+ 1 - 1
src/views/system/devicedamage/crud.tsx

@@ -337,7 +337,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					},
 					viewForm:{
 						component: { placeholder: '' },
-						rules: [{ required: true, message: '' }],
+						rules: [{ required: false, message: '' }],
 					}
 				},
 				estimated_loss:{

+ 3 - 1
src/views/system/devicemaintenance/crud.tsx

@@ -498,6 +498,7 @@ export const createCrudOptions = function ({ crudExpose,  dialogId,
 						],
 					},
 					viewForm:{
+						show:true,
 						component: { placeholder: '' },
 						rules: [{ required: true, message: '' }],
 					}
@@ -561,7 +562,7 @@ export const createCrudOptions = function ({ crudExpose,  dialogId,
 					viewForm:{
 						show:true,
 						component: { placeholder: '' },
-						rules: [{ required: true, message: '' }],
+						rules: [{ required: false, message: '' }],
 					}
 				},
 				reporter_name:{
@@ -680,6 +681,7 @@ export const createCrudOptions = function ({ crudExpose,  dialogId,
 						rules: [{ required: true, message: '请填写维修结果' }],
 					},
 					viewForm:{
+					show:true,
 						component: { placeholder: '' },
 						rules: [{ required: true, message: '' }],
 					}

+ 61 - 43
src/views/system/studentInfo/crud.tsx

@@ -346,7 +346,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					}
 				}, */
 				organization_ref:{
-					title: '组织架构',
+					title: '学院',
 					type: "dict-cascader",
 					column: {
 						show: false,
@@ -419,26 +419,31 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					column: {
 						show: true,
 						minWidth: 200,
-						formatter: ({ row, value }: { row: any; value: any }) => {
-							// 根据用户类型显示不同内容
-							if(row.user_type !== 0) {
-								// 教师、学院领导:显示学院名称
-								if (row.organization_detail && row.organization_detail.name) {
-									return row.organization_detail.name;
-								}
-								// 否则显示原始值
-								return value || '';
-							} else {
-								// 学生:显示专业信息
-								if (row.organization_detail && row.organization_detail.parent_chain && row.organization_detail.parent_chain.length >= 2) {
-									if(!row.organization_detail.parent_chain[1]) return
-									const major = row.organization_detail.parent_chain[1]; // 第二项是专业
-									return major.name || major.code || '';
-								}
-								// 否则显示原始值
-								return value || row.sub_organization;
-							}
-						},
+				formatter: ({ row, value }: { row: any; value: any }) => {
+					// 检查值是否为无效值(包括 'nan' 字符串)
+					const isValidValue = (val: any) => {
+						return val !== null && val !== undefined && val !== '' && val !== 'nan' && !Number.isNaN(val);
+					};
+					
+					// 根据用户类型显示不同内容
+					if(row.user_type !== 0) {
+						// 教师、学院领导:显示学院名称
+						if (row.organization_detail && row.organization_detail.name) {
+							return row.organization_detail.name;
+						}
+						// 否则显示原始值
+						return isValidValue(value) ? value : '';
+					} else {
+						// 学生:显示专业信息
+						if (row.organization_detail && row.organization_detail.parent_chain && row.organization_detail.parent_chain.length >= 2) {
+							if(!row.organization_detail.parent_chain[1]) return '';
+							const major = row.organization_detail.parent_chain[1]; // 第二项是专业
+							return major.name || major.code || '';
+						}
+						// 否则显示原始值
+						return isValidValue(value) ? value : (isValidValue(row.sub_organization) ? row.sub_organization : '');
+					}
+				},
 						/* formatter: ({ row, value }: { row: any; value: any }) => {
 							// 如果有 organization_detail 对象,显示 full_path
 							if (row.organization_detail && row.organization_detail.full_path) {
@@ -472,16 +477,21 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 							return row && row.user_type === 0;
 						}),
 						minWidth: 120,
-						formatter: ({ row, value }: { row: any; value: any }) => {
-							// 如果有 organization_detail 对象,显示 parent_chain 的第二项(专业)
-							if (row.organization_detail && row.organization_detail.parent_chain && row.organization_detail.parent_chain.length >= 2) {
-								if(!row.organization_detail.parent_chain[2]) return
-								const major = row.organization_detail.parent_chain[2]; // 第二项是专业
-								return major.name || major.code || '';
-							}
-							// 否则显示原始值
-							return value || row.sub_organization;
-						},
+				formatter: ({ row, value }: { row: any; value: any }) => {
+					// 检查值是否为无效值(包括 'nan' 字符串)
+					const isValidValue = (val: any) => {
+						return val !== null && val !== undefined && val !== '' && val !== 'nan' && !Number.isNaN(val);
+					};
+					
+					// 如果有 organization_detail 对象,显示 parent_chain 的第二项(专业)
+					if (row.organization_detail && row.organization_detail.parent_chain && row.organization_detail.parent_chain.length >= 2) {
+						if(!row.organization_detail.parent_chain[2]) return '';
+						const major = row.organization_detail.parent_chain[2]; // 第二项是专业
+						return major.name || major.code || '';
+					}
+					// 否则显示原始值
+					return isValidValue(value) ? value : (isValidValue(row.sub_organization) ? row.sub_organization : '');
+				},
 					},
 					form: {
 						show: compute(({ form }) => {
@@ -496,7 +506,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					}
 				},
 				grade_or_level:{
-					title: '级',
+					title: '级',
 					type: 'input',
 					search:{
 						show:false
@@ -507,14 +517,19 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 							return row && row.user_type === 0;
 						}),
 						minWidth: 120,
-						formatter: ({ row, value }: { row: any; value: any }) => {
-							// 如果有 organization_detail 对象,显示 name
-							if (row.organization_detail && row.organization_detail.name) {
-								return row.organization_detail.name;
-							}
-							// 否则显示原始值
-							return value || row.class_or_group;
-						},
+				formatter: ({ row, value }: { row: any; value: any }) => {
+					// 检查值是否为无效值(包括 'nan' 字符串)
+					const isValidValue = (val: any) => {
+						return val !== null && val !== undefined && val !== '' && val !== 'nan' && !Number.isNaN(val);
+					};
+					
+					// 如果有 organization_detail 对象,显示 name
+					if (row.organization_detail && row.organization_detail.name) {
+						return row.organization_detail.name;
+					}
+					// 否则显示原始值
+					return isValidValue(value) ? value : (isValidValue(row.class_or_group) ? row.class_or_group : '');
+				},
 					},
 					form: {
 						show: compute(({ form }) => {
@@ -528,7 +543,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						component: { placeholder: '' },
 					}
 				},
-				class_or_group:{
+				/* class_or_group:{
 					title: '班级',
 					type: 'input',
 				search:{
@@ -541,12 +556,15 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						}),
 						minWidth: 120,
 						formatter: ({ row, value }: { row: any; value: any }) => {
+							const isValidValue = (val: any) => {
+								return val !== null && val !== undefined && val !== '' && val !== 'nan' && !Number.isNaN(val);
+							};
 							// 如果有 organization_detail 对象,显示 name
 							if (row.organization_detail && row.organization_detail.name) {
 								return row.organization_detail.name;
 							}
 							// 否则显示原始值
-							return value || row.class_or_group;
+							return isValidValue(value) ? value : (isValidValue(row.class_or_group) ? row.class_or_group : '');
 						},
 					},
 					form: {
@@ -557,7 +575,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					viewForm:{
 						component: { placeholder: '' },
 					}
-				},
+				}, */
 
 
 

+ 9 - 9
src/views/system/suppliermanage/crud.tsx

@@ -165,7 +165,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					},
 					viewForm:{
 						component: { placeholder: '' },
-						rules: [{ required: true, message: '' }],
+						rules: [{ required: false, message: '' }],
 					}
 				},
 				website: {
@@ -179,7 +179,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					},
 					viewForm:{
 						component: { placeholder: '' },
-						rules: [{ required: true, message: '' }],
+						rules: [{ required: false, message: '' }],
 					}
 				},
 				business_license: {
@@ -193,7 +193,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					},
 					viewForm:{
 						component: { placeholder: '' },
-						rules: [{ required: true, message: '' }],
+						rules: [{ required: false, message: '' }],
 					}
 				},
 				tax_number: {
@@ -207,7 +207,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					},
 					viewForm:{
 						component: { placeholder: '' },
-						rules: [{ required: true, message: '' }],
+						rules: [{ required: false, message: '' }],
 					}
 				},
 				bank_account: {
@@ -221,7 +221,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					},
 					viewForm:{
 						component: { placeholder: '' },
-						rules: [{ required: true, message: '' }],
+						rules: [{ required: false, message: '' }],
 					}
 				},
 				credit_rating: {
@@ -245,7 +245,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					},
 					viewForm:{
 						component: { placeholder: '' },
-						rules: [{ required: true, message: '' }],
+						rules: [{ required: false, message: '' }],
 					}
 				},
 				cooperation_years: {
@@ -259,7 +259,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					},
 					viewForm:{
 						component: { placeholder: '' },
-						rules: [{ required: true, message: '' }],
+						rules: [{ required: false, message: '' }],
 					}
 				},
 				remark: {
@@ -273,7 +273,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					},
 					viewForm:{
 						component: { placeholder: '' },
-						rules: [{ required: true, message: '' }],
+						rules: [{ required: false, message: '' }],
 					}
 				},
 				tenant_id:{
@@ -297,7 +297,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					},
 					viewForm:{
 						component: { placeholder: '' },
-						rules: [{ required: true, message: '' }],
+						rules: [{ required: false, message: '' }],
 					}
 				},	
 				create_datetime:{

+ 7 - 3
src/views/system/teacherInfor/crud.tsx

@@ -255,7 +255,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					title: '性别',
 					type: 'dict-select',
 					column: {
-						show: false,
+						show: true,
 						minWidth: 120,
 					},
 					dict: dict({
@@ -296,7 +296,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					},
 				},
 				organization_ref:{
-					title: '组织架构',
+					title: '学院',
 					type: "dict-cascader",
 					column: {
 						show: false,
@@ -326,12 +326,16 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						show: true,
 						minWidth: 200,
 						formatter: ({ row, value }: { row: any; value: any }) => {
+							// 检查值是否为无效值(包括 'nan' 字符串)
+							const isValidValue = (val: any) => {
+								return val !== null && val !== undefined && val !== '' && val !== 'nan' && !Number.isNaN(val);
+							};
 							// 教师、学院领导:显示学院名称
 							if (row.organization_detail && row.organization_detail.name) {
 								return row.organization_detail.name;
 							}
 							// 否则显示原始值
-							return value || '';
+						return isValidValue(value) ? value : '';
 						},
 					},
 					form: {