部分描述调整

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 57 KiB

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: {},

View File

@ -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: {

View File

@ -168,6 +168,9 @@ export default {
};
this.rawEditor.executeEdits("my-source", [op]);
},
destoryEditor() {
this.rawEditor.dispose();
},
},
};
</script>

View File

@ -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"
}
}

View File

@ -141,8 +141,10 @@
<q-tooltip
>按四列排列的面板视图<br />
老版本的快捷面板已被弃用取而代之的是新版的面板视图<br />
面板视图下只显示图标描述和匹配类型,且不显示匹配类型为窗口的命令<br />
点击卡片时会直接运行命令而不是编辑命令</q-tooltip
注意<br />
1.未启用匹配类型为窗口的命令在此视图下不显示<br />
2.只显示图标描述和匹配类型<br />
3.点击卡片时会直接运行命令而不是编辑命令</q-tooltip
>
</template>
</q-btn-toggle>