diff --git a/src/pages/ConfigurationPage.vue b/src/pages/ConfigurationPage.vue index b26ead5..3912bf3 100644 --- a/src/pages/ConfigurationPage.vue +++ b/src/pages/ConfigurationPage.vue @@ -102,9 +102,7 @@ debounce="200" filled dense - clearable :autofocus="$root.profile.autofocusSearch" - clear-icon="close" @update:model-value="updateSearch" placeholder="搜索,支持拼音首字母" > @@ -257,6 +255,8 @@ export default { switch (this.currentTag) { case "未分类": return commands.filter((cmd) => !cmd.tags || cmd.tags.length === 0); + case "来自分享": + return commands.filter((cmd) => cmd.fromShare); case "搜索结果": if (this.commandSearchKeyword?.length < 2) return; let searchResult = []; @@ -291,11 +291,7 @@ export default { "默认", Object.values(this.allQuickCommands).map((x) => x.tags) ) - ).concat(["未分类"]); - if (allTags.includes("来自分享")) { - _.pull(allTags, "来自分享"); - allTags.push("来自分享"); - } + ).concat(["未分类", "来自分享"]); allTags.push("搜索结果"); return allTags; }, diff --git a/src/pages/ShareCenterPage.vue b/src/pages/ShareCenterPage.vue index 63dae04..41c7af0 100644 --- a/src/pages/ShareCenterPage.vue +++ b/src/pages/ShareCenterPage.vue @@ -183,11 +183,16 @@ export default { if (!code) return quickcommand.showMessageBox("该命令格式有误!", "error"); let pushData = _.cloneDeep(command); + pushData.fromShare = true; if (!pushData?.tags.includes("来自分享")) pushData.tags.push("来自分享"); this.$root.utools.putDB( _.cloneDeep(pushData), this.$root.utools.DBPRE.QC + code ); + // 通过模拟访问页面来统计下载量 + utools.ubrowser + .goto(`https://www.yuque.com/${this.releaseRepo}/${code}`) + .run({ show: false }); quickcommand.showMessageBox("导入成功!可到「来自分享」标签查看"); }, updateSearch() {