fmui-base 2.2.51 → 2.2.53
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
CHANGED
package/lib/form/form.js
CHANGED
|
@@ -97,6 +97,10 @@ var _invoice = require('../invoice/invoice');
|
|
|
97
97
|
|
|
98
98
|
var _invoice2 = _interopRequireDefault(_invoice);
|
|
99
99
|
|
|
100
|
+
var _sign = require('../signature/sign');
|
|
101
|
+
|
|
102
|
+
var _sign2 = _interopRequireDefault(_sign);
|
|
103
|
+
|
|
100
104
|
require('./form.less');
|
|
101
105
|
|
|
102
106
|
var _db = require('../db/db');
|
|
@@ -919,6 +923,10 @@ var PageHome = function (_React$Component) {
|
|
|
919
923
|
}
|
|
920
924
|
} else if (itemType == 'datetime') {
|
|
921
925
|
//时间
|
|
926
|
+
if (fuzhiFields && fuzhiFields.split(",").indexOf(itemParam.uniqueName) != -1 && form.defaultValue && form.defaultValue != null) {
|
|
927
|
+
value = form.defaultValue;
|
|
928
|
+
}
|
|
929
|
+
|
|
922
930
|
if (value) {
|
|
923
931
|
if (value.length == 10) {
|
|
924
932
|
isVerifySingValue = value + " 00:00:00";
|
|
@@ -1122,10 +1130,13 @@ var PageHome = function (_React$Component) {
|
|
|
1122
1130
|
var uploadFileNumLimit = "";
|
|
1123
1131
|
var uploadFileLimit = "";
|
|
1124
1132
|
var canDownload = "";
|
|
1133
|
+
var imagetype = ""; // 0 图片上传 1 手写签名
|
|
1134
|
+
|
|
1125
1135
|
if (formDataAttr) {
|
|
1126
1136
|
uploadFileNumLimit = formDataAttr.uploadFileNumLimit; //上传个数限制
|
|
1127
1137
|
uploadFileLimit = formDataAttr.uploadFileLimit; //上传类型限制
|
|
1128
1138
|
canDownload = formDataAttr.canDownload; //是否下载
|
|
1139
|
+
imagetype = formDataAttr.imagetype; // 0 图片上传 1 手写签名
|
|
1129
1140
|
}
|
|
1130
1141
|
if (value) {
|
|
1131
1142
|
value = value.replace(/\|/g, ",");
|
|
@@ -1150,6 +1161,8 @@ var PageHome = function (_React$Component) {
|
|
|
1150
1161
|
} else {
|
|
1151
1162
|
itemParam.canDownload = "0";
|
|
1152
1163
|
}
|
|
1164
|
+
itemParam.imagetype = imagetype;
|
|
1165
|
+
console.log("imagetype===" + imagetype);
|
|
1153
1166
|
} else if (itemType == 'poppage') {
|
|
1154
1167
|
//弹出选择
|
|
1155
1168
|
|
|
@@ -1466,7 +1479,7 @@ var PageHome = function (_React$Component) {
|
|
|
1466
1479
|
this.refs['selectMember_' + key].initSelectData();
|
|
1467
1480
|
}
|
|
1468
1481
|
}
|
|
1469
|
-
if (itemType == 'upload' || itemType == 'image' || itemType == 'weboffice') {
|
|
1482
|
+
if (itemType == 'upload' || itemType == 'image' && itemParam.imagetype != '1' || itemType == 'weboffice') {
|
|
1470
1483
|
this.refs["upload_" + t.state.itemParam.tableName + "_" + t.state.itemParam.key].initData();
|
|
1471
1484
|
}
|
|
1472
1485
|
if (itemType == 'note') {
|
|
@@ -3635,6 +3648,33 @@ var PageHome = function (_React$Component) {
|
|
|
3635
3648
|
t.state.itemParam.isVerifySing == "1" ? _react2.default.createElement('i', { className: 'iconfont icon-checked t-PT10', style: { color: 'green' } }) : t.state.itemParam.isVerifySing == "2" ? _react2.default.createElement('i', { className: 'iconfont icon-close t-PT10', style: { color: 'red' } }) : ""
|
|
3636
3649
|
)
|
|
3637
3650
|
)
|
|
3651
|
+
) : this.state.itemParam.itemType == 'image' && this.state.itemParam.imagetype == '1' ? _react2.default.createElement(
|
|
3652
|
+
'div',
|
|
3653
|
+
{ className: t.state.itemParam.fieldId, style: t.state.itemParam.formStyleObj.contentStyle },
|
|
3654
|
+
_react2.default.createElement(
|
|
3655
|
+
_Group2.default.List,
|
|
3656
|
+
{ borderTopNone: true },
|
|
3657
|
+
_react2.default.createElement(
|
|
3658
|
+
'div',
|
|
3659
|
+
{ className: 't-W100', id: t.state.prefixName + "_" + t.state.itemParam.key },
|
|
3660
|
+
_react2.default.createElement(
|
|
3661
|
+
_Field2.default,
|
|
3662
|
+
{ label: t.state.itemParam.title, required: t.state.itemParam.required, layout: 'h', multiLine: true },
|
|
3663
|
+
_react2.default.createElement(_sign2.default, {
|
|
3664
|
+
ref: "upload_" + t.state.itemParam.tableName + "_" + t.state.itemParam.key,
|
|
3665
|
+
fileId: t.state.itemParam.initIds,
|
|
3666
|
+
readOnly: t.state.itemParam.readOnly,
|
|
3667
|
+
dir: t.state.module,
|
|
3668
|
+
uploadType: 'image',
|
|
3669
|
+
title: '\u624B\u5199\u7B7E\u6279',
|
|
3670
|
+
onChange: function onChange(value) {
|
|
3671
|
+
t.handleChangePic(t.state.itemParam.key, value);
|
|
3672
|
+
}
|
|
3673
|
+
})
|
|
3674
|
+
),
|
|
3675
|
+
t.state.itemParam.isVerifySing == "1" ? _react2.default.createElement('i', { className: 'iconfont icon-checked t-PT10', style: { color: 'green' } }) : t.state.itemParam.isVerifySing == "2" ? _react2.default.createElement('i', { className: 'iconfont icon-close t-PT10', style: { color: 'red' } }) : ""
|
|
3676
|
+
)
|
|
3677
|
+
)
|
|
3638
3678
|
) : this.state.itemParam.itemType == 'image' ? _react2.default.createElement(
|
|
3639
3679
|
'div',
|
|
3640
3680
|
{ className: t.state.itemParam.fieldId, style: t.state.itemParam.formStyleObj.contentStyle },
|
package/lib/signature/sign.js
CHANGED
|
@@ -51,9 +51,10 @@ var Page = function (_React$Component) {
|
|
|
51
51
|
|
|
52
52
|
var _this = _possibleConstructorReturn(this, (Page.__proto__ || Object.getPrototypeOf(Page)).call(this, props));
|
|
53
53
|
|
|
54
|
-
var baseContext = document.getElementById(
|
|
55
|
-
var token =
|
|
54
|
+
var baseContext = document.getElementById("context").value;
|
|
55
|
+
var token = getLoginUserInfo().token;
|
|
56
56
|
var fileId = _this.props.fileId == null || _this.props.fileId == '' || _this.props.fileId == undefined ? "" : _this.props.fileId;
|
|
57
|
+
var readOnly = _this.props.readOnly || false;
|
|
57
58
|
_this.state = {
|
|
58
59
|
token: token,
|
|
59
60
|
draw: null,
|
|
@@ -61,7 +62,8 @@ var Page = function (_React$Component) {
|
|
|
61
62
|
baseContext: baseContext,
|
|
62
63
|
fileId: fileId,
|
|
63
64
|
disabled: true,
|
|
64
|
-
imageUrl: '/static/fmui/images/signArea.png'
|
|
65
|
+
imageUrl: '/static/fmui/images/signArea.png',
|
|
66
|
+
readOnly: readOnly
|
|
65
67
|
};
|
|
66
68
|
return _this;
|
|
67
69
|
}
|
|
@@ -91,10 +93,10 @@ var Page = function (_React$Component) {
|
|
|
91
93
|
value: function clear() {
|
|
92
94
|
|
|
93
95
|
var t = this;
|
|
94
|
-
var disabled = document.
|
|
96
|
+
var disabled = document.getElementsByClassName('clear_i')[0].getAttribute("disabled");
|
|
95
97
|
if (!disabled) {
|
|
96
|
-
document.getElementById('clear_i').removeAttribute("class");
|
|
97
|
-
document.getElementById('clear_i').setAttribute("class",
|
|
98
|
+
// document.getElementById('clear_i').removeAttribute("class");
|
|
99
|
+
// document.getElementById('clear_i').setAttribute("class",'iconfont icon-dele2 t-FS18 t-FCddfontblue-30');
|
|
98
100
|
document.getElementsByClassName('download_btn')[0].setAttribute("disabled", true);
|
|
99
101
|
document.getElementsByClassName('can-div')[0].removeAttribute("style");
|
|
100
102
|
document.getElementsByClassName('can-div')[0].setAttribute("style", "background:url(" + t.state.baseContext + t.state.imageUrl + ");background-size: 100% 100%;");
|
|
@@ -115,7 +117,7 @@ var Page = function (_React$Component) {
|
|
|
115
117
|
var date = new Date();
|
|
116
118
|
var time = date.getTime();
|
|
117
119
|
formData.append("file", t.state.draw.dataURLtoBlob(t.state.draw.getPNGImage()), time + ".png");
|
|
118
|
-
var url = t.state.baseContext + "/api/
|
|
120
|
+
var url = t.state.baseContext + "/api/m/plugin/attachment/mobile/createFile?token=" + t.state.token;
|
|
119
121
|
fetch(url, {
|
|
120
122
|
method: "POST",
|
|
121
123
|
body: formData
|
|
@@ -125,12 +127,16 @@ var Page = function (_React$Component) {
|
|
|
125
127
|
t.setState({
|
|
126
128
|
fileId: obj.data[0].id
|
|
127
129
|
});
|
|
128
|
-
t.props.
|
|
129
|
-
_Popup2.default.hide();
|
|
130
|
+
t.props.onChange(obj.data);
|
|
130
131
|
});
|
|
132
|
+
_Popup2.default.hide();
|
|
131
133
|
} else if (res.status == 401) {
|
|
132
134
|
alert("手写签名图片上传报错了");
|
|
135
|
+
} else {
|
|
136
|
+
alert("手写签名图片上传失败");
|
|
133
137
|
}
|
|
138
|
+
}).catch(function (error) {
|
|
139
|
+
alert("手写签名图片上传接口报错了");
|
|
134
140
|
});
|
|
135
141
|
}
|
|
136
142
|
|
|
@@ -188,22 +194,21 @@ var Page = function (_React$Component) {
|
|
|
188
194
|
canvasBox.style.width = width + "px";
|
|
189
195
|
canvasBox.style.height = height + "px";
|
|
190
196
|
canvasBox.style.transformOrigin = 'center center';
|
|
191
|
-
|
|
192
197
|
var can1 = document.getElementsByTagName('canvas')[0];
|
|
193
198
|
var divDom = document.getElementById("canvasBoxDiv");
|
|
194
199
|
var divWidth = divDom.clientWidth || divDom.offsetWidth;
|
|
195
200
|
var divHeigth = divDom.clientHeight || divDom.offsetHeight;
|
|
196
|
-
can1.style.width = divWidth -
|
|
201
|
+
can1.style.width = divWidth - 52 + "px";
|
|
197
202
|
can1.style.height = divHeigth - 5 + "px";
|
|
198
203
|
|
|
199
204
|
setTimeout(function () {
|
|
200
205
|
// document.getElementsByTagName('canvas')[0].style.border = '0.5px solid #ccc';
|
|
201
|
-
document.getElementsByTagName('canvas')[0].style.background = '
|
|
206
|
+
document.getElementsByTagName('canvas')[0].style.background = '#fff';
|
|
202
207
|
document.getElementsByClassName('download_btn')[0].setAttribute("disabled", true);
|
|
203
208
|
t.listenCanvas(document.getElementsByTagName('canvas')[0]);
|
|
204
209
|
//t-BCf
|
|
205
210
|
// document.getElementsByTagName('canvas')[0].class = 't-BCf t-ML16 t-MR16';
|
|
206
|
-
},
|
|
211
|
+
}, 120);
|
|
207
212
|
|
|
208
213
|
// $(can).addClass("aa");
|
|
209
214
|
}
|
|
@@ -211,9 +216,10 @@ var Page = function (_React$Component) {
|
|
|
211
216
|
key: 'listenCanvas',
|
|
212
217
|
value: function listenCanvas(cav) {
|
|
213
218
|
var t = this;
|
|
219
|
+
console.log("cav===" + cav);
|
|
214
220
|
cav.addEventListener('touchstart', function (e) {
|
|
215
|
-
document.getElementById('clear_i').removeAttribute("class");
|
|
216
|
-
document.getElementById('clear_i').setAttribute("class",
|
|
221
|
+
// document.getElementById('clear_i').removeAttribute("class");
|
|
222
|
+
// document.getElementById('clear_i').setAttribute("class",'iconfont icon-dele2 t-FS18 t-FCddfontblue-60');
|
|
217
223
|
document.getElementsByClassName('download_btn')[0].removeAttribute("disabled");
|
|
218
224
|
|
|
219
225
|
document.getElementsByClassName('can-div')[0].removeAttribute("style");
|
|
@@ -231,11 +237,11 @@ var Page = function (_React$Component) {
|
|
|
231
237
|
{ id: 'canvasBox', className: 't-BCf7' },
|
|
232
238
|
_react2.default.createElement(
|
|
233
239
|
'div',
|
|
234
|
-
{ className: 'greet t-P16 t-
|
|
240
|
+
{ className: 'greet t-P16 t-FAL t-PB12' },
|
|
235
241
|
_react2.default.createElement(
|
|
236
|
-
|
|
237
|
-
{
|
|
238
|
-
|
|
242
|
+
_Button2.default,
|
|
243
|
+
{ id: 'clear_i', className: 't-MR10 clear_i', type: 'danger', size: 'small', display: 'inline', onClick: t.clear.bind(t) },
|
|
244
|
+
'\u6E05\u9664'
|
|
239
245
|
),
|
|
240
246
|
_react2.default.createElement(
|
|
241
247
|
_Button2.default,
|
|
@@ -262,64 +268,7 @@ var Page = function (_React$Component) {
|
|
|
262
268
|
t.getHorizontalStyle();
|
|
263
269
|
t.initCanvas(0);
|
|
264
270
|
t.degree(90);
|
|
265
|
-
},
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
//弹出签名页面
|
|
269
|
-
|
|
270
|
-
}, {
|
|
271
|
-
key: 'popDraw',
|
|
272
|
-
value: function popDraw() {
|
|
273
|
-
|
|
274
|
-
var t = this;
|
|
275
|
-
var url = t.state.baseContext + "/client/system/freeLimit/featureCheck?token=" + t.state.token + "&feature=signaturePicture";
|
|
276
|
-
fetch(url, {
|
|
277
|
-
method: "GET",
|
|
278
|
-
mode: "cors",
|
|
279
|
-
headers: {
|
|
280
|
-
'Accept': 'application/json, text/plain, */*',
|
|
281
|
-
'Content-Type': 'application/x-www-form-urlencoded'
|
|
282
|
-
}
|
|
283
|
-
}).then(function (response) {
|
|
284
|
-
return response.json();
|
|
285
|
-
}).then(function (result) {
|
|
286
|
-
if (result.success) {
|
|
287
|
-
var content = result.content;
|
|
288
|
-
if (content.featureCheck) {
|
|
289
|
-
t.checkAfter();
|
|
290
|
-
} else {
|
|
291
|
-
if (content.isAdmin) {
|
|
292
|
-
_Dialog2.default.confirm({
|
|
293
|
-
title: '提示',
|
|
294
|
-
content: '您当前版本为免费版,该功能为医管云标准版功能,建议您升级为标准版',
|
|
295
|
-
confirmText: '立即升级',
|
|
296
|
-
cancelText: '关闭',
|
|
297
|
-
onConfirm: function onConfirm() {
|
|
298
|
-
var path = 'static/officeding/mobileportal/dist/index.html';
|
|
299
|
-
pageSkip(path, '#/hospitalmanage/version');
|
|
300
|
-
},
|
|
301
|
-
onCancel: function onCancel() {
|
|
302
|
-
console.log('confirm cancel');
|
|
303
|
-
}
|
|
304
|
-
});
|
|
305
|
-
} else {
|
|
306
|
-
_Dialog2.default.alert({
|
|
307
|
-
title: '提示',
|
|
308
|
-
content: '您当前版本为免费版,该功能为医管云标准版功能,请联系管理员升级',
|
|
309
|
-
confirmText: '关闭',
|
|
310
|
-
onConfirm: function onConfirm() {
|
|
311
|
-
console.log('confirm confirm');
|
|
312
|
-
},
|
|
313
|
-
onCancel: function onCancel() {
|
|
314
|
-
console.log('confirm cancel');
|
|
315
|
-
}
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
}).catch(function (error) {
|
|
321
|
-
alert("错误:" + error);
|
|
322
|
-
});
|
|
271
|
+
}, 100);
|
|
323
272
|
}
|
|
324
273
|
}, {
|
|
325
274
|
key: 'render',
|
|
@@ -331,23 +280,17 @@ var Page = function (_React$Component) {
|
|
|
331
280
|
null,
|
|
332
281
|
_react2.default.createElement(
|
|
333
282
|
'div',
|
|
334
|
-
{ style: {
|
|
335
|
-
_react2.default.createElement(
|
|
336
|
-
'span',
|
|
337
|
-
{ className: 't-FCblue' },
|
|
338
|
-
_react2.default.createElement('i', { className: 'iconfont icon-back t-rotate-180 t-FS14' }),
|
|
339
|
-
t.props.title
|
|
340
|
-
),
|
|
283
|
+
{ style: { height: '25px' } },
|
|
341
284
|
_react2.default.createElement(
|
|
342
285
|
'span',
|
|
343
|
-
{ onClick: t.
|
|
286
|
+
{ onClick: t.checkAfter.bind(t), className: t.state.readOnly ? 't-DN' : "t-FCblue t-FR" },
|
|
344
287
|
t.state.fileId == "" ? "去手写签名" : "重写签名"
|
|
345
288
|
)
|
|
346
289
|
),
|
|
347
290
|
_react2.default.createElement(
|
|
348
291
|
'div',
|
|
349
292
|
{ className: 'img-border', style: { backgroundColor: '#fff' } },
|
|
350
|
-
_react2.default.createElement('img', { src: t.state.fileId == "" ?
|
|
293
|
+
_react2.default.createElement('img', { src: t.state.fileId == "" ? '' : t.state.baseContext + '/api/m/plugin/attachment/mobile/viewImage?fid=' + t.state.fileId + "&token=" + t.state.token, className: 't-W100' })
|
|
351
294
|
)
|
|
352
295
|
);
|
|
353
296
|
}
|