@chlp-tech/rpa-ui 0.0.11 → 0.0.13
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/MediaAccountPreview/index.d.ts +11 -0
- package/dist/MediaAccountPreview/index.js +39 -0
- package/dist/MediaAccountPreview/index.module.less +35 -0
- package/dist/account-select/index.d.ts +6 -38
- package/dist/account-select/index.js +256 -185
- package/dist/account-select/index.module.less +152 -39
- package/dist/account-select/type.d.ts +90 -0
- package/dist/account-select/type.js +1 -0
- package/dist/cover-modal/index.d.ts +10 -0
- package/dist/cover-modal/index.js +64 -0
- package/dist/drawer-task/index.d.ts +2 -2
- package/dist/drawer-task/index.js +3 -1
- package/dist/drawer-task/index.module.less +6 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/publish-account2/imgs/close.svg +25 -0
- package/dist/publish-account2/imgs/fb.svg +20 -0
- package/dist/publish-account2/imgs/ins.svg +36 -0
- package/dist/publish-account2/imgs/tk.svg +31 -0
- package/dist/publish-account2/imgs/tt.svg +21 -0
- package/dist/publish-account2/imgs/yt.svg +25 -0
- package/dist/publish-account2/index.d.ts +37 -0
- package/dist/publish-account2/index.js +144 -0
- package/dist/publish-account2/index.module.less +83 -0
- package/dist/publish-status/imgs/delete.svg +22 -0
- package/dist/publish-status/imgs/pause.svg +27 -0
- package/dist/publish-status/index.js +26 -0
- package/dist/release-video-card/index.d.ts +1 -0
- package/dist/release-video-card/index.js +21 -8
- package/dist/release-video-card/index.module.less +1 -0
- package/dist/text-ellipsis/index.js +8 -4
- package/package.json +3 -2
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface MediaAccountPreviewProps {
|
|
3
|
+
width?: number | string;
|
|
4
|
+
nickname?: string;
|
|
5
|
+
remark?: string;
|
|
6
|
+
language?: string;
|
|
7
|
+
country?: string;
|
|
8
|
+
ownerUsername?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const MediaAccountPreview: React.FC<MediaAccountPreviewProps>;
|
|
11
|
+
export default MediaAccountPreview;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import TextEllipsis from "../text-ellipsis";
|
|
3
|
+
import styles from "./index.module.less";
|
|
4
|
+
import { Tooltip } from 'antd';
|
|
5
|
+
var MediaAccountPreview = function MediaAccountPreview(props) {
|
|
6
|
+
var _props$ownerUsername, _props$ownerUsername2, _props$ownerUsername3;
|
|
7
|
+
var languageCountry = useMemo(function () {
|
|
8
|
+
var list = [];
|
|
9
|
+
if (props.country) list.push(props.country);
|
|
10
|
+
if (props.language) list.push(props.language);
|
|
11
|
+
return list;
|
|
12
|
+
}, [props.language, props.country]);
|
|
13
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
14
|
+
className: styles.box,
|
|
15
|
+
style: {
|
|
16
|
+
width: props.width
|
|
17
|
+
}
|
|
18
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
19
|
+
className: styles.nameText
|
|
20
|
+
}, /*#__PURE__*/React.createElement(TextEllipsis, {
|
|
21
|
+
lines: 1,
|
|
22
|
+
showTooltip: false
|
|
23
|
+
}, props.nickname || '--')), /*#__PURE__*/React.createElement("div", {
|
|
24
|
+
className: styles.remarkText
|
|
25
|
+
}, /*#__PURE__*/React.createElement(TextEllipsis, {
|
|
26
|
+
lines: 1,
|
|
27
|
+
showTooltip: false
|
|
28
|
+
}, props.remark || '无备注')), /*#__PURE__*/React.createElement("div", {
|
|
29
|
+
className: styles.languageCountryText
|
|
30
|
+
}, /*#__PURE__*/React.createElement(TextEllipsis, {
|
|
31
|
+
lines: 1,
|
|
32
|
+
showTooltip: false
|
|
33
|
+
}, languageCountry.length > 0 ? languageCountry.join('/') : '')), props.ownerUsername && /*#__PURE__*/React.createElement(Tooltip, {
|
|
34
|
+
title: ((_props$ownerUsername = props.ownerUsername) === null || _props$ownerUsername === void 0 ? void 0 : _props$ownerUsername.length) > 4 ? props.ownerUsername : ''
|
|
35
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
className: styles.userTag
|
|
37
|
+
}, props.ownerUsername && ((_props$ownerUsername2 = props.ownerUsername) === null || _props$ownerUsername2 === void 0 ? void 0 : _props$ownerUsername2.length) > 4 ? "".concat((_props$ownerUsername3 = props.ownerUsername) === null || _props$ownerUsername3 === void 0 ? void 0 : _props$ownerUsername3.slice(0, 4), "...") : props.ownerUsername || '--')));
|
|
38
|
+
};
|
|
39
|
+
export default MediaAccountPreview;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.box {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: row;
|
|
4
|
+
align-items: center;
|
|
5
|
+
gap: 8px;
|
|
6
|
+
padding: 8px;
|
|
7
|
+
|
|
8
|
+
.nameText {
|
|
9
|
+
font-size: 14px;
|
|
10
|
+
color: #142A51;
|
|
11
|
+
width: 30%;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.remarkText {
|
|
15
|
+
font-size: 12px;
|
|
16
|
+
color: #9EA7B5;
|
|
17
|
+
flex: 1;
|
|
18
|
+
min-width: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.languageCountryText {
|
|
22
|
+
font-size: 12px;
|
|
23
|
+
color: #9EA7B5;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.userTag {
|
|
27
|
+
padding: 4px 6px;
|
|
28
|
+
line-height: 1;
|
|
29
|
+
font-size: 12px;
|
|
30
|
+
color: #004FD3;
|
|
31
|
+
background: #E9F1FF;
|
|
32
|
+
border-radius: 4px;
|
|
33
|
+
border: 1px solid #004FD3;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -1,39 +1,7 @@
|
|
|
1
|
-
import React
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
icon: string | React.ReactNode;
|
|
6
|
-
disabledIcon: string | React.ReactNode;
|
|
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, IAccountListRef, IAccountSelectProps } from './type';
|
|
3
|
+
interface AccountSelectComponent extends React.FC<IAccountSelectProps> {
|
|
4
|
+
Group: React.ForwardRefExoticComponent<IAccountListProps & React.RefAttributes<IAccountListRef>>;
|
|
19
5
|
}
|
|
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;
|
|
6
|
+
declare const _default: AccountSelectComponent;
|
|
7
|
+
export default _default;
|
|
@@ -1,221 +1,292 @@
|
|
|
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
|
-
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; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
5
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
6
|
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."); }
|
|
9
7
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
10
8
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
9
|
+
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; }
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
11
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
11
12
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
13
|
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."); }
|
|
13
14
|
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); }
|
|
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, { forwardRef, useEffect, useImperativeHandle } 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 "../text-ellipsis";
|
|
23
|
+
import MediaAccountPreview from "../MediaAccountPreview";
|
|
24
|
+
import { SearchOutlined } from "@ant-design/icons";
|
|
25
|
+
import classNames from "classnames";
|
|
26
|
+
import styles from "./index.module.less";
|
|
22
27
|
var AccountSelect = function AccountSelect(props) {
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
var _props$placeholder = props.placeholder,
|
|
29
|
+
placeholder = _props$placeholder === void 0 ? '请选择账号' : _props$placeholder,
|
|
30
|
+
_props$multiple = props.multiple,
|
|
31
|
+
multiple = _props$multiple === void 0 ? false : _props$multiple;
|
|
32
|
+
var _React$useState = React.useState(false),
|
|
33
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
34
|
+
open = _React$useState2[0],
|
|
35
|
+
setOpen = _React$useState2[1];
|
|
36
|
+
var _React$useState3 = React.useState(false),
|
|
37
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
38
|
+
previewPopOpen = _React$useState4[0],
|
|
39
|
+
setPreviewPopOpen = _React$useState4[1];
|
|
40
|
+
var _React$useState5 = React.useState(props.options || []),
|
|
41
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
42
|
+
optionList = _React$useState6[0],
|
|
43
|
+
setOptionList = _React$useState6[1];
|
|
44
|
+
var _React$useState7 = React.useState(props.defaultSelectList || []),
|
|
45
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
46
|
+
selectedKeys = _React$useState8[0],
|
|
47
|
+
setSelectedKeys = _React$useState8[1];
|
|
31
48
|
useEffect(function () {
|
|
32
|
-
|
|
33
|
-
}, [props.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
49
|
+
setOptionList(props.options || []);
|
|
50
|
+
}, [props.options]);
|
|
51
|
+
useEffect(function () {
|
|
52
|
+
setSelectedKeys(props.defaultSelectList || []);
|
|
53
|
+
}, [props.defaultSelectList]);
|
|
54
|
+
var handleClearAll = function handleClearAll() {
|
|
55
|
+
var _props$onChange;
|
|
56
|
+
setSelectedKeys([]);
|
|
57
|
+
setOpen(false);
|
|
58
|
+
(_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, []);
|
|
38
59
|
};
|
|
39
|
-
var
|
|
40
|
-
var _props$
|
|
41
|
-
if (
|
|
42
|
-
return
|
|
43
|
-
})) !== null && _props$list !== void 0 && _props$list.isPersonTk) {
|
|
44
|
-
message.error('旧版TK账号无法发布,请前往社媒管理重新绑定账号');
|
|
45
|
-
return;
|
|
60
|
+
var renderSelectInfo = function renderSelectInfo() {
|
|
61
|
+
var _props$options, _info$languageCnName, _info$languageCnName2, _info$languageCnName3;
|
|
62
|
+
if (selectedKeys.length <= 0) {
|
|
63
|
+
return null;
|
|
46
64
|
}
|
|
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
|
-
});
|
|
65
|
+
if (props.multiple) {
|
|
66
|
+
return /*#__PURE__*/React.createElement("div", null, "\u5DF2\u9009\u62E9$", selectedKeys.length, "\u4E2A");
|
|
60
67
|
}
|
|
68
|
+
var info = (_props$options = props.options) === null || _props$options === void 0 || (_props$options = _props$options.filter(function (item) {
|
|
69
|
+
return item.id === selectedKeys[0];
|
|
70
|
+
})) === null || _props$options === void 0 ? void 0 : _props$options[0];
|
|
71
|
+
return /*#__PURE__*/React.createElement(Popover, {
|
|
72
|
+
open: previewPopOpen,
|
|
73
|
+
onOpenChange: function onOpenChange(open) {
|
|
74
|
+
return setPreviewPopOpen(open);
|
|
75
|
+
},
|
|
76
|
+
rootClassName: styles.accountPrePopBox,
|
|
77
|
+
content: /*#__PURE__*/React.createElement(MediaAccountPreview, {
|
|
78
|
+
width: 400,
|
|
79
|
+
nickname: info === null || info === void 0 ? void 0 : info.accountName,
|
|
80
|
+
language: info === null || info === void 0 ? void 0 : info.languageCnName,
|
|
81
|
+
remark: info === null || info === void 0 ? void 0 : info.remark,
|
|
82
|
+
country: info === null || info === void 0 ? void 0 : info.countryCnName,
|
|
83
|
+
ownerUsername: info === null || info === void 0 ? void 0 : info.ownerUserName
|
|
84
|
+
})
|
|
85
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
86
|
+
className: styles.selectInfoBox
|
|
87
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
88
|
+
className: styles.accountName
|
|
89
|
+
}, /*#__PURE__*/React.createElement(TextEllipsis, {
|
|
90
|
+
lines: 1,
|
|
91
|
+
showTooltip: false
|
|
92
|
+
}, info === null || info === void 0 ? void 0 : info.accountName)), /*#__PURE__*/React.createElement(Tooltip, {
|
|
93
|
+
title: info !== null && info !== void 0 && info.languageCnName && (info === null || info === void 0 || (_info$languageCnName = info.languageCnName) === null || _info$languageCnName === void 0 ? void 0 : _info$languageCnName.length) > 4 ? info.languageCnName : ''
|
|
94
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
95
|
+
className: styles.languageText
|
|
96
|
+
}, info !== null && info !== void 0 && info.languageCnName && (info === null || info === void 0 || (_info$languageCnName2 = info.languageCnName) === null || _info$languageCnName2 === void 0 ? void 0 : _info$languageCnName2.length) > 4 ? "".concat(info === null || info === void 0 || (_info$languageCnName3 = info.languageCnName) === null || _info$languageCnName3 === void 0 ? void 0 : _info$languageCnName3.slice(0, 4), "...") : (info === null || info === void 0 ? void 0 : info.languageCnName) || '--'))));
|
|
61
97
|
};
|
|
62
|
-
var
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
98
|
+
var renderAccountView = function renderAccountView() {
|
|
99
|
+
return /*#__PURE__*/React.createElement(Popover, {
|
|
100
|
+
open: !!props.disabledPopContent,
|
|
101
|
+
content: props.disabledPopContent ? /*#__PURE__*/React.createElement("div", {
|
|
102
|
+
className: styles.defaultDisablePopContent
|
|
103
|
+
}, props.disabledPopContent) : null
|
|
104
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
105
|
+
className: classNames(styles.box, _defineProperty({}, styles.boxDisabled, props.disabled))
|
|
106
|
+
}, props.disabled && typeof props.disabledIcon === "string" || !props.disabled && typeof props.icon === 'string' ? /*#__PURE__*/React.createElement("img", {
|
|
107
|
+
width: 48,
|
|
108
|
+
height: 48,
|
|
109
|
+
alt: "",
|
|
110
|
+
src: props.disabled ? props.disabledIcon : props.icon
|
|
111
|
+
}) : /*#__PURE__*/React.createElement("div", null, props.disabled ? props.disabledIcon : props.icon), /*#__PURE__*/React.createElement("div", {
|
|
112
|
+
className: styles.centerContentBox
|
|
113
|
+
}, selectedKeys.length <= 0 && /*#__PURE__*/React.createElement("div", {
|
|
114
|
+
className: styles.placeHolderText
|
|
115
|
+
}, placeholder), selectedKeys.length > 0 && (props.renderSelectStatus ? props.renderSelectStatus(selectedKeys) : renderSelectInfo())), /*#__PURE__*/React.createElement("img", {
|
|
116
|
+
src: (selectedKeys === null || selectedKeys === void 0 ? void 0 : selectedKeys.length) > 0 ? UpIcon : DownIcon,
|
|
117
|
+
alt: "",
|
|
118
|
+
onClick: function onClick(e) {
|
|
119
|
+
e.stopPropagation();
|
|
120
|
+
e.preventDefault();
|
|
121
|
+
if ((selectedKeys === null || selectedKeys === void 0 ? void 0 : selectedKeys.length) > 0) {
|
|
122
|
+
handleClearAll === null || handleClearAll === void 0 || handleClearAll();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
})));
|
|
126
|
+
};
|
|
127
|
+
var onClickItem = function onClickItem(item) {
|
|
128
|
+
// const newList = [];
|
|
129
|
+
if (multiple) {
|
|
130
|
+
var _props$onChange2;
|
|
131
|
+
var newList = _toConsumableArray(selectedKeys);
|
|
132
|
+
if (newList.includes(item.id)) {
|
|
133
|
+
newList.unshift(item.id);
|
|
134
|
+
} else {
|
|
135
|
+
newList.push(item.id);
|
|
136
|
+
}
|
|
137
|
+
setSelectedKeys(newList);
|
|
138
|
+
(_props$onChange2 = props.onChange) === null || _props$onChange2 === void 0 || _props$onChange2.call(props, newList);
|
|
139
|
+
} else {
|
|
140
|
+
var _props$onChange3;
|
|
141
|
+
var _newList = [item.id];
|
|
142
|
+
setSelectedKeys(_newList);
|
|
143
|
+
(_props$onChange3 = props.onChange) === null || _props$onChange3 === void 0 || _props$onChange3.call(props, _newList);
|
|
144
|
+
setOpen(false);
|
|
145
|
+
}
|
|
66
146
|
};
|
|
67
|
-
var
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
147
|
+
var onSearchChange = function onSearchChange(e) {
|
|
148
|
+
var _props$options2;
|
|
149
|
+
var searchValue = (e.target.value || '').toString().toLowerCase();
|
|
150
|
+
var list = (_props$options2 = props.options) === null || _props$options2 === void 0 ? void 0 : _props$options2.filter(function (item) {
|
|
151
|
+
var accountName = (item.accountName || '').toString().toLowerCase();
|
|
152
|
+
var ownerName = (item.ownerUserName || '').toString().toLowerCase();
|
|
153
|
+
return accountName.includes(searchValue) || ownerName.includes(searchValue);
|
|
71
154
|
});
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
case 'video':
|
|
82
|
-
return ['视频宽和高需大于360px,小于4096px', '视频帧率需要大于23fps,小于60fps'];
|
|
83
|
-
default:
|
|
84
|
-
return [];
|
|
155
|
+
setOptionList(list || []);
|
|
156
|
+
};
|
|
157
|
+
var getLanguageAndCountryList = function getLanguageAndCountryList(item) {
|
|
158
|
+
var list = [];
|
|
159
|
+
if (item.countryCnName) {
|
|
160
|
+
list.push(item.countryCnName);
|
|
161
|
+
}
|
|
162
|
+
if (item.languageCnName) {
|
|
163
|
+
list.push(item.languageCnName);
|
|
85
164
|
}
|
|
86
|
-
|
|
165
|
+
return list;
|
|
166
|
+
};
|
|
87
167
|
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
168
|
trigger: ['click'],
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
169
|
+
classNames: {
|
|
170
|
+
root: styles.popBox
|
|
171
|
+
},
|
|
172
|
+
onOpenChange: function onOpenChange(open) {
|
|
173
|
+
setOpen(open);
|
|
174
|
+
if (open) {
|
|
175
|
+
setPreviewPopOpen(false);
|
|
176
|
+
}
|
|
106
177
|
},
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
178
|
+
arrow: false,
|
|
179
|
+
placement: "bottomLeft",
|
|
180
|
+
open: open,
|
|
181
|
+
content: function content() {
|
|
182
|
+
return !props.disabled ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Input, {
|
|
183
|
+
style: {
|
|
184
|
+
height: '36px',
|
|
185
|
+
color: '#142A51'
|
|
186
|
+
},
|
|
187
|
+
prefix: /*#__PURE__*/React.createElement(SearchOutlined, {
|
|
113
188
|
style: {
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
border: '1px solid rgba(250, 68, 65, 1)',
|
|
136
|
-
borderRadius: 4,
|
|
137
|
-
whiteSpace: 'nowrap'
|
|
138
|
-
}
|
|
139
|
-
}, "\u65E7\u7248\u8D26\u53F7") : null, /*#__PURE__*/React.createElement("div", {
|
|
140
|
-
className: styles['wrap_right_desc'],
|
|
141
|
-
style: {
|
|
142
|
-
width: 77,
|
|
143
|
-
overflow: 'hidden',
|
|
144
|
-
textOverflow: 'ellipsis',
|
|
145
|
-
whiteSpace: 'nowrap'
|
|
146
|
-
}
|
|
147
|
-
}, item.desc)),
|
|
148
|
-
disabled: !item.isValid
|
|
189
|
+
color: '#9EA7B5'
|
|
190
|
+
}
|
|
191
|
+
}),
|
|
192
|
+
placeholder: "\u641C\u7D22\u6210\u5458\u6216\u8D26\u53F7\u540D",
|
|
193
|
+
onChange: onSearchChange
|
|
194
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
195
|
+
className: styles.scrollBox
|
|
196
|
+
}, optionList.map(function (item, index) {
|
|
197
|
+
var _item$ownerUserName, _item$ownerUserName2, _item$ownerUserName3;
|
|
198
|
+
var languageAndCountryList = getLanguageAndCountryList(item);
|
|
199
|
+
var getTipsText = function getTipsText() {
|
|
200
|
+
switch (item.disabledState) {
|
|
201
|
+
case 1:
|
|
202
|
+
return '请勿选择语言不统一的账号';
|
|
203
|
+
case 2:
|
|
204
|
+
return '账号Token失效,请重新授权该账号,恢复账号绑定状态';
|
|
205
|
+
case 3:
|
|
206
|
+
return '您没有该账号的运营权限';
|
|
207
|
+
default:
|
|
208
|
+
return null;
|
|
209
|
+
}
|
|
149
210
|
};
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
211
|
+
var tipsText = getTipsText();
|
|
212
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
213
|
+
title: tipsText,
|
|
214
|
+
key: index
|
|
215
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
216
|
+
key: item.id,
|
|
217
|
+
className: classNames(styles.rowBox, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, styles.rowBoxClick, true), styles.rowBoxSelect, selectedKeys.includes(item.id)), styles.rowBoxDisable, item.disabledState === 2), styles.rowBoxDisableMatchLanguage, item.disabledState === 1 || item.disabledState === 3)),
|
|
218
|
+
onClick: function onClick() {
|
|
219
|
+
if (!item.disabledState || item.disabledState < 1) {
|
|
220
|
+
onClickItem(item);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
224
|
+
className: styles.name
|
|
225
|
+
}, /*#__PURE__*/React.createElement(TextEllipsis, {
|
|
226
|
+
lines: 1,
|
|
227
|
+
showTooltip: false
|
|
228
|
+
}, item.accountName || '--')), /*#__PURE__*/React.createElement("div", {
|
|
229
|
+
className: styles.remark
|
|
230
|
+
}, /*#__PURE__*/React.createElement(TextEllipsis, {
|
|
231
|
+
lines: 1,
|
|
232
|
+
showTooltip: false
|
|
233
|
+
}, item.remark || '无描述')), /*#__PURE__*/React.createElement("div", {
|
|
234
|
+
className: styles.countryAndLanguage
|
|
235
|
+
}, /*#__PURE__*/React.createElement(TextEllipsis, {
|
|
236
|
+
lines: 1,
|
|
237
|
+
showTooltip: false
|
|
238
|
+
}, languageAndCountryList.join('/'))), /*#__PURE__*/React.createElement("div", {
|
|
239
|
+
className: styles.userWrap
|
|
240
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
241
|
+
title: item.ownerUserName && ((_item$ownerUserName = item.ownerUserName) === null || _item$ownerUserName === void 0 ? void 0 : _item$ownerUserName.length) > 4 ? item.ownerUserName : ''
|
|
242
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
243
|
+
className: styles.userBox
|
|
244
|
+
}, item.ownerUserName && ((_item$ownerUserName2 = item.ownerUserName) === null || _item$ownerUserName2 === void 0 ? void 0 : _item$ownerUserName2.length) > 4 ? "".concat((_item$ownerUserName3 = item.ownerUserName) === null || _item$ownerUserName3 === void 0 ? void 0 : _item$ownerUserName3.slice(0, 4), "...") : item.ownerUserName)))));
|
|
245
|
+
}), optionList.length <= 0 && /*#__PURE__*/React.createElement(Empty, {
|
|
246
|
+
image: Empty.PRESENTED_IMAGE_SIMPLE,
|
|
247
|
+
description: "\u6682\u65E0\u6570\u636E"
|
|
248
|
+
}))) : null;
|
|
172
249
|
}
|
|
173
|
-
},
|
|
174
|
-
src: UpIcon,
|
|
175
|
-
alt: "",
|
|
176
|
-
onClick: handleClearAll
|
|
177
|
-
}) : /*#__PURE__*/React.createElement("img", {
|
|
178
|
-
src: DownIcon,
|
|
179
|
-
alt: ""
|
|
180
|
-
}))));
|
|
250
|
+
}, renderAccountView());
|
|
181
251
|
};
|
|
182
|
-
var AccountSelectList = function
|
|
183
|
-
var accounts
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
return newState;
|
|
199
|
-
});
|
|
200
|
-
};
|
|
252
|
+
var AccountSelectList = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
253
|
+
var _props$accounts;
|
|
254
|
+
var _React$useState9 = React.useState({}),
|
|
255
|
+
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
256
|
+
selectValues = _React$useState10[0],
|
|
257
|
+
setSelectValues = _React$useState10[1];
|
|
258
|
+
useImperativeHandle(ref, function () {
|
|
259
|
+
return {
|
|
260
|
+
resetSelectList: function resetSelectList() {
|
|
261
|
+
return setSelectValues({});
|
|
262
|
+
},
|
|
263
|
+
setNewsSelectAccount: function setNewsSelectAccount(selectValue) {
|
|
264
|
+
setSelectValues(selectValue);
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
});
|
|
201
268
|
return /*#__PURE__*/React.createElement(Row, {
|
|
202
269
|
gutter: [32, 32]
|
|
203
|
-
}, accounts === null || accounts === void 0 ? void 0 : accounts.map(function (account, index) {
|
|
270
|
+
}, (_props$accounts = props.accounts) === null || _props$accounts === void 0 ? void 0 : _props$accounts.map(function (account, index) {
|
|
204
271
|
return /*#__PURE__*/React.createElement(Col, {
|
|
205
|
-
span: 8,
|
|
272
|
+
span: props.colSpan || 8,
|
|
206
273
|
key: index
|
|
207
|
-
}, /*#__PURE__*/React.createElement(AccountSelect, {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
onSelectionChange: handleSelectionChange,
|
|
217
|
-
selectedValues: selectedAccounts[account.key]
|
|
218
|
-
}));
|
|
274
|
+
}, /*#__PURE__*/React.createElement(AccountSelect, _extends({}, account, {
|
|
275
|
+
onChange: function onChange(values) {
|
|
276
|
+
var _props$onChange4;
|
|
277
|
+
var tValues = _objectSpread({}, selectValues);
|
|
278
|
+
tValues[account.key] = values;
|
|
279
|
+
setSelectValues(tValues);
|
|
280
|
+
(_props$onChange4 = props.onChange) === null || _props$onChange4 === void 0 || _props$onChange4.call(props, tValues);
|
|
281
|
+
}
|
|
282
|
+
})));
|
|
219
283
|
}));
|
|
220
|
-
};
|
|
221
|
-
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
// 类型扩展 - 声明 AccountSelect 包含 Group 属性
|
|
287
|
+
|
|
288
|
+
// 将 AccountSelectList 附加为 AccountSelect 的静态属性
|
|
289
|
+
AccountSelect.Group = AccountSelectList;
|
|
290
|
+
|
|
291
|
+
// 导出带有 Group 属性的 AccountSelect
|
|
292
|
+
export default AccountSelect;
|