部分描述调整

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; window.commandEditor = this;
this.bindKeys(); this.bindKeys();
let quickCommandInfo = let quickCommandInfo =
this.action.type === "edit" this.action.type === "run"
? this.action.data ? this.$utools.getDB(this.$utools.DBPRE.CFG + "codeHistory")
: this.$utools.getDB(this.$utools.DBPRE.CFG + "codeHistory"); : this.action.data;
Object.assign( Object.assign(
this.quickcommandInfo, this.quickcommandInfo,
JSON.parse(JSON.stringify(quickCommandInfo)) JSON.parse(JSON.stringify(quickCommandInfo))
); );
// monoca // monoca
this.$refs.editor.setEditorValue(this.quickcommandInfo.cmd);
this.setLanguage(this.quickcommandInfo.program); this.setLanguage(this.quickcommandInfo.program);
this.$refs.editor.setEditorValue(quickCommandInfo.cmd);
// //
if (this.quickcommandInfo.tags?.includes("默认") && !utools.isDev()) { if (this.quickcommandInfo.tags?.includes("默认") && !utools.isDev()) {
this.canCommandSave = false; this.canCommandSave = false;
} }
// // runCode
if (this.action.type === "edit") return; if (this.action.type !== "run") return;
utools.onPluginOut(() => { utools.onPluginOut(() => {
this.quickcommandInfo.cmd = this.$refs.editor.getEditorValue(); this.quickcommandInfo.cmd = this.$refs.editor.getEditorValue();
// //
@ -402,6 +402,7 @@ export default {
this.runResult += htmlEncode(content, raw); this.runResult += htmlEncode(content, raw);
}, },
closeEditor() { closeEditor() {
this.$refs.editor?.destoryEditor();
this.$emit("editorEvent", { this.$emit("editorEvent", {
type: "close", type: "close",
data: {}, data: {},

View File

@ -159,6 +159,14 @@
<q-item v-bind="scope.itemProps"> <q-item v-bind="scope.itemProps">
<q-item-section> <q-item-section>
<q-item-label v-html="scope.opt.label" /> <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-label caption>{{ scope.opt.desc }}</q-item-label>
</q-item-section> </q-item-section>
</q-item> </q-item>
@ -259,11 +267,10 @@ export default {
}, },
computed: { computed: {
specialVarsOptions() { specialVarsOptions() {
let x= Object.values(specialVars).filter( let x = Object.values(specialVars).filter(
(x) => !x.label.match(this.cmdType.disabledSpecialVars) (x) => !x.label.match(this.cmdType.disabledSpecialVars)
); );
console.log(x); return x;
return x
}, },
}, },
methods: { methods: {

View File

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

View File

@ -1,9 +1,4 @@
const specialVars = { const specialVars = {
isWin: {
name: "isWin",
label: "{{isWin}}",
desc: "是否Window系统, 返回1或0"
},
LocalId: { LocalId: {
name: "LocalId", name: "LocalId",
label: "{{LocalId}}", label: "{{LocalId}}",
@ -37,7 +32,8 @@ const specialVars = {
WindowInfo: { WindowInfo: {
name: "WindowInfo", name: "WindowInfo",
label: "{{WindowInfo}}", label: "{{WindowInfo}}",
desc: "当前窗口信息JSON格式" desc: "当前窗口信息JSON格式字符串",
type: "json"
}, },
SelectFile: { SelectFile: {
name: "SelectFile", name: "SelectFile",
@ -47,7 +43,8 @@ const specialVars = {
MatchedFiles: { MatchedFiles: {
name: "MatchedFiles", name: "MatchedFiles",
label: "{{MatchedFiles}}", label: "{{MatchedFiles}}",
desc: "匹配的文件JSON格式" desc: "匹配的文件JSON格式字符串",
type: "json"
}, },
type: { type: {
name: "type", name: "type",
@ -57,7 +54,8 @@ const specialVars = {
payload: { payload: {
name: "payload", name: "payload",
label: "{{payload}}", label: "{{payload}}",
desc: "专业模式的payload,JSON格式" desc: "专业模式的payload,JSON格式字符串",
type: "json"
} }
} }

View File

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