component-shipinlv 2.3.6 → 2.3.8

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.
Files changed (117) hide show
  1. package/dist/Auth/index.js +45 -26
  2. package/dist/AuthClient/qr/index.css.js +1 -1
  3. package/dist/PhonePublish/account-manage/home.d.ts +11 -0
  4. package/dist/PhonePublish/account-manage/home.js +243 -0
  5. package/dist/PhonePublish/account-manage/home.less +28 -0
  6. package/dist/PhonePublish/account-manage/index.d.ts +3 -0
  7. package/dist/PhonePublish/account-manage/index.js +56 -0
  8. package/dist/PhonePublish/account-manage/index.less +59 -0
  9. package/dist/PhonePublish/account-manage/list.d.ts +17 -0
  10. package/dist/PhonePublish/account-manage/list.js +443 -0
  11. package/dist/PhonePublish/account-manage/list.less +95 -0
  12. package/dist/PhonePublish/account-manage/setting/index.d.ts +6 -0
  13. package/dist/PhonePublish/account-manage/setting/index.js +199 -0
  14. package/dist/PhonePublish/account-manage/setting/index.less +11 -0
  15. package/dist/PhonePublish/create-task/base/index.d.ts +10 -0
  16. package/dist/PhonePublish/create-task/base/index.js +386 -0
  17. package/dist/PhonePublish/create-task/base/index.less +64 -0
  18. package/dist/PhonePublish/create-task/getVideoGoodsUrl.d.ts +2 -0
  19. package/dist/PhonePublish/create-task/getVideoGoodsUrl.js +136 -0
  20. package/dist/PhonePublish/create-task/hour-enabled.d.ts +9 -0
  21. package/dist/PhonePublish/create-task/hour-enabled.js +42 -0
  22. package/dist/PhonePublish/create-task/hour-enabled.less +24 -0
  23. package/dist/PhonePublish/create-task/index.d.ts +11 -0
  24. package/dist/PhonePublish/create-task/index.js +449 -0
  25. package/dist/PhonePublish/create-task/index.less +75 -0
  26. package/dist/PhonePublish/create-task/select-list.css.d.ts +5 -0
  27. package/dist/PhonePublish/create-task/select-list.css.js +6 -0
  28. package/dist/PhonePublish/create-task/select-list.d.ts +8 -0
  29. package/dist/PhonePublish/create-task/select-list.js +304 -0
  30. package/dist/PhonePublish/create-task/task-list.css.d.ts +5 -0
  31. package/dist/PhonePublish/create-task/task-list.css.js +6 -0
  32. package/dist/PhonePublish/create-task/task-list.d.ts +9 -0
  33. package/dist/PhonePublish/create-task/task-list.js +323 -0
  34. package/dist/PhonePublish/index.css.d.ts +2 -0
  35. package/dist/PhonePublish/index.css.js +35 -0
  36. package/dist/PhonePublish/index.d.ts +15 -0
  37. package/dist/PhonePublish/index.js +191 -0
  38. package/dist/PhonePublish/index.less +55 -0
  39. package/dist/PhonePublish/lib/chrome-quit.d.ts +2 -0
  40. package/dist/PhonePublish/lib/chrome-quit.js +20 -0
  41. package/dist/PhonePublish/log/index.d.ts +8 -0
  42. package/dist/PhonePublish/log/index.js +186 -0
  43. package/dist/PhonePublish/log/index.less +81 -0
  44. package/dist/PhonePublish/publish-task-plan/index.d.ts +9 -0
  45. package/dist/PhonePublish/publish-task-plan/index.js +32 -0
  46. package/dist/PhonePublish/publish-task-plan/index.less +4 -0
  47. package/dist/PhonePublish/publish-task-plan/tool-bak.txt +219 -0
  48. package/dist/PhonePublish/publish-task-plan/tool.d.ts +29 -0
  49. package/dist/PhonePublish/publish-task-plan/tool.js +720 -0
  50. package/dist/PhonePublish/task-list/index.d.ts +8 -0
  51. package/dist/PhonePublish/task-list/index.js +224 -0
  52. package/dist/PhonePublish/task-list/index.less +8 -0
  53. package/dist/PhonePublish/task-list/plan/list.d.ts +12 -0
  54. package/dist/PhonePublish/task-list/plan/list.js +290 -0
  55. package/dist/PhonePublish/task-list/plan/list.less +87 -0
  56. package/dist/PhonePublish/task-list/plan/operate.d.ts +8 -0
  57. package/dist/PhonePublish/task-list/plan/operate.js +145 -0
  58. package/dist/PhonePublish/task-list/plan/query.d.ts +8 -0
  59. package/dist/PhonePublish/task-list/plan/query.js +89 -0
  60. package/dist/PhonePublish/task-list/plan/query.less +9 -0
  61. package/dist/PhonePublish/task-list/plan/status.d.ts +13 -0
  62. package/dist/PhonePublish/task-list/plan/status.js +53 -0
  63. package/dist/PhonePublish/task-list/query.d.ts +8 -0
  64. package/dist/PhonePublish/task-list/query.js +76 -0
  65. package/dist/PhonePublish/task-list/query.less +19 -0
  66. package/dist/PhonePublish/task-list/who-can-view.d.ts +12 -0
  67. package/dist/PhonePublish/task-list/who-can-view.js +37 -0
  68. package/dist/PhonePublish/video-account/ban/index.d.ts +10 -0
  69. package/dist/PhonePublish/video-account/ban/index.js +94 -0
  70. package/dist/PhonePublish/video-account/ban/index.less +4 -0
  71. package/dist/PhonePublish/video-account/base-info.d.ts +13 -0
  72. package/dist/PhonePublish/video-account/base-info.js +75 -0
  73. package/dist/PhonePublish/video-account/base-info.less +92 -0
  74. package/dist/PhonePublish/video-account/create.d.ts +8 -0
  75. package/dist/PhonePublish/video-account/create.js +174 -0
  76. package/dist/PhonePublish/video-account/group.d.ts +9 -0
  77. package/dist/PhonePublish/video-account/group.js +255 -0
  78. package/dist/PhonePublish/video-account/group.less +10 -0
  79. package/dist/PhonePublish/video-account/index.d.ts +8 -0
  80. package/dist/PhonePublish/video-account/index.js +403 -0
  81. package/dist/PhonePublish/video-account/index.less +92 -0
  82. package/dist/PhonePublish/video-account/query.d.ts +8 -0
  83. package/dist/PhonePublish/video-account/query.js +115 -0
  84. package/dist/PhonePublish/video-account/query.less +18 -0
  85. package/dist/PhonePublish/video-publish-statistic/account-trend/index.d.ts +8 -0
  86. package/dist/PhonePublish/video-publish-statistic/account-trend/index.js +173 -0
  87. package/dist/PhonePublish/video-publish-statistic/account-trend/index.less +3 -0
  88. package/dist/PhonePublish/video-publish-statistic/account-trend/kind-list.d.ts +7 -0
  89. package/dist/PhonePublish/video-publish-statistic/account-trend/kind-list.js +22 -0
  90. package/dist/PhonePublish/video-publish-statistic/account-trend/query.d.ts +9 -0
  91. package/dist/PhonePublish/video-publish-statistic/account-trend/query.js +54 -0
  92. package/dist/PhonePublish/video-publish-statistic/account-trend/query.less +3 -0
  93. package/dist/PhonePublish/video-publish-statistic/index.d.ts +2 -0
  94. package/dist/PhonePublish/video-publish-statistic/index.js +37 -0
  95. package/dist/PhonePublish/video-publish-statistic/kind.d.ts +16 -0
  96. package/dist/PhonePublish/video-publish-statistic/kind.js +57 -0
  97. package/dist/PhonePublish/video-publish-statistic/operation/list.d.ts +7 -0
  98. package/dist/PhonePublish/video-publish-statistic/operation/list.js +242 -0
  99. package/dist/PhonePublish/video-publish-statistic/operation/list.less +10 -0
  100. package/dist/PhonePublish/video-publish-statistic/operation/query.d.ts +8 -0
  101. package/dist/PhonePublish/video-publish-statistic/operation/query.js +56 -0
  102. package/dist/PhonePublish/video-publish-statistic/operation/query.less +3 -0
  103. package/dist/PhonePublish/video-publish-statistic/publish-plan/list.d.ts +8 -0
  104. package/dist/PhonePublish/video-publish-statistic/publish-plan/list.js +257 -0
  105. package/dist/PhonePublish/video-publish-statistic/publish-plan/list.less +105 -0
  106. package/dist/PhonePublish/video-publish-statistic/publish-plan/query.d.ts +9 -0
  107. package/dist/PhonePublish/video-publish-statistic/publish-plan/query.js +79 -0
  108. package/dist/PhonePublish/video-publish-statistic/publish-plan/query.less +3 -0
  109. package/dist/VideoPublish/account-manage/list.js +1 -1
  110. package/dist/index.d.ts +1 -0
  111. package/dist/index.js +1 -0
  112. package/dist/lib/Tool.d.ts +1 -1
  113. package/dist/phone/index.d.ts +8 -0
  114. package/dist/phone/index.js +62 -0
  115. package/dist/phone/index.less +170 -0
  116. package/dist/typings.d.ts +1 -1
  117. package/package.json +1 -1
