update store

This commit is contained in:
DESKTOP-FUDKNA8\znjsz 2024-04-17 17:02:52 +08:00
parent 7c479072e0
commit 8075325f50
4 changed files with 39 additions and 1 deletions

View File

@ -5,7 +5,7 @@ ENV = 'development'
VUE_APP_TITLE = 芋道管理系统 VUE_APP_TITLE = 芋道管理系统
# 芋道管理系统/开发环境 # 芋道管理系统/开发环境
VUE_APP_BASE_API = 'http://192.168.0.30:48080' VUE_APP_BASE_API = 'http://192.168.1.61:48080'
# 路由懒加载 # 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true

25
src/store/modules/home.js Normal file
View File

@ -0,0 +1,25 @@
const state = {
info: null
};
const mutations = {
SET_INFO: (state) => {
state.info = state
},
};
const actions = {
setInfo({ commit }, ) {
commit("SET_INFO", );
},
closeSideBar({ commit }, { withoutAnimation }) {
commit("CLOSE_SIDEBAR", withoutAnimation);
},
};
export default {
namespaced: true,
state,
mutations,
actions,
};

View File

@ -29,6 +29,7 @@
<button <button
type="button" type="button"
class="fullscreen-btn" class="fullscreen-btn"
:class="[isFullscreen ? 'exit-fullscreen' : '']"
@click="toggleFullScreen" @click="toggleFullScreen"
/> />
</div> </div>
@ -108,6 +109,10 @@ export default {
background: url(../../../assets/images/full-icon.png) 0 0 / 100% 100% background: url(../../../assets/images/full-icon.png) 0 0 / 100% 100%
no-repeat; no-repeat;
} }
.exit-fullscreen {
background: url(../../../assets/images/homeindex/exit-fullscreen.png) 0 0 / 100% 100%
no-repeat;
}
.page-title { .page-title {
flex: 1; flex: 1;

View File

@ -108,6 +108,14 @@ export default {
}; };
}, },
mounted() { mounted() {
this.$axios
.post("/ip/prod-target/query-by-date", { factorys: [], date: 4 })
.then((res) => {
if (res.data && Array.isArray(res.data)) {
this.$store.dispatch("home/setInfo", res.data);
}
});
this.$nextTick(() => { this.$nextTick(() => {
this.initPins(); this.initPins();