🐛 日期单元格值设置不上

This commit is contained in:
Vanessa 2023-08-02 12:02:34 +08:00
parent 12d399dce9
commit e3315a1dd1
4 changed files with 12 additions and 11 deletions

View file

@ -63,6 +63,7 @@ export const bindDateEvent = (options: {
data: options.data,
protyle: options.protyle,
value: {
isNotEmpty: inputElements[0].value !== "",
content: new Date(inputElements[0].value).getTime()
}
});
@ -73,6 +74,7 @@ export const bindDateEvent = (options: {
data: options.data,
protyle: options.protyle,
value: {
isNotEmpty2: inputElements[1].value !== "",
content2: new Date(inputElements[1].value).getTime()
}
});
@ -99,11 +101,7 @@ export const setDateValue = (options: {
cellElements: HTMLElement[],
data: IAV
protyle: IProtyle,
value: {
content?: number,
content2?: number,
hasEndDate?: boolean
}
value: IAVCellDateValue
}) => {
let cellIndex = 0;
Array.from(options.cellElements[0].parentElement.querySelectorAll(".av__cell")).find((item: HTMLElement, index) => {

View file

@ -11,7 +11,7 @@ export const getDefaultOperatorByType = (type: TAVCol) => {
if (type === "number" || type === "select") {
return "=";
}
if (type === "text" || type === "mSelect" || type === "url") {
if (["text", "mSelect", "url", "block"].includes(type)) {
return "Contains";
}
};
@ -133,6 +133,7 @@ export const setFilter = (options: {
}
});
switch (colData.type) {
case "block":
case "text":
case "url":
selectHTML = `<option ${"=" === options.filter.operator ? "selected" : ""} value="=">${window.siyuan.languages.filterOperatorIs}</option>
@ -208,7 +209,7 @@ export const setFilter = (options: {
}
});
});
} else if (colData.type === "text" || colData.type === "url") {
} else if (["text", "url", "block"].includes(colData.type)) {
menu.addItem({
iconHTML: "",
label: `<input style="margin: 4px 0" value="${options.filter.value?.text.content || ""}" class="b3-text-field fn__size200">`

View file

@ -621,8 +621,10 @@ export const openMenuPanel = (options: {
data,
protyle: options.protyle,
value: {
content: 0,
content2: 0,
isNotEmpty2: false,
isNotEmpty: false,
content: null,
content2: null,
hasEndDate: false
}
});

View file

@ -937,8 +937,8 @@ interface IAVCellValue {
interface IAVCellDateValue {
content?: number,
isNotEmpty: boolean
isNotEmpty?: boolean
content2?: number,
isNotEmpty2: boolean
isNotEmpty2?: boolean
hasEndDate?: boolean
}