diff --git a/ljwx-admin/src/locales/langs/en-us.ts b/ljwx-admin/src/locales/langs/en-us.ts index fc750c2..9a0ae9f 100644 --- a/ljwx-admin/src/locales/langs/en-us.ts +++ b/ljwx-admin/src/locales/langs/en-us.ts @@ -533,7 +533,7 @@ const local: App.I18n.Schema = { male: 'Male', female: 'Female' }, - selectTreeIsEmptyTip: 'Please select the organization to view user items' + selectTreeIsEmptyTip: 'Please select a department to view employee list' }, menu: { home: 'Home', diff --git a/ljwx-admin/src/locales/langs/zh-cn.ts b/ljwx-admin/src/locales/langs/zh-cn.ts index 507b8fb..6b1abaf 100644 --- a/ljwx-admin/src/locales/langs/zh-cn.ts +++ b/ljwx-admin/src/locales/langs/zh-cn.ts @@ -1198,7 +1198,7 @@ const local: App.I18n.Schema = { male: '男', female: '女' }, - selectTreeIsEmptyTip: '请选择组织查看员工列表' + selectTreeIsEmptyTip: '请选择部门查看员工列表' }, menu: { home: '首页', diff --git a/ljwx-admin/src/typings/components.d.ts b/ljwx-admin/src/typings/components.d.ts index 5756539..9a4c189 100644 --- a/ljwx-admin/src/typings/components.d.ts +++ b/ljwx-admin/src/typings/components.d.ts @@ -54,8 +54,13 @@ declare module 'vue' { IconLocalLogo: typeof import('~icons/local/logo')['default'] 'IconMdi:alertCircleOutline': typeof import('~icons/mdi/alert-circle-outline')['default'] 'IconMdi:alertOutline': typeof import('~icons/mdi/alert-outline')['default'] + 'IconMdi:batteryCharging': typeof import('~icons/mdi/battery-charging')['default'] + 'IconMdi:cellphone': typeof import('~icons/mdi/cellphone')['default'] + 'IconMdi:devices': typeof import('~icons/mdi/devices')['default'] 'IconMdi:messageOutline': typeof import('~icons/mdi/message-outline')['default'] + 'IconMdi:power': typeof import('~icons/mdi/power')['default'] 'IconMdi:progressCheck': typeof import('~icons/mdi/progress-check')['default'] + 'IconMdi:watch': typeof import('~icons/mdi/watch')['default'] IconMdiArrowDownThin: typeof import('~icons/mdi/arrow-down-thin')['default'] IconMdiArrowUpThin: typeof import('~icons/mdi/arrow-up-thin')['default'] IconMdiDrag: typeof import('~icons/mdi/drag')['default'] diff --git a/ljwx-admin/src/views/alert/rules/index.vue b/ljwx-admin/src/views/alert/rules/index.vue index df7e77a..d7f9212 100644 --- a/ljwx-admin/src/views/alert/rules/index.vue +++ b/ljwx-admin/src/views/alert/rules/index.vue @@ -99,11 +99,31 @@ const { columns, columnChecks, data, loading, getData, getDataByPage, mobilePagi 多指标组合 ({indicators.length})
- {indicators.slice(0, 3).map((indicator, index) => ( - - {dictTag('health_data_type', indicator)?.props?.children || indicator} - - ))} + {indicators.slice(0, 3).map((indicator, index) => { + const getIndicatorConfig = (physicalSign) => { + const configs = { + 'heart_rate': { text: '心率', type: 'error' }, + 'blood_oxygen': { text: '血氧', type: 'success' }, + 'temperature': { text: '体温', type: 'warning' }, + 'pressure_high': { text: '收缩压', type: 'error' }, + 'pressure_low': { text: '舒张压', type: 'info' }, + 'blood_pressure': { text: '血压', type: 'error' }, + 'step': { text: '步数', type: 'success' }, + 'calorie': { text: '卡路里', type: 'warning' }, + 'distance': { text: '距离', type: 'info' }, + 'sleep': { text: '睡眠', type: 'primary' }, + 'stress': { text: '压力', type: 'error' }, + 'event': { text: '事件告警', type: 'warning' } + }; + return configs[physicalSign] || { text: physicalSign, type: 'default' }; + }; + const config = getIndicatorConfig(indicator); + return ( + + {config.text} + + ); + })} {indicators.length > 3 && ( {{ @@ -114,11 +134,30 @@ const { columns, columnChecks, data, loading, getData, getDataByPage, mobilePagi ), default: () => (
- {indicators.slice(3).map((indicator, index) => ( - - {dictTag('health_data_type', indicator)?.props?.children || indicator} - - ))} + {indicators.slice(3).map((indicator, index) => { + const getIndicatorText = (physicalSign) => { + const configs = { + 'heart_rate': '心率', + 'blood_oxygen': '血氧', + 'temperature': '体温', + 'pressure_high': '收缩压', + 'pressure_low': '舒张压', + 'blood_pressure': '血压', + 'step': '步数', + 'calorie': '卡路里', + 'distance': '距离', + 'sleep': '睡眠', + 'stress': '压力', + 'event': '事件告警' + }; + return configs[physicalSign] || physicalSign; + }; + return ( + + {getIndicatorText(indicator)} + + ); + })}
) }} @@ -148,23 +187,35 @@ const { columns, columnChecks, data, loading, getData, getDataByPage, mobilePagi ); } // 单体征规则:显示具体指标 - const indicator = dictTag('health_data_type', row.physicalSign); - if (indicator) { + if (row.physicalSign) { + const getIndicatorConfig = (physicalSign) => { + const configs = { + 'heart_rate': { text: '心率', type: 'error' }, + 'blood_oxygen': { text: '血氧', type: 'success' }, + 'temperature': { text: '体温', type: 'warning' }, + 'pressure_high': { text: '收缩压', type: 'error' }, + 'pressure_low': { text: '舒张压', type: 'info' }, + 'blood_pressure': { text: '血压', type: 'error' }, + 'step': { text: '步数', type: 'success' }, + 'calorie': { text: '卡路里', type: 'warning' }, + 'distance': { text: '距离', type: 'info' }, + 'sleep': { text: '睡眠', type: 'primary' }, + 'stress': { text: '压力', type: 'error' }, + 'event': { text: '事件告警', type: 'warning' } + }; + return configs[physicalSign] || { text: physicalSign, type: 'default' }; + }; + + const config = getIndicatorConfig(row.physicalSign); return ( - - - - - {indicator} + + {config.text} ); } return ( - - - - {row.physicalSign || '未设置'} + 未设置 ); } @@ -816,7 +867,7 @@ function onWizardSuccess() {
- + @@ -404,6 +405,31 @@ watch(visible, () => { diff --git a/ljwx-admin/src/views/device/info/index.vue b/ljwx-admin/src/views/device/info/index.vue index af3207f..72b572f 100644 --- a/ljwx-admin/src/views/device/info/index.vue +++ b/ljwx-admin/src/views/device/info/index.vue @@ -1,8 +1,10 @@ diff --git a/ljwx-admin/src/views/manage/role/modules/button-auth-modal.vue b/ljwx-admin/src/views/manage/role/modules/button-auth-modal.vue index 8651f87..2c71503 100644 --- a/ljwx-admin/src/views/manage/role/modules/button-auth-modal.vue +++ b/ljwx-admin/src/views/manage/role/modules/button-auth-modal.vue @@ -36,19 +36,51 @@ function createDefaultModel(): Api.SystemManage.RolePermission { /** menu permission data */ const permissionData = shallowRef([]); +// 数据加载状态 +const dataLoading = shallowRef(false); + async function getPermissionData() { - const { error, data } = await fetchGetMenuPermission(); - if (!error) { - permissionData.value = data; + try { + dataLoading.value = true; + const { error, data } = await fetchGetMenuPermission(); + if (!error && data) { + permissionData.value = data; + console.log('按钮权限数据加载完成:', data); + } else { + console.error('获取按钮权限数据失败:', error); + permissionData.value = []; + } + } catch (error) { + console.error('加载按钮权限数据异常:', error); + permissionData.value = []; + } finally { + dataLoading.value = false; } } /** init get permissionIds for roleId, belong checks */ async function getPermissionIds() { - const { error, data } = await fetchGetRolePermissionIds(props.roleId); - if (!error) { - checks.value = data; - getPermissionData(); + try { + dataLoading.value = true; + + // 首先获取角色已有的权限 + const { error: roleError, data: roleData } = await fetchGetRolePermissionIds(props.roleId); + if (!roleError && roleData) { + checks.value = roleData; + console.log('当前角色已有权限:', roleData); + } else { + checks.value = []; + } + + // 然后获取所有可用的权限数据 + await getPermissionData(); + + } catch (error) { + console.error('获取角色权限失败:', error); + checks.value = []; + window.$message?.error?.('获取权限数据失败,请重试'); + } finally { + dataLoading.value = false; } } @@ -66,11 +98,40 @@ async function handleSubmit() { } function selectAll() { - checks.value = permissionData.value.flatMap(item => item.buttons.map(button => button.id)); + // 确保permissionData已加载且有数据 + if (!permissionData.value || permissionData.value.length === 0) { + console.warn('权限数据未加载或为空'); + window.$message?.warning?.('权限数据未加载,请稍后再试'); + return; + } + + const allButtonIds: string[] = []; + + // 遍历所有菜单的按钮权限 + permissionData.value.forEach(item => { + if (item.buttons && Array.isArray(item.buttons)) { + item.buttons.forEach(button => { + if (button.id) { + allButtonIds.push(String(button.id)); + } + }); + } + }); + + console.log('全选按钮权限ID列表:', allButtonIds); + console.log('当前选中权限:', checks.value); + + // 更新选中状态 + checks.value = [...allButtonIds]; + + console.log('全选后选中权限:', checks.value); + window.$message?.success?.(`已选中 ${allButtonIds.length} 项按钮权限`); } function clearAll() { checks.value = []; + console.log('清空所有选中权限'); + window.$message?.success?.('已清空所有选中的按钮权限'); } watch(visible, () => { @@ -98,28 +159,59 @@ watch(visible, () => {
已选择 {{ checks.length }} 项权限 - 全选 - 清空 + + 全选 + + + 清空 +
- - -
-
- - - + + + +
+
+ + + +
-
- - + + + + +