@kmkf-fe-packages/basic-components 0.8.21-alpha.6 → 0.8.21-alpha.7

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/index.esm.js CHANGED
@@ -3,7 +3,6 @@ import { Cascader, DatePicker, InputNumber, Input, Select, Upload, Image, messag
3
3
  import { EyeOutlined, DeleteOutlined } from '@ant-design/icons';
4
4
  import request, { extend as extend$1 } from 'umi-request';
5
5
  import { CopyToClipboard } from 'react-copy-to-clipboard';
6
- import { getInfo } from 'react-mediainfo';
7
6
  import { AddressData, BsAddressData, request as request$1, ExpressData, LogisticsAddressData, uuid } from '@kmkf-fe-packages/kmkf-utils';
8
7
  import zhCN from 'antd/lib/locale/zh_CN';
9
8
  import pubsub from 'pubsub-js';
@@ -6854,7 +6853,8 @@ hooks.HTML5_FMT = {
6854
6853
  MONTH: 'YYYY-MM', // <input type="month" />
6855
6854
  };
6856
6855
 
6857
- var _excluded$7 = ["maxCount", "maxSize", "onChange", "value", "accept", "disabled", "uniqueKey", "hostUrl", "actionUrl"];
6856
+ var _excluded$7 = ["maxCount", "maxSize", "onChange", "value", "accept", "disabled", "uniqueKey", "hostUrl", "actionUrl", "platform"];
6857
+ // import { getInfo } from 'react-mediainfo';
6858
6858
  var Dragger = Upload.Dragger;
6859
6859
  var fn$2 = function fn() {
6860
6860
  return void 0;
@@ -6877,6 +6877,8 @@ var ApaasUploadAsync$1 = function ApaasUploadAsync(_ref) {
6877
6877
  hostUrl = _ref$hostUrl === void 0 ? '' : _ref$hostUrl,
6878
6878
  _ref$actionUrl = _ref.actionUrl,
6879
6879
  actionUrl = _ref$actionUrl === void 0 ? '/qy/common/uploadWorkOrderImg' : _ref$actionUrl,
6880
+ _ref$platform = _ref.platform,
6881
+ platform = _ref$platform === void 0 ? '' : _ref$platform,
6880
6882
  resetProps = _objectWithoutProperties(_ref, _excluded$7);
6881
6883
  var inputRef = useRef(null);
6882
6884
  var _useState = useState(false),
@@ -7018,31 +7020,58 @@ var ApaasUploadAsync$1 = function ApaasUploadAsync(_ref) {
7018
7020
  valueRef.current = list;
7019
7021
  onChange(list);
7020
7022
  };
7021
- var verificationFormat = function verificationFormat(file) {
7022
- getInfo(file).then(function (res) {
7023
- var track = res.media.track;
7024
- console.log(res);
7025
- var videoItem = track.find(function (item) {
7026
- return item['@type'] === 'Video';
7027
- });
7028
- var generalItem = track.find(function (item) {
7029
- return item['@type'] === 'General';
7030
- });
7031
- if (videoItem && blackList[generalItem === null || generalItem === void 0 ? void 0 : generalItem.Format.toUpperCase()] && blackList[generalItem === null || generalItem === void 0 ? void 0 : generalItem.Format.toUpperCase()].includes(videoItem === null || videoItem === void 0 ? void 0 : videoItem.Format.toUpperCase())) {
7032
- Modal.confirm({
7033
- title: '提示',
7034
- content: '上传的视屏无法播放确认要上传吗?',
7035
- okText: '确定',
7036
- cancelText: '取消',
7037
- onOk: function onOk() {
7023
+ var verificationFormat = /*#__PURE__*/function () {
7024
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(file) {
7025
+ var _yield$require, getInfo;
7026
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
7027
+ while (1) switch (_context3.prev = _context3.next) {
7028
+ case 0:
7029
+ if (!(platform !== 'fxg')) {
7030
+ _context3.next = 8;
7031
+ break;
7032
+ }
7033
+ _context3.next = 3;
7034
+ return require('react-mediainfo');
7035
+ case 3:
7036
+ _yield$require = _context3.sent;
7037
+ getInfo = _yield$require.getInfo;
7038
+ getInfo(file).then(function (res) {
7039
+ var track = res.media.track;
7040
+ console.log(res);
7041
+ var videoItem = track.find(function (item) {
7042
+ return item['@type'] === 'Video';
7043
+ });
7044
+ var generalItem = track.find(function (item) {
7045
+ return item['@type'] === 'General';
7046
+ });
7047
+ if (videoItem && blackList[generalItem === null || generalItem === void 0 ? void 0 : generalItem.Format.toUpperCase()] && blackList[generalItem === null || generalItem === void 0 ? void 0 : generalItem.Format.toUpperCase()].includes(videoItem === null || videoItem === void 0 ? void 0 : videoItem.Format.toUpperCase())) {
7048
+ Modal.confirm({
7049
+ title: '提示',
7050
+ content: '上传的视频可能无法播放,确认要上传吗?',
7051
+ okText: '确定',
7052
+ cancelText: '取消',
7053
+ onOk: function onOk() {
7054
+ asyncUpload(file);
7055
+ }
7056
+ });
7057
+ } else {
7058
+ asyncUpload(file);
7059
+ }
7060
+ });
7061
+ _context3.next = 9;
7062
+ break;
7063
+ case 8:
7038
7064
  asyncUpload(file);
7039
- }
7040
- });
7041
- } else {
7042
- asyncUpload(file);
7043
- }
7044
- });
7045
- };
7065
+ case 9:
7066
+ case "end":
7067
+ return _context3.stop();
7068
+ }
7069
+ }, _callee3);
7070
+ }));
7071
+ return function verificationFormat(_x2) {
7072
+ return _ref4.apply(this, arguments);
7073
+ };
7074
+ }();
7046
7075
  // 手动上传模式, 一直返回false
7047
7076
  var beforeUpload = function beforeUpload(file) {
7048
7077
  console.log('beforeUpload', file);
@@ -7117,11 +7146,11 @@ var ApaasUploadAsync$1 = function ApaasUploadAsync(_ref) {
7117
7146
  return;
7118
7147
  }
7119
7148
  reader.onload = /*#__PURE__*/function () {
7120
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(e) {
7149
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(e) {
7121
7150
  var _e$target;
7122
7151
  var result, fileName, file;
7123
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
7124
- while (1) switch (_context3.prev = _context3.next) {
7152
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
7153
+ while (1) switch (_context4.prev = _context4.next) {
7125
7154
  case 0:
7126
7155
  result = e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.result;
7127
7156
  fileName = blob.name;
@@ -7129,12 +7158,12 @@ var ApaasUploadAsync$1 = function ApaasUploadAsync(_ref) {
7129
7158
  verificationFormat(file);
7130
7159
  case 4:
7131
7160
  case "end":
7132
- return _context3.stop();
7161
+ return _context4.stop();
7133
7162
  }
7134
- }, _callee3);
7163
+ }, _callee4);
7135
7164
  }));
7136
- return function (_x2) {
7137
- return _ref4.apply(this, arguments);
7165
+ return function (_x3) {
7166
+ return _ref5.apply(this, arguments);
7138
7167
  };
7139
7168
  }();
7140
7169
  reader.readAsDataURL(blob);
package/dist/index.js CHANGED
@@ -7,7 +7,6 @@ var antd = require('antd');
7
7
  var icons = require('@ant-design/icons');
8
8
  var request = require('umi-request');
9
9
  var reactCopyToClipboard = require('react-copy-to-clipboard');
10
- var reactMediainfo = require('react-mediainfo');
11
10
  var kmkfUtils = require('@kmkf-fe-packages/kmkf-utils');
12
11
  var zhCN = require('antd/lib/locale/zh_CN');
13
12
  var pubsub = require('pubsub-js');
@@ -6865,7 +6864,8 @@ hooks.HTML5_FMT = {
6865
6864
  MONTH: 'YYYY-MM', // <input type="month" />
6866
6865
  };
6867
6866
 
6868
- var _excluded$7 = ["maxCount", "maxSize", "onChange", "value", "accept", "disabled", "uniqueKey", "hostUrl", "actionUrl"];
6867
+ var _excluded$7 = ["maxCount", "maxSize", "onChange", "value", "accept", "disabled", "uniqueKey", "hostUrl", "actionUrl", "platform"];
6868
+ // import { getInfo } from 'react-mediainfo';
6869
6869
  var Dragger = antd.Upload.Dragger;
6870
6870
  var fn$2 = function fn() {
6871
6871
  return void 0;
@@ -6888,6 +6888,8 @@ var ApaasUploadAsync$1 = function ApaasUploadAsync(_ref) {
6888
6888
  hostUrl = _ref$hostUrl === void 0 ? '' : _ref$hostUrl,
6889
6889
  _ref$actionUrl = _ref.actionUrl,
6890
6890
  actionUrl = _ref$actionUrl === void 0 ? '/qy/common/uploadWorkOrderImg' : _ref$actionUrl,
6891
+ _ref$platform = _ref.platform,
6892
+ platform = _ref$platform === void 0 ? '' : _ref$platform,
6891
6893
  resetProps = _objectWithoutProperties(_ref, _excluded$7);
6892
6894
  var inputRef = React.useRef(null);
6893
6895
  var _useState = React.useState(false),
@@ -7029,31 +7031,58 @@ var ApaasUploadAsync$1 = function ApaasUploadAsync(_ref) {
7029
7031
  valueRef.current = list;
7030
7032
  onChange(list);
7031
7033
  };
7032
- var verificationFormat = function verificationFormat(file) {
7033
- reactMediainfo.getInfo(file).then(function (res) {
7034
- var track = res.media.track;
7035
- console.log(res);
7036
- var videoItem = track.find(function (item) {
7037
- return item['@type'] === 'Video';
7038
- });
7039
- var generalItem = track.find(function (item) {
7040
- return item['@type'] === 'General';
7041
- });
7042
- if (videoItem && blackList[generalItem === null || generalItem === void 0 ? void 0 : generalItem.Format.toUpperCase()] && blackList[generalItem === null || generalItem === void 0 ? void 0 : generalItem.Format.toUpperCase()].includes(videoItem === null || videoItem === void 0 ? void 0 : videoItem.Format.toUpperCase())) {
7043
- antd.Modal.confirm({
7044
- title: '提示',
7045
- content: '上传的视屏无法播放确认要上传吗?',
7046
- okText: '确定',
7047
- cancelText: '取消',
7048
- onOk: function onOk() {
7034
+ var verificationFormat = /*#__PURE__*/function () {
7035
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(file) {
7036
+ var _yield$require, getInfo;
7037
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
7038
+ while (1) switch (_context3.prev = _context3.next) {
7039
+ case 0:
7040
+ if (!(platform !== 'fxg')) {
7041
+ _context3.next = 8;
7042
+ break;
7043
+ }
7044
+ _context3.next = 3;
7045
+ return require('react-mediainfo');
7046
+ case 3:
7047
+ _yield$require = _context3.sent;
7048
+ getInfo = _yield$require.getInfo;
7049
+ getInfo(file).then(function (res) {
7050
+ var track = res.media.track;
7051
+ console.log(res);
7052
+ var videoItem = track.find(function (item) {
7053
+ return item['@type'] === 'Video';
7054
+ });
7055
+ var generalItem = track.find(function (item) {
7056
+ return item['@type'] === 'General';
7057
+ });
7058
+ if (videoItem && blackList[generalItem === null || generalItem === void 0 ? void 0 : generalItem.Format.toUpperCase()] && blackList[generalItem === null || generalItem === void 0 ? void 0 : generalItem.Format.toUpperCase()].includes(videoItem === null || videoItem === void 0 ? void 0 : videoItem.Format.toUpperCase())) {
7059
+ antd.Modal.confirm({
7060
+ title: '提示',
7061
+ content: '上传的视频可能无法播放,确认要上传吗?',
7062
+ okText: '确定',
7063
+ cancelText: '取消',
7064
+ onOk: function onOk() {
7065
+ asyncUpload(file);
7066
+ }
7067
+ });
7068
+ } else {
7069
+ asyncUpload(file);
7070
+ }
7071
+ });
7072
+ _context3.next = 9;
7073
+ break;
7074
+ case 8:
7049
7075
  asyncUpload(file);
7050
- }
7051
- });
7052
- } else {
7053
- asyncUpload(file);
7054
- }
7055
- });
7056
- };
7076
+ case 9:
7077
+ case "end":
7078
+ return _context3.stop();
7079
+ }
7080
+ }, _callee3);
7081
+ }));
7082
+ return function verificationFormat(_x2) {
7083
+ return _ref4.apply(this, arguments);
7084
+ };
7085
+ }();
7057
7086
  // 手动上传模式, 一直返回false
