@aliretail/react-materials-components
Version:
60 lines (59 loc) • 1.58 kB
TypeScript
export declare type TCodeList = string[];
export interface IGetAreaByCodeListResultItem {
code: string;
/**
* 层级
* 1 省 2 市 3 区,县 4 街道,镇,乡
*/
divLevel: 1 | 2 | 3 | 4;
isFullName: 1 | 2;
name: string;
state: 1 | 2;
parentCode?: string;
telCode?: string;
postCode?: string;
description?: string;
}
/**
* 根据 codeList 获取地区数据
*/
export declare const getAreaByCodeList: (appCode: string, apiCode: string, url: string, regionCodes?: TCodeList) => Promise<IGetAreaByCodeListResultItem[]>;
export interface IGetAreaByCodeResultItem {
code: string;
/**
* 层级
* 1 省 2 市 3 区,县 4 街道,镇,乡
*/
divLevel: 1 | 2 | 3 | 4;
isFullName: 1 | 2;
name: string;
state: 1 | 2;
covered: boolean;
isLeaf: boolean;
tips: string;
}
/**
* 根据 code 获取地区数据
*/
export declare const getAreaByCode: (appCode: string, apiCode: string, url: string, code?: string) => Promise<IGetAreaByCodeResultItem[]>;
export interface ITableValue {
area: ITableAreaItem;
province: ITableAreaItem;
city: ITableAreaItem;
street: ITableAreaItem;
}
interface ITableAreaItem {
value: string;
frags: {
color: string;
value: string;
}[];
}
/**
* 根据 code 获取地区数据
*/
export declare const getTableDataByCodeList: (appCode: string, apiCode: string, url: string, data: {
currentSelectedRegionCode: TCodeList;
lastSelectedRegionCode?: TCodeList;
}) => Promise<ITableValue[]>;
export {};