Browse Source

[修正] 数量修正

master
徐振升 4 years ago
parent
commit
2ed2251b20
  1. 12
      src/app/canvas-share-data.service.ts

12
src/app/canvas-share-data.service.ts

@ -166,15 +166,15 @@ export class CanvasShareDataService {
if (element != null) {
let data = JSON.parse(element.data);
// console.log(data.DefinedIncrement);
// console.log(data.Increment);
// console.log(data.Stock);
console.log(data.DefinedIncrement);
console.log(data.Increment);
console.log(data.Stock);
Object.keys(data.DefinedIncrement).forEach(key => {
let name = data.DefinedIncrement[key].Name;
if (this.types.includes(name)) {
if (cars.get(name) === undefined) {
cars.set(name, 0);
cars.set(name, 1);
} else {
cars.set(name, cars.get(name) + 1);
}
@ -184,7 +184,7 @@ export class CanvasShareDataService {
let name = data.Increment[key].Name;
if (this.types.includes(name)) {
if (cars.get(name) === undefined) {
cars.set(name, 0);
cars.set(name, 1);
} else {
cars.set(name, cars.get(name) + 1);
}
@ -194,7 +194,7 @@ export class CanvasShareDataService {
let name = data.Stock[key].Name;
if (this.types.includes(name)) {
if (cars.get(name) === undefined) {
cars.set(name, 0);
cars.set(name, 1);
} else {
cars.set(name, cars.get(name) + 1);
}

Loading…
Cancel
Save