@chlp-tech/rpa-ui 0.0.1
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/LICENSE +21 -0
- package/README.md +43 -0
- package/dist/account-select/imgs/down.svg +24 -0
- package/dist/account-select/imgs/fb-disabled.svg +27 -0
- package/dist/account-select/imgs/fb.svg +20 -0
- package/dist/account-select/imgs/up.svg +20 -0
- package/dist/account-select/index.d.ts +39 -0
- package/dist/account-select/index.js +221 -0
- package/dist/account-select/index.module.less +58 -0
- package/dist/ai-empty/index.d.ts +3 -0
- package/dist/ai-empty/index.js +51 -0
- package/dist/ai-empty/index.module.less +60 -0
- package/dist/batch-label/index.d.ts +14 -0
- package/dist/batch-label/index.js +215 -0
- package/dist/batch-label/index.module.less +96 -0
- package/dist/card-scroll/index.d.ts +6 -0
- package/dist/card-scroll/index.js +75 -0
- package/dist/components/modal/index.d.ts +16 -0
- package/dist/components/modal/index.js +70 -0
- package/dist/cover-modal/boll.gif +0 -0
- package/dist/cover-modal/delete.svg +24 -0
- package/dist/cover-modal/index.d.ts +20 -0
- package/dist/cover-modal/index.js +410 -0
- package/dist/cover-modal/index.module.less +76 -0
- package/dist/cover-modal/question.svg +1 -0
- package/dist/cover-modal/upload.png +0 -0
- package/dist/custom.d.ts +10 -0
- package/dist/drawer-task/img/back.png +0 -0
- package/dist/drawer-task/img/close.svg +18 -0
- package/dist/drawer-task/img/icon.svg +20 -0
- package/dist/drawer-task/index.d.ts +24 -0
- package/dist/drawer-task/index.js +130 -0
- package/dist/drawer-task/index.module.less +85 -0
- package/dist/dynamic-form/index.d.ts +33 -0
- package/dist/dynamic-form/index.js +154 -0
- package/dist/excel-import/excel-import.module.less +32 -0
- package/dist/excel-import/index.d.ts +10 -0
- package/dist/excel-import/index.js +76 -0
- package/dist/form-item/index.d.ts +12 -0
- package/dist/form-item/index.js +34 -0
- package/dist/form-item/index.module.less +45 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +22 -0
- package/dist/label-select/imgs/close.svg +24 -0
- package/dist/label-select/imgs/plus.svg +24 -0
- package/dist/label-select/index.d.ts +10 -0
- package/dist/label-select/index.js +173 -0
- package/dist/label-select/index.module.less +25 -0
- package/dist/layout/index.d.ts +3 -0
- package/dist/layout/index.js +10 -0
- package/dist/layout/index.module.less +6 -0
- package/dist/link-filter/index.d.ts +25 -0
- package/dist/link-filter/index.js +242 -0
- package/dist/link-filter/index.module.less +7 -0
- package/dist/media-play/close.svg +1 -0
- package/dist/media-play/index.d.ts +13 -0
- package/dist/media-play/index.js +245 -0
- package/dist/media-play/index.module.less +196 -0
- package/dist/media-play/play.svg +17 -0
- package/dist/modal-wrapper/index.d.ts +17 -0
- package/dist/modal-wrapper/index.js +66 -0
- package/dist/publish-account/imgs/close.svg +25 -0
- package/dist/publish-account/imgs/fb.svg +20 -0
- package/dist/publish-account/imgs/ins.svg +36 -0
- package/dist/publish-account/imgs/tk.svg +31 -0
- package/dist/publish-account/imgs/tt.svg +21 -0
- package/dist/publish-account/imgs/yt.svg +25 -0
- package/dist/publish-account/index.d.ts +31 -0
- package/dist/publish-account/index.js +118 -0
- package/dist/publish-account/index.module.less +70 -0
- package/dist/publish-status/imgs/fail.svg +22 -0
- package/dist/publish-status/imgs/process.svg +24 -0
- package/dist/publish-status/imgs/publish.svg +24 -0
- package/dist/publish-status/imgs/success.svg +22 -0
- package/dist/publish-status/imgs/wait.svg +22 -0
- package/dist/publish-status/index.d.ts +5 -0
- package/dist/publish-status/index.js +55 -0
- package/dist/publish-status/index.module.less +8 -0
- package/dist/release-manage/index.d.ts +6 -0
- package/dist/release-manage/index.js +5 -0
- package/dist/release-manage/release-title/index.d.ts +10 -0
- package/dist/release-manage/release-title/index.js +94 -0
- package/dist/release-manage/release-title/index.module.less +21 -0
- package/dist/release-manage/release-title/plus.svg +20 -0
- package/dist/release-video-card/imgs/detail.svg +21 -0
- package/dist/release-video-card/imgs/edit.svg +19 -0
- package/dist/release-video-card/imgs/fail.svg +22 -0
- package/dist/release-video-card/imgs/fb.svg +20 -0
- package/dist/release-video-card/imgs/ins.svg +34 -0
- package/dist/release-video-card/imgs/more.svg +18 -0
- package/dist/release-video-card/imgs/new.svg +22 -0
- package/dist/release-video-card/imgs/play.svg +17 -0
- package/dist/release-video-card/imgs/process.svg +24 -0
- package/dist/release-video-card/imgs/publish.svg +24 -0
- package/dist/release-video-card/imgs/success.svg +22 -0
- package/dist/release-video-card/imgs/tk.svg +29 -0
- package/dist/release-video-card/imgs/tw.svg +21 -0
- package/dist/release-video-card/imgs/wait.svg +22 -0
- package/dist/release-video-card/imgs/yt.svg +25 -0
- package/dist/release-video-card/imgs/ytb.svg +1 -0
- package/dist/release-video-card/index.d.ts +35 -0
- package/dist/release-video-card/index.js +221 -0
- package/dist/release-video-card/index.module.less +223 -0
- package/dist/sound-wave/index.d.ts +3 -0
- package/dist/sound-wave/index.js +22 -0
- package/dist/sound-wave/index.module.less +105 -0
- package/dist/text-ellipsis/index.d.ts +8 -0
- package/dist/text-ellipsis/index.js +57 -0
- package/dist/text-ellipsis/index.module.less +8 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.js +101 -0
- package/dist/video-list/delete.svg +26 -0
- package/dist/video-list/index.d.ts +46 -0
- package/dist/video-list/index.js +219 -0
- package/dist/video-list/index.module.less +127 -0
- package/package.json +83 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { default as CardScroll } from "./card-scroll";
|
|
2
|
+
export { default as ExcelImport } from "./excel-import";
|
|
3
|
+
export { default as LinkFilter } from "./link-filter";
|
|
4
|
+
export { default as ModalWrapper } from "./modal-wrapper";
|
|
5
|
+
export { default as ReleaseComponent } from "./release-manage";
|
|
6
|
+
export { default as ReleaseVideoCard } from "./release-video-card";
|
|
7
|
+
export { default as Layout } from "./layout";
|
|
8
|
+
export { default as MediaPlay } from "./media-play";
|
|
9
|
+
export { default as TextEllipsis } from "./text-ellipsis";
|
|
10
|
+
export { default as DynamicForm } from "./dynamic-form";
|
|
11
|
+
export { default as DrawerTask } from "./drawer-task";
|
|
12
|
+
export { default as StatusTag } from "./publish-status";
|
|
13
|
+
export { default as AccountComponent } from "./publish-account";
|
|
14
|
+
export { default as AccountSelectList } from "./account-select";
|
|
15
|
+
export { default as LabelSelect } from "./label-select";
|
|
16
|
+
export { default as BatchLabel } from "./batch-label";
|
|
17
|
+
export { default as VideoList } from "./video-list";
|
|
18
|
+
export { default as FormItem } from "./form-item";
|
|
19
|
+
export { default as SoundWave } from "./sound-wave";
|
|
20
|
+
export { default as AiEmpty } from "./ai-empty";
|
|
21
|
+
export { default as CoverModal } from "./cover-modal";
|
|
22
|
+
export { mapToMockData } from "./utils";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="12px" height="12px" viewBox="0 0 12 12" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<!-- Generator: Sketch 62 (91390) - https://sketch.com -->
|
|
4
|
+
<title>矩形</title>
|
|
5
|
+
<desc>Created with Sketch.</desc>
|
|
6
|
+
<g id="发布管理" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
|
|
7
|
+
<g id="发布管理-新建视频任务-内容填充-账号发布规则异常" transform="translate(-678.000000, -1303.000000)" stroke="#9EA7B5">
|
|
8
|
+
<g id="编组-16" transform="translate(420.000000, 30.000000)">
|
|
9
|
+
<g id="编组-24" transform="translate(24.000000, 593.000000)">
|
|
10
|
+
<g id="编组-29" transform="translate(100.000000, 138.000000)">
|
|
11
|
+
<g id="编组-23" transform="translate(24.000000, 502.000000)">
|
|
12
|
+
<g id="tag备份-5" transform="translate(6.000000, 34.000000)">
|
|
13
|
+
<g id="编组" transform="translate(104.000000, 6.000000)">
|
|
14
|
+
<line x1="3" y1="3" x2="9" y2="9" id="路径"></line>
|
|
15
|
+
<line x1="3" y1="9" x2="9" y2="3" id="路径"></line>
|
|
16
|
+
</g>
|
|
17
|
+
</g>
|
|
18
|
+
</g>
|
|
19
|
+
</g>
|
|
20
|
+
</g>
|
|
21
|
+
</g>
|
|
22
|
+
</g>
|
|
23
|
+
</g>
|
|
24
|
+
</svg>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="12px" height="12px" viewBox="0 0 12 12" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<!-- Generator: Sketch 62 (91390) - https://sketch.com -->
|
|
4
|
+
<title>矩形</title>
|
|
5
|
+
<desc>Created with Sketch.</desc>
|
|
6
|
+
<g id="发布管理" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
|
|
7
|
+
<g id="发布管理-新建视频任务-内容填充-账号发布规则异常" transform="translate(-704.000000, -1303.000000)" stroke="#004FD3">
|
|
8
|
+
<g id="编组-16" transform="translate(420.000000, 30.000000)">
|
|
9
|
+
<g id="编组-24" transform="translate(24.000000, 593.000000)">
|
|
10
|
+
<g id="编组-29" transform="translate(100.000000, 138.000000)">
|
|
11
|
+
<g id="编组-23" transform="translate(24.000000, 502.000000)">
|
|
12
|
+
<g id="tag备份-7" transform="translate(132.000000, 34.000000)">
|
|
13
|
+
<g id="编组" transform="translate(4.000000, 6.000000)">
|
|
14
|
+
<line x1="1.75735931" y1="6" x2="10.2426407" y2="6" id="路径"></line>
|
|
15
|
+
<line x1="6" y1="10.2426407" x2="6" y2="1.75735931" id="路径"></line>
|
|
16
|
+
</g>
|
|
17
|
+
</g>
|
|
18
|
+
</g>
|
|
19
|
+
</g>
|
|
20
|
+
</g>
|
|
21
|
+
</g>
|
|
22
|
+
</g>
|
|
23
|
+
</g>
|
|
24
|
+
</svg>
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
4
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
5
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
10
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
import React, { useMemo, useState, useEffect } from "react";
|
|
12
|
+
import { Input, Dropdown } from "antd";
|
|
13
|
+
import styles from "./index.module.less";
|
|
14
|
+
import CloseIcon from "./imgs/close.svg";
|
|
15
|
+
import PlusIcon from "./imgs/plus.svg";
|
|
16
|
+
var Tag = function Tag(props) {
|
|
17
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
18
|
+
className: styles['tab_wrap'],
|
|
19
|
+
style: props.style,
|
|
20
|
+
onClick: props.onClick
|
|
21
|
+
}, props.type !== "add" ? /*#__PURE__*/React.createElement("div", null, props.prefix) : /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("img", {
|
|
22
|
+
width: 12,
|
|
23
|
+
height: 12,
|
|
24
|
+
src: PlusIcon,
|
|
25
|
+
alt: ''
|
|
26
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
27
|
+
style: {
|
|
28
|
+
color: props.type !== "add" ? '#142A51' : '#004FD3'
|
|
29
|
+
}
|
|
30
|
+
}, props.label), props.type !== "add" && /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
style: {
|
|
32
|
+
cursor: "pointer",
|
|
33
|
+
marginLeft: 8
|
|
34
|
+
},
|
|
35
|
+
onClick: function onClick(e) {
|
|
36
|
+
var _props$onClose;
|
|
37
|
+
e.stopPropagation();
|
|
38
|
+
(_props$onClose = props.onClose) === null || _props$onClose === void 0 || _props$onClose.call(props);
|
|
39
|
+
}
|
|
40
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
41
|
+
width: 12,
|
|
42
|
+
height: 12,
|
|
43
|
+
src: CloseIcon,
|
|
44
|
+
alt: ''
|
|
45
|
+
})));
|
|
46
|
+
};
|
|
47
|
+
var LabelSelect = function LabelSelect(props) {
|
|
48
|
+
var _useState = useState(false),
|
|
49
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
50
|
+
isActive = _useState2[0],
|
|
51
|
+
setIsActive = _useState2[1];
|
|
52
|
+
var _useState3 = useState([]),
|
|
53
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
54
|
+
tags = _useState4[0],
|
|
55
|
+
setTags = _useState4[1];
|
|
56
|
+
var _useState5 = useState([]),
|
|
57
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
58
|
+
selectKeys = _useState6[0],
|
|
59
|
+
setSelectKeys = _useState6[1];
|
|
60
|
+
var _useState7 = useState(false),
|
|
61
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
62
|
+
open = _useState8[0],
|
|
63
|
+
setOpen = _useState8[1];
|
|
64
|
+
var handleChangeStatus = function handleChangeStatus() {
|
|
65
|
+
setIsActive(!isActive);
|
|
66
|
+
};
|
|
67
|
+
useEffect(function () {
|
|
68
|
+
setTags(props.value || []);
|
|
69
|
+
}, [props.value]);
|
|
70
|
+
var handleSetTag = function handleSetTag(label) {
|
|
71
|
+
if (label && !tags.includes(label)) {
|
|
72
|
+
var _props$onChange;
|
|
73
|
+
var newTags = [].concat(_toConsumableArray(tags), [label]);
|
|
74
|
+
setTags(newTags);
|
|
75
|
+
(_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, newTags);
|
|
76
|
+
setSelectKeys(newTags);
|
|
77
|
+
}
|
|
78
|
+
setIsActive(false);
|
|
79
|
+
};
|
|
80
|
+
var handleSelectKey = function handleSelectKey(e) {
|
|
81
|
+
var _props$onChange2;
|
|
82
|
+
var key = e.key;
|
|
83
|
+
var newTags = _toConsumableArray(tags);
|
|
84
|
+
var newSelectKeys = _toConsumableArray(selectKeys);
|
|
85
|
+
if (newSelectKeys.includes(key) && props.isMulti) {
|
|
86
|
+
newTags = newTags.filter(function (tag) {
|
|
87
|
+
return tag !== key;
|
|
88
|
+
});
|
|
89
|
+
newSelectKeys = newSelectKeys.filter(function (selectedKey) {
|
|
90
|
+
return selectedKey !== key;
|
|
91
|
+
});
|
|
92
|
+
} else {
|
|
93
|
+
newTags.push(key);
|
|
94
|
+
newSelectKeys.push(key);
|
|
95
|
+
}
|
|
96
|
+
setTags(newTags);
|
|
97
|
+
(_props$onChange2 = props.onChange) === null || _props$onChange2 === void 0 || _props$onChange2.call(props, newTags);
|
|
98
|
+
setSelectKeys(newSelectKeys);
|
|
99
|
+
};
|
|
100
|
+
var handleRemoveTag = function handleRemoveTag(index) {
|
|
101
|
+
var _props$onChange3;
|
|
102
|
+
var newTags = tags.filter(function (_, i) {
|
|
103
|
+
return i !== index;
|
|
104
|
+
});
|
|
105
|
+
var newSelectKeys = selectKeys.filter(function (_, i) {
|
|
106
|
+
return i !== index;
|
|
107
|
+
});
|
|
108
|
+
setTags(newTags);
|
|
109
|
+
(_props$onChange3 = props.onChange) === null || _props$onChange3 === void 0 || _props$onChange3.call(props, newTags);
|
|
110
|
+
setSelectKeys(newSelectKeys);
|
|
111
|
+
};
|
|
112
|
+
var renderContentTag = useMemo(function () {
|
|
113
|
+
if (isActive) {
|
|
114
|
+
return /*#__PURE__*/React.createElement(Input, {
|
|
115
|
+
style: {
|
|
116
|
+
width: 150
|
|
117
|
+
},
|
|
118
|
+
prefix: props.prefix,
|
|
119
|
+
onBlur: function onBlur(e) {
|
|
120
|
+
return handleSetTag(e.target.value);
|
|
121
|
+
},
|
|
122
|
+
onPressEnter: function onPressEnter(e) {
|
|
123
|
+
return handleSetTag(e.target.value);
|
|
124
|
+
},
|
|
125
|
+
autoFocus: true
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
return /*#__PURE__*/React.createElement(Tag, {
|
|
129
|
+
label: '添加',
|
|
130
|
+
type: 'add',
|
|
131
|
+
style: {
|
|
132
|
+
// width: 56,
|
|
133
|
+
background: '#E9F1FF',
|
|
134
|
+
cursor: 'pointer'
|
|
135
|
+
},
|
|
136
|
+
onClick: handleChangeStatus
|
|
137
|
+
});
|
|
138
|
+
}, [isActive]);
|
|
139
|
+
var onOpenChange = function onOpenChange(nextOpen, info) {
|
|
140
|
+
if (info.source === 'trigger' || nextOpen) {
|
|
141
|
+
setOpen(nextOpen);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
145
|
+
trigger: ['click'],
|
|
146
|
+
open: open,
|
|
147
|
+
onOpenChange: onOpenChange,
|
|
148
|
+
menu: {
|
|
149
|
+
items: props.options.map(function (option) {
|
|
150
|
+
return {
|
|
151
|
+
key: option.value,
|
|
152
|
+
label: option.label
|
|
153
|
+
};
|
|
154
|
+
}),
|
|
155
|
+
// selectable: true,
|
|
156
|
+
onClick: handleSelectKey
|
|
157
|
+
// selectedKeys: selectKeys,
|
|
158
|
+
}
|
|
159
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
160
|
+
className: styles['input_wrap']
|
|
161
|
+
}, tags.map(function (label, index) {
|
|
162
|
+
return /*#__PURE__*/React.createElement(Tag, {
|
|
163
|
+
key: index,
|
|
164
|
+
prefix: props.prefix,
|
|
165
|
+
label: label,
|
|
166
|
+
type: undefined,
|
|
167
|
+
onClose: function onClose() {
|
|
168
|
+
return handleRemoveTag(index);
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
}), renderContentTag));
|
|
172
|
+
};
|
|
173
|
+
export default LabelSelect;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
.tab_wrap {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
color: #004FD3;
|
|
5
|
+
gap: 2px;
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
background: #ECEFF4;
|
|
8
|
+
border-radius: 3px;
|
|
9
|
+
padding: 6px 8px;
|
|
10
|
+
margin: 6px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
.input_wrap {
|
|
15
|
+
//width: 100%;
|
|
16
|
+
//min-height: 36px;
|
|
17
|
+
background: #FFFFFF;
|
|
18
|
+
border-radius: 8px;
|
|
19
|
+
border: 1px solid #D4DBE7;
|
|
20
|
+
padding: 6px;
|
|
21
|
+
display: flex;
|
|
22
|
+
gap: 6px;
|
|
23
|
+
//flex: 1;
|
|
24
|
+
flex-wrap: wrap;
|
|
25
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
// @ts-ignore
|
|
3
|
+
import styles from "./index.module.less";
|
|
4
|
+
var Layout = function Layout(props) {
|
|
5
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
6
|
+
className: styles['wrap'],
|
|
7
|
+
style: props.style
|
|
8
|
+
}, props.children);
|
|
9
|
+
};
|
|
10
|
+
export default Layout;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { FC } from "react";
|
|
2
|
+
interface LinkedFilterProps {
|
|
3
|
+
onChange: (value: any) => void;
|
|
4
|
+
multipleIcon: React.ReactNode;
|
|
5
|
+
config: ConfigItem[];
|
|
6
|
+
isShow?: string[];
|
|
7
|
+
}
|
|
8
|
+
interface ConfigItem {
|
|
9
|
+
key: string;
|
|
10
|
+
label: string;
|
|
11
|
+
width?: number | string;
|
|
12
|
+
defaultValue?: any;
|
|
13
|
+
type: "input" | "select" | "rangeDate" | "spaceCompact";
|
|
14
|
+
isAllowClear?: boolean;
|
|
15
|
+
placeholder: string;
|
|
16
|
+
mode?: "multiple" | "tags";
|
|
17
|
+
children: ConfigItem[];
|
|
18
|
+
options?: any[];
|
|
19
|
+
request?: () => Promise<any>;
|
|
20
|
+
validation?: any;
|
|
21
|
+
filterOption?: (input: any, option: any) => any;
|
|
22
|
+
handleResponse?: (response: any) => any[];
|
|
23
|
+
}
|
|
24
|
+
declare const LinkedFilter: FC<LinkedFilterProps>;
|
|
25
|
+
export default LinkedFilter;
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
10
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
import React, { useState, useEffect, useMemo } from "react";
|
|
12
|
+
import { Form, Input, Select, Button, Modal, Badge, DatePicker, Space } from "antd";
|
|
13
|
+
import styles from "./index.module.less";
|
|
14
|
+
var Option = Select.Option;
|
|
15
|
+
var RangePicker = DatePicker.RangePicker;
|
|
16
|
+
var LinkedFilter = function LinkedFilter(_ref) {
|
|
17
|
+
var _config$find;
|
|
18
|
+
var _onChange = _ref.onChange,
|
|
19
|
+
config = _ref.config,
|
|
20
|
+
multipleIcon = _ref.multipleIcon,
|
|
21
|
+
_ref$isShow = _ref.isShow,
|
|
22
|
+
isShow = _ref$isShow === void 0 ? [] : _ref$isShow;
|
|
23
|
+
var initialSelectValue = ((_config$find = config.find(function (item) {
|
|
24
|
+
return !isShow.includes(item.key);
|
|
25
|
+
})) === null || _config$find === void 0 ? void 0 : _config$find.key) || null;
|
|
26
|
+
var _useState = useState(initialSelectValue),
|
|
27
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
28
|
+
singleSelectValue = _useState2[0],
|
|
29
|
+
setSingleSelectValue = _useState2[1];
|
|
30
|
+
var _useState3 = useState({}),
|
|
31
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
32
|
+
multiSelectValues = _useState4[0],
|
|
33
|
+
setMultiSelectValues = _useState4[1];
|
|
34
|
+
var _useState5 = useState(false),
|
|
35
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
36
|
+
isModalVisible = _useState6[0],
|
|
37
|
+
setIsModalVisible = _useState6[1];
|
|
38
|
+
var _Form$useForm = Form.useForm(),
|
|
39
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
40
|
+
dynamicForm = _Form$useForm2[0];
|
|
41
|
+
var _Form$useForm3 = Form.useForm(),
|
|
42
|
+
_Form$useForm4 = _slicedToArray(_Form$useForm3, 1),
|
|
43
|
+
multilineForm = _Form$useForm4[0];
|
|
44
|
+
useEffect(function () {
|
|
45
|
+
config.forEach( /*#__PURE__*/function () {
|
|
46
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(item) {
|
|
47
|
+
var _response;
|
|
48
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
49
|
+
while (1) switch (_context.prev = _context.next) {
|
|
50
|
+
case 0:
|
|
51
|
+
if (!item.request) {
|
|
52
|
+
_context.next = 5;
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
_context.next = 3;
|
|
56
|
+
return item.request();
|
|
57
|
+
case 3:
|
|
58
|
+
_response = _context.sent;
|
|
59
|
+
item.options = item.handleResponse ? item.handleResponse(_response) : _response;
|
|
60
|
+
case 5:
|
|
61
|
+
case "end":
|
|
62
|
+
return _context.stop();
|
|
63
|
+
}
|
|
64
|
+
}, _callee);
|
|
65
|
+
}));
|
|
66
|
+
return function (_x) {
|
|
67
|
+
return _ref2.apply(this, arguments);
|
|
68
|
+
};
|
|
69
|
+
}());
|
|
70
|
+
}, [config]);
|
|
71
|
+
var handleSingleSelectChange = /*#__PURE__*/function () {
|
|
72
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
73
|
+
var values;
|
|
74
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
75
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
76
|
+
case 0:
|
|
77
|
+
multilineForm.resetFields();
|
|
78
|
+
setMultiSelectValues({});
|
|
79
|
+
_context2.next = 4;
|
|
80
|
+
return dynamicForm.validateFields();
|
|
81
|
+
case 4:
|
|
82
|
+
values = _context2.sent;
|
|
83
|
+
_onChange(values);
|
|
84
|
+
case 6:
|
|
85
|
+
case "end":
|
|
86
|
+
return _context2.stop();
|
|
87
|
+
}
|
|
88
|
+
}, _callee2);
|
|
89
|
+
}));
|
|
90
|
+
return function handleSingleSelectChange() {
|
|
91
|
+
return _ref3.apply(this, arguments);
|
|
92
|
+
};
|
|
93
|
+
}();
|
|
94
|
+
var handleModalOk = /*#__PURE__*/function () {
|
|
95
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
96
|
+
var values;
|
|
97
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
98
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
99
|
+
case 0:
|
|
100
|
+
_context3.next = 2;
|
|
101
|
+
return multilineForm.validateFields();
|
|
102
|
+
case 2:
|
|
103
|
+
values = _context3.sent;
|
|
104
|
+
setMultiSelectValues(values);
|
|
105
|
+
dynamicForm.resetFields();
|
|
106
|
+
setIsModalVisible(false);
|
|
107
|
+
_onChange(values);
|
|
108
|
+
case 7:
|
|
109
|
+
case "end":
|
|
110
|
+
return _context3.stop();
|
|
111
|
+
}
|
|
112
|
+
}, _callee3);
|
|
113
|
+
}));
|
|
114
|
+
return function handleModalOk() {
|
|
115
|
+
return _ref4.apply(this, arguments);
|
|
116
|
+
};
|
|
117
|
+
}();
|
|
118
|
+
var handleModalCancel = function handleModalCancel() {
|
|
119
|
+
setIsModalVisible(false);
|
|
120
|
+
};
|
|
121
|
+
var showMultiSelectModal = function showMultiSelectModal() {
|
|
122
|
+
setIsModalVisible(true);
|
|
123
|
+
};
|
|
124
|
+
var renderFormItem = function renderFormItem(item, singleItem, noStyle) {
|
|
125
|
+
var _item$width, _item$width2, _item$mode, _item$width3;
|
|
126
|
+
switch (item.type) {
|
|
127
|
+
case "input":
|
|
128
|
+
return /*#__PURE__*/React.createElement(Form.Item, {
|
|
129
|
+
key: item.key,
|
|
130
|
+
name: item.key,
|
|
131
|
+
noStyle: noStyle,
|
|
132
|
+
label: singleItem ? undefined : item.label,
|
|
133
|
+
initialValue: item.defaultValue,
|
|
134
|
+
rules: item.validation
|
|
135
|
+
}, singleItem ? /*#__PURE__*/React.createElement(Input.Search, {
|
|
136
|
+
allowClear: !item.isAllowClear,
|
|
137
|
+
placeholder: item.placeholder,
|
|
138
|
+
onSearch: handleSingleSelectChange,
|
|
139
|
+
style: {
|
|
140
|
+
width: (_item$width = item.width) !== null && _item$width !== void 0 ? _item$width : 300
|
|
141
|
+
}
|
|
142
|
+
}) : /*#__PURE__*/React.createElement(Input, {
|
|
143
|
+
allowClear: !item.isAllowClear,
|
|
144
|
+
placeholder: item.placeholder,
|
|
145
|
+
style: {
|
|
146
|
+
width: (_item$width2 = item.width) !== null && _item$width2 !== void 0 ? _item$width2 : 300
|
|
147
|
+
}
|
|
148
|
+
}));
|
|
149
|
+
case "select":
|
|
150
|
+
return /*#__PURE__*/React.createElement(Form.Item, {
|
|
151
|
+
key: item.key,
|
|
152
|
+
name: item.key,
|
|
153
|
+
noStyle: noStyle,
|
|
154
|
+
label: singleItem ? undefined : item.label,
|
|
155
|
+
initialValue: item.defaultValue,
|
|
156
|
+
rules: item.validation
|
|
157
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
158
|
+
allowClear: !item.isAllowClear,
|
|
159
|
+
className: styles['custom-select'],
|
|
160
|
+
placeholder: item.placeholder,
|
|
161
|
+
options: item.options,
|
|
162
|
+
onChange: singleItem ? handleSingleSelectChange : undefined,
|
|
163
|
+
mode: (_item$mode = item.mode) !== null && _item$mode !== void 0 ? _item$mode : 'tags',
|
|
164
|
+
filterOption: item.filterOption,
|
|
165
|
+
style: {
|
|
166
|
+
width: (_item$width3 = item.width) !== null && _item$width3 !== void 0 ? _item$width3 : 300
|
|
167
|
+
},
|
|
168
|
+
showSearch: true
|
|
169
|
+
}));
|
|
170
|
+
case 'rangeDate':
|
|
171
|
+
return /*#__PURE__*/React.createElement(Form.Item, {
|
|
172
|
+
key: item.key,
|
|
173
|
+
name: item.key,
|
|
174
|
+
noStyle: noStyle,
|
|
175
|
+
label: singleItem ? undefined : item.label,
|
|
176
|
+
initialValue: item.defaultValue,
|
|
177
|
+
rules: item.validation
|
|
178
|
+
}, /*#__PURE__*/React.createElement(RangePicker, {
|
|
179
|
+
onChange: singleItem ? handleSingleSelectChange : undefined
|
|
180
|
+
}));
|
|
181
|
+
case "spaceCompact":
|
|
182
|
+
return /*#__PURE__*/React.createElement(Form.Item, {
|
|
183
|
+
key: item.key,
|
|
184
|
+
label: singleItem ? undefined : item.label
|
|
185
|
+
}, /*#__PURE__*/React.createElement(Space.Compact, null, item.children.map(function (child) {
|
|
186
|
+
return renderFormItem(child, singleItem, true);
|
|
187
|
+
})));
|
|
188
|
+
default:
|
|
189
|
+
return null;
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
var renderSingleItem = useMemo(function () {
|
|
193
|
+
var selectedItem = config.find(function (item) {
|
|
194
|
+
return item.key === singleSelectValue;
|
|
195
|
+
});
|
|
196
|
+
return selectedItem ? renderFormItem(selectedItem, true) : null;
|
|
197
|
+
}, [singleSelectValue]);
|
|
198
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
199
|
+
className: "mb-6"
|
|
200
|
+
}, /*#__PURE__*/React.createElement(Form, {
|
|
201
|
+
layout: "inline",
|
|
202
|
+
form: dynamicForm
|
|
203
|
+
}, /*#__PURE__*/React.createElement(Form.Item, null, /*#__PURE__*/React.createElement(Select, {
|
|
204
|
+
defaultValue: singleSelectValue,
|
|
205
|
+
onChange: function onChange(value) {
|
|
206
|
+
setSingleSelectValue(value);
|
|
207
|
+
dynamicForm.resetFields();
|
|
208
|
+
_onChange(undefined);
|
|
209
|
+
},
|
|
210
|
+
style: {
|
|
211
|
+
width: "150px"
|
|
212
|
+
},
|
|
213
|
+
placeholder: "\u9009\u62E9\u4E00\u4E2A\u9009\u9879"
|
|
214
|
+
}, config.map(function (item) {
|
|
215
|
+
return isShow && isShow.includes(item.key) ? null : /*#__PURE__*/React.createElement(Option, {
|
|
216
|
+
key: item.key,
|
|
217
|
+
value: item.key
|
|
218
|
+
}, item.label);
|
|
219
|
+
}))), renderSingleItem, /*#__PURE__*/React.createElement(Badge, {
|
|
220
|
+
count: Object.values(multiSelectValues).filter(function (v) {
|
|
221
|
+
return v;
|
|
222
|
+
}).length
|
|
223
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
224
|
+
onClick: showMultiSelectModal,
|
|
225
|
+
icon: multipleIcon
|
|
226
|
+
}, "\u66F4\u591A\u7B5B\u9009"))), /*#__PURE__*/React.createElement(Modal, {
|
|
227
|
+
title: "\u66F4\u591A\u7B5B\u9009",
|
|
228
|
+
open: isModalVisible,
|
|
229
|
+
onOk: handleModalOk,
|
|
230
|
+
onCancel: handleModalCancel,
|
|
231
|
+
cancelText: '取消',
|
|
232
|
+
okText: '确定'
|
|
233
|
+
}, /*#__PURE__*/React.createElement(Form, {
|
|
234
|
+
form: multilineForm,
|
|
235
|
+
labelCol: {
|
|
236
|
+
span: 5
|
|
237
|
+
}
|
|
238
|
+
}, config.map(function (item) {
|
|
239
|
+
return isShow && isShow.includes(item.key) ? null : renderFormItem(item, false);
|
|
240
|
+
}))));
|
|
241
|
+
};
|
|
242
|
+
export default LinkedFilter;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1727228270230" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10403" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 0C229.218462 0 0 229.218462 0 512s229.218462 512 512 512 512-229.218462 512-512S794.781538 0 512 0z m275.495385 711.286154a36.864 36.864 0 0 1-49.348923 54.665846l-219.372308-198.222769-219.372308 198.222769a36.864 36.864 0 0 1-49.388308-54.665846l213.819077-193.220923-174.946461-193.732923a36.864 36.864 0 0 1 49.348923-54.665846l180.499692 198.734769 219.884308-198.734769a36.824615 36.824615 0 1 1 49.348923 54.665846l-214.331077 193.693538 213.858462 193.260308z" fill="#FFFFFF" p-id="10404"></path></svg>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
interface VideoPlayProps {
|
|
3
|
+
url: string[];
|
|
4
|
+
type: 'video' | 'img' | string;
|
|
5
|
+
previewUrl: string[];
|
|
6
|
+
trackUrl?: string;
|
|
7
|
+
trackLabel?: string;
|
|
8
|
+
onPlayClick?: () => void;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
renderContent?: () => ReactNode;
|
|
11
|
+
}
|
|
12
|
+
declare const VideoPlay: FC<VideoPlayProps>;
|
|
13
|
+
export default VideoPlay;
|