From cbdc977fd6c5621daad6ad73ea5ed827f5cd88e3 Mon Sep 17 00:00:00 2001 From: Qi <3194726156@qq.com> Date: Mon, 26 May 2025 21:06:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=A4=96=E6=A0=A1=E8=80=81?= =?UTF-8?q?=E5=B8=88=E6=8A=A5=E5=88=B0=E6=9D=83=E9=99=90=E5=92=8C=E5=AE=BF?= =?UTF-8?q?=E8=88=8D=E6=98=BE=E7=A4=BA=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cees/dormitory/CeesDormitoryInfo.data.ts | 15 +- .../cees/waiTeacher/CeesWaiTeacher.data.ts | 8 +- .../cees/waiTeacher/CeesWaiTeacherList.vue | 187 +++++++++++++----- .../role/components/RolePermissionDrawer.vue | 2 +- 4 files changed, 152 insertions(+), 60 deletions(-) diff --git a/src/views/cees/dormitory/CeesDormitoryInfo.data.ts b/src/views/cees/dormitory/CeesDormitoryInfo.data.ts index 0ad4119..597d25f 100644 --- a/src/views/cees/dormitory/CeesDormitoryInfo.data.ts +++ b/src/views/cees/dormitory/CeesDormitoryInfo.data.ts @@ -10,26 +10,37 @@ export const columns: BasicColumn[] = [ title: '宿舍信息', align: 'center', dataIndex: 'dormitory', + width: 100, }, { - title: '宿舍类型(男/女)', + title: '宿舍类型', align: 'center', dataIndex: 'dormitoryType', + width: 100, }, { title: '宿舍人数', align: 'center', dataIndex: 'dormitoryNum', + width: 100, }, { title: '状态', align: 'center', dataIndex: 'dormitoryStatus', + width: 100, }, { title: '所属学科', align: 'center', dataIndex: 'majorId', + width: 100, + }, + { + title: '宿舍人员信息', + align: 'center', + dataIndex: 'dormitorydata', + width: 300, }, ]; //查询数据 @@ -51,7 +62,7 @@ export const searchFormSchema: FormSchema[] = [ }, ifShow: ({ values }) => { return hasPermission('dormitory:majorId:select'); - } + }, }, ]; //表单数据 diff --git a/src/views/cees/waiTeacher/CeesWaiTeacher.data.ts b/src/views/cees/waiTeacher/CeesWaiTeacher.data.ts index 857a9e0..79e9287 100644 --- a/src/views/cees/waiTeacher/CeesWaiTeacher.data.ts +++ b/src/views/cees/waiTeacher/CeesWaiTeacher.data.ts @@ -410,8 +410,8 @@ export const formSchema: FormSchema[] = [ component: 'RadioGroup', componentProps: { options: [ - { label: '是', value: 0 }, - { label: '否', value: 1 }, + { label: '是', value: 1 }, + { label: '否', value: 0 }, ], }, //dynamicRules: ({ model, schema }) => { @@ -436,8 +436,8 @@ export const formSchema: FormSchema[] = [ component: 'RadioGroup', componentProps: { options: [ - { label: '是', value: 0 }, - { label: '否', value: 1 }, + { label: '是', value: 1 }, + { label: '否', value: 0 }, ], }, //dynamicRules: ({ model, schema }) => { diff --git a/src/views/cees/waiTeacher/CeesWaiTeacherList.vue b/src/views/cees/waiTeacher/CeesWaiTeacherList.vue index c6108a6..0d9214a 100644 --- a/src/views/cees/waiTeacher/CeesWaiTeacherList.vue +++ b/src/views/cees/waiTeacher/CeesWaiTeacherList.vue @@ -38,7 +38,8 @@ @@ -303,34 +304,23 @@ * 操作栏 */ function getTableAction(record) { - const actions = []; - - if (record.status !== 0) { - actions.push({ + return [ + { label: '编辑', onClick: handleEdit.bind(null, record), - }); - } - return actions; + ifShow: () => record.status !== 0, // 只有状态不为0时才显示编辑按钮 + }, + { + label: '删除', + popConfirm: { + title: '是否确认删除', + confirm: handleDelete.bind(null, record), + placement: 'topLeft', + }, + ifShow: () => hasPermission('waiTeacher:delete'), // 权限控制 + }, + ]; } - //function ConfirmRegistration(record) { - // const actions = [{}]; - // // 添加“确认报到”和“取消确认”按钮 - // if (record.status === 0) { - // actions.push({ - // label: '取消确认', - // color: 'error', // 按钮颜色 - // onClick: () => updateStatus(record.id, 'un'), // 点击事件 - // }); - // } else { - // actions.push({ - // label: '确认报到', - // color: 'primary', // 按钮颜色 - // onClick: () => updateStatus(record.id), // 点击事件 - // }); - // } - // return actions; - //} function ConfirmRegistration(record) { const actions = []; @@ -341,8 +331,8 @@ Modal.confirm({ title: isConfirmAction ? '请核对信息!!!' : '', content: , - okText: isConfirmAction ? '确认报到' : '取消报到', // 根据操作类型设置确认按钮文本 - cancelText: isConfirmAction ? '取消' : '关闭', // 根据操作类型设置取消按钮文本 + okText: isConfirmAction ? '确认报到' : '取消报到', + cancelText: isConfirmAction ? '取消' : '关闭', width: 800, onOk: () => { if (isConfirmAction) { @@ -354,17 +344,28 @@ }); }; + // 取消报到按钮(始终显示,无权限时禁用) if (record.status === 0) { + const hasCancelPermission = hasPermission('waiTeacher:cancelRegister'); actions.push({ - label: '取消确认', + label: '取消报到', color: 'error', - onClick: () => handleConfirm('cancel'), + onClick: hasCancelPermission ? () => handleConfirm('cancel') : undefined, + disabled: !hasCancelPermission, + tooltip: !hasCancelPermission ? '无取消报到权限' : undefined, + ifShow: () => true, // 始终显示 }); - } else { + } + // 确认报到按钮(始终显示,无权限时禁用) + else { + const hasConfirmPermission = hasPermission('waiTeacher:confirmRegister'); actions.push({ label: '确认报到', color: 'primary', - onClick: () => handleConfirm('confirm'), + onClick: hasConfirmPermission ? () => handleConfirm('confirm') : undefined, + disabled: !hasConfirmPermission, + tooltip: !hasConfirmPermission ? '无确认报到权限' : undefined, + ifShow: () => true, // 始终显示 }); } @@ -397,10 +398,38 @@ {record.bankName} {record.carNumber} - {/*{record.mealCard}*/} + {record.mealCard} {record.groupId} - {record.dormitoryName} + +
+ + + +
+
+ {record.majorIdDescription} ); @@ -427,25 +456,21 @@ /** * 下拉操作栏 */ - function getDropDownAction(record) { - return [ - { - label: '详情', - onClick: handleDetail.bind(null, record), - }, - { - label: '删除', - popConfirm: { - title: '是否确认删除', - confirm: handleDelete.bind(null, record), - placement: 'topLeft', - }, - ifShow: () => { - return hasPermission('waiTeacher:delete'); - }, - }, - ]; - } + //function getDropDownAction(record) { + // return [ + // { + // label: '删除', + // popConfirm: { + // title: '是否确认删除', + // confirm: handleDelete.bind(null, record), + // placement: 'topLeft', + // }, + // ifShow: () => { + // return hasPermission('waiTeacher:delete'); + // }, + // }, + // ]; + //} // 定义 handleFocus 函数 async function handleFocus(record) { @@ -502,4 +527,60 @@ .qr { display: flex; } + /** 自定义选择框容器 */ + .custom-select-wrapper { + position: relative; + display: inline-block; + width: 150px; + } + + /* 原生select元素美化 */ + .custom-select { + appearance: none; + -webkit-appearance: none; + -moz-appearance: none; + width: 100%; + padding: 6px 12px; + font-size: 14px; + line-height: 1.5; + color: rgba(0, 0, 0, 0.85); + background-color: #fff; + background-image: none; + border: 1px solid #d9d9d9; + border-radius: 4px; + transition: all 0.3s; + cursor: pointer; + } + + /* 下拉箭头 */ + .custom-arrow { + position: absolute; + top: 50%; + right: 12px; + transform: translateY(-50%); + width: 0; + height: 0; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-top: 5px solid #999; + pointer-events: none; + } + + /* 交互状态 */ + .custom-select:focus { + border-color: #40a9ff; + box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2); + outline: none; + } + + .custom-select:disabled { + color: rgba(0, 0, 0, 0.25); + background-color: #f5f5f5; + cursor: not-allowed; + } + + /* 选项样式 */ + .custom-select option { + padding: 8px 12px; + } diff --git a/src/views/system/role/components/RolePermissionDrawer.vue b/src/views/system/role/components/RolePermissionDrawer.vue index e1780ae..9f8b4f1 100644 --- a/src/views/system/role/components/RolePermissionDrawer.vue +++ b/src/views/system/role/components/RolePermissionDrawer.vue @@ -72,7 +72,7 @@ //展开折叠的key const expandedKeys = ref([]); //父子节点选中状态是否关联 - const checkStrictly = ref(false); + const checkStrictly = ref(true); const [registerDrawer1, { openDrawer: openDataRuleDrawer }] = useDrawer(); const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => { await reset();