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