王家程 před 3 roky
rodič
revize
a879877f0f

+ 3 - 3
src/components/generator/wisdomUiComp.js

@@ -2,7 +2,7 @@
  * @Author: wjc
  * @Date: 2021-09-15 17:46:28
  * @LastEditors: wjc
- * @LastEditTime: 2021-09-16 16:22:50
+ * @LastEditTime: 2021-09-17 14:39:20
  * @Description: wisdom ui 组件
  */
 
@@ -56,7 +56,7 @@ export const wLayoutComponents = [
       right: ''
     },
     // 其余的为可直接写在组件标签上的属性
-    desc: '', // 描述
-    back: ''
+    desc: '描述文字', // 描述
+    back: () => {}
   }
 ]

+ 0 - 10
src/views/app/components/AttributePane/index.js

@@ -1,10 +0,0 @@
-/*
- * @Author: WangJiaCheng
- * @Date: 2021-09-14 16:24:09
- * @LastEditors: WangJiaCheng
- * @LastEditTime: 2021-09-14 16:25:10
- * @Description:
- */
-import AttributePane from './AttributePane.vue'
-
-export default AttributePane

+ 3 - 3
src/views/app/components/AttributePane/AttributePane.vue → src/views/app/components/AttributePanel/AttributePanel.vue

@@ -2,11 +2,11 @@
  * @Author: WangJiaCheng
  * @Date: 2021-09-14 16:24:04
  * @LastEditors: wjc
- * @LastEditTime: 2021-09-15 09:43:55
+ * @LastEditTime: 2021-09-17 15:13:58
  * @Description: 属性面板
 -->
 <template>
-  <div class="attribute-pane">
+  <div class="attribute-panel">
     <el-button
       type="primary"
       @click="openPane"
@@ -21,7 +21,7 @@
 
 <script>
 export default {
-  name: 'AttributePane',
+  name: 'AttributePanel',
   props: {
   },
   data() {

+ 10 - 0
src/views/app/components/AttributePanel/index.js

@@ -0,0 +1,10 @@
+/*
+ * @Author: WangJiaCheng
+ * @Date: 2021-09-14 16:24:09
+ * @LastEditors: wjc
+ * @LastEditTime: 2021-09-17 15:13:49
+ * @Description:
+ */
+import AttributePanel from './AttributePanel.vue'
+
+export default AttributePanel

+ 9 - 3
src/views/app/components/DraggableItem/DraggableItem.vue

@@ -31,14 +31,11 @@ const layouts = {
     return (
       <el-col span={config.span} class={className}
         nativeOnClick={event => { activeItem(currentItem); event.stopPropagation() }}>
-        <el-form-item label-width={labelWidth}
-          label={config.showLabel ? config.label : ''} required={config.required}>
           <render key={config.renderKey} conf={currentItem} onInput={ event => {
             this.$set(config, 'defaultValue', event)
           }}>
             {child}
           </render>
-        </el-form-item>
         {components.itemBtns.apply(this, arguments)}
       </el-col>
     )
@@ -77,6 +74,15 @@ const layouts = {
     }}>
       {child}
     </render>
+  },
+  auto(h, currentItem, index, list) {
+    const config = currentItem.__config__
+    const child = renderChildren.apply(this, arguments)
+    return <render key={config.renderKey} conf={currentItem} onInput={ event => {
+      this.$set(config, 'defaultValue', event)
+    }}>
+      {child}
+    </render>
   }
 }
 

+ 0 - 10
src/views/app/components/ElementUiPane/index.js

@@ -1,10 +0,0 @@
-/*
- * @Author: wjc
- * @Date: 2021-09-15 16:02:17
- * @LastEditors: wjc
- * @LastEditTime: 2021-09-15 16:08:48
- * @Description:
- */
-import ElementUiPane from './ElementUiPane.vue'
-
-export default ElementUiPane

+ 14 - 9
src/views/app/components/ElementUiPane/ElementUiPane.vue → src/views/app/components/ElementUiPanel/ElementUiPanel.vue

