From bdde195e2b14ea674ed92b9a1b35464b9d6107f9 Mon Sep 17 00:00:00 2001
From: 若依 <yzz_ivy@163.com>
Date: 星期二, 11 五月 2021 14:19:53 +0800
Subject: [PATCH] !225 【bug修复】文件上传时出现java.nio.file.FileAlreadyExistsException Merge pull request !225 from CANYON/master
---
ruoyi-ui/src/layout/components/Settings/index.vue | 49 ++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 42 insertions(+), 7 deletions(-)
diff --git a/ruoyi-ui/src/layout/components/Settings/index.vue b/ruoyi-ui/src/layout/components/Settings/index.vue
index 7e36d48..efdc0fd 100644
--- a/ruoyi-ui/src/layout/components/Settings/index.vue
+++ b/ruoyi-ui/src/layout/components/Settings/index.vue
@@ -62,6 +62,10 @@
<el-switch v-model="sidebarLogo" class="drawer-switch" />
</div>
+ <el-divider/>
+
+ <el-button size="small" type="primary" plain icon="el-icon-document-add" @click="saveSetting">保存配置</el-button>
+ <el-button size="small" plain icon="el-icon-refresh" @click="resetSetting">重置配置</el-button>
</div>
</div>
</template>
@@ -72,15 +76,12 @@
export default {
components: { ThemePicker },
data() {
- return {}
+ return {
+ theme: this.$store.state.settings.theme,
+ sideTheme: this.$store.state.settings.sideTheme
+ };
},
computed: {
- theme() {
- return this.$store.state.settings.theme
- },
- sideTheme() {
- return this.$store.state.settings.sideTheme
- },
fixedHeader: {
get() {
return this.$store.state.settings.fixedHeader
@@ -135,12 +136,46 @@
key: 'theme',
value: val
})
+ this.theme = val;
},
handleTheme(val) {
this.$store.dispatch('settings/changeSetting', {
key: 'sideTheme',
value: val
})
+ this.sideTheme = val;
+ },
+ saveSetting() {
+ const loading = this.$loading({
+ lock: true,
+ fullscreen: false,
+ text: "正在保存到本地,请稍后...",
+ spinner: "el-icon-loading",
+ background: "rgba(0, 0, 0, 0.7)"
+ });
+ localStorage.setItem(
+ "layout-setting",
+ `{
+ "topNav":${this.topNav},
+ "tagsView":${this.tagsView},
+ "fixedHeader":${this.fixedHeader},
+ "sidebarLogo":${this.sidebarLogo},
+ "sideTheme":"${this.sideTheme}",
+ "theme":"${this.theme}"
+ }`
+ );
+ setTimeout(loading.close(), 1000)
+ },
+ resetSetting() {
+ this.$loading({
+ lock: true,
+ fullscreen: false,
+ text: "正在清除设置缓存并刷新,请稍后...",
+ spinner: "el-icon-loading",
+ background: "rgba(0, 0, 0, 0.7)"
+ });
+ localStorage.removeItem("layout-setting")
+ setTimeout("window.location.reload()", 1000)
}
}
}
--
Gitblit v1.9.2