mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-09 06:54:11 +08:00
部分描述调整
This commit is contained in:
parent
eddadcada4
commit
343d9c4bd4
Binary file not shown.
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 57 KiB |
@ -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>
|
||||
|
@ -1,9 +1,4 @@
|
||||
const specialVars = {
|
||||
isWin: {
|
||||
name: "isWin",
|
||||
label: "{{isWin}}",
|
||||
desc: "是否Window系统, 返回1或0"
|
||||
},
|
||||
LocalId: {
|
||||
name: "LocalId",
|
||||
label: "{{LocalId}}",
|
||||
@ -37,7 +32,8 @@ const specialVars = {
|
||||
WindowInfo: {
|
||||
name: "WindowInfo",
|
||||
label: "{{WindowInfo}}",
|
||||
desc: "当前窗口信息,JSON格式"
|
||||
desc: "当前窗口信息,JSON格式字符串",
|
||||
type: "json"
|
||||
},
|
||||
SelectFile: {
|
||||
name: "SelectFile",
|
||||
@ -47,7 +43,8 @@ const specialVars = {
|
||||
MatchedFiles: {
|
||||
name: "MatchedFiles",
|
||||
label: "{{MatchedFiles}}",
|
||||
desc: "匹配的文件,JSON格式"
|
||||
desc: "匹配的文件,JSON格式字符串",
|
||||
type: "json"
|
||||
},
|
||||
type: {
|
||||
name: "type",
|
||||
@ -57,7 +54,8 @@ const specialVars = {
|
||||
payload: {
|
||||
name: "payload",
|
||||
label: "{{payload}}",
|
||||
desc: "专业模式的payload,JSON格式"
|
||||
desc: "专业模式的payload,JSON格式字符串",
|
||||
type: "json"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -141,8 +141,10 @@
|
||||
<q-tooltip
|
||||
>按四列排列的面板视图<br />
|
||||
老版本的「快捷面板」已被弃用,取而代之的是新版的「面板视图」<br />
|
||||
面板视图下只显示图标、描述和匹配类型,且不显示匹配类型为窗口的命令<br />
|
||||
点击卡片时会直接运行命令而不是编辑命令</q-tooltip
|
||||
注意:<br />
|
||||
1.未启用、匹配类型为窗口的命令在此视图下不显示<br />
|
||||
2.只显示图标、描述和匹配类型<br />
|
||||
3.点击卡片时会直接运行命令而不是编辑命令</q-tooltip
|
||||
>
|
||||
</template>
|
||||
</q-btn-toggle>
|
||||
|
Loading…
x
Reference in New Issue
Block a user