test: 测试

develop
时启龙 2024-08-27 15:57:13 +08:00
parent 3bc6977775
commit 1b733e1982
2 changed files with 11 additions and 3 deletions

View File

@ -8,7 +8,7 @@
<ThirdMenu :menuData="thirdMenuData" v-if="thirdMenuData.children"></ThirdMenu>
<el-main class="main-body">
<div style="background-color: red">
<el-select v-model="selectPostion">
<el-select v-model="selectPostion" @change="SET_SELECTED_POSITION">
<el-option v-for="item in positionList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
@ -137,6 +137,9 @@ export default {
store.commit('SET_OPERATETIME')
}
const selectPostion = ref('')
const SET_SELECTED_POSITION = () => {
store.commit('SET_SELECTED_POSITION', selectPostion.value)
}
return {
isCollapsed: computed(() => store.state.app.isCollapsed),
basePath: computed(() => store.state.app.basePath),
@ -149,7 +152,8 @@ export default {
thirdMenuData,
toggleCollapsed,
setTime,
selectPostion
selectPostion,
SET_SELECTED_POSITION
}
},
methods: {

View File

@ -7,9 +7,13 @@ const state = {
positionList: [
{ name: '主阵地', id: 1 },
{ name: '子阵地 1', id: 2 }
]
],
selectedPostion: ''
}
const mutations = {
SET_SELECTED_POSITION(state, value) {
state.selectedPostion = value
},
SET_IS_MAIN_POSITION(state, value) {
state.isMainPosition = value
},