mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-08 22:51:25 +08:00
标记来自分享的命令
This commit is contained in:
parent
46885b29cd
commit
83c277363c
@ -102,9 +102,7 @@
|
|||||||
debounce="200"
|
debounce="200"
|
||||||
filled
|
filled
|
||||||
dense
|
dense
|
||||||
clearable
|
|
||||||
:autofocus="$root.profile.autofocusSearch"
|
:autofocus="$root.profile.autofocusSearch"
|
||||||
clear-icon="close"
|
|
||||||
@update:model-value="updateSearch"
|
@update:model-value="updateSearch"
|
||||||
placeholder="搜索,支持拼音首字母"
|
placeholder="搜索,支持拼音首字母"
|
||||||
>
|
>
|
||||||
@ -257,6 +255,8 @@ export default {
|
|||||||
switch (this.currentTag) {
|
switch (this.currentTag) {
|
||||||
case "未分类":
|
case "未分类":
|
||||||
return commands.filter((cmd) => !cmd.tags || cmd.tags.length === 0);
|
return commands.filter((cmd) => !cmd.tags || cmd.tags.length === 0);
|
||||||
|
case "来自分享":
|
||||||
|
return commands.filter((cmd) => cmd.fromShare);
|
||||||
case "搜索结果":
|
case "搜索结果":
|
||||||
if (this.commandSearchKeyword?.length < 2) return;
|
if (this.commandSearchKeyword?.length < 2) return;
|
||||||
let searchResult = [];
|
let searchResult = [];
|
||||||
@ -291,11 +291,7 @@ export default {
|
|||||||
"默认",
|
"默认",
|
||||||
Object.values(this.allQuickCommands).map((x) => x.tags)
|
Object.values(this.allQuickCommands).map((x) => x.tags)
|
||||||
)
|
)
|
||||||
).concat(["未分类"]);
|
).concat(["未分类", "来自分享"]);
|
||||||
if (allTags.includes("来自分享")) {
|
|
||||||
_.pull(allTags, "来自分享");
|
|
||||||
allTags.push("来自分享");
|
|
||||||
}
|
|
||||||
allTags.push("搜索结果");
|
allTags.push("搜索结果");
|
||||||
return allTags;
|
return allTags;
|
||||||
},
|
},
|
||||||
|
@ -183,11 +183,16 @@ export default {
|
|||||||
if (!code)
|
if (!code)
|
||||||
return quickcommand.showMessageBox("该命令格式有误!", "error");
|
return quickcommand.showMessageBox("该命令格式有误!", "error");
|
||||||
let pushData = _.cloneDeep(command);
|
let pushData = _.cloneDeep(command);
|
||||||
|
pushData.fromShare = true;
|
||||||
if (!pushData?.tags.includes("来自分享")) pushData.tags.push("来自分享");
|
if (!pushData?.tags.includes("来自分享")) pushData.tags.push("来自分享");
|
||||||
this.$root.utools.putDB(
|
this.$root.utools.putDB(
|
||||||
_.cloneDeep(pushData),
|
_.cloneDeep(pushData),
|
||||||
this.$root.utools.DBPRE.QC + code
|
this.$root.utools.DBPRE.QC + code
|
||||||
);
|
);
|
||||||
|
// 通过模拟访问页面来统计下载量
|
||||||
|
utools.ubrowser
|
||||||
|
.goto(`https://www.yuque.com/${this.releaseRepo}/${code}`)
|
||||||
|
.run({ show: false });
|
||||||
quickcommand.showMessageBox("导入成功!可到「来自分享」标签查看");
|
quickcommand.showMessageBox("导入成功!可到「来自分享」标签查看");
|
||||||
},
|
},
|
||||||
updateSearch() {
|
updateSearch() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user