antd-management-fast-framework 1.11.39 → 1.11.41
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/es/configGroup/configGeneral.d.ts +7 -0
- package/es/configGroup/configGeneral.js +83 -1
- package/es/customComponents/AnimalBox/FadeBox/index.less +6 -6
- package/es/customComponents/AudioUpload/index.d.ts +30 -0
- package/es/customComponents/AudioUpload/index.js +488 -0
- package/es/customComponents/EllipsisCustom/index.less +1 -1
- package/es/customComponents/FunctionComponent/index.js +0 -1
- package/es/customComponents/ImageBox/index.less +4 -4
- package/es/customComponents/ImageUpload/index.less +2 -2
- package/es/customComponents/MobileContainor/Devices/GalaxyNote8/index.d.ts +6 -0
- package/es/customComponents/MobileContainor/Devices/GalaxyNote8/index.js +89 -0
- package/es/customComponents/MobileContainor/Devices/IPhone5S/index.d.ts +11 -0
- package/es/customComponents/MobileContainor/Devices/IPhone5S/index.js +95 -0
- package/es/customComponents/MobileContainor/Devices/Iphone8/index.d.ts +11 -0
- package/es/customComponents/MobileContainor/Devices/Iphone8/index.js +95 -0
- package/es/customComponents/MobileContainor/Devices/Iphone8plus/index.d.ts +11 -0
- package/es/customComponents/MobileContainor/Devices/Iphone8plus/index.js +95 -0
- package/es/customComponents/MobileContainor/Devices/IphoneX/index.d.ts +6 -0
- package/es/customComponents/MobileContainor/Devices/IphoneX/index.js +97 -0
- package/es/customComponents/MobileContainor/Devices/devices.less +2815 -0
- package/es/customComponents/MobileContainor/MobilePreviewDrawer/index.d.ts +9 -0
- package/es/customComponents/MobileContainor/MobilePreviewDrawer/index.js +209 -0
- package/es/customComponents/MobileContainor/{index.d.ts → RoughSketch/index.d.ts} +0 -0
- package/es/customComponents/MobileContainor/{index.js → RoughSketch/index.js} +1 -11
- package/es/customComponents/MobileContainor/RoughSketch/index.less +58 -0
- package/es/customComponents/NoticeIconCustom/NoticeList.less +1 -1
- package/es/customComponents/VideoUpload/index.js +1 -1
- package/es/framework/Common/index.d.ts +1 -0
- package/es/framework/Common/index.js +43 -1
- package/es/framework/CustomWrapper/SupplementCore/index.js +17 -0
- package/es/framework/DataDrawer/Base/index.d.ts +5 -0
- package/es/framework/DataDrawer/Base/index.js +142 -11
- package/es/framework/DataListView/Base/index.js +5 -1
- package/es/framework/DataModal/Base/index.js +0 -2
- package/es/framework/DataModal/BaseUpdateTransferModal/index.js +0 -2
- package/es/utils/constants.d.ts +122 -38
- package/es/utils/constants.js +138 -4
- package/es/utils/defaultSettingsSpecial.d.ts +1 -0
- package/es/utils/defaultSettingsSpecial.js +10 -0
- package/es/utils/mediaDefault.d.ts +2 -0
- package/es/utils/mediaDefault.js +10 -0
- package/es/utils/tools.d.ts +1 -0
- package/package.json +13 -13
- package/es/customComponents/MobileContainor/index.less +0 -60
|
@@ -3,9 +3,34 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.buildConfig = buildConfig;
|
|
6
7
|
exports.configGeneral = void 0;
|
|
7
8
|
exports.empty = empty;
|
|
9
|
+
|
|
10
|
+
var _umi = require("umi");
|
|
11
|
+
|
|
12
|
+
var _webpackPlugin = require("./webpackPlugin");
|
|
13
|
+
|
|
14
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
15
|
+
|
|
16
|
+
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."); }
|
|
17
|
+
|
|
18
|
+
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); }
|
|
19
|
+
|
|
20
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
21
|
+
|
|
22
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
27
|
+
|
|
28
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
29
|
+
|
|
30
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
31
|
+
|
|
8
32
|
var REACT_APP_ENV = process.env.REACT_APP_ENV;
|
|
33
|
+
var winPath = _umi.utils.winPath;
|
|
9
34
|
var configGeneral = {
|
|
10
35
|
hash: true,
|
|
11
36
|
alias: {},
|
|
@@ -47,6 +72,64 @@ var configGeneral = {
|
|
|
47
72
|
babelCompact: false
|
|
48
73
|
}
|
|
49
74
|
};
|
|
75
|
+
exports.configGeneral = configGeneral;
|
|
76
|
+
|
|
77
|
+
function buildConfig(_ref) {
|
|
78
|
+
var routes = _ref.routes,
|
|
79
|
+
_ref$loading = _ref.loading,
|
|
80
|
+
loading = _ref$loading === void 0 ? '@/components/PageLoading/index' : _ref$loading,
|
|
81
|
+
_ref$headerExtraLinks = _ref.headerExtraLinks,
|
|
82
|
+
headerExtraLinks = _ref$headerExtraLinks === void 0 ? [] : _ref$headerExtraLinks,
|
|
83
|
+
_ref$mfsu = _ref.mfsu,
|
|
84
|
+
mfsu = _ref$mfsu === void 0 ? true : _ref$mfsu,
|
|
85
|
+
_ref$proxy = _ref.proxy,
|
|
86
|
+
proxy = _ref$proxy === void 0 ? null : _ref$proxy;
|
|
87
|
+
|
|
88
|
+
var c = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, configGeneral), {
|
|
89
|
+
dynamicImport: {
|
|
90
|
+
loading: loading
|
|
91
|
+
},
|
|
92
|
+
routes: routes,
|
|
93
|
+
cssLoader: {
|
|
94
|
+
modules: {
|
|
95
|
+
getLocalIdent: function getLocalIdent(context, _, localName) {
|
|
96
|
+
if (context.resourcePath.includes('node_modules') || context.resourcePath.includes('ant.design.pro.less') || context.resourcePath.includes('global.less')) {
|
|
97
|
+
return localName;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
var match = context.resourcePath.match(/src(.*)/);
|
|
101
|
+
|
|
102
|
+
if (match && match[1]) {
|
|
103
|
+
var antdProPath = match[1].replace('.less', '');
|
|
104
|
+
var arr = winPath(antdProPath).split('/').map(function (a) {
|
|
105
|
+
return a.replace(/([A-Z])/g, '-$1');
|
|
106
|
+
}).map(function (a) {
|
|
107
|
+
return a.toLowerCase();
|
|
108
|
+
});
|
|
109
|
+
return "antd-pro".concat(arr.join('-'), "-").concat(localName).replace(/--/g, '-');
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return localName;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}), {
|
|
117
|
+
chainWebpack: _webpackPlugin.webpackPlugin5
|
|
118
|
+
}), (proxy || null) == null ? {} : {
|
|
119
|
+
proxy: proxy
|
|
120
|
+
}), mfsu ? {
|
|
121
|
+
mfsu: {}
|
|
122
|
+
} : {
|
|
123
|
+
mfsu: false
|
|
124
|
+
}), {
|
|
125
|
+
extraCustomOption: {
|
|
126
|
+
headerExtraLinks: _toConsumableArray(headerExtraLinks),
|
|
127
|
+
babelCompact: false
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
return (0, _umi.defineConfig)(c);
|
|
132
|
+
}
|
|
50
133
|
/**
|
|
51
134
|
* 占位函数
|
|
52
135
|
*
|
|
@@ -54,7 +137,6 @@ var configGeneral = {
|
|
|
54
137
|
* @returns
|
|
55
138
|
*/
|
|
56
139
|
|
|
57
|
-
exports.configGeneral = configGeneral;
|
|
58
140
|
|
|
59
141
|
function empty() {
|
|
60
142
|
return {};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
.fadeBox {
|
|
4
4
|
.fade-enter {
|
|
5
|
-
opacity: 0
|
|
5
|
+
opacity: 0;
|
|
6
6
|
animation-duration: 0.5s;
|
|
7
7
|
animation-play-state: paused;
|
|
8
8
|
animation-timing-function: cubic-bezier(0.55, 0, 0.55, 0.2);
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.fade-appear {
|
|
13
|
-
opacity: 0
|
|
13
|
+
opacity: 0;
|
|
14
14
|
animation-duration: 0.5s;
|
|
15
15
|
animation-play-state: paused;
|
|
16
16
|
animation-timing-function: cubic-bezier(0.55, 0, 0.55, 0.2);
|
|
@@ -41,21 +41,21 @@
|
|
|
41
41
|
|
|
42
42
|
@keyframes fade-in {
|
|
43
43
|
0% {
|
|
44
|
-
opacity: 0
|
|
44
|
+
opacity: 0;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
100% {
|
|
48
|
-
opacity:
|
|
48
|
+
opacity: 1;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
@keyframes fade-out {
|
|
53
53
|
0% {
|
|
54
|
-
opacity:
|
|
54
|
+
opacity: 1;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
100% {
|
|
58
|
-
opacity: 0
|
|
58
|
+
opacity: 0;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export default AudioUpload;
|
|
2
|
+
declare class AudioUpload extends React.PureComponent<any, any, any> {
|
|
3
|
+
static getDerivedStateFromProps(nextProps: any, prevState: any): {
|
|
4
|
+
audioSource: any;
|
|
5
|
+
audioUrl: any;
|
|
6
|
+
} | null;
|
|
7
|
+
constructor(props: any);
|
|
8
|
+
handleUploadCancel: () => void;
|
|
9
|
+
showPreviewModal: () => void;
|
|
10
|
+
showChangeUrlModal: () => void;
|
|
11
|
+
handleUrlChange: (e: any) => void;
|
|
12
|
+
handleChangeUrlOk: () => void;
|
|
13
|
+
handleChangeUrlCancel: () => void;
|
|
14
|
+
clearUrl: () => void;
|
|
15
|
+
beforeUpload: (file: any) => boolean;
|
|
16
|
+
handleUploadChange: (info: any) => void;
|
|
17
|
+
handleMenuClick: (e: any) => void;
|
|
18
|
+
}
|
|
19
|
+
declare namespace AudioUpload {
|
|
20
|
+
export namespace defaultProps {
|
|
21
|
+
export const action: string;
|
|
22
|
+
export const disabled: boolean;
|
|
23
|
+
export const tokenSet: {};
|
|
24
|
+
export const audio: string;
|
|
25
|
+
export const showPreview: boolean;
|
|
26
|
+
export function pretreatmentRemoteResponse(): void;
|
|
27
|
+
export function afterChangeSuccess(): void;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
import React from "react";
|
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
require("antd/es/modal/style");
|
|
11
|
+
|
|
12
|
+
var _modal = _interopRequireDefault(require("antd/es/modal"));
|
|
13
|
+
|
|
14
|
+
require("antd/es/space/style");
|
|
15
|
+
|
|
16
|
+
var _space = _interopRequireDefault(require("antd/es/space"));
|
|
17
|
+
|
|
18
|
+
require("antd/es/dropdown/style");
|
|
19
|
+
|
|
20
|
+
var _dropdown = _interopRequireDefault(require("antd/es/dropdown"));
|
|
21
|
+
|
|
22
|
+
require("antd/es/upload/style");
|
|
23
|
+
|
|
24
|
+
var _upload = _interopRequireDefault(require("antd/es/upload"));
|
|
25
|
+
|
|
26
|
+
require("antd/es/tooltip/style");
|
|
27
|
+
|
|
28
|
+
var _tooltip = _interopRequireDefault(require("antd/es/tooltip"));
|
|
29
|
+
|
|
30
|
+
require("antd/es/button/style");
|
|
31
|
+
|
|
32
|
+
var _button = _interopRequireDefault(require("antd/es/button"));
|
|
33
|
+
|
|
34
|
+
require("antd/es/divider/style");
|
|
35
|
+
|
|
36
|
+
var _divider = _interopRequireDefault(require("antd/es/divider"));
|
|
37
|
+
|
|
38
|
+
require("antd/es/menu/style");
|
|
39
|
+
|
|
40
|
+
var _menu = _interopRequireDefault(require("antd/es/menu"));
|
|
41
|
+
|
|
42
|
+
require("antd/es/input/style");
|
|
43
|
+
|
|
44
|
+
var _input = _interopRequireDefault(require("antd/es/input"));
|
|
45
|
+
|
|
46
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
47
|
+
|
|
48
|
+
var _reactPlayer = _interopRequireDefault(require("react-player"));
|
|
49
|
+
|
|
50
|
+
var _icons = require("@ant-design/icons");
|
|
51
|
+
|
|
52
|
+
var _tools = require("../../utils/tools");
|
|
53
|
+
|
|
54
|
+
var _constants = require("../../utils/constants");
|
|
55
|
+
|
|
56
|
+
var _defaultSettingsSpecial = require("../../utils/defaultSettingsSpecial");
|
|
57
|
+
|
|
58
|
+
var _IconInfo = _interopRequireDefault(require("../IconInfo"));
|
|
59
|
+
|
|
60
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
61
|
+
|
|
62
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
63
|
+
|
|
64
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
65
|
+
|
|
66
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
67
|
+
|
|
68
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
69
|
+
|
|
70
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
71
|
+
|
|
72
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
73
|
+
|
|
74
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
75
|
+
|
|
76
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
77
|
+
|
|
78
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
79
|
+
|
|
80
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
81
|
+
|
|
82
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
83
|
+
|
|
84
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
85
|
+
|
|
86
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
87
|
+
|
|
88
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
89
|
+
|
|
90
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
91
|
+
|
|
92
|
+
var TextArea = _input.default.TextArea;
|
|
93
|
+
|
|
94
|
+
var AudioUpload = /*#__PURE__*/function (_PureComponent) {
|
|
95
|
+
_inherits(AudioUpload, _PureComponent);
|
|
96
|
+
|
|
97
|
+
var _super = _createSuper(AudioUpload);
|
|
98
|
+
|
|
99
|
+
function AudioUpload(props) {
|
|
100
|
+
var _this;
|
|
101
|
+
|
|
102
|
+
_classCallCheck(this, AudioUpload);
|
|
103
|
+
|
|
104
|
+
_this = _super.call(this, props);
|
|
105
|
+
|
|
106
|
+
_this.handleUploadCancel = function () {
|
|
107
|
+
_this.setState({
|
|
108
|
+
previewVisible: false
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
_this.showPreviewModal = function () {
|
|
113
|
+
var audioUrl = _this.state.audioUrl;
|
|
114
|
+
|
|
115
|
+
if ((0, _tools.stringIsNullOrWhiteSpace)(audioUrl)) {
|
|
116
|
+
var text = '无效的音频源';
|
|
117
|
+
(0, _tools.showErrorMessage)({
|
|
118
|
+
message: text
|
|
119
|
+
});
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
_this.setState({
|
|
124
|
+
previewVisible: true
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
_this.showChangeUrlModal = function () {
|
|
129
|
+
var audioUrl = _this.state.audioUrl;
|
|
130
|
+
|
|
131
|
+
_this.setState({
|
|
132
|
+
audioUrlTemp: audioUrl,
|
|
133
|
+
changeUrlVisible: true
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
_this.handleUrlChange = function (e) {
|
|
138
|
+
var v = e.target.value;
|
|
139
|
+
|
|
140
|
+
_this.setState({
|
|
141
|
+
audioUrlTemp: v
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
_this.handleChangeUrlOk = function () {
|
|
146
|
+
var afterChangeSuccess = _this.props.afterChangeSuccess;
|
|
147
|
+
var audioUrlTemp = _this.state.audioUrlTemp;
|
|
148
|
+
|
|
149
|
+
_this.setState({
|
|
150
|
+
audioUrl: audioUrlTemp,
|
|
151
|
+
changeUrlVisible: false
|
|
152
|
+
}, function () {
|
|
153
|
+
if ((0, _tools.isFunction)(afterChangeSuccess)) {
|
|
154
|
+
afterChangeSuccess(audioUrlTemp || '');
|
|
155
|
+
} else {
|
|
156
|
+
var text = 'afterChangeSuccess 配置无效';
|
|
157
|
+
(0, _tools.showRuntimeError)({
|
|
158
|
+
message: text
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
_this.handleChangeUrlCancel = function () {
|
|
165
|
+
_this.setState({
|
|
166
|
+
changeUrlVisible: false
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
_this.clearUrl = function () {
|
|
171
|
+
var afterChangeSuccess = _this.props.afterChangeSuccess;
|
|
172
|
+
|
|
173
|
+
_this.setState({
|
|
174
|
+
audioUrl: '',
|
|
175
|
+
changeUrlVisible: false
|
|
176
|
+
}, function () {
|
|
177
|
+
if ((0, _tools.isFunction)(afterChangeSuccess)) {
|
|
178
|
+
afterChangeSuccess('');
|
|
179
|
+
} else {
|
|
180
|
+
var text = 'afterChangeSuccess 配置无效';
|
|
181
|
+
(0, _tools.showRuntimeError)({
|
|
182
|
+
message: text
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
_this.beforeUpload = function (file) {
|
|
189
|
+
var isAudio = file.type === 'audio/mpeg';
|
|
190
|
+
|
|
191
|
+
if (!isAudio) {
|
|
192
|
+
var text = '请上传音频文件(*.mp3)!';
|
|
193
|
+
(0, _tools.showErrorMessage)({
|
|
194
|
+
message: text
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
var isLt3M = file.size / 1024 / 1024 < _defaultSettingsSpecial.defaultSettingsLayoutCustom.getAudioUploadMaxSize();
|
|
199
|
+
|
|
200
|
+
if (!isLt3M) {
|
|
201
|
+
var _text = '音频文件不能超过3MB!';
|
|
202
|
+
(0, _tools.showErrorMessage)({
|
|
203
|
+
message: _text
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
return isAudio && isLt3M;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
_this.handleUploadChange = function (info) {
|
|
211
|
+
var _this$props = _this.props,
|
|
212
|
+
pretreatmentRemoteResponse = _this$props.pretreatmentRemoteResponse,
|
|
213
|
+
afterChangeSuccess = _this$props.afterChangeSuccess;
|
|
214
|
+
|
|
215
|
+
if (info.file.status === 'uploading') {
|
|
216
|
+
_this.setState({
|
|
217
|
+
uploading: true
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if (info.file.status === 'done') {
|
|
224
|
+
var response = info.file.response;
|
|
225
|
+
|
|
226
|
+
if ((0, _tools.isFunction)(pretreatmentRemoteResponse)) {
|
|
227
|
+
var data = pretreatmentRemoteResponse(response) || {
|
|
228
|
+
audio: ''
|
|
229
|
+
};
|
|
230
|
+
var audio = data.audio;
|
|
231
|
+
|
|
232
|
+
_this.setState({
|
|
233
|
+
audioUrl: audio,
|
|
234
|
+
uploading: false
|
|
235
|
+
}, function () {
|
|
236
|
+
if ((0, _tools.isFunction)(afterChangeSuccess)) {
|
|
237
|
+
afterChangeSuccess(audio || '');
|
|
238
|
+
} else {
|
|
239
|
+
var text = 'afterChangeSuccess 配置无效';
|
|
240
|
+
(0, _tools.showRuntimeError)({
|
|
241
|
+
message: text
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
} else {
|
|
246
|
+
var text = 'pretreatmentRemoteResponse 配置无效';
|
|
247
|
+
(0, _tools.showRuntimeError)({
|
|
248
|
+
message: text
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
_this.handleMenuClick = function (e) {
|
|
255
|
+
var key = e.key;
|
|
256
|
+
var audioUrl = _this.state.audioUrl;
|
|
257
|
+
|
|
258
|
+
switch (key) {
|
|
259
|
+
case 'changeUrl':
|
|
260
|
+
_this.showChangeUrlModal();
|
|
261
|
+
|
|
262
|
+
break;
|
|
263
|
+
|
|
264
|
+
case 'showPreview':
|
|
265
|
+
_this.showPreviewModal();
|
|
266
|
+
|
|
267
|
+
break;
|
|
268
|
+
|
|
269
|
+
case 'copyUrl':
|
|
270
|
+
if ((0, _tools.stringIsNullOrWhiteSpace)(audioUrl)) {
|
|
271
|
+
var text = '当前未设置音频地址';
|
|
272
|
+
(0, _tools.showErrorMessage)({
|
|
273
|
+
message: text
|
|
274
|
+
});
|
|
275
|
+
} else {
|
|
276
|
+
(0, _tools.copyToClipboard)(audioUrl);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
break;
|
|
280
|
+
|
|
281
|
+
case 'clearUrl':
|
|
282
|
+
_this.clearUrl();
|
|
283
|
+
|
|
284
|
+
break;
|
|
285
|
+
|
|
286
|
+
default:
|
|
287
|
+
break;
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
_this.state = _objectSpread(_objectSpread({}, _this.state), {
|
|
292
|
+
audioSource: '',
|
|
293
|
+
audioUrl: '',
|
|
294
|
+
audioUrlTemp: '',
|
|
295
|
+
uploading: false,
|
|
296
|
+
previewVisible: false,
|
|
297
|
+
changeUrlVisible: false
|
|
298
|
+
});
|
|
299
|
+
return _this;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
_createClass(AudioUpload, [{
|
|
303
|
+
key: "render",
|
|
304
|
+
value: function render() {
|
|
305
|
+
var _this2 = this;
|
|
306
|
+
|
|
307
|
+
var _this$props2 = this.props,
|
|
308
|
+
action = _this$props2.action,
|
|
309
|
+
disabled = _this$props2.disabled,
|
|
310
|
+
showPreview = _this$props2.showPreview,
|
|
311
|
+
tokenSet = _this$props2.tokenSet;
|
|
312
|
+
var _this$state = this.state,
|
|
313
|
+
uploading = _this$state.uploading,
|
|
314
|
+
previewVisible = _this$state.previewVisible,
|
|
315
|
+
changeUrlVisible = _this$state.changeUrlVisible,
|
|
316
|
+
audioUrlTemp = _this$state.audioUrlTemp,
|
|
317
|
+
audioUrl = _this$state.audioUrl;
|
|
318
|
+
var uploadProps = {
|
|
319
|
+
disabled: disabled,
|
|
320
|
+
action: action,
|
|
321
|
+
listType: 'text',
|
|
322
|
+
showUploadList: false,
|
|
323
|
+
beforeUpload: this.beforeUpload,
|
|
324
|
+
onChange: this.handleUploadChange,
|
|
325
|
+
headers: _objectSpread({}, tokenSet)
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
var menu = /*#__PURE__*/_react.default.createElement(_menu.default, {
|
|
329
|
+
onClick: this.handleMenuClick
|
|
330
|
+
}, /*#__PURE__*/_react.default.createElement(_menu.default.Item, {
|
|
331
|
+
key: "changeUrl"
|
|
332
|
+
}, /*#__PURE__*/_react.default.createElement(_IconInfo.default, {
|
|
333
|
+
icon: /*#__PURE__*/_react.default.createElement(_icons.SwapOutlined, null),
|
|
334
|
+
text: "\u66F4\u6362\u5730\u5740"
|
|
335
|
+
})), /*#__PURE__*/_react.default.createElement(_menu.default.Item, {
|
|
336
|
+
key: "copyUrl",
|
|
337
|
+
disabled: (0, _tools.stringIsNullOrWhiteSpace)(audioUrl)
|
|
338
|
+
}, /*#__PURE__*/_react.default.createElement(_IconInfo.default, {
|
|
339
|
+
icon: /*#__PURE__*/_react.default.createElement(_icons.CopyOutlined, null),
|
|
340
|
+
text: "\u590D\u5236\u5730\u5740"
|
|
341
|
+
})), /*#__PURE__*/_react.default.createElement(_menu.default.Divider, null), /*#__PURE__*/_react.default.createElement(_menu.default.Item, {
|
|
342
|
+
key: "clearUrl",
|
|
343
|
+
disabled: (0, _tools.stringIsNullOrWhiteSpace)(audioUrl)
|
|
344
|
+
}, /*#__PURE__*/_react.default.createElement(_IconInfo.default, {
|
|
345
|
+
icon: /*#__PURE__*/_react.default.createElement(_icons.DeleteOutlined, null),
|
|
346
|
+
text: "\u6E05\u7A7A\u97F3\u9891"
|
|
347
|
+
})));
|
|
348
|
+
|
|
349
|
+
var addonAfter = /*#__PURE__*/_react.default.createElement(_space.default, {
|
|
350
|
+
split: /*#__PURE__*/_react.default.createElement(_divider.default, {
|
|
351
|
+
type: "vertical"
|
|
352
|
+
})
|
|
353
|
+
}, showPreview ? /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
354
|
+
key: "showAudioTip",
|
|
355
|
+
placement: "top",
|
|
356
|
+
title: "\u64AD\u653E\u97F3\u9891\u9884\u89C8"
|
|
357
|
+
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
358
|
+
style: {
|
|
359
|
+
border: '0px solid #d9d9d9',
|
|
360
|
+
backgroundColor: '#fafafa',
|
|
361
|
+
height: '30px',
|
|
362
|
+
paddingLeft: 0,
|
|
363
|
+
paddingRight: 0
|
|
364
|
+
},
|
|
365
|
+
disabled: uploading || (0, _tools.stringIsNullOrWhiteSpace)(audioUrl),
|
|
366
|
+
onClick: function onClick() {
|
|
367
|
+
_this2.showPreviewModal();
|
|
368
|
+
}
|
|
369
|
+
}, /*#__PURE__*/_react.default.createElement(_icons.PlayCircleOutlined, null), "\u64AD\u653E")) : null, /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
370
|
+
key: "showChangeUrlTip",
|
|
371
|
+
placement: "top",
|
|
372
|
+
title: "\u4E0A\u4F20\u97F3\u9891"
|
|
373
|
+
}, /*#__PURE__*/_react.default.createElement(_upload.default, uploadProps, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
374
|
+
style: {
|
|
375
|
+
border: '0px solid #d9d9d9',
|
|
376
|
+
backgroundColor: '#fafafa',
|
|
377
|
+
height: '30px',
|
|
378
|
+
paddingLeft: 0,
|
|
379
|
+
paddingRight: 0
|
|
380
|
+
},
|
|
381
|
+
disabled: uploading
|
|
382
|
+
}, uploading ? /*#__PURE__*/_react.default.createElement(_icons.LoadingOutlined, null) : /*#__PURE__*/_react.default.createElement(_icons.UploadOutlined, null), uploading ? '稍后' : '上传'))), /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
383
|
+
key: "showMoreTip",
|
|
384
|
+
placement: "top",
|
|
385
|
+
title: "\u66F4\u591A\u64CD\u4F5C"
|
|
386
|
+
}, /*#__PURE__*/_react.default.createElement(_dropdown.default, {
|
|
387
|
+
overlay: menu,
|
|
388
|
+
style: {
|
|
389
|
+
border: '0px solid #d9d9d9',
|
|
390
|
+
backgroundColor: '#fafafa',
|
|
391
|
+
height: '30px',
|
|
392
|
+
paddingLeft: 0,
|
|
393
|
+
paddingRight: 0
|
|
394
|
+
}
|
|
395
|
+
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
396
|
+
style: {
|
|
397
|
+
border: '0px solid #d9d9d9',
|
|
398
|
+
backgroundColor: '#fafafa',
|
|
399
|
+
height: '30px',
|
|
400
|
+
paddingLeft: 0,
|
|
401
|
+
paddingRight: 0
|
|
402
|
+
}
|
|
403
|
+
}, /*#__PURE__*/_react.default.createElement(_icons.EllipsisOutlined, {
|
|
404
|
+
style: {
|
|
405
|
+
fontSize: 20,
|
|
406
|
+
verticalAlign: 'top'
|
|
407
|
+
}
|
|
408
|
+
})))));
|
|
409
|
+
|
|
410
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_input.default, {
|
|
411
|
+
disabled: true,
|
|
412
|
+
addonBefore: /*#__PURE__*/_react.default.createElement(_icons.SoundOutlined, null),
|
|
413
|
+
addonAfter: addonAfter,
|
|
414
|
+
value: audioUrl,
|
|
415
|
+
placeholder: "\u5F53\u524D\u672A\u8BBE\u7F6E\u97F3\u9891\u5730\u5740"
|
|
416
|
+
}), /*#__PURE__*/_react.default.createElement(_modal.default, {
|
|
417
|
+
title: /*#__PURE__*/_react.default.createElement(_IconInfo.default, {
|
|
418
|
+
icon: /*#__PURE__*/_react.default.createElement(_icons.SoundOutlined, null),
|
|
419
|
+
text: "\u97F3\u9891\u9884\u89C8"
|
|
420
|
+
}),
|
|
421
|
+
visible: previewVisible,
|
|
422
|
+
footer: null,
|
|
423
|
+
onCancel: this.handleUploadCancel
|
|
424
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
425
|
+
style: {
|
|
426
|
+
position: 'relative',
|
|
427
|
+
height: '100%',
|
|
428
|
+
width: '100%'
|
|
429
|
+
}
|
|
430
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
431
|
+
style: {
|
|
432
|
+
position: 'absolute',
|
|
433
|
+
height: '100%',
|
|
434
|
+
width: '100%',
|
|
435
|
+
zIndex: -1,
|
|
436
|
+
backgroundImage: _constants.audioBackGroundImage
|
|
437
|
+
}
|
|
438
|
+
}), /*#__PURE__*/_react.default.createElement(_reactPlayer.default, {
|
|
439
|
+
width: "100%",
|
|
440
|
+
height: "100%",
|
|
441
|
+
url: audioUrl,
|
|
442
|
+
controls: true
|
|
443
|
+
}))), /*#__PURE__*/_react.default.createElement(_modal.default, {
|
|
444
|
+
title: /*#__PURE__*/_react.default.createElement(_IconInfo.default, {
|
|
445
|
+
icon: /*#__PURE__*/_react.default.createElement(_icons.SwapOutlined, null),
|
|
446
|
+
text: "\u8BF7\u8F93\u5165\u5C06\u66F4\u6362\u7684\u97F3\u9891\u5730\u5740"
|
|
447
|
+
}),
|
|
448
|
+
visible: changeUrlVisible,
|
|
449
|
+
onOk: this.handleChangeUrlOk,
|
|
450
|
+
onCancel: this.handleChangeUrlCancel
|
|
451
|
+
}, /*#__PURE__*/_react.default.createElement(TextArea, {
|
|
452
|
+
rows: 4,
|
|
453
|
+
value: audioUrlTemp,
|
|
454
|
+
onChange: this.handleUrlChange,
|
|
455
|
+
placeholder: "\u76EE\u524D\u6CA1\u6709\u5C06\u8981\u66F4\u6362\u7684\u97F3\u9891\u5730\u5740"
|
|
456
|
+
})));
|
|
457
|
+
}
|
|
458
|
+
}], [{
|
|
459
|
+
key: "getDerivedStateFromProps",
|
|
460
|
+
value: function getDerivedStateFromProps(nextProps, prevState) {
|
|
461
|
+
var audioNext = nextProps.audio;
|
|
462
|
+
var audioPrev = prevState.audioSource;
|
|
463
|
+
|
|
464
|
+
if ((audioNext || '') !== (audioPrev || '')) {
|
|
465
|
+
return {
|
|
466
|
+
audioSource: audioNext,
|
|
467
|
+
audioUrl: audioNext
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
return null;
|
|
472
|
+
}
|
|
473
|
+
}]);
|
|
474
|
+
|
|
475
|
+
return AudioUpload;
|
|
476
|
+
}(_react.PureComponent);
|
|
477
|
+
|
|
478
|
+
AudioUpload.defaultProps = {
|
|
479
|
+
action: '',
|
|
480
|
+
disabled: false,
|
|
481
|
+
tokenSet: {},
|
|
482
|
+
audio: '',
|
|
483
|
+
showPreview: false,
|
|
484
|
+
pretreatmentRemoteResponse: function pretreatmentRemoteResponse() {},
|
|
485
|
+
afterChangeSuccess: function afterChangeSuccess() {}
|
|
486
|
+
};
|
|
487
|
+
var _default = AudioUpload;
|
|
488
|
+
exports.default = _default;
|