mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 15:40:12 +01:00
This commit is contained in:
parent
186c5e29d7
commit
dad137f0d9
2 changed files with 47 additions and 40 deletions
|
|
@ -784,7 +784,6 @@ export const showColMenu = (protyle: IProtyle, blockElement: Element, cellElemen
|
||||||
|
|
||||||
// 行号类型不参与筛选和排序
|
// 行号类型不参与筛选和排序
|
||||||
if (type !== "lineNumber") {
|
if (type !== "lineNumber") {
|
||||||
if (type !== "mAsset") {
|
|
||||||
menu.addItem({
|
menu.addItem({
|
||||||
id: "filter",
|
id: "filter",
|
||||||
icon: "iconFilter",
|
icon: "iconFilter",
|
||||||
|
|
@ -822,7 +821,6 @@ export const showColMenu = (protyle: IProtyle, blockElement: Element, cellElemen
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
menu.addItem({
|
menu.addItem({
|
||||||
id: "asc",
|
id: "asc",
|
||||||
icon: "iconUp",
|
icon: "iconUp",
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,7 @@ export const setFilter = async (options: {
|
||||||
newFilter.relativeDate = null;
|
newFilter.relativeDate = null;
|
||||||
newFilter.relativeDate2 = null;
|
newFilter.relativeDate2 = null;
|
||||||
}
|
}
|
||||||
} else if (["text", "url", "block", "email", "phone", "template", "relation", "number"].includes(filterValue.type)) {
|
} else if (["text", "mAsset", "url", "block", "email", "phone", "template", "relation", "number"].includes(filterValue.type)) {
|
||||||
newValue = genCellValue(filterValue.type, textElements[0].value);
|
newValue = genCellValue(filterValue.type, textElements[0].value);
|
||||||
} else if (filterValue.type === "checkbox") {
|
} else if (filterValue.type === "checkbox") {
|
||||||
newValue = genCellValue(filterValue.type, {
|
newValue = genCellValue(filterValue.type, {
|
||||||
|
|
@ -429,6 +429,8 @@ export const setFilter = async (options: {
|
||||||
if (filterValue) {
|
if (filterValue) {
|
||||||
if (filterValue.type === "relation") {
|
if (filterValue.type === "relation") {
|
||||||
value = filterValue.relation.blockIDs[0] || "";
|
value = filterValue.relation.blockIDs[0] || "";
|
||||||
|
} else if (filterValue.type === "mAsset") {
|
||||||
|
value = filterValue.mAsset[0]?.content || "";
|
||||||
} else {
|
} else {
|
||||||
value = filterValue[filterValue.type as "text"].content || "";
|
value = filterValue[filterValue.type as "text"].content || "";
|
||||||
}
|
}
|
||||||
|
|
@ -732,8 +734,15 @@ export const getFiltersHTML = (data: IAV) => {
|
||||||
} else if ("<=" === filter.operator) {
|
} else if ("<=" === filter.operator) {
|
||||||
filterText = ` ${filterText}≤ ${filterValue.number.content}`;
|
filterText = ` ${filterText}≤ ${filterValue.number.content}`;
|
||||||
}
|
}
|
||||||
} else if (["text", "block", "url", "phone", "email", "relation", "template"].includes(filterValue.type) && filterValue[filterValue.type as "text"]) {
|
} else if (["text", "block", "url", "mAsset", "phone", "email", "relation", "template"].includes(filterValue.type) && filterValue[filterValue.type as "text"]) {
|
||||||
const content = filterValue[filterValue.type as "text"].content || filterValue.relation?.blockIDs[0] || "";
|
let content: string;
|
||||||
|
if (filterValue.type === "relation") {
|
||||||
|
content = filterValue.relation.blockIDs[0] || "";
|
||||||
|
} else if (filterValue.type === "mAsset") {
|
||||||
|
content = filterValue.mAsset[0]?.content || "";
|
||||||
|
} else {
|
||||||
|
content = filterValue[filterValue.type as "text"].content || "";
|
||||||
|
}
|
||||||
if (content) {
|
if (content) {
|
||||||
if (["=", "Contains"].includes(filter.operator)) {
|
if (["=", "Contains"].includes(filter.operator)) {
|
||||||
filterText = `: ${filterText}${content}`;
|
filterText = `: ${filterText}${content}`;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue