id转number补充调整
This commit is contained in:
parent
b91c31f713
commit
1db5125454
@ -35,13 +35,13 @@ export interface GraphicQueryStore {
|
||||
* 根据id或code查询图形
|
||||
* @param v
|
||||
*/
|
||||
queryByIdOrCode(v: string): JlGraphic[];
|
||||
queryByIdOrCode(v: string | number): JlGraphic[];
|
||||
/**
|
||||
* 根据id或code及类型查询图形
|
||||
* @param v
|
||||
* @param type
|
||||
*/
|
||||
queryByIdOrCodeAndType(v: string, type: string): JlGraphic[];
|
||||
queryByIdOrCodeAndType(v: string | number, type: string): JlGraphic[];
|
||||
/**
|
||||
* 根据code和类型获取图形
|
||||
* @param code
|
||||
@ -120,7 +120,7 @@ export class GraphicStore implements GraphicQueryStore {
|
||||
});
|
||||
return list;
|
||||
}
|
||||
queryByIdOrCode(s: string): JlGraphic[] {
|
||||
queryByIdOrCode(s: string | number): JlGraphic[] {
|
||||
const list: JlGraphic[] = [];
|
||||
this.store.forEach((g) => {
|
||||
if (g.isIdOrCode(s)) {
|
||||
@ -129,7 +129,7 @@ export class GraphicStore implements GraphicQueryStore {
|
||||
});
|
||||
return list;
|
||||
}
|
||||
queryByIdOrCodeAndType(s: string, type: string): JlGraphic[] {
|
||||
queryByIdOrCodeAndType(s: string | number, type: string): JlGraphic[] {
|
||||
const list: JlGraphic[] = [];
|
||||
this.store.forEach((g) => {
|
||||
if (g.isIdOrCode(s) && g.type === type) {
|
||||
|
@ -706,8 +706,8 @@ export abstract class JlGraphic extends Container {
|
||||
/**
|
||||
* 是否此对象id/code
|
||||
*/
|
||||
isIdOrCode(s: string): boolean {
|
||||
return this.id === +s || this.code === s;
|
||||
isIdOrCode(s: string | number): boolean {
|
||||
return this.id === s || this.code === s;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user