From 3bc6977775ba50da9c4f8cb399017ad769a2e65a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=B6=E5=90=AF=E9=BE=99?= Date: Tue, 27 Aug 2024 15:53:20 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components.d.ts | 2 ++ src/layouts/home.vue | 11 ++++++++++- src/store/modules/position.js | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 src/store/modules/position.js 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 +}