ソースを参照

feat_defaults-props

ananzhusen 1 年間 前
コミット
5b459fcd29
2 ファイル変更129 行追加23 行削除
  1. 125 22
      src/services/defaults.ts
  2. 4 1
      src/views/components/PenProps.vue

+ 125 - 22
src/services/defaults.ts

@@ -1361,6 +1361,15 @@ export const formComponents = [
               description: '列表内容的描述性文字',
             },
           ],
+          props: {
+            custom: [
+              {
+                key: 'data',
+                label: '数据',
+                type: 'code',
+              },
+            ],
+          },
         },
       },
       {
@@ -1453,6 +1462,20 @@ export const formComponents = [
               ],
             },
           ],
+          props: {
+            custom: [
+              {
+                key: 'data',
+                label: '数据',
+                type: 'code',
+              },
+              {
+                key: 'styles',
+                label: '样式',
+                type: 'code',
+              },
+            ],
+          },
         },
       },
       {
@@ -1536,16 +1559,6 @@ export const formComponents = [
           ],
           props: {
             custom: [
-              {
-                key: 'data',
-                label: '数据',
-                type: 'object',
-              },
-              {
-                key: 'styles',
-                label: '样式',
-                type: 'object',
-              },
               {
                 key: 'stripe',
                 label: '显示斑马纹',
@@ -1576,6 +1589,16 @@ export const formComponents = [
                 label: '有无头部',
                 type: 'bool',
               },
+              {
+                key: 'data',
+                label: '数据',
+                type: 'code',
+              },
+              {
+                key: 'styles',
+                label: '样式',
+                type: 'code',
+              },
             ],
           },
         },
@@ -1597,6 +1620,15 @@ export const formComponents = [
           height: 400,
           externElement: true,
           iframe: 'https://le5le.com',
+          props: {
+            custom: [
+              {
+                key: 'iframe',
+                label: '网页地址',
+                type: 'string',
+              },
+            ],
+          },
         },
       },
     ],
@@ -1635,6 +1667,15 @@ export const formComponents = [
               text: '20%',
             },
           ],
+          props: {
+            custom: [
+              {
+                key: 'data',
+                label: '数据',
+                type: 'code',
+              },
+            ],
+          },
         },
       },
       {
@@ -1698,6 +1739,34 @@ export const formComponents = [
           headingColor: '#000',
           headingSize: 16,
           // headingWeight: 'bold',
+          props: {
+            custom: [
+              {
+                key: 'heading',
+                label: '标题',
+                type: 'string',
+              },
+              {
+                key: 'headingColor',
+                label: '标题颜色',
+                type: 'color',
+              },
+              {
+                key: 'headingSize',
+                label: '标题大小',
+                type: 'number',
+              },
+              {
+                key: 'headingWeight',
+                label: '标题加粗',
+                type: 'select',
+                options: [
+                  { label: '加粗', value: 'bold' },
+                  { label: '正常', value: '' },
+                ],
+              },
+            ],
+          },
         },
       },
       // {
@@ -1723,6 +1792,20 @@ export const formComponents = [
           height: 40,
           data: ['轮播第一次数据', '轮播第二次数据', '轮播第三次数据'],
           hiddenText: true,
+          props: {
+            custom: [
+              {
+                key: 'data',
+                label: '数据',
+                type: 'code',
+              },
+              {
+                key: 'timeout',
+                label: '轮播时间',
+                type: 'number',
+              },
+            ],
+          },
         },
       },
       {
@@ -1736,6 +1819,20 @@ export const formComponents = [
           lineHeight: 2,
           data: ['轮播第一次数据', '轮播第二次数据', '轮播第三次数据'],
           hiddenText: true,
+          props: {
+            custom: [
+              {
+                key: 'data',
+                label: '数据',
+                type: 'code',
+              },
+              {
+                key: 'timeout',
+                label: '轮播时间',
+                type: 'number',
+              },
+            ],
+          },
         },
       },
       {
@@ -1745,18 +1842,6 @@ export const formComponents = [
           name: 'leSwiper',
           width: 400,
           height: 300,
-          // swiperType: 'iframe',
-          // data: [
-          //   {
-          //     src: 'https://2d.le5le.com/preview?id=6357a9e2d44b9402de84d2e8',
-          //   },
-          //   {
-          //     src: 'https://2d.le5le.com/preview?id=6357aec8d44b9402de84d2f1',
-          //   },
-          //   {
-          //     src: 'https://2d.le5le.com/preview?id=641d524a8df2c654ea652d7e',
-          //   },
-          // ],
           data: [
             {
               src: 'https://2ds.le5le.com/img/banner1.bc890350.png',
@@ -1769,6 +1854,15 @@ export const formComponents = [
             },
           ],
           hiddenText: true,
+          props: {
+            custom: [
+              {
+                key: 'data',
+                label: '数据',
+                type: 'code',
+              },
+            ],
+          },
         },
       },
       {
@@ -1791,6 +1885,15 @@ export const formComponents = [
             },
           ],
           hiddenText: true,
+          props: {
+            custom: [
+              {
+                key: 'data',
+                label: '数据',
+                type: 'code',
+              },
+            ],
+          },
         },
       },
     ],

+ 4 - 1
src/views/components/PenProps.vue

@@ -858,10 +858,13 @@
                     v-model="data.pen[item.key]"
                     @change="changeValue(item.key)"
                   />
-                  <t-input
+                  <t-input-number
                     class="w-full"
                     v-else-if="item.type === 'number'"
                     v-model.number="data.pen[item.key]"
+                    theme="column"
+                    :max="item.max"
+                    :min="item.min"
                     @change="changeValue(item.key)"
                     :placeholder="item.placeholder"
                   />