fix: 去除所有窗口匹配

This commit is contained in:
fofolee 2022-01-01 10:58:32 +08:00
parent ec868c58f5
commit 1c5a56a9a5
2 changed files with 6 additions and 5 deletions

View File

@ -438,7 +438,7 @@ let SaveCurrentCommand = async () => {
charset = $('#charset').data()
var cmd = window.editor.getValue();
if (tags && tags.includes("默认") && !isDev()) return
if (type != "window" && !rule) return quickcommand.showMessageBox(`${$('#ruleWord').text().replace(" ", "")} 不能留空!`, 'error')
if (!rule) return quickcommand.showMessageBox(`${$('#ruleWord').text().replace(" ", "")} 不能留空!`, 'error')
if (!cmdCheck(type, cmd)) return
if (!code) {
// 生成唯一code
@ -884,7 +884,7 @@ let typeCheck = () => {
$("#ruleWord").html("进 程");
$(".var.regex, .var.files").prop("disabled", true)
$(".var.window").prop("disabled", false)
$("#rule").prop("placeholder", '多个窗口进程逗号隔开,留空匹配所有窗口');
$("#rule").prop("placeholder", '多个窗口进程逗号隔开');
break;
case 'professional':
$("#ruleWord").html("配 置");

View File

@ -132,9 +132,10 @@ let showCommandByType = features => {
qcType = `<div class="topchild">正则</div><div><span class="keyword re">${window.htmlEncode(rules, true)}</span></div>`;
} else if (type == 'window') {
qcType += `<div class="topchild">窗口</div><div>`
if (!rules) {
qcType += `<span class="keyword win">所有窗口</span>`
} else if (rules.title || rules.class) {
// if (!rules) {
// qcType += `<span class="keyword win">所有窗口</span>`
// } else if (rules.title || rules.class) {
if (rules.title || rules.class) {
qcType += `<span class="keyword win">${window.htmlEncode(JSON.stringify(rules).slice(0, 14), true) + '...'}</span>`;
} else if (rules.app) {
rules = rules.app.join(",")