@@ -0,0 +1,75 @@
1
+ import React from "react";
2
+ import "./base-info.less";
3
+ import { Avatar, Popconfirm, Tooltip } from "antd";
4
+ import VideoPlatformLogo from "../../component/video-platform/logo";
5
+ import { CloseOutlined } from "@ant-design/icons";
6
+ import AccountBan from "../../component/AccountBan";
7
+ import { jsxs as _jsxs } from "react/jsx-runtime";
8
+ import { Fragment as _Fragment } from "react/jsx-runtime";
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ var VideoPublishVideoAccountBaseInfo = function VideoPublishVideoAccountBaseInfo(_ref) {
11
+ var id = _ref.id,
12
+ _ref$className = _ref.className,
13
+ className = _ref$className === void 0 ? '' : _ref$className,
14
+ index = _ref.index,
15
+ accountInfo = _ref.accountInfo,
16
+ disabledDel = _ref.disabledDel,
17
+ _ref$onClick = _ref.onClick,
18
+ _onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
19
+ _ref$onDel = _ref.onDel,
20
+ onDel = _ref$onDel === void 0 ? function () {} : _ref$onDel;
21
+ return /*#__PURE__*/_jsx(Tooltip, {
22
+ title: /*#__PURE__*/_jsxs(_Fragment, {
23
+ children: ["\u6240\u5C5E\u5206\u7EC4\uFF1A", accountInfo === null || accountInfo === void 0 ? void 0 : accountInfo.groupName, /*#__PURE__*/_jsxs("div", {
24
+ children: ["\u7F16\u53F7\uFF1A", accountInfo === null || accountInfo === void 0 ? void 0 : accountInfo.id]
25
+ })]
26
+ }),
27
+ children: /*#__PURE__*/_jsxs("article", {
28
+ className: "videoAccountBaseInfo ".concat(className, " ").concat(accountInfo !== null && accountInfo !== void 0 && accountInfo.isLoginValid ? "valid" : "invalid"),
29
+ onClick: function onClick() {
30
+ return _onClick();
31
+ },
32
+ children: [typeof index === 'number' && /*#__PURE__*/_jsx("i", {
33
+ className: "index",
34
+ children: index + 1
35
+ }), typeof id === 'number' && !disabledDel && /*#__PURE__*/_jsx(Popconfirm, {
36
+ title: "\u5220\u9664\u8D26\u6237",
37
+ description: "\u786E\u5B9A\u5220\u9664\u8D26\u6237\uFF1F\u5220\u9664\u4E4B\u540E\u4E0D\u80FD\u53D1\u5E03\u89C6\u9891\u4E86",
38
+ onConfirm: function onConfirm() {
39
+ return onDel(id);
40
+ },
41
+ children: /*#__PURE__*/_jsx("a", {
42
+ className: "del",
43
+ children: /*#__PURE__*/_jsx(CloseOutlined, {})
44
+ })
45
+ }), /*#__PURE__*/_jsxs("div", {
46
+ className: "avatar",
47
+ children: [/*#__PURE__*/_jsx(Avatar, {
48
+ className: "avatarUrl",
49
+ size: 46,
50
+ src: (accountInfo === null || accountInfo === void 0 ? void 0 : accountInfo.avatar) || 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'
51
+ }), /*#__PURE__*/_jsx(Tooltip, {
52
+ title: accountInfo !== null && accountInfo !== void 0 && accountInfo.isLoginValid ? '登录有效' : '登录失效',
53
+ children: /*#__PURE__*/_jsx("div", {
54
+ className: "isLoginValid"
55
+ })
56
+ })]
57
+ }), /*#__PURE__*/_jsxs("div", {
58
+ className: "shopName",
59
+ children: [(accountInfo === null || accountInfo === void 0 ? void 0 : accountInfo.isBan) && /*#__PURE__*/_jsx(AccountBan, {
60
+ isBan: accountInfo.isBan
61
+ }), /*#__PURE__*/_jsx(VideoPlatformLogo, {
62
+ platform: (accountInfo === null || accountInfo === void 0 ? void 0 : accountInfo.platform) || '',
63
+ size: 12
64
+ }), accountInfo === null || accountInfo === void 0 ? void 0 : accountInfo.nickname, /*#__PURE__*/_jsx("div", {
65
+ className: "nicknameRemark",
66
+ children: accountInfo === null || accountInfo === void 0 ? void 0 : accountInfo.nicknameRemark
67
+ }), /*#__PURE__*/_jsx("div", {
68
+ className: "uniqueId",
69
+ children: accountInfo === null || accountInfo === void 0 ? void 0 : accountInfo.uniqueId
70
+ })]
71
+ })]
72
+ })
73
+ });
74
+ };
75
+ export default VideoPublishVideoAccountBaseInfo;
@@ -0,0 +1,92 @@
1
+ .videoAccountBaseInfo{
2
+ position: relative;
3
+ display: flex;
4
+ flex-direction: row;
5
+ cursor: pointer;
6
+ .index{
7
+ position: absolute;
8
+ top: 10px;
9
+ right: 4px;
10
+ font-size: 12px;
11
+ font-style: normal;
12
+ opacity: 0.3;
13
+ }
14
+ .del{
15
+ position: absolute;
16
+ bottom: 7px;
17
+ right: 4px;
18
+ padding: 3px;
19
+ font-size: 12px;
20
+ color: #FFF;
21
+ border-radius: 3px;
22
+ background-color: #C00;
23
+ line-height: 1em;
24
+ display: none;
25
+ }
26
+ &.valid{
27
+ .isLoginValid{
28
+ background-color: #00bc00;
29
+ }
30
+ .shopName{
31
+ color: #005a00;
32
+ }
33
+ }
34
+ &.invalid{
35
+ background-color: #e1e1e1;
36
+ .isLoginValid{
37
+ background-color: red;
38
+ }
39
+ .shopName{
40
+ color: #999;
41
+ font-weight: 300;
42
+ }
43
+ .avatarUrl{
44
+ opacity: 0.5;
45
+ filter: grayscale(100%);
46
+ }
47
+ }
48
+ .avatar{
49
+ position: relative;
50
+ width: 40px;
51
+ //box-shadow: 0 0 5px #EEE;
52
+ .avatarUrl{
53
+ border-radius: 100px;
54
+ box-shadow: 0 0 5px #EEE;
55
+ }
56
+ .isLoginValid{
57
+ position: absolute;
58
+ left: 35px;
59
+ top: 35px;
60
+ width: 8px;
61
+ height: 8px;
62
+ border-radius: 100px;
63
+ }
64
+ }
65
+ .shopName{
66
+ max-width: 150px;
67
+ color: #666;
68
+ display: inline-block;
69
+ text-overflow: ellipsis;
70
+ //line-height: 30px;
71
+ font-size: 12px;
72
+ padding: 1px 0 0 12px;
73
+ line-height: 1.1em;
74
+ word-break: keep-all;
75
+ white-space: nowrap;
76
+ overflow: hidden;
77
+ }
78
+ .nicknameRemark{
79
+ max-width: 150px;
80
+ color: #666;
81
+ text-overflow: ellipsis;
82
+ overflow: hidden;
83
+ //background-color: #F6F6F6;
84
+ padding: 2px 0 1px;
85
+ font-weight: 300;
86
+ }
87
+ .uniqueId{
88
+ padding: 1px 0 0;
89
+ font-size: 12px;
90
+ opacity: 0.6;
91
+ }
92
+ }
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ env?: Global.Env;
4
+ id: number;
5
+ onSuccess: () => void;
6
+ }
7
+ declare const VideoAccountCreate: React.FC<Props>;
8
+ export default VideoAccountCreate;
@@ -0,0 +1,174 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
3
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
4
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
5
+ import React, { useState } from 'react';
6
+ import { Button, Form, Input, Select, Switch, Tag } from 'antd';
7
+ import { useRequest } from "@umijs/hooks";
8
+ import * as VideoAccountController from "../../service/api/VideoPublishVideoAccountController";
9
+ import PageContentWarp from "../../UI/PageContentWarp";
10
+ import Tool from "../../lib/Tool";
11
+ import DialogDrawerFooter from "../../UI/DialogDrawerFooter";
12
+ import * as VideoPublishVideoAccountGroupController from "../../service/api/VideoPublishVideoAccountGroupController";
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { jsxs as _jsxs } from "react/jsx-runtime";
15
+ var VideoAccountCreate = function VideoAccountCreate(_ref) {
16
+ var env = _ref.env,
17
+ id = _ref.id,
18
+ _ref$onSuccess = _ref.onSuccess,
19
+ _onSuccess3 = _ref$onSuccess === void 0 ? function () {} : _ref$onSuccess;
20
+ var _Form$useForm = Form.useForm(),
21
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
22
+ form = _Form$useForm2[0];
23
+ var _useState = useState([]),
24
+ _useState2 = _slicedToArray(_useState, 2),
25
+ groupList = _useState2[0],
26
+ setGroupList = _useState2[1];
27
+ var _useRequest = useRequest(function () {
28
+ return VideoPublishVideoAccountGroupController.list({}, {
29
+ env: env
30
+ });
31
+ }, {
32
+ onSuccess: function () {
33
+ var _onSuccess = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(result) {
34
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
35
+ while (1) switch (_context.prev = _context.next) {
36
+ case 0:
37
+ setGroupList(result);
38
+ case 1:
39
+ case "end":
40
+ return _context.stop();
41
+ }
42
+ }, _callee);
43
+ }));
44
+ function onSuccess(_x) {
45
+ return _onSuccess.apply(this, arguments);
46
+ }
47
+ return onSuccess;
48
+ }()
49
+ }),
50
+ runGroupList = _useRequest.run,
51
+ loadingGroupList = _useRequest.loading;
52
+ var _useRequest2 = useRequest(function () {
53
+ return VideoAccountController.detailById({
54
+ id: id
55
+ }, {
56
+ env: env
57
+ });
58
+ }, {
59
+ onSuccess: function () {
60
+ var _onSuccess2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(result) {
61
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
62
+ while (1) switch (_context2.prev = _context2.next) {
63
+ case 0:
64
+ form.setFieldsValue({
65
+ nicknameRemark: result.nicknameRemark,
66
+ groupId: result.groupId || 0,
67
+ enabledActiveAccountMode: typeof result.enabledActiveAccountMode === 'boolean' ? result.enabledActiveAccountMode : true
68
+ });
69
+ case 1:
70
+ case "end":
71
+ return _context2.stop();
72
+ }
73
+ }, _callee2);
74
+ }));
75
+ function onSuccess(_x2) {
76
+ return _onSuccess2.apply(this, arguments);
77
+ }
78
+ return onSuccess;
79
+ }()
80
+ }),
81
+ run = _useRequest2.run,
82
+ loading = _useRequest2.loading,
83
+ error = _useRequest2.error;
84
+ var _useRequest3 = useRequest(function (data) {
85
+ return VideoAccountController.editInfo(_objectSpread({}, data), {
86
+ env: env
87
+ });
88
+ }, {
89
+ manual: true,
90
+ onSuccess: function () {
91
+ var _onSuccess4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(result) {
92
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
93
+ while (1) switch (_context3.prev = _context3.next) {
94
+ case 0:
95
+ Tool.toast('已经保存');
96
+ _onSuccess3();
97
+ case 2:
98
+ case "end":
99
+ return _context3.stop();
100
+ }
101
+ }, _callee3);
102
+ }));
103
+ function onSuccess(_x3) {
104
+ return _onSuccess4.apply(this, arguments);
105
+ }
106
+ return onSuccess;
107
+ }()
108
+ }),
109
+ runEditInfo = _useRequest3.run,
110
+ loadingEditInfo = _useRequest3.loading;
111
+ var onFinish = function onFinish(values) {
112
+ runEditInfo(_objectSpread(_objectSpread({}, values), {}, {
113
+ id: id
114
+ }));
115
+ };
116
+ return /*#__PURE__*/_jsx(PageContentWarp, {
117
+ className: "videoAccountGroupCreate",
118
+ loading: loading,
119
+ error: error,
120
+ onReload: function onReload() {
121
+ return run();
122
+ },
123
+ children: /*#__PURE__*/_jsxs(Form, {
124
+ labelCol: {
125
+ span: 6
126
+ },
127
+ form: form,
128
+ disabled: loadingEditInfo,
129
+ onFinish: onFinish,
130
+ children: [/*#__PURE__*/_jsx(Form.Item, {
131
+ name: "groupId",
132
+ label: "\u5206\u7EC4",
133
+ children: /*#__PURE__*/_jsxs(Select, {
134
+ children: [/*#__PURE__*/_jsx(Select.Option, {
135
+ value: 0,
136
+ children: /*#__PURE__*/_jsx(Tag, {
137
+ children: "\u9ED8\u8BA4"
138
+ })
139
+ }), groupList.map(function (items, index) {
140
+ return /*#__PURE__*/_jsx(Select.Option, {
141
+ value: items.id,
142
+ children: items.name
143
+ }, items.id);
144
+ })]
145
+ })
146
+ }), /*#__PURE__*/_jsx(Form.Item, {
147
+ name: "nicknameRemark",
148
+ label: "\u8D26\u53F7\u5907\u6CE8",
149
+ rules: [{
150
+ max: 20,
151
+ message: '最多20个字符'
152
+ }],
153
+ children: /*#__PURE__*/_jsx(Input, {
154
+ placeholder: "\u8F93\u5165\u8D26\u53F7\u5907\u6CE8"
155
+ })
156
+ }), /*#__PURE__*/_jsx(Form.Item, {
157
+ name: "enabledActiveAccountMode",
158
+ label: "\u662F\u5426\u542F\u7528\u517B\u53F7",
159
+ children: /*#__PURE__*/_jsx(Switch, {
160
+ checkedChildren: "\u542F\u7528\u517B\u53F7\u53D1\u5E03",
161
+ unCheckedChildren: "\u7981\u7528\u517B\u53F7\u53D1\u5E03"
162
+ })
163
+ }), /*#__PURE__*/_jsx(DialogDrawerFooter, {
164
+ children: /*#__PURE__*/_jsx(Button, {
165
+ type: "primary",
166
+ htmlType: "submit",
167
+ loading: loadingEditInfo,
168
+ children: "\u4FDD\u5B58"
169
+ })
170
+ })]
171
+ })
172
+ });
173
+ };
174
+ export default VideoAccountCreate;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import './group.less';
3
+ interface Props {
4
+ env?: Global.Env;
5
+ onSuccess: () => void;
6
+ onGroupChange: () => void;
7
+ }
8
+ declare const VideoAccountGroup: React.FC<Props>;
9
+ export default VideoAccountGroup;
@@ -0,0 +1,255 @@
1
+ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
4
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
5
+ import React, { useState } from 'react';
6
+ import { Button, Col, Form, Input, Popconfirm, Row } from 'antd';
7
+ import "./group.less";
8
+ import { useRequest } from "@umijs/hooks";
9
+ import * as VideoPublishVideoAccountGroupController from "../../service/api/VideoPublishVideoAccountGroupController";
10
+ import PageContentWarp from "../../UI/PageContentWarp";
11
+ import { CheckCircleOutlined, CloseCircleOutlined, LoadingOutlined, PlusCircleOutlined } from "@ant-design/icons";
12
+ import Tool from "../../lib/Tool";
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { jsxs as _jsxs } from "react/jsx-runtime";
15
+ var VideoAccountGroup = function VideoAccountGroup(_ref) {
16
+ var env = _ref.env,
17
+ _ref$onSuccess = _ref.onSuccess,
18
+ onSuccess = _ref$onSuccess === void 0 ? function () {} : _ref$onSuccess,
19
+ _ref$onGroupChange = _ref.onGroupChange,
20
+ onGroupChange = _ref$onGroupChange === void 0 ? function () {} : _ref$onGroupChange;
21
+ var _Form$useForm = Form.useForm(),
22
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
23
+ form = _Form$useForm2[0];
24
+ var _useState = useState([]),
25
+ _useState2 = _slicedToArray(_useState, 2),
26
+ groupList = _useState2[0],
27
+ setGroupList = _useState2[1];
28
+ var _useRequest = useRequest(function () {
29
+ return VideoPublishVideoAccountGroupController.list({}, {
30
+ env: env
31
+ });
32
+ }, {
33
+ onSuccess: function () {
34
+ var _onSuccess = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(result) {
35
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
36
+ while (1) switch (_context.prev = _context.next) {
37
+ case 0:
38
+ groupList.push({
39
+ _key: '-1',
40
+ id: -1,
41
+ name: '默认',
42
+ isChange: false
43
+ });
44
+ result.forEach(function (items) {
45
+ groupList.push({
46
+ _key: Tool.math.randWord(10),
47
+ id: items.id,
48
+ name: items.name,
49
+ isChange: false
50
+ });
51
+ });
52
+ setGroupList(_toConsumableArray(groupList));
53
+ case 3:
54
+ case "end":
55
+ return _context.stop();
56
+ }
57
+ }, _callee);
58
+ }));
59
+ function onSuccess(_x) {
60
+ return _onSuccess.apply(this, arguments);
61
+ }
62
+ return onSuccess;
63
+ }()
64
+ }),
65
+ run = _useRequest.run,
66
+ loading = _useRequest.loading,
67
+ error = _useRequest.error;
68
+ var _useRequest2 = useRequest(function (id) {
69
+ return VideoPublishVideoAccountGroupController.del({
70
+ id: id
71
+ }, {
72
+ env: env
73
+ });
74
+ }, {
75
+ manual: true,
76
+ onSuccess: function () {
77
+ var _onSuccess2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(result) {
78
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
79
+ while (1) switch (_context2.prev = _context2.next) {
80
+ case 0:
81
+ Tool.toast('已经删除');
82
+ onGroupChange();
83
+ case 2:
84
+ case "end":
85
+ return _context2.stop();
86
+ }
87
+ }, _callee2);
88
+ }));
89
+ function onSuccess(_x2) {
90
+ return _onSuccess2.apply(this, arguments);
91
+ }
92
+ return onSuccess;
93
+ }()
94
+ }),
95
+ runDel = _useRequest2.run,
96
+ loadingDel = _useRequest2.loading;
97
+ var onName = function onName(index, name) {
98
+ groupList[index].name = name;
99
+ groupList[index].isChange = true;
100
+ setGroupList(_toConsumableArray(groupList));
101
+ };
102
+ var onDel = /*#__PURE__*/function () {
103
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(index) {
104
+ var id, delResult;
105
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
106
+ while (1) switch (_context3.prev = _context3.next) {
107
+ case 0:
108
+ id = groupList[index].id;
109
+ if (!(id === 0)) {
110
+ _context3.next = 5;
111
+ break;
112
+ }
113
+ groupList.splice(index, 1);
114
+ setGroupList(_toConsumableArray(groupList));
115
+ return _context3.abrupt("return");
116
+ case 5:
117
+ console.log('delResult 0:', id);
118
+ _context3.next = 8;
119
+ return runDel(id).then(function (result) {
120
+ console.log('then 10:', result);
121
+ groupList.splice(index, 1);
122
+ setGroupList(_toConsumableArray(groupList));
123
+ }).catch(function (err) {});
124
+ case 8:
125
+ delResult = _context3.sent;
126
+ case 9:
127
+ case "end":
128
+ return _context3.stop();
129
+ }
130
+ }, _callee3);
131
+ }));
132
+ return function onDel(_x3) {
133
+ return _ref2.apply(this, arguments);
134
+ };
135
+ }();
136
+ var onSubmit = /*#__PURE__*/function () {
137
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(index) {
138
+ var item, createResult;
139
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
140
+ while (1) switch (_context4.prev = _context4.next) {
141
+ case 0:
142
+ groupList[index].loading = true;
143
+ setGroupList(_toConsumableArray(groupList));
144
+ item = groupList[index];
145
+ _context4.next = 5;
146
+ return VideoPublishVideoAccountGroupController.create({
147
+ id: item.id,
148
+ name: "".concat(item.name)
149
+ }, {
150
+ env: env
151
+ }).catch(function (err) {});
152
+ case 5:
153
+ createResult = _context4.sent;
154
+ groupList[index].loading = false;
155
+ if (!createResult) {} else {
156
+ groupList[index].isChange = false;
157
+ Tool.toast('已保存');
158
+ if (createResult) {
159
+ groupList[index].id = createResult.id;
160
+ }
161
+ }
162
+ setGroupList(_toConsumableArray(groupList));
163
+ onGroupChange();
164
+ case 10:
165
+ case "end":
166
+ return _context4.stop();
167
+ }
168
+ }, _callee4);
169
+ }));
170
+ return function onSubmit(_x4) {
171
+ return _ref3.apply(this, arguments);
172
+ };
173
+ }();
174
+ var onAdd = function onAdd() {
175
+ groupList.push({
176
+ _key: Tool.math.randWord(10),
177
+ id: 0,
178
+ name: '',
179
+ isChange: true
180
+ });
181
+ setGroupList(_toConsumableArray(groupList));
182
+ };
183
+ return /*#__PURE__*/_jsx(PageContentWarp, {
184
+ className: "videoAccountGroupCreate",
185
+ loading: loading,
186
+ error: error,
187
+ onReload: run,
188
+ children: /*#__PURE__*/_jsxs(Form, {
189
+ labelCol: {
190
+ span: 6
191
+ },
192
+ form: form,
193
+ disabled: loadingDel
194
+ // onFinish={ onFinish }
195
+ ,
196
+ children: [groupList.map(function (items, index) {
197
+ return /*#__PURE__*/_jsxs(Row, {
198
+ children: [/*#__PURE__*/_jsx(Col, {
199
+ span: 21,
200
+ children: /*#__PURE__*/_jsx(Form.Item, {
201
+ rules: [{
202
+ required: true,
203
+ message: '请输入'
204
+ }, {
205
+ max: 8,
206
+ message: '最多8个字符'
207
+ }],
208
+ children: /*#__PURE__*/_jsx(Input, {
209
+ disabled: index === 0 || items.loading,
210
+ value: items.name,
211
+ placeholder: "\u8F93\u5165\u5206\u7EC4\u540D\u79F0",
212
+ addonAfter: index > 0 && (items.isChange ? /*#__PURE__*/_jsxs("a", {
213
+ onClick: function onClick() {
214
+ return onSubmit(index);
215
+ },
216
+ children: [items.loading && /*#__PURE__*/_jsx(LoadingOutlined, {}), " \u4FDD\u5B58"]
217
+ }) : /*#__PURE__*/_jsx(CheckCircleOutlined, {
218
+ className: "saved"
219
+ })),
220
+ onChange: function onChange(e) {
221
+ return onName(index, e.target.value);
222
+ }
223
+ })
224
+ })
225
+ }), /*#__PURE__*/_jsx(Col, {
226
+ span: 2,
227
+ offset: 1,
228
+ children: items.id > 0 && /*#__PURE__*/_jsx(Popconfirm, {
229
+ title: "\u5220\u9664\u5206\u7EC4",
230
+ description: "\u4EC5\u5220\u9664\u5206\u7EC4\uFF0C\u4E0D\u5220\u9664\u8D26\u53F7",
231
+ onConfirm: function onConfirm() {
232
+ return onDel(index);
233
+ },
234
+ children: /*#__PURE__*/_jsx("a", {
235
+ className: "del",
236
+ children: /*#__PURE__*/_jsx(CloseCircleOutlined, {})
237
+ })
238
+ })
239
+ })]
240
+ }, "".concat(items.id, "-").concat(items._key));
241
+ }), /*#__PURE__*/_jsx("div", {
242
+ children: /*#__PURE__*/_jsx(Button, {
243
+ disabled: loadingDel,
244
+ type: "primary",
245
+ icon: /*#__PURE__*/_jsx(PlusCircleOutlined, {}),
246
+ onClick: onAdd,
247
+ ghost: true,
248
+ size: "small",
249
+ children: "\u589E\u52A0"
250
+ })
251
+ })]
252
+ })
253
+ });
254
+ };
255
+ export default VideoAccountGroup;
@@ -0,0 +1,10 @@
1
+ .videoAccountGroupCreate{
2
+ .del{
3
+ display: block;
4
+ line-height: 32px;
5
+ color: #C00;
6
+ }
7
+ .saved{
8
+ color: #999;
9
+ }
10
+ }
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import "./index.less";
3
+ interface Props {
4
+ disabled?: boolean;
5
+ env?: Global.Env;
6
+ }
7
+ declare const VideoPublishVideoAccount: React.FC<Props>;
8
+ export default VideoPublishVideoAccount;