szld-libs 0.4.46 → 0.4.49
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/style.css +1 -1
- package/dist/szld-components.es.js +51950 -28754
- package/dist/szld-components.umd.js +396 -77
- package/es/components/AuthButton/index.d.ts +2 -1
- package/es/components/BackHeader/index.d.ts +1 -1
- package/es/components/CoralButton/index.d.ts +2 -1
- package/es/components/CreateForm/index.d.ts +1 -1
- package/es/components/CustomPagination/index.d.ts +2 -1
- package/es/components/DynamicForm/func.js +4 -0
- package/es/components/DynamicForm/index.d.ts +3 -0
- package/es/components/DynamicForm/myCascader/index.d.ts +1 -1
- package/es/components/DynamicForm/myCheckbox/index.d.ts +2 -1
- package/es/components/DynamicForm/myRadio/index.d.ts +2 -1
- package/es/components/DynamicForm/myRichText/index.d.ts +10 -0
- package/es/components/DynamicForm/myRichText/index.js +280 -0
- package/es/components/DynamicForm/myRichText/vite.svg +1 -0
- package/es/components/DynamicForm/mySelect/index.d.ts +2 -1
- package/es/components/DynamicForm/mySelect/index.js +51 -15
- package/es/components/DynamicForm/myUpload/index.d.ts +2 -1
- package/es/components/DynamicForm/radioCard/index.d.ts +1 -1
- package/es/components/DynamicForm/selectModel/index.d.ts +1 -1
- package/es/components/DynamicForm/selectModelBackfillFormItem/index.d.ts +1 -1
- package/es/components/DynamicForm/useDynamicForm.d.ts +1 -1
- package/es/components/DynamicForm/useDynamicForm.js +23 -3
- package/es/components/DynamicFormMobile/index.js +2 -0
- package/es/components/DynamicFormMobile/myCalendar/index.d.ts +2 -1
- package/es/components/DynamicFormMobile/myCascader/index.d.ts +1 -1
- package/es/components/DynamicFormMobile/myCheckbox/index.d.ts +2 -1
- package/es/components/DynamicFormMobile/myRadio/index.d.ts +2 -1
- package/es/components/DynamicFormMobile/mySelect/index.d.ts +2 -1
- package/es/components/DynamicFormMobile/myUpload/index.d.ts +2 -1
- package/es/components/DynamicFormMobile/radioCard/index.d.ts +1 -1
- package/es/components/DynamicFormMobile/selectModel/index.d.ts +1 -1
- package/es/components/DynamicFormMobile/selectModelBackfillFormItem/index.d.ts +1 -1
- package/es/components/DynamicFormMobile/useDynamicForm.d.ts +1 -1
- package/es/components/DynamicFormMobile/useDynamicForm.js +2 -0
- package/es/components/EditTable/index.d.ts +2 -1
- package/es/components/LoopSlide/index.js +1 -0
- package/es/components/SearchTable/index.d.ts +2 -1
- package/es/components/Upload/index.d.ts +1 -1
- package/es/components/VirtualTable/index.d.ts +2 -1
- package/es/components/WorkFlowNode/index.d.ts +1 -1
- package/es/components/common/403.d.ts +2 -1
- package/es/components/common/404.d.ts +2 -1
- package/es/hooks/useCaptcha.d.ts +2 -1
- package/es/hooks/useChangePwd.js +1 -0
- package/es/hooks/useDetailRender.d.ts +3 -2
- package/es/hooks/useUniversalTable.js +7 -0
- package/es/index.js +6 -9
- package/es/mock/index.d.ts +1 -14
- package/es/mock/index.js +9 -1404
- package/es/utils/formRules.js +6 -0
- package/es/utils/hmacSM3.js +40 -4
- package/es/utils/method.js +25 -5
- package/es/utils/szxkFunc.js +1 -0
- package/es/utils/verify-code.js +13 -0
- package/lib/components/AuthButton/index.d.ts +2 -1
- package/lib/components/BackHeader/index.d.ts +1 -1
- package/lib/components/CoralButton/index.d.ts +2 -1
- package/lib/components/CreateForm/index.d.ts +1 -1
- package/lib/components/CustomPagination/index.d.ts +2 -1
- package/lib/components/DynamicForm/func.js +4 -0
- package/lib/components/DynamicForm/index.d.ts +3 -0
- package/lib/components/DynamicForm/myCascader/index.d.ts +1 -1
- package/lib/components/DynamicForm/myCheckbox/index.d.ts +2 -1
- package/lib/components/DynamicForm/myRadio/index.d.ts +2 -1
- package/lib/components/DynamicForm/myRichText/index.d.ts +10 -0
- package/lib/components/DynamicForm/myRichText/index.js +279 -0
- package/lib/components/DynamicForm/myRichText/vite.svg +1 -0
- package/lib/components/DynamicForm/mySelect/index.d.ts +2 -1
- package/lib/components/DynamicForm/mySelect/index.js +49 -13
- package/lib/components/DynamicForm/myUpload/index.d.ts +2 -1
- package/lib/components/DynamicForm/radioCard/index.d.ts +1 -1
- package/lib/components/DynamicForm/selectModel/index.d.ts +1 -1
- package/lib/components/DynamicForm/selectModelBackfillFormItem/index.d.ts +1 -1
- package/lib/components/DynamicForm/useDynamicForm.d.ts +1 -1
- package/lib/components/DynamicForm/useDynamicForm.js +23 -3
- package/lib/components/DynamicFormMobile/index.js +2 -0
- package/lib/components/DynamicFormMobile/myCalendar/index.d.ts +2 -1
- package/lib/components/DynamicFormMobile/myCascader/index.d.ts +1 -1
- package/lib/components/DynamicFormMobile/myCheckbox/index.d.ts +2 -1
- package/lib/components/DynamicFormMobile/myRadio/index.d.ts +2 -1
- package/lib/components/DynamicFormMobile/mySelect/index.d.ts +2 -1
- package/lib/components/DynamicFormMobile/myUpload/index.d.ts +2 -1
- package/lib/components/DynamicFormMobile/radioCard/index.d.ts +1 -1
- package/lib/components/DynamicFormMobile/selectModel/index.d.ts +1 -1
- package/lib/components/DynamicFormMobile/selectModelBackfillFormItem/index.d.ts +1 -1
- package/lib/components/DynamicFormMobile/useDynamicForm.d.ts +1 -1
- package/lib/components/DynamicFormMobile/useDynamicForm.js +2 -0
- package/lib/components/EditTable/index.d.ts +2 -1
- package/lib/components/LoopSlide/index.js +1 -0
- package/lib/components/SearchTable/index.d.ts +2 -1
- package/lib/components/Upload/index.d.ts +1 -1
- package/lib/components/VirtualTable/index.d.ts +2 -1
- package/lib/components/WorkFlowNode/index.d.ts +1 -1
- package/lib/components/common/403.d.ts +2 -1
- package/lib/components/common/404.d.ts +2 -1
- package/lib/hooks/useCaptcha.d.ts +2 -1
- package/lib/hooks/useChangePwd.js +1 -0
- package/lib/hooks/useDetailRender.d.ts +3 -2
- package/lib/hooks/useUniversalTable.js +7 -0
- package/lib/index.js +6 -9
- package/lib/mock/index.d.ts +1 -14
- package/lib/mock/index.js +9 -1404
- package/lib/utils/formRules.js +6 -0
- package/lib/utils/hmacSM3.js +40 -4
- package/lib/utils/method.js +25 -5
- package/lib/utils/szxkFunc.js +1 -0
- package/lib/utils/verify-code.js +13 -0
- package/package.json +10 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { ButtonProps } from "antd";
|
|
2
3
|
export interface AuthButtonProps extends ButtonProps {
|
|
3
4
|
auth?: boolean;
|
|
4
5
|
}
|
|
5
|
-
declare const AuthButton: (props: AuthButtonProps) => import("react
|
|
6
|
+
declare const AuthButton: (props: AuthButtonProps) => import("react").JSX.Element | null;
|
|
6
7
|
export default AuthButton;
|
|
@@ -21,5 +21,5 @@ interface BackHeaderProps {
|
|
|
21
21
|
/** 自定义返回事件 */
|
|
22
22
|
onBack?: () => void;
|
|
23
23
|
}
|
|
24
|
-
declare const BackHeader: (props: BackHeaderProps) => import("react
|
|
24
|
+
declare const BackHeader: (props: BackHeaderProps) => import("react").JSX.Element;
|
|
25
25
|
export default BackHeader;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { ButtonProps } from "antd";
|
|
2
3
|
interface AuthProps {
|
|
3
4
|
PId: number;
|
|
@@ -6,5 +7,5 @@ export interface CoralButtonProps extends ButtonProps {
|
|
|
6
7
|
PId: number | number[];
|
|
7
8
|
auths?: AuthProps[];
|
|
8
9
|
}
|
|
9
|
-
declare const CoralButton: (props: CoralButtonProps) => import("react
|
|
10
|
+
declare const CoralButton: (props: CoralButtonProps) => import("react").JSX.Element;
|
|
10
11
|
export default CoralButton;
|
|
@@ -45,7 +45,7 @@ export interface CreateFormProps {
|
|
|
45
45
|
hiddenTitle?: boolean;
|
|
46
46
|
langId?: string;
|
|
47
47
|
}
|
|
48
|
-
declare const CreateForm: (props: CreateFormProps) =>
|
|
48
|
+
declare const CreateForm: (props: CreateFormProps) => React.JSX.Element;
|
|
49
49
|
interface FormFieldsProps extends Pick<CreateFormItemProps<ValueType>, 'valueType' | 'valueProps'> {
|
|
50
50
|
onChange?: (e: any) => void;
|
|
51
51
|
value?: any;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { PaginationProps } from 'antd';
|
|
2
3
|
export interface CustomPaginationProps {
|
|
3
4
|
/** 总数文本 */
|
|
@@ -11,5 +12,5 @@ export interface CustomPaginationProps {
|
|
|
11
12
|
/** pagination属性配置 */
|
|
12
13
|
paginationProps?: PaginationProps;
|
|
13
14
|
}
|
|
14
|
-
declare function CustomPagination(props: CustomPaginationProps): import("react
|
|
15
|
+
declare function CustomPagination(props: CustomPaginationProps): import("react").JSX.Element;
|
|
15
16
|
export default CustomPagination;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import dayjs from "dayjs";
|
|
2
2
|
import { message } from "antd";
|
|
3
|
+
import { base64ToString } from "../../utils/method";
|
|
3
4
|
const handleGetPlaceholder = (itemWithJson, langId) => {
|
|
4
5
|
const { input = "" } = (itemWithJson == null ? void 0 : itemWithJson.json) || {};
|
|
5
6
|
let placeholderCn = "请输入", placeholderEn = "Please input";
|
|
@@ -87,6 +88,9 @@ const handleSetFormItemInitialValue = (itemWithJson) => {
|
|
|
87
88
|
if (itemWithJson.attrtype === 1) {
|
|
88
89
|
initialValue = handleGetSingleAttrListObj(itemWithJson.children || []);
|
|
89
90
|
}
|
|
91
|
+
if (inputType === "rich-text" && initialValue) {
|
|
92
|
+
initialValue = base64ToString(initialValue);
|
|
93
|
+
}
|
|
90
94
|
return initialValue || null;
|
|
91
95
|
};
|
|
92
96
|
const disabledDate = (current) => {
|
|
@@ -18,6 +18,8 @@ export interface IformConfigItem {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export interface Ijson {
|
|
21
|
+
'operation-types'?: string[]; // 自定义按钮类型列表
|
|
22
|
+
'custom-operation'?: boolean; // 是否自定义按钮
|
|
21
23
|
extraDescObj?: Record<string, any>;
|
|
22
24
|
hidden?: boolean; // 是否隐藏属性
|
|
23
25
|
'auto-generate'?: boolean; // 是否自动生成时间
|
|
@@ -102,6 +104,7 @@ export type InputType =
|
|
|
102
104
|
| 'checkbox'
|
|
103
105
|
| 'cascader'
|
|
104
106
|
| 'mult-field-modal-select' // 弹窗选择对应多个表单字段
|
|
107
|
+
| 'rich-text' // 富文本
|
|
105
108
|
| string;
|
|
106
109
|
|
|
107
110
|
// 定义文件上传值类型
|
|
@@ -15,5 +15,5 @@ interface MyCascaderProps {
|
|
|
15
15
|
actionUrlExtraParams: object;
|
|
16
16
|
langId?: string;
|
|
17
17
|
}
|
|
18
|
-
declare const MyCascader: ({ item, readonly, value, onChange, style, commonRequestWidthParams, commonRequest, interfaceTypeDict, interfaceTypeSysDict, actionUrlKey, actionUrlExtraParams, langId, }: MyCascaderProps) => import("react
|
|
18
|
+
declare const MyCascader: ({ item, readonly, value, onChange, style, commonRequestWidthParams, commonRequest, interfaceTypeDict, interfaceTypeSysDict, actionUrlKey, actionUrlExtraParams, langId, }: MyCascaderProps) => import("react").JSX.Element;
|
|
19
19
|
export default MyCascader;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { AxiosResponse } from 'axios';
|
|
2
3
|
import { Ijson } from '../index.d';
|
|
3
4
|
export interface IMYRadio {
|
|
@@ -15,5 +16,5 @@ export interface IMYRadio {
|
|
|
15
16
|
actionUrlKey: string;
|
|
16
17
|
actionUrlExtraParams: object;
|
|
17
18
|
}
|
|
18
|
-
declare const MyCheckbox: (props: IMYRadio) => import("react
|
|
19
|
+
declare const MyCheckbox: (props: IMYRadio) => import("react").JSX.Element;
|
|
19
20
|
export default MyCheckbox;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { RadioChangeEvent } from 'antd';
|
|
2
3
|
import { AxiosResponse } from 'axios';
|
|
3
4
|
import { Ijson } from '../index.d';
|
|
@@ -16,5 +17,5 @@ export interface IMYRadio {
|
|
|
16
17
|
actionUrlKey: string;
|
|
17
18
|
actionUrlExtraParams: object;
|
|
18
19
|
}
|
|
19
|
-
declare const MyRadio: (props: IMYRadio) => import("react
|
|
20
|
+
declare const MyRadio: (props: IMYRadio) => import("react").JSX.Element;
|
|
20
21
|
export default MyRadio;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface IMyRichTextProps {
|
|
3
|
+
item: any;
|
|
4
|
+
readonly: boolean;
|
|
5
|
+
style: React.CSSProperties;
|
|
6
|
+
value: string;
|
|
7
|
+
onChange: (val: string) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const MyRichText: ({ item, readonly, style, value, onChange }: IMyRichTextProps) => import("react").JSX.Element | null;
|
|
10
|
+
export default MyRichText;
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Space, Tooltip, Button, ColorPicker, Select } from "antd";
|
|
3
|
+
import { useEditor, EditorContent } from "@tiptap/react";
|
|
4
|
+
import { TextStyle } from "@tiptap/extension-text-style";
|
|
5
|
+
import TextAlign from "@tiptap/extension-text-align";
|
|
6
|
+
import Highlight from "@tiptap/extension-highlight";
|
|
7
|
+
import FontSize from "@tiptap/extension-font-size";
|
|
8
|
+
import StarterKit from "@tiptap/starter-kit";
|
|
9
|
+
import Color from "@tiptap/extension-color";
|
|
10
|
+
import { useState, useEffect } from "react";
|
|
11
|
+
import { BoldOutlined, ItalicOutlined, UnderlineOutlined, StrikethroughOutlined, ClearOutlined, FontSizeOutlined, AlignLeftOutlined, AlignCenterOutlined, AlignRightOutlined, BlockOutlined, UnorderedListOutlined, OrderedListOutlined, ToolOutlined, LinkOutlined, UndoOutlined, RedoOutlined } from "@ant-design/icons";
|
|
12
|
+
const MyRichText = ({ item, readonly, style, value, onChange }) => {
|
|
13
|
+
const [color, setColor] = useState("#1677ff");
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
const styleSheet = document.createElement("style");
|
|
16
|
+
styleSheet.textContent = `
|
|
17
|
+
.MyRichText_ProseMirror {
|
|
18
|
+
min-height: 300px !important;
|
|
19
|
+
outline: none !important;
|
|
20
|
+
box-shadow: none !important;
|
|
21
|
+
border: none !important;
|
|
22
|
+
}
|
|
23
|
+
.MyRichText_ProseMirror:focus,
|
|
24
|
+
.MyRichText_ProseMirror:focus-visible {
|
|
25
|
+
outline: none !important;
|
|
26
|
+
box-shadow: none !important;
|
|
27
|
+
border: none !important;
|
|
28
|
+
}
|
|
29
|
+
.MyRichText_ProseMirror p {
|
|
30
|
+
min-height: 1.5em;
|
|
31
|
+
margin: 0;
|
|
32
|
+
padding: 0;
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
document.head.appendChild(styleSheet);
|
|
36
|
+
return () => {
|
|
37
|
+
document.head.removeChild(styleSheet);
|
|
38
|
+
};
|
|
39
|
+
}, []);
|
|
40
|
+
const editor = useEditor({
|
|
41
|
+
extensions: [
|
|
42
|
+
StarterKit,
|
|
43
|
+
Highlight.configure({ multicolor: true }),
|
|
44
|
+
TextAlign.configure({
|
|
45
|
+
types: ["heading", "paragraph"]
|
|
46
|
+
}),
|
|
47
|
+
TextStyle,
|
|
48
|
+
FontSize,
|
|
49
|
+
Color.configure({
|
|
50
|
+
types: ["textStyle"]
|
|
51
|
+
})
|
|
52
|
+
],
|
|
53
|
+
content: value,
|
|
54
|
+
editable: !readonly,
|
|
55
|
+
editorProps: {
|
|
56
|
+
attributes: {
|
|
57
|
+
class: "MyRichText_ProseMirror"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
onUpdate: ({ editor: editor2 }) => {
|
|
61
|
+
onChange(editor2.getHTML());
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
if (!editor) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
return /* @__PURE__ */ jsxs("div", { style: { ...style, border: "1px solid #d9d9d9", borderRadius: 6, overflow: "hidden" }, children: [
|
|
68
|
+
/* @__PURE__ */ jsx("div", { style: { borderBottom: "1px solid #d9d9d9", padding: 8, background: "#fafafa" }, children: /* @__PURE__ */ jsxs(Space, { wrap: true, children: [
|
|
69
|
+
/* @__PURE__ */ jsx(Tooltip, { placement: "topLeft", title: "加粗", children: /* @__PURE__ */ jsx(
|
|
70
|
+
Button,
|
|
71
|
+
{
|
|
72
|
+
type: "text",
|
|
73
|
+
icon: /* @__PURE__ */ jsx(BoldOutlined, {}),
|
|
74
|
+
onClick: () => editor.chain().focus().toggleBold().run(),
|
|
75
|
+
disabled: readonly,
|
|
76
|
+
className: editor.isActive("bold") ? "ant-btn-primary" : ""
|
|
77
|
+
}
|
|
78
|
+
) }),
|
|
79
|
+
/* @__PURE__ */ jsx(Tooltip, { placement: "topLeft", title: "斜体", children: /* @__PURE__ */ jsx(
|
|
80
|
+
Button,
|
|
81
|
+
{
|
|
82
|
+
type: "text",
|
|
83
|
+
icon: /* @__PURE__ */ jsx(ItalicOutlined, {}),
|
|
84
|
+
onClick: () => editor.chain().focus().toggleItalic().run(),
|
|
85
|
+
disabled: readonly,
|
|
86
|
+
className: editor.isActive("italic") ? "ant-btn-primary" : ""
|
|
87
|
+
}
|
|
88
|
+
) }),
|
|
89
|
+
/* @__PURE__ */ jsx(Tooltip, { placement: "topLeft", title: "下划线", children: /* @__PURE__ */ jsx(
|
|
90
|
+
Button,
|
|
91
|
+
{
|
|
92
|
+
type: "text",
|
|
93
|
+
icon: /* @__PURE__ */ jsx(UnderlineOutlined, {}),
|
|
94
|
+
onClick: () => editor.chain().focus().toggleUnderline().run(),
|
|
95
|
+
disabled: readonly,
|
|
96
|
+
className: editor.isActive("underline") ? "ant-btn-primary" : ""
|
|
97
|
+
}
|
|
98
|
+
) }),
|
|
99
|
+
/* @__PURE__ */ jsx(Tooltip, { placement: "topLeft", title: "删除线", children: /* @__PURE__ */ jsx(
|
|
100
|
+
Button,
|
|
101
|
+
{
|
|
102
|
+
type: "text",
|
|
103
|
+
icon: /* @__PURE__ */ jsx(StrikethroughOutlined, {}),
|
|
104
|
+
onClick: () => editor.chain().focus().toggleStrike().run(),
|
|
105
|
+
disabled: readonly,
|
|
106
|
+
className: editor.isActive("strike") ? "ant-btn-primary" : ""
|
|
107
|
+
}
|
|
108
|
+
) }),
|
|
109
|
+
/* @__PURE__ */ jsx(Tooltip, { placement: "topLeft", title: "清除格式", children: /* @__PURE__ */ jsx(
|
|
110
|
+
Button,
|
|
111
|
+
{
|
|
112
|
+
type: "text",
|
|
113
|
+
icon: /* @__PURE__ */ jsx(ClearOutlined, {}),
|
|
114
|
+
onClick: () => editor.chain().focus().unsetAllMarks().clearNodes().run(),
|
|
115
|
+
disabled: readonly
|
|
116
|
+
}
|
|
117
|
+
) }),
|
|
118
|
+
/* @__PURE__ */ jsx(Tooltip, { placement: "topLeft", title: "文字颜色", children: /* @__PURE__ */ jsx(
|
|
119
|
+
ColorPicker,
|
|
120
|
+
{
|
|
121
|
+
value: color,
|
|
122
|
+
size: "small",
|
|
123
|
+
disabled: readonly,
|
|
124
|
+
onChangeComplete: (newColor) => {
|
|
125
|
+
setColor(newColor);
|
|
126
|
+
editor.chain().focus().setColor(newColor.toHexString()).run();
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
) }),
|
|
130
|
+
/* @__PURE__ */ jsx(Tooltip, { placement: "topLeft", title: "字体大小", children: /* @__PURE__ */ jsx(
|
|
131
|
+
Select,
|
|
132
|
+
{
|
|
133
|
+
defaultValue: "16px",
|
|
134
|
+
style: { width: 100 },
|
|
135
|
+
disabled: readonly,
|
|
136
|
+
onChange: (value2) => {
|
|
137
|
+
editor.chain().focus().setFontSize(value2).run();
|
|
138
|
+
},
|
|
139
|
+
options: [
|
|
140
|
+
{ value: "12px", label: "12px" },
|
|
141
|
+
{ value: "14px", label: "14px" },
|
|
142
|
+
{ value: "16px", label: "16px" },
|
|
143
|
+
{ value: "18px", label: "18px" },
|
|
144
|
+
{ value: "20px", label: "20px" },
|
|
145
|
+
{ value: "24px", label: "24px" },
|
|
146
|
+
{ value: "28px", label: "28px" },
|
|
147
|
+
{ value: "32px", label: "32px" }
|
|
148
|
+
],
|
|
149
|
+
suffixIcon: /* @__PURE__ */ jsx(FontSizeOutlined, {})
|
|
150
|
+
}
|
|
151
|
+
) }),
|
|
152
|
+
/* @__PURE__ */ jsx(Tooltip, { placement: "topLeft", title: "左对齐", children: /* @__PURE__ */ jsx(
|
|
153
|
+
Button,
|
|
154
|
+
{
|
|
155
|
+
type: "text",
|
|
156
|
+
icon: /* @__PURE__ */ jsx(AlignLeftOutlined, {}),
|
|
157
|
+
onClick: () => editor.chain().focus().setTextAlign("left").run(),
|
|
158
|
+
disabled: readonly,
|
|
159
|
+
className: editor.isActive({ textAlign: "left" }) ? "ant-btn-primary" : ""
|
|
160
|
+
}
|
|
161
|
+
) }),
|
|
162
|
+
/* @__PURE__ */ jsx(Tooltip, { placement: "topLeft", title: "居中对齐", children: /* @__PURE__ */ jsx(
|
|
163
|
+
Button,
|
|
164
|
+
{
|
|
165
|
+
type: "text",
|
|
166
|
+
icon: /* @__PURE__ */ jsx(AlignCenterOutlined, {}),
|
|
167
|
+
onClick: () => editor.chain().focus().setTextAlign("center").run(),
|
|
168
|
+
disabled: readonly,
|
|
169
|
+
className: editor.isActive({ textAlign: "center" }) ? "ant-btn-primary" : ""
|
|
170
|
+
}
|
|
171
|
+
) }),
|
|
172
|
+
/* @__PURE__ */ jsx(Tooltip, { placement: "topLeft", title: "右对齐", children: /* @__PURE__ */ jsx(
|
|
173
|
+
Button,
|
|
174
|
+
{
|
|
175
|
+
type: "text",
|
|
176
|
+
icon: /* @__PURE__ */ jsx(AlignRightOutlined, {}),
|
|
177
|
+
onClick: () => editor.chain().focus().setTextAlign("right").run(),
|
|
178
|
+
disabled: readonly,
|
|
179
|
+
className: editor.isActive({ textAlign: "right" }) ? "ant-btn-primary" : ""
|
|
180
|
+
}
|
|
181
|
+
) }),
|
|
182
|
+
/* @__PURE__ */ jsx(Tooltip, { placement: "topLeft", title: "两端对齐", children: /* @__PURE__ */ jsx(
|
|
183
|
+
Button,
|
|
184
|
+
{
|
|
185
|
+
type: "text",
|
|
186
|
+
icon: /* @__PURE__ */ jsx(BlockOutlined, {}),
|
|
187
|
+
onClick: () => editor.chain().focus().setTextAlign("justify").run(),
|
|
188
|
+
disabled: readonly,
|
|
189
|
+
className: editor.isActive({ textAlign: "justify" }) ? "ant-btn-primary" : ""
|
|
190
|
+
}
|
|
191
|
+
) }),
|
|
192
|
+
/* @__PURE__ */ jsx("span", { style: { width: 1, height: 20, background: "#d9d9d9", margin: "0 8px" } }),
|
|
193
|
+
/* @__PURE__ */ jsx(Tooltip, { placement: "topLeft", title: "无序列表", children: /* @__PURE__ */ jsx(
|
|
194
|
+
Button,
|
|
195
|
+
{
|
|
196
|
+
type: "text",
|
|
197
|
+
icon: /* @__PURE__ */ jsx(UnorderedListOutlined, {}),
|
|
198
|
+
onClick: () => editor.chain().focus().toggleBulletList().run(),
|
|
199
|
+
disabled: readonly,
|
|
200
|
+
className: editor.isActive("bulletList") ? "ant-btn-primary" : ""
|
|
201
|
+
}
|
|
202
|
+
) }),
|
|
203
|
+
/* @__PURE__ */ jsx(Tooltip, { placement: "topLeft", title: "有序列表", children: /* @__PURE__ */ jsx(
|
|
204
|
+
Button,
|
|
205
|
+
{
|
|
206
|
+
type: "text",
|
|
207
|
+
icon: /* @__PURE__ */ jsx(OrderedListOutlined, {}),
|
|
208
|
+
onClick: () => editor.chain().focus().toggleOrderedList().run(),
|
|
209
|
+
disabled: readonly,
|
|
210
|
+
className: editor.isActive("orderedList") ? "ant-btn-primary" : ""
|
|
211
|
+
}
|
|
212
|
+
) }),
|
|
213
|
+
/* @__PURE__ */ jsx("span", { style: { width: 1, height: 20, background: "#d9d9d9", margin: "0 8px" } }),
|
|
214
|
+
/* @__PURE__ */ jsx(Tooltip, { placement: "topLeft", title: "高亮", children: /* @__PURE__ */ jsx(
|
|
215
|
+
Button,
|
|
216
|
+
{
|
|
217
|
+
type: "text",
|
|
218
|
+
icon: /* @__PURE__ */ jsx(ToolOutlined, {}),
|
|
219
|
+
onClick: () => editor.chain().focus().toggleHighlight().run(),
|
|
220
|
+
disabled: readonly,
|
|
221
|
+
className: editor.isActive("highlight") ? "ant-btn-primary" : ""
|
|
222
|
+
}
|
|
223
|
+
) }),
|
|
224
|
+
/* @__PURE__ */ jsx("span", { style: { width: 1, height: 20, background: "#d9d9d9", margin: "0 8px" } }),
|
|
225
|
+
/* @__PURE__ */ jsx(Tooltip, { placement: "topLeft", title: "链接", children: /* @__PURE__ */ jsx(
|
|
226
|
+
Button,
|
|
227
|
+
{
|
|
228
|
+
type: "text",
|
|
229
|
+
icon: /* @__PURE__ */ jsx(LinkOutlined, {}),
|
|
230
|
+
onClick: () => {
|
|
231
|
+
const previousUrl = editor.getAttributes("link").href;
|
|
232
|
+
const url = window.prompt("请输入链接地址", previousUrl);
|
|
233
|
+
if (url === null) {
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
if (url === "") {
|
|
237
|
+
editor.chain().focus().extendMarkRange("link").unsetLink().run();
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
editor.chain().focus().extendMarkRange("link").setLink({ href: url }).run();
|
|
241
|
+
},
|
|
242
|
+
disabled: readonly
|
|
243
|
+
}
|
|
244
|
+
) }),
|
|
245
|
+
/* @__PURE__ */ jsx("span", { style: { width: 1, height: 20, background: "#d9d9d9", margin: "0 8px" } }),
|
|
246
|
+
/* @__PURE__ */ jsx(Tooltip, { placement: "topLeft", title: "撤销", children: /* @__PURE__ */ jsx(
|
|
247
|
+
Button,
|
|
248
|
+
{
|
|
249
|
+
type: "text",
|
|
250
|
+
icon: /* @__PURE__ */ jsx(UndoOutlined, {}),
|
|
251
|
+
onClick: () => editor.chain().focus().undo().run(),
|
|
252
|
+
disabled: readonly || !editor.can().undo()
|
|
253
|
+
}
|
|
254
|
+
) }),
|
|
255
|
+
/* @__PURE__ */ jsx(Tooltip, { placement: "topLeft", title: "前进", children: /* @__PURE__ */ jsx(
|
|
256
|
+
Button,
|
|
257
|
+
{
|
|
258
|
+
type: "text",
|
|
259
|
+
icon: /* @__PURE__ */ jsx(RedoOutlined, {}),
|
|
260
|
+
onClick: () => editor.chain().focus().redo().run(),
|
|
261
|
+
disabled: readonly || !editor.can().redo()
|
|
262
|
+
}
|
|
263
|
+
) })
|
|
264
|
+
] }) }),
|
|
265
|
+
/* @__PURE__ */ jsx("div", { onClick: () => editor.chain().focus().run(), children: /* @__PURE__ */ jsx(
|
|
266
|
+
EditorContent,
|
|
267
|
+
{
|
|
268
|
+
editor,
|
|
269
|
+
style: {
|
|
270
|
+
minHeight: 300,
|
|
271
|
+
padding: "8px",
|
|
272
|
+
outline: "none"
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
) })
|
|
276
|
+
] });
|
|
277
|
+
};
|
|
278
|
+
export {
|
|
279
|
+
MyRichText as default
|
|
280
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { Ijson } from '../index.d';
|
|
2
3
|
import { AxiosResponse } from 'axios';
|
|
3
4
|
declare const MySelect: ({ item, readonly, style, commonRequestWidthParams, commonRequest, value, onChange, interfaceTypeDict, interfaceTypeSysDict, actionUrlKey, actionUrlExtraParams, langId, getTitle, attrid, }: {
|
|
@@ -17,5 +18,5 @@ declare const MySelect: ({ item, readonly, style, commonRequestWidthParams, comm
|
|
|
17
18
|
langId?: string | undefined;
|
|
18
19
|
getTitle?: ((pageID: string, dataID: string) => string) | undefined;
|
|
19
20
|
attrid: string;
|
|
20
|
-
}) => import("react
|
|
21
|
+
}) => import("react").JSX.Element;
|
|
21
22
|
export default MySelect;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { handleSelectOptions, handleGetPlaceholder, findRowByValue } from "../func";
|
|
3
3
|
import { handleGetList, handleGetControlPanelConfig } from "../../../utils/szxkFunc";
|
|
4
4
|
import { useState, useEffect } from "react";
|
|
5
|
-
import { message, Select } from "antd";
|
|
5
|
+
import { message, Select, Divider, Flex, Checkbox } from "antd";
|
|
6
6
|
const MySelect = ({
|
|
7
7
|
item,
|
|
8
8
|
readonly,
|
|
@@ -16,11 +16,14 @@ const MySelect = ({
|
|
|
16
16
|
actionUrlKey,
|
|
17
17
|
actionUrlExtraParams,
|
|
18
18
|
langId,
|
|
19
|
+
// 新增:语言id,默认10001
|
|
19
20
|
getTitle,
|
|
21
|
+
// 新增:获取下拉框选项的语言匹配数据
|
|
20
22
|
attrid
|
|
21
23
|
}) => {
|
|
22
24
|
const [options, setOptions] = useState([]);
|
|
23
25
|
const [loading, setLoading] = useState(false);
|
|
26
|
+
const [checkedAll, setCheckedAll] = useState(false);
|
|
24
27
|
const [instanceList, setInstanceList] = useState([]);
|
|
25
28
|
useEffect(() => {
|
|
26
29
|
handleLoadOptions();
|
|
@@ -76,6 +79,22 @@ const MySelect = ({
|
|
|
76
79
|
setLoading(false);
|
|
77
80
|
}
|
|
78
81
|
};
|
|
82
|
+
const handleChange = (val) => {
|
|
83
|
+
if (attrid && (instanceList == null ? void 0 : instanceList.length) > 0 && (item == null ? void 0 : item.inputType) === "instance-url") {
|
|
84
|
+
const keyField = item == null ? void 0 : item["key-field"];
|
|
85
|
+
const row = findRowByValue(instanceList, String(val));
|
|
86
|
+
const keys = Object.keys(keyField || {});
|
|
87
|
+
const newObj = keys == null ? void 0 : keys.reduce((prev, cur) => {
|
|
88
|
+
const { list, delimiter } = (keyField == null ? void 0 : keyField[cur]) || {};
|
|
89
|
+
const value2 = list == null ? void 0 : list.map((x) => row == null ? void 0 : row[x]).join(delimiter || "-");
|
|
90
|
+
prev[cur] = value2;
|
|
91
|
+
return prev;
|
|
92
|
+
}, {});
|
|
93
|
+
onChange(newObj);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
onChange(val);
|
|
97
|
+
};
|
|
79
98
|
return /* @__PURE__ */ jsx(
|
|
80
99
|
Select,
|
|
81
100
|
{
|
|
@@ -94,20 +113,37 @@ const MySelect = ({
|
|
|
94
113
|
maxTagCount: 1,
|
|
95
114
|
allowClear: true,
|
|
96
115
|
onChange: (val) => {
|
|
97
|
-
if (
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
const { list, delimiter } = (keyField == null ? void 0 : keyField[cur]) || {};
|
|
103
|
-
const value2 = list == null ? void 0 : list.map((x) => row == null ? void 0 : row[x]).join(delimiter || "-");
|
|
104
|
-
prev[cur] = value2;
|
|
105
|
-
return prev;
|
|
106
|
-
}, {});
|
|
107
|
-
onChange(newObj);
|
|
108
|
-
return;
|
|
116
|
+
if (Array.isArray(val) && (item == null ? void 0 : item["custom-operation"]) && item.input === "mult-select") {
|
|
117
|
+
setCheckedAll(false);
|
|
118
|
+
if ((val == null ? void 0 : val.length) === (options == null ? void 0 : options.length)) {
|
|
119
|
+
setCheckedAll(true);
|
|
120
|
+
}
|
|
109
121
|
}
|
|
110
|
-
|
|
122
|
+
handleChange(val);
|
|
123
|
+
},
|
|
124
|
+
popupRender: (menu) => {
|
|
125
|
+
var _a;
|
|
126
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
127
|
+
menu,
|
|
128
|
+
(item == null ? void 0 : item["custom-operation"]) && item.input === "mult-select" && ((_a = item == null ? void 0 : item["operation-types"]) == null ? void 0 : _a.includes("check-all")) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
129
|
+
/* @__PURE__ */ jsx(Divider, { style: { margin: "8px 0" } }),
|
|
130
|
+
/* @__PURE__ */ jsxs(Flex, { justify: "space-between", children: [
|
|
131
|
+
/* @__PURE__ */ jsx("div", {}),
|
|
132
|
+
/* @__PURE__ */ jsx(
|
|
133
|
+
Checkbox,
|
|
134
|
+
{
|
|
135
|
+
checked: checkedAll,
|
|
136
|
+
onChange: (e) => {
|
|
137
|
+
const val = e.target.checked ? options == null ? void 0 : options.map((v) => v.value) : [];
|
|
138
|
+
setCheckedAll(e.target.checked);
|
|
139
|
+
handleChange(val);
|
|
140
|
+
},
|
|
141
|
+
children: langId === "10001" ? "全选" : "check all"
|
|
142
|
+
}
|
|
143
|
+
)
|
|
144
|
+
] })
|
|
145
|
+
] })
|
|
146
|
+
] });
|
|
111
147
|
}
|
|
112
148
|
}
|
|
113
149
|
);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { UploadFile } from 'antd/es/upload/interface';
|
|
2
3
|
import { Ijson } from '../index.d';
|
|
3
4
|
interface IMYUpload {
|
|
@@ -13,5 +14,5 @@ interface IMYUpload {
|
|
|
13
14
|
relatedidKey: string;
|
|
14
15
|
langId?: string;
|
|
15
16
|
}
|
|
16
|
-
declare const MyUpload: (props: IMYUpload) => import("react
|
|
17
|
+
declare const MyUpload: (props: IMYUpload) => import("react").JSX.Element;
|
|
17
18
|
export default MyUpload;
|
|
@@ -9,5 +9,5 @@ interface RadioCardProps {
|
|
|
9
9
|
commonRequestWidthParams: (params: object, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
10
10
|
langId?: string;
|
|
11
11
|
}
|
|
12
|
-
declare const RadioCard: ({ item, readonly, value, onChange, style, commonRequestWidthParams, langId }: RadioCardProps) => import("react
|
|
12
|
+
declare const RadioCard: ({ item, readonly, value, onChange, style, commonRequestWidthParams, langId }: RadioCardProps) => import("react").JSX.Element;
|
|
13
13
|
export default RadioCard;
|
|
@@ -12,7 +12,7 @@ interface SelectModelProps {
|
|
|
12
12
|
CustomModalComponent?: React.FC<ICustomModal>;
|
|
13
13
|
langId?: string;
|
|
14
14
|
}
|
|
15
|
-
declare function SelectModel(props: SelectModelProps):
|
|
15
|
+
declare function SelectModel(props: SelectModelProps): React.JSX.Element;
|
|
16
16
|
/**
|
|
17
17
|
*
|
|
18
18
|
* @param selectedRows 选中的行数据
|
|
@@ -18,5 +18,5 @@ interface SelectModelProps {
|
|
|
18
18
|
form: FormInstance;
|
|
19
19
|
langId?: string;
|
|
20
20
|
}
|
|
21
|
-
declare function SelectModel(props: SelectModelProps):
|
|
21
|
+
declare function SelectModel(props: SelectModelProps): React.JSX.Element;
|
|
22
22
|
export default SelectModel;
|
|
@@ -37,7 +37,7 @@ declare function useDynamicForm(props: IDynamicFormProps): {
|
|
|
37
37
|
isFormListItem?: boolean | undefined;
|
|
38
38
|
formListField?: NestedFormListFieldData | undefined;
|
|
39
39
|
isShowLabel?: boolean | undefined;
|
|
40
|
-
}) => import("react
|
|
40
|
+
}) => import("react").JSX.Element | null;
|
|
41
41
|
handleSetFormItemInitialValue: (itemWithJson: IformConfigItem) => any;
|
|
42
42
|
};
|
|
43
43
|
export default useDynamicForm;
|