@chlp-tech/rpa-ui 0.0.10 → 0.0.11-beta.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/dist/account-select/index.d.ts +8 -38
- package/dist/account-select/index.js +197 -180
- package/dist/account-select/index.module.less +116 -41
- package/dist/account-select/type.d.ts +80 -0
- package/dist/account-select/type.js +1 -0
- package/dist/release-video-card/index.js +2 -2
- package/dist/text-ellipsis/index.js +8 -4
- package/package.json +3 -2
|
@@ -1,39 +1,9 @@
|
|
|
1
|
-
import React
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
list: AccountSelectProps['list'];
|
|
8
|
-
placeholder: string;
|
|
9
|
-
isValid: 'img' | 'video' | 'insVideo' | undefined;
|
|
10
|
-
multiple?: boolean;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
}[];
|
|
13
|
-
onChange?: (selected: {
|
|
14
|
-
[key: string]: string[];
|
|
15
|
-
}) => void;
|
|
16
|
-
value?: {
|
|
17
|
-
[key: string]: string[];
|
|
18
|
-
};
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IAccountListProps, IAccountSelectProps } from "./type";
|
|
3
|
+
declare namespace AccountSelectComponent {
|
|
4
|
+
interface StaticComponents {
|
|
5
|
+
Group: React.FC<IAccountListProps>;
|
|
6
|
+
}
|
|
19
7
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
placeholder: string;
|
|
23
|
-
icon: string | React.ReactNode;
|
|
24
|
-
disabledIcon: string | React.ReactNode;
|
|
25
|
-
list: {
|
|
26
|
-
label: string;
|
|
27
|
-
desc: string;
|
|
28
|
-
isValid: boolean;
|
|
29
|
-
value: string;
|
|
30
|
-
isPersonTk: boolean;
|
|
31
|
-
}[];
|
|
32
|
-
isValid: 'img' | 'video' | 'insImg' | 'insVideo' | undefined;
|
|
33
|
-
multiple: boolean;
|
|
34
|
-
disabled?: boolean;
|
|
35
|
-
onSelectionChange: (keys: string[], accountKey: string) => void;
|
|
36
|
-
selectedValues?: string[];
|
|
37
|
-
}
|
|
38
|
-
declare const AccountSelectList: FC<AccountSelectListProps>;
|
|
39
|
-
export default AccountSelectList;
|
|
8
|
+
declare const AccountSelect: React.FC<IAccountSelectProps> & AccountSelectComponent.StaticComponents;
|
|
9
|
+
export default AccountSelect;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
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 _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -14,208 +15,224 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
14
15
|
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; }
|
|
15
16
|
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; } }
|
|
16
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
-
import React, {
|
|
18
|
-
import { Dropdown, Row, Col, Popover, message } from "antd";
|
|
19
|
-
import styles from "./index.module.less";
|
|
18
|
+
import React, { useEffect } from "react";
|
|
20
19
|
import DownIcon from "./imgs/down.svg";
|
|
21
20
|
import UpIcon from "./imgs/up.svg";
|
|
21
|
+
import { Col, Empty, Input, Popover, Row, Tooltip } from "antd";
|
|
22
|
+
import { TextEllipsis } from "../index";
|
|
23
|
+
import { SearchOutlined } from "@ant-design/icons";
|
|
24
|
+
import classNames from "classnames";
|
|
25
|
+
import styles from "./index.module.less";
|
|
26
|
+
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
28
|
+
|
|
22
29
|
var AccountSelect = function AccountSelect(props) {
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
var _props$placeholder = props.placeholder,
|
|
31
|
+
placeholder = _props$placeholder === void 0 ? '请选择账号' : _props$placeholder,
|
|
32
|
+
_props$multiple = props.multiple,
|
|
33
|
+
multiple = _props$multiple === void 0 ? false : _props$multiple;
|
|
34
|
+
var _React$useState = React.useState(false),
|
|
35
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
36
|
+
open = _React$useState2[0],
|
|
37
|
+
setOpen = _React$useState2[1];
|
|
38
|
+
var _React$useState3 = React.useState(props.options || []),
|
|
39
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
40
|
+
optionList = _React$useState4[0],
|
|
41
|
+
setOptionList = _React$useState4[1];
|
|
42
|
+
var _React$useState5 = React.useState(props.defaultSelectList || []),
|
|
43
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
44
|
+
selectedKeys = _React$useState6[0],
|
|
45
|
+
setSelectedKeys = _React$useState6[1];
|
|
46
|
+
var handleClearAll = function handleClearAll() {
|
|
47
|
+
var _props$onChange;
|
|
48
|
+
setSelectedKeys([]);
|
|
49
|
+
setOpen(false);
|
|
50
|
+
(_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, []);
|
|
38
51
|
};
|
|
39
|
-
var
|
|
40
|
-
var _props$
|
|
41
|
-
if (
|
|
42
|
-
return
|
|
43
|
-
})) !== null && _props$list !== void 0 && _props$list.isPersonTk) {
|
|
44
|
-
message.error('旧版TK账号无法发布,请前往社媒管理重新绑定账号');
|
|
45
|
-
return;
|
|
52
|
+
var renderSelectInfo = function renderSelectInfo() {
|
|
53
|
+
var _props$options;
|
|
54
|
+
if (selectedKeys.length <= 0) {
|
|
55
|
+
return null;
|
|
46
56
|
}
|
|
47
|
-
if (
|
|
48
|
-
|
|
49
|
-
var newSelectedKeys;
|
|
50
|
-
if (prevState.includes(value.key)) {
|
|
51
|
-
newSelectedKeys = prevState.filter(function (item) {
|
|
52
|
-
return item !== value.key;
|
|
53
|
-
});
|
|
54
|
-
} else {
|
|
55
|
-
newSelectedKeys = props.multiple ? [].concat(_toConsumableArray(prevState), [value.key]) : [value.key];
|
|
56
|
-
}
|
|
57
|
-
props.onSelectionChange(newSelectedKeys, props.keys);
|
|
58
|
-
return newSelectedKeys;
|
|
59
|
-
});
|
|
57
|
+
if (props.multiple) {
|
|
58
|
+
return /*#__PURE__*/React.createElement("div", null, "\u5DF2\u9009\u62E9$", selectedKeys.length, "\u4E2A");
|
|
60
59
|
}
|
|
60
|
+
var info = (_props$options = props.options) === null || _props$options === void 0 || (_props$options = _props$options.filter(function (item) {
|
|
61
|
+
return item.id === selectedKeys[0];
|
|
62
|
+
})) === null || _props$options === void 0 ? void 0 : _props$options[0];
|
|
63
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
64
|
+
className: styles.selectInfoBox
|
|
65
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
66
|
+
className: styles.accountName
|
|
67
|
+
}, /*#__PURE__*/React.createElement(TextEllipsis, {
|
|
68
|
+
lines: 1,
|
|
69
|
+
showTooltip: false
|
|
70
|
+
}, info === null || info === void 0 ? void 0 : info.accountName)), /*#__PURE__*/React.createElement("div", {
|
|
71
|
+
className: styles.languageText
|
|
72
|
+
}, /*#__PURE__*/React.createElement(TextEllipsis, {
|
|
73
|
+
lines: 1,
|
|
74
|
+
showTooltip: false
|
|
75
|
+
}, (info === null || info === void 0 ? void 0 : info.remark) || '--')));
|
|
61
76
|
};
|
|
62
|
-
var
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
props.
|
|
77
|
+
var renderAccountView = function renderAccountView() {
|
|
78
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
79
|
+
className: styles.box
|
|
80
|
+
}, props.disabled && typeof props.disabledIcon === "string" || !props.disabled && typeof props.icon === 'string' ? /*#__PURE__*/React.createElement("img", {
|
|
81
|
+
width: 48,
|
|
82
|
+
height: 48,
|
|
83
|
+
alt: "",
|
|
84
|
+
src: props.disabled ? props.disabledIcon : props.icon
|
|
85
|
+
}) : /*#__PURE__*/React.createElement("div", null, props.disabled ? props.disabledIcon : props.icon), /*#__PURE__*/React.createElement("div", {
|
|
86
|
+
className: styles.centerContentBox
|
|
87
|
+
}, selectedKeys.length <= 0 && /*#__PURE__*/React.createElement("div", {
|
|
88
|
+
className: styles.placeHolderText
|
|
89
|
+
}, placeholder), selectedKeys.length > 0 && (props.renderSelectStatus ? props.renderSelectStatus(selectedKeys) : renderSelectInfo())), /*#__PURE__*/React.createElement("img", {
|
|
90
|
+
src: (selectedKeys === null || selectedKeys === void 0 ? void 0 : selectedKeys.length) > 0 ? UpIcon : DownIcon,
|
|
91
|
+
alt: "",
|
|
92
|
+
onClick: function onClick() {
|
|
93
|
+
if ((selectedKeys === null || selectedKeys === void 0 ? void 0 : selectedKeys.length) > 0) {
|
|
94
|
+
handleClearAll === null || handleClearAll === void 0 || handleClearAll();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}));
|
|
98
|
+
};
|
|
99
|
+
var onClickItem = function onClickItem(item) {
|
|
100
|
+
// const newList = [];
|
|
101
|
+
if (multiple) {
|
|
102
|
+
var _props$onChange2;
|
|
103
|
+
var newList = _toConsumableArray(selectedKeys);
|
|
104
|
+
if (newList.includes(item.id)) {
|
|
105
|
+
newList.unshift(item.id);
|
|
106
|
+
} else {
|
|
107
|
+
newList.push(item.id);
|
|
108
|
+
}
|
|
109
|
+
setSelectedKeys(newList);
|
|
110
|
+
(_props$onChange2 = props.onChange) === null || _props$onChange2 === void 0 || _props$onChange2.call(props, newList);
|
|
111
|
+
} else {
|
|
112
|
+
var _props$onChange3;
|
|
113
|
+
var _newList = [item.id];
|
|
114
|
+
setSelectedKeys(_newList);
|
|
115
|
+
(_props$onChange3 = props.onChange) === null || _props$onChange3 === void 0 || _props$onChange3.call(props, _newList);
|
|
116
|
+
setOpen(false);
|
|
117
|
+
}
|
|
66
118
|
};
|
|
67
|
-
var
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
119
|
+
var onSearchChange = function onSearchChange(e) {
|
|
120
|
+
var _props$options2;
|
|
121
|
+
console.log(e.target.value);
|
|
122
|
+
var searchValue = (e.target.value || '').toString().toLowerCase();
|
|
123
|
+
var list = (_props$options2 = props.options) === null || _props$options2 === void 0 ? void 0 : _props$options2.filter(function (item) {
|
|
124
|
+
var accountName = (item.accountName || '').toString().toLowerCase();
|
|
125
|
+
var ownerName = (item.ownerName || '').toString().toLowerCase();
|
|
126
|
+
return accountName.includes(searchValue) || ownerName.includes(searchValue);
|
|
71
127
|
});
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
case 'video':
|
|
82
|
-
return ['视频宽和高需大于360px,小于4096px', '视频帧率需要大于23fps,小于60fps'];
|
|
83
|
-
default:
|
|
84
|
-
return [];
|
|
128
|
+
setOptionList(list || []);
|
|
129
|
+
};
|
|
130
|
+
var getLanguageAndCountryList = function getLanguageAndCountryList(item) {
|
|
131
|
+
var list = [];
|
|
132
|
+
if (item.country) {
|
|
133
|
+
list.push(item.country);
|
|
134
|
+
}
|
|
135
|
+
if (item.language) {
|
|
136
|
+
list.push(item.language);
|
|
85
137
|
}
|
|
86
|
-
|
|
138
|
+
return list;
|
|
139
|
+
};
|
|
87
140
|
return /*#__PURE__*/React.createElement(Popover, {
|
|
88
|
-
content: /*#__PURE__*/React.createElement("div", {
|
|
89
|
-
className: styles['popover_title']
|
|
90
|
-
}, content.map(function (item, index) {
|
|
91
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
92
|
-
key: index,
|
|
93
|
-
className: styles['popover_item']
|
|
94
|
-
}, item);
|
|
95
|
-
})),
|
|
96
|
-
open: !!content.length
|
|
97
|
-
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
98
141
|
trigger: ['click'],
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
boxShadow: "0px 9px 28px 8px rgba(0,0,0,0.05), 0px 6px 16px 0px rgba(0,0,0,0.08), 0px 3px 6px -4px rgba(0,0,0,0.12)",
|
|
105
|
-
borderRadius: 8
|
|
142
|
+
classNames: {
|
|
143
|
+
root: styles.popBox
|
|
144
|
+
},
|
|
145
|
+
onOpenChange: function onOpenChange(open) {
|
|
146
|
+
return setOpen(open);
|
|
106
147
|
},
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
148
|
+
arrow: false,
|
|
149
|
+
placement: "bottomLeft",
|
|
150
|
+
open: open,
|
|
151
|
+
content: function content() {
|
|
152
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Input, {
|
|
153
|
+
style: {
|
|
154
|
+
height: '36px',
|
|
155
|
+
color: '#142A51'
|
|
156
|
+
},
|
|
157
|
+
prefix: /*#__PURE__*/React.createElement(SearchOutlined, {
|
|
113
158
|
style: {
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
159
|
+
color: '#9EA7B5'
|
|
160
|
+
}
|
|
161
|
+
}),
|
|
162
|
+
placeholder: "\u641C\u7D22\u6210\u5458\u6216\u8D26\u53F7\u540D",
|
|
163
|
+
onChange: onSearchChange
|
|
164
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
165
|
+
className: styles.scrollBox
|
|
166
|
+
}, optionList.map(function (item) {
|
|
167
|
+
var _item$ownerName, _item$ownerName2, _item$ownerName3;
|
|
168
|
+
var languageAndCountryList = getLanguageAndCountryList(item);
|
|
169
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
170
|
+
key: item.id,
|
|
171
|
+
className: classNames(styles.rowBox, _defineProperty(_defineProperty(_defineProperty({}, styles.rowBoxClick, true), styles.rowBoxSelect, selectedKeys.includes(item.id)), styles.rowBoxDisable, item.disabled)),
|
|
172
|
+
onClick: function onClick() {
|
|
173
|
+
return onClickItem(item);
|
|
174
|
+
}
|
|
175
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
176
|
+
className: styles.name
|
|
177
|
+
}, /*#__PURE__*/React.createElement(TextEllipsis, {
|
|
178
|
+
lines: 1,
|
|
179
|
+
showTooltip: false
|
|
180
|
+
}, item.accountName || '--')), /*#__PURE__*/React.createElement("div", {
|
|
181
|
+
className: styles.remark
|
|
182
|
+
}, /*#__PURE__*/React.createElement(TextEllipsis, {
|
|
183
|
+
lines: 1,
|
|
184
|
+
showTooltip: false
|
|
185
|
+
}, item.remark || '无描述')), /*#__PURE__*/React.createElement("div", {
|
|
186
|
+
className: styles.countryAndLanguage
|
|
187
|
+
}, /*#__PURE__*/React.createElement(TextEllipsis, {
|
|
188
|
+
lines: 1,
|
|
189
|
+
showTooltip: false
|
|
190
|
+
}, languageAndCountryList.join('/'))), /*#__PURE__*/React.createElement("div", {
|
|
191
|
+
className: styles.userWrap
|
|
192
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
193
|
+
title: item.ownerName && ((_item$ownerName = item.ownerName) === null || _item$ownerName === void 0 ? void 0 : _item$ownerName.length) > 4 ? item.ownerName : ''
|
|
194
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
195
|
+
className: styles.userBox
|
|
196
|
+
}, item.ownerName && ((_item$ownerName2 = item.ownerName) === null || _item$ownerName2 === void 0 ? void 0 : _item$ownerName2.length) > 4 ? "".concat((_item$ownerName3 = item.ownerName) === null || _item$ownerName3 === void 0 ? void 0 : _item$ownerName3.slice(0, 4), "...") : item.ownerName))));
|
|
197
|
+
}), optionList.length <= 0 && /*#__PURE__*/React.createElement(Empty, {
|
|
198
|
+
image: Empty.PRESENTED_IMAGE_SIMPLE,
|
|
199
|
+
description: "\u6682\u65E0\u6570\u636E"
|
|
200
|
+
})));
|
|
156
201
|
}
|
|
157
|
-
},
|
|
158
|
-
width: 48,
|
|
159
|
-
height: 48,
|
|
160
|
-
src: list.length && !props.disabled ? props.icon : props.disabledIcon,
|
|
161
|
-
alt: ""
|
|
162
|
-
}) : /*#__PURE__*/React.createElement("div", {
|
|
163
|
-
style: {
|
|
164
|
-
width: 48,
|
|
165
|
-
height: 48
|
|
166
|
-
}
|
|
167
|
-
}, list.length && !props.disabled ? props.icon : props.disabledIcon), /*#__PURE__*/React.createElement("div", {
|
|
168
|
-
className: styles['wrap_desc'],
|
|
169
|
-
style: {
|
|
170
|
-
color: selectedKeys.length > 0 ? '#142A51' : '#9EA7B5',
|
|
171
|
-
fontWeight: selectedKeys.length > 0 ? 500 : 400
|
|
172
|
-
}
|
|
173
|
-
}, list.length < 1 ? "\u6682\u65E0\u7ED1\u5B9A".concat(props.placeholder) : selectedKeys.length > 0 ? "\u5DF2\u9009\u62E9".concat(selectedKeys.length, "\u4E2A").concat(props.placeholder) : "\u8BF7\u9009\u62E9".concat(props.placeholder)), selectedKeys.length > 0 ? /*#__PURE__*/React.createElement("img", {
|
|
174
|
-
src: UpIcon,
|
|
175
|
-
alt: "",
|
|
176
|
-
onClick: handleClearAll
|
|
177
|
-
}) : /*#__PURE__*/React.createElement("img", {
|
|
178
|
-
src: DownIcon,
|
|
179
|
-
alt: ""
|
|
180
|
-
}))));
|
|
202
|
+
}, renderAccountView());
|
|
181
203
|
};
|
|
182
|
-
var AccountSelectList = function AccountSelectList(
|
|
183
|
-
var
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
var
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
204
|
+
var AccountSelectList = function AccountSelectList(props) {
|
|
205
|
+
var _React$useState7 = React.useState([]),
|
|
206
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
207
|
+
accounts = _React$useState8[0],
|
|
208
|
+
setAccounts = _React$useState8[1];
|
|
209
|
+
var _React$useState9 = React.useState({}),
|
|
210
|
+
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
211
|
+
selectValues = _React$useState10[0],
|
|
212
|
+
setSelectValues = _React$useState10[1];
|
|
191
213
|
useEffect(function () {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
return newState;
|
|
199
|
-
});
|
|
200
|
-
};
|
|
214
|
+
setAccounts(props.accounts.map(function (item, index) {
|
|
215
|
+
return _objectSpread({
|
|
216
|
+
key: index
|
|
217
|
+
}, item);
|
|
218
|
+
}));
|
|
219
|
+
}, [props.accounts]);
|
|
201
220
|
return /*#__PURE__*/React.createElement(Row, {
|
|
202
221
|
gutter: [32, 32]
|
|
203
222
|
}, accounts === null || accounts === void 0 ? void 0 : accounts.map(function (account, index) {
|
|
204
223
|
return /*#__PURE__*/React.createElement(Col, {
|
|
205
224
|
span: 8,
|
|
206
225
|
key: index
|
|
207
|
-
}, /*#__PURE__*/React.createElement(AccountSelect, {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
onSelectionChange: handleSelectionChange,
|
|
217
|
-
selectedValues: selectedAccounts[account.key]
|
|
218
|
-
}));
|
|
226
|
+
}, /*#__PURE__*/React.createElement(AccountSelect, _extends({}, account, {
|
|
227
|
+
onChange: function onChange(values) {
|
|
228
|
+
var _props$onChange4;
|
|
229
|
+
var tValues = _objectSpread({}, selectValues);
|
|
230
|
+
tValues[account.key] = values;
|
|
231
|
+
setSelectValues(tValues);
|
|
232
|
+
(_props$onChange4 = props.onChange) === null || _props$onChange4 === void 0 || _props$onChange4.call(props, tValues);
|
|
233
|
+
}
|
|
234
|
+
})));
|
|
219
235
|
}));
|
|
220
236
|
};
|
|
221
|
-
|
|
237
|
+
AccountSelect.Group = AccountSelectList;
|
|
238
|
+
export default AccountSelect;
|
|
@@ -1,58 +1,133 @@
|
|
|
1
|
-
.
|
|
2
|
-
padding: 2px 17px 2px 2px;
|
|
3
|
-
border-radius: 25px;
|
|
1
|
+
.box {
|
|
4
2
|
display: flex;
|
|
5
|
-
|
|
3
|
+
flex-direction: row;
|
|
6
4
|
align-items: center;
|
|
5
|
+
justify-content: space-between;
|
|
6
|
+
|
|
7
|
+
padding: 2px 17px 2px 2px;
|
|
8
|
+
border-radius: 999px;
|
|
7
9
|
cursor: pointer;
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
border: 1px solid #D4DBE7;
|
|
12
|
+
|
|
13
|
+
.placeHolderText {
|
|
12
14
|
font-size: 14px;
|
|
13
15
|
color: #9EA7B5;
|
|
14
16
|
}
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
.centerContentBox {
|
|
19
|
+
flex: 1;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
margin: 0 12px;
|
|
22
|
+
|
|
23
|
+
.selectInfoBox {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: row;
|
|
26
|
+
align-items: center;
|
|
27
|
+
.accountName {
|
|
28
|
+
color: #142A51;
|
|
29
|
+
font-size: 14px;
|
|
30
|
+
max-width: 66%;
|
|
31
|
+
flex: 2;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.languageText {
|
|
35
|
+
font-size: 12px;
|
|
36
|
+
color: #9EA7B5;
|
|
37
|
+
flex: 1;
|
|
38
|
+
max-width: 33%;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
21
41
|
}
|
|
42
|
+
}
|
|
22
43
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
44
|
+
.popBox {
|
|
45
|
+
width: 481px;
|
|
46
|
+
background: #FFFFFF;
|
|
47
|
+
box-shadow: 0 9px 28px 8px rgba(0,0,0,0.05), 0 6px 16px 0 rgba(0,0,0,0.08), 0 3px 6px -4px rgba(0,0,0,0.12);
|
|
48
|
+
border-radius: 8px;
|
|
49
|
+
|
|
50
|
+
:global {
|
|
51
|
+
.ant-popover-inner {
|
|
52
|
+
padding: 4px;
|
|
53
|
+
}
|
|
28
54
|
}
|
|
29
55
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
56
|
+
.scrollBox {
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
max-height: 50vh;
|
|
60
|
+
overflow: auto;
|
|
61
|
+
margin-top: 4px;
|
|
62
|
+
gap: 2px;
|
|
35
63
|
}
|
|
36
|
-
}
|
|
37
64
|
|
|
38
|
-
.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
65
|
+
.rowBox {
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: row;
|
|
68
|
+
align-items: center;
|
|
69
|
+
padding: 12px 12px;
|
|
70
|
+
gap: 12px;
|
|
71
|
+
|
|
72
|
+
&:hover {
|
|
73
|
+
background-color: #F5F7FA;
|
|
74
|
+
border-radius: 4px;
|
|
75
|
+
}
|
|
48
76
|
|
|
77
|
+
.name {
|
|
78
|
+
font-size: 14px;
|
|
79
|
+
color: #142A51;
|
|
80
|
+
width: 130px;
|
|
81
|
+
}
|
|
49
82
|
|
|
50
|
-
.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
83
|
+
.remark {
|
|
84
|
+
font-size: 12px;
|
|
85
|
+
color: #9EA7B5;
|
|
86
|
+
flex: 1;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.countryAndLanguage {
|
|
90
|
+
font-size: 12px;
|
|
91
|
+
color: #9EA7B5;
|
|
92
|
+
width: 80px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.userWrap {
|
|
96
|
+
width: 80px;
|
|
97
|
+
display: flex;
|
|
98
|
+
flex-direction: row;
|
|
99
|
+
justify-content: flex-end;
|
|
100
|
+
}
|
|
101
|
+
.userBox {
|
|
102
|
+
width: max-content;
|
|
103
|
+
background: #E9F1FF;
|
|
104
|
+
border-radius: 4px;
|
|
105
|
+
border: 1px solid #004FD3;
|
|
106
|
+
padding: 4px 8px;
|
|
107
|
+
|
|
108
|
+
font-size: 12px;
|
|
109
|
+
color: #004FD3;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.rowBoxClick {
|
|
114
|
+
cursor: pointer;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.rowBoxSelect {
|
|
118
|
+
background-color: #e6f3ff;
|
|
119
|
+
border-radius: 4px;
|
|
120
|
+
&:hover {
|
|
121
|
+
background-color: #e6f3ff;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.rowBoxDisable {
|
|
126
|
+
cursor: not-allowed;
|
|
127
|
+
|
|
128
|
+
&:hover {
|
|
129
|
+
background-color: #fff;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
58
132
|
}
|
|
133
|
+
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import React, { ReactElement } from "react";
|
|
2
|
+
export interface IAccountSelectProps {
|
|
3
|
+
/**
|
|
4
|
+
* 普通状态下的icon
|
|
5
|
+
*/
|
|
6
|
+
icon?: string | React.ReactElement;
|
|
7
|
+
/**
|
|
8
|
+
* 禁用状态下的icon
|
|
9
|
+
*/
|
|
10
|
+
disabledIcon?: string | React.ReactElement;
|
|
11
|
+
/**
|
|
12
|
+
* 默认选中的条数
|
|
13
|
+
*/
|
|
14
|
+
defaultSelectList?: (number | string)[];
|
|
15
|
+
/**
|
|
16
|
+
* 没有选择文件的时候默认提示文案
|
|
17
|
+
*/
|
|
18
|
+
placeholder?: string | React.ReactElement;
|
|
19
|
+
/**
|
|
20
|
+
* 是否禁用
|
|
21
|
+
*/
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* 是否多选
|
|
25
|
+
*/
|
|
26
|
+
multiple?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* 选项发生变化触发
|
|
29
|
+
* @param values
|
|
30
|
+
*/
|
|
31
|
+
onChange?: (values: (string | number)[]) => void;
|
|
32
|
+
/**
|
|
33
|
+
* 下拉选项列表
|
|
34
|
+
*/
|
|
35
|
+
options?: IAccountOptionModel[];
|
|
36
|
+
/**
|
|
37
|
+
* 自定义渲染选择之后的视图
|
|
38
|
+
* @param values
|
|
39
|
+
*/
|
|
40
|
+
renderSelectStatus: (values: (string | number)[]) => ReactElement;
|
|
41
|
+
}
|
|
42
|
+
export interface IAccountOptionModel {
|
|
43
|
+
/**
|
|
44
|
+
* 选项唯一值
|
|
45
|
+
*/
|
|
46
|
+
id: string | number;
|
|
47
|
+
/**
|
|
48
|
+
* 账号名
|
|
49
|
+
*/
|
|
50
|
+
accountName?: string;
|
|
51
|
+
/**
|
|
52
|
+
* 备注
|
|
53
|
+
*/
|
|
54
|
+
remark?: string;
|
|
55
|
+
/**
|
|
56
|
+
* 国家
|
|
57
|
+
*/
|
|
58
|
+
country?: string;
|
|
59
|
+
/**
|
|
60
|
+
* 语言
|
|
61
|
+
*/
|
|
62
|
+
language?: string;
|
|
63
|
+
/**
|
|
64
|
+
* 所属人员
|
|
65
|
+
*/
|
|
66
|
+
ownerName?: string;
|
|
67
|
+
/**
|
|
68
|
+
* 不可操作
|
|
69
|
+
*/
|
|
70
|
+
disabled?: boolean;
|
|
71
|
+
}
|
|
72
|
+
export interface IAccountListProps {
|
|
73
|
+
accounts: IAccountSelectProps[];
|
|
74
|
+
onChange?: (selected: {
|
|
75
|
+
[key: string]: string[];
|
|
76
|
+
}) => void;
|
|
77
|
+
value?: {
|
|
78
|
+
[key: string]: string[];
|
|
79
|
+
};
|
|
80
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -194,7 +194,7 @@ var ReleaseVideoCard = function ReleaseVideoCard(props) {
|
|
|
194
194
|
marginRight: 12,
|
|
195
195
|
cursor: 'pointer'
|
|
196
196
|
}
|
|
197
|
-
}, [0, 1].includes(props.status) ? /*#__PURE__*/React.createElement(React.Fragment, null, (_props$editComponent = props.editComponent) !== null && _props$editComponent !== void 0 ? _props$editComponent : /*#__PURE__*/React.createElement("span", null, "\u7F16\u8F91")) : [2, 3].includes(props.status) ? /*#__PURE__*/React.createElement(React.Fragment, null, (_props$detailComponen = props.detailComponent) !== null && _props$detailComponen !== void 0 ? _props$detailComponen : /*#__PURE__*/React.createElement("span", null, "\u8BE6\u60C5")) : null), /*#__PURE__*/React.createElement(Dropdown, {
|
|
197
|
+
}, [0, 1].includes(props.status) ? /*#__PURE__*/React.createElement(React.Fragment, null, (_props$editComponent = props.editComponent) !== null && _props$editComponent !== void 0 ? _props$editComponent : /*#__PURE__*/React.createElement("span", null, "\u7F16\u8F91")) : [2, 3].includes(props.status) ? /*#__PURE__*/React.createElement(React.Fragment, null, (_props$detailComponen = props.detailComponent) !== null && _props$detailComponen !== void 0 ? _props$detailComponen : /*#__PURE__*/React.createElement("span", null, "\u8BE6\u60C5")) : null), [0, 1].includes(props.status) ? /*#__PURE__*/React.createElement(Dropdown, {
|
|
198
198
|
trigger: ['click'],
|
|
199
199
|
menu: {
|
|
200
200
|
items: [{
|
|
@@ -212,7 +212,7 @@ var ReleaseVideoCard = function ReleaseVideoCard(props) {
|
|
|
212
212
|
}, /*#__PURE__*/React.createElement(Image, {
|
|
213
213
|
src: More,
|
|
214
214
|
preview: false
|
|
215
|
-
}))))), props.isNew && /*#__PURE__*/React.createElement("div", {
|
|
215
|
+
}))) : null)), props.isNew && /*#__PURE__*/React.createElement("div", {
|
|
216
216
|
className: styles['new-position']
|
|
217
217
|
}, /*#__PURE__*/React.createElement(Image, {
|
|
218
218
|
src: New,
|
|
@@ -27,7 +27,7 @@ var TextEllipsis = function TextEllipsis(_ref) {
|
|
|
27
27
|
var parentElement = parentRef.current;
|
|
28
28
|
var parentWidth = parentElement.clientWidth;
|
|
29
29
|
var textWidth = textElement.scrollWidth;
|
|
30
|
-
setIsTruncated(textWidth
|
|
30
|
+
setIsTruncated(textWidth >= parentWidth);
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
checkTruncation();
|
|
@@ -41,17 +41,21 @@ var TextEllipsis = function TextEllipsis(_ref) {
|
|
|
41
41
|
}, /*#__PURE__*/React.createElement("div", {
|
|
42
42
|
className: styles['text-ellipsis'],
|
|
43
43
|
ref: parentRef,
|
|
44
|
+
style: {
|
|
45
|
+
width: '100%'
|
|
46
|
+
}
|
|
47
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
ref: textRef,
|
|
44
49
|
style: {
|
|
45
50
|
display: '-webkit-box',
|
|
51
|
+
width: 'max-content',
|
|
52
|
+
maxWidth: '100%',
|
|
46
53
|
WebkitBoxOrient: 'vertical',
|
|
47
54
|
WebkitLineClamp: lines,
|
|
48
55
|
overflow: 'hidden',
|
|
49
56
|
textOverflow: 'ellipsis',
|
|
50
|
-
width: '100%',
|
|
51
57
|
wordBreak: 'break-all'
|
|
52
58
|
}
|
|
53
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
54
|
-
ref: textRef
|
|
55
59
|
}, children)));
|
|
56
60
|
};
|
|
57
61
|
export default TextEllipsis;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chlp-tech/rpa-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11-beta.1",
|
|
4
4
|
"description": "rpa-ui",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@ant-design/icons": ">=4.18.0",
|
|
39
|
-
"antd": ">=
|
|
39
|
+
"antd": ">=5.25.0",
|
|
40
40
|
"react": ">=16.9.0",
|
|
41
41
|
"react-dom": ">=16.9.0"
|
|
42
42
|
},
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@webav/av-cliper": "^1.0.11",
|
|
65
|
+
"classnames": "^2.5.1",
|
|
65
66
|
"dayjs": "^1.11.13",
|
|
66
67
|
"js-md5": "^0.8.3",
|
|
67
68
|
"styled-components": "^6.1.12"
|