删除
@@ -72,12 +73,12 @@ export default {
type: String,
default: () => '/system/oss/zip/upload'
},
- accept: {
- type: Array,
- default: () => []
+ multiple: {
+ type: Boolean,
+ default: true
}
},
- data() {
+ data () {
return {
number: 0,
uploadList: [],
@@ -91,8 +92,9 @@ export default {
},
watch: {
value: {
- handler(val) {
+ handler (val) {
if (val) {
+ console.log(val)
let temp = 1
// 首先将值转为数组
const list = Array.isArray(val) ? val : this.value.split(',')
@@ -115,18 +117,23 @@ export default {
},
computed: {
// 是否显示提示
- showTip() {
+ showTip () {
return this.isShowTip && (this.fileType || this.fileSize)
+ },
+ suffixArr() {
+ return this.fileType.map(item => {
+ return `.${item}`
+ })
}
},
methods: {
// 上传前校检格式和大小
- handleBeforeUpload(file) {
+ handleBeforeUpload (file) {
// 校检文件类型
if (this.fileType) {
const fileName = file.name.split('.')
const fileExt = fileName[fileName.length - 1]
- const isTypeOk = this.fileType.indexOf(fileExt) >= 0
+ const isTypeOk = this.fileType.indexOf(fileExt.toLocaleUpperCase()) >= 0 || this.fileType.indexOf(fileExt.toLocaleLowerCase()) >= 0
if (!isTypeOk) {
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join('/')}格式文件!`)
return false
@@ -145,19 +152,21 @@ export default {
return true
},
// 文件个数超出
- handleExceed() {
+ handleExceed () {
this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`)
},
// 上传失败
- handleUploadError(err) {
+ handleUploadError (err) {
this.$modal.msgError('上传文件失败,请重试')
this.$modal.closeLoading()
},
// 上传成功回调
- handleUploadSuccess(res, file) {
+ handleUploadSuccess (res, file) {
if (res.code === 200) {
- this.uploadList.push({ name: res.data.url, url: res.data.url, size: res.data.size })
-
+ const { data } = res;
+ data.name = data.url;
+ this.uploadList.push(data)
+
this.uploadedSuccessfully()
} else {
this.number--
@@ -168,23 +177,28 @@ export default {
}
},
// 删除文件
- handleDelete(index) {
+ handleDelete (index) {
this.fileList.splice(index, 1)
this.$emit('input', this.listToString(this.fileList))
+ this.$emit('change', this.fileList)
+ this.$emit('getSize', this.fileList)
},
// 上传结束处理
- uploadedSuccessfully() {
+ uploadedSuccessfully () {
if (this.number > 0 && this.uploadList.length === this.number) {
this.fileList = this.fileList.concat(this.uploadList)
this.uploadList = []
this.number = 0
this.$emit('input', this.listToString(this.fileList))
+ this.$emit('change', this.fileList)
this.$emit('getSize', this.fileList)
this.$modal.closeLoading()
}
},
// 获取文件名称
- getFileName(name) {
+ getFileName(file) {
+ const {name, originalName} = file;
+ if (originalName) return originalName;
if (name.lastIndexOf('/') > -1) {
return name.slice(name.lastIndexOf('/') + 1)
} else {
@@ -192,7 +206,7 @@ export default {
}
},
// 对象转成指定字符串分隔
- listToString(list, separator) {
+ listToString (list, separator) {
let strs = ''
separator = separator || ','
for (let i in list) {
diff --git a/sf-ui/src/components/Hamburger/index.vue b/sf-ui/src/components/Hamburger/index.vue
index c6a4359..368b002 100644
--- a/sf-ui/src/components/Hamburger/index.vue
+++ b/sf-ui/src/components/Hamburger/index.vue
@@ -1,44 +1,44 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/sf-ui/src/components/HeaderSearch/index.vue b/sf-ui/src/components/HeaderSearch/index.vue
index 6e9b72f..c4d76bb 100644
--- a/sf-ui/src/components/HeaderSearch/index.vue
+++ b/sf-ui/src/components/HeaderSearch/index.vue
@@ -1,189 +1,189 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/sf-ui/src/components/IconSelect/requireIcons.js b/sf-ui/src/components/IconSelect/requireIcons.js
index 5d3005d..99e5c54 100644
--- a/sf-ui/src/components/IconSelect/requireIcons.js
+++ b/sf-ui/src/components/IconSelect/requireIcons.js
@@ -1,11 +1,11 @@
-
-const req = require.context('../../assets/icons/svg', false, /\.svg$/)
-const requireAll = requireContext => requireContext.keys()
-
-const re = /\.\/(.*)\.svg/
-
-const icons = requireAll(req).map(i => {
- return i.match(re)[1]
-})
-
-export default icons
+
+const req = require.context('../../assets/icons/svg', false, /\.svg$/)
+const requireAll = requireContext => requireContext.keys()
+
+const re = /\.\/(.*)\.svg/
+
+const icons = requireAll(req).map(i => {
+ return i.match(re)[1]
+})
+
+export default icons
diff --git a/sf-ui/src/components/ImageUpload/index.vue b/sf-ui/src/components/ImageUpload/index.vue
index 8aa25f1..1973047 100644
--- a/sf-ui/src/components/ImageUpload/index.vue
+++ b/sf-ui/src/components/ImageUpload/index.vue
@@ -1,242 +1,223 @@
-
-
-
-
- 上传文件
-
-
-
-
- 请上传
- 大小不超过 {{ fileSize }}MB
- 格式为 {{ fileType.join('/') }}
- 的文件
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+ 上传文件
+
+
+
+
+ 请上传大小不超过 {{ fileSize }}MB
+ 格式为 {{ fileType.join('/') }}
+ 的文件
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sf-ui/src/components/Pagination/index.vue b/sf-ui/src/components/Pagination/index.vue
index 1617af0..56f5a6b 100644
--- a/sf-ui/src/components/Pagination/index.vue
+++ b/sf-ui/src/components/Pagination/index.vue
@@ -1,114 +1,114 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/sf-ui/src/components/PanThumb/index.vue b/sf-ui/src/components/PanThumb/index.vue
index 796b01b..1bcf417 100644
--- a/sf-ui/src/components/PanThumb/index.vue
+++ b/sf-ui/src/components/PanThumb/index.vue
@@ -1,142 +1,142 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/sf-ui/src/components/RightPanel/index.vue b/sf-ui/src/components/RightPanel/index.vue
index 25ce3f8..5abeecb 100644
--- a/sf-ui/src/components/RightPanel/index.vue
+++ b/sf-ui/src/components/RightPanel/index.vue
@@ -1,106 +1,106 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/sf-ui/src/components/RightToolbar/index.vue b/sf-ui/src/components/RightToolbar/index.vue
index 776fcee..527e07c 100644
--- a/sf-ui/src/components/RightToolbar/index.vue
+++ b/sf-ui/src/components/RightToolbar/index.vue
@@ -1,104 +1,104 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sf-ui/src/components/RuoYi/Doc/index.vue b/sf-ui/src/components/RuoYi/Doc/index.vue
index cc829b2..75fa864 100644
--- a/sf-ui/src/components/RuoYi/Doc/index.vue
+++ b/sf-ui/src/components/RuoYi/Doc/index.vue
@@ -1,21 +1,21 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/sf-ui/src/components/RuoYi/Git/index.vue b/sf-ui/src/components/RuoYi/Git/index.vue
index 517c448..bdafbae 100644
--- a/sf-ui/src/components/RuoYi/Git/index.vue
+++ b/sf-ui/src/components/RuoYi/Git/index.vue
@@ -1,21 +1,21 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/sf-ui/src/components/Screenfull/index.vue b/sf-ui/src/components/Screenfull/index.vue
index 85937c9..d4e539c 100644
--- a/sf-ui/src/components/Screenfull/index.vue
+++ b/sf-ui/src/components/Screenfull/index.vue
@@ -1,57 +1,57 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/sf-ui/src/components/SizeSelect/index.vue b/sf-ui/src/components/SizeSelect/index.vue
index 00496f7..2ba215d 100644
--- a/sf-ui/src/components/SizeSelect/index.vue
+++ b/sf-ui/src/components/SizeSelect/index.vue
@@ -1,56 +1,56 @@
-
-
-
-
-
-
-
- {{ item.label }}
-
-
-
-
-
-
+
+
+
+
+
+
+
+ {{ item.label }}
+
+
+
+
+
+
diff --git a/sf-ui/src/components/SvgIcon/index.vue b/sf-ui/src/components/SvgIcon/index.vue
index 340ace4..e4bf5ad 100644
--- a/sf-ui/src/components/SvgIcon/index.vue
+++ b/sf-ui/src/components/SvgIcon/index.vue
@@ -1,61 +1,61 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/sf-ui/src/components/ThemePicker/index.vue b/sf-ui/src/components/ThemePicker/index.vue
index 4ba9bd2..1714e1f 100644
--- a/sf-ui/src/components/ThemePicker/index.vue
+++ b/sf-ui/src/components/ThemePicker/index.vue
@@ -1,173 +1,173 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/sf-ui/src/components/iFrame/index.vue b/sf-ui/src/components/iFrame/index.vue
index 4b85f36..426857f 100644
--- a/sf-ui/src/components/iFrame/index.vue
+++ b/sf-ui/src/components/iFrame/index.vue
@@ -1,36 +1,36 @@
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/sf-ui/src/directive/dialog/drag.js b/sf-ui/src/directive/dialog/drag.js
index 728f49d..2e82346 100644
--- a/sf-ui/src/directive/dialog/drag.js
+++ b/sf-ui/src/directive/dialog/drag.js
@@ -1,64 +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;
- };
- }
- }
+/**
+* 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/sf-ui/src/directive/dialog/dragHeight.js b/sf-ui/src/directive/dialog/dragHeight.js
index db5e1db..d1590f8 100644
--- a/sf-ui/src/directive/dialog/dragHeight.js
+++ b/sf-ui/src/directive/dialog/dragHeight.js
@@ -1,34 +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);
- }
+/**
+* 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/sf-ui/src/directive/dialog/dragWidth.js b/sf-ui/src/directive/dialog/dragWidth.js
index e3b5f3f..d5cda3a 100644
--- a/sf-ui/src/directive/dialog/dragWidth.js
+++ b/sf-ui/src/directive/dialog/dragWidth.js
@@ -1,30 +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);
- }
+/**
+* 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/sf-ui/src/directive/index.js b/sf-ui/src/directive/index.js
index b2901d7..b9b07da 100644
--- a/sf-ui/src/directive/index.js
+++ b/sf-ui/src/directive/index.js
@@ -1,23 +1,23 @@
-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'
-import clipboard from './module/clipboard'
-
-const install = function(Vue) {
- Vue.directive('hasRole', hasRole)
- Vue.directive('hasPermi', hasPermi)
- Vue.directive('clipboard', clipboard)
- 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
+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'
+import clipboard from './module/clipboard'
+
+const install = function(Vue) {
+ Vue.directive('hasRole', hasRole)
+ Vue.directive('hasPermi', hasPermi)
+ Vue.directive('clipboard', clipboard)
+ 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/sf-ui/src/directive/permission/hasPermi.js b/sf-ui/src/directive/permission/hasPermi.js
index 799e015..719536c 100644
--- a/sf-ui/src/directive/permission/hasPermi.js
+++ b/sf-ui/src/directive/permission/hasPermi.js
@@ -1,28 +1,28 @@
- /**
- * v-hasPermi 操作权限处理
- * Copyright (c) 2019 ruoyi
- */
-
-import store from '@/store'
-
-export default {
- inserted(el, binding, vnode) {
- const { value } = binding
- const all_permission = "*:*:*";
- const permissions = store.getters && store.getters.permissions
-
- if (value && value instanceof Array && value.length > 0) {
- const permissionFlag = value
-
- const hasPermissions = permissions.some(permission => {
- return all_permission === permission || permissionFlag.includes(permission)
- })
-
- if (!hasPermissions) {
- el.parentNode && el.parentNode.removeChild(el)
- }
- } else {
- throw new Error(`请设置操作权限标签值`)
- }
- }
-}
+ /**
+ * v-hasPermi 操作权限处理
+ * Copyright (c) 2019 ruoyi
+ */
+
+import store from '@/store'
+
+export default {
+ inserted(el, binding, vnode) {
+ const { value } = binding
+ const all_permission = "*:*:*";
+ const permissions = store.getters && store.getters.permissions
+
+ if (value && value instanceof Array && value.length > 0) {
+ const permissionFlag = value
+
+ const hasPermissions = permissions.some(permission => {
+ return all_permission === permission || permissionFlag.includes(permission)
+ })
+
+ if (!hasPermissions) {
+ el.parentNode && el.parentNode.removeChild(el)
+ }
+ } else {
+ throw new Error(`请设置操作权限标签值`)
+ }
+ }
+}
diff --git a/sf-ui/src/directive/permission/hasRole.js b/sf-ui/src/directive/permission/hasRole.js
index 406b943..eec4a5b 100644
--- a/sf-ui/src/directive/permission/hasRole.js
+++ b/sf-ui/src/directive/permission/hasRole.js
@@ -1,28 +1,28 @@
- /**
- * v-hasRole 角色权限处理
- * Copyright (c) 2019 ruoyi
- */
-
-import store from '@/store'
-
-export default {
- inserted(el, binding, vnode) {
- const { value } = binding
- const super_admin = "admin";
- const roles = store.getters && store.getters.roles
-
- if (value && value instanceof Array && value.length > 0) {
- const roleFlag = value
-
- const hasRole = roles.some(role => {
- return super_admin === role || roleFlag.includes(role)
- })
-
- if (!hasRole) {
- el.parentNode && el.parentNode.removeChild(el)
- }
- } else {
- throw new Error(`请设置角色权限标签值"`)
- }
- }
-}
+ /**
+ * v-hasRole 角色权限处理
+ * Copyright (c) 2019 ruoyi
+ */
+
+import store from '@/store'
+
+export default {
+ inserted(el, binding, vnode) {
+ const { value } = binding
+ const super_admin = "admin";
+ const roles = store.getters && store.getters.roles
+
+ if (value && value instanceof Array && value.length > 0) {
+ const roleFlag = value
+
+ const hasRole = roles.some(role => {
+ return super_admin === role || roleFlag.includes(role)
+ })
+
+ if (!hasRole) {
+ el.parentNode && el.parentNode.removeChild(el)
+ }
+ } else {
+ throw new Error(`请设置角色权限标签值"`)
+ }
+ }
+}
diff --git a/sf-ui/src/layout/components/AppMain.vue b/sf-ui/src/layout/components/AppMain.vue
index a25c562..8d6828b 100644
--- a/sf-ui/src/layout/components/AppMain.vue
+++ b/sf-ui/src/layout/components/AppMain.vue
@@ -30,9 +30,10 @@ export default {
.app-main {
/* 50= navbar 50 */
min-height: calc(100vh - 50px);
+ height: calc(100vh - 50px);
width: 100%;
position: relative;
- overflow: hidden;
+ overflow: auto;
}
.fixed-header + .app-main {
@@ -43,6 +44,7 @@ export default {
.app-main {
/* 84 = navbar + tags-view = 50 + 34 */
min-height: calc(100vh - 84px);
+ height: calc(100vh - 84px);
}
.fixed-header + .app-main {
diff --git a/sf-ui/src/layout/components/IframeToggle/index.vue b/sf-ui/src/layout/components/IframeToggle/index.vue
index eeddc87..26e17c1 100644
--- a/sf-ui/src/layout/components/IframeToggle/index.vue
+++ b/sf-ui/src/layout/components/IframeToggle/index.vue
@@ -1,24 +1,24 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/sf-ui/src/layout/components/InnerLink/index.vue b/sf-ui/src/layout/components/InnerLink/index.vue
index 6edcdec..badefc5 100644
--- a/sf-ui/src/layout/components/InnerLink/index.vue
+++ b/sf-ui/src/layout/components/InnerLink/index.vue
@@ -1,47 +1,47 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/sf-ui/src/layout/components/Navbar.vue b/sf-ui/src/layout/components/Navbar.vue
index 7506ba1..5bffc6a 100644
--- a/sf-ui/src/layout/components/Navbar.vue
+++ b/sf-ui/src/layout/components/Navbar.vue
@@ -1,205 +1,206 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sf-ui/src/layout/components/Settings/index.vue b/sf-ui/src/layout/components/Settings/index.vue
index 068acbf..e681fd5 100644
--- a/sf-ui/src/layout/components/Settings/index.vue
+++ b/sf-ui/src/layout/components/Settings/index.vue
@@ -1,260 +1,260 @@
-
-
-
-
-
-
-
主题风格设置
-
-
-
-

-
-
-
-

-
-
-
-
-
- 主题颜色
-
-
-
-
-
-
-
系统布局配置
-
-
- 开启 TopNav
-
-
-
-
- 开启 Tags-Views
-
-
-
-
- 固定 Header
-
-
-
-
- 显示 Logo
-
-
-
-
- 动态标题
-
-
-
-
-
-
保存配置
-
重置配置
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
主题风格设置
+
+
+
+

+
+
+
+

+
+
+
+
+
+ 主题颜色
+
+
+
+
+
+
+
系统布局配置
+
+
+ 开启 TopNav
+
+
+
+
+ 开启 Tags-Views
+
+
+
+
+ 固定 Header
+
+
+
+
+ 显示 Logo
+
+
+
+
+ 动态标题
+
+
+
+
+
+
保存配置
+
重置配置
+
+
+
+
+
+
+
+
diff --git a/sf-ui/src/layout/components/Sidebar/FixiOSBug.js b/sf-ui/src/layout/components/Sidebar/FixiOSBug.js
index 3d8cc21..6823726 100644
--- a/sf-ui/src/layout/components/Sidebar/FixiOSBug.js
+++ b/sf-ui/src/layout/components/Sidebar/FixiOSBug.js
@@ -1,25 +1,25 @@
-export default {
- computed: {
- device() {
- return this.$store.state.app.device
- }
- },
- mounted() {
- // In order to fix the click on menu on the ios device will trigger the mouseleave bug
- this.fixBugIniOS()
- },
- methods: {
- fixBugIniOS() {
- const $subMenu = this.$refs.subMenu
- if ($subMenu) {
- const handleMouseleave = $subMenu.handleMouseleave
- $subMenu.handleMouseleave = (e) => {
- if (this.device === 'mobile') {
- return
- }
- handleMouseleave(e)
- }
- }
- }
- }
-}
+export default {
+ computed: {
+ device() {
+ return this.$store.state.app.device
+ }
+ },
+ mounted() {
+ // In order to fix the click on menu on the ios device will trigger the mouseleave bug
+ this.fixBugIniOS()
+ },
+ methods: {
+ fixBugIniOS() {
+ const $subMenu = this.$refs.subMenu
+ if ($subMenu) {
+ const handleMouseleave = $subMenu.handleMouseleave
+ $subMenu.handleMouseleave = (e) => {
+ if (this.device === 'mobile') {
+ return
+ }
+ handleMouseleave(e)
+ }
+ }
+ }
+ }
+}
diff --git a/sf-ui/src/layout/components/Sidebar/Item.vue b/sf-ui/src/layout/components/Sidebar/Item.vue
index 37214aa..be3285d 100644
--- a/sf-ui/src/layout/components/Sidebar/Item.vue
+++ b/sf-ui/src/layout/components/Sidebar/Item.vue
@@ -1,33 +1,33 @@
-
+
diff --git a/sf-ui/src/layout/components/Sidebar/Link.vue b/sf-ui/src/layout/components/Sidebar/Link.vue
index cc62468..8b0bc93 100644
--- a/sf-ui/src/layout/components/Sidebar/Link.vue
+++ b/sf-ui/src/layout/components/Sidebar/Link.vue
@@ -1,43 +1,43 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/sf-ui/src/layout/components/Sidebar/Logo.vue b/sf-ui/src/layout/components/Sidebar/Logo.vue
index 35cc528..b17f37f 100644
--- a/sf-ui/src/layout/components/Sidebar/Logo.vue
+++ b/sf-ui/src/layout/components/Sidebar/Logo.vue
@@ -1,93 +1,93 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/sf-ui/src/layout/components/Sidebar/SidebarItem.vue b/sf-ui/src/layout/components/Sidebar/SidebarItem.vue
index 1baf540..4853fbb 100644
--- a/sf-ui/src/layout/components/Sidebar/SidebarItem.vue
+++ b/sf-ui/src/layout/components/Sidebar/SidebarItem.vue
@@ -1,100 +1,100 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sf-ui/src/layout/components/Sidebar/index.vue b/sf-ui/src/layout/components/Sidebar/index.vue
index 24fb533..51d0839 100644
--- a/sf-ui/src/layout/components/Sidebar/index.vue
+++ b/sf-ui/src/layout/components/Sidebar/index.vue
@@ -1,57 +1,57 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sf-ui/src/layout/components/TagsView/index.vue b/sf-ui/src/layout/components/TagsView/index.vue
index 1fc2323..96585a5 100644
--- a/sf-ui/src/layout/components/TagsView/index.vue
+++ b/sf-ui/src/layout/components/TagsView/index.vue
@@ -1,332 +1,332 @@
-
-
-
-
- {{ tag.title }}
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+ {{ tag.title }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sf-ui/src/layout/components/index.js b/sf-ui/src/layout/components/index.js
index d60f9ef..104bd3a 100644
--- a/sf-ui/src/layout/components/index.js
+++ b/sf-ui/src/layout/components/index.js
@@ -1,6 +1,5 @@
-export { default as AppMain } from './AppMain'
-export { default as Navbar } from './Navbar'
-// export { default as NavbarNew } from './NavbarNew'
-export { default as Settings } from './Settings'
-export { default as Sidebar } from './Sidebar/index.vue'
-export { default as TagsView } from './TagsView/index.vue'
+export { default as AppMain } from './AppMain'
+export { default as Navbar } from './Navbar'
+export { default as Settings } from './Settings'
+export { default as Sidebar } from './Sidebar/index.vue'
+export { default as TagsView } from './TagsView/index.vue'
diff --git a/sf-ui/src/layout/mixin/ResizeHandler.js b/sf-ui/src/layout/mixin/ResizeHandler.js
index b3fc8b2..e8d0df8 100644
--- a/sf-ui/src/layout/mixin/ResizeHandler.js
+++ b/sf-ui/src/layout/mixin/ResizeHandler.js
@@ -1,45 +1,45 @@
-import store from '@/store'
-
-const { body } = document
-const WIDTH = 992 // refer to Bootstrap's responsive design
-
-export default {
- watch: {
- $route(route) {
- if (this.device === 'mobile' && this.sidebar.opened) {
- store.dispatch('app/closeSideBar', { withoutAnimation: false })
- }
- }
- },
- beforeMount() {
- window.addEventListener('resize', this.$_resizeHandler)
- },
- beforeDestroy() {
- window.removeEventListener('resize', this.$_resizeHandler)
- },
- mounted() {
- const isMobile = this.$_isMobile()
- if (isMobile) {
- store.dispatch('app/toggleDevice', 'mobile')
- store.dispatch('app/closeSideBar', { withoutAnimation: true })
- }
- },
- methods: {
- // use $_ for mixins properties
- // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential
- $_isMobile() {
- const rect = body.getBoundingClientRect()
- return rect.width - 1 < WIDTH
- },
- $_resizeHandler() {
- if (!document.hidden) {
- const isMobile = this.$_isMobile()
- store.dispatch('app/toggleDevice', isMobile ? 'mobile' : 'desktop')
-
- if (isMobile) {
- store.dispatch('app/closeSideBar', { withoutAnimation: true })
- }
- }
- }
- }
-}
+import store from '@/store'
+
+const { body } = document
+const WIDTH = 992 // refer to Bootstrap's responsive design
+
+export default {
+ watch: {
+ $route(route) {
+ if (this.device === 'mobile' && this.sidebar.opened) {
+ store.dispatch('app/closeSideBar', { withoutAnimation: false })
+ }
+ }
+ },
+ beforeMount() {
+ window.addEventListener('resize', this.$_resizeHandler)
+ },
+ beforeDestroy() {
+ window.removeEventListener('resize', this.$_resizeHandler)
+ },
+ mounted() {
+ const isMobile = this.$_isMobile()
+ if (isMobile) {
+ store.dispatch('app/toggleDevice', 'mobile')
+ store.dispatch('app/closeSideBar', { withoutAnimation: true })
+ }
+ },
+ methods: {
+ // use $_ for mixins properties
+ // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential
+ $_isMobile() {
+ const rect = body.getBoundingClientRect()
+ return rect.width - 1 < WIDTH
+ },
+ $_resizeHandler() {
+ if (!document.hidden) {
+ const isMobile = this.$_isMobile()
+ store.dispatch('app/toggleDevice', isMobile ? 'mobile' : 'desktop')
+
+ if (isMobile) {
+ store.dispatch('app/closeSideBar', { withoutAnimation: true })
+ }
+ }
+ }
+ }
+}
diff --git a/sf-ui/src/main.js b/sf-ui/src/main.js
index ebd94b9..3c54e19 100644
--- a/sf-ui/src/main.js
+++ b/sf-ui/src/main.js
@@ -1,86 +1,90 @@
-import Vue from 'vue'
-
-import Cookies from 'js-cookie'
-
-import Element from 'element-ui'
-import './assets/styles/element-variables.scss'
-
-import '@/assets/styles/index.scss' // global css
-import '@/assets/styles/ruoyi.scss' // ruoyi css
-import App from './App'
-import store from './store'
-import router from './router'
-import directive from './directive' // directive
-import plugins from './plugins' // plugins
-import { download } from '@/utils/request'
-
-import './assets/icons' // icon
-import './permission' // permission control
-import { getDicts } from "@/api/system/dict/data";
-import { getConfigKey } from "@/api/system/config";
-import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi";
-// 分页组件
-import Pagination from "@/components/Pagination";
-// 自定义表格工具组件
-import RightToolbar from "@/components/RightToolbar"
-// 富文本组件
-import Editor from "@/components/Editor"
-// 文件上传组件
-import FileUpload from "@/components/FileUpload"
-// 图片上传组件
-import ImageUpload from "@/components/ImageUpload"
-// 图片预览组件
-import ImagePreview from "@/components/ImagePreview"
-// 字典标签组件
-import DictTag from '@/components/DictTag'
-// 头部标签组件
-import VueMeta from 'vue-meta'
-// 字典数据组件
-import DictData from '@/components/DictData'
-
-// 全局方法挂载
-Vue.prototype.getDicts = getDicts
-Vue.prototype.getConfigKey = getConfigKey
-Vue.prototype.parseTime = parseTime
-Vue.prototype.resetForm = resetForm
-Vue.prototype.addDateRange = addDateRange
-Vue.prototype.selectDictLabel = selectDictLabel
-Vue.prototype.selectDictLabels = selectDictLabels
-Vue.prototype.download = download
-Vue.prototype.handleTree = handleTree
-
-// 全局组件挂载
-Vue.component('DictTag', DictTag)
-Vue.component('Pagination', Pagination)
-Vue.component('RightToolbar', RightToolbar)
-Vue.component('Editor', Editor)
-Vue.component('FileUpload', FileUpload)
-Vue.component('ImageUpload', ImageUpload)
-Vue.component('ImagePreview', ImagePreview)
-
-Vue.use(directive)
-Vue.use(plugins)
-Vue.use(VueMeta)
-DictData.install()
-
-/**
- * If you don't want to use mock-server
- * you want to use MockJs for mock api
- * you can execute: mockXHR()
- *
- * Currently MockJs will be used in the production environment,
- * please remove it before going online! ! !
- */
-
-Vue.use(Element, {
- size: Cookies.get('size') || 'medium' // set element-ui default size
-})
-
-Vue.config.productionTip = false
-
-new Vue({
- el: '#app',
- router,
- store,
- render: h => h(App)
-})
+import Vue from 'vue'
+
+import Cookies from 'js-cookie'
+
+import Element from 'element-ui'
+import './assets/styles/element-variables.scss'
+
+import '@/assets/styles/index.scss' // global css
+import '@/assets/styles/ruoyi.scss' // ruoyi css
+import App from './App'
+import store from './store'
+import router from './router'
+import directive from './directive' // directive
+import plugins from './plugins' // plugins
+import { download } from '@/utils/request'
+
+import './assets/icons' // icon
+import './permission' // permission control
+import { getDicts } from "@/api/system/dict/data";
+import { getConfigKey } from "@/api/system/config";
+import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree, addDateRange2 } from "@/utils/ruoyi";
+// 分页组件
+import Pagination from "@/components/Pagination";
+// 自定义表格工具组件
+import RightToolbar from "@/components/RightToolbar"
+// 富文本组件
+import Editor from "@/components/Editor"
+// 文件上传组件
+import FileUpload from "@/components/FileUpload"
+// 图片上传组件
+import ImageUpload from "@/components/ImageUpload"
+// 图片预览组件
+import ImagePreview from "@/components/ImagePreview"
+// 字典标签组件
+import DictTag from '@/components/DictTag'
+// 头部标签组件
+import VueMeta from 'vue-meta'
+// 字典数据组件
+import DictData from '@/components/DictData'
+
+// 全局方法挂载
+Vue.prototype.getDicts = getDicts
+Vue.prototype.getConfigKey = getConfigKey
+Vue.prototype.parseTime = parseTime
+Vue.prototype.resetForm = resetForm
+Vue.prototype.addDateRange = addDateRange
+Vue.prototype.selectDictLabel = selectDictLabel
+Vue.prototype.selectDictLabels = selectDictLabels
+Vue.prototype.download = download
+Vue.prototype.handleTree = handleTree
+Vue.prototype.addDateRange2 = addDateRange2
+
+// 全局组件挂载
+Vue.component('DictTag', DictTag)
+Vue.component('Pagination', Pagination)
+Vue.component('RightToolbar', RightToolbar)
+Vue.component('Editor', Editor)
+Vue.component('FileUpload', FileUpload)
+Vue.component('ImageUpload', ImageUpload)
+Vue.component('ImagePreview', ImagePreview)
+
+Vue.use(directive)
+Vue.use(plugins)
+Vue.use(VueMeta)
+DictData.install()
+
+/**
+ * If you don't want to use mock-server
+ * you want to use MockJs for mock api
+ * you can execute: mockXHR()
+ *
+ * Currently MockJs will be used in the production environment,
+ * please remove it before going online! ! !
+ */
+Element.Table.props.stripe = { type: Boolean, default: true }
+Element.Dialog.props.closeOnPressEscape = { type: Boolean, default: false }
+// Element.Dialog.props.width = { type: Boolean, default: '700' }
+// Element.Radio.props.border = { type: Boolean, default: true }
+Vue.use(Element, {
+ size: Cookies.get('size') || 'medium' // set element-ui default size
+})
+
+Vue.config.productionTip = false
+
+new Vue({
+ el: '#app',
+ router,
+ store,
+ render: h => h(App)
+})
diff --git a/sf-ui/src/permission.js b/sf-ui/src/permission.js
index 73fd6bf..7d87f5f 100644
--- a/sf-ui/src/permission.js
+++ b/sf-ui/src/permission.js
@@ -10,7 +10,7 @@ import { getApplicationId } from './utils/application'
NProgress.configure({ showSpinner: false })
const whiteList = ['/login', '/register']
-const needApplicationList = ['/build/installationList', '/build/whiteListManagement', '/build/publish']
+const needApplicationList = ['/build', '/gateway']
router.beforeEach((to, from, next) => {
NProgress.start()
@@ -65,7 +65,8 @@ router.beforeEach((to, from, next) => {
})
function checkApplication(path) {
- return needApplicationList.includes(path) && !getApplicationId();
+ return needApplicationList.some(item => path.startsWith(item)) && !getApplicationId()
+ // return needApplicationList.includes(path) && !getApplicationId();
}
router.afterEach(() => {
diff --git a/sf-ui/src/plugins/auth.js b/sf-ui/src/plugins/auth.js
index af740aa..6c6bc24 100644
--- a/sf-ui/src/plugins/auth.js
+++ b/sf-ui/src/plugins/auth.js
@@ -1,60 +1,60 @@
-import store from '@/store'
-
-function authPermission(permission) {
- const all_permission = "*:*:*";
- const permissions = store.getters && store.getters.permissions
- if (permission && permission.length > 0) {
- return permissions.some(v => {
- return all_permission === v || v === permission
- })
- } else {
- return false
- }
-}
-
-function authRole(role) {
- const super_admin = "admin";
- const roles = store.getters && store.getters.roles
- if (role && role.length > 0) {
- return roles.some(v => {
- return super_admin === v || v === role
- })
- } else {
- return false
- }
-}
-
-export default {
- // 验证用户是否具备某权限
- hasPermi(permission) {
- return authPermission(permission);
- },
- // 验证用户是否含有指定权限,只需包含其中一个
- hasPermiOr(permissions) {
- return permissions.some(item => {
- return authPermission(item)
- })
- },
- // 验证用户是否含有指定权限,必须全部拥有
- hasPermiAnd(permissions) {
- return permissions.every(item => {
- return authPermission(item)
- })
- },
- // 验证用户是否具备某角色
- hasRole(role) {
- return authRole(role);
- },
- // 验证用户是否含有指定角色,只需包含其中一个
- hasRoleOr(roles) {
- return roles.some(item => {
- return authRole(item)
- })
- },
- // 验证用户是否含有指定角色,必须全部拥有
- hasRoleAnd(roles) {
- return roles.every(item => {
- return authRole(item)
- })
- }
-}
+import store from '@/store'
+
+function authPermission(permission) {
+ const all_permission = "*:*:*";
+ const permissions = store.getters && store.getters.permissions
+ if (permission && permission.length > 0) {
+ return permissions.some(v => {
+ return all_permission === v || v === permission
+ })
+ } else {
+ return false
+ }
+}
+
+function authRole(role) {
+ const super_admin = "admin";
+ const roles = store.getters && store.getters.roles
+ if (role && role.length > 0) {
+ return roles.some(v => {
+ return super_admin === v || v === role
+ })
+ } else {
+ return false
+ }
+}
+
+export default {
+ // 验证用户是否具备某权限
+ hasPermi(permission) {
+ return authPermission(permission);
+ },
+ // 验证用户是否含有指定权限,只需包含其中一个
+ hasPermiOr(permissions) {
+ return permissions.some(item => {
+ return authPermission(item)
+ })
+ },
+ // 验证用户是否含有指定权限,必须全部拥有
+ hasPermiAnd(permissions) {
+ return permissions.every(item => {
+ return authPermission(item)
+ })
+ },
+ // 验证用户是否具备某角色
+ hasRole(role) {
+ return authRole(role);
+ },
+ // 验证用户是否含有指定角色,只需包含其中一个
+ hasRoleOr(roles) {
+ return roles.some(item => {
+ return authRole(item)
+ })
+ },
+ // 验证用户是否含有指定角色,必须全部拥有
+ hasRoleAnd(roles) {
+ return roles.every(item => {
+ return authRole(item)
+ })
+ }
+}
diff --git a/sf-ui/src/plugins/cache.js b/sf-ui/src/plugins/cache.js
index 6f71b8e..6b5c00b 100644
--- a/sf-ui/src/plugins/cache.js
+++ b/sf-ui/src/plugins/cache.js
@@ -1,77 +1,77 @@
-const sessionCache = {
- set (key, value) {
- if (!sessionStorage) {
- return
- }
- if (key != null && value != null) {
- sessionStorage.setItem(key, value)
- }
- },
- get (key) {
- if (!sessionStorage) {
- return null
- }
- if (key == null) {
- return null
- }
- return sessionStorage.getItem(key)
- },
- setJSON (key, jsonValue) {
- if (jsonValue != null) {
- this.set(key, JSON.stringify(jsonValue))
- }
- },
- getJSON (key) {
- const value = this.get(key)
- if (value != null) {
- return JSON.parse(value)
- }
- },
- remove (key) {
- sessionStorage.removeItem(key);
- }
-}
-const localCache = {
- set (key, value) {
- if (!localStorage) {
- return
- }
- if (key != null && value != null) {
- localStorage.setItem(key, value)
- }
- },
- get (key) {
- if (!localStorage) {
- return null
- }
- if (key == null) {
- return null
- }
- return localStorage.getItem(key)
- },
- setJSON (key, jsonValue) {
- if (jsonValue != null) {
- this.set(key, JSON.stringify(jsonValue))
- }
- },
- getJSON (key) {
- const value = this.get(key)
- if (value != null) {
- return JSON.parse(value)
- }
- },
- remove (key) {
- localStorage.removeItem(key);
- }
-}
-
-export default {
- /**
- * 会话级缓存
- */
- session: sessionCache,
- /**
- * 本地缓存
- */
- local: localCache
-}
+const sessionCache = {
+ set (key, value) {
+ if (!sessionStorage) {
+ return
+ }
+ if (key != null && value != null) {
+ sessionStorage.setItem(key, value)
+ }
+ },
+ get (key) {
+ if (!sessionStorage) {
+ return null
+ }
+ if (key == null) {
+ return null
+ }
+ return sessionStorage.getItem(key)
+ },
+ setJSON (key, jsonValue) {
+ if (jsonValue != null) {
+ this.set(key, JSON.stringify(jsonValue))
+ }
+ },
+ getJSON (key) {
+ const value = this.get(key)
+ if (value != null) {
+ return JSON.parse(value)
+ }
+ },
+ remove (key) {
+ sessionStorage.removeItem(key);
+ }
+}
+const localCache = {
+ set (key, value) {
+ if (!localStorage) {
+ return
+ }
+ if (key != null && value != null) {
+ localStorage.setItem(key, value)
+ }
+ },
+ get (key) {
+ if (!localStorage) {
+ return null
+ }
+ if (key == null) {
+ return null
+ }
+ return localStorage.getItem(key)
+ },
+ setJSON (key, jsonValue) {
+ if (jsonValue != null) {
+ this.set(key, JSON.stringify(jsonValue))
+ }
+ },
+ getJSON (key) {
+ const value = this.get(key)
+ if (value != null) {
+ return JSON.parse(value)
+ }
+ },
+ remove (key) {
+ localStorage.removeItem(key);
+ }
+}
+
+export default {
+ /**
+ * 会话级缓存
+ */
+ session: sessionCache,
+ /**
+ * 本地缓存
+ */
+ local: localCache
+}
diff --git a/sf-ui/src/plugins/index.js b/sf-ui/src/plugins/index.js
index 9bc6eac..d000f2d 100644
--- a/sf-ui/src/plugins/index.js
+++ b/sf-ui/src/plugins/index.js
@@ -1,20 +1,20 @@
-import tab from './tab'
-import auth from './auth'
-import cache from './cache'
-import modal from './modal'
-import download from './download'
-
-export default {
- install(Vue) {
- // 页签操作
- Vue.prototype.$tab = tab
- // 认证对象
- Vue.prototype.$auth = auth
- // 缓存对象
- Vue.prototype.$cache = cache
- // 模态框对象
- Vue.prototype.$modal = modal
- // 下载文件
- Vue.prototype.$download = download
- }
-}
+import tab from './tab'
+import auth from './auth'
+import cache from './cache'
+import modal from './modal'
+import download from './download'
+
+export default {
+ install(Vue) {
+ // 页签操作
+ Vue.prototype.$tab = tab
+ // 认证对象
+ Vue.prototype.$auth = auth
+ // 缓存对象
+ Vue.prototype.$cache = cache
+ // 模态框对象
+ Vue.prototype.$modal = modal
+ // 下载文件
+ Vue.prototype.$download = download
+ }
+}
diff --git a/sf-ui/src/plugins/modal.js b/sf-ui/src/plugins/modal.js
index 503a16f..b37ca14 100644
--- a/sf-ui/src/plugins/modal.js
+++ b/sf-ui/src/plugins/modal.js
@@ -1,83 +1,83 @@
-import { Message, MessageBox, Notification, Loading } from 'element-ui'
-
-let loadingInstance;
-
-export default {
- // 消息提示
- msg(content) {
- Message.info(content)
- },
- // 错误消息
- msgError(content) {
- Message.error(content)
- },
- // 成功消息
- msgSuccess(content) {
- Message.success(content)
- },
- // 警告消息
- msgWarning(content) {
- Message.warning(content)
- },
- // 弹出提示
- alert(content) {
- MessageBox.alert(content, "系统提示")
- },
- // 错误提示
- alertError(content) {
- MessageBox.alert(content, "系统提示", { type: 'error' })
- },
- // 成功提示
- alertSuccess(content) {
- MessageBox.alert(content, "系统提示", { type: 'success' })
- },
- // 警告提示
- alertWarning(content) {
- MessageBox.alert(content, "系统提示", { type: 'warning' })
- },
- // 通知提示
- notify(content) {
- Notification.info(content)
- },
- // 错误通知
- notifyError(content) {
- Notification.error(content);
- },
- // 成功通知
- notifySuccess(content) {
- Notification.success(content)
- },
- // 警告通知
- notifyWarning(content) {
- Notification.warning(content)
- },
- // 确认窗体
- confirm(content) {
- return MessageBox.confirm(content, "系统提示", {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: "warning",
- })
- },
- // 提交内容
- prompt(content) {
- return MessageBox.prompt(content, "系统提示", {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: "warning",
- })
- },
- // 打开遮罩层
- loading(content) {
- loadingInstance = Loading.service({
- lock: true,
- text: content,
- spinner: "el-icon-loading",
- background: "rgba(0, 0, 0, 0.7)",
- })
- },
- // 关闭遮罩层
- closeLoading() {
- loadingInstance.close();
- }
-}
+import { Message, MessageBox, Notification, Loading } from 'element-ui'
+
+let loadingInstance;
+
+export default {
+ // 消息提示
+ msg(content) {
+ Message.info(content)
+ },
+ // 错误消息
+ msgError(content) {
+ Message.error(content)
+ },
+ // 成功消息
+ msgSuccess(content) {
+ Message.success(content)
+ },
+ // 警告消息
+ msgWarning(content) {
+ Message.warning(content)
+ },
+ // 弹出提示
+ alert(content) {
+ MessageBox.alert(content, "系统提示")
+ },
+ // 错误提示
+ alertError(content) {
+ MessageBox.alert(content, "系统提示", { type: 'error' })
+ },
+ // 成功提示
+ alertSuccess(content) {
+ MessageBox.alert(content, "系统提示", { type: 'success' })
+ },
+ // 警告提示
+ alertWarning(content) {
+ MessageBox.alert(content, "系统提示", { type: 'warning' })
+ },
+ // 通知提示
+ notify(content) {
+ Notification.info(content)
+ },
+ // 错误通知
+ notifyError(content) {
+ Notification.error(content);
+ },
+ // 成功通知
+ notifySuccess(content) {
+ Notification.success(content)
+ },
+ // 警告通知
+ notifyWarning(content) {
+ Notification.warning(content)
+ },
+ // 确认窗体
+ confirm(content) {
+ return MessageBox.confirm(content, "系统提示", {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: "warning",
+ })
+ },
+ // 提交内容
+ prompt(content) {
+ return MessageBox.prompt(content, "系统提示", {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: "warning",
+ })
+ },
+ // 打开遮罩层
+ loading(content) {
+ loadingInstance = Loading.service({
+ lock: true,
+ text: content,
+ spinner: "el-icon-loading",
+ background: "rgba(0, 0, 0, 0.7)",
+ })
+ },
+ // 关闭遮罩层
+ closeLoading() {
+ loadingInstance.close();
+ }
+}
diff --git a/sf-ui/src/plugins/tab.js b/sf-ui/src/plugins/tab.js
index 60ceb5f..b029c0e 100644
--- a/sf-ui/src/plugins/tab.js
+++ b/sf-ui/src/plugins/tab.js
@@ -1,71 +1,71 @@
-import store from '@/store'
-import router from '@/router';
-
-export default {
- // 刷新当前tab页签
- refreshPage(obj) {
- const { path, query, matched } = router.currentRoute;
- if (obj === undefined) {
- matched.forEach((m) => {
- if (m.components && m.components.default && m.components.default.name) {
- if (!['Layout', 'ParentView'].includes(m.components.default.name)) {
- obj = { name: m.components.default.name, path: path, query: query };
- }
- }
- });
- }
- return store.dispatch('tagsView/delCachedView', obj).then(() => {
- const { path, query } = obj
- router.replace({
- path: '/redirect' + path,
- query: query
- })
- })
- },
- // 关闭当前tab页签,打开新页签
- closeOpenPage(obj) {
- store.dispatch("tagsView/delView", router.currentRoute);
- if (obj !== undefined) {
- return router.push(obj);
- }
- },
- // 关闭指定tab页签
- closePage(obj) {
- if (obj === undefined) {
- return store.dispatch('tagsView/delView', router.currentRoute).then(({ visitedViews }) => {
- const latestView = visitedViews.slice(-1)[0]
- if (latestView) {
- return router.push(latestView.fullPath)
- }
- return router.push('/');
- });
- }
- return store.dispatch('tagsView/delView', obj);
- },
- // 关闭所有tab页签
- closeAllPage() {
- return store.dispatch('tagsView/delAllViews');
- },
- // 关闭左侧tab页签
- closeLeftPage(obj) {
- return store.dispatch('tagsView/delLeftTags', obj || router.currentRoute);
- },
- // 关闭右侧tab页签
- closeRightPage(obj) {
- return store.dispatch('tagsView/delRightTags', obj || router.currentRoute);
- },
- // 关闭其他tab页签
- closeOtherPage(obj) {
- return store.dispatch('tagsView/delOthersViews', obj || router.currentRoute);
- },
- // 添加tab页签
- openPage(title, url, params) {
- var obj = { path: url, meta: { title: title } }
- store.dispatch('tagsView/addView', obj);
- return router.push({ path: url, query: params });
- },
- // 修改tab页签
- updatePage(obj) {
- return store.dispatch('tagsView/updateVisitedView', obj);
- }
-}
+import store from '@/store'
+import router from '@/router';
+
+export default {
+ // 刷新当前tab页签
+ refreshPage(obj) {
+ const { path, query, matched } = router.currentRoute;
+ if (obj === undefined) {
+ matched.forEach((m) => {
+ if (m.components && m.components.default && m.components.default.name) {
+ if (!['Layout', 'ParentView'].includes(m.components.default.name)) {
+ obj = { name: m.components.default.name, path: path, query: query };
+ }
+ }
+ });
+ }
+ return store.dispatch('tagsView/delCachedView', obj).then(() => {
+ const { path, query } = obj
+ router.replace({
+ path: '/redirect' + path,
+ query: query
+ })
+ })
+ },
+ // 关闭当前tab页签,打开新页签
+ closeOpenPage(obj) {
+ store.dispatch("tagsView/delView", router.currentRoute);
+ if (obj !== undefined) {
+ return router.push(obj);
+ }
+ },
+ // 关闭指定tab页签
+ closePage(obj) {
+ if (obj === undefined) {
+ return store.dispatch('tagsView/delView', router.currentRoute).then(({ visitedViews }) => {
+ const latestView = visitedViews.slice(-1)[0]
+ if (latestView) {
+ return router.push(latestView.fullPath)
+ }
+ return router.push('/');
+ });
+ }
+ return store.dispatch('tagsView/delView', obj);
+ },
+ // 关闭所有tab页签
+ closeAllPage() {
+ return store.dispatch('tagsView/delAllViews');
+ },
+ // 关闭左侧tab页签
+ closeLeftPage(obj) {
+ return store.dispatch('tagsView/delLeftTags', obj || router.currentRoute);
+ },
+ // 关闭右侧tab页签
+ closeRightPage(obj) {
+ return store.dispatch('tagsView/delRightTags', obj || router.currentRoute);
+ },
+ // 关闭其他tab页签
+ closeOtherPage(obj) {
+ return store.dispatch('tagsView/delOthersViews', obj || router.currentRoute);
+ },
+ // 添加tab页签
+ openPage(title, url, params) {
+ var obj = { path: url, meta: { title: title } }
+ store.dispatch('tagsView/addView', obj);
+ return router.push({ path: url, query: params });
+ },
+ // 修改tab页签
+ updatePage(obj) {
+ return store.dispatch('tagsView/updateVisitedView', obj);
+ }
+}
diff --git a/sf-ui/src/router/index.js b/sf-ui/src/router/index.js
index 94ab3e2..db75a18 100644
--- a/sf-ui/src/router/index.js
+++ b/sf-ui/src/router/index.js
@@ -19,12 +19,12 @@ Vue.use(Router)
* roles: ['admin', 'common'] // 访问路由的角色权限
* permissions: ['a:a:a', 'b:b:b'] // 访问路由的菜单权限
* meta : {
- noCache: true // 如果设置为true,则不会被
缓存(默认 false)
- title: 'title' // 设置该路由在侧边栏和面包屑中展示的名字
- icon: 'svg-name' // 设置该路由的图标,对应路径src/assets/icons/svg
- breadcrumb: false // 如果设置为false,则不会在breadcrumb面包屑中显示
- activeMenu: '/system/user' // 当路由设置了该属性,则会高亮相对应的侧边栏。
- }
+ noCache: true // 如果设置为true,则不会被 缓存(默认 false)
+ title: 'title' // 设置该路由在侧边栏和面包屑中展示的名字
+ icon: 'svg-name' // 设置该路由的图标,对应路径src/assets/icons/svg
+ breadcrumb: false // 如果设置为false,则不会在breadcrumb面包屑中显示
+ activeMenu: '/system/user' // 当路由设置了该属性,则会高亮相对应的侧边栏。
+ }
*/
// 公共路由
@@ -88,20 +88,44 @@ export const constantRoutes = [
]
},
// 本地测试-----------
- {
- path: '/gateway',
- component: Layout,
- hidden: true,
- redirect: 'server-config',
- children: [
- {
- path: 'server-config',
- component: () => import('@/views/gateway/server/config/index'),
- name: 'serverConfig',
- meta: { title: '新增服务配置', breadcrumb: false, }
- }
- ]
- },
+ // {
+ // path: '/gateway',
+ // component: Layout,
+ // hidden: true,
+ // redirect: 'server-config',
+ // children: [
+ // // {
+ // // path: 'server-config',
+ // // component: () => import('@/views/gateway/server/config/index'),
+ // // name: 'serverConfig',
+ // // meta: { title: '新增服务配置', breadcrumb: false, }
+ // // },
+ // // {
+ // // path: 'server-detail',
+ // // component: () => import('@/views/gateway/server/detail'),
+ // // name: 'serverDetail',
+ // // meta: { title: '服务详情', breadcrumb: false, }
+ // // },
+ // // {
+ // // path: 'route-edit',
+ // // component: () => import('@/views/gateway/route/edit'),
+ // // name: 'routeEdit',
+ // // meta: { title: '路由配置', breadcrumb: false, }
+ // // },
+ // // {
+ // // path: 'strategy-edit',
+ // // component: () => import('@/views/gateway/strategy/edit'),
+ // // name: 'strategyEdit',
+ // // meta: { title: '策略配置', breadcrumb: false, }
+ // // },
+ // // {
+ // // path: 'interface-edit',
+ // // component: () => import('@/views/gateway/interface/edit'),
+ // // name: 'interfaceEdit',
+ // // meta: { title: '接口配置', breadcrumb: false, }
+ // // }
+ // ]
+ // },
// 本地测试-----------
]
@@ -115,8 +139,7 @@ export const dynamicRoutes = [
children: [
{
path: 'role/:userId(\\d+)',
- // component: () => import('@/views/system/user/authRole'),
- component: (resolve) => require(['@/views/system/user/authRole'], resolve),
+ component: () => import('@/views/system/user/authRole'),
name: 'AuthRole',
meta: { title: '分配角色', activeMenu: '/system/user' }
}
@@ -178,139 +201,7 @@ export const dynamicRoutes = [
}
]
},
- {
- path: '/build/install',
- component: Layout,
- hidden: true,
- permissions: ['build:install:add'],
- children: [
- {
- path: 'add',
- component: () => import('@/views/FDS/installationList/add'),
- name: 'InstallAdd',
- meta: { title: '新增安装包', activeMenu: '/build/installationList' }
- }
- ]
- },
- {
- path: '/build/install',
- component: Layout,
- hidden: true,
- permissions: ['build:install:edit'],
- children: [
- {
- path: 'edit',
- component: () => import('@/views/FDS/installationList/edit'),
- name: 'InstallEdit',
- meta: { title: '编辑安装包', activeMenu: '/build/installationList' }
- }
- ]
- },
-
- {
- path: '/build/install',
- component: Layout,
- hidden: true,
- permissions: ['build:install:detail'],
- children: [
- {
- path: 'detail',
- component: () => import('@/views/FDS/installationList/detail'),
- name: 'InstallDetail',
- meta: { title: '安装包详情', activeMenu: '/build/installationList' }
- }
- ]
- },
-
- {
- path: '/build/publishList',
- component: Layout,
- hidden: true,
- permissions: ['build:publishList:add'],
- children: [
- {
- path: 'add',
- component: () => import('@/views/FDS/publishList/add'),
- name: 'PublishAdd',
- meta: { title: '新增发布', activeMenu: '/build/publish' }
- }
- ]
- },
- {
- path: '/build/publishList',
- component: Layout,
- hidden: true,
- permissions: ['build:publishList:detail'],
- children: [
- {
- path: 'detail',
- component: () => import('@/views/FDS/publishList/detail'),
- name: 'PublishDetail',
- meta: { title: '发布详情', activeMenu: '/build/publish' }
- }
- ]
- },
-
- {
- path: '/build/whiteList',
- component: Layout,
- hidden: true,
- permissions: ['build:whiteListManagement:add'],
- children: [
- {
- path: 'add',
- component: () => import('@/views/FDS/whiteListManagement/add'),
- name: 'WhiteListManagementAdd',
- meta: { title: '新增白名单', activeMenu: '/build/whiteListManagement' }
- }
- ]
- },
-
- {
- path: '/build/whiteList',
- component: Layout,
- hidden: true,
- permissions: ['build:whiteListManagement:detail'],
- children: [
- {
- path: 'detail',
- component: () => import('@/views/FDS/whiteListManagement/detail'),
- name: 'WhiteListManagementDetail',
- meta: { title: '白名单详情', activeMenu: '/build/whiteListManagement' }
- }
- ]
- },
-
- {
- path: '/build/whiteList',
- component: Layout,
- hidden: true,
- permissions: ['build:whiteListManagement:equepDetail'],
- children: [
- {
- path: 'equepDetail',
- component: () => import('@/views/FDS/whiteListManagement/equepDetail'),
- name: 'WhiteListManagementEquepDetail',
- meta: { title: '白名单设备详情', activeMenu: '/build/whiteListManagement' }
- }
- ]
- },
-
- {
- path: '/build/whiteList',
- component: Layout,
- hidden: true,
- permissions: ['build:whiteListManagement:addConfig'],
- children: [
- {
- path: 'addConfig',
- component: () => import('@/views/FDS/whiteListManagement/addConfig'),
- name: 'WhiteListManagementConfigAdd',
- meta: { title: '新增白名单配置', activeMenu: '/build/whiteListManagement' }
- }
- ]
- }
]
@@ -318,11 +209,11 @@ export const dynamicRoutes = [
let routerPush = Router.prototype.push
let routerReplace = Router.prototype.replace
// push
-Router.prototype.push = function push(location) {
+Router.prototype.push = function push (location) {
return routerPush.call(this, location).catch(err => err)
}
// replace
-Router.prototype.replace = function push(location) {
+Router.prototype.replace = function push (location) {
return routerReplace.call(this, location).catch(err => err)
}
diff --git a/sf-ui/src/settings.js b/sf-ui/src/settings.js
index 059c74d..6a0b09f 100644
--- a/sf-ui/src/settings.js
+++ b/sf-ui/src/settings.js
@@ -1,44 +1,44 @@
-module.exports = {
- /**
- * 侧边栏主题 深色主题theme-dark,浅色主题theme-light
- */
- sideTheme: 'theme-dark',
-
- /**
- * 是否系统布局配置
- */
- showSettings: false,
-
- /**
- * 是否显示顶部导航
- */
- topNav: false,
-
- /**
- * 是否显示 tagsView
- */
- tagsView: true,
-
- /**
- * 是否固定头部
- */
- fixedHeader: false,
-
- /**
- * 是否显示logo
- */
- sidebarLogo: true,
-
- /**
- * 是否显示动态标题
- */
- dynamicTitle: false,
-
- /**
- * @type {string | array} 'production' | ['production', 'development']
- * @description Need show err logs component.
- * The default is only used in the production env
- * If you want to also use it in dev, you can pass ['production', 'development']
- */
- errorLog: 'production'
-}
+module.exports = {
+ /**
+ * 侧边栏主题 深色主题theme-dark,浅色主题theme-light
+ */
+ sideTheme: 'theme-dark',
+
+ /**
+ * 是否系统布局配置
+ */
+ showSettings: false,
+
+ /**
+ * 是否显示顶部导航
+ */
+ topNav: false,
+
+ /**
+ * 是否显示 tagsView
+ */
+ tagsView: true,
+
+ /**
+ * 是否固定头部
+ */
+ fixedHeader: false,
+
+ /**
+ * 是否显示logo
+ */
+ sidebarLogo: true,
+
+ /**
+ * 是否显示动态标题
+ */
+ dynamicTitle: false,
+
+ /**
+ * @type {string | array} 'production' | ['production', 'development']
+ * @description Need show err logs component.
+ * The default is only used in the production env
+ * If you want to also use it in dev, you can pass ['production', 'development']
+ */
+ errorLog: 'production'
+}
diff --git a/sf-ui/src/store/getters.js b/sf-ui/src/store/getters.js
index 46e2bee..bb20fab 100644
--- a/sf-ui/src/store/getters.js
+++ b/sf-ui/src/store/getters.js
@@ -1,20 +1,20 @@
-const getters = {
- sidebar: state => state.app.sidebar,
- size: state => state.app.size,
- device: state => state.app.device,
- dict: state => state.dict.dict,
- visitedViews: state => state.tagsView.visitedViews,
- cachedViews: state => state.tagsView.cachedViews,
- token: state => state.user.token,
- avatar: state => state.user.avatar,
- name: state => state.user.name,
- introduction: state => state.user.introduction,
- roles: state => state.user.roles,
- permissions: state => state.user.permissions,
- applicationId: state => state.user.applicationId,
- permission_routes: state => state.permission.routes,
- topbarRouters:state => state.permission.topbarRouters,
- defaultRoutes:state => state.permission.defaultRoutes,
- sidebarRouters:state => state.permission.sidebarRouters,
-}
-export default getters
+const getters = {
+ sidebar: state => state.app.sidebar,
+ size: state => state.app.size,
+ device: state => state.app.device,
+ dict: state => state.dict.dict,
+ visitedViews: state => state.tagsView.visitedViews,
+ cachedViews: state => state.tagsView.cachedViews,
+ token: state => state.user.token,
+ avatar: state => state.user.avatar,
+ name: state => state.user.name,
+ introduction: state => state.user.introduction,
+ roles: state => state.user.roles,
+ permissions: state => state.user.permissions,
+ applicationId: state => state.user.applicationId,
+ permission_routes: state => state.permission.routes,
+ topbarRouters:state => state.permission.topbarRouters,
+ defaultRoutes:state => state.permission.defaultRoutes,
+ sidebarRouters:state => state.permission.sidebarRouters,
+}
+export default getters
diff --git a/sf-ui/src/store/index.js b/sf-ui/src/store/index.js
index 2ee6e43..97aaef8 100644
--- a/sf-ui/src/store/index.js
+++ b/sf-ui/src/store/index.js
@@ -1,25 +1,25 @@
-import Vue from 'vue'
-import Vuex from 'vuex'
-import app from './modules/app'
-import dict from './modules/dict'
-import user from './modules/user'
-import tagsView from './modules/tagsView'
-import permission from './modules/permission'
-import settings from './modules/settings'
-import getters from './getters'
-
-Vue.use(Vuex)
-
-const store = new Vuex.Store({
- modules: {
- app,
- dict,
- user,
- tagsView,
- permission,
- settings
- },
- getters
-})
-
-export default store
+import Vue from 'vue'
+import Vuex from 'vuex'
+import app from './modules/app'
+import dict from './modules/dict'
+import user from './modules/user'
+import tagsView from './modules/tagsView'
+import permission from './modules/permission'
+import settings from './modules/settings'
+import getters from './getters'
+
+Vue.use(Vuex)
+
+const store = new Vuex.Store({
+ modules: {
+ app,
+ dict,
+ user,
+ tagsView,
+ permission,
+ settings
+ },
+ getters
+})
+
+export default store
diff --git a/sf-ui/src/store/modules/app.js b/sf-ui/src/store/modules/app.js
index 5a0ed6c..3e22d1c 100644
--- a/sf-ui/src/store/modules/app.js
+++ b/sf-ui/src/store/modules/app.js
@@ -1,66 +1,66 @@
-import Cookies from 'js-cookie'
-
-const state = {
- sidebar: {
- opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true,
- withoutAnimation: false,
- hide: false
- },
- device: 'desktop',
- size: Cookies.get('size') || 'medium'
-}
-
-const mutations = {
- TOGGLE_SIDEBAR: state => {
- if (state.sidebar.hide) {
- return false;
- }
- state.sidebar.opened = !state.sidebar.opened
- state.sidebar.withoutAnimation = false
- if (state.sidebar.opened) {
- Cookies.set('sidebarStatus', 1)
- } else {
- Cookies.set('sidebarStatus', 0)
- }
- },
- CLOSE_SIDEBAR: (state, withoutAnimation) => {
- Cookies.set('sidebarStatus', 0)
- state.sidebar.opened = false
- state.sidebar.withoutAnimation = withoutAnimation
- },
- TOGGLE_DEVICE: (state, device) => {
- state.device = device
- },
- SET_SIZE: (state, size) => {
- state.size = size
- Cookies.set('size', size)
- },
- SET_SIDEBAR_HIDE: (state, status) => {
- state.sidebar.hide = status
- }
-}
-
-const actions = {
- toggleSideBar({ commit }) {
- commit('TOGGLE_SIDEBAR')
- },
- closeSideBar({ commit }, { withoutAnimation }) {
- commit('CLOSE_SIDEBAR', withoutAnimation)
- },
- toggleDevice({ commit }, device) {
- commit('TOGGLE_DEVICE', device)
- },
- setSize({ commit }, size) {
- commit('SET_SIZE', size)
- },
- toggleSideBarHide({ commit }, status) {
- commit('SET_SIDEBAR_HIDE', status)
- }
-}
-
-export default {
- namespaced: true,
- state,
- mutations,
- actions
-}
+import Cookies from 'js-cookie'
+
+const state = {
+ sidebar: {
+ opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true,
+ withoutAnimation: false,
+ hide: false
+ },
+ device: 'desktop',
+ size: Cookies.get('size') || 'medium'
+}
+
+const mutations = {
+ TOGGLE_SIDEBAR: state => {
+ if (state.sidebar.hide) {
+ return false;
+ }
+ state.sidebar.opened = !state.sidebar.opened
+ state.sidebar.withoutAnimation = false
+ if (state.sidebar.opened) {
+ Cookies.set('sidebarStatus', 1)
+ } else {
+ Cookies.set('sidebarStatus', 0)
+ }
+ },
+ CLOSE_SIDEBAR: (state, withoutAnimation) => {
+ Cookies.set('sidebarStatus', 0)
+ state.sidebar.opened = false
+ state.sidebar.withoutAnimation = withoutAnimation
+ },
+ TOGGLE_DEVICE: (state, device) => {
+ state.device = device
+ },
+ SET_SIZE: (state, size) => {
+ state.size = size
+ Cookies.set('size', size)
+ },
+ SET_SIDEBAR_HIDE: (state, status) => {
+ state.sidebar.hide = status
+ }
+}
+
+const actions = {
+ toggleSideBar({ commit }) {
+ commit('TOGGLE_SIDEBAR')
+ },
+ closeSideBar({ commit }, { withoutAnimation }) {
+ commit('CLOSE_SIDEBAR', withoutAnimation)
+ },
+ toggleDevice({ commit }, device) {
+ commit('TOGGLE_DEVICE', device)
+ },
+ setSize({ commit }, size) {
+ commit('SET_SIZE', size)
+ },
+ toggleSideBarHide({ commit }, status) {
+ commit('SET_SIDEBAR_HIDE', status)
+ }
+}
+
+export default {
+ namespaced: true,
+ state,
+ mutations,
+ actions
+}
diff --git a/sf-ui/src/store/modules/dict.js b/sf-ui/src/store/modules/dict.js
index f48df42..f95bead 100644
--- a/sf-ui/src/store/modules/dict.js
+++ b/sf-ui/src/store/modules/dict.js
@@ -1,50 +1,50 @@
-const state = {
- dict: new Array()
-}
-const mutations = {
- SET_DICT: (state, { key, value }) => {
- if (key !== null && key !== "") {
- state.dict.push({
- key: key,
- value: value
- })
- }
- },
- REMOVE_DICT: (state, key) => {
- try {
- for (let i = 0; i < state.dict.length; i++) {
- if (state.dict[i].key == key) {
- state.dict.splice(i, i)
- return true
- }
- }
- } catch (e) {
- }
- },
- CLEAN_DICT: (state) => {
- state.dict = new Array()
- }
-}
-
-const actions = {
- // 设置字典
- setDict({ commit }, data) {
- commit('SET_DICT', data)
- },
- // 删除字典
- removeDict({ commit }, key) {
- commit('REMOVE_DICT', key)
- },
- // 清空字典
- cleanDict({ commit }) {
- commit('CLEAN_DICT')
- }
-}
-
-export default {
- namespaced: true,
- state,
- mutations,
- actions
-}
-
+const state = {
+ dict: new Array()
+}
+const mutations = {
+ SET_DICT: (state, { key, value }) => {
+ if (key !== null && key !== "") {
+ state.dict.push({
+ key: key,
+ value: value
+ })
+ }
+ },
+ REMOVE_DICT: (state, key) => {
+ try {
+ for (let i = 0; i < state.dict.length; i++) {
+ if (state.dict[i].key == key) {
+ state.dict.splice(i, i)
+ return true
+ }
+ }
+ } catch (e) {
+ }
+ },
+ CLEAN_DICT: (state) => {
+ state.dict = new Array()
+ }
+}
+
+const actions = {
+ // 设置字典
+ setDict({ commit }, data) {
+ commit('SET_DICT', data)
+ },
+ // 删除字典
+ removeDict({ commit }, key) {
+ commit('REMOVE_DICT', key)
+ },
+ // 清空字典
+ cleanDict({ commit }) {
+ commit('CLEAN_DICT')
+ }
+}
+
+export default {
+ namespaced: true,
+ state,
+ mutations,
+ actions
+}
+
diff --git a/sf-ui/src/store/modules/permission.js b/sf-ui/src/store/modules/permission.js
index 3577229..f77686b 100644
--- a/sf-ui/src/store/modules/permission.js
+++ b/sf-ui/src/store/modules/permission.js
@@ -1,134 +1,134 @@
-import auth from '@/plugins/auth'
-import router, { constantRoutes, dynamicRoutes } from '@/router'
-import { getRouters } from '@/api/menu'
-import Layout from '@/layout/index'
-import ParentView from '@/components/ParentView'
-import InnerLink from '@/layout/components/InnerLink'
-
-const permission = {
- state: {
- routes: [],
- addRoutes: [],
- defaultRoutes: [],
- topbarRouters: [],
- sidebarRouters: []
- },
- mutations: {
- SET_ROUTES: (state, routes) => {
- state.addRoutes = routes
- state.routes = constantRoutes.concat(routes)
- },
- SET_DEFAULT_ROUTES: (state, routes) => {
- state.defaultRoutes = constantRoutes.concat(routes)
- },
- SET_TOPBAR_ROUTES: (state, routes) => {
- state.topbarRouters = routes
- },
- SET_SIDEBAR_ROUTERS: (state, routes) => {
- state.sidebarRouters = routes
- },
- },
- actions: {
- // 生成路由
- GenerateRoutes({ commit }) {
- return new Promise(resolve => {
- // 向后端请求路由数据
- getRouters().then(res => {
- const sdata = JSON.parse(JSON.stringify(res.data))
- const rdata = JSON.parse(JSON.stringify(res.data))
- const sidebarRoutes = filterAsyncRouter(sdata)
- const rewriteRoutes = filterAsyncRouter(rdata, false, true)
- const asyncRoutes = filterDynamicRoutes(dynamicRoutes);
- rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true })
- router.addRoutes(asyncRoutes);
- commit('SET_ROUTES', rewriteRoutes)
- commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes))
- commit('SET_DEFAULT_ROUTES', sidebarRoutes)
- commit('SET_TOPBAR_ROUTES', sidebarRoutes)
- resolve(rewriteRoutes)
- })
- })
- }
- }
-}
-
-// 遍历后台传来的路由字符串,转换为组件对象
-function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
- return asyncRouterMap.filter(route => {
- if (type && route.children) {
- route.children = filterChildren(route.children)
- }
- if (route.component) {
- // Layout ParentView 组件特殊处理
- if (route.component === 'Layout') {
- route.component = Layout
- } else if (route.component === 'ParentView') {
- route.component = ParentView
- } else if (route.component === 'InnerLink') {
- route.component = InnerLink
- } else {
- route.component = loadView(route.component)
- }
- }
- if (route.children != null && route.children && route.children.length) {
- route.children = filterAsyncRouter(route.children, route, type)
- } else {
- delete route['children']
- delete route['redirect']
- }
- return true
- })
-}
-
-function filterChildren(childrenMap, lastRouter = false) {
- var children = []
- childrenMap.forEach((el, index) => {
- if (el.children && el.children.length) {
- if (el.component === 'ParentView' && !lastRouter) {
- el.children.forEach(c => {
- c.path = el.path + '/' + c.path
- if (c.children && c.children.length) {
- children = children.concat(filterChildren(c.children, c))
- return
- }
- children.push(c)
- })
- return
- }
- }
- if (lastRouter) {
- el.path = lastRouter.path + '/' + el.path
- }
- children = children.concat(el)
- })
- return children
-}
-
-// 动态路由遍历,验证是否具备权限
-export function filterDynamicRoutes(routes) {
- const res = []
- routes.forEach(route => {
- if (route.permissions) {
- if (auth.hasPermiOr(route.permissions)) {
- res.push(route)
- }
- } else if (route.roles) {
- if (auth.hasRoleOr(route.roles)) {
- res.push(route)
- }
- }
- })
- return res
-}
-
-export const loadView = (view) => {
- if (process.env.NODE_ENV === 'development') {
- return (resolve) => require([`@/views/${view}`], resolve)
- } else {
- // 使用 import 实现生产环境的路由懒加载
- //return () => require([`@/views/${view}`], resolve)
- return (resolve) => require([`@/views/${view}`], resolve)
- }
-}
-
-export default permission
+import auth from '@/plugins/auth'
+import router, { constantRoutes, dynamicRoutes } from '@/router'
+import { getRouters } from '@/api/menu'
+import Layout from '@/layout/index'
+import ParentView from '@/components/ParentView'
+import InnerLink from '@/layout/components/InnerLink'
+
+const permission = {
+ state: {
+ routes: [],
+ addRoutes: [],
+ defaultRoutes: [],
+ topbarRouters: [],
+ sidebarRouters: []
+ },
+ mutations: {
+ SET_ROUTES: (state, routes) => {
+ state.addRoutes = routes
+ state.routes = constantRoutes.concat(routes)
+ },
+ SET_DEFAULT_ROUTES: (state, routes) => {
+ state.defaultRoutes = constantRoutes.concat(routes)
+ },
+ SET_TOPBAR_ROUTES: (state, routes) => {
+ state.topbarRouters = routes
+ },
+ SET_SIDEBAR_ROUTERS: (state, routes) => {
+ state.sidebarRouters = routes
+ },
+ },
+ actions: {
+ // 生成路由
+ GenerateRoutes({ commit }) {
+ return new Promise(resolve => {
+ // 向后端请求路由数据
+ getRouters().then(res => {
+ const sdata = JSON.parse(JSON.stringify(res.data))
+ const rdata = JSON.parse(JSON.stringify(res.data))
+ const sidebarRoutes = filterAsyncRouter(sdata)
+ const rewriteRoutes = filterAsyncRouter(rdata, false, true)
+ const asyncRoutes = filterDynamicRoutes(dynamicRoutes);
+ rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true })
+ router.addRoutes(asyncRoutes);
+ commit('SET_ROUTES', rewriteRoutes)
+ commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes))
+ commit('SET_DEFAULT_ROUTES', sidebarRoutes)
+ commit('SET_TOPBAR_ROUTES', sidebarRoutes)
+ resolve(rewriteRoutes)
+ })
+ })
+ }
+ }
+}
+
+// 遍历后台传来的路由字符串,转换为组件对象
+function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
+ return asyncRouterMap.filter(route => {
+ if (type && route.children) {
+ route.children = filterChildren(route.children)
+ }
+ if (route.component) {
+ // Layout ParentView 组件特殊处理
+ if (route.component === 'Layout') {
+ route.component = Layout
+ } else if (route.component === 'ParentView') {
+ route.component = ParentView
+ } else if (route.component === 'InnerLink') {
+ route.component = InnerLink
+ } else {
+ route.component = loadView(route.component)
+ }
+ }
+ if (route.children != null && route.children && route.children.length) {
+ route.children = filterAsyncRouter(route.children, route, type)
+ } else {
+ delete route['children']
+ delete route['redirect']
+ }
+ return true
+ })
+}
+
+function filterChildren(childrenMap, lastRouter = false) {
+ var children = []
+ childrenMap.forEach((el, index) => {
+ if (el.children && el.children.length) {
+ if (el.component === 'ParentView' && !lastRouter) {
+ el.children.forEach(c => {
+ c.path = el.path + '/' + c.path
+ if (c.children && c.children.length) {
+ children = children.concat(filterChildren(c.children, c))
+ return
+ }
+ children.push(c)
+ })
+ return
+ }
+ }
+ if (lastRouter) {
+ el.path = lastRouter.path + '/' + el.path
+ }
+ children = children.concat(el)
+ })
+ return children
+}
+
+// 动态路由遍历,验证是否具备权限
+export function filterDynamicRoutes(routes) {
+ const res = []
+ routes.forEach(route => {
+ if (route.permissions) {
+ if (auth.hasPermiOr(route.permissions)) {
+ res.push(route)
+ }
+ } else if (route.roles) {
+ if (auth.hasRoleOr(route.roles)) {
+ res.push(route)
+ }
+ }
+ })
+ return res
+}
+
+export const loadView = (view) => {
+ if (process.env.NODE_ENV === 'development') {
+ return (resolve) => require([`@/views/${view}`], resolve)
+ } else {
+ // 使用 import 实现生产环境的路由懒加载
+ //return () => require([`@/views/${view}`], resolve)
+ return (resolve) => require([`@/views/${view}`], resolve)
+ }
+}
+
+export default permission
diff --git a/sf-ui/src/store/modules/settings.js b/sf-ui/src/store/modules/settings.js
index d08d8c2..7187b08 100644
--- a/sf-ui/src/store/modules/settings.js
+++ b/sf-ui/src/store/modules/settings.js
@@ -1,42 +1,42 @@
-import defaultSettings from '@/settings'
-
-const { sideTheme, showSettings, topNav, tagsView, fixedHeader, sidebarLogo, dynamicTitle } = defaultSettings
-
-const storageSetting = JSON.parse(localStorage.getItem('layout-setting')) || ''
-const state = {
- title: '',
- theme: storageSetting.theme || '#409EFF',
- sideTheme: storageSetting.sideTheme || sideTheme,
- showSettings: showSettings,
- topNav: storageSetting.topNav === undefined ? topNav : storageSetting.topNav,
- tagsView: storageSetting.tagsView === undefined ? tagsView : storageSetting.tagsView,
- fixedHeader: storageSetting.fixedHeader === undefined ? fixedHeader : storageSetting.fixedHeader,
- sidebarLogo: storageSetting.sidebarLogo === undefined ? sidebarLogo : storageSetting.sidebarLogo,
- dynamicTitle: storageSetting.dynamicTitle === undefined ? dynamicTitle : storageSetting.dynamicTitle
-}
-const mutations = {
- CHANGE_SETTING: (state, { key, value }) => {
- if (state.hasOwnProperty(key)) {
- state[key] = value
- }
- }
-}
-
-const actions = {
- // 修改布局设置
- changeSetting({ commit }, data) {
- commit('CHANGE_SETTING', data)
- },
- // 设置网页标题
- setTitle({ commit }, title) {
- state.title = title
- }
-}
-
-export default {
- namespaced: true,
- state,
- mutations,
- actions
-}
-
+import defaultSettings from '@/settings'
+
+const { sideTheme, showSettings, topNav, tagsView, fixedHeader, sidebarLogo, dynamicTitle } = defaultSettings
+
+const storageSetting = JSON.parse(localStorage.getItem('layout-setting')) || ''
+const state = {
+ title: '',
+ theme: storageSetting.theme || '#3F68FF',
+ sideTheme: storageSetting.sideTheme || sideTheme,
+ showSettings: showSettings,
+ topNav: storageSetting.topNav === undefined ? topNav : storageSetting.topNav,
+ tagsView: storageSetting.tagsView === undefined ? tagsView : storageSetting.tagsView,
+ fixedHeader: storageSetting.fixedHeader === undefined ? fixedHeader : storageSetting.fixedHeader,
+ sidebarLogo: storageSetting.sidebarLogo === undefined ? sidebarLogo : storageSetting.sidebarLogo,
+ dynamicTitle: storageSetting.dynamicTitle === undefined ? dynamicTitle : storageSetting.dynamicTitle
+}
+const mutations = {
+ CHANGE_SETTING: (state, { key, value }) => {
+ if (state.hasOwnProperty(key)) {
+ state[key] = value
+ }
+ }
+}
+
+const actions = {
+ // 修改布局设置
+ changeSetting({ commit }, data) {
+ commit('CHANGE_SETTING', data)
+ },
+ // 设置网页标题
+ setTitle({ commit }, title) {
+ state.title = title
+ }
+}
+
+export default {
+ namespaced: true,
+ state,
+ mutations,
+ actions
+}
+
diff --git a/sf-ui/src/store/modules/tagsView.js b/sf-ui/src/store/modules/tagsView.js
index 9a88c2b..5fc011c 100644
--- a/sf-ui/src/store/modules/tagsView.js
+++ b/sf-ui/src/store/modules/tagsView.js
@@ -1,228 +1,228 @@
-const state = {
- visitedViews: [],
- cachedViews: [],
- iframeViews: []
-}
-
-const mutations = {
- ADD_IFRAME_VIEW: (state, view) => {
- if (state.iframeViews.some(v => v.path === view.path)) return
- state.iframeViews.push(
- Object.assign({}, view, {
- title: view.meta.title || 'no-name'
- })
- )
- },
- ADD_VISITED_VIEW: (state, view) => {
- if (state.visitedViews.some(v => v.path === view.path)) return
- state.visitedViews.push(
- Object.assign({}, view, {
- title: view.meta.title || 'no-name'
- })
- )
- },
- ADD_CACHED_VIEW: (state, view) => {
- if (state.cachedViews.includes(view.name)) return
- if (view.meta && !view.meta.noCache) {
- state.cachedViews.push(view.name)
- }
- },
- DEL_VISITED_VIEW: (state, view) => {
- for (const [i, v] of state.visitedViews.entries()) {
- if (v.path === view.path) {
- state.visitedViews.splice(i, 1)
- break
- }
- }
- state.iframeViews = state.iframeViews.filter(item => item.path !== view.path)
- },
- DEL_IFRAME_VIEW: (state, view) => {
- state.iframeViews = state.iframeViews.filter(item => item.path !== view.path)
- },
- DEL_CACHED_VIEW: (state, view) => {
- const index = state.cachedViews.indexOf(view.name)
- index > -1 && state.cachedViews.splice(index, 1)
- },
-
- DEL_OTHERS_VISITED_VIEWS: (state, view) => {
- state.visitedViews = state.visitedViews.filter(v => {
- return v.meta.affix || v.path === view.path
- })
- state.iframeViews = state.iframeViews.filter(item => item.path === view.path)
- },
- DEL_OTHERS_CACHED_VIEWS: (state, view) => {
- const index = state.cachedViews.indexOf(view.name)
- if (index > -1) {
- state.cachedViews = state.cachedViews.slice(index, index + 1)
- } else {
- state.cachedViews = []
- }
- },
- DEL_ALL_VISITED_VIEWS: state => {
- // keep affix tags
- const affixTags = state.visitedViews.filter(tag => tag.meta.affix)
- state.visitedViews = affixTags
- state.iframeViews = []
- },
- DEL_ALL_CACHED_VIEWS: state => {
- state.cachedViews = []
- },
- UPDATE_VISITED_VIEW: (state, view) => {
- for (let v of state.visitedViews) {
- if (v.path === view.path) {
- v = Object.assign(v, view)
- break
- }
- }
- },
- DEL_RIGHT_VIEWS: (state, view) => {
- const index = state.visitedViews.findIndex(v => v.path === view.path)
- if (index === -1) {
- return
- }
- state.visitedViews = state.visitedViews.filter((item, idx) => {
- if (idx <= index || (item.meta && item.meta.affix)) {
- return true
- }
- const i = state.cachedViews.indexOf(item.name)
- if (i > -1) {
- state.cachedViews.splice(i, 1)
- }
- if(item.meta.link) {
- const fi = state.iframeViews.findIndex(v => v.path === item.path)
- state.iframeViews.splice(fi, 1)
- }
- return false
- })
- },
- DEL_LEFT_VIEWS: (state, view) => {
- const index = state.visitedViews.findIndex(v => v.path === view.path)
- if (index === -1) {
- return
- }
- state.visitedViews = state.visitedViews.filter((item, idx) => {
- if (idx >= index || (item.meta && item.meta.affix)) {
- return true
- }
- const i = state.cachedViews.indexOf(item.name)
- if (i > -1) {
- state.cachedViews.splice(i, 1)
- }
- if(item.meta.link) {
- const fi = state.iframeViews.findIndex(v => v.path === item.path)
- state.iframeViews.splice(fi, 1)
- }
- return false
- })
- }
-}
-
-const actions = {
- addView({ dispatch }, view) {
- dispatch('addVisitedView', view)
- dispatch('addCachedView', view)
- },
- addIframeView({ commit }, view) {
- commit('ADD_IFRAME_VIEW', view)
- },
- addVisitedView({ commit }, view) {
- commit('ADD_VISITED_VIEW', view)
- },
- addCachedView({ commit }, view) {
- commit('ADD_CACHED_VIEW', view)
- },
- delView({ dispatch, state }, view) {
- return new Promise(resolve => {
- dispatch('delVisitedView', view)
- dispatch('delCachedView', view)
- resolve({
- visitedViews: [...state.visitedViews],
- cachedViews: [...state.cachedViews]
- })
- })
- },
- delVisitedView({ commit, state }, view) {
- return new Promise(resolve => {
- commit('DEL_VISITED_VIEW', view)
- resolve([...state.visitedViews])
- })
- },
- delIframeView({ commit, state }, view) {
- return new Promise(resolve => {
- commit('DEL_IFRAME_VIEW', view)
- resolve([...state.iframeViews])
- })
- },
- delCachedView({ commit, state }, view) {
- return new Promise(resolve => {
- commit('DEL_CACHED_VIEW', view)
- resolve([...state.cachedViews])
- })
- },
- delOthersViews({ dispatch, state }, view) {
- return new Promise(resolve => {
- dispatch('delOthersVisitedViews', view)
- dispatch('delOthersCachedViews', view)
- resolve({
- visitedViews: [...state.visitedViews],
- cachedViews: [...state.cachedViews]
- })
- })
- },
- delOthersVisitedViews({ commit, state }, view) {
- return new Promise(resolve => {
- commit('DEL_OTHERS_VISITED_VIEWS', view)
- resolve([...state.visitedViews])
- })
- },
- delOthersCachedViews({ commit, state }, view) {
- return new Promise(resolve => {
- commit('DEL_OTHERS_CACHED_VIEWS', view)
- resolve([...state.cachedViews])
- })
- },
- delAllViews({ dispatch, state }, view) {
- return new Promise(resolve => {
- dispatch('delAllVisitedViews', view)
- dispatch('delAllCachedViews', view)
- resolve({
- visitedViews: [...state.visitedViews],
- cachedViews: [...state.cachedViews]
- })
- })
- },
- delAllVisitedViews({ commit, state }) {
- return new Promise(resolve => {
- commit('DEL_ALL_VISITED_VIEWS')
- resolve([...state.visitedViews])
- })
- },
- delAllCachedViews({ commit, state }) {
- return new Promise(resolve => {
- commit('DEL_ALL_CACHED_VIEWS')
- resolve([...state.cachedViews])
- })
- },
- updateVisitedView({ commit }, view) {
- commit('UPDATE_VISITED_VIEW', view)
- },
- delRightTags({ commit }, view) {
- return new Promise(resolve => {
- commit('DEL_RIGHT_VIEWS', view)
- resolve([...state.visitedViews])
- })
- },
- delLeftTags({ commit }, view) {
- return new Promise(resolve => {
- commit('DEL_LEFT_VIEWS', view)
- resolve([...state.visitedViews])
- })
- },
-}
-
-export default {
- namespaced: true,
- state,
- mutations,
- actions
-}
+const state = {
+ visitedViews: [],
+ cachedViews: [],
+ iframeViews: []
+}
+
+const mutations = {
+ ADD_IFRAME_VIEW: (state, view) => {
+ if (state.iframeViews.some(v => v.path === view.path)) return
+ state.iframeViews.push(
+ Object.assign({}, view, {
+ title: view.meta.title || 'no-name'
+ })
+ )
+ },
+ ADD_VISITED_VIEW: (state, view) => {
+ if (state.visitedViews.some(v => v.path === view.path)) return
+ state.visitedViews.push(
+ Object.assign({}, view, {
+ title: view.meta.title || 'no-name'
+ })
+ )
+ },
+ ADD_CACHED_VIEW: (state, view) => {
+ if (state.cachedViews.includes(view.name)) return
+ if (view.meta && !view.meta.noCache) {
+ state.cachedViews.push(view.name)
+ }
+ },
+ DEL_VISITED_VIEW: (state, view) => {
+ for (const [i, v] of state.visitedViews.entries()) {
+ if (v.path === view.path) {
+ state.visitedViews.splice(i, 1)
+ break
+ }
+ }
+ state.iframeViews = state.iframeViews.filter(item => item.path !== view.path)
+ },
+ DEL_IFRAME_VIEW: (state, view) => {
+ state.iframeViews = state.iframeViews.filter(item => item.path !== view.path)
+ },
+ DEL_CACHED_VIEW: (state, view) => {
+ const index = state.cachedViews.indexOf(view.name)
+ index > -1 && state.cachedViews.splice(index, 1)
+ },
+
+ DEL_OTHERS_VISITED_VIEWS: (state, view) => {
+ state.visitedViews = state.visitedViews.filter(v => {
+ return v.meta.affix || v.path === view.path
+ })
+ state.iframeViews = state.iframeViews.filter(item => item.path === view.path)
+ },
+ DEL_OTHERS_CACHED_VIEWS: (state, view) => {
+ const index = state.cachedViews.indexOf(view.name)
+ if (index > -1) {
+ state.cachedViews = state.cachedViews.slice(index, index + 1)
+ } else {
+ state.cachedViews = []
+ }
+ },
+ DEL_ALL_VISITED_VIEWS: state => {
+ // keep affix tags
+ const affixTags = state.visitedViews.filter(tag => tag.meta.affix)
+ state.visitedViews = affixTags
+ state.iframeViews = []
+ },
+ DEL_ALL_CACHED_VIEWS: state => {
+ state.cachedViews = []
+ },
+ UPDATE_VISITED_VIEW: (state, view) => {
+ for (let v of state.visitedViews) {
+ if (v.path === view.path) {
+ v = Object.assign(v, view)
+ break
+ }
+ }
+ },
+ DEL_RIGHT_VIEWS: (state, view) => {
+ const index = state.visitedViews.findIndex(v => v.path === view.path)
+ if (index === -1) {
+ return
+ }
+ state.visitedViews = state.visitedViews.filter((item, idx) => {
+ if (idx <= index || (item.meta && item.meta.affix)) {
+ return true
+ }
+ const i = state.cachedViews.indexOf(item.name)
+ if (i > -1) {
+ state.cachedViews.splice(i, 1)
+ }
+ if(item.meta.link) {
+ const fi = state.iframeViews.findIndex(v => v.path === item.path)
+ state.iframeViews.splice(fi, 1)
+ }
+ return false
+ })
+ },
+ DEL_LEFT_VIEWS: (state, view) => {
+ const index = state.visitedViews.findIndex(v => v.path === view.path)
+ if (index === -1) {
+ return
+ }
+ state.visitedViews = state.visitedViews.filter((item, idx) => {
+ if (idx >= index || (item.meta && item.meta.affix)) {
+ return true
+ }
+ const i = state.cachedViews.indexOf(item.name)
+ if (i > -1) {
+ state.cachedViews.splice(i, 1)
+ }
+ if(item.meta.link) {
+ const fi = state.iframeViews.findIndex(v => v.path === item.path)
+ state.iframeViews.splice(fi, 1)
+ }
+ return false
+ })
+ }
+}
+
+const actions = {
+ addView({ dispatch }, view) {
+ dispatch('addVisitedView', view)
+ dispatch('addCachedView', view)
+ },
+ addIframeView({ commit }, view) {
+ commit('ADD_IFRAME_VIEW', view)
+ },
+ addVisitedView({ commit }, view) {
+ commit('ADD_VISITED_VIEW', view)
+ },
+ addCachedView({ commit }, view) {
+ commit('ADD_CACHED_VIEW', view)
+ },
+ delView({ dispatch, state }, view) {
+ return new Promise(resolve => {
+ dispatch('delVisitedView', view)
+ dispatch('delCachedView', view)
+ resolve({
+ visitedViews: [...state.visitedViews],
+ cachedViews: [...state.cachedViews]
+ })
+ })
+ },
+ delVisitedView({ commit, state }, view) {
+ return new Promise(resolve => {
+ commit('DEL_VISITED_VIEW', view)
+ resolve([...state.visitedViews])
+ })
+ },
+ delIframeView({ commit, state }, view) {
+ return new Promise(resolve => {
+ commit('DEL_IFRAME_VIEW', view)
+ resolve([...state.iframeViews])
+ })
+ },
+ delCachedView({ commit, state }, view) {
+ return new Promise(resolve => {
+ commit('DEL_CACHED_VIEW', view)
+ resolve([...state.cachedViews])
+ })
+ },
+ delOthersViews({ dispatch, state }, view) {
+ return new Promise(resolve => {
+ dispatch('delOthersVisitedViews', view)
+ dispatch('delOthersCachedViews', view)
+ resolve({
+ visitedViews: [...state.visitedViews],
+ cachedViews: [...state.cachedViews]
+ })
+ })
+ },
+ delOthersVisitedViews({ commit, state }, view) {
+ return new Promise(resolve => {
+ commit('DEL_OTHERS_VISITED_VIEWS', view)
+ resolve([...state.visitedViews])
+ })
+ },
+ delOthersCachedViews({ commit, state }, view) {
+ return new Promise(resolve => {
+ commit('DEL_OTHERS_CACHED_VIEWS', view)
+ resolve([...state.cachedViews])
+ })
+ },
+ delAllViews({ dispatch, state }, view) {
+ return new Promise(resolve => {
+ dispatch('delAllVisitedViews', view)
+ dispatch('delAllCachedViews', view)
+ resolve({
+ visitedViews: [...state.visitedViews],
+ cachedViews: [...state.cachedViews]
+ })
+ })
+ },
+ delAllVisitedViews({ commit, state }) {
+ return new Promise(resolve => {
+ commit('DEL_ALL_VISITED_VIEWS')
+ resolve([...state.visitedViews])
+ })
+ },
+ delAllCachedViews({ commit, state }) {
+ return new Promise(resolve => {
+ commit('DEL_ALL_CACHED_VIEWS')
+ resolve([...state.cachedViews])
+ })
+ },
+ updateVisitedView({ commit }, view) {
+ commit('UPDATE_VISITED_VIEW', view)
+ },
+ delRightTags({ commit }, view) {
+ return new Promise(resolve => {
+ commit('DEL_RIGHT_VIEWS', view)
+ resolve([...state.visitedViews])
+ })
+ },
+ delLeftTags({ commit }, view) {
+ return new Promise(resolve => {
+ commit('DEL_LEFT_VIEWS', view)
+ resolve([...state.visitedViews])
+ })
+ },
+}
+
+export default {
+ namespaced: true,
+ state,
+ mutations,
+ actions
+}
diff --git a/sf-ui/src/store/modules/user.js b/sf-ui/src/store/modules/user.js
index f917886..0d0ca01 100644
--- a/sf-ui/src/store/modules/user.js
+++ b/sf-ui/src/store/modules/user.js
@@ -1,133 +1,141 @@
-import { getInfo, login, logout } from '@/api/login'
-import { getToken, removeToken, setToken } from '@/utils/auth'
-import {
- getApplicationId,
- removeApplicationId,
- removeApplicationName,
- setApplicationId,
- setApplicationName
-} from '@/utils/application'
-import Cookies from 'js-cookie'
-
-const user = {
- state: {
- token: getToken(),
- name: '',
- avatar: '',
- roles: [],
- permissions: [],
- applicationId: getApplicationId(),
- applicationInfo: {} // 用户选中的项目/应用
- },
-
- mutations: {
- SET_TOKEN: (state, token) => {
- state.token = token
- },
- SET_NAME: (state, name) => {
- state.name = name
- },
- SET_AVATAR: (state, avatar) => {
- state.avatar = avatar
- },
- SET_ROLES: (state, roles) => {
- state.roles = roles
- },
- SET_PERMISSIONS: (state, permissions) => {
- state.permissions = permissions
- },
- SET_APPLICATION: (state, applicationInfo) => {
- const { id } = applicationInfo
- state.applicationId = id || ''
- state.applicationInfo = applicationInfo
- }
- },
-
- actions: {
- // 登录
- Login({ commit }, userInfo) {
- const username = userInfo.username.trim()
- const password = userInfo.password
- const code = userInfo.code
- const uuid = userInfo.uuid
- return new Promise((resolve, reject) => {
- login(username, password, code, uuid).then(res => {
- setToken(res.token)
- commit('SET_TOKEN', res.token)
- resolve()
- }).catch(error => {
- reject(error)
- })
- })
- },
-
- // 获取用户信息
- GetInfo({ commit, state }) {
- return new Promise((resolve, reject) => {
- getInfo().then(res => {
- const user = res.user
- const avatar = (user.avatar == '' || user.avatar == null) ? require('@/assets/images/profile.jpg') : process.env.VUE_APP_BASE_API + user.avatar
- if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
- commit('SET_ROLES', res.roles)
- commit('SET_PERMISSIONS', res.permissions)
- } else {
- commit('SET_ROLES', ['ROLE_DEFAULT'])
- }
- commit('SET_NAME', user.userName)
- commit('SET_AVATAR', avatar)
- resolve(res)
- }).catch(error => {
- reject(error)
- })
- })
- },
-
- // 退出系统
- LogOut({ commit, state }) {
- return new Promise((resolve, reject) => {
- logout(state.token).then(() => {
- commit('SET_TOKEN', '')
- commit('SET_ROLES', [])
- commit('SET_PERMISSIONS', [])
- commit('SET_APPLICATION', {})
- removeApplicationId()
- removeToken()
- resolve()
- }).catch(error => {
- reject(error)
- })
- })
- },
-
- // 前端 登出
- FedLogOut({ commit }) {
- return new Promise(resolve => {
- commit('SET_TOKEN', '')
- commit('SET_APPLICATION', {})
- removeApplicationId()
- removeToken()
- resolve()
- })
- },
-
- // 设置选中的项目应用信息
- SetApplication({ commit }, applicationInfo) {
- commit('SET_APPLICATION', applicationInfo)
- const { id, appName } = applicationInfo || {}
- if (id) {
- setApplicationId(applicationInfo.id)
- Cookies.set('Admin-Application-appCode', applicationInfo.appCode)
- } else {
- removeApplicationId()
- Cookies.remove('Admin-Application-appCode')
- }
- if (appName) {
- setApplicationName(applicationInfo.appName)
- } else {
- removeApplicationName()
- }
- }
- }
-}
-
-export default user
+import { getInfo, login, logout } from '@/api/login'
+import { getToken, removeToken, setToken } from '@/utils/auth'
+import {
+ getApplicationId,
+ removeApplicationId,
+ removeApplicationName,
+ setApplicationId,
+ setApplicationName
+} from '@/utils/application'
+import Cookies from 'js-cookie'
+
+const user = {
+ state: {
+ token: getToken(),
+ name: '',
+ avatar: '',
+ roles: [],
+ permissions: [],
+ applicationId: getApplicationId(),
+ applicationInfo: {} // 用户选中的项目/应用
+ },
+
+ mutations: {
+ SET_TOKEN: (state, token) => {
+ state.token = token
+ },
+ SET_NAME: (state, name) => {
+ state.name = name
+ },
+ SET_AVATAR: (state, avatar) => {
+ state.avatar = avatar
+ },
+ SET_ROLES: (state, roles) => {
+ state.roles = roles
+ },
+ SET_PERMISSIONS: (state, permissions) => {
+ state.permissions = permissions
+ },
+ SET_APPLICATION: (state, applicationInfo) => {
+ const { appCode } = applicationInfo
+ state.applicationId = appCode || ''
+ state.applicationInfo = applicationInfo
+ }
+ },
+
+ actions: {
+ // 登录
+ Login ({ commit }, userInfo) {
+ const username = userInfo.username.trim()
+ const password = userInfo.password
+ const code = userInfo.code
+ const uuid = userInfo.uuid
+ return new Promise((resolve, reject) => {
+ login(username, password, code, uuid).then(res => {
+ setToken(res.token)
+ commit('SET_TOKEN', res.token)
+ resolve()
+ }).catch(error => {
+ reject(error)
+ })
+ })
+ },
+
+ // 获取用户信息
+ GetInfo ({ commit, state }) {
+ return new Promise((resolve, reject) => {
+ getInfo().then(res => {
+ const user = res.user
+ const avatar = (user.avatar == '' || user.avatar == null) ? require('@/assets/images/profile.png') : process.env.VUE_APP_BASE_API + user.avatar
+ if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
+ commit('SET_ROLES', res.roles)
+ commit('SET_PERMISSIONS', res.permissions)
+ } else {
+ commit('SET_ROLES', ['ROLE_DEFAULT'])
+ }
+ commit('SET_NAME', user.userName)
+ commit('SET_AVATAR', avatar)
+ resolve(res)
+ }).catch(error => {
+ reject(error)
+ })
+ })
+ },
+
+ // 退出系统
+ LogOut ({ commit, state }) {
+ return new Promise((resolve, reject) => {
+ logout(state.token).then(() => {
+ commit('SET_TOKEN', '')
+ commit('SET_ROLES', [])
+ commit('SET_PERMISSIONS', [])
+ commit('SET_APPLICATION', {})
+ removeApplicationId()
+ removeToken()
+ resolve()
+ }).catch(error => {
+ reject(error)
+ })
+ })
+ },
+
+ // 前端 登出
+ FedLogOut ({ commit }) {
+ return new Promise(resolve => {
+ commit('SET_TOKEN', '')
+ commit('SET_APPLICATION', {})
+ removeApplicationId()
+ removeToken()
+ resolve()
+ })
+ },
+
+ // 设置选中的项目应用信息
+ SetApplication ({ commit }, applicationInfo) {
+ commit('SET_APPLICATION', applicationInfo)
+ const { appCode, appName, isAdmin } = applicationInfo || {}
+ if (appCode) {
+ setApplicationId(appCode)
+ Cookies.set('Admin-Application-appCode', applicationInfo.appCode)
+ } else {
+ removeApplicationId()
+ Cookies.remove('Admin-Application-appCode')
+ }
+ if (appName) {
+ setApplicationName(applicationInfo.appName)
+ } else {
+ removeApplicationName()
+ }
+
+
+ if (isAdmin) {
+ Cookies.set('Admin-isAdmin', isAdmin)
+ } else {
+ Cookies.set('Admin-isAdmin', 0)
+ }
+
+ }
+ }
+}
+
+export default user
diff --git a/sf-ui/src/utils/application.js b/sf-ui/src/utils/application.js
index bb027b2..6e2e0fc 100644
--- a/sf-ui/src/utils/application.js
+++ b/sf-ui/src/utils/application.js
@@ -8,7 +8,7 @@ const ApplicationKeywords = 'Admin-Application-Name'
* 该函数从Cookie中检索与应用项目相关的关键信息。
* @returns {string} 返回从Cookie中获取的应用项目ID。
*/
-export function getApplicationId() {
+export function getApplicationId () {
return Cookies.get(ApplicationKey)
}
@@ -17,7 +17,7 @@ export function getApplicationId() {
* 该函数从Cookie中检索与应用项目相关的关键信息。
* @returns {string} 返回从Cookie中获取的应用项目ID。
*/
-export function getApplicationName() {
+export function getApplicationName () {
return Cookies.get(ApplicationKeywords)
}
@@ -26,7 +26,7 @@ export function getApplicationName() {
* @param {string} ApplicationId - 需要设置的应用项目ID。
* @return {boolean|Object} 返回Cookie设置的结果。成功则返回true,失败则返回设置失败的对象。
*/
-export function setApplicationId(ApplicationId) {
+export function setApplicationId (ApplicationId) {
return Cookies.set(ApplicationKey, ApplicationId)
}
@@ -35,7 +35,7 @@ export function setApplicationId(ApplicationId) {
* @param {string} ApplicationId - 需要设置的应用项目名称。
* @return {boolean|Object} 返回Cookie设置的结果。成功则返回true,失败则返回设置失败的对象。
*/
-export function setApplicationName(ApplicationName) {
+export function setApplicationName (ApplicationName) {
return Cookies.set(ApplicationKeywords, ApplicationName)
}
@@ -44,7 +44,7 @@ export function setApplicationName(ApplicationName) {
* 本函数用于删除与应用相关的ID Cookie。
* @returns {boolean} 返回删除操作的结果。如果删除成功,则返回true;如果删除失败,则返回false。
*/
-export function removeApplicationId() {
+export function removeApplicationId () {
return Cookies.remove(ApplicationKey)
}
@@ -53,7 +53,7 @@ export function removeApplicationId() {
* 本函数用于删除与应用相关的Name Cookie。
* @returns {boolean} 返回删除操作的结果。如果删除成功,则返回true;如果删除失败,则返回false。
*/
-export function removeApplicationName() {
+export function removeApplicationName () {
return Cookies.remove(ApplicationKeywords)
}
diff --git a/sf-ui/src/utils/auth.js b/sf-ui/src/utils/auth.js
index 88d7b6c..08a43d6 100644
--- a/sf-ui/src/utils/auth.js
+++ b/sf-ui/src/utils/auth.js
@@ -1,15 +1,15 @@
-import Cookies from 'js-cookie'
-
-const TokenKey = 'Admin-Token'
-
-export function getToken() {
- return Cookies.get(TokenKey)
-}
-
-export function setToken(token) {
- return Cookies.set(TokenKey, token)
-}
-
-export function removeToken() {
- return Cookies.remove(TokenKey)
-}
+import Cookies from 'js-cookie'
+
+const TokenKey = 'Admin-Token'
+
+export function getToken() {
+ return Cookies.get(TokenKey)
+}
+
+export function setToken(token) {
+ return Cookies.set(TokenKey, token)
+}
+
+export function removeToken() {
+ return Cookies.remove(TokenKey)
+}
diff --git a/sf-ui/src/utils/dict/Dict.js b/sf-ui/src/utils/dict/Dict.js
index 22db32f..104bd6e 100644
--- a/sf-ui/src/utils/dict/Dict.js
+++ b/sf-ui/src/utils/dict/Dict.js
@@ -1,82 +1,82 @@
-import Vue from 'vue'
-import { mergeRecursive } from "@/utils/ruoyi";
-import DictMeta from './DictMeta'
-import DictData from './DictData'
-
-const DEFAULT_DICT_OPTIONS = {
- types: [],
-}
-
-/**
- * @classdesc 字典
- * @property {Object} label 标签对象,内部属性名为字典类型名称
- * @property {Object} dict 字段数组,内部属性名为字典类型名称
- * @property {Array.} _dictMetas 字典元数据数组
- */
-export default class Dict {
- constructor() {
- this.owner = null
- this.label = {}
- this.type = {}
- }
-
- init(options) {
- if (options instanceof Array) {
- options = { types: options }
- }
- const opts = mergeRecursive(DEFAULT_DICT_OPTIONS, options)
- if (opts.types === undefined) {
- throw new Error('need dict types')
- }
- const ps = []
- this._dictMetas = opts.types.map(t => DictMeta.parse(t))
- this._dictMetas.forEach(dictMeta => {
- const type = dictMeta.type
- Vue.set(this.label, type, {})
- Vue.set(this.type, type, [])
- if (dictMeta.lazy) {
- return
- }
- ps.push(loadDict(this, dictMeta))
- })
- return Promise.all(ps)
- }
-
- /**
- * 重新加载字典
- * @param {String} type 字典类型
- */
- reloadDict(type) {
- const dictMeta = this._dictMetas.find(e => e.type === type)
- if (dictMeta === undefined) {
- return Promise.reject(`the dict meta of ${type} was not found`)
- }
- return loadDict(this, dictMeta)
- }
-}
-
-/**
- * 加载字典
- * @param {Dict} dict 字典
- * @param {DictMeta} dictMeta 字典元数据
- * @returns {Promise}
- */
-function loadDict(dict, dictMeta) {
- return dictMeta.request(dictMeta)
- .then(response => {
- const type = dictMeta.type
- let dicts = dictMeta.responseConverter(response, dictMeta)
- if (!(dicts instanceof Array)) {
- console.error('the return of responseConverter must be Array.')
- dicts = []
- } else if (dicts.filter(d => d instanceof DictData).length !== dicts.length) {
- console.error('the type of elements in dicts must be DictData')
- dicts = []
- }
- dict.type[type].splice(0, Number.MAX_SAFE_INTEGER, ...dicts)
- dicts.forEach(d => {
- Vue.set(dict.label[type], d.value, d.label)
- })
- return dicts
- })
-}
+import Vue from 'vue'
+import { mergeRecursive } from "@/utils/ruoyi";
+import DictMeta from './DictMeta'
+import DictData from './DictData'
+
+const DEFAULT_DICT_OPTIONS = {
+ types: [],
+}
+
+/**
+ * @classdesc 字典
+ * @property {Object} label 标签对象,内部属性名为字典类型名称
+ * @property {Object} dict 字段数组,内部属性名为字典类型名称
+ * @property {Array.} _dictMetas 字典元数据数组
+ */
+export default class Dict {
+ constructor() {
+ this.owner = null
+ this.label = {}
+ this.type = {}
+ }
+
+ init(options) {
+ if (options instanceof Array) {
+ options = { types: options }
+ }
+ const opts = mergeRecursive(DEFAULT_DICT_OPTIONS, options)
+ if (opts.types === undefined) {
+ throw new Error('need dict types')
+ }
+ const ps = []
+ this._dictMetas = opts.types.map(t => DictMeta.parse(t))
+ this._dictMetas.forEach(dictMeta => {
+ const type = dictMeta.type
+ Vue.set(this.label, type, {})
+ Vue.set(this.type, type, [])
+ if (dictMeta.lazy) {
+ return
+ }
+ ps.push(loadDict(this, dictMeta))
+ })
+ return Promise.all(ps)
+ }
+
+ /**
+ * 重新加载字典
+ * @param {String} type 字典类型
+ */
+ reloadDict(type) {
+ const dictMeta = this._dictMetas.find(e => e.type === type)
+ if (dictMeta === undefined) {
+ return Promise.reject(`the dict meta of ${type} was not found`)
+ }
+ return loadDict(this, dictMeta)
+ }
+}
+
+/**
+ * 加载字典
+ * @param {Dict} dict 字典
+ * @param {DictMeta} dictMeta 字典元数据
+ * @returns {Promise}
+ */
+function loadDict(dict, dictMeta) {
+ return dictMeta.request(dictMeta)
+ .then(response => {
+ const type = dictMeta.type
+ let dicts = dictMeta.responseConverter(response, dictMeta)
+ if (!(dicts instanceof Array)) {
+ console.error('the return of responseConverter must be Array.')
+ dicts = []
+ } else if (dicts.filter(d => d instanceof DictData).length !== dicts.length) {
+ console.error('the type of elements in dicts must be DictData')
+ dicts = []
+ }
+ dict.type[type].splice(0, Number.MAX_SAFE_INTEGER, ...dicts)
+ dicts.forEach(d => {
+ Vue.set(dict.label[type], d.value, d.label)
+ })
+ return dicts
+ })
+}
diff --git a/sf-ui/src/utils/dict/DictConverter.js b/sf-ui/src/utils/dict/DictConverter.js
index 576ff54..0cf5df8 100644
--- a/sf-ui/src/utils/dict/DictConverter.js
+++ b/sf-ui/src/utils/dict/DictConverter.js
@@ -1,17 +1,17 @@
-import DictOptions from './DictOptions'
-import DictData from './DictData'
-
-export default function(dict, dictMeta) {
- const label = determineDictField(dict, dictMeta.labelField, ...DictOptions.DEFAULT_LABEL_FIELDS)
- const value = determineDictField(dict, dictMeta.valueField, ...DictOptions.DEFAULT_VALUE_FIELDS)
- return new DictData(dict[label], dict[value], dict)
-}
-
-/**
- * 确定字典字段
- * @param {DictData} dict
- * @param {...String} fields
- */
-function determineDictField(dict, ...fields) {
- return fields.find(f => Object.prototype.hasOwnProperty.call(dict, f))
-}
+import DictOptions from './DictOptions'
+import DictData from './DictData'
+
+export default function(dict, dictMeta) {
+ const label = determineDictField(dict, dictMeta.labelField, ...DictOptions.DEFAULT_LABEL_FIELDS)
+ const value = determineDictField(dict, dictMeta.valueField, ...DictOptions.DEFAULT_VALUE_FIELDS)
+ return new DictData(dict[label], dict[value], dict)
+}
+
+/**
+ * 确定字典字段
+ * @param {DictData} dict
+ * @param {...String} fields
+ */
+function determineDictField(dict, ...fields) {
+ return fields.find(f => Object.prototype.hasOwnProperty.call(dict, f))
+}
diff --git a/sf-ui/src/utils/dict/DictData.js b/sf-ui/src/utils/dict/DictData.js
index 37a60d5..afc763e 100644
--- a/sf-ui/src/utils/dict/DictData.js
+++ b/sf-ui/src/utils/dict/DictData.js
@@ -1,13 +1,13 @@
-/**
- * @classdesc 字典数据
- * @property {String} label 标签
- * @property {*} value 标签
- * @property {Object} raw 原始数据
- */
-export default class DictData {
- constructor(label, value, raw) {
- this.label = label
- this.value = value
- this.raw = raw
- }
-}
+/**
+ * @classdesc 字典数据
+ * @property {String} label 标签
+ * @property {*} value 标签
+ * @property {Object} raw 原始数据
+ */
+export default class DictData {
+ constructor(label, value, raw) {
+ this.label = label
+ this.value = value
+ this.raw = raw
+ }
+}
diff --git a/sf-ui/src/utils/dict/DictMeta.js b/sf-ui/src/utils/dict/DictMeta.js
index 2ae0827..9779daa 100644
--- a/sf-ui/src/utils/dict/DictMeta.js
+++ b/sf-ui/src/utils/dict/DictMeta.js
@@ -1,38 +1,38 @@
-import { mergeRecursive } from "@/utils/ruoyi";
-import DictOptions from './DictOptions'
-
-/**
- * @classdesc 字典元数据
- * @property {String} type 类型
- * @property {Function} request 请求
- * @property {String} label 标签字段
- * @property {String} value 值字段
- */
-export default class DictMeta {
- constructor(options) {
- this.type = options.type
- this.request = options.request
- this.responseConverter = options.responseConverter
- this.labelField = options.labelField
- this.valueField = options.valueField
- this.lazy = options.lazy === true
- }
-}
-
-
-/**
- * 解析字典元数据
- * @param {Object} options
- * @returns {DictMeta}
- */
-DictMeta.parse= function(options) {
- let opts = null
- if (typeof options === 'string') {
- opts = DictOptions.metas[options] || {}
- opts.type = options
- } else if (typeof options === 'object') {
- opts = options
- }
- opts = mergeRecursive(DictOptions.metas['*'], opts)
- return new DictMeta(opts)
-}
+import { mergeRecursive } from "@/utils/ruoyi";
+import DictOptions from './DictOptions'
+
+/**
+ * @classdesc 字典元数据
+ * @property {String} type 类型
+ * @property {Function} request 请求
+ * @property {String} label 标签字段
+ * @property {String} value 值字段
+ */
+export default class DictMeta {
+ constructor(options) {
+ this.type = options.type
+ this.request = options.request
+ this.responseConverter = options.responseConverter
+ this.labelField = options.labelField
+ this.valueField = options.valueField
+ this.lazy = options.lazy === true
+ }
+}
+
+
+/**
+ * 解析字典元数据
+ * @param {Object} options
+ * @returns {DictMeta}
+ */
+DictMeta.parse= function(options) {
+ let opts = null
+ if (typeof options === 'string') {
+ opts = DictOptions.metas[options] || {}
+ opts.type = options
+ } else if (typeof options === 'object') {
+ opts = options
+ }
+ opts = mergeRecursive(DictOptions.metas['*'], opts)
+ return new DictMeta(opts)
+}
diff --git a/sf-ui/src/utils/dict/DictOptions.js b/sf-ui/src/utils/dict/DictOptions.js
index 5e1cc41..338a94e 100644
--- a/sf-ui/src/utils/dict/DictOptions.js
+++ b/sf-ui/src/utils/dict/DictOptions.js
@@ -1,51 +1,51 @@
-import { mergeRecursive } from "@/utils/ruoyi";
-import dictConverter from './DictConverter'
-
-export const options = {
- metas: {
- '*': {
- /**
- * 字典请求,方法签名为function(dictMeta: DictMeta): Promise
- */
- request: (dictMeta) => {
- console.log(`load dict ${dictMeta.type}`)
- return Promise.resolve([])
- },
- /**
- * 字典响应数据转换器,方法签名为function(response: Object, dictMeta: DictMeta): DictData
- */
- responseConverter,
- labelField: 'label',
- valueField: 'value',
- },
- },
- /**
- * 默认标签字段
- */
- DEFAULT_LABEL_FIELDS: ['label', 'name', 'title'],
- /**
- * 默认值字段
- */
- DEFAULT_VALUE_FIELDS: ['value', 'id', 'uid', 'key'],
-}
-
-/**
- * 映射字典
- * @param {Object} response 字典数据
- * @param {DictMeta} dictMeta 字典元数据
- * @returns {DictData}
- */
-function responseConverter(response, dictMeta) {
- const dicts = response.content instanceof Array ? response.content : response
- if (dicts === undefined) {
- console.warn(`no dict data of "${dictMeta.type}" found in the response`)
- return []
- }
- return dicts.map(d => dictConverter(d, dictMeta))
-}
-
-export function mergeOptions(src) {
- mergeRecursive(options, src)
-}
-
-export default options
+import { mergeRecursive } from "@/utils/ruoyi";
+import dictConverter from './DictConverter'
+
+export const options = {
+ metas: {
+ '*': {
+ /**
+ * 字典请求,方法签名为function(dictMeta: DictMeta): Promise
+ */
+ request: (dictMeta) => {
+ console.log(`load dict ${dictMeta.type}`)
+ return Promise.resolve([])
+ },
+ /**
+ * 字典响应数据转换器,方法签名为function(response: Object, dictMeta: DictMeta): DictData
+ */
+ responseConverter,
+ labelField: 'label',
+ valueField: 'value',
+ },
+ },
+ /**
+ * 默认标签字段
+ */
+ DEFAULT_LABEL_FIELDS: ['label', 'name', 'title'],
+ /**
+ * 默认值字段
+ */
+ DEFAULT_VALUE_FIELDS: ['value', 'id', 'uid', 'key'],
+}
+
+/**
+ * 映射字典
+ * @param {Object} response 字典数据
+ * @param {DictMeta} dictMeta 字典元数据
+ * @returns {DictData}
+ */
+function responseConverter(response, dictMeta) {
+ const dicts = response.content instanceof Array ? response.content : response
+ if (dicts === undefined) {
+ console.warn(`no dict data of "${dictMeta.type}" found in the response`)
+ return []
+ }
+ return dicts.map(d => dictConverter(d, dictMeta))
+}
+
+export function mergeOptions(src) {
+ mergeRecursive(options, src)
+}
+
+export default options
diff --git a/sf-ui/src/utils/dict/index.js b/sf-ui/src/utils/dict/index.js
index d6fdb80..215eb9e 100644
--- a/sf-ui/src/utils/dict/index.js
+++ b/sf-ui/src/utils/dict/index.js
@@ -1,33 +1,33 @@
-import Dict from './Dict'
-import { mergeOptions } from './DictOptions'
-
-export default function(Vue, options) {
- mergeOptions(options)
- Vue.mixin({
- data() {
- if (this.$options === undefined || this.$options.dicts === undefined || this.$options.dicts === null) {
- return {}
- }
- const dict = new Dict()
- dict.owner = this
- return {
- dict
- }
- },
- created() {
- if (!(this.dict instanceof Dict)) {
- return
- }
- options.onCreated && options.onCreated(this.dict)
- this.dict.init(this.$options.dicts).then(() => {
- options.onReady && options.onReady(this.dict)
- this.$nextTick(() => {
- this.$emit('dictReady', this.dict)
- if (this.$options.methods && this.$options.methods.onDictReady instanceof Function) {
- this.$options.methods.onDictReady.call(this, this.dict)
- }
- })
- })
- },
- })
-}
+import Dict from './Dict'
+import { mergeOptions } from './DictOptions'
+
+export default function(Vue, options) {
+ mergeOptions(options)
+ Vue.mixin({
+ data() {
+ if (this.$options === undefined || this.$options.dicts === undefined || this.$options.dicts === null) {
+ return {}
+ }
+ const dict = new Dict()
+ dict.owner = this
+ return {
+ dict
+ }
+ },
+ created() {
+ if (!(this.dict instanceof Dict)) {
+ return
+ }
+ options.onCreated && options.onCreated(this.dict)
+ this.dict.init(this.$options.dicts).then(() => {
+ options.onReady && options.onReady(this.dict)
+ this.$nextTick(() => {
+ this.$emit('dictReady', this.dict)
+ if (this.$options.methods && this.$options.methods.onDictReady instanceof Function) {
+ this.$options.methods.onDictReady.call(this, this.dict)
+ }
+ })
+ })
+ },
+ })
+}
diff --git a/sf-ui/src/utils/eventBus.js b/sf-ui/src/utils/eventBus.js
new file mode 100644
index 0000000..b6d5a72
--- /dev/null
+++ b/sf-ui/src/utils/eventBus.js
@@ -0,0 +1,3 @@
+import vue from 'vue'
+const EventBus = new vue();
+export default EventBus;
\ No newline at end of file
diff --git a/sf-ui/src/utils/generator/config.js b/sf-ui/src/utils/generator/config.js
index 005140a..7abf227 100644
--- a/sf-ui/src/utils/generator/config.js
+++ b/sf-ui/src/utils/generator/config.js
@@ -1,438 +1,438 @@
-export const formConf = {
- formRef: 'elForm',
- formModel: 'formData',
- size: 'medium',
- labelPosition: 'right',
- labelWidth: 100,
- formRules: 'rules',
- gutter: 15,
- disabled: false,
- span: 24,
- formBtns: true
-}
-
-export const inputComponents = [
- {
- label: '单行文本',
- tag: 'el-input',
- tagIcon: 'input',
- placeholder: '请输入',
- defaultValue: undefined,
- span: 24,
- labelWidth: null,
- style: { width: '100%' },
- clearable: true,
- prepend: '',
- append: '',
- 'prefix-icon': '',
- 'suffix-icon': '',
- maxlength: null,
- 'show-word-limit': false,
- readonly: false,
- disabled: false,
- required: true,
- regList: [],
- changeTag: true,
- document: 'https://element.eleme.cn/#/zh-CN/component/input'
- },
- {
- label: '多行文本',
- tag: 'el-input',
- tagIcon: 'textarea',
- type: 'textarea',
- placeholder: '请输入',
- defaultValue: undefined,
- span: 24,
- labelWidth: null,
- autosize: {
- minRows: 4,
- maxRows: 4
- },
- style: { width: '100%' },
- maxlength: null,
- 'show-word-limit': false,
- readonly: false,
- disabled: false,
- required: true,
- regList: [],
- changeTag: true,
- document: 'https://element.eleme.cn/#/zh-CN/component/input'
- },
- {
- label: '密码',
- tag: 'el-input',
- tagIcon: 'password',
- placeholder: '请输入',
- defaultValue: undefined,
- span: 24,
- 'show-password': true,
- labelWidth: null,
- style: { width: '100%' },
- clearable: true,
- prepend: '',
- append: '',
- 'prefix-icon': '',
- 'suffix-icon': '',
- maxlength: null,
- 'show-word-limit': false,
- readonly: false,
- disabled: false,
- required: true,
- regList: [],
- changeTag: true,
- document: 'https://element.eleme.cn/#/zh-CN/component/input'
- },
- {
- label: '计数器',
- tag: 'el-input-number',
- tagIcon: 'number',
- placeholder: '',
- defaultValue: undefined,
- span: 24,
- labelWidth: null,
- min: undefined,
- max: undefined,
- step: undefined,
- 'step-strictly': false,
- precision: undefined,
- 'controls-position': '',
- disabled: false,
- required: true,
- regList: [],
- changeTag: true,
- document: 'https://element.eleme.cn/#/zh-CN/component/input-number'
- }
-]
-
-export const selectComponents = [
- {
- label: '下拉选择',
- tag: 'el-select',
- tagIcon: 'select',
- placeholder: '请选择',
- defaultValue: undefined,
- span: 24,
- labelWidth: null,
- style: { width: '100%' },
- clearable: true,
- disabled: false,
- required: true,
- filterable: false,
- multiple: false,
- options: [{
- label: '选项一',
- value: 1
- }, {
- label: '选项二',
- value: 2
- }],
- regList: [],
- changeTag: true,
- document: 'https://element.eleme.cn/#/zh-CN/component/select'
- },
- {
- label: '级联选择',
- tag: 'el-cascader',
- tagIcon: 'cascader',
- placeholder: '请选择',
- defaultValue: [],
- span: 24,
- labelWidth: null,
- style: { width: '100%' },
- props: {
- props: {
- multiple: false
- }
- },
- 'show-all-levels': true,
- disabled: false,
- clearable: true,
- filterable: false,
- required: true,
- options: [{
- id: 1,
- value: 1,
- label: '选项1',
- children: [{
- id: 2,
- value: 2,
- label: '选项1-1'
- }]
- }],
- dataType: 'dynamic',
- labelKey: 'label',
- valueKey: 'value',
- childrenKey: 'children',
- separator: '/',
- regList: [],
- changeTag: true,
- document: 'https://element.eleme.cn/#/zh-CN/component/cascader'
- },
- {
- label: '单选框组',
- tag: 'el-radio-group',
- tagIcon: 'radio',
- defaultValue: undefined,
- span: 24,
- labelWidth: null,
- style: {},
- optionType: 'default',
- border: false,
- size: 'medium',
- disabled: false,
- required: true,
- options: [{
- label: '选项一',
- value: 1
- }, {
- label: '选项二',
- value: 2
- }],
- regList: [],
- changeTag: true,
- document: 'https://element.eleme.cn/#/zh-CN/component/radio'
- },
- {
- label: '多选框组',
- tag: 'el-checkbox-group',
- tagIcon: 'checkbox',
- defaultValue: [],
- span: 24,
- labelWidth: null,
- style: {},
- optionType: 'default',
- border: false,
- size: 'medium',
- disabled: false,
- required: true,
- options: [{
- label: '选项一',
- value: 1
- }, {
- label: '选项二',
- value: 2
- }],
- regList: [],
- changeTag: true,
- document: 'https://element.eleme.cn/#/zh-CN/component/checkbox'
- },
- {
- label: '开关',
- tag: 'el-switch',
- tagIcon: 'switch',
- defaultValue: false,
- span: 24,
- labelWidth: null,
- style: {},
- disabled: false,
- required: true,
- 'active-text': '',
- 'inactive-text': '',
- 'active-color': null,
- 'inactive-color': null,
- 'active-value': true,
- 'inactive-value': false,
- regList: [],
- changeTag: true,
- document: 'https://element.eleme.cn/#/zh-CN/component/switch'
- },
- {
- label: '滑块',
- tag: 'el-slider',
- tagIcon: 'slider',
- defaultValue: null,
- span: 24,
- labelWidth: null,
- disabled: false,
- required: true,
- min: 0,
- max: 100,
- step: 1,
- 'show-stops': false,
- range: false,
- regList: [],
- changeTag: true,
- document: 'https://element.eleme.cn/#/zh-CN/component/slider'
- },
- {
- label: '时间选择',
- tag: 'el-time-picker',
- tagIcon: 'time',
- placeholder: '请选择',
- defaultValue: null,
- span: 24,
- labelWidth: null,
- style: { width: '100%' },
- disabled: false,
- clearable: true,
- required: true,
- 'picker-options': {
- selectableRange: '00:00:00-23:59:59'
- },
- format: 'HH:mm:ss',
- 'value-format': 'HH:mm:ss',
- regList: [],
- changeTag: true,
- document: 'https://element.eleme.cn/#/zh-CN/component/time-picker'
- },
- {
- label: '时间范围',
- tag: 'el-time-picker',
- tagIcon: 'time-range',
- defaultValue: null,
- span: 24,
- labelWidth: null,
- style: { width: '100%' },
- disabled: false,
- clearable: true,
- required: true,
- 'is-range': true,
- 'range-separator': '至',
- 'start-placeholder': '开始时间',
- 'end-placeholder': '结束时间',
- format: 'HH:mm:ss',
- 'value-format': 'HH:mm:ss',
- regList: [],
- changeTag: true,
- document: 'https://element.eleme.cn/#/zh-CN/component/time-picker'
- },
- {
- label: '日期选择',
- tag: 'el-date-picker',
- tagIcon: 'date',
- placeholder: '请选择',
- defaultValue: null,
- type: 'date',
- span: 24,
- labelWidth: null,
- style: { width: '100%' },
- disabled: false,
- clearable: true,
- required: true,
- format: 'yyyy-MM-dd',
- 'value-format': 'yyyy-MM-dd',
- readonly: false,
- regList: [],
- changeTag: true,
- document: 'https://element.eleme.cn/#/zh-CN/component/date-picker'
- },
- {
- label: '日期范围',
- tag: 'el-date-picker',
- tagIcon: 'date-range',
- defaultValue: null,
- span: 24,
- labelWidth: null,
- style: { width: '100%' },
- type: 'daterange',
- 'range-separator': '至',
- 'start-placeholder': '开始日期',
- 'end-placeholder': '结束日期',
- disabled: false,
- clearable: true,
- required: true,
- format: 'yyyy-MM-dd',
- 'value-format': 'yyyy-MM-dd',
- readonly: false,
- regList: [],
- changeTag: true,
- document: 'https://element.eleme.cn/#/zh-CN/component/date-picker'
- },
- {
- label: '评分',
- tag: 'el-rate',
- tagIcon: 'rate',
- defaultValue: 0,
- span: 24,
- labelWidth: null,
- style: {},
- max: 5,
- 'allow-half': false,
- 'show-text': false,
- 'show-score': false,
- disabled: false,
- required: true,
- regList: [],
- changeTag: true,
- document: 'https://element.eleme.cn/#/zh-CN/component/rate'
- },
- {
- label: '颜色选择',
- tag: 'el-color-picker',
- tagIcon: 'color',
- defaultValue: null,
- labelWidth: null,
- 'show-alpha': false,
- 'color-format': '',
- disabled: false,
- required: true,
- size: 'medium',
- regList: [],
- changeTag: true,
- document: 'https://element.eleme.cn/#/zh-CN/component/color-picker'
- },
- {
- label: '上传',
- tag: 'el-upload',
- tagIcon: 'upload',
- action: 'https://jsonplaceholder.typicode.com/posts/',
- defaultValue: null,
- labelWidth: null,
- disabled: false,
- required: true,
- accept: '',
- name: 'file',
- 'auto-upload': true,
- showTip: false,
- buttonText: '点击上传',
- fileSize: 2,
- sizeUnit: 'MB',
- 'list-type': 'text',
- multiple: false,
- regList: [],
- changeTag: true,
- document: 'https://element.eleme.cn/#/zh-CN/component/upload'
- }
-]
-
-export const layoutComponents = [
- {
- layout: 'rowFormItem',
- tagIcon: 'row',
- type: 'default',
- justify: 'start',
- align: 'top',
- label: '行容器',
- layoutTree: true,
- children: [],
- document: 'https://element.eleme.cn/#/zh-CN/component/layout'
- },
- {
- layout: 'colFormItem',
- label: '按钮',
- changeTag: true,
- labelWidth: null,
- tag: 'el-button',
- tagIcon: 'button',
- span: 24,
- default: '主要按钮',
- type: 'primary',
- icon: 'el-icon-search',
- size: 'medium',
- disabled: false,
- document: 'https://element.eleme.cn/#/zh-CN/component/button'
- }
-]
-
-// 组件rule的触发方式,无触发方式的组件不生成rule
-export const trigger = {
- 'el-input': 'blur',
- 'el-input-number': 'blur',
- 'el-select': 'change',
- 'el-radio-group': 'change',
- 'el-checkbox-group': 'change',
- 'el-cascader': 'change',
- 'el-time-picker': 'change',
- 'el-date-picker': 'change',
- 'el-rate': 'change'
-}
+export const formConf = {
+ formRef: 'elForm',
+ formModel: 'formData',
+ size: 'medium',
+ labelPosition: 'right',
+ labelWidth: 100,
+ formRules: 'rules',
+ gutter: 15,
+ disabled: false,
+ span: 24,
+ formBtns: true
+}
+
+export const inputComponents = [
+ {
+ label: '单行文本',
+ tag: 'el-input',
+ tagIcon: 'input',
+ placeholder: '请输入',
+ defaultValue: undefined,
+ span: 24,
+ labelWidth: null,
+ style: { width: '100%' },
+ clearable: true,
+ prepend: '',
+ append: '',
+ 'prefix-icon': '',
+ 'suffix-icon': '',
+ maxlength: null,
+ 'show-word-limit': false,
+ readonly: false,
+ disabled: false,
+ required: true,
+ regList: [],
+ changeTag: true,
+ document: 'https://element.eleme.cn/#/zh-CN/component/input'
+ },
+ {
+ label: '多行文本',
+ tag: 'el-input',
+ tagIcon: 'textarea',
+ type: 'textarea',
+ placeholder: '请输入',
+ defaultValue: undefined,
+ span: 24,
+ labelWidth: null,
+ autosize: {
+ minRows: 4,
+ maxRows: 4
+ },
+ style: { width: '100%' },
+ maxlength: null,
+ 'show-word-limit': false,
+ readonly: false,
+ disabled: false,
+ required: true,
+ regList: [],
+ changeTag: true,
+ document: 'https://element.eleme.cn/#/zh-CN/component/input'
+ },
+ {
+ label: '密码',
+ tag: 'el-input',
+ tagIcon: 'password',
+ placeholder: '请输入',
+ defaultValue: undefined,
+ span: 24,
+ 'show-password': true,
+ labelWidth: null,
+ style: { width: '100%' },
+ clearable: true,
+ prepend: '',
+ append: '',
+ 'prefix-icon': '',
+ 'suffix-icon': '',
+ maxlength: null,
+ 'show-word-limit': false,
+ readonly: false,
+ disabled: false,
+ required: true,
+ regList: [],
+ changeTag: true,
+ document: 'https://element.eleme.cn/#/zh-CN/component/input'
+ },
+ {
+ label: '计数器',
+ tag: 'el-input-number',
+ tagIcon: 'number',
+ placeholder: '',
+ defaultValue: undefined,
+ span: 24,
+ labelWidth: null,
+ min: undefined,
+ max: undefined,
+ step: undefined,
+ 'step-strictly': false,
+ precision: undefined,
+ 'controls-position': '',
+ disabled: false,
+ required: true,
+ regList: [],
+ changeTag: true,
+ document: 'https://element.eleme.cn/#/zh-CN/component/input-number'
+ }
+]
+
+export const selectComponents = [
+ {
+ label: '下拉选择',
+ tag: 'el-select',
+ tagIcon: 'select',
+ placeholder: '请选择',
+ defaultValue: undefined,
+ span: 24,
+ labelWidth: null,
+ style: { width: '100%' },
+ clearable: true,
+ disabled: false,
+ required: true,
+ filterable: false,
+ multiple: false,
+ options: [{
+ label: '选项一',
+ value: 1
+ }, {
+ label: '选项二',
+ value: 2
+ }],
+ regList: [],
+ changeTag: true,
+ document: 'https://element.eleme.cn/#/zh-CN/component/select'
+ },
+ {
+ label: '级联选择',
+ tag: 'el-cascader',
+ tagIcon: 'cascader',
+ placeholder: '请选择',
+ defaultValue: [],
+ span: 24,
+ labelWidth: null,
+ style: { width: '100%' },
+ props: {
+ props: {
+ multiple: false
+ }
+ },
+ 'show-all-levels': true,
+ disabled: false,
+ clearable: true,
+ filterable: false,
+ required: true,
+ options: [{
+ id: 1,
+ value: 1,
+ label: '选项1',
+ children: [{
+ id: 2,
+ value: 2,
+ label: '选项1-1'
+ }]
+ }],
+ dataType: 'dynamic',
+ labelKey: 'label',
+ valueKey: 'value',
+ childrenKey: 'children',
+ separator: '/',
+ regList: [],
+ changeTag: true,
+ document: 'https://element.eleme.cn/#/zh-CN/component/cascader'
+ },
+ {
+ label: '单选框组',
+ tag: 'el-radio-group',
+ tagIcon: 'radio',
+ defaultValue: undefined,
+ span: 24,
+ labelWidth: null,
+ style: {},
+ optionType: 'default',
+ border: false,
+ size: 'medium',
+ disabled: false,
+ required: true,
+ options: [{
+ label: '选项一',
+ value: 1
+ }, {
+ label: '选项二',
+ value: 2
+ }],
+ regList: [],
+ changeTag: true,
+ document: 'https://element.eleme.cn/#/zh-CN/component/radio'
+ },
+ {
+ label: '多选框组',
+ tag: 'el-checkbox-group',
+ tagIcon: 'checkbox',
+ defaultValue: [],
+ span: 24,
+ labelWidth: null,
+ style: {},
+ optionType: 'default',
+ border: false,
+ size: 'medium',
+ disabled: false,
+ required: true,
+ options: [{
+ label: '选项一',
+ value: 1
+ }, {
+ label: '选项二',
+ value: 2
+ }],
+ regList: [],
+ changeTag: true,
+ document: 'https://element.eleme.cn/#/zh-CN/component/checkbox'
+ },
+ {
+ label: '开关',
+ tag: 'el-switch',
+ tagIcon: 'switch',
+ defaultValue: false,
+ span: 24,
+ labelWidth: null,
+ style: {},
+ disabled: false,
+ required: true,
+ 'active-text': '',
+ 'inactive-text': '',
+ 'active-color': null,
+ 'inactive-color': null,
+ 'active-value': true,
+ 'inactive-value': false,
+ regList: [],
+ changeTag: true,
+ document: 'https://element.eleme.cn/#/zh-CN/component/switch'
+ },
+ {
+ label: '滑块',
+ tag: 'el-slider',
+ tagIcon: 'slider',
+ defaultValue: null,
+ span: 24,
+ labelWidth: null,
+ disabled: false,
+ required: true,
+ min: 0,
+ max: 100,
+ step: 1,
+ 'show-stops': false,
+ range: false,
+ regList: [],
+ changeTag: true,
+ document: 'https://element.eleme.cn/#/zh-CN/component/slider'
+ },
+ {
+ label: '时间选择',
+ tag: 'el-time-picker',
+ tagIcon: 'time',
+ placeholder: '请选择',
+ defaultValue: null,
+ span: 24,
+ labelWidth: null,
+ style: { width: '100%' },
+ disabled: false,
+ clearable: true,
+ required: true,
+ 'picker-options': {
+ selectableRange: '00:00:00-23:59:59'
+ },
+ format: 'HH:mm:ss',
+ 'value-format': 'HH:mm:ss',
+ regList: [],
+ changeTag: true,
+ document: 'https://element.eleme.cn/#/zh-CN/component/time-picker'
+ },
+ {
+ label: '时间范围',
+ tag: 'el-time-picker',
+ tagIcon: 'time-range',
+ defaultValue: null,
+ span: 24,
+ labelWidth: null,
+ style: { width: '100%' },
+ disabled: false,
+ clearable: true,
+ required: true,
+ 'is-range': true,
+ 'range-separator': '至',
+ 'start-placeholder': '开始时间',
+ 'end-placeholder': '结束时间',
+ format: 'HH:mm:ss',
+ 'value-format': 'HH:mm:ss',
+ regList: [],
+ changeTag: true,
+ document: 'https://element.eleme.cn/#/zh-CN/component/time-picker'
+ },
+ {
+ label: '日期选择',
+ tag: 'el-date-picker',
+ tagIcon: 'date',
+ placeholder: '请选择',
+ defaultValue: null,
+ type: 'date',
+ span: 24,
+ labelWidth: null,
+ style: { width: '100%' },
+ disabled: false,
+ clearable: true,
+ required: true,
+ format: 'yyyy-MM-dd',
+ 'value-format': 'yyyy-MM-dd',
+ readonly: false,
+ regList: [],
+ changeTag: true,
+ document: 'https://element.eleme.cn/#/zh-CN/component/date-picker'
+ },
+ {
+ label: '日期范围',
+ tag: 'el-date-picker',
+ tagIcon: 'date-range',
+ defaultValue: null,
+ span: 24,
+ labelWidth: null,
+ style: { width: '100%' },
+ type: 'daterange',
+ 'range-separator': '至',
+ 'start-placeholder': '开始日期',
+ 'end-placeholder': '结束日期',
+ disabled: false,
+ clearable: true,
+ required: true,
+ format: 'yyyy-MM-dd',
+ 'value-format': 'yyyy-MM-dd',
+ readonly: false,
+ regList: [],
+ changeTag: true,
+ document: 'https://element.eleme.cn/#/zh-CN/component/date-picker'
+ },
+ {
+ label: '评分',
+ tag: 'el-rate',
+ tagIcon: 'rate',
+ defaultValue: 0,
+ span: 24,
+ labelWidth: null,
+ style: {},
+ max: 5,
+ 'allow-half': false,
+ 'show-text': false,
+ 'show-score': false,
+ disabled: false,
+ required: true,
+ regList: [],
+ changeTag: true,
+ document: 'https://element.eleme.cn/#/zh-CN/component/rate'
+ },
+ {
+ label: '颜色选择',
+ tag: 'el-color-picker',
+ tagIcon: 'color',
+ defaultValue: null,
+ labelWidth: null,
+ 'show-alpha': false,
+ 'color-format': '',
+ disabled: false,
+ required: true,
+ size: 'medium',
+ regList: [],
+ changeTag: true,
+ document: 'https://element.eleme.cn/#/zh-CN/component/color-picker'
+ },
+ {
+ label: '上传',
+ tag: 'el-upload',
+ tagIcon: 'upload',
+ action: 'https://jsonplaceholder.typicode.com/posts/',
+ defaultValue: null,
+ labelWidth: null,
+ disabled: false,
+ required: true,
+ accept: '',
+ name: 'file',
+ 'auto-upload': true,
+ showTip: false,
+ buttonText: '点击上传',
+ fileSize: 2,
+ sizeUnit: 'MB',
+ 'list-type': 'text',
+ multiple: false,
+ regList: [],
+ changeTag: true,
+ document: 'https://element.eleme.cn/#/zh-CN/component/upload'
+ }
+]
+
+export const layoutComponents = [
+ {
+ layout: 'rowFormItem',
+ tagIcon: 'row',
+ type: 'default',
+ justify: 'start',
+ align: 'top',
+ label: '行容器',
+ layoutTree: true,
+ children: [],
+ document: 'https://element.eleme.cn/#/zh-CN/component/layout'
+ },
+ {
+ layout: 'colFormItem',
+ label: '按钮',
+ changeTag: true,
+ labelWidth: null,
+ tag: 'el-button',
+ tagIcon: 'button',
+ span: 24,
+ default: '主要按钮',
+ type: 'primary',
+ icon: 'el-icon-search',
+ size: 'medium',
+ disabled: false,
+ document: 'https://element.eleme.cn/#/zh-CN/component/button'
+ }
+]
+
+// 组件rule的触发方式,无触发方式的组件不生成rule
+export const trigger = {
+ 'el-input': 'blur',
+ 'el-input-number': 'blur',
+ 'el-select': 'change',
+ 'el-radio-group': 'change',
+ 'el-checkbox-group': 'change',
+ 'el-cascader': 'change',
+ 'el-time-picker': 'change',
+ 'el-date-picker': 'change',
+ 'el-rate': 'change'
+}
diff --git a/sf-ui/src/utils/generator/css.js b/sf-ui/src/utils/generator/css.js
index 0d7f075..c1c62e6 100644
--- a/sf-ui/src/utils/generator/css.js
+++ b/sf-ui/src/utils/generator/css.js
@@ -1,18 +1,18 @@
-const styles = {
- 'el-rate': '.el-rate{display: inline-block; vertical-align: text-top;}',
- 'el-upload': '.el-upload__tip{line-height: 1.2;}'
-}
-
-function addCss(cssList, el) {
- const css = styles[el.tag]
- css && cssList.indexOf(css) === -1 && cssList.push(css)
- if (el.children) {
- el.children.forEach(el2 => addCss(cssList, el2))
- }
-}
-
-export function makeUpCss(conf) {
- const cssList = []
- conf.fields.forEach(el => addCss(cssList, el))
- return cssList.join('\n')
-}
+const styles = {
+ 'el-rate': '.el-rate{display: inline-block; vertical-align: text-top;}',
+ 'el-upload': '.el-upload__tip{line-height: 1.2;}'
+}
+
+function addCss(cssList, el) {
+ const css = styles[el.tag]
+ css && cssList.indexOf(css) === -1 && cssList.push(css)
+ if (el.children) {
+ el.children.forEach(el2 => addCss(cssList, el2))
+ }
+}
+
+export function makeUpCss(conf) {
+ const cssList = []
+ conf.fields.forEach(el => addCss(cssList, el))
+ return cssList.join('\n')
+}
diff --git a/sf-ui/src/utils/generator/render.js b/sf-ui/src/utils/generator/render.js
index f187029..e8640f0 100644
--- a/sf-ui/src/utils/generator/render.js
+++ b/sf-ui/src/utils/generator/render.js
@@ -1,126 +1,126 @@
-import { makeMap } from '@/utils/index'
-
-// 参考https://github.com/vuejs/vue/blob/v2.6.10/src/platforms/web/server/util.js
-const isAttr = makeMap(
- 'accept,accept-charset,accesskey,action,align,alt,async,autocomplete,'
- + 'autofocus,autoplay,autosave,bgcolor,border,buffered,challenge,charset,'
- + 'checked,cite,class,code,codebase,color,cols,colspan,content,http-equiv,'
- + 'name,contenteditable,contextmenu,controls,coords,data,datetime,default,'
- + 'defer,dir,dirname,disabled,download,draggable,dropzone,enctype,method,for,'
- + 'form,formaction,headers,height,hidden,high,href,hreflang,http-equiv,'
- + 'icon,id,ismap,itemprop,keytype,kind,label,lang,language,list,loop,low,'
- + 'manifest,max,maxlength,media,method,GET,POST,min,multiple,email,file,'
- + 'muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,'
- + 'preload,radiogroup,readonly,rel,required,reversed,rows,rowspan,sandbox,'
- + 'scope,scoped,seamless,selected,shape,size,type,text,password,sizes,span,'
- + 'spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,'
- + 'target,title,type,usemap,value,width,wrap'
-)
-
-function vModel(self, dataObject, defaultValue) {
- dataObject.props.value = defaultValue
-
- dataObject.on.input = val => {
- self.$emit('input', val)
- }
-}
-
-const componentChild = {
- 'el-button': {
- default(h, conf, key) {
- return conf[key]
- },
- },
- 'el-input': {
- prepend(h, conf, key) {
- return {conf[key]}
- },
- append(h, conf, key) {
- return {conf[key]}
- }
- },
- 'el-select': {
- options(h, conf, key) {
- const list = []
- conf.options.forEach(item => {
- list.push()
- })
- return list
- }
- },
- 'el-radio-group': {
- options(h, conf, key) {
- const list = []
- conf.options.forEach(item => {
- if (conf.optionType === 'button') list.push({item.label})
- else list.push({item.label})
- })
- return list
- }
- },
- 'el-checkbox-group': {
- options(h, conf, key) {
- const list = []
- conf.options.forEach(item => {
- if (conf.optionType === 'button') {
- list.push({item.label})
- } else {
- list.push({item.label})
- }
- })
- return list
- }
- },
- 'el-upload': {
- 'list-type': (h, conf, key) => {
- const list = []
- if (conf['list-type'] === 'picture-card') {
- list.push()
- } else {
- list.push({conf.buttonText})
- }
- if (conf.showTip) {
- list.push(只能上传不超过 {conf.fileSize}{conf.sizeUnit} 的{conf.accept}文件
)
- }
- return list
- }
- }
-}
-
-export default {
- render(h) {
- const dataObject = {
- attrs: {},
- props: {},
- on: {},
- style: {}
- }
- const confClone = JSON.parse(JSON.stringify(this.conf))
- const children = []
-
- const childObjs = componentChild[confClone.tag]
- if (childObjs) {
- Object.keys(childObjs).forEach(key => {
- const childFunc = childObjs[key]
- if (confClone[key]) {
- children.push(childFunc(h, confClone, key))
- }
- })
- }
-
- Object.keys(confClone).forEach(key => {
- const val = confClone[key]
- if (key === 'vModel') {
- vModel(this, dataObject, confClone.defaultValue)
- } else if (dataObject[key]) {
- dataObject[key] = val
- } else if (!isAttr(key)) {
- dataObject.props[key] = val
- } else {
- dataObject.attrs[key] = val
- }
- })
- return h(this.conf.tag, dataObject, children)
- },
- props: ['conf']
-}
+import { makeMap } from '@/utils/index'
+
+// 参考https://github.com/vuejs/vue/blob/v2.6.10/src/platforms/web/server/util.js
+const isAttr = makeMap(
+ 'accept,accept-charset,accesskey,action,align,alt,async,autocomplete,'
+ + 'autofocus,autoplay,autosave,bgcolor,border,buffered,challenge,charset,'
+ + 'checked,cite,class,code,codebase,color,cols,colspan,content,http-equiv,'
+ + 'name,contenteditable,contextmenu,controls,coords,data,datetime,default,'
+ + 'defer,dir,dirname,disabled,download,draggable,dropzone,enctype,method,for,'
+ + 'form,formaction,headers,height,hidden,high,href,hreflang,http-equiv,'
+ + 'icon,id,ismap,itemprop,keytype,kind,label,lang,language,list,loop,low,'
+ + 'manifest,max,maxlength,media,method,GET,POST,min,multiple,email,file,'
+ + 'muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,'
+ + 'preload,radiogroup,readonly,rel,required,reversed,rows,rowspan,sandbox,'
+ + 'scope,scoped,seamless,selected,shape,size,type,text,password,sizes,span,'
+ + 'spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,'
+ + 'target,title,type,usemap,value,width,wrap'
+)
+
+function vModel(self, dataObject, defaultValue) {
+ dataObject.props.value = defaultValue
+
+ dataObject.on.input = val => {
+ self.$emit('input', val)
+ }
+}
+
+const componentChild = {
+ 'el-button': {
+ default(h, conf, key) {
+ return conf[key]
+ },
+ },
+ 'el-input': {
+ prepend(h, conf, key) {
+ return {conf[key]}
+ },
+ append(h, conf, key) {
+ return {conf[key]}
+ }
+ },
+ 'el-select': {
+ options(h, conf, key) {
+ const list = []
+ conf.options.forEach(item => {
+ list.push()
+ })
+ return list
+ }
+ },
+ 'el-radio-group': {
+ options(h, conf, key) {
+ const list = []
+ conf.options.forEach(item => {
+ if (conf.optionType === 'button') list.push({item.label})
+ else list.push({item.label})
+ })
+ return list
+ }
+ },
+ 'el-checkbox-group': {
+ options(h, conf, key) {
+ const list = []
+ conf.options.forEach(item => {
+ if (conf.optionType === 'button') {
+ list.push({item.label})
+ } else {
+ list.push({item.label})
+ }
+ })
+ return list
+ }
+ },
+ 'el-upload': {
+ 'list-type': (h, conf, key) => {
+ const list = []
+ if (conf['list-type'] === 'picture-card') {
+ list.push()
+ } else {
+ list.push({conf.buttonText})
+ }
+ if (conf.showTip) {
+ list.push(只能上传不超过 {conf.fileSize}{conf.sizeUnit} 的{conf.accept}文件
)
+ }
+ return list
+ }
+ }
+}
+
+export default {
+ render(h) {
+ const dataObject = {
+ attrs: {},
+ props: {},
+ on: {},
+ style: {}
+ }
+ const confClone = JSON.parse(JSON.stringify(this.conf))
+ const children = []
+
+ const childObjs = componentChild[confClone.tag]
+ if (childObjs) {
+ Object.keys(childObjs).forEach(key => {
+ const childFunc = childObjs[key]
+ if (confClone[key]) {
+ children.push(childFunc(h, confClone, key))
+ }
+ })
+ }
+
+ Object.keys(confClone).forEach(key => {
+ const val = confClone[key]
+ if (key === 'vModel') {
+ vModel(this, dataObject, confClone.defaultValue)
+ } else if (dataObject[key]) {
+ dataObject[key] = val
+ } else if (!isAttr(key)) {
+ dataObject.props[key] = val
+ } else {
+ dataObject.attrs[key] = val
+ }
+ })
+ return h(this.conf.tag, dataObject, children)
+ },
+ props: ['conf']
+}
diff --git a/sf-ui/src/utils/index.js b/sf-ui/src/utils/index.js
index 9679e75..4e65504 100644
--- a/sf-ui/src/utils/index.js
+++ b/sf-ui/src/utils/index.js
@@ -1,390 +1,390 @@
-import { parseTime } from './ruoyi'
-
-/**
- * 表格时间格式化
- */
-export function formatDate(cellValue) {
- if (cellValue == null || cellValue == "") return "";
- var date = new Date(cellValue)
- var year = date.getFullYear()
- var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
- var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
- var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
- var minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
- var seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
- return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds
-}
-
-/**
- * @param {number} time
- * @param {string} option
- * @returns {string}
- */
-export function formatTime(time, option) {
- if (('' + time).length === 10) {
- time = parseInt(time) * 1000
- } else {
- time = +time
- }
- const d = new Date(time)
- const now = Date.now()
-
- const diff = (now - d) / 1000
-
- if (diff < 30) {
- return '刚刚'
- } else if (diff < 3600) {
- // less 1 hour
- return Math.ceil(diff / 60) + '分钟前'
- } else if (diff < 3600 * 24) {
- return Math.ceil(diff / 3600) + '小时前'
- } else if (diff < 3600 * 24 * 2) {
- return '1天前'
- }
- if (option) {
- return parseTime(time, option)
- } else {
- return (
- d.getMonth() +
- 1 +
- '月' +
- d.getDate() +
- '日' +
- d.getHours() +
- '时' +
- d.getMinutes() +
- '分'
- )
- }
-}
-
-/**
- * @param {string} url
- * @returns {Object}
- */
-export function getQueryObject(url) {
- url = url == null ? window.location.href : url
- const search = url.substring(url.lastIndexOf('?') + 1)
- const obj = {}
- const reg = /([^?&=]+)=([^?&=]*)/g
- search.replace(reg, (rs, $1, $2) => {
- const name = decodeURIComponent($1)
- let val = decodeURIComponent($2)
- val = String(val)
- obj[name] = val
- return rs
- })
- return obj
-}
-
-/**
- * @param {string} input value
- * @returns {number} output value
- */
-export function byteLength(str) {
- // returns the byte length of an utf8 string
- let s = str.length
- for (var i = str.length - 1; i >= 0; i--) {
- const code = str.charCodeAt(i)
- if (code > 0x7f && code <= 0x7ff) s++
- else if (code > 0x7ff && code <= 0xffff) s += 2
- if (code >= 0xDC00 && code <= 0xDFFF) i--
- }
- return s
-}
-
-/**
- * @param {Array} actual
- * @returns {Array}
- */
-export function cleanArray(actual) {
- const newArray = []
- for (let i = 0; i < actual.length; i++) {
- if (actual[i]) {
- newArray.push(actual[i])
- }
- }
- return newArray
-}
-
-/**
- * @param {Object} json
- * @returns {Array}
- */
-export function param(json) {
- if (!json) return ''
- return cleanArray(
- Object.keys(json).map(key => {
- if (json[key] === undefined) return ''
- return encodeURIComponent(key) + '=' + encodeURIComponent(json[key])
- })
- ).join('&')
-}
-
-/**
- * @param {string} url
- * @returns {Object}
- */
-export function param2Obj(url) {
- const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ')
- if (!search) {
- return {}
- }
- const obj = {}
- const searchArr = search.split('&')
- searchArr.forEach(v => {
- const index = v.indexOf('=')
- if (index !== -1) {
- const name = v.substring(0, index)
- const val = v.substring(index + 1, v.length)
- obj[name] = val
- }
- })
- return obj
-}
-
-/**
- * @param {string} val
- * @returns {string}
- */
-export function html2Text(val) {
- const div = document.createElement('div')
- div.innerHTML = val
- return div.textContent || div.innerText
-}
-
-/**
- * Merges two objects, giving the last one precedence
- * @param {Object} target
- * @param {(Object|Array)} source
- * @returns {Object}
- */
-export function objectMerge(target, source) {
- if (typeof target !== 'object') {
- target = {}
- }
- if (Array.isArray(source)) {
- return source.slice()
- }
- Object.keys(source).forEach(property => {
- const sourceProperty = source[property]
- if (typeof sourceProperty === 'object') {
- target[property] = objectMerge(target[property], sourceProperty)
- } else {
- target[property] = sourceProperty
- }
- })
- return target
-}
-
-/**
- * @param {HTMLElement} element
- * @param {string} className
- */
-export function toggleClass(element, className) {
- if (!element || !className) {
- return
- }
- let classString = element.className
- const nameIndex = classString.indexOf(className)
- if (nameIndex === -1) {
- classString += '' + className
- } else {
- classString =
- classString.substr(0, nameIndex) +
- classString.substr(nameIndex + className.length)
- }
- element.className = classString
-}
-
-/**
- * @param {string} type
- * @returns {Date}
- */
-export function getTime(type) {
- if (type === 'start') {
- return new Date().getTime() - 3600 * 1000 * 24 * 90
- } else {
- return new Date(new Date().toDateString())
- }
-}
-
-/**
- * @param {Function} func
- * @param {number} wait
- * @param {boolean} immediate
- * @return {*}
- */
-export function debounce(func, wait, immediate) {
- let timeout, args, context, timestamp, result
-
- const later = function() {
- // 据上一次触发时间间隔
- const last = +new Date() - timestamp
-
- // 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait
- if (last < wait && last > 0) {
- timeout = setTimeout(later, wait - last)
- } else {
- timeout = null
- // 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用
- if (!immediate) {
- result = func.apply(context, args)
- if (!timeout) context = args = null
- }
- }
- }
-
- return function(...args) {
- context = this
- timestamp = +new Date()
- const callNow = immediate && !timeout
- // 如果延时不存在,重新设定延时
- if (!timeout) timeout = setTimeout(later, wait)
- if (callNow) {
- result = func.apply(context, args)
- context = args = null
- }
-
- return result
- }
-}
-
-/**
- * This is just a simple version of deep copy
- * Has a lot of edge cases bug
- * If you want to use a perfect deep copy, use lodash's _.cloneDeep
- * @param {Object} source
- * @returns {Object}
- */
-export function deepClone(source) {
- if (!source && typeof source !== 'object') {
- throw new Error('error arguments', 'deepClone')
- }
- const targetObj = source.constructor === Array ? [] : {}
- Object.keys(source).forEach(keys => {
- if (source[keys] && typeof source[keys] === 'object') {
- targetObj[keys] = deepClone(source[keys])
- } else {
- targetObj[keys] = source[keys]
- }
- })
- return targetObj
-}
-
-/**
- * @param {Array} arr
- * @returns {Array}
- */
-export function uniqueArr(arr) {
- return Array.from(new Set(arr))
-}
-
-/**
- * @returns {string}
- */
-export function createUniqueString() {
- const timestamp = +new Date() + ''
- const randomNum = parseInt((1 + Math.random()) * 65536) + ''
- return (+(randomNum + timestamp)).toString(32)
-}
-
-/**
- * Check if an element has a class
- * @param {HTMLElement} elm
- * @param {string} cls
- * @returns {boolean}
- */
-export function hasClass(ele, cls) {
- return !!ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'))
-}
-
-/**
- * Add class to element
- * @param {HTMLElement} elm
- * @param {string} cls
- */
-export function addClass(ele, cls) {
- if (!hasClass(ele, cls)) ele.className += ' ' + cls
-}
-
-/**
- * Remove class from element
- * @param {HTMLElement} elm
- * @param {string} cls
- */
-export function removeClass(ele, cls) {
- if (hasClass(ele, cls)) {
- const reg = new RegExp('(\\s|^)' + cls + '(\\s|$)')
- ele.className = ele.className.replace(reg, ' ')
- }
-}
-
-export function makeMap(str, expectsLowerCase) {
- const map = Object.create(null)
- const list = str.split(',')
- for (let i = 0; i < list.length; i++) {
- map[list[i]] = true
- }
- return expectsLowerCase
- ? val => map[val.toLowerCase()]
- : val => map[val]
-}
-
-export const exportDefault = 'export default '
-
-export const beautifierConf = {
- html: {
- indent_size: '2',
- indent_char: ' ',
- max_preserve_newlines: '-1',
- preserve_newlines: false,
- keep_array_indentation: false,
- break_chained_methods: false,
- indent_scripts: 'separate',
- brace_style: 'end-expand',
- space_before_conditional: true,
- unescape_strings: false,
- jslint_happy: false,
- end_with_newline: true,
- wrap_line_length: '110',
- indent_inner_html: true,
- comma_first: false,
- e4x: true,
- indent_empty_lines: true
- },
- js: {
- indent_size: '2',
- indent_char: ' ',
- max_preserve_newlines: '-1',
- preserve_newlines: false,
- keep_array_indentation: false,
- break_chained_methods: false,
- indent_scripts: 'normal',
- brace_style: 'end-expand',
- space_before_conditional: true,
- unescape_strings: false,
- jslint_happy: true,
- end_with_newline: true,
- wrap_line_length: '110',
- indent_inner_html: true,
- comma_first: false,
- e4x: true,
- indent_empty_lines: true
- }
-}
-
-// 首字母大小
-export function titleCase(str) {
- return str.replace(/( |^)[a-z]/g, L => L.toUpperCase())
-}
-
-// 下划转驼峰
-export function camelCase(str) {
- return str.replace(/_[a-z]/g, str1 => str1.substr(-1).toUpperCase())
-}
-
-export function isNumberStr(str) {
- return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str)
-}
-
+import { parseTime } from './ruoyi'
+
+/**
+ * 表格时间格式化
+ */
+export function formatDate(cellValue) {
+ if (cellValue == null || cellValue == "") return "";
+ var date = new Date(cellValue)
+ var year = date.getFullYear()
+ var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
+ var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
+ var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
+ var minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
+ var seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
+ return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds
+}
+
+/**
+ * @param {number} time
+ * @param {string} option
+ * @returns {string}
+ */
+export function formatTime(time, option) {
+ if (('' + time).length === 10) {
+ time = parseInt(time) * 1000
+ } else {
+ time = +time
+ }
+ const d = new Date(time)
+ const now = Date.now()
+
+ const diff = (now - d) / 1000
+
+ if (diff < 30) {
+ return '刚刚'
+ } else if (diff < 3600) {
+ // less 1 hour
+ return Math.ceil(diff / 60) + '分钟前'
+ } else if (diff < 3600 * 24) {
+ return Math.ceil(diff / 3600) + '小时前'
+ } else if (diff < 3600 * 24 * 2) {
+ return '1天前'
+ }
+ if (option) {
+ return parseTime(time, option)
+ } else {
+ return (
+ d.getMonth() +
+ 1 +
+ '月' +
+ d.getDate() +
+ '日' +
+ d.getHours() +
+ '时' +
+ d.getMinutes() +
+ '分'
+ )
+ }
+}
+
+/**
+ * @param {string} url
+ * @returns {Object}
+ */
+export function getQueryObject(url) {
+ url = url == null ? window.location.href : url
+ const search = url.substring(url.lastIndexOf('?') + 1)
+ const obj = {}
+ const reg = /([^?&=]+)=([^?&=]*)/g
+ search.replace(reg, (rs, $1, $2) => {
+ const name = decodeURIComponent($1)
+ let val = decodeURIComponent($2)
+ val = String(val)
+ obj[name] = val
+ return rs
+ })
+ return obj
+}
+
+/**
+ * @param {string} input value
+ * @returns {number} output value
+ */
+export function byteLength(str) {
+ // returns the byte length of an utf8 string
+ let s = str.length
+ for (var i = str.length - 1; i >= 0; i--) {
+ const code = str.charCodeAt(i)
+ if (code > 0x7f && code <= 0x7ff) s++
+ else if (code > 0x7ff && code <= 0xffff) s += 2
+ if (code >= 0xDC00 && code <= 0xDFFF) i--
+ }
+ return s
+}
+
+/**
+ * @param {Array} actual
+ * @returns {Array}
+ */
+export function cleanArray(actual) {
+ const newArray = []
+ for (let i = 0; i < actual.length; i++) {
+ if (actual[i]) {
+ newArray.push(actual[i])
+ }
+ }
+ return newArray
+}
+
+/**
+ * @param {Object} json
+ * @returns {Array}
+ */
+export function param(json) {
+ if (!json) return ''
+ return cleanArray(
+ Object.keys(json).map(key => {
+ if (json[key] === undefined) return ''
+ return encodeURIComponent(key) + '=' + encodeURIComponent(json[key])
+ })
+ ).join('&')
+}
+
+/**
+ * @param {string} url
+ * @returns {Object}
+ */
+export function param2Obj(url) {
+ const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ')
+ if (!search) {
+ return {}
+ }
+ const obj = {}
+ const searchArr = search.split('&')
+ searchArr.forEach(v => {
+ const index = v.indexOf('=')
+ if (index !== -1) {
+ const name = v.substring(0, index)
+ const val = v.substring(index + 1, v.length)
+ obj[name] = val
+ }
+ })
+ return obj
+}
+
+/**
+ * @param {string} val
+ * @returns {string}
+ */
+export function html2Text(val) {
+ const div = document.createElement('div')
+ div.innerHTML = val
+ return div.textContent || div.innerText
+}
+
+/**
+ * Merges two objects, giving the last one precedence
+ * @param {Object} target
+ * @param {(Object|Array)} source
+ * @returns {Object}
+ */
+export function objectMerge(target, source) {
+ if (typeof target !== 'object') {
+ target = {}
+ }
+ if (Array.isArray(source)) {
+ return source.slice()
+ }
+ Object.keys(source).forEach(property => {
+ const sourceProperty = source[property]
+ if (typeof sourceProperty === 'object') {
+ target[property] = objectMerge(target[property], sourceProperty)
+ } else {
+ target[property] = sourceProperty
+ }
+ })
+ return target
+}
+
+/**
+ * @param {HTMLElement} element
+ * @param {string} className
+ */
+export function toggleClass(element, className) {
+ if (!element || !className) {
+ return
+ }
+ let classString = element.className
+ const nameIndex = classString.indexOf(className)
+ if (nameIndex === -1) {
+ classString += '' + className
+ } else {
+ classString =
+ classString.substr(0, nameIndex) +
+ classString.substr(nameIndex + className.length)
+ }
+ element.className = classString
+}
+
+/**
+ * @param {string} type
+ * @returns {Date}
+ */
+export function getTime(type) {
+ if (type === 'start') {
+ return new Date().getTime() - 3600 * 1000 * 24 * 90
+ } else {
+ return new Date(new Date().toDateString())
+ }
+}
+
+/**
+ * @param {Function} func
+ * @param {number} wait
+ * @param {boolean} immediate
+ * @return {*}
+ */
+export function debounce(func, wait, immediate) {
+ let timeout, args, context, timestamp, result
+
+ const later = function() {
+ // 据上一次触发时间间隔
+ const last = +new Date() - timestamp
+
+ // 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait
+ if (last < wait && last > 0) {
+ timeout = setTimeout(later, wait - last)
+ } else {
+ timeout = null
+ // 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用
+ if (!immediate) {
+ result = func.apply(context, args)
+ if (!timeout) context = args = null
+ }
+ }
+ }
+
+ return function(...args) {
+ context = this
+ timestamp = +new Date()
+ const callNow = immediate && !timeout
+ // 如果延时不存在,重新设定延时
+ if (!timeout) timeout = setTimeout(later, wait)
+ if (callNow) {
+ result = func.apply(context, args)
+ context = args = null
+ }
+
+ return result
+ }
+}
+
+/**
+ * This is just a simple version of deep copy
+ * Has a lot of edge cases bug
+ * If you want to use a perfect deep copy, use lodash's _.cloneDeep
+ * @param {Object} source
+ * @returns {Object}
+ */
+export function deepClone(source) {
+ if (!source && typeof source !== 'object') {
+ throw new Error('error arguments', 'deepClone')
+ }
+ const targetObj = source.constructor === Array ? [] : {}
+ Object.keys(source).forEach(keys => {
+ if (source[keys] && typeof source[keys] === 'object') {
+ targetObj[keys] = deepClone(source[keys])
+ } else {
+ targetObj[keys] = source[keys]
+ }
+ })
+ return targetObj
+}
+
+/**
+ * @param {Array} arr
+ * @returns {Array}
+ */
+export function uniqueArr(arr) {
+ return Array.from(new Set(arr))
+}
+
+/**
+ * @returns {string}
+ */
+export function createUniqueString() {
+ const timestamp = +new Date() + ''
+ const randomNum = parseInt((1 + Math.random()) * 65536) + ''
+ return (+(randomNum + timestamp)).toString(32)
+}
+
+/**
+ * Check if an element has a class
+ * @param {HTMLElement} elm
+ * @param {string} cls
+ * @returns {boolean}
+ */
+export function hasClass(ele, cls) {
+ return !!ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'))
+}
+
+/**
+ * Add class to element
+ * @param {HTMLElement} elm
+ * @param {string} cls
+ */
+export function addClass(ele, cls) {
+ if (!hasClass(ele, cls)) ele.className += ' ' + cls
+}
+
+/**
+ * Remove class from element
+ * @param {HTMLElement} elm
+ * @param {string} cls
+ */
+export function removeClass(ele, cls) {
+ if (hasClass(ele, cls)) {
+ const reg = new RegExp('(\\s|^)' + cls + '(\\s|$)')
+ ele.className = ele.className.replace(reg, ' ')
+ }
+}
+
+export function makeMap(str, expectsLowerCase) {
+ const map = Object.create(null)
+ const list = str.split(',')
+ for (let i = 0; i < list.length; i++) {
+ map[list[i]] = true
+ }
+ return expectsLowerCase
+ ? val => map[val.toLowerCase()]
+ : val => map[val]
+}
+
+export const exportDefault = 'export default '
+
+export const beautifierConf = {
+ html: {
+ indent_size: '2',
+ indent_char: ' ',
+ max_preserve_newlines: '-1',
+ preserve_newlines: false,
+ keep_array_indentation: false,
+ break_chained_methods: false,
+ indent_scripts: 'separate',
+ brace_style: 'end-expand',
+ space_before_conditional: true,
+ unescape_strings: false,
+ jslint_happy: false,
+ end_with_newline: true,
+ wrap_line_length: '110',
+ indent_inner_html: true,
+ comma_first: false,
+ e4x: true,
+ indent_empty_lines: true
+ },
+ js: {
+ indent_size: '2',
+ indent_char: ' ',
+ max_preserve_newlines: '-1',
+ preserve_newlines: false,
+ keep_array_indentation: false,
+ break_chained_methods: false,
+ indent_scripts: 'normal',
+ brace_style: 'end-expand',
+ space_before_conditional: true,
+ unescape_strings: false,
+ jslint_happy: true,
+ end_with_newline: true,
+ wrap_line_length: '110',
+ indent_inner_html: true,
+ comma_first: false,
+ e4x: true,
+ indent_empty_lines: true
+ }
+}
+
+// 首字母大小
+export function titleCase(str) {
+ return str.replace(/( |^)[a-z]/g, L => L.toUpperCase())
+}
+
+// 下划转驼峰
+export function camelCase(str) {
+ return str.replace(/_[a-z]/g, str1 => str1.substr(-1).toUpperCase())
+}
+
+export function isNumberStr(str) {
+ return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str)
+}
+
diff --git a/sf-ui/src/utils/permission.js b/sf-ui/src/utils/permission.js
index 25d1a02..1730e33 100644
--- a/sf-ui/src/utils/permission.js
+++ b/sf-ui/src/utils/permission.js
@@ -1,51 +1,51 @@
-import store from '@/store'
-
-/**
- * 字符权限校验
- * @param {Array} value 校验值
- * @returns {Boolean}
- */
-export function checkPermi(value) {
- if (value && value instanceof Array && value.length > 0) {
- const permissions = store.getters && store.getters.permissions
- const permissionDatas = value
- const all_permission = "*:*:*";
-
- const hasPermission = permissions.some(permission => {
- return all_permission === permission || permissionDatas.includes(permission)
- })
-
- if (!hasPermission) {
- return false
- }
- return true
- } else {
- console.error(`need roles! Like checkPermi="['system:user:add','system:user:edit']"`)
- return false
- }
-}
-
-/**
- * 角色权限校验
- * @param {Array} value 校验值
- * @returns {Boolean}
- */
-export function checkRole(value) {
- if (value && value instanceof Array && value.length > 0) {
- const roles = store.getters && store.getters.roles
- const permissionRoles = value
- const super_admin = "admin";
-
- const hasRole = roles.some(role => {
- return super_admin === role || permissionRoles.includes(role)
- })
-
- if (!hasRole) {
- return false
- }
- return true
- } else {
- console.error(`need roles! Like checkRole="['admin','editor']"`)
- return false
- }
+import store from '@/store'
+
+/**
+ * 字符权限校验
+ * @param {Array} value 校验值
+ * @returns {Boolean}
+ */
+export function checkPermi(value) {
+ if (value && value instanceof Array && value.length > 0) {
+ const permissions = store.getters && store.getters.permissions
+ const permissionDatas = value
+ const all_permission = "*:*:*";
+
+ const hasPermission = permissions.some(permission => {
+ return all_permission === permission || permissionDatas.includes(permission)
+ })
+
+ if (!hasPermission) {
+ return false
+ }
+ return true
+ } else {
+ console.error(`need roles! Like checkPermi="['system:user:add','system:user:edit']"`)
+ return false
+ }
+}
+
+/**
+ * 角色权限校验
+ * @param {Array} value 校验值
+ * @returns {Boolean}
+ */
+export function checkRole(value) {
+ if (value && value instanceof Array && value.length > 0) {
+ const roles = store.getters && store.getters.roles
+ const permissionRoles = value
+ const super_admin = "admin";
+
+ const hasRole = roles.some(role => {
+ return super_admin === role || permissionRoles.includes(role)
+ })
+
+ if (!hasRole) {
+ return false
+ }
+ return true
+ } else {
+ console.error(`need roles! Like checkRole="['admin','editor']"`)
+ return false
+ }
}
\ No newline at end of file
diff --git a/sf-ui/src/utils/request.js b/sf-ui/src/utils/request.js
index 66874e2..296889e 100644
--- a/sf-ui/src/utils/request.js
+++ b/sf-ui/src/utils/request.js
@@ -7,6 +7,7 @@ import { blobValidate, tansParams } from '@/utils/ruoyi'
import cache from '@/plugins/cache'
import { saveAs } from 'file-saver'
import Cookies from 'js-cookie'
+import router from '@/router'
let downloadLoadingInstance
// 是否显示重新登录
@@ -72,44 +73,53 @@ service.interceptors.request.use(config => {
// 响应拦截器
service.interceptors.response.use(res => {
- // 未设置状态码则默认成功状态
- const code = res.data.code || 200
- // 获取错误信息
- const msg = errorCode[code] || res.data.msg || errorCode['default']
- // 二进制数据则直接返回
- if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') {
- return res.data
- }
- if (code === 401) {
- if (!isRelogin.show) {
- isRelogin.show = true
- MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
- confirmButtonText: '重新登录',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- isRelogin.show = false
- store.dispatch('LogOut').then(() => {
- location.href = '/index'
- })
- }).catch(() => {
- isRelogin.show = false
+ // 未设置状态码则默认成功状态
+ const code = res.data.code || 200
+ // 获取错误信息
+ const msg = errorCode[code] || res.data.msg || errorCode['default']
+ // 二进制数据则直接返回
+ if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') {
+ return res.data
+ }
+ if (code === 401) {
+ if (!isRelogin.show) {
+ isRelogin.show = true
+ MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
+ confirmButtonText: '重新登录',
+ cancelButtonText: '取消',
+ type: 'warning'
+ }).then(() => {
+ isRelogin.show = false
+ store.dispatch('LogOut').then(() => {
+ location.href = '/index'
})
- }
- return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
- } else if (code === 500) {
- Message({ message: msg, type: 'error' })
- return Promise.reject(new Error(msg))
- } else if (code === 601) {
- Message({ message: msg, type: 'warning' })
- return Promise.reject('error')
- } else if (code !== 200) {
- Notification.error({ title: msg })
- return Promise.reject('error')
- } else {
- return res.data
+ }).catch(() => {
+ isRelogin.show = false
+ })
}
- },
+ return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
+ } else if (code === 4030) {
+ MessageBox.confirm('AppCode未找到,请重新选择项目。', '系统提示', {
+ confirmButtonText: '重新选择',
+ cancelButtonText: '取消',
+ type: 'warning'
+ }).then(() => {
+ router.push('/')
+ })
+ return Promise.reject('AppCode未找到,请重新选择项目。')
+ } else if (code === 500) {
+ Message({ message: msg, type: 'error' })
+ return Promise.reject(new Error(msg))
+ } else if (code === 601) {
+ Message({ message: msg, type: 'warning' })
+ return Promise.reject('error')
+ } else if (code !== 200) {
+ Notification.error({ title: msg })
+ return Promise.reject('error')
+ } else {
+ return res.data
+ }
+},
error => {
console.log('err' + error)
let { message } = error
@@ -126,7 +136,7 @@ service.interceptors.response.use(res => {
)
// 通用下载方法
-export function download(url, params, filename, config) {
+export function download (url, params, filename, config) {
downloadLoadingInstance = Loading.service({
text: '正在下载数据,请稍候',
spinner: 'el-icon-loading',
@@ -139,7 +149,7 @@ export function download(url, params, filename, config) {
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
responseType: 'blob',
...config
- }).then(async(data) => {
+ }).then(async (data) => {
const isBlob = blobValidate(data)
if (isBlob) {
const blob = new Blob([data])
diff --git a/sf-ui/src/utils/ruoyi.js b/sf-ui/src/utils/ruoyi.js
index 44bf9c4..b818800 100644
--- a/sf-ui/src/utils/ruoyi.js
+++ b/sf-ui/src/utils/ruoyi.js
@@ -6,7 +6,7 @@
*/
// 日期格式化
-export function parseTime(time, pattern) {
+export function parseTime (time, pattern) {
if (arguments.length === 0 || !time) {
return null
}
@@ -47,14 +47,14 @@ export function parseTime(time, pattern) {
}
// 表单重置
-export function resetForm(refName) {
+export function resetForm (refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
}
// 添加日期范围
-export function addDateRange(params, dateRange, propName) {
+export function addDateRange (params, dateRange, propName) {
let search = params;
search.params = typeof (search.params) === 'object' && search.params !== null && !Array.isArray(search.params) ? search.params : {};
dateRange = Array.isArray(dateRange) ? dateRange : [];
@@ -68,8 +68,27 @@ export function addDateRange(params, dateRange, propName) {
return search;
}
+
+
+// 添加日期范围
+export function addDateRange2 (params, dateRange, propName) {
+ let search = params;
+ search.params = typeof (search.params) === 'object' && search.params !== null && !Array.isArray(search.params) ? search.params : {};
+ dateRange = Array.isArray(dateRange) ? dateRange : [];
+ if (typeof (propName) === 'undefined') {
+ search.beginTime = dateRange[0];
+ search.endTime = dateRange[1];
+ } else {
+ search.params['begin' + propName] = dateRange[0];
+ search.params['end' + propName] = dateRange[1];
+ }
+ return search;
+}
+
+
+
// 回显数据字典
-export function selectDictLabel(datas, value) {
+export function selectDictLabel (datas, value) {
if (value === undefined) {
return "";
}
@@ -87,8 +106,8 @@ export function selectDictLabel(datas, value) {
}
// 回显数据字典(字符串、数组)
-export function selectDictLabels(datas, value, separator) {
- if (value === undefined || value.length ===0) {
+export function selectDictLabels (datas, value, separator) {
+ if (value === undefined || value.length === 0) {
return "";
}
if (Array.isArray(value)) {
@@ -113,7 +132,7 @@ export function selectDictLabels(datas, value, separator) {
}
// 字符串格式化(%s )
-export function sprintf(str) {
+export function sprintf (str) {
var args = arguments, flag = true, i = 1;
str = str.replace(/%s/g, function () {
var arg = args[i++];
@@ -127,7 +146,7 @@ export function sprintf(str) {
}
// 转换字符串,undefined,null等转化为""
-export function parseStrEmpty(str) {
+export function parseStrEmpty (str) {
if (!str || str == "undefined" || str == "null") {
return "";
}
@@ -135,7 +154,7 @@ export function parseStrEmpty(str) {
}
// 数据合并
-export function mergeRecursive(source, target) {
+export function mergeRecursive (source, target) {
for (var p in target) {
try {
if (target[p].constructor == Object) {
@@ -157,7 +176,7 @@ export function mergeRecursive(source, target) {
* @param {*} parentId 父节点字段 默认 'parentId'
* @param {*} children 孩子节点字段 默认 'children'
*/
-export function handleTree(data, id, parentId, children) {
+export function handleTree (data, id, parentId, children) {
let config = {
id: id || 'id',
parentId: parentId || 'parentId',
@@ -188,7 +207,7 @@ export function handleTree(data, id, parentId, children) {
adaptToChildrenList(t);
}
- function adaptToChildrenList(o) {
+ function adaptToChildrenList (o) {
if (childrenListMap[o[config.id]] !== null) {
o[config.childrenList] = childrenListMap[o[config.id]];
}
@@ -205,7 +224,7 @@ export function handleTree(data, id, parentId, children) {
* 参数处理
* @param {*} params 参数
*/
-export function tansParams(params) {
+export function tansParams (params) {
let result = ''
for (const propName of Object.keys(params)) {
const value = params[propName];
@@ -228,6 +247,6 @@ export function tansParams(params) {
}
// 验证是否为blob格式
-export function blobValidate(data) {
+export function blobValidate (data) {
return data.type !== 'application/json'
}
diff --git a/sf-ui/src/utils/scroll-to.js b/sf-ui/src/utils/scroll-to.js
index 709fa57..c5d8e04 100644
--- a/sf-ui/src/utils/scroll-to.js
+++ b/sf-ui/src/utils/scroll-to.js
@@ -1,58 +1,58 @@
-Math.easeInOutQuad = function(t, b, c, d) {
- t /= d / 2
- if (t < 1) {
- return c / 2 * t * t + b
- }
- t--
- return -c / 2 * (t * (t - 2) - 1) + b
-}
-
-// requestAnimationFrame for Smart Animating http://goo.gl/sx5sts
-var requestAnimFrame = (function() {
- return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1000 / 60) }
-})()
-
-/**
- * Because it's so fucking difficult to detect the scrolling element, just move them all
- * @param {number} amount
- */
-function move(amount) {
- document.documentElement.scrollTop = amount
- document.body.parentNode.scrollTop = amount
- document.body.scrollTop = amount
-}
-
-function position() {
- return document.documentElement.scrollTop || document.body.parentNode.scrollTop || document.body.scrollTop
-}
-
-/**
- * @param {number} to
- * @param {number} duration
- * @param {Function} callback
- */
-export function scrollTo(to, duration, callback) {
- const start = position()
- const change = to - start
- const increment = 20
- let currentTime = 0
- duration = (typeof (duration) === 'undefined') ? 500 : duration
- var animateScroll = function() {
- // increment the time
- currentTime += increment
- // find the value with the quadratic in-out easing function
- var val = Math.easeInOutQuad(currentTime, start, change, duration)
- // move the document.body
- move(val)
- // do the animation unless its over
- if (currentTime < duration) {
- requestAnimFrame(animateScroll)
- } else {
- if (callback && typeof (callback) === 'function') {
- // the animation is done so lets callback
- callback()
- }
- }
- }
- animateScroll()
-}
+Math.easeInOutQuad = function(t, b, c, d) {
+ t /= d / 2
+ if (t < 1) {
+ return c / 2 * t * t + b
+ }
+ t--
+ return -c / 2 * (t * (t - 2) - 1) + b
+}
+
+// requestAnimationFrame for Smart Animating http://goo.gl/sx5sts
+var requestAnimFrame = (function() {
+ return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1000 / 60) }
+})()
+
+/**
+ * Because it's so fucking difficult to detect the scrolling element, just move them all
+ * @param {number} amount
+ */
+function move(amount) {
+ document.documentElement.scrollTop = amount
+ document.body.parentNode.scrollTop = amount
+ document.body.scrollTop = amount
+}
+
+function position() {
+ return document.documentElement.scrollTop || document.body.parentNode.scrollTop || document.body.scrollTop
+}
+
+/**
+ * @param {number} to
+ * @param {number} duration
+ * @param {Function} callback
+ */
+export function scrollTo(to, duration, callback) {
+ const start = position()
+ const change = to - start
+ const increment = 20
+ let currentTime = 0
+ duration = (typeof (duration) === 'undefined') ? 500 : duration
+ var animateScroll = function() {
+ // increment the time
+ currentTime += increment
+ // find the value with the quadratic in-out easing function
+ var val = Math.easeInOutQuad(currentTime, start, change, duration)
+ // move the document.body
+ move(val)
+ // do the animation unless its over
+ if (currentTime < duration) {
+ requestAnimFrame(animateScroll)
+ } else {
+ if (callback && typeof (callback) === 'function') {
+ // the animation is done so lets callback
+ callback()
+ }
+ }
+ }
+ animateScroll()
+}
diff --git a/sf-ui/src/utils/validate.js b/sf-ui/src/utils/validate.js
index 9c00400..adfa254 100644
--- a/sf-ui/src/utils/validate.js
+++ b/sf-ui/src/utils/validate.js
@@ -1,83 +1,83 @@
-/**
- * @param {string} path
- * @returns {Boolean}
- */
-export function isExternal(path) {
- return /^(https?:|mailto:|tel:)/.test(path)
-}
-
-/**
- * @param {string} str
- * @returns {Boolean}
- */
-export function validUsername(str) {
- const valid_map = ['admin', 'editor']
- return valid_map.indexOf(str.trim()) >= 0
-}
-
-/**
- * @param {string} url
- * @returns {Boolean}
- */
-export function validURL(url) {
- const reg = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/
- return reg.test(url)
-}
-
-/**
- * @param {string} str
- * @returns {Boolean}
- */
-export function validLowerCase(str) {
- const reg = /^[a-z]+$/
- return reg.test(str)
-}
-
-/**
- * @param {string} str
- * @returns {Boolean}
- */
-export function validUpperCase(str) {
- const reg = /^[A-Z]+$/
- return reg.test(str)
-}
-
-/**
- * @param {string} str
- * @returns {Boolean}
- */
-export function validAlphabets(str) {
- const reg = /^[A-Za-z]+$/
- return reg.test(str)
-}
-
-/**
- * @param {string} email
- * @returns {Boolean}
- */
-export function validEmail(email) {
- const reg = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
- return reg.test(email)
-}
-
-/**
- * @param {string} str
- * @returns {Boolean}
- */
-export function isString(str) {
- if (typeof str === 'string' || str instanceof String) {
- return true
- }
- return false
-}
-
-/**
- * @param {Array} arg
- * @returns {Boolean}
- */
-export function isArray(arg) {
- if (typeof Array.isArray === 'undefined') {
- return Object.prototype.toString.call(arg) === '[object Array]'
- }
- return Array.isArray(arg)
-}
+/**
+ * @param {string} path
+ * @returns {Boolean}
+ */
+export function isExternal(path) {
+ return /^(https?:|mailto:|tel:)/.test(path)
+}
+
+/**
+ * @param {string} str
+ * @returns {Boolean}
+ */
+export function validUsername(str) {
+ const valid_map = ['admin', 'editor']
+ return valid_map.indexOf(str.trim()) >= 0
+}
+
+/**
+ * @param {string} url
+ * @returns {Boolean}
+ */
+export function validURL(url) {
+ const reg = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/
+ return reg.test(url)
+}
+
+/**
+ * @param {string} str
+ * @returns {Boolean}
+ */
+export function validLowerCase(str) {
+ const reg = /^[a-z]+$/
+ return reg.test(str)
+}
+
+/**
+ * @param {string} str
+ * @returns {Boolean}
+ */
+export function validUpperCase(str) {
+ const reg = /^[A-Z]+$/
+ return reg.test(str)
+}
+
+/**
+ * @param {string} str
+ * @returns {Boolean}
+ */
+export function validAlphabets(str) {
+ const reg = /^[A-Za-z]+$/
+ return reg.test(str)
+}
+
+/**
+ * @param {string} email
+ * @returns {Boolean}
+ */
+export function validEmail(email) {
+ const reg = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
+ return reg.test(email)
+}
+
+/**
+ * @param {string} str
+ * @returns {Boolean}
+ */
+export function isString(str) {
+ if (typeof str === 'string' || str instanceof String) {
+ return true
+ }
+ return false
+}
+
+/**
+ * @param {Array} arg
+ * @returns {Boolean}
+ */
+export function isArray(arg) {
+ if (typeof Array.isArray === 'undefined') {
+ return Object.prototype.toString.call(arg) === '[object Array]'
+ }
+ return Array.isArray(arg)
+}
diff --git a/sf-ui/src/views/FDS/installationList/add.vue b/sf-ui/src/views/FDS/installationList/add.vue
index de16b89..7e26b9c 100644
--- a/sf-ui/src/views/FDS/installationList/add.vue
+++ b/sf-ui/src/views/FDS/installationList/add.vue
@@ -8,25 +8,29 @@
-
-
-
-
-
-
-
-
-
+
+
+ {{ item.label }}
+
+
+
+
+
+
+
-
@@ -43,6 +47,16 @@
+
+
+
+
+
+
+
+
+
+
提交
取 消
@@ -63,7 +77,7 @@ export default {
data() {
return {
formData: {
- uploadingType: 'OnLineUploading',
+ uploadingType: 'OffLineUploading',
sysApkName: undefined,
version: undefined,
sysApk: null,
@@ -109,7 +123,6 @@ export default {
})
},
getSize(e) {
- console.log(e)
this.formData.sysApkSize = e[0].size + 'kb'
},
cancel() {
diff --git a/sf-ui/src/views/FDS/installationList/detail.vue b/sf-ui/src/views/FDS/installationList/detail.vue
index 8e93a32..2213aa4 100644
--- a/sf-ui/src/views/FDS/installationList/detail.vue
+++ b/sf-ui/src/views/FDS/installationList/detail.vue
@@ -27,11 +27,11 @@
登录模块
{{ form.createTime }}
-
-
-
+
+
+
{{ form.created }}
-
+ 日志日志
关 闭
diff --git a/sf-ui/src/views/FDS/installationList/edit.vue b/sf-ui/src/views/FDS/installationList/edit.vue
index a3cdea0..ba121da 100644
--- a/sf-ui/src/views/FDS/installationList/edit.vue
+++ b/sf-ui/src/views/FDS/installationList/edit.vue
@@ -8,27 +8,30 @@
-
-
-
-
-
-
-
-
-
+
+
+ {{ item.label }}
+
+
+
+
+
+
+
-
@@ -45,6 +48,16 @@
+
+
+
+
+
+
+
+
+
+
提交
取 消
diff --git a/sf-ui/src/views/FDS/installationList/index.vue b/sf-ui/src/views/FDS/installationList/index.vue
index e356451..1ac9418 100644
--- a/sf-ui/src/views/FDS/installationList/index.vue
+++ b/sf-ui/src/views/FDS/installationList/index.vue
@@ -1,39 +1,68 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
搜索
@@ -43,159 +72,120 @@
- 新增
+ 新建
-
-
-
-
-
-
-
-
-
-
-
-
- 批量删除
+ 批量删除
-
-
-
-
-
- 安装包
-
- 复制当前的安装包地址
-
-
-
-
- 复制
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ parseTime(scope.row.createTime) }}
+
+
+
+
+
+
-
-
+
-
-
-
-
-
-
-
- 下载安装包
+ 下载安装包
-
- 修改
+ 编辑
-
- 详情
+ 详情
- 删除
+ 删除
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ form.sysApkName }}
-
-
- {{ form.version }}
-
-
- {{ form.sysApk }}
-
-
- {{ form.sysApkSize }}
-
-
- {{ form.sysType }}
-
-
-
- 复制
-
-
- {{ form.createTime }}
-
- {{ form.created }}
-
-
-
-
+
-
-
-
+
+
+
+
+
+
+
+
+ {{ generateIconCode(item) }}
+
+
+
+ {{ item }}
+
+
+
+
+
+
+
+
+ {{ generateElementIconCode(item) }}
+
+
+
+ {{ item }}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sf-ui/src/views/components/icons/svg-icons.js b/sf-ui/src/views/components/icons/svg-icons.js
index 9713fd8..724cd8e 100644
--- a/sf-ui/src/views/components/icons/svg-icons.js
+++ b/sf-ui/src/views/components/icons/svg-icons.js
@@ -1,10 +1,10 @@
-const req = require.context('../../../assets/icons/svg', false, /\.svg$/)
-const requireAll = requireContext => requireContext.keys()
-
-const re = /\.\/(.*)\.svg/
-
-const svgIcons = requireAll(req).map(i => {
- return i.match(re)[1]
-})
-
-export default svgIcons
+const req = require.context('../../../assets/icons/svg', false, /\.svg$/)
+const requireAll = requireContext => requireContext.keys()
+
+const re = /\.\/(.*)\.svg/
+
+const svgIcons = requireAll(req).map(i => {
+ return i.match(re)[1]
+})
+
+export default svgIcons
diff --git a/sf-ui/src/views/dashboard/BarChart.vue b/sf-ui/src/views/dashboard/BarChart.vue
index 5be49bc..cd33d2d 100644
--- a/sf-ui/src/views/dashboard/BarChart.vue
+++ b/sf-ui/src/views/dashboard/BarChart.vue
@@ -1,102 +1,102 @@
-
-
-
-
-
+
+
+
+
+
diff --git a/sf-ui/src/views/dashboard/LineChart.vue b/sf-ui/src/views/dashboard/LineChart.vue
index 5b1ab1b..ddd1063 100644
--- a/sf-ui/src/views/dashboard/LineChart.vue
+++ b/sf-ui/src/views/dashboard/LineChart.vue
@@ -1,135 +1,135 @@
-
-
-
-
-
+
+
+
+
+
diff --git a/sf-ui/src/views/dashboard/PanelGroup.vue b/sf-ui/src/views/dashboard/PanelGroup.vue
index 8d3a73b..1a1081f 100644
--- a/sf-ui/src/views/dashboard/PanelGroup.vue
+++ b/sf-ui/src/views/dashboard/PanelGroup.vue
@@ -1,181 +1,181 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sf-ui/src/views/dashboard/PieChart.vue b/sf-ui/src/views/dashboard/PieChart.vue
index 2397704..c360057 100644
--- a/sf-ui/src/views/dashboard/PieChart.vue
+++ b/sf-ui/src/views/dashboard/PieChart.vue
@@ -1,79 +1,79 @@
-
-
-
-
-
+
+
+
+
+
diff --git a/sf-ui/src/views/dashboard/RaddarChart.vue b/sf-ui/src/views/dashboard/RaddarChart.vue
index 662e952..b1790ca 100644
--- a/sf-ui/src/views/dashboard/RaddarChart.vue
+++ b/sf-ui/src/views/dashboard/RaddarChart.vue
@@ -1,116 +1,116 @@
-
-
-
-
-
+
+
+
+
+
diff --git a/sf-ui/src/views/dashboard/mixins/resize.js b/sf-ui/src/views/dashboard/mixins/resize.js
index d26194c..b1e76e9 100644
--- a/sf-ui/src/views/dashboard/mixins/resize.js
+++ b/sf-ui/src/views/dashboard/mixins/resize.js
@@ -1,56 +1,56 @@
-import { debounce } from '@/utils'
-
-export default {
- data() {
- return {
- $_sidebarElm: null,
- $_resizeHandler: null
- }
- },
- mounted() {
- this.initListener()
- },
- activated() {
- if (!this.$_resizeHandler) {
- // avoid duplication init
- this.initListener()
- }
-
- // when keep-alive chart activated, auto resize
- this.resize()
- },
- beforeDestroy() {
- this.destroyListener()
- },
- deactivated() {
- this.destroyListener()
- },
- methods: {
- // use $_ for mixins properties
- // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential
- $_sidebarResizeHandler(e) {
- if (e.propertyName === 'width') {
- this.$_resizeHandler()
- }
- },
- initListener() {
- this.$_resizeHandler = debounce(() => {
- this.resize()
- }, 100)
- window.addEventListener('resize', this.$_resizeHandler)
-
- this.$_sidebarElm = document.getElementsByClassName('sidebar-container')[0]
- this.$_sidebarElm && this.$_sidebarElm.addEventListener('transitionend', this.$_sidebarResizeHandler)
- },
- destroyListener() {
- window.removeEventListener('resize', this.$_resizeHandler)
- this.$_resizeHandler = null
-
- this.$_sidebarElm && this.$_sidebarElm.removeEventListener('transitionend', this.$_sidebarResizeHandler)
- },
- resize() {
- const { chart } = this
- chart && chart.resize()
- }
- }
-}
+import { debounce } from '@/utils'
+
+export default {
+ data() {
+ return {
+ $_sidebarElm: null,
+ $_resizeHandler: null
+ }
+ },
+ mounted() {
+ this.initListener()
+ },
+ activated() {
+ if (!this.$_resizeHandler) {
+ // avoid duplication init
+ this.initListener()
+ }
+
+ // when keep-alive chart activated, auto resize
+ this.resize()
+ },
+ beforeDestroy() {
+ this.destroyListener()
+ },
+ deactivated() {
+ this.destroyListener()
+ },
+ methods: {
+ // use $_ for mixins properties
+ // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential
+ $_sidebarResizeHandler(e) {
+ if (e.propertyName === 'width') {
+ this.$_resizeHandler()
+ }
+ },
+ initListener() {
+ this.$_resizeHandler = debounce(() => {
+ this.resize()
+ }, 100)
+ window.addEventListener('resize', this.$_resizeHandler)
+
+ this.$_sidebarElm = document.getElementsByClassName('sidebar-container')[0]
+ this.$_sidebarElm && this.$_sidebarElm.addEventListener('transitionend', this.$_sidebarResizeHandler)
+ },
+ destroyListener() {
+ window.removeEventListener('resize', this.$_resizeHandler)
+ this.$_resizeHandler = null
+
+ this.$_sidebarElm && this.$_sidebarElm.removeEventListener('transitionend', this.$_sidebarResizeHandler)
+ },
+ resize() {
+ const { chart } = this
+ chart && chart.resize()
+ }
+ }
+}
diff --git a/sf-ui/src/views/deployment/environment/index.vue b/sf-ui/src/views/deployment/environment/index.vue
index dc7924b..b2f4737 100644
--- a/sf-ui/src/views/deployment/environment/index.vue
+++ b/sf-ui/src/views/deployment/environment/index.vue
@@ -1,13 +1,8 @@
-
+
-
+
搜索
@@ -17,87 +12,41 @@
- 新增
+ 新增
- 修改
+ 修改
- 删除
-
-
- 导出
+ 删除
-
-
+
- 修改
- 删除
+ 修改
+ 删除
-
-
+
+
-
-
+
+
@@ -112,8 +61,8 @@
@@ -124,7 +73,7 @@ import { listEnvironment, getEnvironment, delEnvironment, addEnvironment, update
export default {
name: "Environment",
- data() {
+ data () {
return {
// 遮罩层
loading: true,
@@ -163,12 +112,12 @@ export default {
}
};
},
- created() {
+ created () {
this.getList();
},
methods: {
/** 查询环境维护列表 */
- getList() {
+ getList () {
this.loading = true;
listEnvironment(this.queryParams).then(response => {
this.environmentList = response.rows;
@@ -177,12 +126,12 @@ export default {
});
},
// 取消按钮
- cancel() {
+ cancel () {
this.open = false;
this.reset();
},
// 表单重置
- reset() {
+ reset () {
this.form = {
id: null,
appId: null,
@@ -200,29 +149,29 @@ export default {
this.resetForm("form");
},
/** 搜索按钮操作 */
- handleQuery() {
+ handleQuery () {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
- resetQuery() {
+ resetQuery () {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
- handleSelectionChange(selection) {
+ handleSelectionChange (selection) {
this.ids = selection.map(item => item.id)
- this.single = selection.length!==1
+ this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
- handleAdd() {
+ handleAdd () {
this.reset();
this.open = true;
this.title = "添加环境维护";
},
/** 修改按钮操作 */
- handleUpdate(row) {
+ handleUpdate (row) {
this.reset();
const id = row.id || this.ids
getEnvironment(id).then(response => {
@@ -232,12 +181,12 @@ export default {
});
},
/** 提交按钮 */
- submitForm() {
+ submitForm () {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
- let data = Object.assign({},this.form)
- delete data.explain
+ let data = Object.assign({}, this.form)
+ delete data.explain
updateEnvironment(data).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
@@ -254,17 +203,17 @@ export default {
});
},
/** 删除按钮操作 */
- handleDelete(row) {
+ handleDelete (row) {
const ids = row.id || this.ids;
- this.$modal.confirm('是否确认删除环境维护编号为"' + ids + '"的数据项?').then(function() {
+ this.$modal.confirm('是否确认删除环境维护编号为"' + ids + '"的数据项?').then(function () {
return delEnvironment(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
- }).catch(() => {});
+ }).catch(() => { });
},
/** 导出按钮操作 */
- handleExport() {
+ handleExport () {
this.download('deployment/environment/export', {
...this.queryParams
}, `environment_${new Date().getTime()}.xlsx`)
@@ -272,3 +221,14 @@ export default {
}
};
+
diff --git a/sf-ui/src/views/deployment/install/index.vue b/sf-ui/src/views/deployment/install/index.vue
new file mode 100644
index 0000000..e9714e1
--- /dev/null
+++ b/sf-ui/src/views/deployment/install/index.vue
@@ -0,0 +1,403 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+
+
+
+
+ 新增
+
+
+
+ 批量删除
+
+
+
+
+
+
+
+
+
+
+ 安装包
+
+
+ 复制当前的安装包地址
+
+
+
+
+ 复制
+
+
+
+
+
+
+
+
+
+
+
+
+
+
操作
+
+ 下载
+ 修改
+ 详情
+ 删除
+
+
+ 更多
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ form.sysApkName }}
+
+
+ {{ form.version }}
+
+
+
+
+ 复制
+
+
+
+ {{ form.sysApkSize }}
+
+
+ {{ form.sysType }}
+
+
+ {{ form.createTime }}
+
+ {{ form.created }}
+
+
+
+
+
+
+
+
diff --git a/sf-ui/src/views/deployment/module/index.vue b/sf-ui/src/views/deployment/module/index.vue
index 97aab0f..6caff1d 100644
--- a/sf-ui/src/views/deployment/module/index.vue
+++ b/sf-ui/src/views/deployment/module/index.vue
@@ -1,8 +1,8 @@
-
-
-
+
+
+
@@ -20,7 +20,7 @@
- 新增
@@ -34,47 +34,63 @@
type="danger" @click="handleDelete">删除
-
- 导出
-
-
-
-
+
+
+
+ 安装包
+
+
+ 复制当前的H5模块包地址
+
+
+
+
+ 复制
+
+
+
-
+
-
+
-
+
- 下载安装包
-
-
- 修改
-
-
- 详情
-
-
- 删除
-
+
+
+
操作
+
+ 下载
+ 修改
+ 详情
+ 删除
+
+
+ 更多
+
@@ -83,17 +99,20 @@
@pagination="getList" />
-
-
-
-
+
+
+
+
+
+
+
-
@@ -113,74 +132,38 @@
-
-
-
+
+
+
{{ form.moduleName }}
{{ form.version }}
+
- {{ form.moduleUrl }}
-
-
-
-
-
-
-
- {{ form.moduleSize }}
-
-
-
- {{ form.sysType }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
复制
-
-
+
+
+ {{ form.moduleSize }}
+
+
+ {{ form.sysType }}
+
+
+
{{ form.createTime }}
-
-
-
{{ form.created }}
-
-