mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
This commit is contained in:
parent
8d2e3bfd20
commit
7b2e48d54e
1 changed files with 38 additions and 25 deletions
|
@ -219,33 +219,46 @@ export const setFilter = async (options: {
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let targetAVId = "";
|
if (colData.rollup.calc?.operator && colData.rollup.calc.operator !== "Range") {
|
||||||
fields.find((column) => {
|
if (["Count all", "Count empty", "Count not empty", "Count values", "Count unique values", "Percent empty",
|
||||||
if (column.id === colData.rollup.relationKeyID) {
|
"Percent not empty", "Percent unique values", "Percent checked", "Percent unchecked", "Sum", "Average", "Median",
|
||||||
targetAVId = column.relation.avID;
|
"Min", "Max"].includes(colData.rollup.calc.operator)) {
|
||||||
return true;
|
filterValue.type = "number";
|
||||||
|
} else if (["Checked", "Unchecked"].includes(colData.rollup.calc.operator)) {
|
||||||
|
filterValue.type = "checkbox";
|
||||||
|
} else if (["Earliest", "Latest"].includes(colData.rollup.calc.operator)) {
|
||||||
|
filterValue.type = "date";
|
||||||
}
|
}
|
||||||
});
|
} else {
|
||||||
const response = await fetchSyncPost("/api/av/getAttributeView", {id: targetAVId});
|
let targetAVId = "";
|
||||||
response.data.av.keyValues.find((item: {
|
fields.find((column) => {
|
||||||
key: {
|
if (column.id === colData.rollup.relationKeyID) {
|
||||||
id: string,
|
targetAVId = column.relation.avID;
|
||||||
name: string,
|
return true;
|
||||||
type: TAVCol,
|
|
||||||
options: {
|
|
||||||
name: string,
|
|
||||||
color: string,
|
|
||||||
}[]
|
|
||||||
}
|
|
||||||
}) => {
|
|
||||||
if (item.key.id === colData.rollup.keyID) {
|
|
||||||
filterValue.type = item.key.type;
|
|
||||||
if (item.key.type === "select") {
|
|
||||||
colData.options = item.key.options;
|
|
||||||
}
|
}
|
||||||
return true;
|
});
|
||||||
}
|
const response = await fetchSyncPost("/api/av/getAttributeView", {id: targetAVId});
|
||||||
});
|
response.data.av.keyValues.find((item: {
|
||||||
|
key: {
|
||||||
|
id: string,
|
||||||
|
name: string,
|
||||||
|
type: TAVCol,
|
||||||
|
options: {
|
||||||
|
name: string,
|
||||||
|
color: string,
|
||||||
|
}[]
|
||||||
|
}
|
||||||
|
}) => {
|
||||||
|
if (item.key.id === colData.rollup.keyID) {
|
||||||
|
filterValue.type = item.key.type;
|
||||||
|
if (item.key.type === "select") {
|
||||||
|
colData.options = item.key.options;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
options.data.view.filters.find(item => {
|
options.data.view.filters.find(item => {
|
||||||
if (item.column === colData.id && item.value.type === "rollup") {
|
if (item.column === colData.id && item.value.type === "rollup") {
|
||||||
if (!item.value.rollup || !item.value.rollup.contents || item.value.rollup.contents.length === 0) {
|
if (!item.value.rollup || !item.value.rollup.contents || item.value.rollup.contents.length === 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue