ananzhusen 11 місяців тому
батько
коміт
5bdc708871

+ 26 - 278
src/services/defaults.ts

@@ -1591,95 +1591,44 @@ export const formComponents = [
           height: 0,
           disableAnchor: true,
           // disableSize: true,
-          colWidth: 40,
+          colWidth: 80,
           rowHeight: 30,
           rowHeaders:true,
           colHeaders:true,
           maxNum:16,
+          textColor:'#E3E8F4',
+          background:'#10131A',
           tableType:'longlist',
           mergeCells: [
             { row: 1, col: 1, rowspan: 3, colspan: 3 },
             { row: 3, col: 4, rowspan: 2, colspan: 2 },
             { row: 5, col: 6, rowspan: 3, colspan: 2 }
           ],
-          // styles: [
-          //   {
-          //     row: 1,
-          //     col: 1,
-          //     color: '#ff0000',
-          //     background: '#ffff00',
-          //     wheres: [
-          //       //触发条件 成立后才允许配置样式
-          //       {
-          //         comparison: '<=',
-          //         value: '123',
-          //       },
-          //     ],
-          //   },
-          //   {
-          //     row: 0,
-          //     height: 60,
-          //   },
-          //   {
-          //     col: 4,
-          //     width: 200, //为该列设置额外的节点
-          //     pens: [
-          //       {
-          //         name: 'rectangle',
-          //         width: 50,
-          //         height: 20,
-          //         text: '编辑',
-          //         fontSize: 0.6,
-          //         disableAnchor: true,
-          //         activeBackground: '#2D71EC',
-          //         activeColor: '#40a9ff',
-          //         background: '#4583FF',
-          //         color: '#1890ff',
-          //         hoverBackground: '#7DA4FF',
-          //         hoverColor: '#40a9ff',
-          //         textColor: '#ffffff',
-          //         hoverTextColor: '#ffffff',
-          //         activeTextColor: '#ffffff',
-          //         events: [
-          //           {
-          //             action: 5,
-          //             name: 'click',
-          //             value: 'alert("点击了编辑")',
-          //           },
-          //         ],
-          //       },
-          //       {
-          //         name: 'rectangle',
-          //         width: 80,
-          //         height: 20,
-          //         text: '实时数据',
-          //         fontSize: 0.6,
-          //         disableAnchor: true,
-          //         activeBackground: '#2D71EC',
-          //         activeColor: '#40a9ff',
-          //         background: '#4583FF',
-          //         color: '#1890ff',
-          //         hoverBackground: '#7DA4FF',
-          //         hoverColor: '#40a9ff',
-          //         textColor: '#ffffff',
-          //         hoverTextColor: '#ffffff',
-          //         activeTextColor: '#ffffff',
-          //         events: [
-          //           {
-          //             action: 5,
-          //             name: 'click',
-          //             value: 'alert("点击了实时数据")',
-          //           },
-          //         ],
-          //       },
-          //     ],
-          //   },
-          // ],
+          styles:[
+            {
+              row:0,
+              background:'#303746',
+            },
+            {
+              col:0,
+              background:'#303746',
+            }
+          ],
           props: {
             custom: [
               {
-                key: 'rowHeaders',
-                label: '行头显示',
+                key: 'bordered',
+                label: '边框',
+                type: 'bool',
+              },
+              {
+                key: 'vLine',
+                label: '垂直线',
+                type: 'bool',
+              },
+              {
+                key: 'hLine',
+                label: '水平线',
                 type: 'bool',
               },
               {
@@ -2146,7 +2095,7 @@ export const formComponents = [
           pagination: {
             current: 1,
             maxPageBtn: 5,
-            pageSize: 20,
+            pageSize: 10,
             pageSizeOptions: [
               5,
               10,
@@ -2400,206 +2349,6 @@ export const formComponents = [
                 ]
               }
             ],
-            [
-              "智慧工厂",
-              "01888a79-9d70-70ad-803e-767682ff0962",
-              "智能预制泵站",
-              {
-                "events": [
-                  {
-                    "actions": [
-                      {
-                        "action": 0,
-                        "params": "_blank",
-                        "value": "https://view.le5le.com/2d?id=01888a79-9d70-70ad-803e-767682ff0962"
-                      }
-                    ],
-                    "conditions": [],
-                    "name": "click"
-                  }
-                ]
-              }
-            ],
-            [
-              "智慧物联",
-              "01840e88-00e8-70d4-804b-9402de84d2f3",
-              "锅炉房",
-              {
-                "events": [
-                  {
-                    "actions": [
-                      {
-                        "action": 0,
-                        "params": "_blank",
-                        "value": "https://view.le5le.com/2d?id=01840e88-00e8-70d4-804b-9402de84d2f3"
-                      }
-                    ],
-                    "conditions": [],
-                    "name": "click"
-                  }
-                ]
-              }
-            ],
-            [
-              "智慧工厂",
-              "0180abf4-d170-709d-80ac-35b389088ca8",
-              "火电厂生产过程示意图",
-              {
-                "events": [
-                  {
-                    "actions": [
-                      {
-                        "action": 0,
-                        "params": "_blank",
-                        "value": "https://view.le5le.com/2d?id=0180abf4-d170-709d-80ac-35b389088ca8"
-                      }
-                    ],
-                    "conditions": [],
-                    "name": "click"
-                  }
-                ]
-              }
-            ],
-            [
-              "智慧工厂",
-              "01840e73-e090-70d4-804b-9402de84d2ea",
-              "制冷站",
-              {
-                "events": [
-                  {
-                    "actions": [
-                      {
-                        "action": 0,
-                        "params": "_blank",
-                        "value": "https://view.le5le.com/2d?id=01840e73-e090-70d4-804b-9402de84d2ea"
-                      }
-                    ],
-                    "conditions": [],
-                    "name": "click"
-                  }
-                ]
-              }
-            ],
-            [
-              "智慧物联",
-              "0179c5f5-1d70-70fd-8058-e60001871e89",
-              "燃气管道远程监控系统",
-              {
-                "events": [
-                  {
-                    "actions": [
-                      {
-                        "action": 0,
-                        "params": "_blank",
-                        "value": "https://view.le5le.com/2d?id=0179c5f5-1d70-70fd-8058-e60001871e89"
-                      }
-                    ],
-                    "conditions": [],
-                    "name": "click"
-                  }
-                ]
-              }
-            ],
-            [
-              "智慧工厂",
-              "01869188-d448-7073-804c-5807bdf1ecb5",
-              "汽车涂装生产线",
-              {
-                "events": [
-                  {
-                    "actions": [
-                      {
-                        "action": 0,
-                        "params": "_blank",
-                        "value": "https://view.le5le.com/2d?id=01869188-d448-7073-804c-5807bdf1ecb5"
-                      }
-                    ],
-                    "conditions": [],
-                    "name": "click"
-                  }
-                ]
-              }
-            ],
-            [
-              "智慧工厂",
-              "018431db-bc38-70da-8009-62a797f1ab75",
-              "废气治理",
-              {
-                "events": [
-                  {
-                    "actions": [
-                      {
-                        "action": 0,
-                        "params": "_blank",
-                        "value": "https://view.le5le.com/2d?id=018431db-bc38-70da-8009-62a797f1ab75"
-                      }
-                    ],
-                    "conditions": [],
-                    "name": "click"
-                  }
-                ]
-              }
-            ],
-            [
-              "电力能源",
-              "016effb2-56a0-7060-8025-d729abf23681",
-              "电网单线图",
-              {
-                "events": [
-                  {
-                    "actions": [
-                      {
-                        "action": 0,
-                        "params": "_blank",
-                        "value": "https://view.le5le.com/2d?id=016effb2-56a0-7060-8025-d729abf23681"
-                      }
-                    ],
-                    "conditions": [],
-                    "name": "click"
-                  }
-                ]
-              }
-            ],
-            [
-              "智慧城市",
-              "01840e7f-fe20-70d4-804b-9402de84d2f0",
-              "智慧城市",
-              {
-                "events": [
-                  {
-                    "actions": [
-                      {
-                        "action": 0,
-                        "params": "_blank",
-                        "value": "https://view.le5le.com/2d?id=01840e7f-fe20-70d4-804b-9402de84d2f0"
-                      }
-                    ],
-                    "conditions": [],
-                    "name": "click"
-                  }
-                ]
-              }
-            ],
-            [
-              "电力能源",
-              "01796382-43c0-7070-80c5-ce0001cdb895吾问无为谓哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇dd",
-              "高压一次图",
-              {
-                "events": [
-                  {
-                    "actions": [
-                      {
-                        "action": 0,
-                        "params": "_blank",
-                        "value": "https://view.le5le.com/2d?id=01796382-43c0-7070-80c5-ce0001cdb895"
-                      }
-                    ],
-                    "conditions": [],
-                    "name": "click"
-                  }
-                ]
-              }
-            ]
           ],
           styles: [
             {
@@ -2621,7 +2370,6 @@ export const formComponents = [
               ]
             }
           ],
-          
           props: {
             custom: [
               {

+ 20 - 0
src/views/components/ContextMenu.vue

@@ -14,6 +14,12 @@
     <template v-if="props.type === 'pen'">
       <t-menu-item v-if="!selections.mode&&hasC()" value="updateC"> 一键更新我的组件 </t-menu-item>
       <t-menu-item v-if="isAppend()" value="appendChild"> 追加状态 </t-menu-item>
+      <t-menu-item v-if="isTableNoFocus()" value="focus"> 
+        <div class="flex">进入编辑模式<span class="flex-grow"></span>Enter</div>
+      </t-menu-item>
+      <t-menu-item v-if="isTableFocus()" value="unFocus"> 
+        <div class="flex">退出编辑模式 <span class="flex-grow"></span>Esc</div>
+      </t-menu-item>
       <t-menu-item :disabled="!selections.mode" value="top"> 置顶 </t-menu-item>
       <t-menu-item :disabled="!selections.mode" value="bottom">
         置底
@@ -177,6 +183,12 @@ const onMenu = (val: string) => {
       meta2d.active([pen],true);
       meta2d.render();
       break;
+    case 'focus':
+      meta2d.store.active[0].calculative.focus = true;
+      break;
+    case 'unFocus':
+      meta2d.store.active[0].calculative.focus = false;
+      break;
   }
 
   emit('changeVisible', false);
@@ -190,6 +202,14 @@ const isAppend =() => {
   return meta2d?.store.active.length > 1 && meta2d?.store.active.some((pen: any) => pen.name === "combine"&& pen.showChild !== undefined);
 }
 
+const isTableNoFocus =() => {
+  return meta2d?.store.active.length === 1 && meta2d?.store.active[0].name === "tablePlus" && !meta2d?.store.active[0].calculative.focus;
+}
+
+const isTableFocus =() => {
+  return meta2d?.store.active.length === 1 && meta2d?.store.active[0].name === "tablePlus" && meta2d?.store.active[0].calculative.focus;
+}
+
 </script>
 
 <style lang="postcss" scoped>

+ 7 - 0
src/views/components/Graphics.vue

@@ -1292,6 +1292,13 @@ const dragStart = async (event: DragEvent | MouseEvent|TouchEvent, item: any) =>
           .map((_, row) => new Array(10).fill(0)
           .map((_, column) => `${row}, ${column}`));
           _data.splice(0, 0, new Array(10).fill(0).map((_, i) =>String.fromCharCode(65+i)));
+          _data.forEach((item,index)=>{
+            if(index==0){
+              item.splice(0, 0, '');
+            }else{
+              item.splice(0, 0, index+'');
+            }
+          })
           data.data = _data;
           // console.log("data",data);
         }