mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
This commit is contained in:
parent
533e11cc1e
commit
4e87e5e7ef
1 changed files with 6 additions and 5 deletions
|
@ -20,7 +20,7 @@ export const getDefaultOperatorByType = (type: TAVCol) => {
|
||||||
if (["checkbox"].includes(type)) {
|
if (["checkbox"].includes(type)) {
|
||||||
return "Is false";
|
return "Is false";
|
||||||
}
|
}
|
||||||
if (["rollup", "relation", "rollup", "text", "mSelect", "url", "block", "email", "phone", "template"].includes(type)) {
|
if (["rollup", "relation", "mAsset", "text", "mSelect", "url", "block", "email", "phone", "template"].includes(type)) {
|
||||||
return "Contains";
|
return "Contains";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -288,6 +288,7 @@ export const setFilter = async (options: {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "block":
|
case "block":
|
||||||
|
case "mAsset":
|
||||||
case "text":
|
case "text":
|
||||||
case "url":
|
case "url":
|
||||||
case "phone":
|
case "phone":
|
||||||
|
@ -351,7 +352,7 @@ export const setFilter = async (options: {
|
||||||
<option ${"Is not empty" === options.filter.operator ? "selected" : ""} value="Is not empty">${window.siyuan.languages.filterOperatorIsNotEmpty}</option>`;
|
<option ${"Is not empty" === options.filter.operator ? "selected" : ""} value="Is not empty">${window.siyuan.languages.filterOperatorIsNotEmpty}</option>`;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (options.filter.value.type === "rollup") {
|
if (["rollup", "mAsset"].includes(options.filter.value.type)) {
|
||||||
menu.addItem({
|
menu.addItem({
|
||||||
iconHTML: "",
|
iconHTML: "",
|
||||||
type: "readonly",
|
type: "readonly",
|
||||||
|
@ -423,7 +424,7 @@ export const setFilter = async (options: {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else if (["text", "url", "block", "email", "phone", "template", "relation"].includes(filterValue.type)) {
|
} else if (["text", "url", "block", "mAsset", "email", "phone", "template", "relation"].includes(filterValue.type)) {
|
||||||
let value = "";
|
let value = "";
|
||||||
if (filterValue) {
|
if (filterValue) {
|
||||||
if (filterValue.type === "relation") {
|
if (filterValue.type === "relation") {
|
||||||
|
@ -609,7 +610,7 @@ export const addFilter = (options: {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// 该列是行号类型列,则不允许添加到过滤器
|
// 该列是行号类型列,则不允许添加到过滤器
|
||||||
if (!filter && column.type !== "mAsset" && column.type !== "lineNumber") {
|
if (!filter && column.type !== "lineNumber") {
|
||||||
menu.addItem({
|
menu.addItem({
|
||||||
label: column.name,
|
label: column.name,
|
||||||
iconHTML: column.icon ? unicode2Emoji(column.icon, "b3-menu__icon", true) : `<svg class="b3-menu__icon"><use xlink:href="#${getColIconByType(column.type)}"></use></svg>`,
|
iconHTML: column.icon ? unicode2Emoji(column.icon, "b3-menu__icon", true) : `<svg class="b3-menu__icon"><use xlink:href="#${getColIconByType(column.type)}"></use></svg>`,
|
||||||
|
@ -651,7 +652,7 @@ export const getFiltersHTML = (data: IAV) => {
|
||||||
fields.find((item) => {
|
fields.find((item) => {
|
||||||
if (item.id === filter.column && item.type === filter.value.type) {
|
if (item.id === filter.column && item.type === filter.value.type) {
|
||||||
let filterText = "";
|
let filterText = "";
|
||||||
if (item.type === "rollup") {
|
if (["rollup", "mAsset"].includes(item.type)) {
|
||||||
if (filter.quantifier === "" || filter.quantifier === "Any") {
|
if (filter.quantifier === "" || filter.quantifier === "Any") {
|
||||||
filterText = window.siyuan.languages.filterQuantifierAny + " ";
|
filterText = window.siyuan.languages.filterQuantifierAny + " ";
|
||||||
} else if (filter.quantifier === "All") {
|
} else if (filter.quantifier === "All") {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue