diff --git a/src/store/modules/neinfo.ts b/src/store/modules/neinfo.ts index 901fe0a5..f3c6c5cc 100644 --- a/src/store/modules/neinfo.ts +++ b/src/store/modules/neinfo.ts @@ -8,13 +8,16 @@ type NeInfo = { /**网元列表 */ nelist: Record[]; /**级联options树结构 */ - neOtions: Record[]; + neCascaderOtions: Record[]; + /**选择器单级父类型 */ + neSelectOtions: Record[]; }; const useNeInfoStore = defineStore('neinfo', { state: (): NeInfo => ({ nelist: [], - neOtions: [], + neCascaderOtions: [], + neSelectOtions: [], }), getters: { /** @@ -22,8 +25,16 @@ const useNeInfoStore = defineStore('neinfo', { * @param state 内部属性不用传入 * @returns 级联options */ - getNeOtions(state) { - return state.neOtions; + getNeCascaderOtions(state) { + return state.neCascaderOtions; + }, + /** + * 选择器单级父类型 + * @param state 内部属性不用传入 + * @returns 级联options + */ + getNeSelectOtions(state) { + return state.neSelectOtions; }, }, actions: { @@ -41,6 +52,9 @@ const useNeInfoStore = defineStore('neinfo', { } const res = await getNelistAll(); if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + // 原始列表 + this.nelist = res.data; + // 转级联数据 const options = parseDataToOptions( res.data, @@ -48,8 +62,10 @@ const useNeInfoStore = defineStore('neinfo', { 'neName', 'neId' ); + this.neCascaderOtions = options; - this.neOtions = options; + // 转选择器单级父类型 + this.neSelectOtions = options.map(item => item); } return res; }, diff --git a/src/views/configManage/backupManage/index.vue b/src/views/configManage/backupManage/index.vue index 0f0bedba..0cdd4c71 100644 --- a/src/views/configManage/backupManage/index.vue +++ b/src/views/configManage/backupManage/index.vue @@ -16,6 +16,7 @@ import { import { saveAs } from 'file-saver'; import useI18n from '@/hooks/useI18n'; import { getConfigInfo, updateConfig } from '@/api/configManage/config'; +import useNeInfoStore from '@/store/modules/neinfo'; const { t } = useI18n(); const route = useRoute(); @@ -251,7 +252,7 @@ function fnModalVisibleByEdit() { if (res.code === RESULT_CODE_SUCCESS) { modalState.from.configTag = res.data.configTag modalState.from.autoBackupTime = res.data.value - modalState.title = t('views.configManage.backupManage.SetBackupTask'); + modalState.title = t('views.configManage.backupManage.setBackupTask'); modalState.visibleByEdit = true; } else { message.error(`获取配置信息失败`, 2); @@ -333,11 +334,12 @@ onMounted(() => { :label="t('views.configManage.backupManage.neType')" name="neType " > - + /> @@ -364,7 +366,7 @@ onMounted(() => { - {{ t('views.configManage.backupManage.SetBackupTask') }} + {{ t('views.configManage.backupManage.setBackupTask') }} diff --git a/src/views/configManage/configParam/index.vue b/src/views/configManage/configParam/index.vue index 1f0d1b69..af36ff81 100644 --- a/src/views/configManage/configParam/index.vue +++ b/src/views/configManage/configParam/index.vue @@ -97,7 +97,7 @@ onMounted(() => {