部分描述调整

This commit is contained in:
fofolee
2022-04-07 09:58:54 +08:00
parent eddadcada4
commit 343d9c4bd4
6 changed files with 30 additions and 19 deletions

View File

@@ -213,22 +213,22 @@ export default {
window.commandEditor = this;
this.bindKeys();
let quickCommandInfo =
this.action.type === "edit"
? this.action.data
: this.$utools.getDB(this.$utools.DBPRE.CFG + "codeHistory");
this.action.type === "run"
? this.$utools.getDB(this.$utools.DBPRE.CFG + "codeHistory")
: this.action.data;
Object.assign(
this.quickcommandInfo,
JSON.parse(JSON.stringify(quickCommandInfo))
);
// monoca 相关
this.$refs.editor.setEditorValue(this.quickcommandInfo.cmd);
this.setLanguage(this.quickcommandInfo.program);
this.$refs.editor.setEditorValue(quickCommandInfo.cmd);
// 默认命令不可编辑
if (this.quickcommandInfo.tags?.includes("默认") && !utools.isDev()) {
this.canCommandSave = false;
}
// 只有新建或运行时才保存记录
if (this.action.type === "edit") return;
// 只有 runCode 时才保存记录
if (this.action.type !== "run") return;
utools.onPluginOut(() => {
this.quickcommandInfo.cmd = this.$refs.editor.getEditorValue();
// 保存本次编辑记录
@@ -402,6 +402,7 @@ export default {
this.runResult += htmlEncode(content, raw);
},
closeEditor() {
this.$refs.editor?.destoryEditor();
this.$emit("editorEvent", {
type: "close",
data: {},