Bladeren bron

feat_通知/锚点/回到顶部

ananzhusen 1 jaar geleden
bovenliggende
commit
43d00e0648
1 gewijzigde bestanden met toevoegingen van 81 en 8 verwijderingen
  1. 81 8
      src/services/defaults.ts

+ 81 - 8
src/services/defaults.ts

@@ -1505,6 +1505,7 @@ export const formComponents = [
           textLeft: 30,
           shadow: false,
           textColor: 'rgba(0, 0, 0, 1)',
+          hoverTextColor: 'rgba(0, 0, 0, 1)',
           shadowColor: 'rgba(250, 247, 247, 0.5)',
           shadowOffsetX: 6,
           shadowOffsetY: 6,
@@ -1515,8 +1516,35 @@ export const formComponents = [
         name: '通知',
         icon: 'l-tongzhi',
         data: {
-          width: 200,
-          height: 200,
+          width: 360,
+          height: 178,
+          text: '通知具体内容;通知具体内容;通知具体内容;通知具体内容;通知具体内容;通知具体内容;通知具体内容;通知具体内容;通知具体内容;',
+          borderRadius: 6,
+          name: 'notification',
+          icon: '\ue6e4',
+          iconFamily: 'l-icon',
+          iconColor: '#4583ff',
+          iconSize: 17.5,
+          iconAlign: 'left-top',
+          iconLeft: 8,
+          iconTop: 8,
+          textAlign: 'left',
+          textBaseline: 'top',
+          textLeft: 30,
+          textTop: 30,
+          color: 'rgba(235, 235, 235, 1)',
+          background: 'rgba(255, 255, 255, 1)',
+          shadow: false,
+          textColor: '#666666',
+          hoverTextColor: '#666666',
+          shadowColor: 'rgba(250, 247, 247, 0.5)',
+          shadowOffsetX: 6,
+          shadowOffsetY: 6,
+          shadowBlur: 20,
+          heading: '标题名称',
+          headingColor: '#000',
+          headingSize: 16,
+          // headingWeight: 'bold',
         },
       },
       // {
@@ -1662,18 +1690,63 @@ export const formComponents = [
       },
       {
         name: '锚点',
-        icon: 'l-pc', //l-anchor
+        icon: 'l-anchor',
         data: {
-          width: 200,
-          height: 200,
+          width: 40,
+          height: 40,
+          name: 'image',
+          icon: '\uea7b',
+          iconFamily: 'l-icon',
+          events: [
+            {
+              action: 5,
+              name: 'click',
+              params: 'pen.id/tag',
+              value:
+                'let pens = context.meta2d.find(params);\r\nif (!pens.length) {\r\n    pens = [pen]\r\n}\r\ncontext.meta2d.active(pens, true);\r\ncontext.meta2d.gotoView(pens[0]);\r\ncontext.meta2d.resize();\r\ncontext.meta2d.render();',
+              where: { type: null },
+            },
+          ],
         },
       },
       {
         name: '回到顶部',
-        icon: 'l-pc', //l-huidaodingbu
+        icon: 'l-huidaodingbu',
         data: {
-          width: 200,
-          height: 200,
+          width: 64,
+          height: 64,
+          name: 'rectangle',
+          activeBackground: '#eee',
+          background: 'rgba(255, 255, 255, 1)',
+          borderRadius: 0.1,
+          color: '#eee',
+          hoverBackground: '#eee',
+          hoverColor: '#eee',
+          hoverTextColor: '#c5c5c5',
+          iconAlign: 'top',
+          iconColor: 'rgba(0, 0, 0, 1)',
+          iconSize: 20,
+          iconTop: 10,
+          text: 'TOP',
+          textBaseline: 'bottom',
+          textColor: '#c5c5c5',
+          textTop: -2,
+          icon: '\ue6a6',
+          iconFamily: 'l-icon',
+          events: [
+            {
+              action: 5,
+              name: 'click',
+              // params: 'pen.id/tag',
+              value: `
+              const { scale, origin, y: dataY } = context.meta2d.store.data;
+              context.meta2d.translate(
+                0,
+                ((parseInt(params)||32) * context.meta2d.store.data.scale - origin.y) / scale - dataY / scale
+              );`,
+              where: { type: null },
+            },
+          ],
         },
       },
       {