mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-08 05:32:33 +01:00
This commit is contained in:
parent
9f792df41e
commit
1c45347de5
2 changed files with 11 additions and 3 deletions
|
|
@ -566,7 +566,7 @@ export const getSelectHTML = (data: IAVTable, cellElements: HTMLElement[], init
|
|||
</div>`;
|
||||
};
|
||||
|
||||
export const mergeAddOption = (column: IAVColumn, cellValue: IAVCellValue, avID:string) => {
|
||||
export const mergeAddOption = (column: IAVColumn, cellValue: IAVCellValue, avID: string) => {
|
||||
const doOperations: IOperation[] = [];
|
||||
const undoOperations: IOperation[] = [];
|
||||
cellValue.mSelect.forEach((item: IAVCellSelectValue) => {
|
||||
|
|
@ -580,15 +580,17 @@ export const mergeAddOption = (column: IAVColumn, cellValue: IAVCellValue, avID:
|
|||
}
|
||||
});
|
||||
if (!needAdd) {
|
||||
const newColor = ((column.options?.length || 0) % 13 + 1).toString()
|
||||
column.options.push({
|
||||
name: item.content,
|
||||
color:(column.options?.length || 0) % 13 + 1
|
||||
color: newColor
|
||||
});
|
||||
item.color = newColor;
|
||||
doOperations.push({
|
||||
action: "updateAttrViewColOptions",
|
||||
id: column.id,
|
||||
avID,
|
||||
data: column.options
|
||||
data: column.options
|
||||
})
|
||||
undoOperations.push({
|
||||
action: "removeAttrViewColOption",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue