Vanessa 2024-01-28 00:08:41 +08:00
parent 76ac9912dc
commit fa4d66dcce
5 changed files with 145 additions and 23 deletions

View file

@ -130,6 +130,18 @@ export const genCellValue = (colType: TAVCol, value: string | any) => {
checked: true
}
};
} else if (colType === "date") {
cellValue = {
type: colType,
date: {
content: null,
isNotEmpty: false,
content2: null,
isNotEmpty2: false,
hasEndDate: false,
isNotTime: true,
}
};
}
} else if (typeof value === "undefined" || !value) {
if (colType === "number") {

View file

@ -23,6 +23,11 @@ export const avKeydown = (event: KeyboardEvent, nodeElement: HTMLElement, protyl
if (!rowElement) {
return false;
}
if (event.key === "Backspace" || event.key === "Delete") {
updateCellsValue(protyle, nodeElement, undefined, Array.from(nodeElement.querySelectorAll(".av__cell--active, .av__cell--select")));
event.preventDefault();
return true;
}
// 复制、粘贴
if (!event.ctrlKey && !event.metaKey) {
nodeElement.querySelectorAll(".av__cell--active").forEach(item => {
@ -41,11 +46,6 @@ export const avKeydown = (event: KeyboardEvent, nodeElement: HTMLElement, protyl
event.preventDefault();
return true;
}
if (event.key === "Backspace" || event.key === "Delete") {
updateCellsValue(protyle, nodeElement, undefined, [selectCellElement]);
event.preventDefault();
return true;
}
let newCellElement;
if (event.key === "ArrowLeft" || matchHotKey("⇧⇥", event)) {
const previousRowElement = rowElement.previousElementSibling;