-
+
{{ item.dictLabel }}{{ item.label }}
- {{ item.dictLabel }}
+ {{ item.label }}
@@ -31,12 +32,12 @@ export default {
type: Array,
default: null,
},
- value: [String, Array],
+ value: [Number, String, Array],
},
computed: {
values() {
- if (this.value) {
- return Array.isArray(this.value) ? this.value : [this.value];
+ if (this.value !== null && typeof this.value !== 'undefined') {
+ return Array.isArray(this.value) ? this.value : [String(this.value)];
} else {
return [];
}
diff --git a/ruoyi-ui/src/components/Editor/index.vue b/ruoyi-ui/src/components/Editor/index.vue
index b67c3789..89d49f32 100644
--- a/ruoyi-ui/src/components/Editor/index.vue
+++ b/ruoyi-ui/src/components/Editor/index.vue
@@ -2,6 +2,7 @@
@@ -46,14 +47,20 @@ export default {
type: Boolean,
default: false,
},
- /* 上传地址 */
- uploadUrl: {
+ // 上传文件大小限制(MB)
+ fileSize: {
+ type: Number,
+ default: 5,
+ },
+ /* 类型(base64格式、url格式) */
+ type: {
type: String,
- default: "",
+ default: "url",
}
},
data() {
return {
+ uploadUrl: process.env.VUE_APP_BASE_API + "/file/upload", // 上传的图片服务器地址
headers: {
Authorization: "Bearer " + getToken()
},
@@ -119,7 +126,7 @@ export default {
const editor = this.$refs.editor;
this.Quill = new Quill(editor, this.options);
// 如果设置了上传地址则自定义图片上传事件
- if (this.uploadUrl) {
+ if (this.type == 'url') {
let toolbar = this.Quill.getModule("toolbar");
toolbar.addHandler("image", (value) => {
this.uploadType = "image";
@@ -129,14 +136,6 @@ export default {
this.quill.format("image", false);
}
});
- toolbar.addHandler("video", (value) => {
- this.uploadType = "video";
- if (value) {
- this.$refs.upload.$children[0].$refs.input.click();
- } else {
- this.quill.format("video", false);
- }
- });
}
this.Quill.pasteHTML(this.currentValue);
this.Quill.on("text-change", (delta, oldDelta, source) => {
@@ -157,6 +156,18 @@ export default {
this.$emit("on-editor-change", eventName, ...args);
});
},
+ // 上传前校检格式和大小
+ handleBeforeUpload(file) {
+ // 校检文件大小
+ if (this.fileSize) {
+ const isLt = file.size / 1024 / 1024 < this.fileSize;
+ if (!isLt) {
+ this.$message.error(`上传文件大小不能超过 ${this.fileSize} MB!`);
+ return false;
+ }
+ }
+ return true;
+ },
handleUploadSuccess(res, file) {
// 获取富文本组件实例
let quill = this.Quill;
@@ -165,7 +176,7 @@ export default {
// 获取光标所在位置
let length = quill.getSelection().index;
// 插入图片 res.url为服务器返回的图片地址
- quill.insertEmbed(length, "image", res.url);
+ quill.insertEmbed(length, "image", res.data.url);
// 调整光标到最后
quill.setSelection(length + 1);
} else {
diff --git a/ruoyi-ui/src/components/FileUpload/index.vue b/ruoyi-ui/src/components/FileUpload/index.vue
index af22f19a..da14d724 100644
--- a/ruoyi-ui/src/components/FileUpload/index.vue
+++ b/ruoyi-ui/src/components/FileUpload/index.vue
@@ -4,7 +4,7 @@
:action="uploadFileUrl"
:before-upload="handleBeforeUpload"
:file-list="fileList"
- :limit="1"
+ :limit="limit"
:on-error="handleUploadError"
:on-exceed="handleExceed"
:on-success="handleUploadSuccess"
@@ -26,7 +26,7 @@
-
+
{{ getFileName(file.name) }}
@@ -42,9 +42,15 @@
import { getToken } from "@/utils/auth";
export default {
+ name: "FileUpload",
props: {
// 值
value: [String, Object, Array],
+ // 数量限制
+ limit: {
+ type: Number,
+ default: 5,
+ },
// 大小限制(MB)
fileSize: {
type: Number,
@@ -70,30 +76,35 @@ export default {
fileList: [],
};
},
+ watch: {
+ value: {
+ handler(val) {
+ if (val) {
+ let temp = 1;
+ // 首先将值转为数组
+ const list = Array.isArray(val) ? val : this.value.split(',');
+ // 然后将数组转为对象数组
+ this.fileList = list.map(item => {
+ if (typeof item === "string") {
+ item = { name: item, url: item };
+ }
+ item.uid = item.uid || new Date().getTime() + temp++;
+ return item;
+ });
+ } else {
+ this.fileList = [];
+ return [];
+ }
+ },
+ deep: true,
+ immediate: true
+ }
+ },
computed: {
// 是否显示提示
showTip() {
return this.isShowTip && (this.fileType || this.fileSize);
},
- // 列表
- list() {
- let temp = 1;
- if (this.value) {
- // 首先将值转为数组
- const list = Array.isArray(this.value) ? this.value : [this.value];
- // 然后将数组转为对象数组
- return list.map((item) => {
- if (typeof item === "string") {
- item = { name: item, url: item };
- }
- item.uid = item.uid || new Date().getTime() + temp++;
- return item;
- });
- } else {
- this.fileList = [];
- return [];
- }
- },
},
methods: {
// 上传前校检格式和大小
@@ -126,7 +137,7 @@ export default {
},
// 文件个数超出
handleExceed() {
- this.$message.error(`只允许上传单个文件`);
+ this.$message.error(`上传文件数量不能超过 ${this.limit} 个!`);
},
// 上传失败
handleUploadError(err) {
@@ -135,12 +146,13 @@ export default {
// 上传成功回调
handleUploadSuccess(res, file) {
this.$message.success("上传成功");
- this.$emit("input", res.data.url);
+ this.fileList.push({ name: res.data.url, url: res.data.url });
+ this.$emit("input", this.listToString(this.fileList));
},
// 删除文件
handleDelete(index) {
this.fileList.splice(index, 1);
- this.$emit("input", '');
+ this.$emit("input", this.listToString(this.fileList));
},
// 获取文件名称
getFileName(name) {
@@ -149,11 +161,17 @@ export default {
} else {
return "";
}
+ },
+ // 对象转成指定字符串分隔
+ listToString(list, separator) {
+ let strs = "";
+ separator = separator || ",";
+ for (let i in list) {
+ strs += list[i].url + separator;
+ }
+ return strs != '' ? strs.substr(0, strs.length - 1) : '';
}
- },
- created() {
- this.fileList = this.list;
- },
+ }
};
diff --git a/ruoyi-ui/src/components/HeaderSearch/index.vue b/ruoyi-ui/src/components/HeaderSearch/index.vue
index ae952a98..09311842 100644
--- a/ruoyi-ui/src/components/HeaderSearch/index.vue
+++ b/ruoyi-ui/src/components/HeaderSearch/index.vue
@@ -70,9 +70,11 @@ export default {
this.show = false
},
change(val) {
+ const path = val.path;
if(this.ishttp(val.path)) {
// http(s):// 路径新窗口打开
- window.open(val.path, "_blank");
+ const pindex = path.indexOf("http");
+ window.open(path.substr(pindex, path.length), "_blank");
} else {
this.$router.push(val.path)
}
diff --git a/ruoyi-ui/src/components/ImageUpload/index.vue b/ruoyi-ui/src/components/ImageUpload/index.vue
index cf772eed..1f3a9c19 100644
--- a/ruoyi-ui/src/components/ImageUpload/index.vue
+++ b/ruoyi-ui/src/components/ImageUpload/index.vue
@@ -5,33 +5,38 @@
list-type="picture-card"
:on-success="handleUploadSuccess"
:before-upload="handleBeforeUpload"
+ :limit="limit"
:on-error="handleUploadError"
+ :on-exceed="handleExceed"
name="file"
- :show-file-list="false"
+ :on-remove="handleRemove"
+ :show-file-list="true"
:headers="headers"
- style="display: inline-block; vertical-align: top"
+ :file-list="fileList"
+ :on-preview="handlePictureCardPreview"
+ :class="{hide: this.fileList.length >= this.limit}"
>
-
-
-
-
-
-
+
-
-
+
+
+
+ 请上传
+ 大小不超过 {{ fileSize }}MB
+ 格式为 {{ fileType.join("/") }}
+ 的文件
+
+
+
+
@@ -40,36 +45,125 @@
import { getToken } from "@/utils/auth";
export default {
+ props: {
+ value: [String, Object, Array],
+ // 图片数量限制
+ limit: {
+ type: Number,
+ default: 5,
+ },
+ // 大小限制(MB)
+ fileSize: {
+ type: Number,
+ default: 5,
+ },
+ // 文件类型, 例如['png', 'jpg', 'jpeg']
+ fileType: {
+ type: Array,
+ default: () => ["png", "jpg", "jpeg"],
+ },
+ // 是否显示提示
+ isShowTip: {
+ type: Boolean,
+ default: true
+ }
+ },
data() {
return {
+ dialogImageUrl: "",
dialogVisible: false,
+ hideUpload: false,
uploadImgUrl: process.env.VUE_APP_BASE_API + "/file/upload", // 上传的图片服务器地址
headers: {
Authorization: "Bearer " + getToken(),
},
+ fileList: []
};
},
- props: {
+ watch: {
value: {
- type: String,
- default: "",
+ handler(val) {
+ if (val) {
+ // 首先将值转为数组
+ const list = Array.isArray(val) ? val : this.value.split(',');
+ // 然后将数组转为对象数组
+ this.fileList = list.map(item => {
+ if (typeof item === "string") {
+ item = { name: item, url: item };
+ }
+ return item;
+ });
+ } else {
+ this.fileList = [];
+ return [];
+ }
+ },
+ deep: true,
+ immediate: true
+ }
+ },
+ computed: {
+ // 是否显示提示
+ showTip() {
+ return this.isShowTip && (this.fileType || this.fileSize);
},
},
methods: {
- removeImage() {
- this.$emit("input", "");
+ // 删除图片
+ handleRemove(file, fileList) {
+ const findex = this.fileList.map(f => f.name).indexOf(file.name);
+ if(findex > -1) {
+ this.fileList.splice(findex, 1);
+ this.$emit("input", this.listToString(this.fileList));
+ }
},
+ // 上传成功回调
handleUploadSuccess(res) {
- this.$emit("input", res.data.url);
+ this.fileList.push({ name: res.data.url, url: res.data.url });
+ this.$emit("input", this.listToString(this.fileList));
this.loading.close();
},
- handleBeforeUpload() {
+ // 上传前loading加载
+ handleBeforeUpload(file) {
+ let isImg = false;
+ if (this.fileType.length) {
+ let fileExtension = "";
+ if (file.name.lastIndexOf(".") > -1) {
+ fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
+ }
+ isImg = this.fileType.some(type => {
+ if (file.type.indexOf(type) > -1) return true;
+ if (fileExtension && fileExtension.indexOf(type) > -1) return true;
+ return false;
+ });
+ } else {
+ isImg = file.type.indexOf("image") > -1;
+ }
+
+ if (!isImg) {
+ this.$message.error(
+ `文件格式不正确, 请上传${this.fileType.join("/")}图片格式文件!`
+ );
+ return false;
+ }
+ if (this.fileSize) {
+ const isLt = file.size / 1024 / 1024 < this.fileSize;
+ if (!isLt) {
+ this.$message.error(`上传头像图片大小不能超过 ${this.fileSize} MB!`);
+ return false;
+ }
+ }
this.loading = this.$loading({
lock: true,
text: "上传中",
background: "rgba(0, 0, 0, 0.7)",
});
},
+ // 文件个数超出
+ handleExceed() {
+ this.$message.error(`上传文件数量不能超过 ${this.limit} 个!`);
+ },
+ // 上传失败
handleUploadError() {
this.$message({
type: "error",
@@ -77,24 +171,37 @@ export default {
});
this.loading.close();
},
- },
- watch: {},
+ // 预览
+ handlePictureCardPreview(file) {
+ this.dialogImageUrl = file.url;
+ this.dialogVisible = true;
+ },
+ // 对象转成指定字符串分隔
+ listToString(list, separator) {
+ let strs = "";
+ separator = separator || ",";
+ for (let i in list) {
+ strs += list[i].url + separator;
+ }
+ return strs != '' ? strs.substr(0, strs.length - 1) : '';
+ }
+ }
};
-
\ No newline at end of file
+// 去掉动画效果
+::v-deep .el-list-enter-active,
+::v-deep .el-list-leave-active {
+ transition: all 0s;
+}
+
+::v-deep .el-list-enter, .el-list-leave-active {
+ opacity: 0;
+ transform: translateY(0);
+}
+
+
diff --git a/ruoyi-ui/src/components/ThemePicker/index.vue b/ruoyi-ui/src/components/ThemePicker/index.vue
index 5c16ee45..4ba9bd27 100644
--- a/ruoyi-ui/src/components/ThemePicker/index.vue
+++ b/ruoyi-ui/src/components/ThemePicker/index.vue
@@ -31,19 +31,22 @@ export default {
immediate: true
},
async theme(val) {
+ await this.setTheme(val)
+ }
+ },
+ created() {
+ if(this.defaultTheme !== ORIGINAL_THEME) {
+ this.setTheme(this.defaultTheme)
+ }
+ },
+
+ methods: {
+ async setTheme(val) {
const oldVal = this.chalk ? this.theme : ORIGINAL_THEME
if (typeof val !== 'string') return
const themeCluster = this.getThemeCluster(val.replace('#', ''))
const originalCluster = this.getThemeCluster(oldVal.replace('#', ''))
- const $message = this.$message({
- message: ' Compiling the theme',
- customClass: 'theme-message',
- type: 'success',
- duration: 0,
- iconClass: 'el-icon-loading'
- })
-
const getHandler = (variable, id) => {
return () => {
const originalCluster = this.getThemeCluster(ORIGINAL_THEME.replace('#', ''))
@@ -80,12 +83,8 @@ export default {
})
this.$emit('change', val)
+ },
- $message.close()
- }
- },
-
- methods: {
updateStyle(style, oldCluster, newCluster) {
let newStyle = style
oldCluster.forEach((color, index) => {
diff --git a/ruoyi-ui/src/components/TopNav/index.vue b/ruoyi-ui/src/components/TopNav/index.vue
index d89930a8..1b7c4d9e 100644
--- a/ruoyi-ui/src/components/TopNav/index.vue
+++ b/ruoyi-ui/src/components/TopNav/index.vue
@@ -12,7 +12,7 @@
-
+
更多菜单
0) {
const tmpPath = path.substring(1, path.length);
activePath = "/" + tmpPath.substring(0, tmpPath.indexOf("/"));
@@ -100,7 +100,7 @@ export default {
}
var routes = this.activeRoutes(activePath);
if (routes.length === 0) {
- activePath = this.currentIndex || this.routers[0].path
+ activePath = this.currentIndex || this.defaultRouter()
this.activeRoutes(activePath);
}
return activePath;
@@ -121,6 +121,17 @@ export default {
const width = document.body.getBoundingClientRect().width / 3;
this.visibleNumber = parseInt(width / 85);
},
+ // 默认激活的路由
+ defaultRouter() {
+ let router;
+ Object.keys(this.routers).some((key) => {
+ if (!this.routers[key].hidden) {
+ router = this.routers[key].path;
+ return true;
+ }
+ });
+ return router;
+ },
// 菜单选择事件
handleSelect(key, keyPath) {
this.currentIndex = key;
@@ -158,25 +169,27 @@ export default {
diff --git a/ruoyi-ui/src/directive/dialog/drag.js b/ruoyi-ui/src/directive/dialog/drag.js
new file mode 100644
index 00000000..2e823465
--- /dev/null
+++ b/ruoyi-ui/src/directive/dialog/drag.js
@@ -0,0 +1,64 @@
+/**
+* v-dialogDrag 弹窗拖拽
+* Copyright (c) 2019 ruoyi
+*/
+
+export default {
+ bind(el, binding, vnode, oldVnode) {
+ const value = binding.value
+ if (value == false) return
+ // 获取拖拽内容头部
+ const dialogHeaderEl = el.querySelector('.el-dialog__header');
+ const dragDom = el.querySelector('.el-dialog');
+ dialogHeaderEl.style.cursor = 'move';
+ // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
+ const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null);
+ dragDom.style.position = 'absolute';
+ dragDom.style.marginTop = 0;
+ let width = dragDom.style.width;
+ if (width.includes('%')) {
+ width = +document.body.clientWidth * (+width.replace(/\%/g, '') / 100);
+ } else {
+ width = +width.replace(/\px/g, '');
+ }
+ dragDom.style.left = `${(document.body.clientWidth - width) / 2}px`;
+ // 鼠标按下事件
+ dialogHeaderEl.onmousedown = (e) => {
+ // 鼠标按下,计算当前元素距离可视区的距离 (鼠标点击位置距离可视窗口的距离)
+ const disX = e.clientX - dialogHeaderEl.offsetLeft;
+ const disY = e.clientY - dialogHeaderEl.offsetTop;
+
+ // 获取到的值带px 正则匹配替换
+ let styL, styT;
+
+ // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
+ if (sty.left.includes('%')) {
+ styL = +document.body.clientWidth * (+sty.left.replace(/\%/g, '') / 100);
+ styT = +document.body.clientHeight * (+sty.top.replace(/\%/g, '') / 100);
+ } else {
+ styL = +sty.left.replace(/\px/g, '');
+ styT = +sty.top.replace(/\px/g, '');
+ };
+
+ // 鼠标拖拽事件
+ document.onmousemove = function (e) {
+ // 通过事件委托,计算移动的距离 (开始拖拽至结束拖拽的距离)
+ const l = e.clientX - disX;
+ const t = e.clientY - disY;
+
+ let finallyL = l + styL
+ let finallyT = t + styT
+
+ // 移动当前元素
+ dragDom.style.left = `${finallyL}px`;
+ dragDom.style.top = `${finallyT}px`;
+
+ };
+
+ document.onmouseup = function (e) {
+ document.onmousemove = null;
+ document.onmouseup = null;
+ };
+ }
+ }
+};
\ No newline at end of file
diff --git a/ruoyi-ui/src/directive/dialog/dragHeight.js b/ruoyi-ui/src/directive/dialog/dragHeight.js
new file mode 100644
index 00000000..db5e1dbc
--- /dev/null
+++ b/ruoyi-ui/src/directive/dialog/dragHeight.js
@@ -0,0 +1,34 @@
+/**
+* v-dialogDragWidth 可拖动弹窗高度(右下角)
+* Copyright (c) 2019 ruoyi
+*/
+
+export default {
+ bind(el) {
+ const dragDom = el.querySelector('.el-dialog');
+ const lineEl = document.createElement('div');
+ lineEl.style = 'width: 6px; background: inherit; height: 10px; position: absolute; right: 0; bottom: 0; margin: auto; z-index: 1; cursor: nwse-resize;';
+ lineEl.addEventListener('mousedown',
+ function(e) {
+ // 鼠标按下,计算当前元素距离可视区的距离
+ const disX = e.clientX - el.offsetLeft;
+ const disY = e.clientY - el.offsetTop;
+ // 当前宽度 高度
+ const curWidth = dragDom.offsetWidth;
+ const curHeight = dragDom.offsetHeight;
+ document.onmousemove = function(e) {
+ e.preventDefault(); // 移动时禁用默认事件
+ // 通过事件委托,计算移动的距离
+ const xl = e.clientX - disX;
+ const yl = e.clientY - disY
+ dragDom.style.width = `${curWidth + xl}px`;
+ dragDom.style.height = `${curHeight + yl}px`;
+ };
+ document.onmouseup = function(e) {
+ document.onmousemove = null;
+ document.onmouseup = null;
+ };
+ }, false);
+ dragDom.appendChild(lineEl);
+ }
+}
\ No newline at end of file
diff --git a/ruoyi-ui/src/directive/dialog/dragWidth.js b/ruoyi-ui/src/directive/dialog/dragWidth.js
new file mode 100644
index 00000000..e3b5f3f8
--- /dev/null
+++ b/ruoyi-ui/src/directive/dialog/dragWidth.js
@@ -0,0 +1,30 @@
+/**
+* v-dialogDragWidth 可拖动弹窗宽度(右侧边)
+* Copyright (c) 2019 ruoyi
+*/
+
+export default {
+ bind(el) {
+ const dragDom = el.querySelector('.el-dialog');
+ const lineEl = document.createElement('div');
+ lineEl.style = 'width: 5px; background: inherit; height: 80%; position: absolute; right: 0; top: 0; bottom: 0; margin: auto; z-index: 1; cursor: w-resize;';
+ lineEl.addEventListener('mousedown',
+ function (e) {
+ // 鼠标按下,计算当前元素距离可视区的距离
+ const disX = e.clientX - el.offsetLeft;
+ // 当前宽度
+ const curWidth = dragDom.offsetWidth;
+ document.onmousemove = function (e) {
+ e.preventDefault(); // 移动时禁用默认事件
+ // 通过事件委托,计算移动的距离
+ const l = e.clientX - disX;
+ dragDom.style.width = `${curWidth + l}px`;
+ };
+ document.onmouseup = function (e) {
+ document.onmousemove = null;
+ document.onmouseup = null;
+ };
+ }, false);
+ dragDom.appendChild(lineEl);
+ }
+}
\ No newline at end of file
diff --git a/ruoyi-ui/src/directive/index.js b/ruoyi-ui/src/directive/index.js
new file mode 100644
index 00000000..5801640a
--- /dev/null
+++ b/ruoyi-ui/src/directive/index.js
@@ -0,0 +1,21 @@
+import hasRole from './permission/hasRole'
+import hasPermi from './permission/hasPermi'
+import dialogDrag from './dialog/drag'
+import dialogDragWidth from './dialog/dragWidth'
+import dialogDragHeight from './dialog/dragHeight'
+
+const install = function(Vue) {
+ Vue.directive('hasRole', hasRole)
+ Vue.directive('hasPermi', hasPermi)
+ Vue.directive('dialogDrag', dialogDrag)
+ Vue.directive('dialogDragWidth', dialogDragWidth)
+ Vue.directive('dialogDragHeight', dialogDragHeight)
+}
+
+if (window.Vue) {
+ window['hasRole'] = hasRole
+ window['hasPermi'] = hasPermi
+ Vue.use(install); // eslint-disable-line
+}
+
+export default install
diff --git a/ruoyi-ui/src/directive/permission/hasPermi.js b/ruoyi-ui/src/directive/permission/hasPermi.js
index 74f9d325..799e0153 100644
--- a/ruoyi-ui/src/directive/permission/hasPermi.js
+++ b/ruoyi-ui/src/directive/permission/hasPermi.js
@@ -1,5 +1,5 @@
/**
- * 操作权限处理
+ * v-hasPermi 操作权限处理
* Copyright (c) 2019 ruoyi
*/
diff --git a/ruoyi-ui/src/directive/permission/hasRole.js b/ruoyi-ui/src/directive/permission/hasRole.js
index ea966a34..406b9435 100644
--- a/ruoyi-ui/src/directive/permission/hasRole.js
+++ b/ruoyi-ui/src/directive/permission/hasRole.js
@@ -1,5 +1,5 @@
/**
- * 角色权限处理
+ * v-hasRole 角色权限处理
* Copyright (c) 2019 ruoyi
*/
diff --git a/ruoyi-ui/src/layout/components/InnerLink/index.vue b/ruoyi-ui/src/layout/components/InnerLink/index.vue
new file mode 100644
index 00000000..227ff2a7
--- /dev/null
+++ b/ruoyi-ui/src/layout/components/InnerLink/index.vue
@@ -0,0 +1,27 @@
+
diff --git a/ruoyi-ui/src/layout/components/Settings/index.vue b/ruoyi-ui/src/layout/components/Settings/index.vue
index 0a6becac..4dff1d0c 100644
--- a/ruoyi-ui/src/layout/components/Settings/index.vue
+++ b/ruoyi-ui/src/layout/components/Settings/index.vue
@@ -162,14 +162,8 @@ export default {
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(
+ this.$modal.loading("正在保存到本地,请稍后...");
+ this.$cache.local.set(
"layout-setting",
`{
"topNav":${this.topNav},
@@ -181,17 +175,11 @@ export default {
"theme":"${this.theme}"
}`
);
- setTimeout(loading.close(), 1000)
+ setTimeout(this.$modal.closeLoading(), 1000)
},
resetSetting() {
- this.$loading({
- lock: true,
- fullscreen: false,
- text: "正在清除设置缓存并刷新,请稍后...",
- spinner: "el-icon-loading",
- background: "rgba(0, 0, 0, 0.7)"
- });
- localStorage.removeItem("layout-setting")
+ this.$modal.loading("正在清除设置缓存并刷新,请稍后...");
+ this.$cache.local.remove("layout-setting")
setTimeout("window.location.reload()", 1000)
}
}
diff --git a/ruoyi-ui/src/layout/components/Sidebar/Link.vue b/ruoyi-ui/src/layout/components/Sidebar/Link.vue
index d235d10b..cc62468c 100644
--- a/ruoyi-ui/src/layout/components/Sidebar/Link.vue
+++ b/ruoyi-ui/src/layout/components/Sidebar/Link.vue
@@ -10,7 +10,7 @@ import { isExternal } from '@/utils/validate'
export default {
props: {
to: {
- type: String,
+ type: [String, Object],
required: true
}
},
diff --git a/ruoyi-ui/src/layout/components/Sidebar/Logo.vue b/ruoyi-ui/src/layout/components/Sidebar/Logo.vue
index f3bf5d5b..82f3d581 100644
--- a/ruoyi-ui/src/layout/components/Sidebar/Logo.vue
+++ b/ruoyi-ui/src/layout/components/Sidebar/Logo.vue
@@ -1,13 +1,13 @@
-