mirror of
https://github.com/fanchenio/DawnLauncher.git
synced 2026-09-02 22:15:30 +08:00
优化'快速搜索'打开次数问题。
This commit is contained in:
1
commons/utils/common.d.ts
vendored
1
commons/utils/common.d.ts
vendored
@@ -64,7 +64,6 @@ export function newItemData(data: {
|
||||
fixedIcon?: boolean | null;
|
||||
openNumber?: number | null;
|
||||
lastOpen?: number | null;
|
||||
quickSearchOpenNumber?: number | null;
|
||||
quickSearchLastOpen?: number | null;
|
||||
multiItemsTimeInterval?: number | null;
|
||||
}): ItemData;
|
||||
|
||||
@@ -243,7 +243,6 @@ function newItemData({
|
||||
fixedIcon = false,
|
||||
openNumber = 0,
|
||||
lastOpen = 0,
|
||||
quickSearchOpenNumber = 0,
|
||||
quickSearchLastOpen = 0,
|
||||
multiItemsTimeInterval = 0,
|
||||
}: {
|
||||
@@ -258,7 +257,6 @@ function newItemData({
|
||||
fixedIcon?: boolean | null;
|
||||
openNumber?: number | null;
|
||||
lastOpen?: number | null;
|
||||
quickSearchOpenNumber?: number | null;
|
||||
quickSearchLastOpen?: number | null;
|
||||
multiItemsTimeInterval?: number | null;
|
||||
}): ItemData {
|
||||
@@ -274,7 +272,6 @@ function newItemData({
|
||||
fixedIcon: fixedIcon ?? false,
|
||||
openNumber: openNumber ?? 0,
|
||||
lastOpen: lastOpen ?? 0,
|
||||
quickSearchOpenNumber: quickSearchOpenNumber ?? 0,
|
||||
quickSearchLastOpen: quickSearchLastOpen ?? 0,
|
||||
multiItemsTimeInterval: multiItemsTimeInterval ?? 0,
|
||||
};
|
||||
|
||||
@@ -79,7 +79,7 @@ function databaseRestore(filePath: string) {
|
||||
function clearAndInsert(
|
||||
db: Database.Database,
|
||||
tableName: string,
|
||||
list: Array<any>
|
||||
list: Array<any>,
|
||||
) {
|
||||
// 清空数据
|
||||
db.prepare(`DELETE FROM ${tableName}`).run();
|
||||
@@ -90,7 +90,7 @@ function clearAndInsert(
|
||||
const placeholders = keys.map(() => "?").join(",");
|
||||
const values = keys.map((key) => row[key]);
|
||||
db.prepare(
|
||||
`INSERT INTO ${tableName} (${columns.join(",")}) VALUES (${placeholders})`
|
||||
`INSERT INTO ${tableName} (${columns.join(",")}) VALUES (${placeholders})`,
|
||||
).run(values);
|
||||
});
|
||||
}
|
||||
@@ -136,7 +136,7 @@ function jsonRestore(filePath: string) {
|
||||
const child = parent.childList[j];
|
||||
let childClassification = jsonAddClassification(
|
||||
child,
|
||||
classification.id
|
||||
classification.id,
|
||||
);
|
||||
if (
|
||||
childClassification &&
|
||||
@@ -149,7 +149,7 @@ function jsonRestore(filePath: string) {
|
||||
child.itemList[k],
|
||||
child,
|
||||
childClassification.id,
|
||||
iconData
|
||||
iconData,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -162,7 +162,7 @@ function jsonRestore(filePath: string) {
|
||||
parent.itemList[k],
|
||||
parent,
|
||||
classification.id,
|
||||
iconData
|
||||
iconData,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -192,7 +192,7 @@ function jsonRestore(filePath: string) {
|
||||
*/
|
||||
function jsonAddClassification(
|
||||
oldClassification: any,
|
||||
parentId: number | null
|
||||
parentId: number | null,
|
||||
) {
|
||||
// 排序
|
||||
let itemSort: "default" | "initial" | "openNumber" | "lastOpen" = "default";
|
||||
@@ -262,7 +262,7 @@ function jsonAddClassification(
|
||||
classification.shortcutKey,
|
||||
classification.globalShortcutKey,
|
||||
classification.data,
|
||||
classification.type
|
||||
classification.type,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -277,7 +277,7 @@ function jsonAddItem(
|
||||
oldItem: any,
|
||||
oldClassification: any,
|
||||
classificationId: number,
|
||||
iconData: Array<any>
|
||||
iconData: Array<any>,
|
||||
) {
|
||||
// 类型
|
||||
let type = oldItem.type;
|
||||
@@ -341,7 +341,6 @@ function jsonAddItem(
|
||||
fixedIcon: oldItem.notRefreshIcon,
|
||||
openNumber: oldItem.openNumber,
|
||||
lastOpen: oldItem.lastOpen,
|
||||
quickSearchOpenNumber: oldItem.quickSearchOpenNumber,
|
||||
quickSearchLastOpen: oldItem.quickSearchLastOpen,
|
||||
});
|
||||
let item = newItem({
|
||||
|
||||
@@ -45,7 +45,7 @@ let itemSVGIconWindow: BrowserWindow | null = null;
|
||||
*/
|
||||
async function createAddEditWindow(
|
||||
id: number | null,
|
||||
classificationId: number | null
|
||||
classificationId: number | null,
|
||||
) {
|
||||
// 如果窗口存在先关闭窗口
|
||||
closeWindow(itemAddEditWindow);
|
||||
@@ -83,7 +83,7 @@ async function createAddEditWindow(
|
||||
}
|
||||
if (process.env.VITE_DEV_SERVER_URL) {
|
||||
itemAddEditWindow.loadURL(
|
||||
process.env.VITE_DEV_SERVER_URL + "item/AddEdit" + getURLParams(params)
|
||||
process.env.VITE_DEV_SERVER_URL + "item/AddEdit" + getURLParams(params),
|
||||
);
|
||||
} else {
|
||||
itemAddEditWindow.loadFile(join(process.env.DIST, "index.html"), {
|
||||
@@ -139,7 +139,7 @@ async function createNetworkIconWindow() {
|
||||
});
|
||||
if (process.env.VITE_DEV_SERVER_URL) {
|
||||
itemNetworkIconWindow.loadURL(
|
||||
process.env.VITE_DEV_SERVER_URL + "item/NetworkIcon"
|
||||
process.env.VITE_DEV_SERVER_URL + "item/NetworkIcon",
|
||||
);
|
||||
} else {
|
||||
itemNetworkIconWindow.loadFile(join(process.env.DIST, "index.html"), {
|
||||
@@ -296,14 +296,15 @@ function updateOpenInfo(type: string, id: number) {
|
||||
// 记录打开信息
|
||||
curItem.data.quickSearchLastOpen = new Date().getTime();
|
||||
// 记录打开次数
|
||||
curItem.data.quickSearchOpenNumber += 1;
|
||||
if (global.setting.item.openNumber) {
|
||||
curItem.data.openNumber += 1;
|
||||
}
|
||||
}
|
||||
if (updateData(curItem.id, curItem.data)) {
|
||||
sendToWebContent("mainWindow", "onUpdateOpenInfo", {
|
||||
id: curItem.id,
|
||||
openNumber: curItem.data.openNumber,
|
||||
lastOpen: curItem.data.lastOpen,
|
||||
quickSearchOpenNumber: curItem.data.quickSearchOpenNumber,
|
||||
quickSearchLastOpen: curItem.data.quickSearchLastOpen,
|
||||
type,
|
||||
});
|
||||
@@ -320,7 +321,7 @@ function updateOpenInfo(type: string, id: number) {
|
||||
function run(
|
||||
type: string,
|
||||
operation: "open" | "runas" | "openFileLocation" | "explore",
|
||||
item: Item
|
||||
item: Item,
|
||||
) {
|
||||
if (item.data) {
|
||||
if (operation === "open" && item.data.runAsAdmin) {
|
||||
@@ -356,7 +357,7 @@ function run(
|
||||
operation,
|
||||
item.data.target,
|
||||
item.data.params ?? "",
|
||||
item.data.startLocation
|
||||
item.data.startLocation,
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -495,7 +496,7 @@ function refreshIcon(idList: Array<number>) {
|
||||
}
|
||||
// 发送消息到页面
|
||||
sendToWebContent("mainWindow", "onRefreshItemIcon", itemList);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -533,7 +534,7 @@ function getDirectoryList(
|
||||
dir: string | null,
|
||||
hiddenItems: string | null,
|
||||
listen: boolean,
|
||||
clear: boolean
|
||||
clear: boolean,
|
||||
) {
|
||||
// 校验目录
|
||||
if (!dir || dir.trim() === "") {
|
||||
@@ -578,7 +579,7 @@ function getDirectoryList(
|
||||
classificationId,
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -671,7 +672,6 @@ function checkInvalid() {
|
||||
function clearOpenInfo(item: Item) {
|
||||
item.data.openNumber = 0;
|
||||
item.data.lastOpen = 0;
|
||||
item.data.quickSearchOpenNumber = 0;
|
||||
item.data.quickSearchLastOpen = 0;
|
||||
}
|
||||
|
||||
@@ -685,20 +685,17 @@ function deleteQuickSearchHistory(itemId: number) {
|
||||
if (item) {
|
||||
// 重置历史记录
|
||||
item.data.quickSearchLastOpen = 0;
|
||||
item.data.quickSearchOpenNumber = 0;
|
||||
// 更新
|
||||
updateData(itemId, item.data);
|
||||
// 通知主页面
|
||||
sendToWebContent("mainWindow", "onUpdateOpenInfo", {
|
||||
id: itemId,
|
||||
quickSearchOpenNumber: item.data.quickSearchOpenNumber,
|
||||
quickSearchLastOpen: item.data.quickSearchLastOpen,
|
||||
type: "quickSearch",
|
||||
});
|
||||
// 通知快速搜索页面
|
||||
sendToWebContent("quickSearchWindow", "onUpdateOpenInfo", {
|
||||
id: itemId,
|
||||
quickSearchOpenNumber: item.data.quickSearchOpenNumber,
|
||||
quickSearchLastOpen: item.data.quickSearchLastOpen,
|
||||
});
|
||||
}
|
||||
@@ -711,7 +708,7 @@ function deleteQuickSearchHistory(itemId: number) {
|
||||
*/
|
||||
async function getDropItemInfo(
|
||||
classificationId: number,
|
||||
pathList: Array<string>
|
||||
pathList: Array<string>,
|
||||
) {
|
||||
// 项目列表
|
||||
let itemList: Array<Item> = [];
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
>
|
||||
<div
|
||||
v-for="(classification, index) of getClassificationChildList(
|
||||
store.selectedClassificationParentId
|
||||
store.selectedClassificationParentId,
|
||||
)"
|
||||
:key="'classification-child-' + classification.id + '-item-' + index"
|
||||
class="item-container"
|
||||
@@ -67,7 +67,7 @@
|
||||
<ItemList
|
||||
:data="
|
||||
getShowItemListByClassificationId(
|
||||
store.selectedClassificationParentId
|
||||
store.selectedClassificationParentId,
|
||||
)
|
||||
"
|
||||
:classification-id="store.selectedClassificationParentId"
|
||||
@@ -164,7 +164,7 @@ watch(
|
||||
// 滚动到顶部
|
||||
scrollToTop(itemContentSimpleBar);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
// 监听选中的父级分类
|
||||
watch(
|
||||
@@ -181,7 +181,7 @@ watch(
|
||||
// 滚动到顶部
|
||||
scrollToTop(itemContentSimpleBar);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
// 监听选中的子级分类
|
||||
watch(
|
||||
@@ -198,7 +198,7 @@ watch(
|
||||
// 滚动到顶部
|
||||
scrollToTop(itemContentSimpleBar);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
/**
|
||||
* 获取项目列表
|
||||
@@ -241,7 +241,7 @@ function createSimpleBar() {
|
||||
}
|
||||
}
|
||||
},
|
||||
{ passive: false, capture: true }
|
||||
{ passive: false, capture: true },
|
||||
);
|
||||
}
|
||||
} else {
|
||||
@@ -314,7 +314,7 @@ function createItemSortable() {
|
||||
// 普通操作
|
||||
// from 分类ID
|
||||
let fromClassificationId = parseInt(
|
||||
event.from.getAttribute("classification-id")!
|
||||
event.from.getAttribute("classification-id")!,
|
||||
);
|
||||
let fromClassification =
|
||||
getClassificationById(fromClassificationId);
|
||||
@@ -326,7 +326,7 @@ function createItemSortable() {
|
||||
// 可能会存在自定义排序的情况,所以需要按照指定的排序方式获取项目
|
||||
const currentItem = showItemList(
|
||||
copyItemList,
|
||||
fromClassification
|
||||
fromClassification,
|
||||
)[event.oldIndex];
|
||||
fromIdList.push(currentItem.id);
|
||||
}
|
||||
@@ -348,13 +348,13 @@ function createItemSortable() {
|
||||
let res = window.item.updateOrder(
|
||||
fromIdList,
|
||||
toClassificationId,
|
||||
store.mouseoverClassificationId ? null : event.newIndex
|
||||
store.mouseoverClassificationId ? null : event.newIndex,
|
||||
);
|
||||
if (res) {
|
||||
updateItemOrder(
|
||||
fromIdList,
|
||||
toClassificationId,
|
||||
store.mouseoverClassificationId ? null : event.newIndex
|
||||
store.mouseoverClassificationId ? null : event.newIndex,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -368,7 +368,7 @@ function createItemSortable() {
|
||||
setItemWidth();
|
||||
});
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
} else {
|
||||
// 将所有元素设置为可拖拽,项目拖出时需要用到
|
||||
@@ -413,7 +413,7 @@ watch(
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
// 清除批量操作
|
||||
function clearBatchOperation() {
|
||||
@@ -638,7 +638,7 @@ async function contextmenu(e: any) {
|
||||
let itemListElement = getClassElement(e, "item-list");
|
||||
if (itemListElement) {
|
||||
pageClassificationId = parseInt(
|
||||
itemListElement.getAttribute("classification-id")
|
||||
itemListElement.getAttribute("classification-id"),
|
||||
);
|
||||
}
|
||||
// 弹出菜单
|
||||
@@ -716,7 +716,7 @@ onMounted(() => {
|
||||
// 设置项目宽度
|
||||
setItemWidth();
|
||||
});
|
||||
})
|
||||
}),
|
||||
);
|
||||
// 监听更新项目
|
||||
listens.push(
|
||||
@@ -729,7 +729,7 @@ onMounted(() => {
|
||||
// 设置项目宽度
|
||||
setItemWidth();
|
||||
});
|
||||
})
|
||||
}),
|
||||
);
|
||||
// 监听删除项目
|
||||
listens.push(
|
||||
@@ -749,7 +749,7 @@ onMounted(() => {
|
||||
// 设置项目宽度
|
||||
setItemWidth();
|
||||
});
|
||||
})
|
||||
}),
|
||||
);
|
||||
// 监听锁定/解锁项目
|
||||
listens.push(
|
||||
@@ -766,7 +766,7 @@ onMounted(() => {
|
||||
// 创建项目拖拽对象
|
||||
createItemSortable();
|
||||
});
|
||||
})
|
||||
}),
|
||||
);
|
||||
// 监听批量操作
|
||||
listens.push(
|
||||
@@ -778,7 +778,7 @@ onMounted(() => {
|
||||
// 创建项目拖拽对象
|
||||
createItemSortable();
|
||||
});
|
||||
})
|
||||
}),
|
||||
);
|
||||
// 监听转换路径
|
||||
listens.push(
|
||||
@@ -795,7 +795,7 @@ onMounted(() => {
|
||||
}
|
||||
// 清空批量操作
|
||||
clearBatchOperation();
|
||||
})
|
||||
}),
|
||||
);
|
||||
// 监听刷新图标
|
||||
listens.push(
|
||||
@@ -813,7 +813,7 @@ onMounted(() => {
|
||||
}
|
||||
// 清空批量操作
|
||||
clearBatchOperation();
|
||||
})
|
||||
}),
|
||||
);
|
||||
// 监听移动项目
|
||||
listens.push(
|
||||
@@ -828,7 +828,7 @@ onMounted(() => {
|
||||
// 创建项目拖拽对象
|
||||
createItemSortable();
|
||||
});
|
||||
})
|
||||
}),
|
||||
);
|
||||
// 监听批量操作全选
|
||||
listens.push(
|
||||
@@ -839,7 +839,7 @@ onMounted(() => {
|
||||
hasChildClassification(store.selectedClassificationParentId)
|
||||
) {
|
||||
let classificationList = getClassificationChildList(
|
||||
store.selectedClassificationParentId
|
||||
store.selectedClassificationParentId,
|
||||
);
|
||||
for (const classification of classificationList) {
|
||||
if (classification.type === 0) {
|
||||
@@ -857,7 +857,7 @@ onMounted(() => {
|
||||
let classification = getClassificationById(classificationId);
|
||||
if (classification && classification.type === 0) {
|
||||
let itemList = getItemListByClassificationId(
|
||||
getSelectedClassificationId()
|
||||
getSelectedClassificationId(),
|
||||
);
|
||||
for (const item of itemList) {
|
||||
if (!store.itemBatchOperationDataArray.includes(item.id)) {
|
||||
@@ -867,14 +867,14 @@ onMounted(() => {
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}),
|
||||
);
|
||||
// 监听项目右键菜单关闭
|
||||
listens.push(
|
||||
window.item.onRightMenuClose((data) => {
|
||||
store.itemRightMenuItemId = null;
|
||||
store.searchItemRightMenuItemId = null;
|
||||
})
|
||||
}),
|
||||
);
|
||||
// 监听项目资源管理器菜单
|
||||
listens.push(
|
||||
@@ -884,14 +884,14 @@ onMounted(() => {
|
||||
} else if (data.type === "search") {
|
||||
store.searchItemRightMenuItemId = data.id;
|
||||
}
|
||||
})
|
||||
}),
|
||||
);
|
||||
// 监听取消项目拖拽
|
||||
listens.push(
|
||||
window.item.onCancelDragOut((data) => {
|
||||
store.itemDragOutData = null;
|
||||
store.itemDragOut = false;
|
||||
})
|
||||
}),
|
||||
);
|
||||
// 监听更新打开次数
|
||||
listens.push(
|
||||
@@ -902,17 +902,17 @@ onMounted(() => {
|
||||
item.data.openNumber = data.openNumber;
|
||||
item.data.lastOpen = data.lastOpen;
|
||||
} else if (data.type === "quickSearch") {
|
||||
item.data.quickSearchOpenNumber = data.quickSearchOpenNumber;
|
||||
item.data.openNumber = data.openNumber;
|
||||
item.data.quickSearchLastOpen = data.quickSearchLastOpen;
|
||||
}
|
||||
}
|
||||
})
|
||||
}),
|
||||
);
|
||||
// 监听无效项目
|
||||
listens.push(
|
||||
window.item.onCheckInvalid((data) => {
|
||||
store.invalidItemIdList = data;
|
||||
})
|
||||
}),
|
||||
);
|
||||
});
|
||||
// unmounted
|
||||
|
||||
@@ -557,7 +557,6 @@ function sort(
|
||||
| "initial"
|
||||
| "openNumber"
|
||||
| "lastOpen"
|
||||
| "quickSearchOpenNumber"
|
||||
| "quickSearchLastOpen",
|
||||
) {
|
||||
if (type === "initial") {
|
||||
@@ -609,7 +608,6 @@ function sort(
|
||||
} else if (
|
||||
type === "openNumber" ||
|
||||
type === "lastOpen" ||
|
||||
type === "quickSearchOpenNumber" ||
|
||||
type === "quickSearchLastOpen"
|
||||
) {
|
||||
return list
|
||||
@@ -781,7 +779,7 @@ function getItemTitle(item: Item, quickSearch: boolean = false) {
|
||||
"\n" +
|
||||
store.language.openCount +
|
||||
store.language.colon +
|
||||
(item.data.quickSearchOpenNumber ?? 0);
|
||||
(item.data.openNumber ?? 0);
|
||||
} else if (store.setting.item.openNumber) {
|
||||
name +=
|
||||
"\n" +
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
store.quickSearchItemRightMenuItemId === item.id
|
||||
? hexToRGBA(
|
||||
store.setting.appearance.theme.secondBackgroundColor,
|
||||
0.3
|
||||
0.3,
|
||||
)
|
||||
: undefined,
|
||||
}"
|
||||
@@ -77,7 +77,7 @@
|
||||
:index="index"
|
||||
:target="item.data.target"
|
||||
>
|
||||
<CustomItemIcon :item="(item as Item)" :icon-size="28"></CustomItemIcon>
|
||||
<CustomItemIcon :item="item as Item" :icon-size="28"></CustomItemIcon>
|
||||
<span
|
||||
class="text-sm ml-[10px] overflow-hidden text-ellipsis whitespace-nowrap h-[20px]"
|
||||
>{{ getName(item.name) }}</span
|
||||
@@ -209,7 +209,7 @@ watch(
|
||||
() => value.value,
|
||||
() => {
|
||||
search();
|
||||
}
|
||||
},
|
||||
);
|
||||
// 搜索
|
||||
function search() {
|
||||
@@ -246,8 +246,8 @@ function refresh() {
|
||||
!resultList.value || resultList.value.length === 0
|
||||
? 0
|
||||
: resultList.value.length > 9
|
||||
? 10 * 48 + 1
|
||||
: resultList.value.length * 48 + 1;
|
||||
? 10 * 48 + 1
|
||||
: resultList.value.length * 48 + 1;
|
||||
window.quickSearch.setWindowHeight(height + 44);
|
||||
});
|
||||
}
|
||||
@@ -271,7 +271,7 @@ function resetScroll() {
|
||||
function getData() {
|
||||
// 分类
|
||||
store.classificationList = convertClassificationList(
|
||||
window.classification.list()
|
||||
window.classification.list(),
|
||||
);
|
||||
// 项目
|
||||
store.itemMap = convertItemList(window.item.list());
|
||||
@@ -280,7 +280,7 @@ function getData() {
|
||||
// 搜索Map
|
||||
searchMap = getItemSearchMap(
|
||||
itemList,
|
||||
store.setting.quickSearch.matchConditionsRemark
|
||||
store.setting.quickSearch.matchConditionsRemark,
|
||||
);
|
||||
// 历史记录
|
||||
getHistory();
|
||||
@@ -292,7 +292,7 @@ function getHistory() {
|
||||
let itemList: Array<Item> = filterExcludeSearchItemList().filter((item) => {
|
||||
if (
|
||||
store.setting.quickSearch.showHistorySort === "openNumber" &&
|
||||
item.data.quickSearchOpenNumber > 0
|
||||
item.data.openNumber > 0
|
||||
) {
|
||||
return true;
|
||||
} else if (
|
||||
@@ -307,8 +307,8 @@ function getHistory() {
|
||||
let sortList = sort(
|
||||
itemList,
|
||||
store.setting.quickSearch.showHistorySort === "openNumber"
|
||||
? "quickSearchOpenNumber"
|
||||
: "quickSearchLastOpen"
|
||||
? "openNumber"
|
||||
: "quickSearchLastOpen",
|
||||
);
|
||||
if (sortList && sortList.length > 0) {
|
||||
// 截取数据
|
||||
@@ -712,7 +712,7 @@ onMounted(() => {
|
||||
// 显示窗口
|
||||
window.quickSearch.showWindow();
|
||||
}, 10);
|
||||
})
|
||||
}),
|
||||
);
|
||||
// 清空数据
|
||||
listens.push(
|
||||
@@ -723,14 +723,14 @@ onMounted(() => {
|
||||
selected.value = 0;
|
||||
mode.value = "search";
|
||||
webSearchSource.value = null;
|
||||
})
|
||||
}),
|
||||
);
|
||||
// 监听项目右键菜单关闭
|
||||
listens.push(
|
||||
window.item.onRightMenuClose((data) => {
|
||||
store.quickSearchItemRightMenuItemId = null;
|
||||
itemAllRemoveStyle("item", selected.value);
|
||||
})
|
||||
}),
|
||||
);
|
||||
// 监听项目资源管理器菜单
|
||||
listens.push(
|
||||
@@ -738,18 +738,18 @@ onMounted(() => {
|
||||
if (data.type === "quickSearch") {
|
||||
store.quickSearchItemRightMenuItemId = data.id;
|
||||
}
|
||||
})
|
||||
}),
|
||||
);
|
||||
// 删除历史记录
|
||||
// 监听更新打开信息
|
||||
listens.push(
|
||||
window.item.onUpdateOpenInfo((data) => {
|
||||
let item = getItemById(data.id);
|
||||
if (item) {
|
||||
item.data.quickSearchOpenNumber = data.quickSearchOpenNumber;
|
||||
item.data.openNumber = data.openNumber;
|
||||
item.data.quickSearchLastOpen = data.quickSearchLastOpen;
|
||||
}
|
||||
getHistory();
|
||||
})
|
||||
}),
|
||||
);
|
||||
});
|
||||
// unmounted
|
||||
|
||||
2
types/item.d.ts
vendored
2
types/item.d.ts
vendored
@@ -66,8 +66,6 @@ export interface ItemData {
|
||||
openNumber: number;
|
||||
// 最后打开时间
|
||||
lastOpen: number;
|
||||
// 快速搜索-打开次数
|
||||
quickSearchOpenNumber: number;
|
||||
// 快速搜索-最后打开时间
|
||||
quickSearchLastOpen: number;
|
||||
// 多项目时间间隔(毫秒)
|
||||
|
||||
Reference in New Issue
Block a user