Explorar o código

feat:defaults

ananzhusen hai 1 ano
pai
achega
4411069dd8
Modificáronse 1 ficheiros con 111 adicións e 20 borrados
  1. 111 20
      src/services/defaults.ts

+ 111 - 20
src/services/defaults.ts

@@ -3163,9 +3163,16 @@ context.meta2d.translate(
           events: [
             {
               action: 5,
+              actions:[
+                {
+                    "action": 5,
+                    "value": "context.meta2d.setValue({ id: pen.id, text: parseFloat(pen.text) }, { doEvent: false });",
+                    "params": ""
+                }
+              ],
               name: 'inactive',
-              value:
-                'context.meta2d.setValue({ id: pen.id, text: parseFloat(pen.text) }, { doEvent: false });',
+              // value:
+              //   'context.meta2d.setValue({ id: pen.id, text: parseFloat(pen.text) }, { doEvent: false });',
               where: { type: null },
             },
           ],
@@ -3428,6 +3435,22 @@ context.meta2d.translate(
           color: '#FFFFFF00',
           progress: 0.5,
           progressColor: '#4583FF',
+          props: {
+            custom: [
+              {
+                key: 'progress',
+                label: '水位',
+                type: 'number',
+                min:0,
+                max:1,
+              },
+              {
+                key: 'progressColor',
+                label: '水位颜色',
+                type: 'color',
+              }
+            ]
+          }
         },
       },
       {
@@ -3447,6 +3470,40 @@ context.meta2d.translate(
           // maxText: 'max',
           // minText: 'min',
           scaleShow: false,
+          props: {
+            custom: [
+              {
+                key: 'value',
+                label: '值',
+                type: 'number',
+              },
+              {
+                key: 'max',
+                label: '最大值',
+                type: 'number',
+              },
+              {
+                key: 'min',
+                label: '最小值',
+                type: 'number',
+              },
+              {
+                key: 'maxBackground',
+                label: '>最大颜色',
+                type: 'color',
+              },
+              {
+                key: 'minBackground',
+                label: '<最小颜色',
+                type: 'color',
+              },
+              {
+                key: 'scaleShow',
+                label: '刻度显示',
+                type: 'bool',
+              }
+            ]
+          }
         },
       },
       {
@@ -3462,25 +3519,59 @@ context.meta2d.translate(
           color: '#4583FF',
           hiddenText: true,
           onColor: '#58CC84',
-          frames: [
-            {
-              background: '#4583FF33',
-              color: '#4583FF',
-              bkType: 0,
-              duration: 200,
-              strokeType: 0,
-              visible: true,
-            },
+          animations:[
             {
-              background: '#4583FF33',
-              color: '#4583FF',
-              bkType: 0,
-              duration: 200,
-              strokeType: 0,
-              visible: true,
-            },
-          ],
-          animateType: 'custom',
+                name: "动画1",
+                temType: "id",
+                animate: "custom",
+                frames: [
+                    {
+                      background: '#4583FF33',
+                      color: '#4583FF',
+                      bkType: 0,
+                      duration: 200,
+                      strokeType: 0,
+                      visible: true,
+                    },
+                    {
+                      background: '#4583FF33',
+                      color: '#4583FF',
+                      bkType: 0,
+                      duration: 200,
+                      strokeType: 0,
+                      visible: true,
+                    }
+                ]
+            }
+        ],
+          // frames: [
+          //   {
+          //     background: '#4583FF33',
+          //     color: '#4583FF',
+          //     bkType: 0,
+          //     duration: 200,
+          //     strokeType: 0,
+          //     visible: true,
+          //   },
+          //   {
+          //     background: '#4583FF33',
+          //     color: '#4583FF',
+          //     bkType: 0,
+          //     duration: 200,
+          //     strokeType: 0,
+          //     visible: true,
+          //   },
+          // ],
+          // animateType: 'custom',
+          props: {
+            custom: [
+              {
+                key: 'displayStatus',
+                label: '显示状态',
+                type: 'number',
+              },
+            ]
+          }
         },
         props: {
           custom: [