7058
7087
  var beforeUpload = function beforeUpload(file) {
7059
7088
  console.log('beforeUpload', file);
@@ -7128,11 +7157,11 @@ var ApaasUploadAsync$1 = function ApaasUploadAsync(_ref) {
7128
7157
  return;
7129
7158
  }
7130
7159
  reader.onload = /*#__PURE__*/function () {
7131
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(e) {
7160
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(e) {
7132
7161
  var _e$target;
7133
7162
  var result, fileName, file;
7134
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
7135
- while (1) switch (_context3.prev = _context3.next) {
7163
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
7164
+ while (1) switch (_context4.prev = _context4.next) {
7136
7165
  case 0:
7137
7166
  result = e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.result;
7138
7167
  fileName = blob.name;
@@ -7140,12 +7169,12 @@ var ApaasUploadAsync$1 = function ApaasUploadAsync(_ref) {
7140
7169
  verificationFormat(file);
7141
7170
  case 4:
7142
7171
  case "end":
7143
- return _context3.stop();
7172
+ return _context4.stop();
7144
7173
  }
7145
- }, _callee3);
7174
+ }, _callee4);
7146
7175
  }));
7147
- return function (_x2) {
7148
- return _ref4.apply(this, arguments);
7176
+ return function (_x3) {
7177
+ return _ref5.apply(this, arguments);
7149
7178
  };
7150
7179
  }();
7151
7180
  reader.readAsDataURL(blob);
@@ -15,6 +15,7 @@ export interface ApaasUploadProps extends Omit<UploadProps, 'onChange' | 'value'
15
15
  uniqueKey?: string;
16
16
  hostUrl?: string;
17
17
  actionUrl?: string;
18
+ platform?: string;
18
19
  }
19
- declare const ApaasUploadAsync: ({ maxCount, maxSize, onChange, value, accept, disabled, uniqueKey, hostUrl, actionUrl, ...resetProps }: ApaasUploadProps) => React.JSX.Element;
20
+ declare const ApaasUploadAsync: ({ maxCount, maxSize, onChange, value, accept, disabled, uniqueKey, hostUrl, actionUrl, platform, ...resetProps }: ApaasUploadProps) => React.JSX.Element;
20
21
  export default ApaasUploadAsync;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "0.8.21-alpha.6",
3
+ "version": "0.8.21-alpha.7",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "",
6
6
  "license": "ISC",
@@ -61,5 +61,5 @@
61
61
  "publishConfig": {
62
62
  "access": "public"
63
63
  },
64
- "gitHead": "a57e346b9c807660ebff73b66aa286488ba1d552"
64
+ "gitHead": "812ab4ed4d1bc5dd36ca0d15f4c0ca12b9d855ee"
65
65
  }