Browse Source

feat:结构active&事件http回调

ananzhusen 11 months ago
parent
commit
6decfa521a
2 changed files with 17 additions and 3 deletions
  1. 14 0
      src/views/components/Actions.vue
  2. 3 3
      src/views/components/Structure.vue

+ 14 - 0
src/views/components/Actions.vue

@@ -301,6 +301,20 @@
               <div v-else class="center gray mt-8">暂无数据</div>
             </div>
           </div>
+          <div class="form-item mt-8" v-if="a.network&&a.network.protocol==='http'">
+            <label>回调</label>
+            <CodeEditor
+              v-model="a.callback"
+              class="mt-4"
+              style="height: 50px"
+            />
+          </div>
+          <div class="form-item mt-8 desc"  v-if="a.network&&a.network.protocol==='http'">
+            <label></label>
+            <div>
+              可获取pen、data和context参数,参考:<a target="_blank" href="https://doc.le5le.com/document/22">发送指令</a>
+            </div>
+          </div>
         </template>
         <template v-else-if="a.action == 8 || a.action == 9 || a.action == 10">
           <div class="form-item mt-8">

+ 3 - 3
src/views/components/Structure.vue

@@ -507,10 +507,10 @@ const onActive = (e,value: any) => {
     data.actived.forEach((item) => {
       pens.push(meta2d.store.pens[item]);
     });
-    meta2d.active(pens, false);
-  }else{
+    meta2d.active(pens, true);
+  }else{   
       const pen = meta2d.store.pens[value];
-      meta2d.active([pen], false);
+      meta2d.active([pen], true);
       if (!pen.calculative?.inView) {
       meta2d.gotoView(pen);
       meta2d.resize();