id转number补充调整

This commit is contained in:
fan 2023-12-12 16:54:02 +08:00
parent b91c31f713
commit 1db5125454
2 changed files with 6 additions and 6 deletions

View File

@ -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) {

View File

@ -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;
}
/**