ftdsy-attr 2.1.1 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ftdsy-attr.cjs.js +17878 -1
- package/dist/ftdsy-attr.cjs.js.map +1 -1
- package/dist/ftdsy-attr.d.ts +15 -11
- package/dist/ftdsy-attr.esm.mjs +17858 -0
- package/dist/ftdsy-attr.esm.mjs.map +1 -0
- package/package.json +13 -9
- package/dist/ftdsy-attr.esm.js +0 -2
- package/dist/ftdsy-attr.esm.js.map +0 -1
- package/dist/index.html +0 -845
- package/dist/types/api/tb/index.d.ts +0 -3
- package/dist/types/category/bags/bags_leather.d.ts +0 -16
- package/dist/types/category/bags/bags_motion.d.ts +0 -16
- package/dist/types/category/clothing/clothing_accessory.d.ts +0 -16
- package/dist/types/category/clothing/clothing_children.d.ts +0 -16
- package/dist/types/category/clothing/clothing_jewelry.d.ts +0 -16
- package/dist/types/category/clothing/clothing_men.d.ts +0 -16
- package/dist/types/category/clothing/clothing_motion.d.ts +0 -16
- package/dist/types/category/clothing/clothing_underwear.d.ts +0 -16
- package/dist/types/category/clothing/clothing_women.d.ts +0 -16
- package/dist/types/category/departmentStore/departmentStore_bedding.d.ts +0 -16
- package/dist/types/category/departmentStore/departmentStore_commodity.d.ts +0 -17
- package/dist/types/category/departmentStore/departmentStore_flower.d.ts +0 -16
- package/dist/types/category/departmentStore/departmentStore_holidaysupplies.d.ts +0 -17
- package/dist/types/category/departmentStore/departmentStore_homefabric.d.ts +0 -16
- package/dist/types/category/departmentStore/departmentStore_petanimal.d.ts +0 -16
- package/dist/types/category/departmentStore/departmentStore_storage.d.ts +0 -16
- package/dist/types/category/departmentStore/departmentStore_tableware.d.ts +0 -17
- package/dist/types/category/index.d.ts +0 -7
- package/dist/types/category/motherBaby/motherBaby_bady.d.ts +0 -16
- package/dist/types/category/motherBaby/motherBaby_gravida.d.ts +0 -16
- package/dist/types/category/numeral/numeral_accessory.d.ts +0 -16
- package/dist/types/category/numeral/numeral_camera.d.ts +0 -16
- package/dist/types/category/numeral/numeral_computer.d.ts +0 -16
- package/dist/types/category/numeral/numeral_game.d.ts +0 -17
- package/dist/types/category/numeral/numeral_smart.d.ts +0 -17
- package/dist/types/category/shoes/shoes_children.d.ts +0 -16
- package/dist/types/category/shoes/shoes_men.d.ts +0 -16
- package/dist/types/category/shoes/shoes_motion.d.ts +0 -16
- package/dist/types/category/shoes/shoes_women.d.ts +0 -16
- package/dist/types/category/sportsOutdoor/sportsOutdoor_outdoors.d.ts +0 -16
- package/dist/types/category/sportsOutdoor/sportsOutdoor_sports.d.ts +0 -16
- package/dist/types/category/type.d.ts +0 -18
- package/dist/types/category/vehicle/vehicle_cycling.d.ts +0 -16
- package/dist/types/category/vehicle/vehicle_electricvehicle.d.ts +0 -16
- package/dist/types/category/vehicle/vehicle_motorcycle.d.ts +0 -16
- package/dist/types/main.d.ts +0 -42
- package/dist/types/models/defaultModel.d.ts +0 -16
- package/dist/types/models/index.d.ts +0 -4
- package/dist/types/models/modal.d.ts +0 -11
- package/dist/types/platform/albb.d.ts +0 -6
- package/dist/types/platform/albb.type.d.ts +0 -27
- package/dist/types/platform/dy.d.ts +0 -3
- package/dist/types/platform/dy.type.d.ts +0 -48
- package/dist/types/platform/jd.d.ts +0 -3
- package/dist/types/platform/jd.type.d.ts +0 -30
- package/dist/types/platform/ks.d.ts +0 -3
- package/dist/types/platform/ks.type.d.ts +0 -41
- package/dist/types/platform/pdd.d.ts +0 -6
- package/dist/types/platform/pdd.type.d.ts +0 -28
- package/dist/types/platform/shopee.d.ts +0 -6
- package/dist/types/platform/shopee.type.d.ts +0 -28
- package/dist/types/platform/tb.d.ts +0 -7
- package/dist/types/platform/tb.type.d.ts +0 -63
- package/dist/types/platform/tiktok.d.ts +0 -6
- package/dist/types/platform/tiktok.type.d.ts +0 -1
- package/dist/types/platform/tm.d.ts +0 -5
- package/dist/types/platform/tm.type.d.ts +0 -1
- package/dist/types/platform/wxsph.d.ts +0 -6
- package/dist/types/platform/wxsph.type.d.ts +0 -9
- package/dist/types/platform/xhs.d.ts +0 -6
- package/dist/types/platform/xhs.type.d.ts +0 -16
- package/dist/types/property/index.d.ts +0 -10
- package/dist/types/property/matchProperty.d.ts +0 -6
- package/dist/types/property/perpareProperty.d.ts +0 -9
- package/dist/types/property/predictionProperty.d.ts +0 -8
- package/dist/types/property/type.d.ts +0 -69
- package/dist/types/type.d.ts +0 -67
- package/dist/types/utils/axios.d.ts +0 -15
- package/dist/types/utils/error.d.ts +0 -12
- package/dist/types/utils/is/index.d.ts +0 -23
- package/dist/types/utils/utils.d.ts +0 -34
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { MatchInfo, MatchAttr } from "@/property/type";
|
|
2
|
-
export declare function getAttrDefaultValue(matchInfo: MatchInfo, propertyItem: MatchAttr): any;
|
|
3
|
-
export declare function attrSimilarity(attr_name1: string, attr_name2: string): number;
|
|
4
|
-
export declare function attrValueSimilarity(attr: string, attr_value1: string, attr_value2: string, min_similarity?: number): number;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export type DataSource = {
|
|
2
|
-
value: string;
|
|
3
|
-
text: string;
|
|
4
|
-
help?: string;
|
|
5
|
-
};
|
|
6
|
-
export type AlbbAttr = {
|
|
7
|
-
propertyId: string;
|
|
8
|
-
name: string;
|
|
9
|
-
label: string;
|
|
10
|
-
uiType: string;
|
|
11
|
-
required: boolean;
|
|
12
|
-
propType: string;
|
|
13
|
-
maxCustomItems: number;
|
|
14
|
-
maxItems: number;
|
|
15
|
-
maxLength: number;
|
|
16
|
-
supportLevelProp: boolean;
|
|
17
|
-
useAiAgent: boolean;
|
|
18
|
-
fieldType: string;
|
|
19
|
-
dataSource?: DataSource[];
|
|
20
|
-
asyncCheck: boolean;
|
|
21
|
-
customizable?: boolean;
|
|
22
|
-
supportValueSearch?: boolean;
|
|
23
|
-
unit: string;
|
|
24
|
-
async?: {
|
|
25
|
-
childPropUrl?: string;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
export type Option = {
|
|
2
|
-
name: string;
|
|
3
|
-
sequence: number;
|
|
4
|
-
value: string;
|
|
5
|
-
value_id: number;
|
|
6
|
-
};
|
|
7
|
-
export type ValueModules = {
|
|
8
|
-
input_type: string;
|
|
9
|
-
module_id: number;
|
|
10
|
-
prefix: string;
|
|
11
|
-
suffix: string;
|
|
12
|
-
units: [];
|
|
13
|
-
validate_rule: {
|
|
14
|
-
data_type: string;
|
|
15
|
-
max: number;
|
|
16
|
-
min: number;
|
|
17
|
-
precision: number;
|
|
18
|
-
time_format: string;
|
|
19
|
-
unit_rules: [];
|
|
20
|
-
};
|
|
21
|
-
value_required: boolean;
|
|
22
|
-
values: {
|
|
23
|
-
value_name: string;
|
|
24
|
-
}[];
|
|
25
|
-
};
|
|
26
|
-
export type Measure = {
|
|
27
|
-
display_name: string;
|
|
28
|
-
template_id: number;
|
|
29
|
-
value_modules: ValueModules[];
|
|
30
|
-
};
|
|
31
|
-
export type DyAttr = {
|
|
32
|
-
category_id: number;
|
|
33
|
-
cid: number;
|
|
34
|
-
diy_type: 0 | 1;
|
|
35
|
-
has_sub_property: boolean;
|
|
36
|
-
important_type: 0 | 1;
|
|
37
|
-
measure_templates: Measure[];
|
|
38
|
-
multi_select_max: number;
|
|
39
|
-
options: Option[];
|
|
40
|
-
property_id: number;
|
|
41
|
-
property_name: string;
|
|
42
|
-
property_type: number;
|
|
43
|
-
relation_id: number;
|
|
44
|
-
required: 0 | 1;
|
|
45
|
-
sequence: number;
|
|
46
|
-
status: number;
|
|
47
|
-
type: 'select' | 'multi_select' | 'text' | 'multi_value_measure' | 'measure';
|
|
48
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export type AttrValue = {
|
|
2
|
-
attId: number;
|
|
3
|
-
catId: number;
|
|
4
|
-
features: {
|
|
5
|
-
key: string;
|
|
6
|
-
fvalue: string;
|
|
7
|
-
}[];
|
|
8
|
-
id: number;
|
|
9
|
-
name: string;
|
|
10
|
-
orderSort: number;
|
|
11
|
-
};
|
|
12
|
-
export type Feature = {
|
|
13
|
-
cn: null;
|
|
14
|
-
fvalue: string;
|
|
15
|
-
key: string;
|
|
16
|
-
};
|
|
17
|
-
export type JdAttr = {
|
|
18
|
-
attrGroup: null;
|
|
19
|
-
attrValueList: AttrValue[];
|
|
20
|
-
attributeType: number;
|
|
21
|
-
catId: number;
|
|
22
|
-
features: Feature[];
|
|
23
|
-
graphic: string;
|
|
24
|
-
id: number;
|
|
25
|
-
inputType: number;
|
|
26
|
-
isRequired: boolean;
|
|
27
|
-
name: string;
|
|
28
|
-
orderSort: 1;
|
|
29
|
-
originCategoryId: null | number;
|
|
30
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
type InputFormatConfig = {
|
|
2
|
-
patternList: string[];
|
|
3
|
-
useLimit: boolean;
|
|
4
|
-
max: number;
|
|
5
|
-
min: number;
|
|
6
|
-
message: string;
|
|
7
|
-
};
|
|
8
|
-
type ImageInputConfig = {
|
|
9
|
-
minCount: number;
|
|
10
|
-
maxCount: number;
|
|
11
|
-
minWidth: number;
|
|
12
|
-
minHeight: number;
|
|
13
|
-
};
|
|
14
|
-
type PropInputConfig = {
|
|
15
|
-
dateInputConfig: null;
|
|
16
|
-
inputFormatConfig: InputFormatConfig | null;
|
|
17
|
-
imageInputConfig: ImageInputConfig | null;
|
|
18
|
-
};
|
|
19
|
-
export type Option = {
|
|
20
|
-
propValueId: number;
|
|
21
|
-
propValue: string;
|
|
22
|
-
};
|
|
23
|
-
export type UnitPropValue = {
|
|
24
|
-
unitPropValueId: string;
|
|
25
|
-
unitPropValueName: string;
|
|
26
|
-
};
|
|
27
|
-
export type KsAttr = {
|
|
28
|
-
propId: string;
|
|
29
|
-
propName: string;
|
|
30
|
-
preConstraint: boolean;
|
|
31
|
-
prePropValues: any[];
|
|
32
|
-
required: boolean;
|
|
33
|
-
propValueMaximum: number;
|
|
34
|
-
sortNum: number;
|
|
35
|
-
propInputConfig: PropInputConfig | null;
|
|
36
|
-
propInputType: string;
|
|
37
|
-
unitProp: UnitPropValue[];
|
|
38
|
-
customInput: boolean;
|
|
39
|
-
options: Option[];
|
|
40
|
-
};
|
|
41
|
-
export {};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export type Value = {
|
|
2
|
-
vid: number;
|
|
3
|
-
value: string;
|
|
4
|
-
parent_value: string[];
|
|
5
|
-
};
|
|
6
|
-
export type Condition = {
|
|
7
|
-
parent_ref_pid: number;
|
|
8
|
-
parent_vids: number[];
|
|
9
|
-
};
|
|
10
|
-
export type PddAttr = {
|
|
11
|
-
can_note: boolean;
|
|
12
|
-
choose_max_num: number;
|
|
13
|
-
input_max_num: number;
|
|
14
|
-
is_important: boolean;
|
|
15
|
-
is_sale: boolean;
|
|
16
|
-
is_sku: boolean;
|
|
17
|
-
max_value: string;
|
|
18
|
-
min_value: string;
|
|
19
|
-
name: string;
|
|
20
|
-
property_value_type: number;
|
|
21
|
-
ref_pid: number;
|
|
22
|
-
required: boolean;
|
|
23
|
-
required_rule_type: number;
|
|
24
|
-
show_condition: Condition[];
|
|
25
|
-
value_precision: number;
|
|
26
|
-
value_unit: string[];
|
|
27
|
-
values: Value[];
|
|
28
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export type MultiLang = {
|
|
2
|
-
language: string;
|
|
3
|
-
value: string;
|
|
4
|
-
};
|
|
5
|
-
export type AttributeValue = {
|
|
6
|
-
value_id: number;
|
|
7
|
-
name: string;
|
|
8
|
-
multi_lang?: MultiLang[];
|
|
9
|
-
child_attribute_list?: ShopeeAttr[];
|
|
10
|
-
};
|
|
11
|
-
export type AttributeInfo = {
|
|
12
|
-
input_type: number;
|
|
13
|
-
input_validation_type: number;
|
|
14
|
-
format_type: number;
|
|
15
|
-
is_oem: boolean;
|
|
16
|
-
support_search_value: boolean;
|
|
17
|
-
max_value_count?: number;
|
|
18
|
-
mandatory_region?: string[];
|
|
19
|
-
attribute_unit_list?: string[];
|
|
20
|
-
};
|
|
21
|
-
export type ShopeeAttr = {
|
|
22
|
-
attribute_id: number;
|
|
23
|
-
mandatory: boolean;
|
|
24
|
-
name: string;
|
|
25
|
-
attribute_value_list?: AttributeValue[];
|
|
26
|
-
multi_lang?: MultiLang[];
|
|
27
|
-
attribute_info: AttributeInfo;
|
|
28
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { DsyAttr } from "../type";
|
|
2
|
-
import type { TbAttr } from "./tb.type";
|
|
3
|
-
export declare const getOriginProperty: (type: string) => string;
|
|
4
|
-
/**
|
|
5
|
-
* 将淘宝属性列表 转换自定义属性列表,
|
|
6
|
-
* */
|
|
7
|
-
export declare function createCategoryProperties(categoryProperties: TbAttr[]): DsyAttr[] | null;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
export type Rule = {
|
|
2
|
-
exProperty?: string;
|
|
3
|
-
name: string;
|
|
4
|
-
unit?: string;
|
|
5
|
-
value: string;
|
|
6
|
-
};
|
|
7
|
-
export type Option = {
|
|
8
|
-
displayName: string;
|
|
9
|
-
value: string;
|
|
10
|
-
};
|
|
11
|
-
export type Format = {
|
|
12
|
-
placeholder: string;
|
|
13
|
-
type: string;
|
|
14
|
-
text?: string;
|
|
15
|
-
};
|
|
16
|
-
export type UnitName = {
|
|
17
|
-
value: string;
|
|
18
|
-
};
|
|
19
|
-
export type Property = {
|
|
20
|
-
formats: {
|
|
21
|
-
format: Format | Format[];
|
|
22
|
-
};
|
|
23
|
-
key: string;
|
|
24
|
-
precision: {
|
|
25
|
-
name: string;
|
|
26
|
-
value: string;
|
|
27
|
-
};
|
|
28
|
-
taoSirType: {
|
|
29
|
-
value: string;
|
|
30
|
-
};
|
|
31
|
-
tip: {
|
|
32
|
-
value: string;
|
|
33
|
-
};
|
|
34
|
-
type: string;
|
|
35
|
-
unitNames: {
|
|
36
|
-
unitName: UnitName | UnitName[];
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
export type Field = {
|
|
40
|
-
id: string;
|
|
41
|
-
name: string;
|
|
42
|
-
options: {
|
|
43
|
-
option: Option[];
|
|
44
|
-
};
|
|
45
|
-
type: string;
|
|
46
|
-
};
|
|
47
|
-
export type TbAttr = {
|
|
48
|
-
id: string;
|
|
49
|
-
name: string;
|
|
50
|
-
rules: {
|
|
51
|
-
rule: Rule | Rule[];
|
|
52
|
-
};
|
|
53
|
-
options: {
|
|
54
|
-
option: Option[];
|
|
55
|
-
};
|
|
56
|
-
properties: {
|
|
57
|
-
property: Property;
|
|
58
|
-
};
|
|
59
|
-
fields: {
|
|
60
|
-
field: Field | Field[];
|
|
61
|
-
};
|
|
62
|
-
type: 'singleCheck' | 'multiCheck' | 'input' | 'multiComplex';
|
|
63
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type TiktokAttr = {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type TmAttr = {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export type AttributeValue = {
|
|
2
|
-
valueId: string;
|
|
3
|
-
valueName: string;
|
|
4
|
-
};
|
|
5
|
-
export type XhsAttr = {
|
|
6
|
-
id: string;
|
|
7
|
-
isRequired: boolean;
|
|
8
|
-
name: string;
|
|
9
|
-
enName: string;
|
|
10
|
-
acceptsImage: boolean;
|
|
11
|
-
isMulti: boolean;
|
|
12
|
-
inputType: number;
|
|
13
|
-
dataType: number;
|
|
14
|
-
customizable: boolean;
|
|
15
|
-
values_list: AttributeValue[];
|
|
16
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { DsyAttr, DsyAttrWithValue, goodsAttr } from "@/type";
|
|
2
|
-
import type { MatchInfo, MatchGoods } from "./type";
|
|
3
|
-
declare const _default: {
|
|
4
|
-
matchPropertiesValue: typeof matchPropertiesValue;
|
|
5
|
-
};
|
|
6
|
-
export default _default;
|
|
7
|
-
/**
|
|
8
|
-
* 匹配属性值
|
|
9
|
-
* */
|
|
10
|
-
declare function matchPropertiesValue(matchInfo: MatchInfo, properties: DsyAttr[], attrs?: goodsAttr[], goods?: MatchGoods): Promise<DsyAttrWithValue[]>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { MatchInfo, MatchGoods, MatchAttr } from "./type";
|
|
2
|
-
/**
|
|
3
|
-
* 预测属性值
|
|
4
|
-
*
|
|
5
|
-
* 1.优先根据已有信息进行填写(标题,备注,货号等)
|
|
6
|
-
* 2.再设置默认值(使用默认值表)
|
|
7
|
-
* */
|
|
8
|
-
export declare function predictionPropertyItem(matchInfo: MatchInfo, propertyItem: MatchAttr, selectAttrs: string, goods: MatchGoods): void;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import type { DsyAttr, Pt, PropertyComponent } from "../type";
|
|
2
|
-
export type MatchInfo = {
|
|
3
|
-
cate_id: string;
|
|
4
|
-
cate_path: string;
|
|
5
|
-
platform: Pt;
|
|
6
|
-
is_prediction: boolean;
|
|
7
|
-
is_required_force: boolean;
|
|
8
|
-
is_other_force: boolean;
|
|
9
|
-
};
|
|
10
|
-
export type MatchGoods = {
|
|
11
|
-
title?: string;
|
|
12
|
-
goods_sn?: string;
|
|
13
|
-
ccc_code?: string;
|
|
14
|
-
remark?: string;
|
|
15
|
-
specs?: MatchGoodsSpec[];
|
|
16
|
-
};
|
|
17
|
-
export type MatchGoodsSpec = {
|
|
18
|
-
spec_id: string;
|
|
19
|
-
spec_name: string;
|
|
20
|
-
is_upload_image: number;
|
|
21
|
-
list: MatchGoodsSpecValue[];
|
|
22
|
-
};
|
|
23
|
-
export type MatchGoodsSpecValue = {
|
|
24
|
-
value_id: string;
|
|
25
|
-
value: string;
|
|
26
|
-
};
|
|
27
|
-
export type MatchAttr = DsyAttr & {
|
|
28
|
-
show: boolean;
|
|
29
|
-
property_value?: number | string | MatchSelectOption[] | MatchSelectOption;
|
|
30
|
-
select_values: MatchSelectOption[];
|
|
31
|
-
select_max_num?: number;
|
|
32
|
-
input_values: MatchInputOption[];
|
|
33
|
-
input_units?: string[];
|
|
34
|
-
input_operator?: string;
|
|
35
|
-
date_format?: string;
|
|
36
|
-
};
|
|
37
|
-
export type MatchSelectOption = {
|
|
38
|
-
name: string;
|
|
39
|
-
value_id: string;
|
|
40
|
-
value: string;
|
|
41
|
-
parent_value?: string[];
|
|
42
|
-
value_path?: string;
|
|
43
|
-
disableContent?: boolean;
|
|
44
|
-
content?: number;
|
|
45
|
-
similarity?: number;
|
|
46
|
-
};
|
|
47
|
-
export type MatchInputOption = PropertyComponent & {
|
|
48
|
-
value: string;
|
|
49
|
-
};
|
|
50
|
-
export interface PropertiesData {
|
|
51
|
-
list: MatchAttr[];
|
|
52
|
-
require_total: number;
|
|
53
|
-
require_count: number;
|
|
54
|
-
required_list: MatchAttr[];
|
|
55
|
-
other_list: MatchAttr[];
|
|
56
|
-
children_list: MatchAttr[];
|
|
57
|
-
brand_property: MatchAttr;
|
|
58
|
-
material_quality_property: MatchAttr;
|
|
59
|
-
}
|
|
60
|
-
export interface MaterialInfo {
|
|
61
|
-
material: string;
|
|
62
|
-
percentage: number;
|
|
63
|
-
}
|
|
64
|
-
export type PercentageRange = {
|
|
65
|
-
min: number | null;
|
|
66
|
-
max: number | null;
|
|
67
|
-
includeMin: boolean;
|
|
68
|
-
includeMax: boolean;
|
|
69
|
-
};
|
package/dist/types/type.d.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
export type Pt = 'pdd' | 'tb' | 'jd' | 'dy' | 'shopee' | 'xhs' | 'ks' | 'dsy' | 'albb' | 'shopeebt' | 'tgc' | 'wxsph' | 'tiktok' | 'tm' | 'tiktokUs';
|
|
2
|
-
export type PropertyType = 'unknown' | 'input' | 'singleSelect' | 'multiSelect' | 'treeSingleSelect' | 'inputComponent' | 'multiComplex' | 'date' | 'image';
|
|
3
|
-
export type RuleName = 'requiredRule' | 'maxLengthRule' | 'valueTypeRule' | 'maxItemsRule' | 'format' | 'regexRule';
|
|
4
|
-
export type ComponentType = 'input' | 'unit' | 'select';
|
|
5
|
-
export type goodsAttr = {
|
|
6
|
-
id?: string;
|
|
7
|
-
attr_name: string;
|
|
8
|
-
value: string | string[];
|
|
9
|
-
value_id?: string | string[];
|
|
10
|
-
};
|
|
11
|
-
export type propertyOption = {
|
|
12
|
-
label: string;
|
|
13
|
-
value: string;
|
|
14
|
-
parent_value?: string[];
|
|
15
|
-
value_path?: string;
|
|
16
|
-
value_ids_path?: string[];
|
|
17
|
-
children?: propertyOption[];
|
|
18
|
-
};
|
|
19
|
-
export type PropertyComponent = {
|
|
20
|
-
type: string;
|
|
21
|
-
name?: string;
|
|
22
|
-
placeholder?: string;
|
|
23
|
-
options: propertyOption[];
|
|
24
|
-
text?: string;
|
|
25
|
-
precision?: number;
|
|
26
|
-
};
|
|
27
|
-
export type Rule = {
|
|
28
|
-
name: RuleName;
|
|
29
|
-
value: string;
|
|
30
|
-
exProperty?: string;
|
|
31
|
-
};
|
|
32
|
-
export type DsyAttr = {
|
|
33
|
-
property_id: string;
|
|
34
|
-
property_required: boolean;
|
|
35
|
-
property_name: string;
|
|
36
|
-
property_type: PropertyType;
|
|
37
|
-
property_values: propertyOption[];
|
|
38
|
-
property_component?: PropertyComponent[];
|
|
39
|
-
property_tips?: string;
|
|
40
|
-
rules: Rule[];
|
|
41
|
-
has_children: boolean;
|
|
42
|
-
select_custom?: boolean;
|
|
43
|
-
show_condition?: Condition[];
|
|
44
|
-
measure_templates?: any;
|
|
45
|
-
isCStore?: boolean;
|
|
46
|
-
};
|
|
47
|
-
export type Condition = {
|
|
48
|
-
parent_id: string;
|
|
49
|
-
parent_value_ids: string[];
|
|
50
|
-
};
|
|
51
|
-
export type DsyAttrValue = {
|
|
52
|
-
valueId: string | string[];
|
|
53
|
-
value: string | string[];
|
|
54
|
-
};
|
|
55
|
-
export type DsyAttrWithValue = DsyAttr & DsyAttrValue;
|
|
56
|
-
export type MatchDatas = {
|
|
57
|
-
cate_id: string | number;
|
|
58
|
-
cate_path: string | string[];
|
|
59
|
-
platform: string;
|
|
60
|
-
properties: any[];
|
|
61
|
-
attrs?: any[];
|
|
62
|
-
title?: string;
|
|
63
|
-
goods_sn?: string;
|
|
64
|
-
ccc_code?: string;
|
|
65
|
-
remark?: string;
|
|
66
|
-
specs?: any;
|
|
67
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type AxiosRequestConfig } from 'axios';
|
|
2
|
-
type Config = {
|
|
3
|
-
maxRetries?: number;
|
|
4
|
-
retryDelay?: number;
|
|
5
|
-
};
|
|
6
|
-
export type Response<T> = {
|
|
7
|
-
code: number;
|
|
8
|
-
status: number;
|
|
9
|
-
msg?: string;
|
|
10
|
-
data: T;
|
|
11
|
-
};
|
|
12
|
-
export declare const fetchWithRetry: <T>(opt: AxiosRequestConfig, config?: Config) => Promise<T | undefined>;
|
|
13
|
-
export type UrlType = 'base' | 'tbApi' | 'dySupplier' | 'image';
|
|
14
|
-
export declare const fullUrl: (url: string, type?: UrlType) => string;
|
|
15
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export declare function is(val: unknown, type: string): boolean;
|
|
2
|
-
export declare function isDef<T = unknown>(val?: T): val is T;
|
|
3
|
-
export declare function isUnDef<T = unknown>(val?: T): val is T;
|
|
4
|
-
export declare function isObject(val: any): val is Record<any, any>;
|
|
5
|
-
export declare function isEmpty<T = unknown>(val: T): val is T;
|
|
6
|
-
export declare function isDate(val: unknown): val is Date;
|
|
7
|
-
export declare function isNull(val: unknown): val is null;
|
|
8
|
-
export declare function isNullAndUnDef(val: unknown): val is null | undefined;
|
|
9
|
-
export declare function isNullOrUnDef(val: unknown): val is null | undefined;
|
|
10
|
-
export declare function isNumber(val: unknown): val is number;
|
|
11
|
-
export declare function isPromise<T = any>(val: unknown): val is Promise<T>;
|
|
12
|
-
export declare function isString(val: unknown): val is string;
|
|
13
|
-
export declare function isFunction(val: unknown): val is Function;
|
|
14
|
-
export declare function isAsyncFunction(val: unknown): val is Function;
|
|
15
|
-
export declare function isBoolean(val: unknown): val is boolean;
|
|
16
|
-
export declare function isRegExp(val: unknown): val is RegExp;
|
|
17
|
-
export declare function isArray(val: any): val is Array<any>;
|
|
18
|
-
export declare function isWindow(val: any): val is Window;
|
|
19
|
-
export declare function isElement(val: unknown): val is Element;
|
|
20
|
-
export declare function isMap(val: unknown): val is Map<any, any>;
|
|
21
|
-
export declare const isServer: boolean;
|
|
22
|
-
export declare const isClient: boolean;
|
|
23
|
-
export declare function isUrl(path: string): boolean;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 检测值是否为空值,true: 已选,false: 未选
|
|
3
|
-
* */
|
|
4
|
-
export declare function checkValue(value: unknown): boolean;
|
|
5
|
-
/**
|
|
6
|
-
* 获取2个字符串的相似度
|
|
7
|
-
* @param {string} str1 字符串1
|
|
8
|
-
* @param {string} str2 字符串2
|
|
9
|
-
* @returns {number} 相似度
|
|
10
|
-
*/
|
|
11
|
-
export declare function getStringSimilarity(str1: string, str2: string): number;
|
|
12
|
-
/**
|
|
13
|
-
* 判断字符串中是否包含某些字符
|
|
14
|
-
*
|
|
15
|
-
* @param {String} text 检测字符串
|
|
16
|
-
* @param {Array} arr 检测内容字符串数组
|
|
17
|
-
* @param {string} type 检测方式,includeOne:包含一个,includeAll:包含全部,默认为 includeOne
|
|
18
|
-
* */
|
|
19
|
-
export declare function isTextInclude(text: string, arr: string[], type?: string): boolean;
|
|
20
|
-
/**
|
|
21
|
-
* 获取文本长度
|
|
22
|
-
*
|
|
23
|
-
* @param {String} text 待检查的字符串
|
|
24
|
-
* @param {Number} max 当text不是字符时返回的数字
|
|
25
|
-
* */
|
|
26
|
-
export declare function getTextLength(text: string, max?: number): number;
|
|
27
|
-
export declare function getCurrentTime(cate_path?: string): {
|
|
28
|
-
year: number;
|
|
29
|
-
month: number;
|
|
30
|
-
day: number;
|
|
31
|
-
season: string;
|
|
32
|
-
lastSeason: string;
|
|
33
|
-
};
|
|
34
|
-
export declare function mathRandomNumber(num: number): number;
|