Przeglądaj źródła

新增卡片选项卡配置

Wind-Breaker1 10 miesięcy temu
rodzic
commit
108ff630f7
1 zmienionych plików z 120 dodań i 2 usunięć
  1. 120 2
      src/services/defaults.ts

+ 120 - 2
src/services/defaults.ts

@@ -3312,7 +3312,7 @@ context.meta2d.translate(
         },
       },
       {
-        name: '选项卡',
+        name: '基本选项卡',
         icon: 'l-xuanxiangka',
         data: {
           name: 'tab',
@@ -3323,7 +3323,6 @@ context.meta2d.translate(
           btnHeight: 32,
           btnWidth: 100,
           gap:8,
-          // selectedKeys: [],
           disableInput: true,
           data: [
             { text: '场景一', key: '0', isForbidden: true },
@@ -3409,6 +3408,125 @@ context.meta2d.translate(
           },
         },
       },
+      {
+        name: '卡片选项卡',
+        icon: 'l-xuanxiangka',
+        data: {
+          name: 'tab',
+          width: 410,
+          height: 36,
+          direction: 'horizontal',
+          selectedKey: '1',
+          btnHeight: 32,
+          btnWidth: 100,
+          gap:2,
+          background:'#272c33',
+          activeBackground:'#272c33',
+          color:'transparent',
+          disableInput: true,
+          data: [
+            { 
+              text: '全部(15)', 
+              key: '0',
+              radius:[10,10,0,0]
+            },
+            { 
+              text: '正常运行(7)', 
+              key: '1',
+              textColor:'green',
+              activeTextColor:'green'
+             },
+            { 
+              text: '故障告警(0)', 
+              key: '2',
+              textColor:'red',
+              activeTextColor:'red'
+            },
+            { 
+              text: '通讯异常(8)', 
+              key: '3',
+              textColor:'rgb(68,81,93)',
+              activeTextColor:'rgb(68,81,93)'
+            },
+          ],
+          props: {
+            custom: [
+              {
+                key: 'data',
+                label: '数据',
+                type: 'code',
+              },
+              {
+                key: 'direction',
+                label: '方向',
+                type: 'select',
+                options: [
+                  { label: '水平', value: 'horizontal' },
+                  { label: '垂直', value: 'vertical' },
+                ],
+              },
+              {
+                key: 'gap',
+                label: '间隔',
+                type: 'number',
+                min:1
+              },
+              {
+                key: 'btnWidth',
+                label: '按钮宽度',
+                type: 'number',
+                min:1
+              },
+              {
+                key: 'btnHeight',
+                label: '按钮高度',
+                type: 'number',
+                min:1
+              },
+              {
+                key: 'activeBackground',
+                label: '选中背景',
+                type: 'color',
+              },
+              {
+                key: 'activeColor',
+                label: '选中边框',
+                type: 'color',
+              },
+              {
+                key: 'activeTextColor',
+                label: '选中文字',
+                type: 'color',
+              }, 
+              {
+                key: 'activeBgImage',
+                label: '选中背景图片',
+                type: 'string',
+              },
+              {
+                key: 'background',
+                label: '(未选中)背景',
+                type: 'color',
+              },
+              {
+                key: 'color',
+                label: '(未选中)边框',
+                type: 'color',
+              },
+              {
+                key: 'textColor',
+                label: '(未选中)文字',
+                type: 'color',
+              },
+              {
+                key: 'bgImage',
+                label: '(未选中)背景图片',
+                type: 'string',
+              }
+            ],
+          },
+        },
+      },
       {
         name: '多选选项卡',
         icon: 'l-duoxiangxuanxiangka',