-
-
-
-
-
@@ -26,12 +21,17 @@
-
-
-
+
+
+
+
+
+
+
+
@@ -58,6 +58,10 @@ export default {
components: { SettingMenu, LinkageField },
props: {
+ sourceElement: {
+ type: Object,
+ required: true
+ },
element: {
type: Object,
required: true
@@ -180,7 +184,7 @@ export default {
multiplexingCheck(val) {
if (val) {
// push
- this.$store.commit('addCurMultiplexingComponent', { 'component': this.element, 'componentId': this.element.id })
+ this.$store.commit('addCurMultiplexingComponent', { 'component': this.sourceElement, 'componentId': this.element.id })
} else {
// remove
this.$store.commit('removeCurMultiplexingComponentWithId', this.element.id)
@@ -311,7 +315,7 @@ export default {
padding-left: 3px;
padding-right: 0px;
cursor:pointer!important;
- background-color: rgba(10,123,224, 1);
+ background-color: #3370ff;
}
.bar-main i{
color: white;
diff --git a/frontend/src/components/canvas/components/Editor/EditBarView.vue b/frontend/src/components/canvas/components/Editor/EditBarView.vue
index 9253fa932e..b9526d9bde 100644
--- a/frontend/src/components/canvas/components/Editor/EditBarView.vue
+++ b/frontend/src/components/canvas/components/Editor/EditBarView.vue
@@ -149,7 +149,7 @@ export default {
padding-left: 3px!important;
padding-right: 0px!important;
cursor:pointer!important;
- background-color: #0a7be0;
+ background-color: #3370ff;
}
.bar-main i{
color: white;
diff --git a/frontend/src/components/canvas/components/Editor/MobileCheckBar.vue b/frontend/src/components/canvas/components/Editor/MobileCheckBar.vue
index 9dcb0779c2..974ed5a6d6 100644
--- a/frontend/src/components/canvas/components/Editor/MobileCheckBar.vue
+++ b/frontend/src/components/canvas/components/Editor/MobileCheckBar.vue
@@ -76,7 +76,7 @@ export default {
padding-right: 1px;
cursor:pointer!important;
text-align: center;
- background-color: #0a7be0;
+ background-color: #3370ff;
}
.bar-main i{
color: white;
diff --git a/frontend/src/components/canvas/components/Editor/Preview.vue b/frontend/src/components/canvas/components/Editor/Preview.vue
index cc0ea8e755..9017d3415c 100644
--- a/frontend/src/components/canvas/components/Editor/Preview.vue
+++ b/frontend/src/components/canvas/components/Editor/Preview.vue
@@ -26,6 +26,7 @@
:key="index"
ref="viewWrapperChild"
:config="item"
+ :source-config="componentData[index]"
:search-count="searchCount"
:in-screen="inScreen"
:terminal="terminal"
@@ -37,7 +38,6 @@
/>
> > .el-popover {
+ >>> .el-popover {
height: 200px;
overflow: auto;
}
diff --git a/frontend/src/components/canvas/components/Editor/index.vue b/frontend/src/components/canvas/components/Editor/index.vue
index 2b62ac983b..037c82ccb9 100644
--- a/frontend/src/components/canvas/components/Editor/index.vue
+++ b/frontend/src/components/canvas/components/Editor/index.vue
@@ -136,7 +136,6 @@
{
bus.$emit('PanelSwitchComponent', { name: 'PanelMain' })
@@ -373,7 +374,6 @@ export default {
clearCanvas() {
this.$store.commit('setComponentData', [])
this.$store.commit('recordSnapshot', 'clearCanvas')
- this.$store.commit('setInEditorStatus', false)
},
handlePreviewChange() {
diff --git a/frontend/src/components/canvas/store/copy.js b/frontend/src/components/canvas/store/copy.js
index d483731abb..a353aa4737 100644
--- a/frontend/src/components/canvas/store/copy.js
+++ b/frontend/src/components/canvas/store/copy.js
@@ -9,13 +9,13 @@ export default {
state: {
copyData: null, // 复制粘贴剪切
isCut: false,
+ baseStyle: {
+ width: 300,
+ height: 200,
+ top: 0,
+ left: 0
+ },
viewBase: {
- style: {
- width: 300,
- height: 200,
- top: 0,
- left: 0
- },
x: 1,
y: 216,
sizex: 48,
@@ -39,10 +39,15 @@ export default {
const component =
{
...deepCopy(state.curMultiplexingComponents[componentId]),
- ...deepCopy(deepCopy(state.viewBase)),
+ ...deepCopy(state.viewBase),
'auxiliaryMatrix': canvasStyleData.auxiliaryMatrix
}
+ component.style = {
+ ...component.style,
+ ...deepCopy(state.baseStyle)
+ }
+
const tilePosition = index % 3
const divisiblePosition = parseInt(index / 3)
if (canvasStyleData.auxiliaryMatrix) {
diff --git a/frontend/src/components/widget/DeWidget/customInput.js b/frontend/src/components/widget/DeWidget/customInput.js
index 62198dafbb..e6d8ccf852 100644
--- a/frontend/src/components/widget/DeWidget/customInput.js
+++ b/frontend/src/components/widget/DeWidget/customInput.js
@@ -2,57 +2,57 @@
import { attrsMap, styleAttrs } from '@/components/widget/DeWidget/serviceNameFn.js'
export default {
- data() {
- return {
- attrsMap,
- styleAttrs,
- // 过滤组件名css变量映射
- refComNameMap: {
- 'de-date': ['--BgDateColor', '--DateColor', '--BrDateColor'],
- 'de-select': ['--BgSelectColor', '--SelectColor', '--BrSelectColor'],
- 'de-select-tree': ['--BgSelectTreeColor', '--SelectTreeColor', '--BrSelectTreeColor'],
- "de-input-search": ['--BgSearchColor', '--SearchColor', '--BrSearchColor'],
- "de-number-range": ['--BgRangeColor', '--RangeColor', '--BrRangeColor']
- }
- }
- },
- watch: {
- cssArr: {
- handler() {
- if (['de-select', 'de-select-tree'].includes(this.element.component)) {
- if (!this.element.options.attrs.multiple) {
- return
- }
- this.handleElTagStyle()
- };
- },
- deep: true
- },
- },
- computed: {
- cssArr() {
- const { brColor, wordColor, innerBgColor } = this.element.style;
- return { brColor, wordColor, innerBgColor }
- }
- },
- mounted() {
- this.handleCoustomStyle()
- },
- methods: {
- typeTransform() {
- let refNode = this.refComNameMap[this.element.component];
- if (!refNode) return [];
- return refNode
- },
- handleCoustomStyle() {
- // 判断组件是否是在仪表板内部 否则css样式取默认值
- const isPanelDe = this.$parent.handlerInputStyle;
- const { brColor, wordColor, innerBgColor } = this.element.style;
- const newValue = { brColor, wordColor, innerBgColor };
- const cssVar = this.typeTransform();
- this.styleAttrs.forEach((ele, index) => {
- document.documentElement.style.setProperty(cssVar[index], !isPanelDe ? '' : newValue[ele])
- })
- },
+ data() {
+ return {
+ attrsMap,
+ styleAttrs,
+ // 过滤组件名css变量映射
+ refComNameMap: {
+ 'de-date': ['--BgDateColor', '--DateColor', '--BrDateColor'],
+ 'de-select': ['--BgSelectColor', '--SelectColor', '--BrSelectColor'],
+ 'de-select-tree': ['--BgSelectTreeColor', '--SelectTreeColor', '--BrSelectTreeColor'],
+ 'de-input-search': ['--BgSearchColor', '--SearchColor', '--BrSearchColor'],
+ 'de-number-range': ['--BgRangeColor', '--RangeColor', '--BrRangeColor']
+ }
}
-}
\ No newline at end of file
+ },
+ watch: {
+ cssArr: {
+ handler() {
+ if (['de-select', 'de-select-tree'].includes(this.element.component)) {
+ if (!this.element.options.attrs.multiple) {
+ return
+ }
+ this.handleElTagStyle()
+ }
+ },
+ deep: true
+ },
+ },
+ computed: {
+ cssArr() {
+ const { brColor, wordColor, innerBgColor } = this.element.style
+ return { brColor, wordColor, innerBgColor }
+ }
+ },
+ mounted() {
+ this.handleCoustomStyle()
+ },
+ methods: {
+ typeTransform() {
+ const refNode = this.refComNameMap[this.element.component]
+ if (!refNode) return []
+ return refNode
+ },
+ handleCoustomStyle() {
+ // 判断组件是否是在仪表板内部 否则css样式取默认值
+ const isPanelDe = this.$parent.handlerInputStyle
+ const { brColor, wordColor, innerBgColor } = this.element.style
+ const newValue = { brColor, wordColor, innerBgColor }
+ const cssVar = this.typeTransform()
+ this.styleAttrs.forEach((ele, index) => {
+ document.documentElement.style.setProperty(cssVar[index], !isPanelDe ? '' : newValue[ele])
+ })
+ },
+ }
+}
diff --git a/frontend/src/components/widget/DeWidget/inputStyleMixin.js b/frontend/src/components/widget/DeWidget/inputStyleMixin.js
index d7bb962a61..cbcf72c892 100644
--- a/frontend/src/components/widget/DeWidget/inputStyleMixin.js
+++ b/frontend/src/components/widget/DeWidget/inputStyleMixin.js
@@ -1,90 +1,90 @@
// 通过控制 js 控制过滤组件输入框样式 如需额外处理 声明组件serviceName同名函数处理
import { timeDateRangeWidget, textInputWidget, attrsMap, styleAttrs } from '@/components/widget/DeWidget/serviceNameFn.js'
export default {
- data() {
- return {
- attrsMap,
- styleAttrs,
- // 过滤组件名ref映射
- refComNameMap: {
- 'de-date': 'dateRef',
- 'de-select-grid': 'de-select-grid',
- 'de-select': 'deSelect',
- 'de-select-tree': 'deSelectTree',
- "de-input-search": "de-input-search",
- "de-number-range": ['de-number-range-min', 'de-number-range-max']
- }
- }
- },
- watch: {
- cssArr: {
- handler(newValue) {
- if (!this.isFilterComponent) return;
- this.typeTransform().forEach(ele => {
- this.handlerInputStyle(ele, newValue)
- })
- },
- deep: true
- },
- multiple: {
- handler() {
- if (!['de-select-tree', 'de-select'].includes(this.element.component)) return;
- const time = setTimeout(() => {
- clearTimeout(time)
- this.typeTransform().forEach(ele => {
- this.handlerInputStyle(ele, this.cssArr)
- })
- }, 100)
- },
- deep: true
- }
- },
- computed: {
- cssArr() {
- const { brColor, wordColor, innerBgColor } = this.element.style;
- return { brColor, wordColor, innerBgColor }
- },
- multiple() {
- const { multiple = false } = this.element.options.attrs
- return multiple;
- }
- },
- mounted() {
- if (!this.isFilterComponent) return;
- this.typeTransform().forEach(item => {
- const nodeCache = this.$refs.deOutWidget.$refs[item].$el.querySelector('.el-input__inner') || this.$refs.deOutWidget.$refs[item].$el
- this.styleAttrs.forEach(ele => {
- nodeCache.style[this.attrsMap[ele]] = this.element.style[ele];
- this[this.element.serviceName] && this[this.element.serviceName](this.selectRange(item), ele, this.element.style[ele])
- })
- })
- },
- methods: {
- handlerInputStyle(type, newValue) {
- let nodeCache = '';
- this.styleAttrs.forEach(ele => {
- if (!nodeCache) {
- nodeCache = this.$refs.deOutWidget.$refs[type].$el.querySelector('.el-input__inner') || this.$refs.deOutWidget.$refs[type].$el
- }
- nodeCache.style[this.attrsMap[ele]] = newValue[ele];
- this[this.element.serviceName] && this[this.element.serviceName](this.selectRange(type), ele, newValue[ele])
- })
- },
- selectRange(item) {
- if (this.element.component === 'de-select-grid') {
- return this.$refs.deOutWidget.$el;
- }
- return this.$refs.deOutWidget.$refs[item].$el;
- },
- timeDateRangeWidget: timeDateRangeWidget,
- textInputWidget: textInputWidget,
- typeTransform() {
- let refNode = this.refComNameMap[this.element.component];
- if (!refNode) return [];
- if (!Array.isArray(refNode)) {
- refNode = [refNode]
- }
- return refNode
- }
+ data() {
+ return {
+ attrsMap,
+ styleAttrs,
+ // 过滤组件名ref映射
+ refComNameMap: {
+ 'de-date': 'dateRef',
+ 'de-select-grid': 'de-select-grid',
+ 'de-select': 'deSelect',
+ 'de-select-tree': 'deSelectTree',
+ 'de-input-search': 'de-input-search',
+ 'de-number-range': ['de-number-range-min', 'de-number-range-max']
+ }
}
-}
\ No newline at end of file
+ },
+ watch: {
+ cssArr: {
+ handler(newValue) {
+ if (!this.isFilterComponent) return
+ this.typeTransform().forEach(ele => {
+ this.handlerInputStyle(ele, newValue)
+ })
+ },
+ deep: true
+ },
+ multiple: {
+ handler() {
+ if (!['de-select-tree', 'de-select'].includes(this.element.component)) return
+ const time = setTimeout(() => {
+ clearTimeout(time)
+ this.typeTransform().forEach(ele => {
+ this.handlerInputStyle(ele, this.cssArr)
+ })
+ }, 100)
+ },
+ deep: true
+ }
+ },
+ computed: {
+ cssArr() {
+ const { brColor, wordColor, innerBgColor } = this.element.style
+ return { brColor, wordColor, innerBgColor }
+ },
+ multiple() {
+ const { multiple = false } = this.element.options.attrs
+ return multiple
+ }
+ },
+ mounted() {
+ if (!this.isFilterComponent) return
+ this.typeTransform().forEach(item => {
+ const nodeCache = this.$refs.deOutWidget.$refs[item].$el.querySelector('.el-input__inner') || this.$refs.deOutWidget.$refs[item].$el
+ this.styleAttrs.forEach(ele => {
+ nodeCache.style[this.attrsMap[ele]] = this.element.style[ele]
+ this[this.element.serviceName] && this[this.element.serviceName](this.selectRange(item), ele, this.element.style[ele])
+ })
+ })
+ },
+ methods: {
+ handlerInputStyle(type, newValue) {
+ let nodeCache = ''
+ this.styleAttrs.forEach(ele => {
+ if (!nodeCache) {
+ nodeCache = this.$refs.deOutWidget.$refs[type].$el.querySelector('.el-input__inner') || this.$refs.deOutWidget.$refs[type].$el
+ }
+ nodeCache.style[this.attrsMap[ele]] = newValue[ele]
+ this[this.element.serviceName] && this[this.element.serviceName](this.selectRange(type), ele, newValue[ele])
+ })
+ },
+ selectRange(item) {
+ if (this.element.component === 'de-select-grid') {
+ return this.$refs.deOutWidget.$el
+ }
+ return this.$refs.deOutWidget.$refs[item].$el
+ },
+ timeDateRangeWidget: timeDateRangeWidget,
+ textInputWidget: textInputWidget,
+ typeTransform() {
+ let refNode = this.refComNameMap[this.element.component]
+ if (!refNode) return []
+ if (!Array.isArray(refNode)) {
+ refNode = [refNode]
+ }
+ return refNode
+ }
+ }
+}
diff --git a/frontend/src/components/widget/DeWidget/serviceNameFn.js b/frontend/src/components/widget/DeWidget/serviceNameFn.js
index 61444f0000..15de69ee3b 100644
--- a/frontend/src/components/widget/DeWidget/serviceNameFn.js
+++ b/frontend/src/components/widget/DeWidget/serviceNameFn.js
@@ -1,92 +1,91 @@
const attrsMap = { brColor: 'borderColor', wordColor: 'color', innerBgColor: 'backgroundColor' }
const styleAttrs = ['innerBgColor', 'wordColor', 'brColor']
-function timeDateRangeWidget (nodeCache, name, value) {
- const classList = ['.el-range-input', '.el-range-separator']
- classList.forEach(ele => {
- let nodeList = nodeCache.querySelectorAll(ele);
- if (!nodeList.length) return;
- nodeList.forEach(ele => {
- ele.style[attrsMap[name]] = value;
- })
+function timeDateRangeWidget(nodeCache, name, value) {
+ const classList = ['.el-range-input', '.el-range-separator']
+ classList.forEach(ele => {
+ const nodeList = nodeCache.querySelectorAll(ele)
+ if (!nodeList.length) return
+ nodeList.forEach(ele => {
+ ele.style[attrsMap[name]] = value
})
+ })
}
-function textInputWidget (nodeCache, name, value) {
- let groupAppend = nodeCache.querySelector('.el-input-group__append');
- groupAppend.style[attrsMap[name]] = value;
- if (name === 'brColor') {
- groupAppend.style.borderLeft = 'none'
- }
+function textInputWidget(nodeCache, name, value) {
+ const groupAppend = nodeCache.querySelector('.el-input-group__append')
+ groupAppend.style[attrsMap[name]] = value
+ if (name === 'brColor') {
+ groupAppend.style.borderLeft = 'none'
+ }
}
-function textSelectGridWidget (nodeCache, name, value) {
- if (name === 'innerBgColor') {
- nodeCache.querySelector('.list').style.backgroundColor = value;
+function textSelectGridWidget(nodeCache, name, value) {
+ if (name === 'innerBgColor') {
+ nodeCache.querySelector('.list').style.backgroundColor = value
+ }
+ if (name === 'wordColor') {
+ const elRadio = nodeCache.querySelectorAll('.el-radio')
+ const elCheckbox = nodeCache.querySelectorAll('.el-checkbox')
+ if (elRadio.length) {
+ elRadio.forEach(ele => {
+ ele.style.color = value
+ })
}
- if (name === 'wordColor') {
- let elRadio = nodeCache.querySelectorAll('.el-radio')
- let elCheckbox = nodeCache.querySelectorAll('.el-checkbox')
- if (elRadio.length) {
- elRadio.forEach(ele => {
- ele.style.color = value;
- });
- }
- if (elCheckbox.length) {
- elCheckbox.forEach(ele => {
- ele.style.color = value;
- });
- }
+ if (elCheckbox.length) {
+ elCheckbox.forEach(ele => {
+ ele.style.color = value
+ })
}
+ }
}
function textSelectTreeWidget(nodeCache, style) {
- textSelectWidget(nodeCache, style)
+ textSelectWidget(nodeCache, style)
}
function textSelectWidget(nodeCache, style) {
- let elTag = nodeCache.querySelectorAll('.el-tag.el-tag--info')
- if (elTag.length) {
- elTag.forEach(item => {
- item.style.flexWrap = 'wrap'
- item.style.padding = '0'
- const textNode = item.querySelector('.el-select__tags-text');
- const closeNode = item.querySelector('.el-tag__close');
- textNode.style.width = '100%';
- item.style.position = 'relative';
- textNode.style.padding = '0 20px 0 8px';
- textNode.style.borderRadius = '3px';
- if (closeNode) {
- closeNode.style.position = 'absolute';
- closeNode.style.top = '60%';
- closeNode.style.transform = 'translateY(-50%)';
- closeNode.style.right = '2px';
- }
- styleAttrs.forEach((ele) => {
- if (ele !== 'brColor' && closeNode) {
- closeNode.style[attrsMap[ele]] = style[ele];
- } else {
- item.style[attrsMap[ele]] = style[ele];
- }
- textNode.style[attrsMap[ele]] = style[ele];
- })
-
- });
- }
+ const elTag = nodeCache.querySelectorAll('.el-tag.el-tag--info')
+ if (elTag.length) {
+ elTag.forEach(item => {
+ item.style.flexWrap = 'wrap'
+ item.style.padding = '0'
+ const textNode = item.querySelector('.el-select__tags-text')
+ const closeNode = item.querySelector('.el-tag__close')
+ textNode.style.width = '100%'
+ item.style.position = 'relative'
+ textNode.style.padding = '0 20px 0 8px'
+ textNode.style.borderRadius = '3px'
+ if (closeNode) {
+ closeNode.style.position = 'absolute'
+ closeNode.style.top = '60%'
+ closeNode.style.transform = 'translateY(-50%)'
+ closeNode.style.right = '2px'
+ }
+ styleAttrs.forEach((ele) => {
+ if (ele !== 'brColor' && closeNode) {
+ closeNode.style[attrsMap[ele]] = style[ele]
+ } else {
+ item.style[attrsMap[ele]] = style[ele]
+ }
+ textNode.style[attrsMap[ele]] = style[ele]
+ })
+ })
+ }
}
-function handlerInputStyle (node, style) {
- if (!node) return;
- styleAttrs.forEach(ele => {
- node.style[attrsMap[ele]] = style[ele];
- })
+function handlerInputStyle(node, style) {
+ if (!node) return
+ styleAttrs.forEach(ele => {
+ node.style[attrsMap[ele]] = style[ele]
+ })
}
export {
- attrsMap,
- styleAttrs,
- timeDateRangeWidget,
- textInputWidget,
- textSelectGridWidget,
- textSelectTreeWidget,
- textSelectWidget,
- handlerInputStyle,
-}
\ No newline at end of file
+ attrsMap,
+ styleAttrs,
+ timeDateRangeWidget,
+ textInputWidget,
+ textSelectGridWidget,
+ textSelectTreeWidget,
+ textSelectWidget,
+ handlerInputStyle,
+}
diff --git a/frontend/src/directive/index.js b/frontend/src/directive/index.js
index e44e82bfae..7077bd0dec 100644
--- a/frontend/src/directive/index.js
+++ b/frontend/src/directive/index.js
@@ -67,39 +67,38 @@ export const bottom2TopDrag = {
const closePress = {
inserted: function (el) {
el.querySelector('.el-drawer__close-btn').onmousedown = function (e) {
- e.currentTarget.style.background = '#d2d3d4';
+ e.currentTarget.style.setProperty('background', '#d2d3d4', 'important');
}
- el.querySelector('.el-drawer__close-btn').onmouseup = function (e) {
- e.currentTarget.style.background = 'none';
+ el.querySelector('.el-drawer__close-btn').onmouseup = function(e) {
+ e.currentTarget.style.background = 'none'
}
}
}
-const btnPress = {
- update: function (el, binding) {
- el.onmousedown = function (e) {
- e.currentTarget.style.setProperty('background', binding.value || '#EFF0F1', 'important');
+const btnPress = {
+ update: function(el, binding) {
+ el.onmousedown = function(e) {
+ e.currentTarget.style.setProperty('background', binding.value || '#EFF0F1', 'important')
}
- el.onmouseup = function (e) {
- e.currentTarget.style.background = 'none';
+ el.onmouseup = function(e) {
+ e.currentTarget.style.background = 'none'
}
},
}
const customStyle = {
- inserted: function (el, binding) {
- const label = el.querySelector('.el-checkbox__label');
+ inserted: function(el, binding) {
+ const label = el.querySelector('.el-checkbox__label')
if (label) {
- if (label.getAttribute("data-color") === binding.value.wordColor) {
+ if (label.getAttribute('data-color') === binding.value.wordColor) {
return
- };
- label.style.setProperty('color', binding.value.wordColor, 'important');
- label.setAttribute("data-color", binding.value.wordColor);
+ }
+ label.style.setProperty('color', binding.value.wordColor, 'important')
+ label.setAttribute('data-color', binding.value.wordColor)
}
},
}
-
export default {
install(Vue) {
// Vue.directive('data-permission', dataPermission)
diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js
index e8fc3a684a..a7dd275f25 100644
--- a/frontend/src/lang/en.js
+++ b/frontend/src/lang/en.js
@@ -1896,6 +1896,7 @@ export default {
themeDark: 'Dark',
themeCustom: 'Custom',
openHomePage: 'Show Home Page',
+ openMarketPage: 'Show Market Page',
mobileBG: 'Mobile Login page BG',
helpLink: 'Help Document Link',
homeLink: 'Home Link',
diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js
index 0b14bbfa6b..552d0f46b7 100644
--- a/frontend/src/lang/tw.js
+++ b/frontend/src/lang/tw.js
@@ -1904,7 +1904,7 @@ export default {
themeDark: '深色',
themeCustom: '自定義',
openHomePage: '顯示首頁',
-
+ openMarketPage: '显示模板市场',
mobileBG: '移動端登錄頁背景',
helpLink: '幫助文檔鏈接',
homeLink: '首頁鏈接',
diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js
index e59eba52ad..c899adf897 100644
--- a/frontend/src/lang/zh.js
+++ b/frontend/src/lang/zh.js
@@ -568,7 +568,7 @@ export default {
filter: '筛选',
list: '列表项',
list_info: '请选择列表中要展示的信息',
- sure_delete: '确定删除该用户吗?',
+ sure_delete: '确定删除该用户吗?'
},
ldap: {
url: 'LDAP地址',
@@ -1914,6 +1914,7 @@ export default {
themeDark: '深色',
themeCustom: '自定义',
openHomePage: '显示首页',
+ openMarketPage: '显示模板市场',
mobileBG: '移动端登录页背景',
helpLink: '帮助文档链接',
homeLink: '首页链接',
diff --git a/frontend/src/main.js b/frontend/src/main.js
index bc30338344..7a8a248651 100644
--- a/frontend/src/main.js
+++ b/frontend/src/main.js
@@ -45,8 +45,6 @@ Vue.prototype.$gaodeMap = GaodeMap
import UmyUi from 'umy-ui'
Vue.use(UmyUi)
-import vcolorpicker from 'vcolorpicker'
-Vue.use(vcolorpicker)
// 全屏插件
import fullscreen from 'vue-fullscreen'
diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js
index fc356e5295..f83f7a7acc 100644
--- a/frontend/src/store/index.js
+++ b/frontend/src/store/index.js
@@ -659,7 +659,7 @@ const data = {
setChangeProperties(state, propertyInfo) {
state.changeProperties[propertyInfo.custom][propertyInfo.property] = propertyInfo.value
},
- initCanvas(state) {
+ initCanvasBase(state) {
this.commit('setCurComponent', { component: null, index: null })
this.commit('clearLinkageSettingInfo', false)
this.commit('resetViewEditInfo')
@@ -676,6 +676,9 @@ const data = {
customStyle: {},
customAttr: {}
}
+ },
+ initCanvas(state) {
+ this.commit('initCanvasBase')
state.isInEditor = true
},
initViewRender(state, pluginViews) {
diff --git a/frontend/src/styles/deicon/iconfont.js b/frontend/src/styles/deicon/iconfont.js
index 1c9d5cb024..4565258bc4 100644
--- a/frontend/src/styles/deicon/iconfont.js
+++ b/frontend/src/styles/deicon/iconfont.js
@@ -1 +1 @@
-!function(l){var c,a,h,i,v,t='',o=(o=document.getElementsByTagName("script"))[o.length-1].getAttribute("data-injectcss"),z=function(l,c){c.parentNode.insertBefore(l,c)};if(o&&!l.__iconfont__svg__cssinject__){l.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(l){console&&console.log(l)}}function m(){v||(v=!0,h())}function p(){try{i.documentElement.doScroll("left")}catch(l){return void setTimeout(p,50)}m()}c=function(){var l,c=document.createElement("div");c.innerHTML=t,t=null,(c=c.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",c=c,(l=document.body).firstChild?z(c,l.firstChild):l.appendChild(c))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(c,0):(a=function(){document.removeEventListener("DOMContentLoaded",a,!1),c()},document.addEventListener("DOMContentLoaded",a,!1)):document.attachEvent&&(h=c,i=l.document,v=!1,p(),i.onreadystatechange=function(){"complete"==i.readyState&&(i.onreadystatechange=null,m())})}(window);
\ No newline at end of file
+!(function(l) { var c; var a; var h; var i; var v; var t = ''; var o = (o = document.getElementsByTagName('script'))[o.length - 1].getAttribute('data-injectcss'); var z = function(l, c) { c.parentNode.insertBefore(l, c) }; if (o && !l.__iconfont__svg__cssinject__) { l.__iconfont__svg__cssinject__ = !0; try { document.write('') } catch (l) { console && console.log(l) } } function m() { v || (v = !0, h()) } function p() { try { i.documentElement.doScroll('left') } catch (l) { return void setTimeout(p, 50) }m() }c = function() { var l; var c = document.createElement('div'); c.innerHTML = t, t = null, (c = c.getElementsByTagName('svg')[0]) && (c.setAttribute('aria-hidden', 'true'), c.style.position = 'absolute', c.style.width = 0, c.style.height = 0, c.style.overflow = 'hidden', c = c, (l = document.body).firstChild ? z(c, l.firstChild) : l.appendChild(c)) }, document.addEventListener ? ~['complete', 'loaded', 'interactive'].indexOf(document.readyState) ? setTimeout(c, 0) : (a = function() { document.removeEventListener('DOMContentLoaded', a, !1), c() }, document.addEventListener('DOMContentLoaded', a, !1)) : document.attachEvent && (h = c, i = l.document, v = !1, p(), i.onreadystatechange = function() { i.readyState == 'complete' && (i.onreadystatechange = null, m()) }) }(window))
diff --git a/frontend/src/views/chart/chart/scatter/scatter.js b/frontend/src/views/chart/chart/scatter/scatter.js
index 05dd41ba46..c77e0a08dc 100644
--- a/frontend/src/views/chart/chart/scatter/scatter.js
+++ b/frontend/src/views/chart/chart/scatter/scatter.js
@@ -1,6 +1,6 @@
import { hexColorToRGBA } from '@/views/chart/chart/util'
import { componentStyle, seniorCfg } from '../common/common'
-import {BASE_ECHARTS_SELECT, DEFAULT_TOOLTIP} from '@/views/chart/chart/chart'
+import { BASE_ECHARTS_SELECT, DEFAULT_TOOLTIP } from '@/views/chart/chart/chart'
let bubbleArray = []
let terminalType = 'pc'
diff --git a/frontend/src/views/chart/components/senior/Threshold.vue b/frontend/src/views/chart/components/senior/Threshold.vue
index 4f57464334..267906fb85 100644
--- a/frontend/src/views/chart/components/senior/Threshold.vue
+++ b/frontend/src/views/chart/components/senior/Threshold.vue
@@ -400,7 +400,7 @@ span{
.field-style{
display: flex;
align-items: center;
- justify-content: start;
+ justify-content: flex-start;
}
.field-text{
diff --git a/frontend/src/views/system/SysParam/BasicSetting.vue b/frontend/src/views/system/SysParam/BasicSetting.vue
index bad233e8cb..5d345d9167 100644
--- a/frontend/src/views/system/SysParam/BasicSetting.vue
+++ b/frontend/src/views/system/SysParam/BasicSetting.vue
@@ -49,6 +49,14 @@
{{ $t('system_parameter_setting.cas_reset') + '[/cas/reset/{adminAcount}/{adminPwd}]' }}
+
+
+
+
+
+
+
+
@@ -163,8 +171,8 @@ export default {
{ paramKey: 'basic.frontTimeOut', paramValue: this.formInline.frontTimeOut, type: 'text', sort: 1 },
{ paramKey: 'basic.msgTimeOut', paramValue: this.formInline.msgTimeOut, type: 'text', sort: 2 },
{ paramKey: 'basic.loginType', paramValue: this.formInline.loginType, type: 'text', sort: 3 },
- { paramKey: 'ui.openHomePage', paramValue: this.formInline.openHomePage, type: 'text', sort: 13 }
-
+ { paramKey: 'ui.openHomePage', paramValue: this.formInline.openHomePage, type: 'text', sort: 13 },
+ { paramKey: 'ui.openMarketPage', paramValue: this.formInline.openMarketPage, type: 'text', sort: 14 }
]
this.$refs[formInline].validate(valid => {
diff --git a/frontend/src/views/system/SysParam/MapSetting/MapSettingLeft.vue b/frontend/src/views/system/SysParam/MapSetting/MapSettingLeft.vue
index a98d018b98..203da13b9b 100644
--- a/frontend/src/views/system/SysParam/MapSetting/MapSettingLeft.vue
+++ b/frontend/src/views/system/SysParam/MapSetting/MapSettingLeft.vue
@@ -149,8 +149,13 @@ export default {
type: 'warning'
}).then(() => {
removeMap(param).then(res => {
- this.$emit('refresh-tree')
- this.$success(this.$t('commons.delete_success'))
+ this.$store.dispatch('map/setGeo', {
+ key: param.code,
+ value: null
+ }).then(() => {
+ this.$emit('refresh-tree')
+ this.$success(this.$t('commons.delete_success'))
+ })
})
}).catch(() => {
this.$info(this.$t('commons.delete_cancel'))
diff --git a/frontend/src/views/system/SysParam/MapSetting/MapSettingRight.vue b/frontend/src/views/system/SysParam/MapSetting/MapSettingRight.vue
index ae6a8613bd..ad024cf0f5 100644
--- a/frontend/src/views/system/SysParam/MapSetting/MapSettingRight.vue
+++ b/frontend/src/views/system/SysParam/MapSetting/MapSettingRight.vue
@@ -131,7 +131,7 @@ export default {
},
data() {
return {
- formInline: { pCode: '' },
+ formInline: { pCode: '', fileName: '' },
loading: false,
rules: {
pCode: [
@@ -227,7 +227,7 @@ export default {
return true
},
uploadMapFile(file) {
- this.formInline.fileName = file.file.name
+ this.$set(this.formInline, 'fileName', file.file.name)
this.formInline.file = file.file
},
removeFile() {
diff --git a/frontend/src/views/system/datasource/ApiTestModel.js b/frontend/src/views/system/datasource/ApiTestModel.js
index 690f4263aa..dd5c98f2d5 100644
--- a/frontend/src/views/system/datasource/ApiTestModel.js
+++ b/frontend/src/views/system/datasource/ApiTestModel.js
@@ -1,14 +1,13 @@
export class BaseConfig {
-
set(options, notUndefined) {
options = this.initOptions(options)
- for (let name in options) {
+ for (const name in options) {
if (options.hasOwnProperty(name)) {
if (!(this[name] instanceof Array)) {
if (notUndefined === true) {
- this[name] = options[name] === undefined ? this[name] : options[name];
+ this[name] = options[name] === undefined ? this[name] : options[name]
} else {
- this[name] = options[name];
+ this[name] = options[name]
}
}
}
@@ -18,10 +17,10 @@ export class BaseConfig {
sets(types, options) {
options = this.initOptions(options)
if (types) {
- for (let name in types) {
+ for (const name in types) {
if (types.hasOwnProperty(name) && options.hasOwnProperty(name)) {
options[name].forEach(o => {
- this[name].push(new types[name](o));
+ this[name].push(new types[name](o))
})
}
}
@@ -29,137 +28,137 @@ export class BaseConfig {
}
initOptions(options) {
- return options || {};
+ return options || {}
}
isValid() {
- return true;
+ return true
}
}
export class KeyValue extends BaseConfig {
constructor(options) {
- options = options || {};
- options.enable = options.enable === undefined ? true : options.enable;
+ options = options || {}
+ options.enable = options.enable === undefined ? true : options.enable
- super();
- this.name = undefined;
- this.value = undefined;
- this.type = undefined;
- this.files = undefined;
- this.enable = undefined;
- this.uuid = undefined;
- this.time = undefined;
- this.contentType = undefined;
- this.set(options);
+ super()
+ this.name = undefined
+ this.value = undefined
+ this.type = undefined
+ this.files = undefined
+ this.enable = undefined
+ this.uuid = undefined
+ this.time = undefined
+ this.contentType = undefined
+ this.set(options)
}
isValid() {
- return (!!this.name || !!this.value) && this.type !== 'file';
+ return (!!this.name || !!this.value) && this.type !== 'file'
}
isFile() {
- return (!!this.name || !!this.value) && this.type === 'file';
+ return (!!this.name || !!this.value) && this.type === 'file'
}
}
export class Body extends BaseConfig {
constructor(options) {
- super();
- this.type = "KeyValue";
- this.raw = undefined;
- this.kvs = [];
- this.binary = [];
- this.set(options);
- this.sets({kvs: KeyValue}, {binary: KeyValue}, options);
+ super()
+ this.type = 'KeyValue'
+ this.raw = undefined
+ this.kvs = []
+ this.binary = []
+ this.set(options)
+ this.sets({ kvs: KeyValue }, { binary: KeyValue }, options)
}
isValid() {
if (this.isKV()) {
return this.kvs.some(kv => {
- return kv.isValid();
+ return kv.isValid()
})
} else {
- return !!this.raw;
+ return !!this.raw
}
}
isKV() {
- return [BODY_TYPE.FORM_DATA, BODY_TYPE.WWW_FORM, BODY_TYPE.BINARY].indexOf(this.type) > 0;
+ return [BODY_TYPE.FORM_DATA, BODY_TYPE.WWW_FORM, BODY_TYPE.BINARY].indexOf(this.type) > 0
}
}
-export const createComponent = function (name) {
- let component = MODELS[name];
+export const createComponent = function(name) {
+ const component = MODELS[name]
if (component) {
- return new component();
+ return new component()
} else {
return new UnsupportedComponent()
}
}
export const BODY_TYPE = {
- KV: "KeyValue",
- FORM_DATA: "Form_Data",
- RAW: "Raw",
- WWW_FORM: "WWW_FORM",
- XML: "XML",
- JSON: "JSON"
+ KV: 'KeyValue',
+ FORM_DATA: 'Form_Data',
+ RAW: 'Raw',
+ WWW_FORM: 'WWW_FORM',
+ XML: 'XML',
+ JSON: 'JSON'
}
export class Scenario extends BaseConfig {
constructor(options = {}) {
- super();
- this.id = undefined;
- this.name = undefined;
- this.url = undefined;
- this.variables = [];
- this.headers = [];
- this.requests = [];
- this.environmentId = undefined;
- this.dubboConfig = undefined;
- this.environment = undefined;
- this.enableCookieShare = false;
- this.enable = true;
- this.databaseConfigs = [];
- this.tcpConfig = undefined;
- this.set(options);
+ super()
+ this.id = undefined
+ this.name = undefined
+ this.url = undefined
+ this.variables = []
+ this.headers = []
+ this.requests = []
+ this.environmentId = undefined
+ this.dubboConfig = undefined
+ this.environment = undefined
+ this.enableCookieShare = false
+ this.enable = true
+ this.databaseConfigs = []
+ this.tcpConfig = undefined
+ this.set(options)
this.sets({
variables: KeyValue,
headers: KeyValue,
requests: RequestFactory,
databaseConfigs: DatabaseConfig
- }, options);
+ }, options)
}
initOptions(options = {}) {
- options.id = options.id || uuid();
- options.requests = options.requests || [new RequestFactory()];
- options.databaseConfigs = options.databaseConfigs || [];
- options.dubboConfig = new DubboConfig(options.dubboConfig);
- options.tcpConfig = new TCPConfig(options.tcpConfig);
- return options;
+ options.id = options.id || uuid()
+ options.requests = options.requests || [new RequestFactory()]
+ options.databaseConfigs = options.databaseConfigs || []
+ options.dubboConfig = new DubboConfig(options.dubboConfig)
+ options.tcpConfig = new TCPConfig(options.tcpConfig)
+ return options
}
clone() {
- let clone = new Scenario(this);
- clone.id = uuid();
- return clone;
+ const clone = new Scenario(this)
+ clone.id = uuid()
+ return clone
}
isValid() {
if (this.enable) {
for (let i = 0; i < this.requests.length; i++) {
- let validator = this.requests[i].isValid(this.environmentId, this.environment);
+ const validator = this.requests[i].isValid(this.environmentId, this.environment)
if (!validator.isValid) {
- return validator;
+ return validator
}
}
}
- return {isValid: true};
+ return { isValid: true }
}
isReference() {
- return this.id.indexOf("#") !== -1
+ return this.id.indexOf('#') !== -1
}
}
diff --git a/frontend/src/views/system/datasource/convert.js b/frontend/src/views/system/datasource/convert.js
index 9057a08438..87ab7c8a4c 100644
--- a/frontend/src/views/system/datasource/convert.js
+++ b/frontend/src/views/system/datasource/convert.js
@@ -1,20 +1,19 @@
-const isBoolean = require("lodash.isboolean");
-const isEmpty = require("lodash.isempty");
-const isInteger = require("lodash.isinteger");
-const isNull = require("lodash.isnull");
-const isNumber = require("lodash.isnumber");
-const isObject = require("lodash.isobject");
-const isString = require("lodash.isstring");
-const isArray = Array.isArray;
-
+const isBoolean = require('lodash.isboolean')
+const isEmpty = require('lodash.isempty')
+const isInteger = require('lodash.isinteger')
+const isNull = require('lodash.isnull')
+const isNumber = require('lodash.isnumber')
+const isObject = require('lodash.isobject')
+const isString = require('lodash.isstring')
+const isArray = Array.isArray
class Convert {
constructor() {
this._option = {
- $id: "http://example.com/root.json",
- $schema: "http://json-schema.org/draft-07/schema#",
+ $id: 'http://example.com/root.json',
+ $schema: 'http://json-schema.org/draft-07/schema#',
}
- this._object = null;
+ this._object = null
}
/**
@@ -25,22 +24,22 @@ class Convert {
format(object, option = {}) {
// 数据校验,确保传入的的object只能是对象或数组
if (!isObject(object)) {
- throw new TypeError("传入参数只能是对象或数组");
+ throw new TypeError('传入参数只能是对象或数组')
}
// 合并属性
- this._option = Object.assign(this._option, option);
+ this._option = Object.assign(this._option, option)
// 需要转换的对象
- this._object = object;
- let convertRes;
+ this._object = object
+ let convertRes
// 数组类型和对象类型结构不一样
if (isArray(object)) {
- convertRes = this._arrayToSchema();
+ convertRes = this._arrayToSchema()
} else {
- convertRes = this._objectToSchema();
+ convertRes = this._objectToSchema()
}
// 释放
- this._object = null;
- return convertRes;
+ this._object = null
+ return convertRes
}
/**
@@ -48,22 +47,22 @@ class Convert {
*/
_arrayToSchema() {
// root节点基本信息
- let result = this._value2object(this._object, this._option.$id, "", true);
+ const result = this._value2object(this._object, this._option.$id, '', true)
if (this._object.length > 0) {
- let itemArr = [];
+ const itemArr = []
for (let index = 0; index < this._object.length; index++) {
// 创建items对象的基本信息
- let objectItem = this._object[index]
- let item = this._value2object(objectItem, `#/items`, 'items');
+ const objectItem = this._object[index]
+ let item = this._value2object(objectItem, `#/items`, 'items')
if (isObject(objectItem) && !isEmpty(objectItem)) {
// 递归遍历
- let objectItemSchema = this._json2schema(objectItem, `#/items`);
+ const objectItemSchema = this._json2schema(objectItem, `#/items`)
// 合并对象
- item = Object.assign(item, objectItemSchema);
+ item = Object.assign(item, objectItemSchema)
}
- itemArr.push(item);
+ itemArr.push(item)
}
- result["items"] = itemArr;
+ result['items'] = itemArr
}
return result
}
@@ -72,8 +71,8 @@ class Convert {
* 对象类型转换成JSONSCHEMA
*/
_objectToSchema() {
- let baseResult = this._value2object(this._object, this._option.$id, "", true)
- let objectSchema = this._json2schema(this._object)
+ let baseResult = this._value2object(this._object, this._option.$id, '', true)
+ const objectSchema = this._json2schema(this._object)
baseResult = Object.assign(baseResult, objectSchema)
return baseResult
}
@@ -83,69 +82,69 @@ class Convert {
* @param {*} object 需要转换对象
* @param {*} name $id值
*/
- _json2schema(object, name = "") {
+ _json2schema(object, name = '') {
// 如果递归值不是对象,那么return掉
if (!isObject(object)) {
- return;
+ return
}
// 处理当前路径$id
- if (name === "" || name == undefined) {
- name = "#"
+ if (name === '' || name == undefined) {
+ name = '#'
}
- let result = {};
+ const result = {}
// 判断传入object是对象还是数组。
if (isArray(object)) {
- result.items = {};
+ result.items = {}
} else {
- result.properties = {};
+ result.properties = {}
}
// 遍历传入的对象
for (const key in object) {
if (object.hasOwnProperty(key)) {
- const element = object[key];
+ const element = object[key]
// 如果只是undefined。跳过
if (element === undefined) {
- continue;
+ continue
}
- let $id = `${name}/properties/${key}`
+ const $id = `${name}/properties/${key}`
// 判断当前 element 的值 是否也是对象,如果是就继续递归,不是就赋值给result
- if(!result["properties"]){
- continue;
+ if (!result['properties']) {
+ continue
}
if (isObject(element)) {
// 创建当前属性的基本信息
- result["properties"][key] = this._value2object(element, $id, key)
+ result['properties'][key] = this._value2object(element, $id, key)
if (isArray(element)) {
// 针对空数组和有值的数组做不同处理
if (element.length > 0) {
// 是数组
- let itemArr = [];
+ const itemArr = []
for (let index = 0; index < element.length; index++) {
- let elementItem = element[index];
+ const elementItem = element[index]
// 创建items对象的基本信息
- let item = this._value2object(elementItem, `${$id}/items`, key + 'items');
+ let item = this._value2object(elementItem, `${$id}/items`, key + 'items')
// 判断第一项是否是对象,且对象属性不为空
if (isObject(elementItem) && !isEmpty(elementItem)) {
// 新增的properties才合并进来
- item = Object.assign(item, this._json2schema(elementItem, `${$id}/items`));
+ item = Object.assign(item, this._json2schema(elementItem, `${$id}/items`))
}
- itemArr.push(item);
+ itemArr.push(item)
}
- result["properties"][key]["items"] = itemArr;
+ result['properties'][key]['items'] = itemArr
}
} else {
// 不是数组,递归遍历获取,然后合并对象属性
- result["properties"][key] = Object.assign(result["properties"][key], this._json2schema(element, $id));
+ result['properties'][key] = Object.assign(result['properties'][key], this._json2schema(element, $id))
}
} else {
// 一般属性直接获取基本信息
- if (result["properties"]) {
- result["properties"][key] = this._value2object(element, $id, key);
+ if (result['properties']) {
+ result['properties'][key] = this._value2object(element, $id, key)
}
}
}
}
- return result;
+ return result
}
/**
@@ -155,39 +154,39 @@ class Convert {
* @param {*} key
*/
_value2object(value, $id, key = '', root = false) {
- let objectTemplate = {
+ const objectTemplate = {
$id: $id,
title: `The ${key} Schema`,
mock: {
- "mock": value
+ 'mock': value
},
}
// 判断是否为初始化root数据
if (root) {
- objectTemplate["$schema"] = this._option.$schema;
- objectTemplate["title"] = `The Root Schema`;
- objectTemplate["mock"] = undefined;
+ objectTemplate['$schema'] = this._option.$schema
+ objectTemplate['title'] = `The Root Schema`
+ objectTemplate['mock'] = undefined
}
if (isBoolean(value)) {
- objectTemplate.type = "boolean";
+ objectTemplate.type = 'boolean'
} else if (isInteger(value)) {
- objectTemplate.type = "integer";
+ objectTemplate.type = 'integer'
} else if (isNumber(value)) {
- objectTemplate.type = "number";
+ objectTemplate.type = 'number'
} else if (isString(value)) {
- objectTemplate.type = "string";
+ objectTemplate.type = 'string'
} else if (isNull(value)) {
- objectTemplate.type = "null";
+ objectTemplate.type = 'null'
} else if (isArray(value)) {
- objectTemplate.type = "array";
- objectTemplate["mock"] = undefined;
+ objectTemplate.type = 'array'
+ objectTemplate['mock'] = undefined
} else if (isObject(value)) {
- objectTemplate.type = "object"
- objectTemplate["mock"] = undefined;
+ objectTemplate.type = 'object'
+ objectTemplate['mock'] = undefined
}
- return objectTemplate;
+ return objectTemplate
}
}
diff --git a/frontend/src/views/system/datasource/format-utils.js b/frontend/src/views/system/datasource/format-utils.js
index b7ce6b4425..ff957f2fe9 100644
--- a/frontend/src/views/system/datasource/format-utils.js
+++ b/frontend/src/views/system/datasource/format-utils.js
@@ -1,142 +1,134 @@
-export function formatJson (json) {
- let i = 0,
- il = 0,
- tab = " ",
- newJson = "",
- indentLevel = 0,
- inString = false,
- currentChar = null;
- let flag = false;
+export function formatJson(json) {
+ let i = 0
+ let il = 0
+ const tab = ' '
+ let newJson = ''
+ let indentLevel = 0
+ let inString = false
+ let currentChar = null
+ let flag = false
for (i = 0, il = json.length; i < il; i += 1) {
- currentChar = json.charAt(i);
+ currentChar = json.charAt(i)
switch (currentChar) {
case '{':
if (i != 0 && json.charAt(i - 1) === '$') {
- newJson += currentChar;
- flag = true;
+ newJson += currentChar
+ flag = true
} else if (!inString) {
- newJson += currentChar + "\n" + repeat(tab, indentLevel + 1);
+ newJson += currentChar + '\n' + repeat(tab, indentLevel + 1)
indentLevel += 1
} else {
newJson += currentChar
}
- break;
+ break
case '[':
if (!inString) {
- newJson += currentChar + "\n" + repeat(tab, indentLevel + 1);
+ newJson += currentChar + '\n' + repeat(tab, indentLevel + 1)
indentLevel += 1
} else {
newJson += currentChar
}
- break;
+ break
case '}':
if (flag) {
- newJson += currentChar;
- flag = false;
+ newJson += currentChar
+ flag = false
} else if (!inString) {
- indentLevel -= 1;
- newJson += "\n" + repeat(tab, indentLevel) + currentChar
+ indentLevel -= 1
+ newJson += '\n' + repeat(tab, indentLevel) + currentChar
} else {
newJson += currentChar
}
- break;
+ break
case ']':
if (!inString) {
- indentLevel -= 1;
- newJson += "\n" + repeat(tab, indentLevel) + currentChar
+ indentLevel -= 1
+ newJson += '\n' + repeat(tab, indentLevel) + currentChar
} else {
newJson += currentChar
}
- break;
+ break
case ',':
if (!inString) {
- newJson += ",\n" + repeat(tab, indentLevel)
+ newJson += ',\n' + repeat(tab, indentLevel)
} else {
newJson += currentChar
}
- break;
+ break
case ':':
if (!inString) {
- newJson += ": "
+ newJson += ': '
} else {
newJson += currentChar
}
- break;
+ break
case ' ':
- case "\n":
- case "\t":
+ case '\n':
+ case '\t':
if (inString) {
newJson += currentChar
}
- break;
+ break
case '"':
if (i > 0 && json.charAt(i - 1) !== '\\') {
inString = !inString
}
- newJson += currentChar;
- break;
+ newJson += currentChar
+ break
default:
- newJson += currentChar;
+ newJson += currentChar
break
}
}
- return newJson;
+ return newJson
}
function repeat(s, count) {
return new Array(count + 1).join(s)
}
-
-
export function formatXml(text) {
- //去掉多余的空格
- text = '\n' + text.replace(/(<\w+)(\s.*?>)/g, function ($0, name, props) {
- return name + ' ' + props.replace(/\s+(\w+=)/g, " $1");
- });
- //把注释编码
- text = text.replace(//g, function ($0, text) {
- var ret = '';
- //alert(ret);
- return ret;
- });
- //调整格式
- var rgx = /\n(<(([^\?]).+?)(?:\s|\s*?>|\s*?(\/)>)(?:.*?(?:(?:(\/)>)|(?:<(\/)\2>)))?)/mg;
- var nodeStack = [];
- var output = text.replace(rgx, function ($0, all, name, isBegin, isCloseFull1, isCloseFull2, isFull1, isFull2) {
- var isClosed = (isCloseFull1 == '/') || (isCloseFull2 == '/' ) || (isFull1 == '/') || (isFull2 == '/');
- //alert([all,isClosed].join('='));
- var prefix = '';
+ // 去掉多余的空格
+ text = '\n' + text.replace(/(<\w+)(\s.*?>)/g, function($0, name, props) {
+ return name + ' ' + props.replace(/\s+(\w+=)/g, ' $1')
+ })
+ // 把注释编码
+ text = text.replace(//g, function($0, text) {
+ var ret = ''
+ return ret
+ })
+ // 调整格式
+ var rgx = /\n(<(([^\?]).+?)(?:\s|\s*?>|\s*?(\/)>)(?:.*?(?:(?:(\/)>)|(?:<(\/)\2>)))?)/mg
+ var nodeStack = []
+ var output = text.replace(rgx, function($0, all, name, isBegin, isCloseFull1, isCloseFull2, isFull1, isFull2) {
+ var isClosed = (isCloseFull1 == '/') || (isCloseFull2 == '/') || (isFull1 == '/') || (isFull2 == '/')
+ var prefix = ''
if (isBegin == '!') {
- prefix = getPrefix(nodeStack.length);
- }
- else {
+ prefix = getPrefix(nodeStack.length)
+ } else {
if (isBegin != '/') {
- prefix = getPrefix(nodeStack.length);
+ prefix = getPrefix(nodeStack.length)
if (!isClosed) {
- nodeStack.push(name);
+ nodeStack.push(name)
}
- }
- else {
- nodeStack.pop();
- prefix = getPrefix(nodeStack.length);
+ } else {
+ nodeStack.pop()
+ prefix = getPrefix(nodeStack.length)
}
}
- var ret = '\n' + prefix + all;
- return ret;
- });
- var prefixSpace = -1;
- var outputText = output.substring(1);
- //把注释还原并解码,调格式
- outputText = outputText.replace(/(\s*)/g, function ($0, prefix, text) {
- if (prefix.charAt(0) == '\r')
- prefix = prefix.substring(1);
- text = unescape(text).replace(/\r/g, '\n');
- var ret = '\n' + prefix + '';
- //alert(ret);
- return ret;
- });
- return outputText.replace(/\s+$/g, '').replace(/\r/g, '\r\n');
+ var ret = '\n' + prefix + all
+ return ret
+ })
+ var prefixSpace = -1
+ var outputText = output.substring(1)
+ // 把注释还原并解码,调格式
+ outputText = outputText.replace(/(\s*)/g, function($0, prefix, text) {
+ if (prefix.charAt(0) == '\r') { prefix = prefix.substring(1) }
+ text = unescape(text).replace(/\r/g, '\n')
+ var ret = '\n' + prefix + ''
+ return ret
+ })
+ return outputText.replace(/\s+$/g, '').replace(/\r/g, '\r\n')
}
/**
@@ -146,17 +138,17 @@ export function formatXml(text) {
* @example formatTime('2018-1-29', '{y}/{m}/{d} {h}:{i}:{s}') // -> 2018/01/29 00:00:00
*/
export function formatTime(time, cFormat) {
- if (arguments.length === 0) return null;
+ if (arguments.length === 0) return null
if ((time + '').length === 10) {
- time = +time * 1000;
+ time = +time * 1000
}
- let format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}', date;
+ const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'; let date
if (typeof time === 'object') {
- date = time;
+ date = time
} else {
- date = new Date(time);
+ date = new Date(time)
}
- let formatObj = {
+ const formatObj = {
y: date.getFullYear(),
m: date.getMonth() + 1,
d: date.getDate(),
@@ -164,22 +156,22 @@ export function formatTime(time, cFormat) {
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
- };
+ }
return format.replace(/{([ymdhisa])+}/g, (result, key) => {
- let value = formatObj[key];
- if (key === 'a') return ['一', '二', '三', '四', '五', '六', '日'][value - 1];
+ let value = formatObj[key]
+ if (key === 'a') return ['一', '二', '三', '四', '五', '六', '日'][value - 1]
if (result.length > 0 && value < 10) {
- value = '0' + value;
+ value = '0' + value
}
- return value || 0;
- });
+ return value || 0
+ })
}
function getPrefix(prefixIndex) {
- var span = ' ';
- var output = [];
+ var span = ' '
+ var output = []
for (var i = 0; i < prefixIndex; ++i) {
- output.push(span);
+ output.push(span)
}
- return output.join('');
+ return output.join('')
}
diff --git a/frontend/src/views/system/user/index.vue b/frontend/src/views/system/user/index.vue
index 1f2d6df965..2d534cfe58 100644
--- a/frontend/src/views/system/user/index.vue
+++ b/frontend/src/views/system/user/index.vue
@@ -746,7 +746,7 @@ export default {
text-align: right;
display: flex;
align-items: center;
- justify-content: end;
+ justify-content: flex-end;
.el-input--medium .el-input__icon {
line-height: 32px;
diff --git a/frontend/src/views/system/user/userEditer.vue b/frontend/src/views/system/user/userEditer.vue
index ec066391ff..596cf9926c 100644
--- a/frontend/src/views/system/user/userEditer.vue
+++ b/frontend/src/views/system/user/userEditer.vue
@@ -361,7 +361,7 @@ export default {
this.create();
return;
}
- const { deptId:id, deptName:label } = row.dept;
+ const { deptId:id, deptName:label } = (row.dept || {});
this.selectDepts = [{id, label}]
this.formType = "modify";
this.dialogVisible = true;