mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-11 23:54:43 +08:00
Cache the values of formulas of HOT tables in meta data [SCI-8173] (#5406)
This commit is contained in:
parent
fc6f443b1e
commit
19cad569b3
1 changed files with 17 additions and 12 deletions
|
@ -162,18 +162,23 @@
|
||||||
update() {
|
update() {
|
||||||
this.element.attributes.orderable.contents = JSON.stringify({ data: this.tableObject.getData() });
|
this.element.attributes.orderable.contents = JSON.stringify({ data: this.tableObject.getData() });
|
||||||
this.element.attributes.orderable.metadata = JSON.stringify({
|
this.element.attributes.orderable.metadata = JSON.stringify({
|
||||||
cells: this.tableObject.getCellsMeta().map(
|
cells: this.tableObject
|
||||||
(x) => {
|
.getCellsMeta()
|
||||||
if (x) {
|
.filter(e => !!e)
|
||||||
return {
|
.map((x) => {
|
||||||
col: x.col,
|
const {row, col} = x;
|
||||||
row: x.row,
|
const plugins = this.tableObject.plugin;
|
||||||
className: x.className || ''
|
const cellId = plugins.utils.translateCellCoords({row, col});
|
||||||
}
|
const calculated = plugins.matrix.getItem(cellId)?.value ||
|
||||||
} else {
|
this.tableObject.getDataAtCell(row, col) ||
|
||||||
return null
|
null;
|
||||||
}
|
return {
|
||||||
}).filter(e => { return e !== null })
|
row: row,
|
||||||
|
col: col,
|
||||||
|
className: x.className || '',
|
||||||
|
calculated: calculated
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
this.$emit('update', this.element)
|
this.$emit('update', this.element)
|
||||||
this.ajax_update_url()
|
this.ajax_update_url()
|
||||||
|
|
Loading…
Add table
Reference in a new issue