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;
|
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: {},
|
||||||
|
@ -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: {
|
||||||
|
@ -168,6 +168,9 @@ export default {
|
|||||||
};
|
};
|
||||||
this.rawEditor.executeEdits("my-source", [op]);
|
this.rawEditor.executeEdits("my-source", [op]);
|
||||||
},
|
},
|
||||||
|
destoryEditor() {
|
||||||
|
this.rawEditor.dispose();
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user