实现编排的插入、应用、运行功能

This commit is contained in:
fofolee
2024-12-23 13:31:13 +08:00
parent a22e1e23e9
commit c8a9a63dcb
3 changed files with 40 additions and 43 deletions

View File

@@ -38,7 +38,7 @@
@program-changed="programChanged"
@run="runCurrentCommand"
@save="saveCurrentCommand"
@add-action="insertText"
@use-composer="handleComposer"
/>
<!-- 编辑器 -->
@@ -196,6 +196,16 @@ export default {
insertText(text) {
this.$refs.editor.repacleEditorSelection(text);
},
handleComposer({ type, code }) {
switch (type) {
case "run":
return this.runCurrentCommand(code);
case "insert":
return this.insertText(code);
case "apply":
return this.$refs.editor.setEditorValue(code);
}
},
// 保存
saveCurrentCommand(message = "保存成功") {
let updatedData = this.$refs.sidebar?.SaveMenuData();