Răsfoiți Sursa

merge: merge code

wenjianzhang 5 ani în urmă
părinte
comite
b53769ee3c

+ 4 - 4
src/components/parser/Parser.vue

@@ -34,8 +34,8 @@ const layouts = {
     let child = renderChildren.apply(this, arguments)
     if (scheme.type === 'flex') {
       child = <el-row type={scheme.type} justify={scheme.justify} align={scheme.align}>
-              {child}
-            </el-row>
+        {child}
+      </el-row>
     }
     return (
       <el-col span={scheme.span}>
@@ -71,8 +71,8 @@ function renderFrom(h) {
 
 function formBtns(h) {
   return <el-col>
-    <el-form-item size="large">
-      <el-button type="primary" onClick={this.submitForm}>提交</el-button>
+    <el-form-item size='large'>
+      <el-button type='primary' onClick={this.submitForm}>提交</el-button>
       <el-button onClick={this.resetForm}>重置</el-button>
     </el-form-item>
   </el-col>

+ 2 - 2
src/components/render/slots/el-input.js

@@ -1,8 +1,8 @@
 export default {
   prepend(h, conf, key) {
-    return <template slot="prepend">{conf.__slot__[key]}</template>
+    return <template slot='prepend'>{conf.__slot__[key]}</template>
   },
   append(h, conf, key) {
-    return <template slot="append">{conf.__slot__[key]}</template>
+    return <template slot='append'>{conf.__slot__[key]}</template>
   }
 }

+ 3 - 3
src/components/render/slots/el-upload.js

@@ -3,13 +3,13 @@ export default {
     const list = []
     const config = conf.__config__
     if (conf['list-type'] === 'picture-card') {
-      list.push(<i class="el-icon-plus"></i>)
+      list.push(<i class='el-icon-plus'></i>)
     } else {
-      list.push(<el-button size="small" type="primary" icon="el-icon-upload">{config.buttonText}</el-button>)
+      list.push(<el-button size='small' type='primary' icon='el-icon-upload'>{config.buttonText}</el-button>)
     }
     if (config.showTip) {
       list.push(
-        <div slot="tip" class="el-upload__tip">只能上传不超过 {config.fileSize}{config.sizeUnit} 的{conf.accept}文件</div>
+        <div slot='tip' class='el-upload__tip'>只能上传不超过 {config.fileSize}{config.sizeUnit} 的{conf.accept}文件</div>
       )
     }
     return list

+ 0 - 2
src/main.js

@@ -29,10 +29,8 @@ import '@/styles/generator/index.scss'
 
 import Tinymce from '@/components/tinymce/index.vue'
 
-
 import '@/icons'
 
-
 import * as filters from './filters' // global filters
 
 import Pagination from '@/components/Pagination'

+ 8 - 8
src/views/tools/build/DraggableItem.vue

@@ -6,15 +6,15 @@ const components = {
   itemBtns(h, element, index, parent) {
     const { copyItem, deleteItem } = this.$listeners
     return [
-      <span class="drawing-item-copy" title="复制" onClick={event => {
+      <span class='drawing-item-copy' title='复制' onClick={event => {
         copyItem(element, parent); event.stopPropagation()
       }}>
-        <i class="el-icon-copy-document" />
+        <i class='el-icon-copy-document' />
       </span>,
-      <span class="drawing-item-delete" title="删除" onClick={event => {
+      <span class='drawing-item-delete' title='删除' onClick={event => {
         deleteItem(index, parent); event.stopPropagation()
       }}>
-        <i class="el-icon-delete" />
+        <i class='el-icon-delete' />
       </span>
     ]
   }
@@ -48,15 +48,15 @@ const layouts = {
     let child = renderChildren.apply(this, arguments)
     if (element.type === 'flex') {
       child = <el-row type={element.type} justify={element.justify} align={element.align}>
-              {child}
-            </el-row>
+        {child}
+      </el-row>
     }
     return (
       <el-col span={element.__config__.span}>
         <el-row gutter={element.__config__.gutter} class={className}
           nativeOnClick={event => { activeItem(element); event.stopPropagation() }}>
-          <span class="component-name">{element.__config__.componentName}</span>
-          <draggable list={element.__config__.children} animation={340} group="componentsGroup" class="drag-wrapper">
+          <span class='component-name'>{element.__config__.componentName}</span>
+          <draggable list={element.__config__.children} animation={340} group='componentsGroup' class='drag-wrapper'>
             {child}
           </draggable>
           {components.itemBtns.apply(this, arguments)}

+ 17 - 15
src/views/tools/build/RightPanel.vue

@@ -397,8 +397,10 @@
             <el-color-picker v-model="activeData['inactive-color']" />
           </el-form-item>
 
-          <el-form-item v-if="activeData.__config__.showLabel !== undefined
-            && activeData.__config__.labelWidth !== undefined" label="显示标签"
+          <el-form-item
+            v-if="activeData.__config__.showLabel !== undefined
+              && activeData.__config__.labelWidth !== undefined"
+            label="显示标签"
           >
             <el-switch v-model="activeData.__config__.showLabel" />
           </el-form-item>
@@ -445,9 +447,9 @@
           <el-form-item
             v-if="activeData.size !== undefined &&
               (activeData.__config__.optionType === 'button' ||
-                activeData.__config__.border ||
-                activeData.__config__.tag === 'el-color-picker' ||
-                activeData.__config__.tag === 'el-button')"
+              activeData.__config__.border ||
+              activeData.__config__.tag === 'el-color-picker' ||
+              activeData.__config__.tag === 'el-button')"
             label="组件尺寸"
           >
             <el-radio-group v-model="activeData.size">
@@ -736,14 +738,14 @@ export default {
   computed: {
     documentLink() {
       return (
-        this.activeData.__config__.document
-        || 'https://element.eleme.cn/#/zh-CN/component/installation'
+        this.activeData.__config__.document ||
+        'https://element.eleme.cn/#/zh-CN/component/installation'
       )
     },
     dateOptions() {
       if (
-        this.activeData.type !== undefined
-        && this.activeData.__config__.tag === 'el-date-picker'
+        this.activeData.type !== undefined &&
+        this.activeData.__config__.tag === 'el-date-picker'
       ) {
         if (this.activeData['start-placeholder'] === undefined) {
           return this.dateTypeOptions
@@ -805,16 +807,16 @@ export default {
     },
     renderContent(h, { node, data, store }) {
       return (
-        <div class="custom-tree-node">
+        <div class='custom-tree-node'>
           <span>{node.label}</span>
-          <span class="node-operation">
+          <span class='node-operation'>
             <i on-click={() => this.append(data)}
-              class="el-icon-plus"
-              title="添加"
+              class='el-icon-plus'
+              title='添加'
             ></i>
             <i on-click={() => this.remove(node, data)}
-              class="el-icon-delete"
-              title="删除"
+              class='el-icon-delete'
+              title='删除'
             ></i>
           </span>
         </div>

+ 1 - 1
src/views/tools/build/TreeNodeDialog.vue

@@ -119,7 +119,7 @@ export default {
   computed: {},
   watch: {
     // eslint-disable-next-line func-names
-    'formData.value': function (val) {
+    'formData.value': function(val) {
       this.dataType = isNumberStr(val) ? 'number' : 'string'
     },
     id(val) {

+ 7 - 10
src/views/tools/build/index.vue

@@ -1,11 +1,11 @@
 
 <template>
-  <div class="container" id="previewApp">
+  <div id="previewApp" class="container">
     <div class="left-board">
       <div class="logo-wrapper">
         <div class="logo">
           <img :src="logo" alt="logo"> Form Generator
-          
+
         </div>
       </div>
       <el-scrollbar class="left-scrollbar">
@@ -147,9 +147,8 @@ import {
 } from '@/utils/generator/db'
 import loadBeautifier from '@/utils/generator/loadBeautifier'
 
-
 let beautifier
-const emptyActiveData = { style: {}, autosize: {} }
+const emptyActiveData = { style: {}, autosize: {}}
 let oldActiveId
 let tempActiveData
 const drawingListInDB = getDrawingList()
@@ -207,11 +206,11 @@ export default {
   },
   watch: {
     // eslint-disable-next-line func-names
-    'activeData.__config__.label': function (val, oldVal) {
+    'activeData.__config__.label': function(val, oldVal) {
       if (
-        this.activeData.placeholder === undefined
-        || !this.activeData.__config__.tag
-        || oldActiveId !== this.activeId
+        this.activeData.placeholder === undefined ||
+        !this.activeData.__config__.tag ||
+        oldActiveId !== this.activeId
       ) {
         return
       }
@@ -422,5 +421,3 @@ export default {
 @import '@/styles/generator/home.scss';
 </style>
 
-
-