mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-09-24 13:03:30 +08:00
部分描述调整
This commit is contained in:
@@ -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: {},
|
||||
|
@@ -159,6 +159,14 @@
|
||||
<q-item v-bind="scope.itemProps">
|
||||
<q-item-section>
|
||||
<q-item-label v-html="scope.opt.label" />
|
||||
<q-tooltip v-if="!scope.opt.type">
|
||||
注意需要自行在变量两边加上引号,如"{{ scope.opt.label }}"
|
||||
</q-tooltip>
|
||||
<q-tooltip v-else>
|
||||
需要自行对json进行处理,如json.loads(r"""{{
|
||||
scope.opt.label
|
||||
}}""")
|
||||
</q-tooltip>
|
||||
<q-item-label caption>{{ scope.opt.desc }}</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
@@ -259,11 +267,10 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
specialVarsOptions() {
|
||||
let x= Object.values(specialVars).filter(
|
||||
let x = Object.values(specialVars).filter(
|
||||
(x) => !x.label.match(this.cmdType.disabledSpecialVars)
|
||||
);
|
||||
console.log(x);
|
||||
return x
|
||||
return x;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
@@ -168,6 +168,9 @@ export default {
|
||||
};
|
||||
this.rawEditor.executeEdits("my-source", [op]);
|
||||
},
|
||||
destoryEditor() {
|
||||
this.rawEditor.dispose();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user