dlt-for-react 2.2.0 → 2.2.1
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/README.md +3 -0
- package/assets/components/HqUeditor/images/anchor.gif +0 -0
- package/assets/components/HqUeditor/images/arrow.png +0 -0
- package/assets/components/HqUeditor/images/arrow_down.png +0 -0
- package/assets/components/HqUeditor/images/arrow_up.png +0 -0
- package/assets/components/HqUeditor/images/button-bg.gif +0 -0
- package/assets/components/HqUeditor/images/cancelbutton.gif +0 -0
- package/assets/components/HqUeditor/images/charts.png +0 -0
- package/assets/components/HqUeditor/images/cursor_h.gif +0 -0
- package/assets/components/HqUeditor/images/cursor_h.png +0 -0
- package/assets/components/HqUeditor/images/cursor_v.gif +0 -0
- package/assets/components/HqUeditor/images/cursor_v.png +0 -0
- package/assets/components/HqUeditor/images/dialog-title-bg.png +0 -0
- package/assets/components/HqUeditor/images/filescan.png +0 -0
- package/assets/components/HqUeditor/images/highlighted.gif +0 -0
- package/assets/components/HqUeditor/images/icons-all.gif +0 -0
- package/assets/components/HqUeditor/images/icons.gif +0 -0
- package/assets/components/HqUeditor/images/icons.png +0 -0
- package/assets/components/HqUeditor/images/loaderror.png +0 -0
- package/assets/components/HqUeditor/images/loading.gif +0 -0
- package/assets/components/HqUeditor/images/lock.gif +0 -0
- package/assets/components/HqUeditor/images/neweditor-tab-bg.png +0 -0
- package/assets/components/HqUeditor/images/pagebreak.gif +0 -0
- package/assets/components/HqUeditor/images/scale.png +0 -0
- package/assets/components/HqUeditor/images/sortable.png +0 -0
- package/assets/components/HqUeditor/images/spacer.gif +0 -0
- package/assets/components/HqUeditor/images/sparator_v.png +0 -0
- package/assets/components/HqUeditor/images/table-cell-align.png +0 -0
- package/assets/components/HqUeditor/images/tangram-colorpicker.png +0 -0
- package/assets/components/HqUeditor/images/toolbar_bg.png +0 -0
- package/assets/components/HqUeditor/images/unhighlighted.gif +0 -0
- package/assets/components/HqUeditor/images/upload.png +0 -0
- package/assets/components/HqUeditor/images/videologo.gif +0 -0
- package/assets/components/HqUeditor/images/word.gif +0 -0
- package/assets/components/HqUeditor/images/wordpaste.png +0 -0
- package/assets/components/HqUeditor/ueditor/index.html +175 -0
- package/assets/components/HqUeditor/ueditor/lang/en/en.js +684 -0
- package/assets/components/HqUeditor/ueditor/lang/en/images/addimage.png +0 -0
- package/assets/components/HqUeditor/ueditor/lang/en/images/alldeletebtnhoverskin.png +0 -0
- package/assets/components/HqUeditor/ueditor/lang/en/images/alldeletebtnupskin.png +0 -0
- package/assets/components/HqUeditor/ueditor/lang/en/images/background.png +0 -0
- package/assets/components/HqUeditor/ueditor/lang/en/images/button.png +0 -0
- package/assets/components/HqUeditor/ueditor/lang/en/images/copy.png +0 -0
- package/assets/components/HqUeditor/ueditor/lang/en/images/deletedisable.png +0 -0
- package/assets/components/HqUeditor/ueditor/lang/en/images/deleteenable.png +0 -0
- package/assets/components/HqUeditor/ueditor/lang/en/images/listbackground.png +0 -0
- package/assets/components/HqUeditor/ueditor/lang/en/images/localimage.png +0 -0
- package/assets/components/HqUeditor/ueditor/lang/en/images/music.png +0 -0
- package/assets/components/HqUeditor/ueditor/lang/en/images/rotateleftdisable.png +0 -0
- package/assets/components/HqUeditor/ueditor/lang/en/images/rotateleftenable.png +0 -0
- package/assets/components/HqUeditor/ueditor/lang/en/images/rotaterightdisable.png +0 -0
- package/assets/components/HqUeditor/ueditor/lang/en/images/rotaterightenable.png +0 -0
- package/assets/components/HqUeditor/ueditor/lang/en/images/upload.png +0 -0
- package/assets/components/HqUeditor/ueditor/lang/zh-cn/images/copy.png +0 -0
- package/assets/components/HqUeditor/ueditor/lang/zh-cn/images/localimage.png +0 -0
- package/assets/components/HqUeditor/ueditor/lang/zh-cn/images/music.png +0 -0
- package/assets/components/HqUeditor/ueditor/lang/zh-cn/images/upload.png +0 -0
- package/assets/components/HqUeditor/ueditor/lang/zh-cn/zh-cn.js +669 -0
- package/assets/components/HqUeditor/ueditor/themes/default/css/ueditor.css +1898 -0
- package/assets/components/HqUeditor/ueditor/themes/default/css/ueditor.min.css +1843 -0
- package/assets/components/HqUeditor/ueditor/themes/default/dialogbase.css +100 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/anchor.gif +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/arrow.png +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/arrow_down.png +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/arrow_up.png +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/button-bg.gif +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/cancelbutton.gif +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/charts.png +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/cursor_h.gif +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/cursor_h.png +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/cursor_v.gif +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/cursor_v.png +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/dialog-title-bg.png +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/filescan.png +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/highlighted.gif +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/icons-all.gif +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/icons.gif +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/icons.png +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/loaderror.png +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/loading.gif +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/lock.gif +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/neweditor-tab-bg.png +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/pagebreak.gif +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/scale.png +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/sortable.png +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/spacer.gif +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/sparator_v.png +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/table-cell-align.png +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/tangram-colorpicker.png +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/toolbar_bg.png +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/unhighlighted.gif +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/upload.png +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/videologo.gif +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/word.gif +0 -0
- package/assets/components/HqUeditor/ueditor/themes/default/images/wordpaste.png +0 -0
- package/assets/components/HqUeditor/ueditor/themes/iframe.css +1 -0
- package/assets/components/HqUeditor/ueditor/ueditor.all.js +29582 -0
- package/assets/components/HqUeditor/ueditor/ueditor.all.min.js +1 -0
- package/assets/components/HqUeditor/ueditor/ueditor.config.js +586 -0
- package/assets/components/HqUeditor/ueditor/ueditor.parse.js +1022 -0
- package/assets/components/HqUeditor/ueditor/ueditor.parse.min.js +7 -0
- package/assets/components/HqUeditor/ueditor.css +1898 -0
- package/assets/components/HqUeditor/ueditor.min.css +1843 -0
- package/lib/components/HqPrint/index.js +51 -0
- package/lib/components/HqUeditor/file/EditForm.js +297 -0
- package/lib/components/HqUeditor/file/index.js +150 -0
- package/lib/components/HqUeditor/img/EditForm.js +310 -0
- package/lib/components/HqUeditor/img/index.js +150 -0
- package/lib/components/HqUeditor/index.js +239 -0
- package/lib/components/HqUeditor/link/EditForm.js +121 -0
- package/lib/components/HqUeditor/link/index.js +163 -0
- package/lib/components/KyTable/index.js +5 -4
- package/lib/components/KyUpload/index.js +165 -172
- package/lib/index.js +9 -0
- package/lib/utils/common.js +3 -9
- package/lib/utils/createUuid.js +40 -0
- package/lib/utils/getLoginUser.js +10 -0
- package/lib/utils/getSize.js +27 -0
- package/package.json +2 -1
- package/lib/components/NHSelector/ListSort/index.js +0 -411
- package/lib/components/NHSelector/index.js +0 -636
- package/lib/components/NHSelector/resultview/index.js +0 -408
- package/lib/components/NHSelector/selectormodal/index.js +0 -303
- package/lib/components/NHSelector/table/index.js +0 -784
- package/lib/components/NHSelector/tree/index.js +0 -554
|
@@ -1,107 +1,105 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = undefined;
|
|
7
7
|
|
|
8
|
-
var _getIterator2 = require(
|
|
8
|
+
var _getIterator2 = require('babel-runtime/core-js/get-iterator');
|
|
9
9
|
|
|
10
10
|
var _getIterator3 = _interopRequireDefault(_getIterator2);
|
|
11
11
|
|
|
12
|
-
var _spin = require(
|
|
12
|
+
var _spin = require('antd/lib/spin');
|
|
13
13
|
|
|
14
14
|
var _spin2 = _interopRequireDefault(_spin);
|
|
15
15
|
|
|
16
|
-
var _upload = require(
|
|
16
|
+
var _upload = require('antd/lib/upload');
|
|
17
17
|
|
|
18
18
|
var _upload2 = _interopRequireDefault(_upload);
|
|
19
19
|
|
|
20
|
-
var _button = require(
|
|
20
|
+
var _button = require('antd/lib/button');
|
|
21
21
|
|
|
22
22
|
var _button2 = _interopRequireDefault(_button);
|
|
23
23
|
|
|
24
|
-
var _icon = require(
|
|
24
|
+
var _icon = require('antd/lib/icon');
|
|
25
25
|
|
|
26
26
|
var _icon2 = _interopRequireDefault(_icon);
|
|
27
27
|
|
|
28
|
-
var _regenerator = require(
|
|
28
|
+
var _regenerator = require('babel-runtime/regenerator');
|
|
29
29
|
|
|
30
30
|
var _regenerator2 = _interopRequireDefault(_regenerator);
|
|
31
31
|
|
|
32
|
-
var _asyncToGenerator2 = require(
|
|
32
|
+
var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator');
|
|
33
33
|
|
|
34
34
|
var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);
|
|
35
35
|
|
|
36
|
-
var _message2 = require(
|
|
36
|
+
var _message2 = require('antd/lib/message');
|
|
37
37
|
|
|
38
38
|
var _message3 = _interopRequireDefault(_message2);
|
|
39
39
|
|
|
40
|
-
var _stringify = require(
|
|
40
|
+
var _stringify = require('babel-runtime/core-js/json/stringify');
|
|
41
41
|
|
|
42
42
|
var _stringify2 = _interopRequireDefault(_stringify);
|
|
43
43
|
|
|
44
|
-
var _getPrototypeOf = require(
|
|
44
|
+
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
|
|
45
45
|
|
|
46
46
|
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
|
|
47
47
|
|
|
48
|
-
var _classCallCheck2 = require(
|
|
48
|
+
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
|
49
49
|
|
|
50
50
|
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
|
51
51
|
|
|
52
|
-
var _createClass2 = require(
|
|
52
|
+
var _createClass2 = require('babel-runtime/helpers/createClass');
|
|
53
53
|
|
|
54
54
|
var _createClass3 = _interopRequireDefault(_createClass2);
|
|
55
55
|
|
|
56
|
-
var _possibleConstructorReturn2 = require(
|
|
56
|
+
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
|
|
57
57
|
|
|
58
58
|
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
|
59
59
|
|
|
60
|
-
var _inherits2 = require(
|
|
60
|
+
var _inherits2 = require('babel-runtime/helpers/inherits');
|
|
61
61
|
|
|
62
62
|
var _inherits3 = _interopRequireDefault(_inherits2);
|
|
63
63
|
|
|
64
|
-
var _promise = require(
|
|
64
|
+
var _promise = require('babel-runtime/core-js/promise');
|
|
65
65
|
|
|
66
66
|
var _promise2 = _interopRequireDefault(_promise);
|
|
67
67
|
|
|
68
|
-
require(
|
|
68
|
+
require('antd/lib/spin/style');
|
|
69
69
|
|
|
70
|
-
require(
|
|
70
|
+
require('antd/lib/upload/style');
|
|
71
71
|
|
|
72
|
-
require(
|
|
72
|
+
require('antd/lib/button/style');
|
|
73
73
|
|
|
74
|
-
require(
|
|
74
|
+
require('antd/lib/icon/style');
|
|
75
75
|
|
|
76
|
-
require(
|
|
76
|
+
require('antd/lib/message/style');
|
|
77
77
|
|
|
78
|
-
var _react = require(
|
|
78
|
+
var _react = require('react');
|
|
79
79
|
|
|
80
80
|
var _react2 = _interopRequireDefault(_react);
|
|
81
81
|
|
|
82
|
-
var _classnames = require(
|
|
82
|
+
var _classnames = require('classnames');
|
|
83
83
|
|
|
84
84
|
var _classnames2 = _interopRequireDefault(_classnames);
|
|
85
85
|
|
|
86
|
-
var _index = require(
|
|
86
|
+
var _index = require('../../index');
|
|
87
87
|
|
|
88
|
-
var _KyModal = require(
|
|
88
|
+
var _KyModal = require('../KyModal');
|
|
89
89
|
|
|
90
90
|
var _KyModal2 = _interopRequireDefault(_KyModal);
|
|
91
91
|
|
|
92
|
-
var _KyPreview = require(
|
|
92
|
+
var _KyPreview = require('../KyPreview');
|
|
93
93
|
|
|
94
94
|
var _KyPreview2 = _interopRequireDefault(_KyPreview);
|
|
95
95
|
|
|
96
|
-
var _base = require(
|
|
96
|
+
var _base = require('../../utils/base64');
|
|
97
97
|
|
|
98
|
-
require(
|
|
98
|
+
require('../../../assets/components/KyUpload/index.less');
|
|
99
99
|
|
|
100
100
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
101
101
|
|
|
102
|
-
var downloadPrefix =
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
var downloadPrefix = 'zuul/docrepo/download/file';
|
|
105
103
|
/**
|
|
106
104
|
* 文件上传路径:
|
|
107
105
|
* file模式:zuul/docrepo/upload
|
|
@@ -127,7 +125,7 @@ function getBase64(file) {
|
|
|
127
125
|
}
|
|
128
126
|
|
|
129
127
|
//pageOffice正文新增与编辑接口url(参数:docId(必填),openType(非必填),templateId(非必填))
|
|
130
|
-
var docUrl =
|
|
128
|
+
var docUrl = 'api/pageoffice/docPageOffice/docAddOrShow';
|
|
131
129
|
|
|
132
130
|
var KyUpload = function (_React$Component) {
|
|
133
131
|
(0, _inherits3.default)(KyUpload, _React$Component);
|
|
@@ -141,22 +139,22 @@ var KyUpload = function (_React$Component) {
|
|
|
141
139
|
|
|
142
140
|
var value = props.value || props.defaultValue;
|
|
143
141
|
var urlTemp = props.xtglUrl || window.xtglUrl || window.baseUrl;
|
|
144
|
-
var xtglUrlTemp = urlTemp ? urlTemp :
|
|
142
|
+
var xtglUrlTemp = urlTemp ? urlTemp : 'api/ky-core';
|
|
145
143
|
|
|
146
144
|
_this.state = {
|
|
147
145
|
fileList: [], //上传的文件
|
|
148
|
-
value: value
|
|
146
|
+
value: value || (0, _index.createUuid)(), //传了附件主表id,查询附件明细
|
|
149
147
|
imageVisible: false,
|
|
150
|
-
previewFile:
|
|
151
|
-
fileName:
|
|
148
|
+
previewFile: '',
|
|
149
|
+
fileName: '',
|
|
152
150
|
spinLoading: false, //加载中标识
|
|
153
151
|
rotateDeg: 0, //旋转角度
|
|
154
|
-
KY_FJFWBZ:
|
|
155
|
-
KY_FJYLBZ:
|
|
152
|
+
KY_FJFWBZ: 'http://192.168.35.210:1101', //附件服务地址
|
|
153
|
+
KY_FJYLBZ: 'http://192.168.35.131:8012', //附件预览服务地址
|
|
156
154
|
//pageOffice附件(Office文档)预览接口url(参数:attachmentId(必填),openType(非必填))
|
|
157
|
-
previewOfficeUrl: xtglUrlTemp +
|
|
155
|
+
previewOfficeUrl: xtglUrlTemp + '/pageoffice/docShow',
|
|
158
156
|
//pdf预览url(参数:attachmentId(必填))
|
|
159
|
-
previewPdfUrl: xtglUrlTemp +
|
|
157
|
+
previewPdfUrl: xtglUrlTemp + '/pageoffice/preview/pdf',
|
|
160
158
|
xtglUrl: xtglUrlTemp
|
|
161
159
|
};
|
|
162
160
|
return _this;
|
|
@@ -165,26 +163,26 @@ var KyUpload = function (_React$Component) {
|
|
|
165
163
|
|
|
166
164
|
|
|
167
165
|
(0, _createClass3.default)(KyUpload, [{
|
|
168
|
-
key:
|
|
166
|
+
key: 'componentWillReceiveProps',
|
|
169
167
|
value: function componentWillReceiveProps(nextProps) {
|
|
170
168
|
var _this2 = this;
|
|
171
169
|
|
|
172
|
-
if (this.props.uploadType ===
|
|
170
|
+
if (this.props.uploadType === 'file') {
|
|
173
171
|
var _props = this.props,
|
|
174
172
|
serviceMark = _props.serviceMark,
|
|
175
173
|
moduleName = _props.moduleName;
|
|
176
174
|
|
|
177
175
|
if (serviceMark && moduleName) {
|
|
178
|
-
if (
|
|
176
|
+
if ('value' in nextProps) {
|
|
179
177
|
var value = nextProps.value;
|
|
180
|
-
if ((0, _stringify2.default)(value) ===
|
|
178
|
+
if ((0, _stringify2.default)(value) === '[]' || typeof value === 'undefined' || typeof value === 'string' && value.trim() === '' || value === null) {
|
|
181
179
|
this.setState({ fileList: [] });
|
|
182
180
|
} else {
|
|
183
181
|
if (value !== this.state.value) {
|
|
184
182
|
this.setState({ value: value, fileList: [] });
|
|
185
183
|
var t = new Date().getTime();
|
|
186
184
|
// 获取动态文件
|
|
187
|
-
(0, _index.NHFetch)(this.state.xtglUrl +
|
|
185
|
+
(0, _index.NHFetch)(this.state.xtglUrl + '/dynamic/' + value + '/getDetailed', 'GET', t).then(function (res) {
|
|
188
186
|
if (res && res.data && res.data.length > 0) {
|
|
189
187
|
_this2.handleFileList(res.data);
|
|
190
188
|
}
|
|
@@ -193,7 +191,7 @@ var KyUpload = function (_React$Component) {
|
|
|
193
191
|
}
|
|
194
192
|
}
|
|
195
193
|
} else {
|
|
196
|
-
_message3.default.error(
|
|
194
|
+
_message3.default.error('服务标志和模块名称不能为空');
|
|
197
195
|
}
|
|
198
196
|
}
|
|
199
197
|
}
|
|
@@ -201,12 +199,12 @@ var KyUpload = function (_React$Component) {
|
|
|
201
199
|
//在组件挂载之前调用一次。如果在这个函数里面调用setState,本次的render函数可以看到更新后的state,并且只渲染一次。
|
|
202
200
|
|
|
203
201
|
}, {
|
|
204
|
-
key:
|
|
202
|
+
key: 'UNSAFE_componentWillMount',
|
|
205
203
|
value: function UNSAFE_componentWillMount() {
|
|
206
204
|
var _this3 = this;
|
|
207
205
|
|
|
208
206
|
this.setState({ fileList: [] });
|
|
209
|
-
if (this.props.uploadType ===
|
|
207
|
+
if (this.props.uploadType === 'file') {
|
|
210
208
|
var _props2 = this.props,
|
|
211
209
|
serviceMark = _props2.serviceMark,
|
|
212
210
|
moduleName = _props2.moduleName,
|
|
@@ -216,13 +214,13 @@ var KyUpload = function (_React$Component) {
|
|
|
216
214
|
var value = this.state.value;
|
|
217
215
|
if (newValue !== value) return;
|
|
218
216
|
var t = new Date().getTime();
|
|
219
|
-
(0, _index.NHFetch)(this.state.xtglUrl +
|
|
217
|
+
(0, _index.NHFetch)(this.state.xtglUrl + '/dynamic/' + value + '/getDetailed', 'GET', t).then(function (res) {
|
|
220
218
|
if (res && res.data && res.data.length > 0) {
|
|
221
219
|
_this3.handleFileList(res.data);
|
|
222
220
|
}
|
|
223
221
|
});
|
|
224
222
|
} else {
|
|
225
|
-
_message3.default.error(
|
|
223
|
+
_message3.default.error('服务标志和模块名称不能为空');
|
|
226
224
|
}
|
|
227
225
|
}
|
|
228
226
|
if (!window.POBrowser) {
|
|
@@ -236,7 +234,7 @@ var KyUpload = function (_React$Component) {
|
|
|
236
234
|
//在组件挂载之后调用一次。
|
|
237
235
|
|
|
238
236
|
}, {
|
|
239
|
-
key:
|
|
237
|
+
key: 'componentDidMount',
|
|
240
238
|
value: function () {
|
|
241
239
|
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee() {
|
|
242
240
|
var params, res, _ref2, KY_FJFWBZ, KY_FJYLBZ;
|
|
@@ -245,9 +243,9 @@ var KyUpload = function (_React$Component) {
|
|
|
245
243
|
while (1) {
|
|
246
244
|
switch (_context.prev = _context.next) {
|
|
247
245
|
case 0:
|
|
248
|
-
params = [
|
|
246
|
+
params = ['KY_FJFWBZ', 'KY_FJYLBZ'];
|
|
249
247
|
_context.next = 3;
|
|
250
|
-
return (0, _index.NHFetch)(this.state.xtglUrl +
|
|
248
|
+
return (0, _index.NHFetch)(this.state.xtglUrl + '/common/parameters/get', 'POST', params);
|
|
251
249
|
|
|
252
250
|
case 3:
|
|
253
251
|
res = _context.sent;
|
|
@@ -257,7 +255,7 @@ var KyUpload = function (_React$Component) {
|
|
|
257
255
|
break;
|
|
258
256
|
}
|
|
259
257
|
|
|
260
|
-
return _context.abrupt(
|
|
258
|
+
return _context.abrupt('return');
|
|
261
259
|
|
|
262
260
|
case 6:
|
|
263
261
|
_ref2 = res.data || {}, KY_FJFWBZ = _ref2.KY_FJFWBZ, KY_FJYLBZ = _ref2.KY_FJYLBZ;
|
|
@@ -265,7 +263,7 @@ var KyUpload = function (_React$Component) {
|
|
|
265
263
|
this.setState({ KY_FJFWBZ: KY_FJFWBZ, KY_FJYLBZ: KY_FJYLBZ });
|
|
266
264
|
|
|
267
265
|
case 8:
|
|
268
|
-
case
|
|
266
|
+
case 'end':
|
|
269
267
|
return _context.stop();
|
|
270
268
|
}
|
|
271
269
|
}
|
|
@@ -311,12 +309,12 @@ var KyUpload = function (_React$Component) {
|
|
|
311
309
|
// 图片旋转90度
|
|
312
310
|
|
|
313
311
|
}, {
|
|
314
|
-
key:
|
|
312
|
+
key: 'render',
|
|
315
313
|
value: function render() {
|
|
316
314
|
var _this4 = this;
|
|
317
315
|
|
|
318
316
|
var baseUrl = this.props.baseUrl || window.baseUrl;
|
|
319
|
-
var action = this.props.uploadType ===
|
|
317
|
+
var action = this.props.uploadType === 'file' ? 'zuul/docrepo/upload' : baseUrl + '/proData/uploadRedis?fileName=' + this.state.fileName;
|
|
320
318
|
var _state = this.state,
|
|
321
319
|
imageVisible = _state.imageVisible,
|
|
322
320
|
previewFile = _state.previewFile,
|
|
@@ -325,13 +323,13 @@ var KyUpload = function (_React$Component) {
|
|
|
325
323
|
fileType = _state.fileType;
|
|
326
324
|
|
|
327
325
|
var showUploadList = {
|
|
328
|
-
showDownloadIcon: this.props.uploadType ===
|
|
326
|
+
showDownloadIcon: this.props.uploadType === 'file' ? true : false
|
|
329
327
|
};
|
|
330
328
|
var _props3 = this.props,
|
|
331
329
|
_props3$templateList = _props3.templateList,
|
|
332
330
|
templateList = _props3$templateList === undefined ? [] : _props3$templateList,
|
|
333
331
|
_props3$accept = _props3.accept,
|
|
334
|
-
accept = _props3$accept === undefined ?
|
|
332
|
+
accept = _props3$accept === undefined ? '*/*' : _props3$accept,
|
|
335
333
|
image = _props3.image,
|
|
336
334
|
fileCountLimit = _props3.fileCountLimit,
|
|
337
335
|
_props3$disableDelete = _props3.disableDelete,
|
|
@@ -339,32 +337,30 @@ var KyUpload = function (_React$Component) {
|
|
|
339
337
|
fileView = _props3.fileView;
|
|
340
338
|
|
|
341
339
|
var uploadButton = image ? _react2.default.createElement(
|
|
342
|
-
|
|
340
|
+
'div',
|
|
343
341
|
null,
|
|
344
|
-
_react2.default.createElement(_icon2.default, { type:
|
|
342
|
+
_react2.default.createElement(_icon2.default, { type: 'plus' })
|
|
345
343
|
) : _react2.default.createElement(
|
|
346
344
|
_button2.default,
|
|
347
345
|
{ disabled: this.props.disabled },
|
|
348
|
-
_react2.default.createElement(_icon2.default, { type:
|
|
349
|
-
|
|
346
|
+
_react2.default.createElement(_icon2.default, { type: 'upload' }),
|
|
347
|
+
' \u70B9\u51FB\u4E0A\u4F20'
|
|
350
348
|
);
|
|
351
349
|
if (fileList.length >= fileCountLimit) {
|
|
352
350
|
uploadButton = null;
|
|
353
351
|
}
|
|
354
352
|
var maxHeight = window.screen.height * 2 / 3;
|
|
355
353
|
return _react2.default.createElement(
|
|
356
|
-
|
|
357
|
-
{
|
|
358
|
-
className: (0, _classnames2.default)("ky-upload", disableDelete ? "nhUpload-removeDelete" : "")
|
|
359
|
-
},
|
|
354
|
+
'div',
|
|
355
|
+
{ className: (0, _classnames2.default)('ky-upload', disableDelete ? 'nhUpload-removeDelete' : '') },
|
|
360
356
|
this.props.isEdit === true ? _react2.default.createElement(
|
|
361
|
-
|
|
357
|
+
'div',
|
|
362
358
|
null,
|
|
363
359
|
_react2.default.createElement(
|
|
364
360
|
_upload2.default,
|
|
365
361
|
{
|
|
366
|
-
className: fileView ?
|
|
367
|
-
name:
|
|
362
|
+
className: fileView ? 'file-view' : '',
|
|
363
|
+
name: 'file',
|
|
368
364
|
accept: accept,
|
|
369
365
|
action: action,
|
|
370
366
|
beforeUpload: this.beforeUpload,
|
|
@@ -381,28 +377,25 @@ var KyUpload = function (_React$Component) {
|
|
|
381
377
|
},
|
|
382
378
|
uploadButton,
|
|
383
379
|
_react2.default.createElement(
|
|
384
|
-
|
|
380
|
+
'p',
|
|
385
381
|
{
|
|
386
|
-
className:
|
|
387
|
-
style: { display: this.props.hideTips ?
|
|
382
|
+
className: 'kyUpload-hint',
|
|
383
|
+
style: { display: this.props.hideTips ? 'none' : 'block' }
|
|
388
384
|
},
|
|
389
385
|
this.props.tips
|
|
390
386
|
)
|
|
391
387
|
),
|
|
392
388
|
templateList.map(function (item) {
|
|
393
389
|
return _react2.default.createElement(
|
|
394
|
-
|
|
395
|
-
{
|
|
396
|
-
key: item.uuid,
|
|
397
|
-
href: downloadPrefix + "?attachmentId=" + item.uuid
|
|
398
|
-
},
|
|
390
|
+
'a',
|
|
391
|
+
{ key: item.uuid, href: downloadPrefix + '?attachmentId=' + item.uuid },
|
|
399
392
|
item.name
|
|
400
393
|
);
|
|
401
394
|
}),
|
|
402
395
|
this.state.spinLoading && _react2.default.createElement(_spin2.default, null)
|
|
403
396
|
) : _react2.default.createElement(_upload2.default, {
|
|
404
|
-
className: fileView ?
|
|
405
|
-
name:
|
|
397
|
+
className: fileView ? 'file-view' : '',
|
|
398
|
+
name: 'file',
|
|
406
399
|
accept: accept,
|
|
407
400
|
action: action,
|
|
408
401
|
beforeUpload: this.beforeUpload,
|
|
@@ -426,12 +419,12 @@ var KyUpload = function (_React$Component) {
|
|
|
426
419
|
_react2.default.createElement(
|
|
427
420
|
_KyModal2.default,
|
|
428
421
|
{
|
|
429
|
-
ref:
|
|
430
|
-
title:
|
|
422
|
+
ref: 'kyModal',
|
|
423
|
+
title: '\u9644\u4EF6\u9884\u89C8',
|
|
431
424
|
maxSize: true,
|
|
432
425
|
footer: [{
|
|
433
|
-
text:
|
|
434
|
-
type:
|
|
426
|
+
text: '关闭',
|
|
427
|
+
type: 'default',
|
|
435
428
|
onClick: function onClick() {
|
|
436
429
|
_this4.refs.kyModal.close();
|
|
437
430
|
}
|
|
@@ -446,9 +439,9 @@ var KyUpload = function (_React$Component) {
|
|
|
446
439
|
})
|
|
447
440
|
),
|
|
448
441
|
_react2.default.createElement(
|
|
449
|
-
|
|
450
|
-
{ jsx:
|
|
451
|
-
|
|
442
|
+
'style',
|
|
443
|
+
{ jsx: 'true', global: 'true' },
|
|
444
|
+
'\n .ant-upload-list-picture .ant-upload-list-item-name,\n .ant-upload-list-picture-card .ant-upload-list-item-name {\n color: #40a9ff;\n cursor: pointer;\n }\n // .ant-upload-list-item-info svg {\n // display: none;\n // }\n '
|
|
452
445
|
)
|
|
453
446
|
);
|
|
454
447
|
}
|
|
@@ -459,21 +452,21 @@ var KyUpload = function (_React$Component) {
|
|
|
459
452
|
KyUpload.defaultProps = {
|
|
460
453
|
multiple: false, //是否支持上传多个文件,默认false
|
|
461
454
|
// fileList:[],//设置默认上传的内容,格式:[{uuid:'附件文档库的标志',name:'文件名称'}],只有uploadType为file(文档库)模式的时候才能使用此功能
|
|
462
|
-
uploadType:
|
|
455
|
+
uploadType: 'file', //文件上传方式,file:文档库,redis:Redis缓存,如果是需要永久上传请使用文档库,如果只是暂存,建议使用redis缓存
|
|
463
456
|
redisData: 30, //缓存时间,单位:分钟,设置缓存时间,意思是超过这个时间就会删除这个缓存信息
|
|
464
457
|
fileCountLimit: 10, //上传文件个数限制
|
|
465
458
|
fileTypeLimit: undefined, //上传文件格式限制
|
|
466
459
|
disabled: false, //是否禁用
|
|
467
460
|
onChange: undefined, //值改变事件,参数:resultStr,resultList
|
|
468
461
|
maxFileSize: 20, //默认上传最大大小限制20MB,
|
|
469
|
-
sizeWord:
|
|
470
|
-
serviceMark:
|
|
471
|
-
moduleName:
|
|
472
|
-
value:
|
|
473
|
-
describe:
|
|
474
|
-
fileMainName:
|
|
462
|
+
sizeWord: 'M', //大小单位,默认为M
|
|
463
|
+
serviceMark: 'ly-ky', //服务标志,说明是属于哪个服务
|
|
464
|
+
moduleName: '科研系统', //模块名称,说明是属于哪个服务的哪个模块
|
|
465
|
+
value: '', //附件主表id
|
|
466
|
+
describe: '', //描述,对上传的附件的一个描述信息
|
|
467
|
+
fileMainName: '', //附件主表名,存储该附件对应的主表的名称,主要是为了以后进行追溯
|
|
475
468
|
isEdit: true, //是否可以编辑,默认为true,查看模式必须传value
|
|
476
|
-
listType:
|
|
469
|
+
listType: 'text', //上传列表的内建样式,基本样式 text, picture,picture-card
|
|
477
470
|
compressThreshold: 5, //压缩的阈值,图片大小超过5M,则需要进行压缩
|
|
478
471
|
isPictureCompress: false, //是否开启图片压缩
|
|
479
472
|
pictureQuality: 0.92, //指定压缩的图片质量,取值范围为0~1,quality值越小,图像越模糊,默认图片质量为0.92
|
|
@@ -482,10 +475,10 @@ KyUpload.defaultProps = {
|
|
|
482
475
|
image: false, //listType为picture-card才能使用true
|
|
483
476
|
disableDelete: false, // 是否隐藏删除按钮,默认为false
|
|
484
477
|
hideTips: true, //默认隐藏附件上传提示语
|
|
485
|
-
tips:
|
|
478
|
+
tips: '附件上传提示语',
|
|
486
479
|
kkFileView: true, //默认使用新版预览方式
|
|
487
480
|
fileView: true, //组件为不可编辑模式下,listType为picture-card,非图片文件默认支持预览
|
|
488
|
-
xtglUrl:
|
|
481
|
+
xtglUrl: ''
|
|
489
482
|
};
|
|
490
483
|
|
|
491
484
|
var _initialiseProps = function _initialiseProps() {
|
|
@@ -493,12 +486,12 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
493
486
|
|
|
494
487
|
this.handleFileList = function (propsfileList) {
|
|
495
488
|
var initFielList = propsfileList;
|
|
496
|
-
if (typeof propsfileList ===
|
|
489
|
+
if (typeof propsfileList === 'string') {
|
|
497
490
|
initFielList = [];
|
|
498
|
-
propsfileList.split(
|
|
491
|
+
propsfileList.split(',').map(function (item) {
|
|
499
492
|
initFielList.push({
|
|
500
|
-
uuid: item.split(
|
|
501
|
-
name: item.split(
|
|
493
|
+
uuid: item.split(';')[0],
|
|
494
|
+
name: item.split(';')[1]
|
|
502
495
|
});
|
|
503
496
|
return item;
|
|
504
497
|
});
|
|
@@ -510,7 +503,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
510
503
|
uuidList.push(item.uuid);
|
|
511
504
|
});
|
|
512
505
|
}
|
|
513
|
-
var img = [
|
|
506
|
+
var img = ['png', 'jpeg', 'jpg', 'gif', 'bmp'];
|
|
514
507
|
initFielList.map(function (item, index) {
|
|
515
508
|
if (uuidList.indexOf(item.uuid) === -1) {
|
|
516
509
|
if (!_this5.checkIsImage(item.name)) {
|
|
@@ -518,8 +511,8 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
518
511
|
uuid: item.uuid,
|
|
519
512
|
uid: item.uuid,
|
|
520
513
|
name: item.name,
|
|
521
|
-
status:
|
|
522
|
-
reponse:
|
|
514
|
+
status: 'done',
|
|
515
|
+
reponse: 'Server Error 500' // custom error message to show
|
|
523
516
|
// url: 'api/docrepo/download/file?attachmentId='+item.uuid,
|
|
524
517
|
});
|
|
525
518
|
return item;
|
|
@@ -528,9 +521,9 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
528
521
|
uuid: item.uuid,
|
|
529
522
|
uid: item.uuid,
|
|
530
523
|
name: item.name,
|
|
531
|
-
status:
|
|
532
|
-
reponse:
|
|
533
|
-
url:
|
|
524
|
+
status: 'done',
|
|
525
|
+
reponse: 'Server Error 500', // custom error message to show
|
|
526
|
+
url: 'zuul/docrepo/download/file?attachmentId=' + item.uuid
|
|
534
527
|
});
|
|
535
528
|
return item;
|
|
536
529
|
}
|
|
@@ -560,14 +553,14 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
560
553
|
|
|
561
554
|
this.beforeUpload = function (file, fileList) {
|
|
562
555
|
var suffixMap = {
|
|
563
|
-
word: [
|
|
564
|
-
exce: [
|
|
565
|
-
img: [
|
|
556
|
+
word: ['.doc', '.docx'],
|
|
557
|
+
exce: ['.xls', '.xlsx'],
|
|
558
|
+
img: ['.png', '.jpeg', '.jpg', '.gif', '.bmp']
|
|
566
559
|
};
|
|
567
|
-
var executable = [
|
|
560
|
+
var executable = ['.exe', '.sys', '.com', '.bat', '.jsp', '.asp', '.php', '.aspx', '.asa', '.asax', '.asmx', '.ashx', '.ascx', '.pif', '.acf', '.arj', '.swg', '.swf', '.svx', '.dos'];
|
|
568
561
|
//文件格式的限制
|
|
569
562
|
if (_this5.checkIsRun(file.name, executable)) {
|
|
570
|
-
_message3.default.info(
|
|
563
|
+
_message3.default.info('不允许上传可执行的文件!');
|
|
571
564
|
return false;
|
|
572
565
|
} else {
|
|
573
566
|
if (_this5.props.fileTypeLimit && _this5.props.fileTypeLimit.length > 0) {
|
|
@@ -582,19 +575,19 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
582
575
|
}
|
|
583
576
|
}
|
|
584
577
|
if (!_this5.checkTypeLimit(file.name, fileTypeLimit)) {
|
|
585
|
-
_message3.default.info(
|
|
578
|
+
_message3.default.info('只能上传后缀为[' + fileTypeLimit.join(',') + ']格式的文件!');
|
|
586
579
|
return false;
|
|
587
580
|
}
|
|
588
581
|
}
|
|
589
582
|
}
|
|
590
583
|
if (_this5.props.image && !_this5.checkIsImage(file.name)) {
|
|
591
|
-
_message3.default.info(
|
|
584
|
+
_message3.default.info('只能上传图片类型');
|
|
592
585
|
return false;
|
|
593
586
|
}
|
|
594
587
|
//文件上传数量限制
|
|
595
588
|
var fileCountLimit = !_this5.props.multiple ? 1 : _this5.props.fileCountLimit;
|
|
596
589
|
if (fileCountLimit && fileCountLimit <= _this5.state.fileList.length) {
|
|
597
|
-
_message3.default.info(
|
|
590
|
+
_message3.default.info('最多只能上传' + fileCountLimit + '个文件!');
|
|
598
591
|
return false;
|
|
599
592
|
}
|
|
600
593
|
|
|
@@ -603,10 +596,10 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
603
596
|
_props4$maxFileSize = _props4.maxFileSize,
|
|
604
597
|
maxFileSize = _props4$maxFileSize === undefined ? 20 : _props4$maxFileSize,
|
|
605
598
|
_props4$sizeWord = _props4.sizeWord,
|
|
606
|
-
sizeWord = _props4$sizeWord === undefined ?
|
|
599
|
+
sizeWord = _props4$sizeWord === undefined ? 'M' : _props4$sizeWord;
|
|
607
600
|
|
|
608
601
|
var isOverSize = false;
|
|
609
|
-
if (sizeWord.toLocaleLowerCase() ===
|
|
602
|
+
if (sizeWord.toLocaleLowerCase() === 'kb') {
|
|
610
603
|
// 若单位为kb则按kb的比较
|
|
611
604
|
var fileSize = file.size / 1024;
|
|
612
605
|
isOverSize = fileSize > maxFileSize;
|
|
@@ -616,7 +609,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
616
609
|
}
|
|
617
610
|
|
|
618
611
|
if (isOverSize) {
|
|
619
|
-
var msg =
|
|
612
|
+
var msg = '抱歉,上传文件大小最大不能超过' + maxFileSize + sizeWord + '!';
|
|
620
613
|
_message3.default.error(msg);
|
|
621
614
|
return !isOverSize;
|
|
622
615
|
}
|
|
@@ -643,7 +636,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
643
636
|
//当开启图片压缩且图片大小大于等于压缩阈值,进行压缩
|
|
644
637
|
if (fileSize >= compressThreshold && isPictureCompress) {
|
|
645
638
|
//判断浏览器内核是否支持base64图片压缩
|
|
646
|
-
if (typeof FileReader ===
|
|
639
|
+
if (typeof FileReader === 'undefined') {
|
|
647
640
|
return file;
|
|
648
641
|
} else {
|
|
649
642
|
try {
|
|
@@ -656,12 +649,12 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
656
649
|
reader.readAsDataURL(file);
|
|
657
650
|
reader.onload = function () {
|
|
658
651
|
// 生成canvas画布
|
|
659
|
-
var canvas = document.createElement(
|
|
652
|
+
var canvas = document.createElement('canvas');
|
|
660
653
|
// 生成img
|
|
661
|
-
var img = document.createElement(
|
|
654
|
+
var img = document.createElement('img');
|
|
662
655
|
img.src = reader.result;
|
|
663
656
|
img.onload = function () {
|
|
664
|
-
var ctx = canvas.getContext(
|
|
657
|
+
var ctx = canvas.getContext('2d');
|
|
665
658
|
//原始图片宽度、高度
|
|
666
659
|
var originImageWidth = img.width,
|
|
667
660
|
originImageHeight = img.height;
|
|
@@ -693,18 +686,18 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
693
686
|
// 绘制图片
|
|
694
687
|
ctx.drawImage(img, 0, 0, targetWidth, targetHeight);
|
|
695
688
|
// quality值越小,图像越模糊,默认图片质量为0.92
|
|
696
|
-
var imageDataURL = canvas.toDataURL(file.type ||
|
|
689
|
+
var imageDataURL = canvas.toDataURL(file.type || 'image/jpeg', pictureQuality);
|
|
697
690
|
// 去掉URL的头,并转换为byte
|
|
698
|
-
var imageBytes = window.atob(imageDataURL.split(
|
|
691
|
+
var imageBytes = window.atob(imageDataURL.split(',')[1]);
|
|
699
692
|
// 处理异常,将ascii码小于0的转换为大于0
|
|
700
693
|
var arrayBuffer = new ArrayBuffer(imageBytes.length);
|
|
701
694
|
var uint8Array = new Uint8Array(arrayBuffer);
|
|
702
695
|
for (var i = 0; i < imageBytes.length; i++) {
|
|
703
696
|
uint8Array[i] = imageBytes.charCodeAt(i);
|
|
704
697
|
}
|
|
705
|
-
var mimeType = imageDataURL.split(
|
|
698
|
+
var mimeType = imageDataURL.split(',')[0].match(/:(.*?);/)[1];
|
|
706
699
|
var newFile = new File([uint8Array], file.name, {
|
|
707
|
-
type: mimeType ||
|
|
700
|
+
type: mimeType || 'image/jpeg'
|
|
708
701
|
});
|
|
709
702
|
// console.log('after compress, the file size is : ', (newFile.size / 1024 / 1024) + "M");
|
|
710
703
|
resolve(newFile);
|
|
@@ -747,7 +740,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
747
740
|
|
|
748
741
|
this.checkIsImage = function (fileName) {
|
|
749
742
|
var flag = void 0;
|
|
750
|
-
var imageTypeList = [
|
|
743
|
+
var imageTypeList = ['.jpg', '.png', '.jpeg', '.gif', '.GIF', '.JPG', '.PNG', '.JPEG'];
|
|
751
744
|
var _iteratorNormalCompletion = true;
|
|
752
745
|
var _didIteratorError = false;
|
|
753
746
|
var _iteratorError = undefined;
|
|
@@ -800,9 +793,9 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
800
793
|
cjsid: (0, _index.getLoginUser)().userId
|
|
801
794
|
};
|
|
802
795
|
if (defaultEffective) {
|
|
803
|
-
param.ztm =
|
|
796
|
+
param.ztm = '1';
|
|
804
797
|
}
|
|
805
|
-
(0, _index.NHFetch)(_this5.state.xtglUrl +
|
|
798
|
+
(0, _index.NHFetch)(_this5.state.xtglUrl + '/dynamic/insert', 'POST', param).then(function (res) {
|
|
806
799
|
if (res && res.code === 200) {
|
|
807
800
|
// 插入主表成功后 去掉将size设置为false,size存在应该为上传阶段的,若存在则未成功保存到接口,getResult时将去掉当前数据
|
|
808
801
|
fileList.map(function (item) {
|
|
@@ -818,7 +811,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
818
811
|
}
|
|
819
812
|
});
|
|
820
813
|
_this5.setState({ fileList: fileList });
|
|
821
|
-
_message3.default.error(
|
|
814
|
+
_message3.default.error('附件上传失败!');
|
|
822
815
|
}
|
|
823
816
|
}).catch(function () {
|
|
824
817
|
fileList.map(function (item, key) {
|
|
@@ -832,10 +825,10 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
832
825
|
|
|
833
826
|
this.handleChange = function (e) {
|
|
834
827
|
var fileList = e.fileList;
|
|
835
|
-
if (e.file.status ===
|
|
828
|
+
if (e.file.status === 'done') {
|
|
836
829
|
//上传链接调用成功
|
|
837
830
|
var response = e.file.response;
|
|
838
|
-
if (_this5.props.uploadType ===
|
|
831
|
+
if (_this5.props.uploadType === 'file') {
|
|
839
832
|
//上传到文档库中
|
|
840
833
|
if (response.meta && response.meta.statusCode === 200) {
|
|
841
834
|
//导出成功
|
|
@@ -847,7 +840,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
847
840
|
});
|
|
848
841
|
_this5.handleMasterTable(e, fileList);
|
|
849
842
|
} else {
|
|
850
|
-
_message3.default.error(
|
|
843
|
+
_message3.default.error('文件上传失败,请重新上传!');
|
|
851
844
|
fileList = _this5.filterCurrentFile(e.fileList, e.file);
|
|
852
845
|
}
|
|
853
846
|
} else {
|
|
@@ -861,27 +854,27 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
861
854
|
});
|
|
862
855
|
_this5.getResult(fileList);
|
|
863
856
|
} else {
|
|
864
|
-
_message3.default.error(
|
|
857
|
+
_message3.default.error('文件上传失败,请重新上传!');
|
|
865
858
|
fileList = _this5.filterCurrentFile(e.fileList, e.file);
|
|
866
859
|
}
|
|
867
860
|
}
|
|
868
|
-
} else if (e.file.status ===
|
|
861
|
+
} else if (e.file.status === 'uploading') {
|
|
869
862
|
//上传中,此时不需要做处理
|
|
870
863
|
_this5.setState({
|
|
871
864
|
// loading: true,
|
|
872
865
|
fileList: fileList
|
|
873
866
|
});
|
|
874
|
-
} else if (e.file.status ===
|
|
867
|
+
} else if (e.file.status === 'error') {
|
|
875
868
|
//上传错误
|
|
876
|
-
_message3.default.error(
|
|
869
|
+
_message3.default.error('文件由于未知原因失败,请重新上传!');
|
|
877
870
|
fileList = _this5.filterCurrentFile(e.fileList, e.file);
|
|
878
|
-
} else if (e.file.status ===
|
|
871
|
+
} else if (e.file.status === 'removed') {
|
|
879
872
|
//删除
|
|
880
|
-
(0, _index.NHFetch)(_this5.state.xtglUrl +
|
|
873
|
+
(0, _index.NHFetch)(_this5.state.xtglUrl + '/dynamic/updateDel', 'POST', { fjid: e.file.uid }).then(function (res) {
|
|
881
874
|
if (res && res.code === 200) {
|
|
882
875
|
_this5.getResult(fileList);
|
|
883
876
|
} else {
|
|
884
|
-
_message3.default.error(
|
|
877
|
+
_message3.default.error('附件上传失败!');
|
|
885
878
|
fileList = _this5.filterCurrentFile(e.fileList, e.file);
|
|
886
879
|
}
|
|
887
880
|
});
|
|
@@ -900,8 +893,8 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
900
893
|
};
|
|
901
894
|
|
|
902
895
|
this.requestData = function () {
|
|
903
|
-
if (_this5.props.uploadType ===
|
|
904
|
-
return { uuid: (0, _index.createUuid)(), type:
|
|
896
|
+
if (_this5.props.uploadType === 'file') {
|
|
897
|
+
return { uuid: (0, _index.createUuid)(), type: '1' };
|
|
905
898
|
} else {
|
|
906
899
|
return { redisData: _this5.props.redisData };
|
|
907
900
|
}
|
|
@@ -912,20 +905,20 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
912
905
|
if (fileList.length > 0) {
|
|
913
906
|
fileList.map(function (item) {
|
|
914
907
|
if (item.response && item.response.meta && item.response.meta.statusCode === 200) {
|
|
915
|
-
var img = [
|
|
916
|
-
var fileNameSplitArry = item.name.split(
|
|
908
|
+
var img = ['png', 'jpeg', 'jpg', 'gif', 'bmp'];
|
|
909
|
+
var fileNameSplitArry = item.name.split('.');
|
|
917
910
|
if (img.indexOf(img.indexOf(fileNameSplitArry[fileNameSplitArry.length - 1]) === -1)) {
|
|
918
911
|
item.uuid = item.response.data.ssbh;
|
|
919
912
|
item.uid = item.response.data.ssbh;
|
|
920
913
|
// item.name = item.name;
|
|
921
|
-
item.reponse =
|
|
914
|
+
item.reponse = 'Server Error 500'; // custom error message to show
|
|
922
915
|
// item.url = 'api/docrepo/download/file?attachmentId='+item.response.data.ssbh;
|
|
923
916
|
} else {
|
|
924
917
|
item.uuid = item.response.data.ssbh;
|
|
925
918
|
item.uid = item.response.data.ssbh;
|
|
926
919
|
// item.name = item.name;
|
|
927
|
-
item.reponse =
|
|
928
|
-
item.url =
|
|
920
|
+
item.reponse = 'Server Error 500'; // custom error message to show
|
|
921
|
+
item.url = 'api/docrepo/download/file?attachmentId=' + item.response.data.ssbh;
|
|
929
922
|
}
|
|
930
923
|
}
|
|
931
924
|
});
|
|
@@ -934,7 +927,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
934
927
|
};
|
|
935
928
|
|
|
936
929
|
this.getResult = function (fileList) {
|
|
937
|
-
if (_this5.props.uploadType ===
|
|
930
|
+
if (_this5.props.uploadType === 'file') {
|
|
938
931
|
var list = [];
|
|
939
932
|
var listMap = [];
|
|
940
933
|
fileList.map(function (item, index) {
|
|
@@ -962,14 +955,14 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
962
955
|
}
|
|
963
956
|
}
|
|
964
957
|
} else {
|
|
965
|
-
var resultStr =
|
|
958
|
+
var resultStr = '';
|
|
966
959
|
var resultList = [];
|
|
967
960
|
fileList.map(function (file) {
|
|
968
961
|
resultList.push({
|
|
969
962
|
uuid: file.uuid,
|
|
970
963
|
name: file.name
|
|
971
964
|
});
|
|
972
|
-
resultStr +=
|
|
965
|
+
resultStr += ',' + file.uuid + ';' + file.name;
|
|
973
966
|
return file;
|
|
974
967
|
});
|
|
975
968
|
_this5.setState({ fileList: fileList });
|
|
@@ -988,10 +981,10 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
988
981
|
while (1) {
|
|
989
982
|
switch (_context2.prev = _context2.next) {
|
|
990
983
|
case 0:
|
|
991
|
-
window.open(
|
|
984
|
+
window.open('zuul/docrepo/download/file?attachmentId=' + file.uid);
|
|
992
985
|
|
|
993
986
|
case 1:
|
|
994
|
-
case
|
|
987
|
+
case 'end':
|
|
995
988
|
return _context2.stop();
|
|
996
989
|
}
|
|
997
990
|
}
|
|
@@ -1031,7 +1024,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1031
1024
|
break;
|
|
1032
1025
|
|
|
1033
1026
|
case 8:
|
|
1034
|
-
file.preUrl =
|
|
1027
|
+
file.preUrl = 'zuul/docrepo/download/file?attachmentId=' + file.uid;
|
|
1035
1028
|
|
|
1036
1029
|
case 9:
|
|
1037
1030
|
_context3.next = 14;
|
|
@@ -1039,16 +1032,16 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1039
1032
|
|
|
1040
1033
|
case 11:
|
|
1041
1034
|
_context3.prev = 11;
|
|
1042
|
-
_context3.t0 = _context3[
|
|
1035
|
+
_context3.t0 = _context3['catch'](1);
|
|
1043
1036
|
|
|
1044
1037
|
console.log(_context3.t0);
|
|
1045
1038
|
|
|
1046
1039
|
case 14:
|
|
1047
|
-
name = file.name.split(
|
|
1040
|
+
name = file.name.split('.')[1];
|
|
1048
1041
|
previewFile = file.url || file.preview || file.preUrl;
|
|
1049
|
-
imageListType = [
|
|
1042
|
+
imageListType = ['png', 'jpeg', 'jpg', 'gif', 'bmp']; //图片格式
|
|
1050
1043
|
|
|
1051
|
-
fileListType = [
|
|
1044
|
+
fileListType = ['doc', 'xls', 'ppt', 'pptx', 'vsd', 'mpp']; //file文档
|
|
1052
1045
|
|
|
1053
1046
|
imageVisible = imageListType.includes(name); //判断是否预览图片文件
|
|
1054
1047
|
|
|
@@ -1060,18 +1053,18 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1060
1053
|
KY_FJYLBZ = _state2.KY_FJYLBZ;
|
|
1061
1054
|
// 使用新版附件预览服务
|
|
1062
1055
|
|
|
1063
|
-
var originUrl = KY_FJFWBZ +
|
|
1064
|
-
var index = file.name.lastIndexOf(
|
|
1056
|
+
var originUrl = KY_FJFWBZ + '/zuul/docrepo/download/file?attachmentId=' + file.uid; //要预览文件的访问地址
|
|
1057
|
+
var index = file.name.lastIndexOf('.');
|
|
1065
1058
|
var _name = file.name;
|
|
1066
1059
|
if (index > -1) {
|
|
1067
1060
|
var firstName = file.name.substring(0, index);
|
|
1068
1061
|
var lastName = file.name.substring(index);
|
|
1069
1062
|
var size = file.uid.length;
|
|
1070
|
-
_name = firstName +
|
|
1063
|
+
_name = firstName + '_' + file.uid.substring(size - 4) + lastName;
|
|
1071
1064
|
}
|
|
1072
1065
|
|
|
1073
|
-
var previewUrl = originUrl +
|
|
1074
|
-
window.open(KY_FJYLBZ +
|
|
1066
|
+
var previewUrl = originUrl + '&fullfilename=/' + _name;
|
|
1067
|
+
window.open(KY_FJYLBZ + '/onlinePreview?url=' + encodeURIComponent((0, _base.encode)(previewUrl)));
|
|
1075
1068
|
} else {
|
|
1076
1069
|
//旧版-预览非图片格式
|
|
1077
1070
|
if (fileListType.includes(name)) {
|
|
@@ -1086,7 +1079,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1086
1079
|
});
|
|
1087
1080
|
|
|
1088
1081
|
case 20:
|
|
1089
|
-
case
|
|
1082
|
+
case 'end':
|
|
1090
1083
|
return _context3.stop();
|
|
1091
1084
|
}
|
|
1092
1085
|
}
|
|
@@ -1099,16 +1092,16 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1099
1092
|
}();
|
|
1100
1093
|
|
|
1101
1094
|
this.previewAttachment = function (uid, name) {
|
|
1102
|
-
var previewUrl = name ===
|
|
1095
|
+
var previewUrl = name === 'pdf' ? previewPdfUrl : previewOfficeUrl;
|
|
1103
1096
|
var _window$location = window.location,
|
|
1104
1097
|
origin = _window$location.origin,
|
|
1105
1098
|
pathname = _window$location.pathname;
|
|
1106
1099
|
|
|
1107
|
-
var url = origin + pathname + previewUrl + (
|
|
1100
|
+
var url = origin + pathname + previewUrl + ('?attachmentId=' + uid);
|
|
1108
1101
|
if (window.POBrowser) {
|
|
1109
|
-
window.POBrowser.openWindowModeless(url,
|
|
1102
|
+
window.POBrowser.openWindowModeless(url, 'width=1200px;height=850px;');
|
|
1110
1103
|
} else {
|
|
1111
|
-
_message3.default.error(
|
|
1104
|
+
_message3.default.error('pageoffice错误,请检查服务是否正常启动!');
|
|
1112
1105
|
}
|
|
1113
1106
|
};
|
|
1114
1107
|
|
|
@@ -1125,10 +1118,10 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1125
1118
|
//templateId: 附件表原有的附件Id,即新增附件记录时,在原有的附件基础上进行修改、添加,可不用该字段
|
|
1126
1119
|
//templateId: "3ab374b70f88704ef209b9e02eb6ecc4130d"
|
|
1127
1120
|
if (window.POBrowser) {
|
|
1128
|
-
var url = window.location.origin + window.location.pathname + docUrl +
|
|
1129
|
-
window.POBrowser.openWindowModeless(url,
|
|
1121
|
+
var url = window.location.origin + window.location.pathname + docUrl + '?docId=' + docId + '&openType=' + openType;
|
|
1122
|
+
window.POBrowser.openWindowModeless(url, 'width=1200px;height=850px;');
|
|
1130
1123
|
} else {
|
|
1131
|
-
_message3.default.error(
|
|
1124
|
+
_message3.default.error('pageoffice错误,请检查服务是否正常启动!');
|
|
1132
1125
|
}
|
|
1133
1126
|
};
|
|
1134
1127
|
|
|
@@ -1139,10 +1132,10 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
1139
1132
|
this.imgTrunDeg = function (direction) {
|
|
1140
1133
|
var rotateDeg = _this5.state.rotateDeg;
|
|
1141
1134
|
|
|
1142
|
-
if (direction ==
|
|
1135
|
+
if (direction == 'left') {
|
|
1143
1136
|
rotateDeg -= 90;
|
|
1144
1137
|
}
|
|
1145
|
-
if (direction ==
|
|
1138
|
+
if (direction == 'right') {
|
|
1146
1139
|
rotateDeg += 90;
|
|
1147
1140
|
}
|
|
1148
1141
|
_this5.setState({
|