mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-10 23:54:57 +08:00
将命令类型的颜色配置移动到js文件中
This commit is contained in:
parent
f42cafe1aa
commit
2a8c52f9b3
@ -107,7 +107,7 @@
|
|||||||
>
|
>
|
||||||
<span v-for="cmd in commandInfo.features.cmds" :key="cmd">
|
<span v-for="cmd in commandInfo.features.cmds" :key="cmd">
|
||||||
<span v-if="typeof cmd === 'string'">
|
<span v-if="typeof cmd === 'string'">
|
||||||
<q-badge rounded :color="cmdBadgeColor()"
|
<q-badge rounded :color="matchTypeColor()"
|
||||||
><q-icon class="q-mr-xs" :name="commandTypes.key.icon" />{{
|
><q-icon class="q-mr-xs" :name="commandTypes.key.icon" />{{
|
||||||
getShortStrByByte(cmd)
|
getShortStrByByte(cmd)
|
||||||
}}</q-badge
|
}}</q-badge
|
||||||
@ -119,7 +119,7 @@
|
|||||||
</q-tooltip>
|
</q-tooltip>
|
||||||
</span>
|
</span>
|
||||||
<span v-else-if="cmd.type === 'window' && cmd.match">
|
<span v-else-if="cmd.type === 'window' && cmd.match">
|
||||||
<q-badge rounded :color="cmdBadgeColor(cmd.type)"
|
<q-badge rounded :color="matchTypeColor(cmd.type)"
|
||||||
><q-icon
|
><q-icon
|
||||||
class="q-mr-xs"
|
class="q-mr-xs"
|
||||||
:name="commandTypes.window.icon"
|
:name="commandTypes.window.icon"
|
||||||
@ -136,7 +136,7 @@
|
|||||||
</q-tooltip>
|
</q-tooltip>
|
||||||
</span>
|
</span>
|
||||||
<span v-else-if="cmd.type === 'files'">
|
<span v-else-if="cmd.type === 'files'">
|
||||||
<q-badge rounded :color="cmdBadgeColor(cmd.type)"
|
<q-badge rounded :color="matchTypeColor(cmd.type)"
|
||||||
><q-icon class="q-mr-xs" :name="commandTypes.files.icon" />
|
><q-icon class="q-mr-xs" :name="commandTypes.files.icon" />
|
||||||
{{
|
{{
|
||||||
(cmd.match && getShortStrByByte(cmd.match)) || "所有文件"
|
(cmd.match && getShortStrByByte(cmd.match)) || "所有文件"
|
||||||
@ -149,7 +149,7 @@
|
|||||||
</q-tooltip>
|
</q-tooltip>
|
||||||
</span>
|
</span>
|
||||||
<span v-else-if="cmd.type === 'regex'">
|
<span v-else-if="cmd.type === 'regex'">
|
||||||
<q-badge rounded :color="cmdBadgeColor(cmd.type)"
|
<q-badge rounded :color="matchTypeColor(cmd.type)"
|
||||||
><q-icon
|
><q-icon
|
||||||
class="q-mr-xs"
|
class="q-mr-xs"
|
||||||
:name="commandTypes.regex.icon"
|
:name="commandTypes.regex.icon"
|
||||||
@ -162,7 +162,7 @@
|
|||||||
</q-tooltip>
|
</q-tooltip>
|
||||||
</span>
|
</span>
|
||||||
<span v-else-if="cmd.type === 'over'">
|
<span v-else-if="cmd.type === 'over'">
|
||||||
<q-badge rounded :color="cmdBadgeColor(cmd.type)"
|
<q-badge rounded :color="matchTypeColor(cmd.type)"
|
||||||
><q-icon
|
><q-icon
|
||||||
class="q-mr-xs"
|
class="q-mr-xs"
|
||||||
:name="commandTypes.over.icon"
|
:name="commandTypes.over.icon"
|
||||||
@ -170,7 +170,7 @@
|
|||||||
</q-badge>
|
</q-badge>
|
||||||
</span>
|
</span>
|
||||||
<span v-else-if="cmd.type === 'img'">
|
<span v-else-if="cmd.type === 'img'">
|
||||||
<q-badge rounded :color="cmdBadgeColor(cmd.type)">
|
<q-badge rounded :color="matchTypeColor(cmd.type)">
|
||||||
<q-icon class="q-mr-xs" :name="commandTypes.img.icon" />图片
|
<q-icon class="q-mr-xs" :name="commandTypes.img.icon" />图片
|
||||||
</q-badge>
|
</q-badge>
|
||||||
</span>
|
</span>
|
||||||
@ -214,14 +214,6 @@ export default {
|
|||||||
allProgrammings: this.$programmings,
|
allProgrammings: this.$programmings,
|
||||||
maxCmdStingLen: 8,
|
maxCmdStingLen: 8,
|
||||||
commandTypes: commandTypes,
|
commandTypes: commandTypes,
|
||||||
cmdBadgeSheet: {
|
|
||||||
key: "primary",
|
|
||||||
files: "light-blue",
|
|
||||||
window: "indigo",
|
|
||||||
regex: "cyan",
|
|
||||||
over: "light-green",
|
|
||||||
img: "deep-orange",
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -256,11 +248,11 @@ export default {
|
|||||||
return this.commandInfo.tags?.includes("默认") ? false : true;
|
return this.commandInfo.tags?.includes("默认") ? false : true;
|
||||||
},
|
},
|
||||||
// 匹配类型的颜色
|
// 匹配类型的颜色
|
||||||
cmdBadgeColor() {
|
matchTypeColor() {
|
||||||
return (cmdType = "keyword") => {
|
return (cmdType = "key") => {
|
||||||
if (!this.isCommandActivated)
|
if (!this.isCommandActivated)
|
||||||
return this.$q.dark.isActive ? "grey-9" : "grey-5";
|
return this.$q.dark.isActive ? "grey-9" : "grey-5";
|
||||||
return this.cmdBadgeSheet[cmdType];
|
return this.commandTypes[cmdType].color;
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -53,6 +53,7 @@ const commandTypes = {
|
|||||||
name: "key",
|
name: "key",
|
||||||
label: "关键词",
|
label: "关键词",
|
||||||
icon: "font_download",
|
icon: "font_download",
|
||||||
|
color: "primary",
|
||||||
matchLabel: "关键词",
|
matchLabel: "关键词",
|
||||||
desc: "在主输入框输入对应关键字进入插件,最通用的一种模式,关键字可以设置多个",
|
desc: "在主输入框输入对应关键字进入插件,最通用的一种模式,关键字可以设置多个",
|
||||||
valueType: "array",
|
valueType: "array",
|
||||||
@ -63,8 +64,9 @@ const commandTypes = {
|
|||||||
regex: {
|
regex: {
|
||||||
name: "regex",
|
name: "regex",
|
||||||
label: "正则/划词",
|
label: "正则/划词",
|
||||||
matchLabel: "正则",
|
|
||||||
icon: "rule",
|
icon: "rule",
|
||||||
|
color: "cyan",
|
||||||
|
matchLabel: "正则",
|
||||||
desc: "匹配主输入框或超级面板选中的文本,可以获取输入框文本或选中文本作为变量",
|
desc: "匹配主输入框或超级面板选中的文本,可以获取输入框文本或选中文本作为变量",
|
||||||
valueType: "regex",
|
valueType: "regex",
|
||||||
disabledSpecialVars: /{{SelectFile}}|{{MatchImage}}|{{WindowInfo.*?}}|{{pwd}}|{{MatchedFiles.*?}}/g,
|
disabledSpecialVars: /{{SelectFile}}|{{MatchImage}}|{{WindowInfo.*?}}|{{pwd}}|{{MatchedFiles.*?}}/g,
|
||||||
@ -75,7 +77,7 @@ const commandTypes = {
|
|||||||
minNum: 1,
|
minNum: 1,
|
||||||
}, ],
|
}, ],
|
||||||
verify: rules => !!rules > 0 || "正则不能为空",
|
verify: rules => !!rules > 0 || "正则不能为空",
|
||||||
tempPayload: async() => {
|
tempPayload: async () => {
|
||||||
let values = await quickcommand.showInputBox(["需要处理的文本"])
|
let values = await quickcommand.showInputBox(["需要处理的文本"])
|
||||||
return values[0]
|
return values[0]
|
||||||
}
|
}
|
||||||
@ -85,6 +87,7 @@ const commandTypes = {
|
|||||||
label: "所有文本",
|
label: "所有文本",
|
||||||
matchLabel: "无需设置",
|
matchLabel: "无需设置",
|
||||||
icon: "emergency",
|
icon: "emergency",
|
||||||
|
color: "light-green",
|
||||||
desc: "匹配主输入框的所有文本,但只有在该文本未设置对应的插件或功能时才生效",
|
desc: "匹配主输入框的所有文本,但只有在该文本未设置对应的插件或功能时才生效",
|
||||||
valueType: null,
|
valueType: null,
|
||||||
disabledSpecialVars: /{{SelectFile}}|{{MatchImage}}|{{WindowInfo.*?}}|{{pwd}}|{{MatchedFiles.*?}}/g,
|
disabledSpecialVars: /{{SelectFile}}|{{MatchImage}}|{{WindowInfo.*?}}|{{pwd}}|{{MatchedFiles.*?}}/g,
|
||||||
@ -94,7 +97,7 @@ const commandTypes = {
|
|||||||
minNum: 1,
|
minNum: 1,
|
||||||
}],
|
}],
|
||||||
verify: rules => true,
|
verify: rules => true,
|
||||||
tempPayload: async() => {
|
tempPayload: async () => {
|
||||||
let values = await quickcommand.showInputBox(["需要处理的文本"])
|
let values = await quickcommand.showInputBox(["需要处理的文本"])
|
||||||
return values[0]
|
return values[0]
|
||||||
}
|
}
|
||||||
@ -104,6 +107,7 @@ const commandTypes = {
|
|||||||
label: "窗口/进程",
|
label: "窗口/进程",
|
||||||
matchLabel: "进程名",
|
matchLabel: "进程名",
|
||||||
icon: "widgets",
|
icon: "widgets",
|
||||||
|
color: "indigo",
|
||||||
desc: "匹配呼出uTools前或唤出超级面板时的活动窗口,可以获取窗口的信息或文件夹路径作为变量",
|
desc: "匹配呼出uTools前或唤出超级面板时的活动窗口,可以获取窗口的信息或文件夹路径作为变量",
|
||||||
valueType: "array",
|
valueType: "array",
|
||||||
disabledSpecialVars: /{{input}}|{{MatchImage}}|{{MatchedFiles.*?}}/g,
|
disabledSpecialVars: /{{input}}|{{MatchImage}}|{{MatchedFiles.*?}}/g,
|
||||||
@ -121,6 +125,7 @@ const commandTypes = {
|
|||||||
label: "图片",
|
label: "图片",
|
||||||
matchLabel: "无需配置",
|
matchLabel: "无需配置",
|
||||||
icon: "panorama",
|
icon: "panorama",
|
||||||
|
color: "deep-orange",
|
||||||
desc: "匹配主输入框或超级面板选中的图片,并返回图片的 DataUrl",
|
desc: "匹配主输入框或超级面板选中的图片,并返回图片的 DataUrl",
|
||||||
valueType: null,
|
valueType: null,
|
||||||
disabledSpecialVars: /{{input}}|{{SelectFile}}|{{pwd}}|{{WindowInfo.*?}}|{{MatchedFiles.*?}}/g,
|
disabledSpecialVars: /{{input}}|{{SelectFile}}|{{pwd}}|{{WindowInfo.*?}}|{{MatchedFiles.*?}}/g,
|
||||||
@ -147,6 +152,7 @@ const commandTypes = {
|
|||||||
label: "复制/选中文件",
|
label: "复制/选中文件",
|
||||||
matchLabel: "正则",
|
matchLabel: "正则",
|
||||||
icon: "description",
|
icon: "description",
|
||||||
|
color: "light-blue",
|
||||||
desc: "匹配主输入框或超级面板选中的文件,可以获取复制及选中的文件信息作为变量",
|
desc: "匹配主输入框或超级面板选中的文件,可以获取复制及选中的文件信息作为变量",
|
||||||
valueType: "regex",
|
valueType: "regex",
|
||||||
disabledSpecialVars: /{{input}}|{{MatchImage}}|{{SelectFile}}|{{pwd}}|{{WindowInfo.*?}}/g,
|
disabledSpecialVars: /{{input}}|{{MatchImage}}|{{SelectFile}}|{{pwd}}|{{WindowInfo.*?}}/g,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user