yangg 1 天之前
父節點
當前提交
fc54e756b6

二進制
src/assets/tes.png


+ 1 - 1
src/theme/element.scss

@@ -17,7 +17,7 @@
 	margin-right: 5px;
 }
 .el-tag{
-	font-size: 10px !important;
+	font-size: 12px !important;
 }
 
 /* Input 输入框、InputNumber 计数器

+ 1 - 1
src/views/system/borrow/approval/SpecialBorrowApp/index.vue

@@ -108,7 +108,7 @@
 					</template>
 				</el-table-column>
 			</el-table>
-			<el-button type="primary" @click="addItem" v-if="!isView">添加设备</el-button>
+			<el-button type="primary" @click="addItem" v-if="!isView">选择设备分类</el-button>
 			<div style="margin: 16px 0 8px 0; font-weight: bold">配件信息</div>
 			<el-input v-model="form.accessories" placeholder="请输入配件信息"  :disabled="isView"/>
 

+ 2 - 2
src/views/system/borrow/component/BorrowTypeSelect/index.vue

@@ -8,7 +8,7 @@
 			</ol>
 			<div style="display: flex; justify-content: space-around; margin: 20px 0">
 				<div v-for="item in types" :key="item.value" @click="select(item.value)" style="cursor: pointer; text-align: center">
-					<img :src="getImage(item.value)" style="width: 80px; height: 80px;" />
+					<img :src="getImage(item.value)" style="width: 90px; height: 90px;" />
 					<el-button type="primary" style="margin-top: 8px; font-weight: bold" v-if="item.label !== '特殊借用'">{{ item.label }}</el-button>
 					<el-button type="danger" plain style="margin-top: 8px; font-weight: bold" v-else>{{ item.label }}</el-button>
 				</div>
@@ -26,7 +26,7 @@ const props = defineProps<{ visible: boolean }>();
 const emit = defineEmits(['update:visible', 'select']);
 const visible = ref(props.visible);
 import classroomImg from '/@/assets/classroom.png';
-import specialImg from '/@/assets/special.png';
+import specialImg from '/@/assets/tes.png';
 
 watch(
 	() => props.visible,

+ 1 - 1
src/views/system/borrow/component/CollectEquipment/index.vue

@@ -118,7 +118,7 @@
                             </template>
                         </el-table-column>
                     </el-table>
-                    <el-button type="primary" @click="addItem" v-if="!isView" :disabled="true">添加设备</el-button>
+                    <el-button type="primary" @click="addItem" v-if="!isView" :disabled="true">选择设备分类</el-button>
                     <div style="margin: 16px 0 8px 0; font-weight: bold">配件信息</div>
                     <el-input v-model="form.accessories" :placeholder="isView?'':'请输入配件信息'"  :disabled="true"/>
 

+ 1 - 1
src/views/system/borrow/component/CommonBorrow/index.vue

@@ -112,7 +112,7 @@
 					</template>
 				</el-table-column>
 			</el-table>
-			<el-button type="primary" @click="addItem">添加设备</el-button>
+			<el-button type="primary" @click="addItem">选择设备分类</el-button>
 			<div style="margin: 16px 0 8px 0; font-weight: bold">配件信息</div>
 			<el-input v-model="form.accessories" placeholder="请输入配件信息" />
 			<div style="margin: 16px 0 8px 0; font-weight: bold">附件</div>

+ 1 - 1
src/views/system/borrow/component/SpecialBorrow/index.vue

@@ -108,7 +108,7 @@
 					</template>
 				</el-table-column>
 			</el-table>
-			<el-button type="primary" @click="addItem" v-if="!isView">添加设备</el-button>
+			<el-button type="primary" @click="addItem" v-if="!isView">选择设备分类</el-button>
 			<div style="margin: 16px 0 8px 0; font-weight: bold">配件信息</div>
 			<el-input v-model="form.accessories" placeholder="请输入配件信息"  :disabled="isView"/>
 

+ 52 - 1
src/views/system/borrow/crud.tsx

@@ -180,7 +180,58 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					title: '创建时间',
 					column: { minWidth: 160, sortable: true,formatter: ({ value }: any) => (value ? dayjs(value).format('YYYY-MM-DD HH:mm:ss') : '') },
 				},
-				status_label: { title: '当前状态', column: { minWidth: 100, sortable: true} },
+				status_label: { 
+				title: '当前状态', 
+				column: { 
+					minWidth: 100, 
+					sortable: true,
+					cellRender: ({ value }: any) => {
+						// 根据状态值返回不同颜色的标签
+						const getStatusConfig = (status: string) => {
+							switch (status) {
+								case '待审批':
+									return { color: '#909399', bgColor: '#f4f4f5' }
+								case '已批准':
+									return { color: '#67c23a', bgColor: '#f0f9ff' }
+								case '已拒绝':
+									return { color: '#f56c6c', bgColor: '#fef0f0' }
+								case '已取消':
+									return { color: '#909399', bgColor: '#f4f4f5' }
+								case '已借出':
+									return { color: '#409eff', bgColor: '#ecf5ff' }
+								case '已归还':
+									return { color: '#67c23a', bgColor: '#f0f9ff' }
+								case '已逾期':
+									return { color: '#e6a23c', bgColor: '#fdf6ec' }
+								case '续借待审批':
+									return { color: '#909399', bgColor: '#f4f4f5' }
+								default:
+									return { color: '#606266', bgColor: '#f5f7fa' }
+							}
+						}
+						
+						const config = getStatusConfig(value)
+						
+						return (
+							<span 
+								style={{
+									color: config.color,
+									backgroundColor: config.bgColor,
+									padding: '4px',
+									borderRadius: '4px',
+									fontSize: '12px',
+									
+									display: 'inline-block',
+									minWidth: '60px',
+									textAlign: 'center'
+								}}
+							>
+								{value || '-'}
+							</span>
+						)
+					}
+				} 
+			},
 				actual_start_time: {
 					title: '借出时间',
 					column: { minWidth: 140,sortable: true, formatter: ({ value }: any) => (value ? dayjs(value).format('YYYY-MM-DD HH:mm:ss') : '') },

+ 2 - 2
src/views/system/deviceclass/crud.tsx

@@ -93,7 +93,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					}
 				},
 				name: {
-					title: '名称',
+					title: '分类名称',
 					search: {
 						show: true,
 					},
@@ -120,7 +120,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					title: '设备描述',
 					type: 'input',
 					column: {
-						minWidth: 120,
+						width: 900,
 					},
 					form: {
 						component: { placeholder: '请填写设备描述' },

+ 4 - 4
src/views/system/devicelabel/crud.tsx

@@ -76,14 +76,14 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					},
 				},
 				name: {
-					title: '名称',
+					title: '标签名称',
 					search: {
 						show: true,
 					},
 					treeNode: true,
 					type: 'input',
 					column: {
-						minWidth: 120,
+						Width: 200,
 					},
 					form: {
 						rules: [
@@ -104,7 +104,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					type: 'input',
 					column: {
 						show:false,
-						minWidth: 120,
+						Width: 220,
 					},
 					form: {
 						value:'#FF5722',
@@ -121,7 +121,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					title: '标签描述',
 					type: 'input',
 					column: {
-						minWidth: 120,
+						width: 1000,
 					},
 					form: {
 						component: { placeholder: '请填写标签描述' },

+ 7 - 0
src/views/system/studentInfo/api.ts

@@ -45,3 +45,10 @@ export function GetPermission() {
         method: 'get',
     });
 }
+
+export function GetTree() {
+	return request({
+		url: `/api/system/organization/tree/`,
+		method: 'get',
+	});
+}

+ 55 - 1
src/views/system/studentInfo/crud.tsx

@@ -136,7 +136,33 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					},
 					form: {
 						component: { placeholder: '请填写密码' },
-						rules: [{ required: true, message: '请填写密码' }],
+						rules: [
+							{ required: true, message: '请填写密码' },
+							{
+								validator: (rule: any, value: string, callback: Function) => {
+									if (!value) {
+										callback();
+										return;
+									}
+									// 检查密码长度不少于8位
+									if (value.length < 8) {
+										callback(new Error('密码长度不能少于8位'));
+										return;
+									}
+									// 检查是否包含字母
+									const hasLetter = /[a-zA-Z]/.test(value);
+									// 检查是否包含数字
+									const hasNumber = /[0-9]/.test(value);
+									
+									if (!hasLetter || !hasNumber) {
+										callback(new Error('密码必须包含字母和数字'));
+										return;
+									}
+									callback();
+								},
+								trigger: 'blur'
+							}
+						],
 					},
 					editForm:{
 						show:false,
@@ -145,6 +171,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						show:false,
 					}
 				},
+
 				email:{
 					title: '邮箱',
 					type: 'input',
@@ -228,6 +255,33 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						component: { placeholder: '' },
 					}
 				},
+				organization_ref:{
+					title: '组织架构',
+					type: "dict-cascader",
+					/* dict: dict({
+						isTree: true,
+						url: "/api/system/organization/tree/",
+						value: 'id',
+						label: 'name'
+					}),
+					form: {
+						component: {
+							filterable: true,
+							clearable: true,
+							placeholder: '请选择组织架构',
+							// props下配置属性跟配置在component下是一样的效果,而el-cascade下也有一个叫props的属性,所以需要配置两层
+							props: { 
+								props: { 
+									checkStrictly: true,
+									value: 'id',
+									label: 'name',
+									children: 'children'
+								} 
+							}
+						},
+						rules: [{ required: false, message: '请选择组织架构' }]
+					} */
+				},
 				sub_organization:{
 					title: '专业',
 					type: 'input',

+ 42 - 3
src/views/system/studentInfo/index.vue

@@ -1,20 +1,59 @@
 <template>
 	<fs-page>
-		<fs-crud ref="crudRef" v-bind="crudBinding"> </fs-crud>
+		<fs-crud ref="crudRef" v-bind="crudBinding">
+			 <template #form_organization_ref="scope">
+				
+				<el-cascader :disabled="scope.mode=='view'" v-model="scope.form.organization_ref" :options="options" :props="props1" :show-all-levels="false" />
+			 </template>
+		</fs-crud>
 	</fs-page>
 </template>
 
 <script lang="ts" setup name="studentInfo">
 import { useFs } from '@fast-crud/fast-crud';
-import { onMounted } from 'vue';
-import { GetPermission } from './api';
+import { onMounted,ref } from 'vue';
+import { GetPermission,GetTree } from './api';
 import { createCrudOptions } from './crud';
 import { handleColumnPermission } from '/@/utils/columnPermission';
 
 const { crudBinding, crudRef, crudExpose, crudOptions, resetCrudOptions } = useFs({ createCrudOptions });
 
+const options=ref<any[]>([])
+const props1 = {
+  checkStrictly: true,
+  label: 'name',
+  value: 'id',
+  children: 'children',
+  emitPath: false // 只返回选中节点的值,不返回完整路径
+}
+
+const init=()=>{
+	GetTree().then((res:any) => { 
+			console.log('组织架构API响应:', res);
+		// 兼容多种响应格式
+		if(res && (res.code === 200 || res.code === 2000 || !res.code)){
+			// 尝试多种数据结构
+			const data = res.data || res.results || res;
+			if (Array.isArray(data)) {
+				options.value = data;
+				console.log('成功赋值组织架构数据:', options.value);
+			} else {
+				console.warn('返回的数据不是数组格式:', data);
+				options.value = [];
+			}
+		} else {
+			console.error('获取组织架构数据失败:', res);
+			options.value = [];
+		}
+	}).catch((error: any) => {
+		console.error('请求组织架构数据失败:', error);
+		options.value = [];
+	});
+}
+
 // 页面打开后获取列表数据
 onMounted(async () => {
+	init()
 	// 设置列权限
 	const newOptions = await handleColumnPermission(GetPermission, crudOptions);
 	//重置crudBinding

+ 1 - 0
src/views/system/teacherInfor/crud.tsx

@@ -230,6 +230,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						minWidth: 120,
 					},
 					form: {
+						show: false,
 						component: { placeholder: '请填写专业' },
 						rules: [{ required: false, message: '请填写专业' }],
 					},