component-shipinlv 1.0.35 → 1.0.36
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/VideoPublish/create-task/base/index.d.ts +10 -0
- package/dist/VideoPublish/create-task/base/index.js +315 -0
- package/dist/VideoPublish/create-task/base/index.less +64 -0
- package/dist/VideoPublish/create-task/index.js +294 -0
- package/dist/VideoPublish/index.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/types/VideoPublish.d.ts +4 -2
- package/package.json +1 -1
- package/dist/VideoPublish/creat-task/index.js +0 -569
- /package/dist/VideoPublish/{creat-task → create-task}/hour-enabled.d.ts +0 -0
- /package/dist/VideoPublish/{creat-task → create-task}/hour-enabled.js +0 -0
- /package/dist/VideoPublish/{creat-task → create-task}/hour-enabled.less +0 -0
- /package/dist/VideoPublish/{creat-task → create-task}/index.css.d.ts +0 -0
- /package/dist/VideoPublish/{creat-task → create-task}/index.css.js +0 -0
- /package/dist/VideoPublish/{creat-task → create-task}/index.d.ts +0 -0
- /package/dist/VideoPublish/{creat-task → create-task}/select-list.css.d.ts +0 -0
- /package/dist/VideoPublish/{creat-task → create-task}/select-list.css.js +0 -0
- /package/dist/VideoPublish/{creat-task → create-task}/select-list.d.ts +0 -0
- /package/dist/VideoPublish/{creat-task → create-task}/select-list.js +0 -0
- /package/dist/VideoPublish/{creat-task → create-task}/task-list.css.d.ts +0 -0
- /package/dist/VideoPublish/{creat-task → create-task}/task-list.css.js +0 -0
- /package/dist/VideoPublish/{creat-task → create-task}/task-list.d.ts +0 -0
- /package/dist/VideoPublish/{creat-task → create-task}/task-list.js +0 -0
@@ -0,0 +1,10 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import "./index.less";
|
3
|
+
interface Props {
|
4
|
+
disabled?: boolean;
|
5
|
+
createBaseData: VideoPublish.TaskCreateBaseData;
|
6
|
+
onCreateBaseData: (baseData: VideoPublish.TaskCreateBaseData) => void;
|
7
|
+
env?: Global.Env;
|
8
|
+
}
|
9
|
+
declare const VideoPublishCreateTaskBase: React.FC<Props>;
|
10
|
+
export default VideoPublishCreateTaskBase;
|
@@ -0,0 +1,315 @@
|
|
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 "./index.less";
|
7
|
+
import { Divider, Tag, Form, Tooltip, InputNumber, Select, Radio, DatePicker, ConfigProvider, Switch } from "antd";
|
8
|
+
import { RedoOutlined, ShoppingOutlined, UsergroupAddOutlined, VideoCameraOutlined } from "@ant-design/icons";
|
9
|
+
import PageContentWarp from "../../../UI/PageContentWarp";
|
10
|
+
import { TreeSelect } from 'antd';
|
11
|
+
import Tool from "../../../lib/Tool";
|
12
|
+
import { useRequest } from "@umijs/hooks";
|
13
|
+
import * as VideoPublishController from "../../../service/api/VideoPublishController";
|
14
|
+
import VideoPlatform from "../../../component/video-platform/logo";
|
15
|
+
import VideoPublishCreateTaskHourEnabled from "../hour-enabled";
|
16
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
17
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
18
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
19
|
+
var VideoPublishCreateTaskBase = function VideoPublishCreateTaskBase(_ref) {
|
20
|
+
var disabled = _ref.disabled,
|
21
|
+
createBaseData = _ref.createBaseData,
|
22
|
+
_ref$onCreateBaseData = _ref.onCreateBaseData,
|
23
|
+
onCreateBaseData = _ref$onCreateBaseData === void 0 ? function () {} : _ref$onCreateBaseData,
|
24
|
+
env = _ref.env;
|
25
|
+
var _useState = useState([]),
|
26
|
+
_useState2 = _slicedToArray(_useState, 2),
|
27
|
+
treeVideoAccountData = _useState2[0],
|
28
|
+
setTreeVideoAccountData = _useState2[1];
|
29
|
+
var _useRequest = useRequest(function () {
|
30
|
+
return VideoPublishController.videoAccountList({
|
31
|
+
isLoginValid: '',
|
32
|
+
// | '1' | '0';
|
33
|
+
keyword: '',
|
34
|
+
platform: '',
|
35
|
+
current: 1,
|
36
|
+
pageSize: 300 // 服务器 固定死了 300;
|
37
|
+
}, {
|
38
|
+
env: env
|
39
|
+
});
|
40
|
+
}, {
|
41
|
+
onSuccess: function onSuccess(result) {
|
42
|
+
var dict = {};
|
43
|
+
result.list.forEach(function (items) {
|
44
|
+
if (!dict[items.groupId]) {
|
45
|
+
dict[items.groupId] = {
|
46
|
+
title: /*#__PURE__*/_jsxs(_Fragment, {
|
47
|
+
children: [/*#__PURE__*/_jsx(UsergroupAddOutlined, {
|
48
|
+
className: "groupIcon"
|
49
|
+
}), " ", items.groupName || '默认分组']
|
50
|
+
}),
|
51
|
+
value: "group-".concat(items.groupId),
|
52
|
+
key: "group-".concat(items.groupId),
|
53
|
+
children: []
|
54
|
+
};
|
55
|
+
}
|
56
|
+
var followerCount = items.followerCount > 9999 ? /*#__PURE__*/_jsxs(_Fragment, {
|
57
|
+
children: [parseFloat((items.followerCount / 1e4).toFixed(1)), /*#__PURE__*/_jsx("small", {
|
58
|
+
children: "\u4E07"
|
59
|
+
})]
|
60
|
+
}) : items.followerCount;
|
61
|
+
dict[items.groupId].children.push({
|
62
|
+
title: /*#__PURE__*/_jsxs(_Fragment, {
|
63
|
+
children: [/*#__PURE__*/_jsx(VideoPlatform, {
|
64
|
+
platform: items.platform,
|
65
|
+
size: 14
|
66
|
+
}), " ", items.nickname, items.nicknameRemark && /*#__PURE__*/_jsx("small", {
|
67
|
+
className: "nicknameRemark",
|
68
|
+
children: items.nicknameRemark
|
69
|
+
}), /*#__PURE__*/_jsxs("small", {
|
70
|
+
className: "followerCount",
|
71
|
+
children: [/*#__PURE__*/_jsx(UsergroupAddOutlined, {}), " ", followerCount, " "]
|
72
|
+
}), !items.isLoginValid && /*#__PURE__*/_jsx("small", {
|
73
|
+
className: "notLoginValid",
|
74
|
+
children: /*#__PURE__*/_jsx(Tag, {
|
75
|
+
color: "red",
|
76
|
+
children: "\u672A\u767B\u5F55"
|
77
|
+
})
|
78
|
+
})]
|
79
|
+
}),
|
80
|
+
disabled: !items.isLoginValid,
|
81
|
+
value: "account-".concat(items.id),
|
82
|
+
key: "account-".concat(items.id)
|
83
|
+
});
|
84
|
+
});
|
85
|
+
var treeData = [{
|
86
|
+
key: 'all',
|
87
|
+
value: 'all',
|
88
|
+
title: /*#__PURE__*/_jsx(Tag, {
|
89
|
+
color: "blue",
|
90
|
+
children: "\u5168\u90E8"
|
91
|
+
}),
|
92
|
+
children: Object.values(dict)
|
93
|
+
}];
|
94
|
+
setTreeVideoAccountData(treeData);
|
95
|
+
}
|
96
|
+
}),
|
97
|
+
runAccountList = _useRequest.run,
|
98
|
+
loadingAccountList = _useRequest.loading,
|
99
|
+
errorAccountList = _useRequest.error;
|
100
|
+
var onAccountList = /*#__PURE__*/function () {
|
101
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
102
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
103
|
+
while (1) switch (_context.prev = _context.next) {
|
104
|
+
case 0:
|
105
|
+
if (!loadingAccountList) {
|
106
|
+
_context.next = 2;
|
107
|
+
break;
|
108
|
+
}
|
109
|
+
return _context.abrupt("return");
|
110
|
+
case 2:
|
111
|
+
_context.next = 4;
|
112
|
+
return runAccountList().catch(function (err) {});
|
113
|
+
case 4:
|
114
|
+
Tool.toast('账户列表已刷新');
|
115
|
+
case 5:
|
116
|
+
case "end":
|
117
|
+
return _context.stop();
|
118
|
+
}
|
119
|
+
}, _callee);
|
120
|
+
}));
|
121
|
+
return function onAccountList() {
|
122
|
+
return _ref2.apply(this, arguments);
|
123
|
+
};
|
124
|
+
}();
|
125
|
+
return /*#__PURE__*/_jsxs(PageContentWarp, {
|
126
|
+
loading: loadingAccountList,
|
127
|
+
error: errorAccountList,
|
128
|
+
onReload: runAccountList,
|
129
|
+
className: "videoPublishCreateTaskBase",
|
130
|
+
children: [/*#__PURE__*/_jsx(Divider, {
|
131
|
+
orientation: "left",
|
132
|
+
children: "\u9009\u62E9\u8D26\u6237"
|
133
|
+
}), /*#__PURE__*/_jsxs("div", {
|
134
|
+
className: "accountListWarp",
|
135
|
+
children: [/*#__PURE__*/_jsx(Form.Item, {
|
136
|
+
label: "\u8D26\u53F7",
|
137
|
+
extra: "\u6BCF\u4E2A\u89C6\u9891\u53EA\u53D1\u4E00\u4E2A\u8D26\u6237",
|
138
|
+
name: "accountList",
|
139
|
+
className: "accountList",
|
140
|
+
rules: [{
|
141
|
+
required: true,
|
142
|
+
message: '请选择账户'
|
143
|
+
}],
|
144
|
+
children: /*#__PURE__*/_jsx(TreeSelect, {
|
145
|
+
disabled: loadingAccountList,
|
146
|
+
treeData: treeVideoAccountData
|
147
|
+
// value={ [] }
|
148
|
+
,
|
149
|
+
onChange: function onChange(idList) {
|
150
|
+
console.log('TreeSelect:', idList);
|
151
|
+
},
|
152
|
+
treeCheckable: !loadingAccountList,
|
153
|
+
showCheckedStrategy: TreeSelect.SHOW_PARENT,
|
154
|
+
placeholder: "\u8BF7\u9009\u62E9 \u8D26\u6237/\u7EC4"
|
155
|
+
})
|
156
|
+
}), /*#__PURE__*/_jsx("a", {
|
157
|
+
className: "renew ".concat(loadingAccountList ? 'disabled' : ''),
|
158
|
+
onClick: function onClick() {
|
159
|
+
return onAccountList();
|
160
|
+
},
|
161
|
+
children: /*#__PURE__*/_jsx(Tooltip, {
|
162
|
+
title: "\u5237\u65B0\u8D26\u6237\u5217\u8868",
|
163
|
+
children: /*#__PURE__*/_jsx(RedoOutlined, {})
|
164
|
+
})
|
165
|
+
})]
|
166
|
+
}), /*#__PURE__*/_jsxs(Divider, {
|
167
|
+
orientation: "left",
|
168
|
+
children: [/*#__PURE__*/_jsx(VideoCameraOutlined, {
|
169
|
+
className: "normalVideo"
|
170
|
+
}), " \u666E\u901A\u89C6\u9891"]
|
171
|
+
}), /*#__PURE__*/_jsx(Form.Item, {
|
172
|
+
label: "\u53D1\u5E03\u9891\u7387",
|
173
|
+
name: "normalVideoRate",
|
174
|
+
children: /*#__PURE__*/_jsx(InputNumber, {
|
175
|
+
precision: 0,
|
176
|
+
min: 0,
|
177
|
+
max: 100,
|
178
|
+
addonBefore: /*#__PURE__*/_jsxs(Select, {
|
179
|
+
className: "rateSelect",
|
180
|
+
value: createBaseData.normalVideoRateType,
|
181
|
+
onChange: function onChange(e) {
|
182
|
+
createBaseData.normalVideoRateType = e;
|
183
|
+
onCreateBaseData(_objectSpread({}, createBaseData));
|
184
|
+
},
|
185
|
+
children: [/*#__PURE__*/_jsx(Select.Option, {
|
186
|
+
value: "hour",
|
187
|
+
children: "\u6BCF\u5C0F\u65F6\u53D1\u5E03"
|
188
|
+
}), /*#__PURE__*/_jsx(Select.Option, {
|
189
|
+
value: "day",
|
190
|
+
children: "\u6BCF\u5929\u53D1\u5E03"
|
191
|
+
})]
|
192
|
+
}),
|
193
|
+
addonAfter: "\u6761\u89C6\u9891"
|
194
|
+
})
|
195
|
+
}), createBaseData.normalVideoRateType === 'hour' && /*#__PURE__*/_jsx(Form.Item, {
|
196
|
+
label: "\u6570\u91CF\u9650\u5236",
|
197
|
+
name: "normalDayMaxCount",
|
198
|
+
children: /*#__PURE__*/_jsx(InputNumber, {
|
199
|
+
precision: 0,
|
200
|
+
min: 1,
|
201
|
+
max: 500,
|
202
|
+
addonBefore: "\u6BCF\u5929\u6700\u591A\u53D1\u5E03",
|
203
|
+
addonAfter: "\u6761\u89C6\u9891"
|
204
|
+
})
|
205
|
+
}), /*#__PURE__*/_jsx(Form.Item, {
|
206
|
+
label: "\u9891\u7387\u65B9\u5F0F",
|
207
|
+
name: "normalVideoKindRateType",
|
208
|
+
children: /*#__PURE__*/_jsxs(Radio.Group, {
|
209
|
+
children: [/*#__PURE__*/_jsx(Radio, {
|
210
|
+
value: "",
|
211
|
+
children: "\u65F6\u95F4\u5E73\u5747\u4E00\u4F1A\u53D1\u4E00\u4E2A"
|
212
|
+
}), /*#__PURE__*/_jsx(Radio, {
|
213
|
+
value: "now",
|
214
|
+
children: "\u4E00\u6B21\u6027\u5168\u53D1\u5E03"
|
215
|
+
})]
|
216
|
+
})
|
217
|
+
}), /*#__PURE__*/_jsxs(Divider, {
|
218
|
+
orientation: "left",
|
219
|
+
children: [/*#__PURE__*/_jsx(ShoppingOutlined, {
|
220
|
+
className: "shoppingCart"
|
221
|
+
}), " \u5E26\u8D27\u89C6\u9891"]
|
222
|
+
}), /*#__PURE__*/_jsx(Form.Item, {
|
223
|
+
label: "\u53D1\u5E03\u9891\u7387",
|
224
|
+
name: "salesVideoRate",
|
225
|
+
children: /*#__PURE__*/_jsx(InputNumber, {
|
226
|
+
precision: 0,
|
227
|
+
min: 1,
|
228
|
+
max: 200,
|
229
|
+
addonBefore: /*#__PURE__*/_jsxs(Select, {
|
230
|
+
className: "rateSelect",
|
231
|
+
value: createBaseData.salesVideoRateType,
|
232
|
+
onChange: function onChange(e) {
|
233
|
+
createBaseData.salesVideoRateType = e;
|
234
|
+
onCreateBaseData(_objectSpread({}, createBaseData));
|
235
|
+
},
|
236
|
+
children: [/*#__PURE__*/_jsx(Select.Option, {
|
237
|
+
value: "hour",
|
238
|
+
children: "\u6BCF\u5C0F\u65F6\u53D1\u5E03"
|
239
|
+
}), /*#__PURE__*/_jsx(Select.Option, {
|
240
|
+
value: "day",
|
241
|
+
children: "\u6BCF\u5929\u53D1\u5E03"
|
242
|
+
})]
|
243
|
+
}),
|
244
|
+
addonAfter: "\u6761\u89C6\u9891"
|
245
|
+
})
|
246
|
+
}), createBaseData.salesVideoRateType === 'hour' && /*#__PURE__*/_jsx(Form.Item, {
|
247
|
+
label: "\u6570\u91CF\u9650\u5236",
|
248
|
+
name: "salesDayMaxCount",
|
249
|
+
children: /*#__PURE__*/_jsx(InputNumber, {
|
250
|
+
precision: 0,
|
251
|
+
min: 1,
|
252
|
+
max: 200,
|
253
|
+
addonBefore: "\u6BCF\u5929\u6700\u591A\u53D1\u5E03",
|
254
|
+
addonAfter: "\u6761\u89C6\u9891"
|
255
|
+
})
|
256
|
+
}), /*#__PURE__*/_jsx(Form.Item, {
|
257
|
+
label: "\u9891\u7387\u65B9\u5F0F",
|
258
|
+
name: "salesVideoKindRateType",
|
259
|
+
children: /*#__PURE__*/_jsxs(Radio.Group, {
|
260
|
+
children: [/*#__PURE__*/_jsx(Radio, {
|
261
|
+
value: "",
|
262
|
+
children: "\u65F6\u95F4\u5E73\u5747\u4E00\u4F1A\u53D1\u4E00\u4E2A"
|
263
|
+
}), /*#__PURE__*/_jsx(Radio, {
|
264
|
+
value: "now",
|
265
|
+
children: "\u4E00\u6B21\u6027\u5168\u53D1\u5E03"
|
266
|
+
})]
|
267
|
+
})
|
268
|
+
}), /*#__PURE__*/_jsx(Divider, {
|
269
|
+
orientation: "left",
|
270
|
+
children: "\u54EA\u4E9B\u5C0F\u65F6\u533A\u95F4\u53EF\u53D1"
|
271
|
+
}), /*#__PURE__*/_jsx(Form.Item, {
|
272
|
+
label: "\u65F6\u95F4\u6BB5",
|
273
|
+
children: /*#__PURE__*/_jsx(VideoPublishCreateTaskHourEnabled, {
|
274
|
+
disabled: true,
|
275
|
+
hourEnabled: createBaseData.hourEnabled,
|
276
|
+
onHourEnabled: function onHourEnabled(hourEnabled) {
|
277
|
+
createBaseData.hourEnabled = hourEnabled;
|
278
|
+
onCreateBaseData(_objectSpread({}, createBaseData));
|
279
|
+
}
|
280
|
+
})
|
281
|
+
}), /*#__PURE__*/_jsx(Divider, {
|
282
|
+
orientation: "left",
|
283
|
+
children: "\u5176\u4ED6\u8BBE\u7F6E"
|
284
|
+
}), /*#__PURE__*/_jsx(Form.Item, {
|
285
|
+
label: "\u5F00\u59CB\u65F6\u95F4",
|
286
|
+
name: "startTime",
|
287
|
+
children: /*#__PURE__*/_jsx(DatePicker, {
|
288
|
+
showTime: true,
|
289
|
+
disabledDate: function disabledDate(e) {
|
290
|
+
return e.valueOf() + 86400e3 < Date.now() || e.valueOf() > Date.now() + 86400e3 * 14;
|
291
|
+
},
|
292
|
+
onChange: function onChange(value, dateString) {
|
293
|
+
console.log('Selected Time: ', value);
|
294
|
+
console.log('Formatted Selected Time: ', dateString);
|
295
|
+
}
|
296
|
+
// onOk={onOk}
|
297
|
+
})
|
298
|
+
}), /*#__PURE__*/_jsx(Form.Item, {
|
299
|
+
label: "\u53D1\u5E03\u5B8C\u6210\u540E",
|
300
|
+
children: /*#__PURE__*/_jsx(ConfigProvider, {
|
301
|
+
theme: {
|
302
|
+
token: {
|
303
|
+
colorPrimary: '#F60',
|
304
|
+
colorTextQuaternary: '#1677ff'
|
305
|
+
}
|
306
|
+
},
|
307
|
+
children: /*#__PURE__*/_jsx(Switch, {
|
308
|
+
unCheckedChildren: "\u4FDD\u7559\u89C6\u9891",
|
309
|
+
checkedChildren: "\u5220\u9664\u89C6\u9891"
|
310
|
+
})
|
311
|
+
})
|
312
|
+
})]
|
313
|
+
});
|
314
|
+
};
|
315
|
+
export default VideoPublishCreateTaskBase;
|
@@ -0,0 +1,64 @@
|
|
1
|
+
.videoPublishCreateTaskBase {
|
2
|
+
padding: 0 12px 0 0;
|
3
|
+
display: flex;
|
4
|
+
flex-direction: column;
|
5
|
+
height: 100%;
|
6
|
+
|
7
|
+
.groupIcon {
|
8
|
+
color: blue;
|
9
|
+
}
|
10
|
+
|
11
|
+
.rateSelect {
|
12
|
+
width: 120px;
|
13
|
+
}
|
14
|
+
|
15
|
+
.normalVideo {
|
16
|
+
color: blue;
|
17
|
+
}
|
18
|
+
|
19
|
+
.shoppingCart {
|
20
|
+
color: #F60;
|
21
|
+
}
|
22
|
+
|
23
|
+
.selectFile {
|
24
|
+
padding: 12px 0 0;
|
25
|
+
}
|
26
|
+
|
27
|
+
.submits {
|
28
|
+
text-align: right;
|
29
|
+
padding: 0 0 36px 0;
|
30
|
+
}
|
31
|
+
|
32
|
+
.accountListWarp {
|
33
|
+
display: flex;
|
34
|
+
flex-direction: row;
|
35
|
+
|
36
|
+
.accountList {
|
37
|
+
flex: 2;
|
38
|
+
margin-left: 5px;
|
39
|
+
}
|
40
|
+
|
41
|
+
.renew {
|
42
|
+
font-size: 20px;
|
43
|
+
padding: 0 12px;
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
.followerCount{
|
49
|
+
background-color: #F2F2F2;
|
50
|
+
border-radius: 3px;
|
51
|
+
font-size: smaller;
|
52
|
+
line-height: 1em;
|
53
|
+
margin-left: 3px;
|
54
|
+
padding: 2px 3px;
|
55
|
+
|
56
|
+
}
|
57
|
+
|
58
|
+
.notLoginValid {
|
59
|
+
margin-left: 5px;
|
60
|
+
}
|
61
|
+
.nicknameRemark {
|
62
|
+
color: #999;
|
63
|
+
padding: 0 3px;
|
64
|
+
}
|
@@ -0,0 +1,294 @@
|
|
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 styles from "./index.css";
|
7
|
+
import { Alert, Button, ConfigProvider, Divider, Form, Radio } from "antd";
|
8
|
+
import { PlusOutlined } from "@ant-design/icons";
|
9
|
+
import PageContentWarp from "../../UI/PageContentWarp";
|
10
|
+
import isInClient from "../../lib/isInClient";
|
11
|
+
import Tool from "../../lib/Tool";
|
12
|
+
import VideoPublishTaskList from "./task-list";
|
13
|
+
import VideoPublishSelectList from "./select-list";
|
14
|
+
import { useRequest } from "@umijs/hooks";
|
15
|
+
import * as VideoPublishController from "../../service/api/VideoPublishController";
|
16
|
+
import fileSelect from "../../base/fileSelect";
|
17
|
+
import VideoPublishCreateTaskBase from "./base";
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
19
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
20
|
+
var VideoPublishCreateTask = function VideoPublishCreateTask(_ref) {
|
21
|
+
var disabled = _ref.disabled,
|
22
|
+
productType = _ref.productType,
|
23
|
+
apiUrl = _ref.apiUrl,
|
24
|
+
env = _ref.env;
|
25
|
+
var _useState = useState({
|
26
|
+
videoFrom: productType ? 'task' : 'local',
|
27
|
+
taskFromProductType: productType,
|
28
|
+
accountList: [],
|
29
|
+
normalVideoRate: 1,
|
30
|
+
normalVideoRateType: 'hour',
|
31
|
+
normalDayMaxCount: 1,
|
32
|
+
normalVideoKindRateType: '',
|
33
|
+
startTime: null,
|
34
|
+
salesVideoRate: 2,
|
35
|
+
salesVideoRateType: 'hour',
|
36
|
+
salesDayMaxCount: 2,
|
37
|
+
salesVideoKindRateType: '',
|
38
|
+
hourEnabled: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23],
|
39
|
+
videoList: []
|
40
|
+
}),
|
41
|
+
_useState2 = _slicedToArray(_useState, 2),
|
42
|
+
formData = _useState2[0],
|
43
|
+
setFormData = _useState2[1];
|
44
|
+
var _useState3 = useState(false),
|
45
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
46
|
+
loadingSelectLocal = _useState4[0],
|
47
|
+
setLoadingSelectLocal = _useState4[1];
|
48
|
+
var _useState5 = useState([]),
|
49
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
50
|
+
localSelectList = _useState6[0],
|
51
|
+
setLocalSelectList = _useState6[1];
|
52
|
+
var _useState7 = useState([]),
|
53
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
54
|
+
taskSelectList = _useState8[0],
|
55
|
+
setTaskSelectList = _useState8[1];
|
56
|
+
var _useRequest = useRequest(function (data) {
|
57
|
+
return VideoPublishController.taskCreate(data, {
|
58
|
+
env: env
|
59
|
+
});
|
60
|
+
}, {
|
61
|
+
manual: true,
|
62
|
+
onSuccess: function onSuccess(result) {
|
63
|
+
// 清除
|
64
|
+
setLocalSelectList([]);
|
65
|
+
setTaskSelectList([]);
|
66
|
+
Tool.toast('任务提交成功');
|
67
|
+
}
|
68
|
+
}),
|
69
|
+
runTask = _useRequest.run,
|
70
|
+
loadingTask = _useRequest.loading,
|
71
|
+
errorTask = _useRequest.error;
|
72
|
+
var onTaskList = function onTaskList() {
|
73
|
+
var dialog = Tool.drawer({
|
74
|
+
title: '任务列表',
|
75
|
+
content: /*#__PURE__*/_jsx(VideoPublishTaskList, {
|
76
|
+
defaultSelectList: [],
|
77
|
+
apiUrl: apiUrl,
|
78
|
+
productType: productType,
|
79
|
+
onFinish: function onFinish(list) {
|
80
|
+
setTaskSelectList(list);
|
81
|
+
dialog.destroy();
|
82
|
+
}
|
83
|
+
}),
|
84
|
+
width: 980
|
85
|
+
});
|
86
|
+
};
|
87
|
+
var onLocalList = /*#__PURE__*/function () {
|
88
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
89
|
+
var result, fileList, localSelectList;
|
90
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
91
|
+
while (1) switch (_context.prev = _context.next) {
|
92
|
+
case 0:
|
93
|
+
setLoadingSelectLocal(true);
|
94
|
+
_context.next = 3;
|
95
|
+
return fileSelect('video').catch(function (err) {});
|
96
|
+
case 3:
|
97
|
+
result = _context.sent;
|
98
|
+
if (!(!result || (result === null || result === void 0 ? void 0 : result.filePaths.length) <= 0)) {
|
99
|
+
_context.next = 7;
|
100
|
+
break;
|
101
|
+
}
|
102
|
+
setLoadingSelectLocal(false);
|
103
|
+
return _context.abrupt("return");
|
104
|
+
case 7:
|
105
|
+
fileList = result === null || result === void 0 ? void 0 : result.filePaths;
|
106
|
+
console.log('list:', fileList);
|
107
|
+
localSelectList = [];
|
108
|
+
fileList.forEach(function (filePath) {
|
109
|
+
localSelectList.push({
|
110
|
+
id: 0,
|
111
|
+
title: Tool.getTitleByPath(filePath),
|
112
|
+
// goodsUrl: '',
|
113
|
+
videoSize: 0,
|
114
|
+
videoDuration: 0,
|
115
|
+
videoFinishUrl: filePath,
|
116
|
+
introduction: '',
|
117
|
+
videoKindTag: '',
|
118
|
+
// shopping | location | minapp
|
119
|
+
kindTagValue: '',
|
120
|
+
goodsTitle: ''
|
121
|
+
});
|
122
|
+
});
|
123
|
+
setLocalSelectList(localSelectList);
|
124
|
+
setLoadingSelectLocal(false);
|
125
|
+
case 13:
|
126
|
+
case "end":
|
127
|
+
return _context.stop();
|
128
|
+
}
|
129
|
+
}, _callee);
|
130
|
+
}));
|
131
|
+
return function onLocalList() {
|
132
|
+
return _ref2.apply(this, arguments);
|
133
|
+
};
|
134
|
+
}();
|
135
|
+
var onFinish = function onFinish(values) {
|
136
|
+
var _values$startTime;
|
137
|
+
var videoList = [];
|
138
|
+
if (formData.videoFrom === 'local') {
|
139
|
+
localSelectList.forEach(function (item) {
|
140
|
+
videoList.push({
|
141
|
+
taskId: 0,
|
142
|
+
productType: productType,
|
143
|
+
title: item.title,
|
144
|
+
// goodsUrl: item.goodsUrl,
|
145
|
+
videoUrl: item.videoFinishUrl,
|
146
|
+
introduction: item.introduction,
|
147
|
+
videoKindTag: item.videoKindTag,
|
148
|
+
// shopping | location | minapp
|
149
|
+
kindTagValue: item.kindTagValue,
|
150
|
+
goodsTitle: item.goodsTitle
|
151
|
+
});
|
152
|
+
});
|
153
|
+
} else {
|
154
|
+
taskSelectList.forEach(function (item) {
|
155
|
+
videoList.push({
|
156
|
+
taskId: item.id,
|
157
|
+
productType: productType,
|
158
|
+
title: item.title,
|
159
|
+
// goodsUrl: item.goodsUrl,
|
160
|
+
videoUrl: item.videoFinishUrl,
|
161
|
+
introduction: item.introduction,
|
162
|
+
videoKindTag: item.videoKindTag,
|
163
|
+
// shopping | location | minapp
|
164
|
+
kindTagValue: item.kindTagValue,
|
165
|
+
goodsTitle: item.goodsTitle
|
166
|
+
});
|
167
|
+
});
|
168
|
+
}
|
169
|
+
var data = _objectSpread(_objectSpread(_objectSpread({}, formData), values), {}, {
|
170
|
+
startTime: values.startTime ? parseInt((((_values$startTime = values.startTime) === null || _values$startTime === void 0 ? void 0 : _values$startTime.valueOf()) * 0.001).toFixed(0)) : 0,
|
171
|
+
videoList: videoList
|
172
|
+
});
|
173
|
+
if (videoList.length === 0) {
|
174
|
+
Tool.toastError('视频为空,请选择视频');
|
175
|
+
return;
|
176
|
+
}
|
177
|
+
console.log('values:', data);
|
178
|
+
runTask(data);
|
179
|
+
};
|
180
|
+
var formLabelSpan = 2;
|
181
|
+
return /*#__PURE__*/_jsx(styles.videoPublishCreateTask, {
|
182
|
+
children: /*#__PURE__*/_jsxs(PageContentWarp
|
183
|
+
// loading={loading}
|
184
|
+
// error={errorAccountList}
|
185
|
+
// onReload={runAccountList}
|
186
|
+
, {
|
187
|
+
children: [disabled && /*#__PURE__*/_jsx(Alert, {
|
188
|
+
message: "\u529F\u80FD\u5347\u7EA7\u4E2D\uFF0C\u5373\u5C06\u5F00\u653E\uFF0C\u656C\u8BF7\u671F\u5F85",
|
189
|
+
type: "warning",
|
190
|
+
showIcon: true,
|
191
|
+
style: {
|
192
|
+
width: 320
|
193
|
+
}
|
194
|
+
}), /*#__PURE__*/_jsxs(Form, {
|
195
|
+
labelCol: {
|
196
|
+
span: formLabelSpan
|
197
|
+
},
|
198
|
+
initialValues: _objectSpread({}, formData),
|
199
|
+
disabled: disabled || loadingTask,
|
200
|
+
scrollToFirstError: true,
|
201
|
+
onFinish: onFinish,
|
202
|
+
children: [/*#__PURE__*/_jsx(Divider, {
|
203
|
+
orientation: "left",
|
204
|
+
children: "\u9009\u62E9\u89C6\u9891"
|
205
|
+
}), /*#__PURE__*/_jsx(Form.Item, {
|
206
|
+
label: "\u89C6\u9891\u6765\u6E90",
|
207
|
+
name: "videoFrom",
|
208
|
+
children: /*#__PURE__*/_jsxs(Radio.Group, {
|
209
|
+
onChange: function onChange(e) {
|
210
|
+
formData.videoFrom = e.target.value;
|
211
|
+
setFormData(_objectSpread({}, formData));
|
212
|
+
},
|
213
|
+
children: [/*#__PURE__*/_jsx(Radio, {
|
214
|
+
value: "local",
|
215
|
+
disabled: !isInClient(),
|
216
|
+
children: "\u672C\u5730\u7535\u8111\u89C6\u9891"
|
217
|
+
}), productType && /*#__PURE__*/_jsx(Radio, {
|
218
|
+
value: "task",
|
219
|
+
children: "\u4EFB\u52A1\u89C6\u9891"
|
220
|
+
})]
|
221
|
+
})
|
222
|
+
}), formData.videoFrom == 'local' && /*#__PURE__*/_jsxs(Form.Item, {
|
223
|
+
wrapperCol: {
|
224
|
+
offset: formLabelSpan
|
225
|
+
},
|
226
|
+
children: [/*#__PURE__*/_jsx(VideoPublishSelectList, {
|
227
|
+
from: "local",
|
228
|
+
list: localSelectList,
|
229
|
+
onList: function onList() {}
|
230
|
+
}), /*#__PURE__*/_jsx("div", {
|
231
|
+
className: "selectFile",
|
232
|
+
children: /*#__PURE__*/_jsx(ConfigProvider, {
|
233
|
+
theme: {
|
234
|
+
components: {
|
235
|
+
Button: {
|
236
|
+
colorPrimary: '#2b59a1'
|
237
|
+
}
|
238
|
+
}
|
239
|
+
},
|
240
|
+
children: /*#__PURE__*/_jsx(Button, {
|
241
|
+
type: "primary",
|
242
|
+
size: "small",
|
243
|
+
loading: loadingSelectLocal,
|
244
|
+
icon: /*#__PURE__*/_jsx(PlusOutlined, {}),
|
245
|
+
onClick: function onClick() {
|
246
|
+
return onLocalList();
|
247
|
+
},
|
248
|
+
children: "\u9009\u62E9\u672C\u5730\u89C6\u9891"
|
249
|
+
})
|
250
|
+
})
|
251
|
+
})]
|
252
|
+
}), formData.videoFrom == 'task' && /*#__PURE__*/_jsxs(Form.Item, {
|
253
|
+
wrapperCol: {
|
254
|
+
offset: formLabelSpan
|
255
|
+
},
|
256
|
+
children: [/*#__PURE__*/_jsx(VideoPublishSelectList, {
|
257
|
+
from: "task",
|
258
|
+
list: taskSelectList,
|
259
|
+
onList: function onList(list) {
|
260
|
+
return setTaskSelectList(list);
|
261
|
+
}
|
262
|
+
}), /*#__PURE__*/_jsx("div", {
|
263
|
+
className: "selectFile",
|
264
|
+
children: /*#__PURE__*/_jsx(Button, {
|
265
|
+
type: "primary",
|
266
|
+
size: "small",
|
267
|
+
icon: /*#__PURE__*/_jsx(PlusOutlined, {}),
|
268
|
+
onClick: function onClick() {
|
269
|
+
return onTaskList();
|
270
|
+
},
|
271
|
+
children: "\u9009\u62E9\u4EFB\u52A1"
|
272
|
+
})
|
273
|
+
})]
|
274
|
+
}), /*#__PURE__*/_jsx(VideoPublishCreateTaskBase, {
|
275
|
+
disabled: disabled,
|
276
|
+
createBaseData: formData,
|
277
|
+
onCreateBaseData: function onCreateBaseData(createBase) {
|
278
|
+
setFormData(_objectSpread(_objectSpread({}, formData), createBase));
|
279
|
+
},
|
280
|
+
env: env
|
281
|
+
}), /*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsx("div", {
|
282
|
+
className: "submits",
|
283
|
+
children: /*#__PURE__*/_jsx(Button, {
|
284
|
+
type: "primary",
|
285
|
+
htmlType: "submit",
|
286
|
+
loading: loadingTask,
|
287
|
+
children: "\u63D0\u4EA4"
|
288
|
+
})
|
289
|
+
})]
|
290
|
+
})]
|
291
|
+
})
|
292
|
+
});
|
293
|
+
};
|
294
|
+
export default VideoPublishCreateTask;
|
@@ -2,7 +2,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import React, { useEffect, useState } from "react";
|
3
3
|
import "./index.less";
|
4
4
|
import { Menu, Tabs } from "antd";
|
5
|
-
import VideoPublishCreateTask from "./
|
5
|
+
import VideoPublishCreateTask from "./create-task";
|
6
6
|
import isInClient from "../lib/isInClient";
|
7
7
|
import { ClockCircleOutlined, UsergroupAddOutlined, VideoCameraAddOutlined } from "@ant-design/icons";
|
8
8
|
import VideoPublishVideoAccount from "./video-account";
|