ronds-metadata 1.2.83 → 1.2.85
Sign up to get free protection for your applications and to get access to all the features.
- package/es/comps/DynamicPorts/comps/DragNode.d.ts +1 -1
- package/es/comps/DynamicPorts/comps/NodeElement.d.ts +1 -1
- package/es/comps/DynamicPorts/comps/contextMenu/NodeContextMenu/index.d.ts +1 -2
- package/es/comps/DynamicPorts/index.d.ts +1 -2
- package/es/comps/Editable/DataCell/ButtonCell.d.ts +1 -1
- package/es/comps/Editable/DataCell/ColorPicker.d.ts +1 -1
- package/es/comps/Editable/DataCell/Input.d.ts +1 -1
- package/es/comps/Editable/DataCell/Number.d.ts +1 -1
- package/es/comps/Editable/DataCell/Select.d.ts +1 -1
- package/es/comps/Editable/DataCell/Switch.d.ts +1 -1
- package/es/comps/Editable/comps/EditableAction.d.ts +1 -2
- package/es/comps/Editable/comps/Texty.d.ts +1 -1
- package/es/comps/Editable/index.d.ts +1 -2
- package/es/comps/Editable/utils.d.ts +1 -2
- package/es/comps/FileView/index.d.ts +1 -2
- package/es/comps/FormGenerator/comps/Canvas/Preview.d.ts +1 -2
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Checkbox.d.ts +1 -2
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Color.d.ts +1 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Date.d.ts +1 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Input.d.ts +1 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/List.d.ts +1 -2
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/MutiSelect.d.ts +1 -2
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Number.d.ts +1 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/NumberRange.d.ts +1 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Obj.d.ts +1 -2
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Password.d.ts +1 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Radio.d.ts +1 -2
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Select.d.ts +1 -2
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Switch.d.ts +1 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Table.d.ts +1 -2
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/TextArea.d.ts +1 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Upload.d.ts +1 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/HOC/index.d.ts +1 -2
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/index.d.ts +1 -2
- package/es/comps/FormGenerator/comps/Canvas/core/index.d.ts +1 -1
- package/es/comps/FormGenerator/comps/Canvas/index.d.ts +1 -2
- package/es/comps/FormGenerator/comps/Settings/index.d.ts +1 -2
- package/es/comps/FormGenerator/comps/Sidebar/Elements.d.ts +1 -1
- package/es/comps/FormGenerator/comps/Sidebar/JsonSchema.d.ts +1 -1
- package/es/comps/FormGenerator/comps/Sidebar/index.d.ts +1 -2
- package/es/comps/FormGenerator/index.d.ts +1 -2
- package/es/comps/JsonEdit/index.d.ts +1 -2
- package/es/comps/JsonView/index.d.ts +1 -2
- package/es/comps/JsonView/index.less +41 -41
- package/es/comps/MdEdit/index.d.ts +1 -2
- package/es/comps/MdEdit/index.less +6 -6
- package/es/comps/MdEditPro/index.d.ts +1 -2
- package/es/comps/MdNavbar/index.d.ts +1 -2
- package/es/comps/MdView/index.d.ts +1 -1
- package/es/comps/MetadataEdit/components/MetaFieldsEdit.d.ts +1 -2
- package/es/comps/MetadataEdit/components/MetaPropsEdit.d.ts +1 -2
- package/es/comps/MetadataEdit/constant/index.js +30 -20
- package/es/comps/MetadataEdit/index.d.ts +1 -2
- package/es/comps/MetadataEdit/index.less +10 -10
- package/es/comps/MetadataEdit/type.d.ts +20 -20
- package/es/comps/MetadataEditV2/components/MetaFieldsEdit.d.ts +1 -2
- package/es/comps/MetadataEditV2/components/MetaPropsEdit.d.ts +1 -2
- package/es/comps/MetadataEditV2/index.d.ts +1 -2
- package/es/comps/MetadataForm/DataCell/Array.d.ts +1 -1
- package/es/comps/MetadataForm/DataCell/Input.d.ts +1 -1
- package/es/comps/MetadataForm/DataCell/Number.d.ts +1 -1
- package/es/comps/MetadataForm/DataCell/Ref.d.ts +1 -1
- package/es/comps/MetadataForm/DataCell/Select.d.ts +1 -1
- package/es/comps/MetadataForm/DataCell/Switch.d.ts +1 -1
- package/es/comps/MetadataForm/DataCell/layout/TableArray.d.ts +1 -2
- package/es/comps/MetadataForm/DataCell/plugin/NumberRange.d.ts +1 -2
- package/es/comps/MetadataForm/HOC/index.d.ts +1 -2
- package/es/comps/MetadataForm/HOC/index.less +41 -41
- package/es/comps/MetadataForm/index.d.ts +1 -2
- package/es/comps/MetadataForm/utils.d.ts +2 -3
- package/es/comps/Split/index.d.ts +1 -1
- package/es/framework/RxStore/demo/index.d.ts +1 -2
- package/es/framework/metadata/types.d.ts +98 -98
- package/es/utils.js +22 -5
- package/package.json +103 -103
@@ -1,20 +1,20 @@
|
|
1
|
-
export interface IMetaFileds {
|
2
|
-
id: string;
|
3
|
-
type: 'object';
|
4
|
-
properties: any[];
|
5
|
-
value: any;
|
6
|
-
}
|
7
|
-
|
8
|
-
export type ITypeStatus = 'object' | 'ref' | 'bool' | 'number' | 'text' | 'enum' | 'array';
|
9
|
-
|
10
|
-
export type IMetaProperty = {
|
11
|
-
/**
|
12
|
-
* 属性的名称
|
13
|
-
*/
|
14
|
-
id: string;
|
15
|
-
/**
|
16
|
-
* 类型
|
17
|
-
*/
|
18
|
-
type: string;
|
19
|
-
enum?: any[];
|
20
|
-
};
|
1
|
+
export interface IMetaFileds {
|
2
|
+
id: string;
|
3
|
+
type: 'object';
|
4
|
+
properties: any[];
|
5
|
+
value: any;
|
6
|
+
}
|
7
|
+
|
8
|
+
export type ITypeStatus = 'object' | 'ref' | 'bool' | 'number' | 'text' | 'enum' | 'array';
|
9
|
+
|
10
|
+
export type IMetaProperty = {
|
11
|
+
/**
|
12
|
+
* 属性的名称
|
13
|
+
*/
|
14
|
+
id: string;
|
15
|
+
/**
|
16
|
+
* 类型
|
17
|
+
*/
|
18
|
+
type: string;
|
19
|
+
enum?: any[];
|
20
|
+
};
|
@@ -1,7 +1,6 @@
|
|
1
|
-
import React from 'react';
|
2
1
|
interface IMetaFieldsEditProps {
|
3
2
|
defaultValues?: any;
|
4
3
|
onChange?: (values: any) => void;
|
5
4
|
}
|
6
|
-
declare const MetaFieldsEdit: (props: IMetaFieldsEditProps) =>
|
5
|
+
declare const MetaFieldsEdit: (props: IMetaFieldsEditProps) => JSX.Element;
|
7
6
|
export default MetaFieldsEdit;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import React from 'react';
|
2
1
|
import { FormInstance } from 'antd/lib/form';
|
3
2
|
interface IMetaPropsEditProps {
|
4
3
|
form: FormInstance;
|
@@ -9,5 +8,5 @@ interface IMetaPropsEditProps {
|
|
9
8
|
onAddFields?: (idx: number) => void;
|
10
9
|
onNewRefClick?: () => void;
|
11
10
|
}
|
12
|
-
declare const MetaPropsEdit: (props: IMetaPropsEditProps) =>
|
11
|
+
declare const MetaPropsEdit: (props: IMetaPropsEditProps) => JSX.Element;
|
13
12
|
export default MetaPropsEdit;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import React from 'react';
|
2
1
|
import './index.less';
|
3
2
|
interface IMetadataEditProps {
|
4
3
|
/**
|
@@ -22,5 +21,5 @@ interface IMetadataEditProps {
|
|
22
21
|
*/
|
23
22
|
onNewRefClick?: () => void;
|
24
23
|
}
|
25
|
-
declare const MetadataEditV2: (props: IMetadataEditProps) =>
|
24
|
+
declare const MetadataEditV2: (props: IMetadataEditProps) => JSX.Element;
|
26
25
|
export default MetadataEditV2;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { IMetaFormProps } from '../interface';
|
3
|
-
declare function Index(props: IMetaFormProps):
|
3
|
+
declare function Index(props: IMetaFormProps): JSX.Element;
|
4
4
|
declare const _default: React.MemoExoticComponent<typeof Index>;
|
5
5
|
export default _default;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { IMetaFormProps } from '../interface';
|
3
|
-
declare function Index(props: IMetaFormProps):
|
3
|
+
declare function Index(props: IMetaFormProps): JSX.Element;
|
4
4
|
declare const _default: React.MemoExoticComponent<typeof Index>;
|
5
5
|
export default _default;
|
6
6
|
export declare const DEFAULT_DATE_FORMAT = "YYYY-MM-DD HH:mm:ss";
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { IMetaFormProps } from '../interface';
|
3
|
-
declare function Index(props: IMetaFormProps):
|
3
|
+
declare function Index(props: IMetaFormProps): JSX.Element;
|
4
4
|
declare const _default: React.MemoExoticComponent<typeof Index>;
|
5
5
|
export default _default;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { IMetaFormProps } from '../interface';
|
3
|
-
declare function Index(props: IMetaFormProps):
|
3
|
+
declare function Index(props: IMetaFormProps): JSX.Element;
|
4
4
|
declare const _default: React.MemoExoticComponent<typeof Index>;
|
5
5
|
export default _default;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { IMetaFormProps } from '../interface';
|
3
|
-
declare function Index(props: IMetaFormProps):
|
3
|
+
declare function Index(props: IMetaFormProps): JSX.Element;
|
4
4
|
declare const _default: React.MemoExoticComponent<typeof Index>;
|
5
5
|
export default _default;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { IMetaFormProps } from '../interface';
|
3
|
-
declare function Index(props: IMetaFormProps):
|
3
|
+
declare function Index(props: IMetaFormProps): JSX.Element;
|
4
4
|
declare const _default: React.MemoExoticComponent<typeof Index>;
|
5
5
|
export default _default;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import React from 'react';
|
2
1
|
import { FormInstance } from 'antd';
|
3
2
|
interface ITableArrayProps {
|
4
3
|
name: string | string[];
|
@@ -11,5 +10,5 @@ interface ITableArrayProps {
|
|
11
10
|
addButtonHidden?: boolean;
|
12
11
|
initValue: any;
|
13
12
|
}
|
14
|
-
declare const TableArray: (props: ITableArrayProps) =>
|
13
|
+
declare const TableArray: (props: ITableArrayProps) => JSX.Element;
|
15
14
|
export default TableArray;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import React from 'react';
|
2
1
|
interface INumberRangeProps {
|
3
2
|
startKey?: string;
|
4
3
|
endKey?: string;
|
@@ -16,5 +15,5 @@ interface INumberRangeProps {
|
|
16
15
|
value?: any;
|
17
16
|
onChange?: (value: any) => void;
|
18
17
|
}
|
19
|
-
declare const NumberRange: (props: INumberRangeProps) =>
|
18
|
+
declare const NumberRange: (props: INumberRangeProps) => JSX.Element;
|
20
19
|
export default NumberRange;
|
@@ -1,41 +1,41 @@
|
|
1
|
-
.with-add-on-after {
|
2
|
-
--card-bg: #ffffff;
|
3
|
-
position: relative;
|
4
|
-
width: 100%;
|
5
|
-
|
6
|
-
.ant-form-item-label {
|
7
|
-
padding: 0 !important;
|
8
|
-
}
|
9
|
-
|
10
|
-
& > .ant-form-item {
|
11
|
-
padding: 0 0 8px !important;
|
12
|
-
flex: 1;
|
13
|
-
}
|
14
|
-
&-extra {
|
15
|
-
position: absolute;
|
16
|
-
right: 20px;
|
17
|
-
top: 18px;
|
18
|
-
padding: 0 6px;
|
19
|
-
background-color: var(--card-bg);
|
20
|
-
z-index: 1000;
|
21
|
-
}
|
22
|
-
&-ref {
|
23
|
-
position: absolute;
|
24
|
-
right: 20px;
|
25
|
-
top: -10px;
|
26
|
-
padding: 0 6px;
|
27
|
-
background-color: var(--card-bg);
|
28
|
-
z-index: 1000;
|
29
|
-
}
|
30
|
-
.ant-select-tree-indent {
|
31
|
-
.ant-select-tree-indent-unit {
|
32
|
-
width: 10px !important;
|
33
|
-
}
|
34
|
-
}
|
35
|
-
|
36
|
-
/* .ant-col-2.7 {
|
37
|
-
display: block;
|
38
|
-
flex: 0 0 75%;
|
39
|
-
max-width: 75%;
|
40
|
-
} */
|
41
|
-
}
|
1
|
+
.with-add-on-after {
|
2
|
+
--card-bg: #ffffff;
|
3
|
+
position: relative;
|
4
|
+
width: 100%;
|
5
|
+
|
6
|
+
.ant-form-item-label {
|
7
|
+
padding: 0 !important;
|
8
|
+
}
|
9
|
+
|
10
|
+
& > .ant-form-item {
|
11
|
+
padding: 0 0 8px !important;
|
12
|
+
flex: 1;
|
13
|
+
}
|
14
|
+
&-extra {
|
15
|
+
position: absolute;
|
16
|
+
right: 20px;
|
17
|
+
top: 18px;
|
18
|
+
padding: 0 6px;
|
19
|
+
background-color: var(--card-bg);
|
20
|
+
z-index: 1000;
|
21
|
+
}
|
22
|
+
&-ref {
|
23
|
+
position: absolute;
|
24
|
+
right: 20px;
|
25
|
+
top: -10px;
|
26
|
+
padding: 0 6px;
|
27
|
+
background-color: var(--card-bg);
|
28
|
+
z-index: 1000;
|
29
|
+
}
|
30
|
+
.ant-select-tree-indent {
|
31
|
+
.ant-select-tree-indent-unit {
|
32
|
+
width: 10px !important;
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
/* .ant-col-2.7 {
|
37
|
+
display: block;
|
38
|
+
flex: 0 0 75%;
|
39
|
+
max-width: 75%;
|
40
|
+
} */
|
41
|
+
}
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import { FormInstance } from 'antd/lib/form/hooks/useForm';
|
2
|
-
import React from 'react';
|
3
2
|
import './index.less';
|
4
3
|
import { IMetaData } from '../../framework/metadata/types';
|
5
4
|
interface IMetadataFormProps {
|
@@ -72,5 +71,5 @@ interface IMetadataFormProps {
|
|
72
71
|
*/
|
73
72
|
onCellButtonClick?: (changedValues: any) => void;
|
74
73
|
}
|
75
|
-
declare const MetadataForm: (props: IMetadataFormProps) =>
|
74
|
+
declare const MetadataForm: (props: IMetadataFormProps) => JSX.Element;
|
76
75
|
export default MetadataForm;
|
@@ -1,6 +1,5 @@
|
|
1
|
-
import React from 'react';
|
2
1
|
import { IFormOptions } from './interface';
|
3
|
-
export declare function getDataCell(item: any, options: IFormOptions, colSpan: number):
|
2
|
+
export declare function getDataCell(item: any, options: IFormOptions, colSpan: number): JSX.Element;
|
4
3
|
/**
|
5
4
|
* 渲染表单
|
6
5
|
* @param schemaRef 元数据的schema
|
@@ -12,7 +11,7 @@ export declare function getDataCell(item: any, options: IFormOptions, colSpan: n
|
|
12
11
|
* @param isObj 是否是个对象
|
13
12
|
* @returns
|
14
13
|
*/
|
15
|
-
export declare function renderForm(schemaRef: any[], options: IFormOptions, colSpan?: number):
|
14
|
+
export declare function renderForm(schemaRef: any[], options: IFormOptions, colSpan?: number): JSX.Element;
|
16
15
|
export declare function getLabelByProps(data: any): any;
|
17
16
|
export declare function assign(pathArr: string[], val: any, obj: any): void;
|
18
17
|
export declare function assignReplace(pathArr: string[], val: any, obj: any): void;
|
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
export default function (): React.JSX.Element;
|
1
|
+
export default function (): JSX.Element;
|
@@ -1,98 +1,98 @@
|
|
1
|
-
/*
|
2
|
-
* @Author: wangxian
|
3
|
-
* @Date: 2021-09-18 14:15:04
|
4
|
-
* @LastEditTime: 2023-02-09 18:37:15
|
5
|
-
*/
|
6
|
-
export type IMetaType = 'object' | 'ref' | 'bool' | 'number' | 'text' | 'enum' | 'array' | string;
|
7
|
-
|
8
|
-
export type IMetaData = {
|
9
|
-
/**
|
10
|
-
* 类名称/属性名称
|
11
|
-
*/
|
12
|
-
id: string;
|
13
|
-
/**
|
14
|
-
* 类型
|
15
|
-
*/
|
16
|
-
type: IMetaType;
|
17
|
-
/**
|
18
|
-
* 属性
|
19
|
-
*/
|
20
|
-
properties?: IMetaProperties[];
|
21
|
-
|
22
|
-
/**
|
23
|
-
* 引用id
|
24
|
-
*/
|
25
|
-
refId?: string;
|
26
|
-
/**
|
27
|
-
* 静态的变量
|
28
|
-
*/
|
29
|
-
fields?: IMetaFileds[];
|
30
|
-
/**
|
31
|
-
* 内部类
|
32
|
-
*/
|
33
|
-
types?: IMetaData[];
|
34
|
-
};
|
35
|
-
|
36
|
-
export type IMetaProperties = {
|
37
|
-
/**
|
38
|
-
* 类规则名称
|
39
|
-
*/
|
40
|
-
id: string;
|
41
|
-
|
42
|
-
/**
|
43
|
-
* 类型
|
44
|
-
*/
|
45
|
-
type: IMetaType;
|
46
|
-
|
47
|
-
/**
|
48
|
-
* 引用id
|
49
|
-
*/
|
50
|
-
refId?: string;
|
51
|
-
/**
|
52
|
-
* 静态的变量
|
53
|
-
*/
|
54
|
-
fields?: IMetaFileds[];
|
55
|
-
/**
|
56
|
-
* 枚举值
|
57
|
-
*/
|
58
|
-
enum?: { value: string }[];
|
59
|
-
/**
|
60
|
-
* 数组类型
|
61
|
-
*/
|
62
|
-
items?: { type: IMetaType; refId?: string };
|
63
|
-
};
|
64
|
-
|
65
|
-
export type IMetaFileds = {
|
66
|
-
/**
|
67
|
-
* 规则名称
|
68
|
-
*/
|
69
|
-
id: string;
|
70
|
-
|
71
|
-
/**
|
72
|
-
* 类型
|
73
|
-
*/
|
74
|
-
type: IMetaType;
|
75
|
-
|
76
|
-
/**
|
77
|
-
* 引用id
|
78
|
-
*/
|
79
|
-
refId?: string;
|
80
|
-
|
81
|
-
/**
|
82
|
-
* 规则值
|
83
|
-
*/
|
84
|
-
value: any;
|
85
|
-
};
|
86
|
-
|
87
|
-
export interface IAPI {
|
88
|
-
// 获取元数据列表
|
89
|
-
GetMetadataList(keyWords?: string[]): Promise<{ id: string; name: string; schema: string }[]>;
|
90
|
-
// 通过元数据Id获取元数据详情
|
91
|
-
GetMetadataDetailById(metadataId: string): Promise<any>;
|
92
|
-
// 新增元数据
|
93
|
-
SaveMetadata(data: any, metadataTag: string): Promise<any>;
|
94
|
-
// 获取元数据的值
|
95
|
-
GetMetadataObjList(data: any): Promise<any[]>;
|
96
|
-
/** 通过扩展规则获取枚举类型的值 */
|
97
|
-
GetEnumDataByUrl(url: string, method: 'get' | 'post', body: any): Promise<any>;
|
98
|
-
}
|
1
|
+
/*
|
2
|
+
* @Author: wangxian
|
3
|
+
* @Date: 2021-09-18 14:15:04
|
4
|
+
* @LastEditTime: 2023-02-09 18:37:15
|
5
|
+
*/
|
6
|
+
export type IMetaType = 'object' | 'ref' | 'bool' | 'number' | 'text' | 'enum' | 'array' | string;
|
7
|
+
|
8
|
+
export type IMetaData = {
|
9
|
+
/**
|
10
|
+
* 类名称/属性名称
|
11
|
+
*/
|
12
|
+
id: string;
|
13
|
+
/**
|
14
|
+
* 类型
|
15
|
+
*/
|
16
|
+
type: IMetaType;
|
17
|
+
/**
|
18
|
+
* 属性
|
19
|
+
*/
|
20
|
+
properties?: IMetaProperties[];
|
21
|
+
|
22
|
+
/**
|
23
|
+
* 引用id
|
24
|
+
*/
|
25
|
+
refId?: string;
|
26
|
+
/**
|
27
|
+
* 静态的变量
|
28
|
+
*/
|
29
|
+
fields?: IMetaFileds[];
|
30
|
+
/**
|
31
|
+
* 内部类
|
32
|
+
*/
|
33
|
+
types?: IMetaData[];
|
34
|
+
};
|
35
|
+
|
36
|
+
export type IMetaProperties = {
|
37
|
+
/**
|
38
|
+
* 类规则名称
|
39
|
+
*/
|
40
|
+
id: string;
|
41
|
+
|
42
|
+
/**
|
43
|
+
* 类型
|
44
|
+
*/
|
45
|
+
type: IMetaType;
|
46
|
+
|
47
|
+
/**
|
48
|
+
* 引用id
|
49
|
+
*/
|
50
|
+
refId?: string;
|
51
|
+
/**
|
52
|
+
* 静态的变量
|
53
|
+
*/
|
54
|
+
fields?: IMetaFileds[];
|
55
|
+
/**
|
56
|
+
* 枚举值
|
57
|
+
*/
|
58
|
+
enum?: { value: string }[];
|
59
|
+
/**
|
60
|
+
* 数组类型
|
61
|
+
*/
|
62
|
+
items?: { type: IMetaType; refId?: string };
|
63
|
+
};
|
64
|
+
|
65
|
+
export type IMetaFileds = {
|
66
|
+
/**
|
67
|
+
* 规则名称
|
68
|
+
*/
|
69
|
+
id: string;
|
70
|
+
|
71
|
+
/**
|
72
|
+
* 类型
|
73
|
+
*/
|
74
|
+
type: IMetaType;
|
75
|
+
|
76
|
+
/**
|
77
|
+
* 引用id
|
78
|
+
*/
|
79
|
+
refId?: string;
|
80
|
+
|
81
|
+
/**
|
82
|
+
* 规则值
|
83
|
+
*/
|
84
|
+
value: any;
|
85
|
+
};
|
86
|
+
|
87
|
+
export interface IAPI {
|
88
|
+
// 获取元数据列表
|
89
|
+
GetMetadataList(keyWords?: string[]): Promise<{ id: string; name: string; schema: string }[]>;
|
90
|
+
// 通过元数据Id获取元数据详情
|
91
|
+
GetMetadataDetailById(metadataId: string): Promise<any>;
|
92
|
+
// 新增元数据
|
93
|
+
SaveMetadata(data: any, metadataTag: string): Promise<any>;
|
94
|
+
// 获取元数据的值
|
95
|
+
GetMetadataObjList(data: any): Promise<any[]>;
|
96
|
+
/** 通过扩展规则获取枚举类型的值 */
|
97
|
+
GetEnumDataByUrl(url: string, method: 'get' | 'post', body: any): Promise<any>;
|
98
|
+
}
|
package/es/utils.js
CHANGED
@@ -6,7 +6,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
6
|
/*
|
7
7
|
* @Author: wangxian
|
8
8
|
* @Date: 2021-09-18 14:15:04
|
9
|
-
* @LastEditTime: 2023-07-
|
9
|
+
* @LastEditTime: 2023-07-19 10:10:33
|
10
10
|
*/
|
11
11
|
import saveAs from 'file-saver';
|
12
12
|
import { asBlob } from 'html-docx-js-typescript';
|
@@ -168,6 +168,8 @@ function _handleMd2Doc() {
|
|
168
168
|
_handleMd2Doc = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(mdText, fileName) {
|
169
169
|
var isFirstLineCenter,
|
170
170
|
md,
|
171
|
+
h2_idx_open,
|
172
|
+
h2_idx,
|
171
173
|
html,
|
172
174
|
commonHtml,
|
173
175
|
opt,
|
@@ -202,15 +204,30 @@ function _handleMd2Doc() {
|
|
202
204
|
// 在 table 元素上添加 class 属性
|
203
205
|
return "<table class='doc-table' >\n";
|
204
206
|
};
|
207
|
+
h2_idx_open = 0;
|
208
|
+
h2_idx = 0;
|
205
209
|
md.renderer.rules.heading_open = function (tokens, idx, options, env, self) {
|
206
210
|
var token = tokens[idx];
|
207
211
|
if (isFirstLineCenter && idx === 0 && token.tag === 'h1') {
|
208
212
|
return "<h1 style=\"text-align:center\" >\n";
|
209
213
|
}
|
214
|
+
if (isFirstLineCenter && token.tag === 'h2') {
|
215
|
+
h2_idx_open++;
|
216
|
+
if (h2_idx_open === 2) {
|
217
|
+
h2_idx = idx;
|
218
|
+
}
|
219
|
+
}
|
220
|
+
return "<".concat(token.tag, ">\n");
|
221
|
+
};
|
222
|
+
md.renderer.rules.paragraph_open = function (tokens, idx, options, env, self) {
|
223
|
+
var token = tokens[idx];
|
224
|
+
if (isFirstLineCenter && h2_idx === 0) {
|
225
|
+
return "<p class=\"my-p\">\n";
|
226
|
+
}
|
210
227
|
return "<".concat(token.tag, ">\n");
|
211
228
|
};
|
212
229
|
html = md.render(mdText);
|
213
|
-
commonHtml = "\n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <style>\n .doc-table {\n border-collapse:collapse;\n width: 100%;\n border: 1px solid #ccc;\n border-style: hidden;\n overflow: hidden;\n }\n p {\n margin: 0;\n }\n th {\n background: #f9fafb;\n border: 1px solid #f3f4f5;\n font-weight: 600;\n color: rgba(0, 0, 0, 0.85);\n padding:8px;\n text-align:left;\n }\n tr {\n border: 1px solid #f3f4f5;\n }\n td {\n border: 1px solid #f3f4f5;\n padding:4px\n }\n blockquote {\n border-left: 4px solid #f3f4f5; \n overflow: hidden;\n }\n </style>\n </head>\n <body>\n ".concat(!isFirstLineCenter ? "<div style='text-align:center;font-weight:blod'><h1>".concat(fileName, "</h1></div>") : '', "\n <div>\n ").concat(html, "\n </div>\n </body>\n </html>\n ");
|
230
|
+
commonHtml = "\n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <style>\n .doc-table {\n border-collapse:collapse;\n width: 100%;\n border: 1px solid #ccc;\n border-style: hidden;\n overflow: hidden;\n }\n \n p {\n margin: 0\n }\n\n .my-p {\n margin-bottom: 10px !important;\n margin-top: 10px !important;\n font-size: 16px;\n }\n\n h4{\n margin:0;\n }\n\n th {\n background: #f9fafb;\n border: 1px solid #f3f4f5;\n font-weight: 600;\n color: rgba(0, 0, 0, 0.85);\n padding:8px;\n text-align:left;\n }\n tr {\n border: 1px solid #f3f4f5;\n }\n td {\n border: 1px solid #f3f4f5;\n padding:4px\n }\n blockquote {\n border-left: 4px solid #f3f4f5; \n overflow: hidden;\n }\n </style>\n </head>\n <body>\n ".concat(!isFirstLineCenter ? "<div style='text-align:center;font-weight:blod'><h1>".concat(fileName, "</h1></div>") : '', "\n <div>\n ").concat(html, "\n </div>\n </body>\n </html>\n ");
|
214
231
|
opt = {
|
215
232
|
margin: {
|
216
233
|
top: 0,
|
@@ -219,12 +236,12 @@ function _handleMd2Doc() {
|
|
219
236
|
},
|
220
237
|
orientation: 'portrait'
|
221
238
|
};
|
222
|
-
_context.next =
|
239
|
+
_context.next = 13;
|
223
240
|
return asBlob(commonHtml, opt);
|
224
|
-
case
|
241
|
+
case 13:
|
225
242
|
blob = _context.sent;
|
226
243
|
saveAs(blob, "".concat(fileName, ".doc"));
|
227
|
-
case
|
244
|
+
case 15:
|
228
245
|
case "end":
|
229
246
|
return _context.stop();
|
230
247
|
}
|