Browse Source

k-form-design源码修改去掉部分组件,文本展示样式修改

lph 1 năm trước cách đây
mục cha
commit
0c917a7a3e

+ 9 - 1
zkqy-ui/src/components/updateModule/k-form-design/packages/components/KFormBuild/index.vue

@@ -76,8 +76,17 @@ export default {
     defaultValue: {
       type: Object,
       default: () => ({})
+    },
+    tableData: {
+      type: Array,
+      default: () => []
     }
   },
+  provide() {
+    return {
+      tableData: () => this.tableData,
+    };
+  },
   components: {
     buildBlocks
   },
@@ -101,7 +110,6 @@ export default {
       this.form.resetFields();
     },
     getData() {
-      console.log('this.form',this.form);
       // 提交函数,提供父级组件调用
       return new Promise((resolve, reject) => {
         try {

+ 7 - 2
zkqy-ui/src/components/updateModule/k-form-design/packages/components/KFormDesign/index.vue

@@ -165,7 +165,7 @@ export default {
   props: {
     title: {
       type: String,
-      default: "表单设计器 --by kcz"
+      default: "表单设计器"
     },
     showHead: {
       type: Boolean,
@@ -529,7 +529,7 @@ export default {
     }
   },
   created() {
-    let blackList=['评分','警告提示','HTML','富文本','按钮']
+    let blackList=['评分','警告提示','HTML','富文本','按钮','级联选择器']
     this.loadState = true;
     nodeSchema.addComputed(this.schemaGroup);
     this.schemaGroup = tempData;
@@ -537,6 +537,11 @@ export default {
     this.schemaGroup[0].list = this.schemaGroup[0].list.filter(item => {
       return !blackList.some(v=>v==item.label)
     })
+    this.schemaGroup[0].list.forEach(item => {
+      if (item.label == '树形选择器') {
+        item.label='级联选择器'
+      }
+    })
   }
 };
 </script>

+ 1 - 1
zkqy-ui/src/components/updateModule/k-form-design/packages/components/KFormDesign/module/formItemProperties.vue

@@ -847,7 +847,7 @@ export default {
       if (flag) {
       item.model='batch.'+item.tableName
       } else if(item.type){
-        item.model=item.tableName
+        item.model='tableShow.'+item.tableName
       }else {
       item.model=''
     }

+ 1 - 0
zkqy-ui/src/components/updateModule/k-form-design/packages/components/KFormDesign/module/layoutItem.vue

@@ -22,6 +22,7 @@
         @click.stop="handleSelectItem(record)"
       >
         <a-form-item
+          :colon="false"
           :label="!record.options.showLabel ? '' : record.label"
           :label-col="
             config.layout === 'horizontal' && record.options.showLabel

+ 10 - 11
zkqy-ui/src/components/updateModule/k-form-design/packages/components/KTableShow/index.vue

@@ -37,14 +37,10 @@ export default {
   watch: {
     
   },
+  inject:['tableData'],
   data() {
     return {
-      tempData:[
-        {
-          id:'1',
-          user_name:'张三',
-        }
-      ],
+      tempData:[],
     };
   },
   computed: {
@@ -56,13 +52,16 @@ export default {
       this.$emit('change',selection.map(item=>item.id))
     },
     
+    
   },
   created() {
-    console.log('record',this.record);
-    console.log('value',this.value);
-    console.log('dynamicData',this.dynamicData);
-    console.log('parentDisabled',this.parentDisabled);
-    console.log('config',this.config);
+    // console.log('record',this.record);
+    // console.log('value',this.value);
+    // console.log('dynamicData',this.dynamicData);
+    // console.log('parentDisabled',this.parentDisabled);
+    // console.log('config', this.config);
+    // console.log(this.tableData());
+    this.tempData = this.tableData();
   }
 };
 </script>

+ 16 - 4
zkqy-ui/src/components/updateModule/k-form-design/packages/components/KTextShow/KTextShow.vue

@@ -3,18 +3,23 @@
     :style="{
       textAlign: record.options.textAlign,
       transform: 'translateY(-2px)',
-      paddingRight: '8px'
+  paddingRight: '8px',
+    
     }"
   >
     <label
-      :class="{ 'ant-form-item-required': record.options.showRequiredMark }"
+    id="text-show-label"
+      :class="{
+  'ant-form-item-required': record.options.showRequiredMark,
+    }"
       :style="{
         fontFamily: record.options.fontFamily,
         fontSize: record.options.fontSize,
-        color: record.options.color
+        color: record.options.color,
+        
       }"
       v-text="record.value"
-    ></label>{{ value }}
+    ></label>{{ value}}
   </div>
 </template>
 <script>
@@ -33,3 +38,10 @@ export default {
   }
 };
 </script>
+<style lang="scss">
+.ant-form-item-label > label::after{
+  content: '' !important;
+  margin-right: 5px;
+}
+
+</style>

+ 1 - 0
zkqy-ui/src/views/system/formGroupMange/component/LayoutItem.vue

@@ -98,6 +98,7 @@
           class="delete"
           :class="record.key === selectItem.key ? 'active' : 'unactivated'"
           @click.stop="deleHandle(record)"
+          style="right: 50%; transform: translateX(100%)"
         >
           <i class="el-icon-delete"></i>
         </div>