diff --git a/ZR.Vue/src/store/modules/socket.js b/ZR.Vue/src/store/modules/socket.js index a7c68f2..5d9935b 100644 --- a/ZR.Vue/src/store/modules/socket.js +++ b/ZR.Vue/src/store/modules/socket.js @@ -16,7 +16,7 @@ const actions = { changeOnlineNum({ commit }, data) { commit('SET_ONLINEUSER_NUM', data) }, - // 更新系统通知 + // 更新系统通知 getNoticeList({ commit }, data) { commit('SET_NOTICE_list', data) } diff --git a/ZR.Vue/src/views/tool/build/index.vue b/ZR.Vue/src/views/tool/build/index.vue index 92291e9..c5a6d69 100644 --- a/ZR.Vue/src/views/tool/build/index.vue +++ b/ZR.Vue/src/views/tool/build/index.vue @@ -11,19 +11,9 @@
输入型组件
- -
+ +
{{ element.label }} @@ -33,21 +23,9 @@
选择型组件
- -
+ +
{{ element.label }} @@ -57,15 +35,9 @@
布局型组件
- -
+ +
{{ element.label }} @@ -90,25 +62,12 @@
- + - +
从左侧拖入或点选组件进行表单设计 @@ -118,19 +77,9 @@
- + - +
@@ -149,10 +98,16 @@ import { formConf } from '@/utils/generator/config' import { - exportDefault, beautifierConf, isNumberStr, titleCase + exportDefault, + beautifierConf, + isNumberStr, + titleCase } from '@/utils/index' import { - makeUpHtml, vueTemplate, vueScript, cssStyle + makeUpHtml, + vueTemplate, + vueScript, + cssStyle } from '@/utils/generator/html' import { makeUpJs } from '@/utils/generator/js' import { makeUpCss } from '@/utils/generator/css' @@ -161,7 +116,7 @@ import logo from '@/assets/logo/logo.png' import CodeTypeDialog from './CodeTypeDialog' import DraggableItem from './DraggableItem' -const emptyActiveData = { style: {}, autosize: {} } +const emptyActiveData = { style: {}, autosize: {}} let oldActiveId let tempActiveData @@ -193,19 +148,19 @@ export default { activeData: drawingDefalut[0] } }, - computed: { - }, + computed: {}, watch: { // eslint-disable-next-line func-names - 'activeData.label': function (val, oldVal) { + 'activeData.label': function(val, oldVal) { if ( - this.activeData.placeholder === undefined - || !this.activeData.tag - || oldActiveId !== this.activeId + this.activeData.placeholder === undefined || + !this.activeData.tag || + oldActiveId !== this.activeId ) { return } - this.activeData.placeholder = this.activeData.placeholder.replace(oldVal, '') + val + this.activeData.placeholder = + this.activeData.placeholder.replace(oldVal, '') + val }, activeId: { handler(val) { @@ -216,7 +171,7 @@ export default { }, mounted() { const clipboard = new ClipboardJS('#copyNode', { - text: trigger => { + text: (trigger) => { const codeStr = this.generateCode() this.$notify({ title: '成功', @@ -226,7 +181,7 @@ export default { return codeStr } }) - clipboard.on('error', e => { + clipboard.on('error', (e) => { this.$message.error('代码复制失败') }) }, @@ -309,7 +264,9 @@ export default { item.componentName = `row${this.idGlobal}` } if (Array.isArray(item.children)) { - item.children = item.children.map(childItem => this.createIdAndKey(childItem)) + item.children = item.children.map((childItem) => + this.createIdAndKey(childItem) + ) } return item }, @@ -353,9 +310,11 @@ export default { delete this.activeData.tag delete this.activeData.tagIcon delete this.activeData.document - Object.keys(newTag).forEach(key => { - if (this.activeData[key] !== undefined - && typeof this.activeData[key] === typeof newTag[key]) { + Object.keys(newTag).forEach((key) => { + if ( + this.activeData[key] !== undefined && + typeof this.activeData[key] === typeof newTag[key] + ) { newTag[key] = this.activeData[key] } }) @@ -363,12 +322,12 @@ export default { this.updateDrawingList(newTag, this.drawingList) }, updateDrawingList(newTag, list) { - const index = list.findIndex(item => item.formId === this.activeId) + const index = list.findIndex((item) => item.formId === this.activeId) if (index > -1) { list.splice(index, 1, newTag) } else { - list.forEach(item => { - if (Array.isArray(item.children)) this.updateDrawingList(newTag, item.children) + list.forEach((item) => { + if (Array.isArray(item.children)) { this.updateDrawingList(newTag, item.children) } }) } } @@ -377,30 +336,34 @@ export default {