@@ -2,11 +2,11 @@
  * @Author: wjc
  * @Date: 2021-09-15 16:03:17
  * @LastEditors: wjc
- * @LastEditTime: 2021-09-16 11:23:18
+ * @LastEditTime: 2021-09-17 15:12:04
  * @Description:
 -->
 <template>
-  <div class="element-ui-pane">
+  <div class="element-ui-panel">
     <el-scrollbar>
       <div class="components-list">
         <div v-for="(item, listIndex) in elementComponents" :key="listIndex">
@@ -44,12 +44,17 @@
 <script>
 import draggable from 'vuedraggable'
 
+import {
+  exportDefault, beautifierConf, isNumberStr, titleCase, deepClone, isObjectObject
+} from '@/utils/index'
 import {
   inputComponents, selectComponents, layoutComponents, formConf
 } from '@/components/generator/config'
 
+let tempActiveData
+
 export default {
-  name: 'ElementUiPane',
+  name: 'ElementUiPanel',
   components: {
     draggable
   },
@@ -81,13 +86,13 @@ export default {
       // this.activeFormItem(clone)
     },
     cloneComponent(origin) {
-      // const clone = deepClone(origin)
-      // const config = clone.__config__
+      const clone = deepClone(origin)
+      const config = clone.__config__
       // config.span = this.formConf.span // 生成代码时,会根据span做精简判断
       // this.createIdAndKey(clone)
-      // clone.placeholder !== undefined && (clone.placeholder += config.label)
-      // tempActiveData = clone
-      // return tempActiveData
+      clone.placeholder !== undefined && (clone.placeholder += config.label)
+      tempActiveData = clone
+      return tempActiveData
     },
     onEnd(obj) {
       // if (obj.from !== obj.to) {
@@ -101,7 +106,7 @@ export default {
 </script>
 
 <style lang="less">
-  .element-ui-pane {
+  .element-ui-panel {
     height: calc(100vh - 60px);
     overflow: hidden;
     .components-list {

+ 10 - 0
src/views/app/components/ElementUiPanel/index.js

@@ -0,0 +1,10 @@
+/*
+ * @Author: wjc
+ * @Date: 2021-09-15 16:02:17
+ * @LastEditors: wjc
+ * @LastEditTime: 2021-09-17 15:12:17
+ * @Description:
+ */
+import ElementUiPanel from './ElementUiPanel.vue'
+
+export default ElementUiPanel

+ 0 - 10
src/views/app/components/WisdomUiPane/index.js

@@ -1,10 +0,0 @@
-/*
- * @Author: wjc
- * @Date: 2021-09-15 17:30:23
- * @LastEditors: wjc
- * @LastEditTime: 2021-09-15 17:30:23
- * @Description:
- */
-import WisdomUiPane from './WisdomUiPane.vue'
-
-export default WisdomUiPane

+ 6 - 7
src/views/app/components/WisdomUiPane/WisdomUiPane.vue → src/views/app/components/WisdomUiPanel/WisdomUiPanel.vue

@@ -2,14 +2,14 @@
  * @Author: wjc
  * @Date: 2021-09-15 16:03:17
  * @LastEditors: wjc
- * @LastEditTime: 2021-09-16 17:46:09
+ * @LastEditTime: 2021-09-17 15:13:22
  * @Description:
 -->
 <template>
-  <div class="wisdom-ui-pane">
+  <div class="wisdom-ui-panel">
     <el-scrollbar>
       <div class="components-list">
-        <div v-for="(item, listIndex) in elementComponents" :key="listIndex">
+        <div v-for="(item, listIndex) in wcComponents" :key="listIndex">
           <div class="components-title">
             <svg-icon icon-class="component" />
             {{ item.title }}
@@ -54,7 +54,7 @@ import {
 let tempActiveData
 
 export default {
-  name: 'WisdomUiPane',
+  name: 'WisdomUiPanel',
   components: {
     draggable
   },
@@ -62,7 +62,7 @@ export default {
   },
   data() {
     return {
-      elementComponents: [
+      wcComponents: [
         {
           title: '表单型组件',
           list: wFormComponents
@@ -88,7 +88,6 @@ export default {
       // this.createIdAndKey(clone)
       clone.placeholder !== undefined && (clone.placeholder += config.label)
       tempActiveData = clone
-      console.log('clone', tempActiveData)
       return tempActiveData
     },
     onEnd(obj) {
@@ -103,7 +102,7 @@ export default {
 </script>
 
 <style lang="less">
-  .wisdom-ui-pane {
+  .wisdom-ui-panel {
     height: calc(100vh - 60px);
     overflow: hidden;
     .components-list {

+ 10 - 0
src/views/app/components/WisdomUiPanel/index.js

@@ -0,0 +1,10 @@
+/*
+ * @Author: wjc
+ * @Date: 2021-09-15 17:30:23
+ * @LastEditors: wjc
+ * @LastEditTime: 2021-09-17 15:13:07
+ * @Description:
+ */
+import WisdomUiPanel from './WisdomUiPanel.vue'
+
+export default WisdomUiPanel

+ 3 - 3
src/views/app/editor/EditorArea/EditorArea.vue

@@ -2,7 +2,7 @@
  * @Author: wjc
  * @Date: 2021-09-16 10:55:40
  * @LastEditors: wjc
- * @LastEditTime: 2021-09-16 18:03:27
+ * @LastEditTime: 2021-09-17 11:45:14
  * @Description:
 -->
 <template>
@@ -25,7 +25,7 @@
         @deleteItem="drawingItemDelete"
       />
     </draggable>
-    <div class="header-area">
+    <!-- <div class="header-area">
       header
     </div>
     <div class="form-area">
@@ -33,7 +33,7 @@
     </div>
     <div class="table-area">
       table
-    </div>
+    </div> -->
   </div>
 </template>
 

+ 10 - 10
src/views/app/editor/index.vue

@@ -2,7 +2,7 @@
  * @Author: WangJiaCheng
  * @Date: 2021-08-20 09:10:36
  * @LastEditors: wjc
- * @LastEditTime: 2021-09-16 15:24:45
+ * @LastEditTime: 2021-09-17 15:12:55
  * @Description: 编辑器
 -->
 <template>
@@ -16,13 +16,13 @@
           <span slot="label" style="text-align: center">
             <img :src="wcIconImg" alt="wc" style="width: 16px; vertical-align: middle">
           </span>
-          <wisdom-ui-pane />
+          <wisdom-ui-panel />
         </el-tab-pane>
         <el-tab-pane>
           <span slot="label" style="text-align: center">
             <svg-icon icon-class="element-icon" style="font-size: 24px; vertical-align: middle" />
           </span>
-          <element-ui-pane />
+          <element-ui-panel />
         </el-tab-pane>
         <el-tab-pane>
           <span slot="label" style="text-align: center">
@@ -37,7 +37,7 @@
     </div>
     <div class="editor-prop">
       属性
-      <attribute-pane />
+      <attribute-panel />
     </div>
   </div>
 </template>
@@ -45,18 +45,18 @@
 <script>
 import wcIcon from '@/assets/wc.png'
 
-import AttributePane from '../components/AttributePane'
-import WisdomUiPane from '../components/WisdomUiPane'
-import ElementUiPane from '../components/ElementUiPane'
+import AttributePanel from '../components/AttributePanel'
+import WisdomUiPanel from '../components/WisdomUiPanel'
+import ElementUiPanel from '../components/ElementUiPanel'
 
 import EditorArea from './EditorArea'
 
 export default {
   name: 'Editor',
   components: {
-    AttributePane,
-    WisdomUiPane,
-    ElementUiPane,
+    AttributePanel,
+    WisdomUiPanel,
+    ElementUiPanel,
     EditorArea
   },
   data() {