diff --git a/src/components.d.ts b/src/components.d.ts index da3be40..282705f 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -28,8 +28,10 @@ declare module '@vue/runtime-core' { ElMain: typeof import('element-plus/es')['ElMain'] ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] + ElOption: typeof import('element-plus/es')['ElOption'] ElRow: typeof import('element-plus/es')['ElRow'] ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] + ElSelect: typeof import('element-plus/es')['ElSelect'] ElSubMenu: typeof import('element-plus/es')['ElSubMenu'] ElSwitch: typeof import('element-plus/es')['ElSwitch'] ElTabPane: typeof import('element-plus/es')['ElTabPane'] diff --git a/src/layouts/home.vue b/src/layouts/home.vue index e6e696c..82a2d96 100644 --- a/src/layouts/home.vue +++ b/src/layouts/home.vue @@ -7,6 +7,11 @@ +
+ + + +
@@ -47,6 +52,7 @@ export default { setup() { const route = useRoute() const store = useStore() + console.log(store) // 初始化 function init() { store.commit('permission/SET_BUTTONS') @@ -130,17 +136,20 @@ export default { function setTime() { store.commit('SET_OPERATETIME') } + const selectPostion = ref('') return { isCollapsed: computed(() => store.state.app.isCollapsed), basePath: computed(() => store.state.app.basePath), expire: computed(() => store.state.app.expire), isFontBig: computed(() => store.state.app.pageConfig.contentFontSize === 'big'), + positionList: computed(() => store.state.position.positionList), addRoutes, menuData, showSidebar, thirdMenuData, toggleCollapsed, - setTime + setTime, + selectPostion } }, methods: { diff --git a/src/store/modules/position.js b/src/store/modules/position.js new file mode 100644 index 0000000..071330b --- /dev/null +++ b/src/store/modules/position.js @@ -0,0 +1,32 @@ +import { getSystemConfigs } from 'services' + +const state = { + // 是否主阵地 + isMainPosition: true, + // 阵地列表 + positionList: [ + { name: '主阵地', id: 1 }, + { name: '子阵地 1', id: 2 } + ] +} +const mutations = { + SET_IS_MAIN_POSITION(state, value) { + state.isMainPosition = value + }, + SET_POSITION_LIST(state, value) { + state.positionList = value + } +} +const actions = { + async GetPostionList({ commit }) { + const data = await getSystemConfigs({ codes: 'pwdStrength,lockScreenTime' }) + if (data.success) { + commit('SET_POSITION_LIST', data.data) + } + } +} +export default { + state, + mutations, + actions +}