|
@@ -7,7 +7,8 @@ import { coordinate } from "../Coordinate";
|
|
|
|
|
|
export default class Change {
|
|
export default class Change {
|
|
constructor() {
|
|
constructor() {
|
|
- this.lastData = {}; // 每次都是当前数据和lastData进行比较,一般在mouseDown的时候存储进来
|
|
|
|
|
|
+ this.lastData = {
|
|
|
|
+ }; // 每次都是当前数据和lastData进行比较,一般在mouseDown的时候存储进来
|
|
this.elements = {}; // 当前的变化
|
|
this.elements = {}; // 当前的变化
|
|
}
|
|
}
|
|
|
|
|
|
@@ -249,8 +250,10 @@ export default class Change {
|
|
const cells = floorplanService.getCells();
|
|
const cells = floorplanService.getCells();
|
|
|
|
|
|
for (const key in cells) {
|
|
for (const key in cells) {
|
|
|
|
+ console.log('compareCells', key, cells);
|
|
const cell = cells[key];
|
|
const cell = cells[key];
|
|
- const lastCell = this.lastData.cells[key];
|
|
|
|
|
|
+ console.log('compareCells', cell, this.lastData);
|
|
|
|
+ const lastCell = this.lastData.cells && this.lastData.cells[key] || undefined;
|
|
// 不存在意味着增加
|
|
// 不存在意味着增加
|
|
if (!lastCell) {
|
|
if (!lastCell) {
|
|
const item = {
|
|
const item = {
|
|
@@ -530,7 +533,7 @@ export default class Change {
|
|
this.elements.title = null;
|
|
this.elements.title = null;
|
|
const title = floorplanService.getTitle();
|
|
const title = floorplanService.getTitle();
|
|
const lastTitle = this.lastData.title;
|
|
const lastTitle = this.lastData.title;
|
|
-
|
|
|
|
|
|
+ console.log('compareTitle', title, lastTitle);
|
|
const flag = historyUtil.isDifferentForTitle(title, lastTitle);
|
|
const flag = historyUtil.isDifferentForTitle(title, lastTitle);
|
|
if (flag) {
|
|
if (flag) {
|
|
const item = {
|
|
const item = {
|