Browse Source

1、更改判断当前位置标记更改图标模式

liyanbo 6 months ago
parent
commit
dc299ec2e3
1 changed files with 15 additions and 5 deletions
  1. 15 5
      src/api/blockly/blockly.js

+ 15 - 5
src/api/blockly/blockly.js

@@ -16,10 +16,12 @@ import constructImage from '@/assets/images/blockly/component/construct.png';
 
 // 积木形状字典
 const BLOCKLY_SHAPE_DICT = {
-  SQUARE_GEM: { value: 'square_gem', label: '正方形宝石' }, // 正方形宝石
-  TRIANGLE_GEM: { value: 'triangle_gem', label: '三角形宝石' }, // 三角形宝石
-  RED_MARK: { value: 'red_mark', label: '红色标记' }, // 红色标记
-  GREEN_MARK: { value: 'green_mark', label: '绿色标记' } // 绿色标记
+  polygon_gem: { value: 'polygon_gem', label: '多边形宝石', img: "https://learn-ai.com.cn/admin-api/infra/file/29/get/20260104/2-18扣过的物品_1767512705721.png" }, // 多边形宝石
+  SQUARE_GEM: { value: 'square_gem', label: '正方形宝石', img: "https://learn-ai.com.cn/admin-api/infra/file/29/get/20260104/2-22-2扣过的物品_1767507589513.png" }, // 正方形宝石
+  TRIANGLE_GEM: { value: 'triangle_gem', label: '三角形宝石', img: "https://learn-ai.com.cn/admin-api/infra/file/29/get/20260104/2-17扣过的物品_1767512591147.png" }, // 三角形宝石
+  RED_MARK: { value: 'red_mark', label: '红色标记', img: "https://learn-ai.com.cn/admin-api/infra/file/29/get/20260104/2-21-1扣过的物品_1767507553979.png" }, // 红色标记
+  GREEN_MARK: { value: 'green_mark', label: '绿色标记', img: "https://learn-ai.com.cn/admin-api/infra/file/29/get/20260104/2-21-2扣过的物品_1767507565373.png" }, // 绿色标记
+  BLUE_MARK: { value: 'blue_mark', label: '蓝色标记', img: "https://learn-ai.com.cn/admin-api/infra/file/29/get/20260104/2-23扣过的物品_1767507448751.png" } // 蓝色标记
 };
 
 // 地图元素类型字典
@@ -257,7 +259,15 @@ const availableBlocks = {
         {
           "type": "field_dropdown",
           "name": "SHAPE",
-          "options": Object.values(BLOCKLY_SHAPE_DICT).map(shape => [shape.label, shape.value])
+          "options": Object.values(BLOCKLY_SHAPE_DICT).map(shape => [
+            {
+              "src": shape.img,
+              "width": 20,
+              "height": 20,
+              "alt": shape.label
+            },
+            shape.value
+          ])
         }
       ],
       "output": "Boolean",