增加了一个初始化过程中的出错声明
This commit is contained in:
parent
003c09cdd2
commit
0da1c9cac4
|
|
@ -70,8 +70,12 @@ export default class TreeStore extends CascadeStore {
|
|||
resetInitialData(data, stat) {
|
||||
this.store = {};
|
||||
const now = Date.now();
|
||||
const schema = this.getSchema();
|
||||
for (const entity in data) {
|
||||
const { attributes } = this.getSchema()[entity];
|
||||
if (!schema[entity]) {
|
||||
throw new Error(`reset unknown entity:[${entity}]`);
|
||||
}
|
||||
const { attributes } = schema[entity];
|
||||
this.store[entity] = {};
|
||||
for (const row of data[entity]) {
|
||||
for (const key in attributes) {
|
||||
|
|
|
|||
|
|
@ -72,8 +72,12 @@ class TreeStore extends CascadeStore_1.CascadeStore {
|
|||
resetInitialData(data, stat) {
|
||||
this.store = {};
|
||||
const now = Date.now();
|
||||
const schema = this.getSchema();
|
||||
for (const entity in data) {
|
||||
const { attributes } = this.getSchema()[entity];
|
||||
if (!schema[entity]) {
|
||||
throw new Error(`reset unknown entity:[${entity}]`);
|
||||
}
|
||||
const { attributes } = schema[entity];
|
||||
this.store[entity] = {};
|
||||
for (const row of data[entity]) {
|
||||
for (const key in attributes) {
|
||||
|
|
|
|||
|
|
@ -134,8 +134,12 @@ export default class TreeStore<ED extends EntityDict & BaseEntityDict> extends C
|
|||
}) {
|
||||
this.store = {};
|
||||
const now = Date.now();
|
||||
const schema = this.getSchema();
|
||||
for (const entity in data) {
|
||||
const { attributes } = this.getSchema()[entity];
|
||||
if (!schema[entity]) {
|
||||
throw new Error(`reset unknown entity:[${entity as string}]`);
|
||||
}
|
||||
const { attributes } = schema[entity];
|
||||
this.store[entity] = {};
|
||||
for (const row of data[entity]!) {
|
||||
for (const key in attributes) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue