diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index 3c761433..aad058da 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -1783,6 +1783,10 @@ export default { reset: "System Reset", resetInstruction: "A system reset will erase all data in the current system, please proceed with caution!!!!", resetTipContent: 'Are you sure you want to clear all data from the current system and insist on continuing?', + homeInstruction:'Set the home page', + home: 'Home Page', + homeTip:'Do you want to submit the current interface as the system interface?', + homeSet:'Home Page Settings', }, role:{ allScopeOptions:'All data permissions', diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index 69369e45..3f878c47 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -1783,6 +1783,10 @@ export default { reset: "系统重置", resetInstruction: "系统重置将会清除当前系统内所有数据,请谨慎操作!!!", resetTipContent: '确认要清除当前系统内所有数据并坚持继续吗?', + homeInstruction:'设置系统首页界面', + home: '系统首页', + homeTip:'确认要提交当前界面为系统界面吗?', + homeSet:'系统首页设置', }, role:{ allScopeOptions:'全部数据权限', diff --git a/src/views/configManage/neOverview/index.vue b/src/views/configManage/neOverview/index.vue new file mode 100644 index 00000000..c32c5201 --- /dev/null +++ b/src/views/configManage/neOverview/index.vue @@ -0,0 +1,446 @@ + + + + + diff --git a/src/views/faultManage/active-alarm/index.vue b/src/views/faultManage/active-alarm/index.vue index 910713d4..375ab56a 100644 --- a/src/views/faultManage/active-alarm/index.vue +++ b/src/views/faultManage/active-alarm/index.vue @@ -612,13 +612,16 @@ function fnShowSet() { } // key替换中文title -function mapKeysWithReduce(data: any, titleMapping: any) { - return data.map((item:any) => { - return Object.keys(item).reduce((newItem:any, key:any) => { +function mapKeysWithReduce(data: any[], titleMapping: Record) { + return data.map((item: any) => { + if (typeof item !== 'object' || item === null) { + return item; // 如果不是对象,直接返回原值 + } + return Object.keys(item).reduce((newItem: Record, key: string) => { const title = titleMapping[key] || key; newItem[title] = item[key]; return newItem; - }); + }, {}); // 确保初始值是一个空对象 }); } @@ -673,6 +676,7 @@ function fnExportAll() { return filteredObj; }); + console.log(mappArr); res.data = mapKeysWithReduce(res.data, mappArr); writeSheet(res.data, 'alarm', sortData).then(fileBlob => { diff --git a/src/views/faultManage/history-alarm/index.vue b/src/views/faultManage/history-alarm/index.vue index d4c58eec..434a18ee 100644 --- a/src/views/faultManage/history-alarm/index.vue +++ b/src/views/faultManage/history-alarm/index.vue @@ -427,13 +427,16 @@ function fnCancelConfirm() { } // key替换中文title -function mapKeysWithReduce(data: any, titleMapping: any) { - return data.map((item:any) => { - return Object.keys(item).reduce((newItem:any, key:any) => { +function mapKeysWithReduce(data: any[], titleMapping: Record) { + return data.map((item: any) => { + if (typeof item !== 'object' || item === null) { + return item; + } + return Object.keys(item).reduce((newItem: Record, key: string) => { const title = titleMapping[key] || key; newItem[title] = item[key]; return newItem; - }); + }, {}); }); } diff --git a/src/views/index.vue b/src/views/index.vue index 283944db..9404fdf8 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -1,446 +1,59 @@ diff --git a/src/views/system/setting/components/change-home-index.vue b/src/views/system/setting/components/change-home-index.vue new file mode 100644 index 00000000..e96f039b --- /dev/null +++ b/src/views/system/setting/components/change-home-index.vue @@ -0,0 +1,129 @@ + + + + + diff --git a/src/views/system/setting/index.vue b/src/views/system/setting/index.vue index 6c241186..6de533d5 100644 --- a/src/views/system/setting/index.vue +++ b/src/views/system/setting/index.vue @@ -8,6 +8,7 @@ import ChangeHelpDoc from './components/change-help-doc.vue'; import ChangeOfficialUrl from './components/change-official-url.vue'; import ChangeI18n from './components/change-i18n.vue'; import SystemReset from './components/system-reset.vue'; +import ChangeHome from './components/change-home-index.vue'; import useI18n from '@/hooks/useI18n'; const { t } = useI18n(); @@ -49,6 +50,10 @@ const { t } = useI18n(); + + {{ t('views.system.setting.homeSet') }} + + {{ t('views.system.setting.reset') }}