mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-17 01:21:14 +08:00
This commit is contained in:
parent
2f1e0bf76b
commit
5ecb868e95
@ -144,7 +144,7 @@ export const genCellValue = (colType: TAVCol, value: string | any) => {
|
|||||||
} else if (colType === "relation") {
|
} else if (colType === "relation") {
|
||||||
cellValue = {
|
cellValue = {
|
||||||
type: colType,
|
type: colType,
|
||||||
relation: {blockIDs: [], contents: []}
|
relation: {blockIDs: [], contents: value ? [value] : []}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -240,10 +240,18 @@ export const setFilter = (options: {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else if (["text", "url", "block", "email", "phone", "template"].includes(colData.type)) {
|
} else if (["text", "url", "block", "email", "phone", "template", "relation"].includes(colData.type)) {
|
||||||
|
let value = ""
|
||||||
|
if (options.filter.value) {
|
||||||
|
if (colData.type === "relation") {
|
||||||
|
value = options.filter.value.relation.contents[0] || ""
|
||||||
|
} else {
|
||||||
|
value = options.filter.value[colData.type as "text"].content || ""
|
||||||
|
}
|
||||||
|
}
|
||||||
menu.addItem({
|
menu.addItem({
|
||||||
iconHTML: "",
|
iconHTML: "",
|
||||||
label: `<input style="margin: 4px 0" value="${options.filter.value ? options.filter.value[colData.type as "text"].content : ""}" class="b3-text-field fn__size200">`
|
label: `<input style="margin: 4px 0" value="${value}" class="b3-text-field fn__size200">`
|
||||||
});
|
});
|
||||||
} else if (colData.type === "number") {
|
} else if (colData.type === "number") {
|
||||||
menu.addItem({
|
menu.addItem({
|
||||||
@ -422,9 +430,10 @@ export const getFiltersHTML = (data: IAVTable) => {
|
|||||||
filterValue = ` ≤ ${filter.value.number.content}`;
|
filterValue = ` ≤ ${filter.value.number.content}`;
|
||||||
}
|
}
|
||||||
} else if (filter.value?.text?.content || filter.value?.block?.content || filter.value?.url?.content ||
|
} else if (filter.value?.text?.content || filter.value?.block?.content || filter.value?.url?.content ||
|
||||||
filter.value?.phone?.content || filter.value?.email?.content) {
|
filter.value?.phone?.content || filter.value?.email?.content || filter.value?.relation?.contents.length>0) {
|
||||||
const content = filter.value?.text?.content || filter.value?.block?.content ||
|
const content = filter.value?.text?.content || filter.value?.block?.content ||
|
||||||
filter.value?.url?.content || filter.value?.phone?.content || filter.value?.email?.content;
|
filter.value?.url?.content || filter.value?.phone?.content || filter.value?.email?.content ||
|
||||||
|
filter.value?.relation?.contents[0];
|
||||||
if (["=", "Contains"].includes(filter.operator)) {
|
if (["=", "Contains"].includes(filter.operator)) {
|
||||||
filterValue = `: ${content}`;
|
filterValue = `: ${content}`;
|
||||||
} else if (filter.operator === "Does not contains") {
|
} else if (filter.operator === "Does not contains") {
|
||||||
|
Loading…
Reference in New Issue
Block a user