fmui-base 2.3.53 → 2.3.54

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
@@ -3,6 +3,7 @@
3
3
  ---npm publish
4
4
 
5
5
  ## 更新日志
6
+ - 2.3.54:移动端支持作废数据进行删除,我的流程点开显示作废按钮显示逻辑和PC一致,移动端流程表单支持留言页签显示附件区和留言区
6
7
  - 2.3.53:移动端审批不通过功能
7
8
  - 2.3.52:移动端批示意见为空时允许保存并显示落款
8
9
  - 2.3.51:移动表单支持矩阵表单设置的字段名称字段内容的字体大小及颜色
package/lib/db/db.js CHANGED
@@ -807,6 +807,22 @@ context.create('FlowModuleAPI', {
807
807
  });
808
808
  }
809
809
  },
810
+ delMyProcess: {
811
+ mockUrl: 'query/getDoneTaskListByProcessId.json',
812
+ url: _variables2.default.URLS.delMyProcess,
813
+ method: 'POST',
814
+ postDataFomat: 'FORM',
815
+ header: {
816
+ Authorization: 'Bearer ' + getLoginUserInfo().token
817
+ },
818
+ willFetch: function willFetch() {
819
+ _Toast2.default.show({
820
+ content: _react2.default.createElement(_loading2.default, null),
821
+ hasMask: true,
822
+ duration: 800
823
+ });
824
+ }
825
+ },
810
826
  forceEnd: {
811
827
  mockUrl: 'query/getDoneTaskListByProcessId.json',
812
828
  url: _variables2.default.URLS.forceEnd,
@@ -1201,6 +1217,76 @@ context.create('FlowModuleAPI', {
1201
1217
  Authorization: 'Bearer ' + getLoginUserInfo().token
1202
1218
  },
1203
1219
  willFetch: function willFetch() {}
1220
+ },
1221
+ getMessageReplyInfo: {
1222
+ url: _variables2.default.URLS.getMessageReplyInfo,
1223
+ method: 'GET',
1224
+ header: {
1225
+ Authorization: 'Bearer ' + getLoginUserInfo().token
1226
+ },
1227
+ willFetch: function willFetch() {}
1228
+ },
1229
+ saveMessageReply: {
1230
+ url: _variables2.default.URLS.saveMessageReply,
1231
+ method: 'POST',
1232
+ postDataFomat: 'FORM',
1233
+ header: {
1234
+ Authorization: 'Bearer ' + getLoginUserInfo().token
1235
+ },
1236
+ willFetch: function willFetch() {}
1237
+ },
1238
+ deleteMessageReply: {
1239
+ url: _variables2.default.URLS.deleteMessageReply,
1240
+ method: 'POST',
1241
+ postDataFomat: 'FORM',
1242
+ header: {
1243
+ Authorization: 'Bearer ' + getLoginUserInfo().token
1244
+ },
1245
+ willFetch: function willFetch() {}
1246
+ },
1247
+ saveMessageReplyDetails: {
1248
+ url: _variables2.default.URLS.saveMessageReplyDetails,
1249
+ method: 'POST',
1250
+ postDataFomat: 'FORM',
1251
+ header: {
1252
+ Authorization: 'Bearer ' + getLoginUserInfo().token
1253
+ },
1254
+ willFetch: function willFetch() {}
1255
+ },
1256
+ deleteMessageReplyDetails: {
1257
+ url: _variables2.default.URLS.deleteMessageReplyDetails,
1258
+ method: 'POST',
1259
+ postDataFomat: 'FORM',
1260
+ header: {
1261
+ Authorization: 'Bearer ' + getLoginUserInfo().token
1262
+ },
1263
+ willFetch: function willFetch() {}
1264
+ },
1265
+ getAttachmentAreaInfo: {
1266
+ url: _variables2.default.URLS.getAttachmentAreaInfo,
1267
+ method: 'GET',
1268
+ header: {
1269
+ Authorization: 'Bearer ' + getLoginUserInfo().token
1270
+ },
1271
+ willFetch: function willFetch() {}
1272
+ },
1273
+ saveAttachmentArea: {
1274
+ url: _variables2.default.URLS.saveAttachmentArea,
1275
+ method: 'POST',
1276
+ postDataFomat: 'FORM',
1277
+ header: {
1278
+ Authorization: 'Bearer ' + getLoginUserInfo().token
1279
+ },
1280
+ willFetch: function willFetch() {}
1281
+ },
1282
+ deleteAttachmentArea: {
1283
+ url: _variables2.default.URLS.deleteAttachmentArea,
1284
+ method: 'POST',
1285
+ postDataFomat: 'FORM',
1286
+ header: {
1287
+ Authorization: 'Bearer ' + getLoginUserInfo().token
1288
+ },
1289
+ willFetch: function willFetch() {}
1204
1290
  }
1205
1291
 
1206
1292
  });
@@ -94,6 +94,7 @@ exports.default = {
94
94
  jump: approveUrlPrefix + "jump" + '?', //跳转
95
95
  getDoneTaskListByProcessId: approveUrlPrefix + "getDoneTaskListByProcessId" + '?', //根据流程实例id查询已办
96
96
  cancelProcess: approveUrlPrefix + 'cancelProcess' + '?', //作废流程
97
+ delMyProcess: approveUrlPrefix + 'delMyProcess' + '?', //我的流程删除
97
98
  forceEnd: approveUrlPrefix + 'forceEnd' + '?', //结束流程
98
99
  notPass: approveUrlPrefix + 'notPass' + '?', //不通过
99
100
  getUndoTaskInfo: approveUrlPrefix + "getUndoTaskInfo" + '?', //获取待办详情
@@ -149,7 +150,16 @@ exports.default = {
149
150
  updateStartUserOrg: approveUrlPrefix + 'updateStartUserOrg' + '?', //更新发起人组织
150
151
  reloadFuzhiMacroFields: approveUrlPrefix + 'reloadFuzhiMacroFields' + '?', //组织切换后重载赋值宏值
151
152
  getUserIdsByGrpId: approveUrlPrefix + 'getUserIdsByGrpId', //根据群组id获取用户(POST FORM)
152
- getUserIdsByDutyId: approveUrlPrefix + 'getUserIdsByDutyId' //根据职务id获取用户(POST FORM)
153
+ getUserIdsByDutyId: approveUrlPrefix + 'getUserIdsByDutyId', //根据职务id获取用户(POST FORM)
154
+ // 留言板 / 附件区(ApproveMobile 代理)
155
+ getMessageReplyInfo: approveUrlPrefix + 'getMessageReplyInfo?',
156
+ saveMessageReply: approveUrlPrefix + 'saveMessageReply',
157
+ deleteMessageReply: approveUrlPrefix + 'deleteMessageReply',
158
+ saveMessageReplyDetails: approveUrlPrefix + 'saveMessageReplyDetails',
159
+ deleteMessageReplyDetails: approveUrlPrefix + 'deleteMessageReplyDetails',
160
+ getAttachmentAreaInfo: approveUrlPrefix + 'getAttachmentAreaInfo?',
161
+ saveAttachmentArea: approveUrlPrefix + 'saveAttachmentArea',
162
+ deleteAttachmentArea: approveUrlPrefix + 'deleteAttachmentArea'
153
163
  },
154
164
  nodataIcon: context + "/mobile/fmui/images/noData.png",
155
165
  loadingIcon: context + "/mobile/fmui/images/loading.gif",
@@ -0,0 +1,564 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = undefined;
7
+
8
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
9
+
10
+ var _react = require('react');
11
+
12
+ var _react2 = _interopRequireDefault(_react);
13
+
14
+ var _Toast = require('saltui/lib/Toast');
15
+
16
+ var _Toast2 = _interopRequireDefault(_Toast);
17
+
18
+ var _Button = require('saltui/lib/Button');
19
+
20
+ var _Button2 = _interopRequireDefault(_Button);
21
+
22
+ var _Dialog = require('saltui/lib/Dialog');
23
+
24
+ var _Dialog2 = _interopRequireDefault(_Dialog);
25
+
26
+ var _TextareaField = require('saltui/lib/TextareaField');
27
+
28
+ var _TextareaField2 = _interopRequireDefault(_TextareaField);
29
+
30
+ var _Boxs = require('saltui/lib/Boxs');
31
+
32
+ var _Boxs2 = _interopRequireDefault(_Boxs);
33
+
34
+ var _Group = require('saltui/lib/Group');
35
+
36
+ var _Group2 = _interopRequireDefault(_Group);
37
+
38
+ var _upload = require('../upload/upload');
39
+
40
+ var _upload2 = _interopRequireDefault(_upload);
41
+
42
+ var _db = require('../db/db');
43
+
44
+ var _db2 = _interopRequireDefault(_db);
45
+
46
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
47
+
48
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
49
+
50
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
51
+
52
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
53
+
54
+ var HBox = _Boxs2.default.HBox,
55
+ Box = _Boxs2.default.Box,
56
+ VBox = _Boxs2.default.VBox;
57
+
58
+ /**
59
+ * 移动端流程留言页签:对齐 PC 附件区 + 留言区
60
+ */
61
+
62
+ var MessageBoard = function (_React$Component) {
63
+ _inherits(MessageBoard, _React$Component);
64
+
65
+ function MessageBoard(props) {
66
+ _classCallCheck(this, MessageBoard);
67
+
68
+ var _this = _possibleConstructorReturn(this, (MessageBoard.__proto__ || Object.getPrototypeOf(MessageBoard)).call(this, props));
69
+
70
+ _this.state = {
71
+ messageContent: '',
72
+ msglist: [],
73
+ replyDraft: {},
74
+ replyOpenId: '',
75
+ attmPreList: [],
76
+ pendingUploadList: [],
77
+ uploadKey: 0
78
+ };
79
+ return _this;
80
+ }
81
+
82
+ _createClass(MessageBoard, [{
83
+ key: 'componentDidMount',
84
+ value: function componentDidMount() {
85
+ this.reloadAll();
86
+ }
87
+ }, {
88
+ key: 'componentDidUpdate',
89
+ value: function componentDidUpdate(prevProps) {
90
+ if (prevProps.processInstanceId !== this.props.processInstanceId) {
91
+ this.reloadAll();
92
+ }
93
+ }
94
+ }, {
95
+ key: 'getLinkParams',
96
+ value: function getLinkParams() {
97
+ return {
98
+ modelflag: 'flow',
99
+ linkid: this.props.processInstanceId || ''
100
+ };
101
+ }
102
+ }, {
103
+ key: 'reloadAll',
104
+ value: function reloadAll() {
105
+ if (this.props.enableAttachmentArea === '1') {
106
+ this.loadAttachment();
107
+ }
108
+ if (this.props.enableMessageBoard === '1') {
109
+ this.loadMessages();
110
+ }
111
+ }
112
+ }, {
113
+ key: 'loadMessages',
114
+ value: function loadMessages() {
115
+ var t = this;
116
+ var params = this.getLinkParams();
117
+ if (!params.linkid) {
118
+ return;
119
+ }
120
+ _db2.default.FlowModuleAPI.getMessageReplyInfo(params).then(function (content) {
121
+ var data = content || {};
122
+ var msglist = data.msglist || [];
123
+ var replist = data.replist || [];
124
+ var withReplies = msglist.map(function (msg) {
125
+ var replies = replist.filter(function (r) {
126
+ return String(r.message_id) === String(msg.id);
127
+ });
128
+ return Object.assign({}, msg, { replies: replies });
129
+ });
130
+ t.setState({
131
+ msglist: withReplies,
132
+ replyOpenId: '',
133
+ replyDraft: {}
134
+ });
135
+ }).catch(function () {
136
+ _Toast2.default.show({ type: 'error', content: '加载留言失败' });
137
+ });
138
+ }
139
+ }, {
140
+ key: 'loadAttachment',
141
+ value: function loadAttachment() {
142
+ var t = this;
143
+ var params = this.getLinkParams();
144
+ if (!params.linkid) {
145
+ return;
146
+ }
147
+ _db2.default.FlowModuleAPI.getAttachmentAreaInfo(params).then(function (content) {
148
+ var data = content || {};
149
+ t.setState({
150
+ attmPreList: data.attmPreList || [],
151
+ pendingUploadList: [],
152
+ uploadKey: t.state.uploadKey + 1
153
+ });
154
+ }).catch(function () {
155
+ _Toast2.default.show({ type: 'error', content: '加载附件区失败' });
156
+ });
157
+ }
158
+ }, {
159
+ key: 'onMessageChange',
160
+ value: function onMessageChange(value) {
161
+ var text = value || '';
162
+ if (text.length > 1000) {
163
+ text = text.substring(0, 1000);
164
+ }
165
+ this.setState({ messageContent: text });
166
+ }
167
+ }, {
168
+ key: 'saveMessage',
169
+ value: function saveMessage() {
170
+ var t = this;
171
+ var content = (this.state.messageContent || '').trim();
172
+ if (!content) {
173
+ _Toast2.default.show({ type: 'error', content: '请输入留言' });
174
+ return;
175
+ }
176
+ var params = Object.assign({}, this.getLinkParams(), { messageContent: content });
177
+ _db2.default.FlowModuleAPI.saveMessageReply(params).then(function () {
178
+ _Toast2.default.show({ type: 'success', content: '添加成功!' });
179
+ t.setState({ messageContent: '' });
180
+ t.loadMessages();
181
+ }).catch(function (err) {
182
+ _Toast2.default.show({ type: 'error', content: err && err.errorMsg || '添加失败' });
183
+ });
184
+ }
185
+ }, {
186
+ key: 'toggleReply',
187
+ value: function toggleReply(msgId) {
188
+ this.setState({
189
+ replyOpenId: this.state.replyOpenId === msgId ? '' : msgId
190
+ });
191
+ }
192
+ }, {
193
+ key: 'onReplyChange',
194
+ value: function onReplyChange(msgId, value) {
195
+ var text = value || '';
196
+ if (text.length > 1000) {
197
+ text = text.substring(0, 1000);
198
+ }
199
+ var draft = Object.assign({}, this.state.replyDraft);
200
+ draft[msgId] = text;
201
+ this.setState({ replyDraft: draft });
202
+ }
203
+ }, {
204
+ key: 'saveReply',
205
+ value: function saveReply(msgId) {
206
+ var t = this;
207
+ var replyContent = ((this.state.replyDraft || {})[msgId] || '').trim();
208
+ if (!replyContent) {
209
+ _Toast2.default.show({ type: 'error', content: '请先填写留言回复的内容!' });
210
+ return;
211
+ }
212
+ _db2.default.FlowModuleAPI.saveMessageReplyDetails({
213
+ messageId: msgId,
214
+ replyContent: replyContent
215
+ }).then(function () {
216
+ _Toast2.default.show({ type: 'success', content: '添加成功!' });
217
+ t.loadMessages();
218
+ }).catch(function (err) {
219
+ _Toast2.default.show({ type: 'error', content: err && err.errorMsg || '回复失败' });
220
+ });
221
+ }
222
+ }, {
223
+ key: 'confirmDelete',
224
+ value: function confirmDelete(title, onOk) {
225
+ _Dialog2.default.confirm({
226
+ locale: 'zh_CN',
227
+ title: '提示',
228
+ content: title || '确认删除?',
229
+ onConfirm: function onConfirm() {
230
+ if (typeof onOk === 'function') {
231
+ onOk();
232
+ }
233
+ }
234
+ });
235
+ }
236
+ }, {
237
+ key: 'deleteMessage',
238
+ value: function deleteMessage(id) {
239
+ var t = this;
240
+ this.confirmDelete('确认删除该留言?', function () {
241
+ _db2.default.FlowModuleAPI.deleteMessageReply({ id: id }).then(function () {
242
+ _Toast2.default.show({ type: 'success', content: '删除成功' });
243
+ t.loadMessages();
244
+ }).catch(function (err) {
245
+ _Toast2.default.show({ type: 'error', content: err && err.errorMsg || '删除失败' });
246
+ });
247
+ });
248
+ }
249
+ }, {
250
+ key: 'deleteReply',
251
+ value: function deleteReply(id) {
252
+ var t = this;
253
+ this.confirmDelete('确认删除该回复?', function () {
254
+ _db2.default.FlowModuleAPI.deleteMessageReplyDetails({ id: id }).then(function () {
255
+ _Toast2.default.show({ type: 'success', content: '删除成功' });
256
+ t.loadMessages();
257
+ }).catch(function (err) {
258
+ _Toast2.default.show({ type: 'error', content: err && err.errorMsg || '删除失败' });
259
+ });
260
+ });
261
+ }
262
+ }, {
263
+ key: 'onUploadChange',
264
+ value: function onUploadChange(value) {
265
+ this.setState({ pendingUploadList: value || [] });
266
+ }
267
+ }, {
268
+ key: 'saveAttachment',
269
+ value: function saveAttachment() {
270
+ var t = this;
271
+ var list = this.state.pendingUploadList || [];
272
+ if (!list.length) {
273
+ _Toast2.default.show({ type: 'error', content: '请先添加附件' });
274
+ return;
275
+ }
276
+ var fileids = list.map(function (f) {
277
+ return f.id;
278
+ }).filter(Boolean).join('|');
279
+ if (!fileids) {
280
+ _Toast2.default.show({ type: 'error', content: '请先添加附件' });
281
+ return;
282
+ }
283
+ var params = Object.assign({}, this.getLinkParams(), {
284
+ fileids: fileids,
285
+ attEncrypts: ''
286
+ });
287
+ _db2.default.FlowModuleAPI.saveAttachmentArea(params).then(function () {
288
+ _Toast2.default.show({ type: 'success', content: '保存成功' });
289
+ t.loadAttachment();
290
+ }).catch(function (err) {
291
+ _Toast2.default.show({ type: 'error', content: err && err.errorMsg || '保存失败' });
292
+ });
293
+ }
294
+ }, {
295
+ key: 'deleteAttachment',
296
+ value: function deleteAttachment(item) {
297
+ var t = this;
298
+ this.confirmDelete('确认删除该附件?', function () {
299
+ _db2.default.FlowModuleAPI.deleteAttachmentArea({
300
+ id: item.attmAreaId,
301
+ fileId: item.id,
302
+ checksum: item.checksum || ''
303
+ }).then(function () {
304
+ _Toast2.default.show({ type: 'success', content: '删除成功' });
305
+ t.loadAttachment();
306
+ }).catch(function (err) {
307
+ _Toast2.default.show({ type: 'error', content: err && err.errorMsg || '删除失败' });
308
+ });
309
+ });
310
+ }
311
+ }, {
312
+ key: 'formatMsgDate',
313
+ value: function formatMsgDate(v) {
314
+ if (!v) {
315
+ return '';
316
+ }
317
+ if (typeof v === 'string') {
318
+ return v.length > 16 ? v.substring(0, 16) : v;
319
+ }
320
+ return String(v);
321
+ }
322
+ }, {
323
+ key: 'renderAttachmentBlock',
324
+ value: function renderAttachmentBlock() {
325
+ var t = this;
326
+ if (this.props.enableAttachmentArea !== '1') {
327
+ return null;
328
+ }
329
+ var attmList = this.state.attmPreList || [];
330
+ return _react2.default.createElement(
331
+ 'div',
332
+ { className: 't-MB12' },
333
+ _react2.default.createElement(
334
+ 'div',
335
+ { className: 't-PL16 t-PR16 t-PT12 t-PB8 t-FS15 t-FC3' },
336
+ '\u9644\u4EF6\u533A\uFF08',
337
+ attmList.length,
338
+ '\uFF09'
339
+ ),
340
+ _react2.default.createElement(
341
+ _Group2.default.List,
342
+ null,
343
+ _react2.default.createElement(
344
+ 'div',
345
+ { className: 't-PL16 t-PR16 t-PB12' },
346
+ _react2.default.createElement(_upload2.default, {
347
+ key: 'msgAttUpload_' + t.state.uploadKey,
348
+ required: false,
349
+ canAdd: true,
350
+ canDel: true,
351
+ initList: [],
352
+ initIds: '',
353
+ dir: 'messageboard',
354
+ onChange: function onChange(value) {
355
+ t.onUploadChange(value);
356
+ },
357
+ onDel: function onDel(value) {
358
+ t.onUploadChange(value);
359
+ }
360
+ }),
361
+ _react2.default.createElement(
362
+ 'div',
363
+ { className: 't-TR t-MT10' },
364
+ _react2.default.createElement(
365
+ _Button2.default,
366
+ { type: 'primary', size: 'small', display: 'inline', onClick: t.saveAttachment.bind(t) },
367
+ '\u6DFB\u52A0\u9644\u4EF6'
368
+ )
369
+ )
370
+ )
371
+ ),
372
+ attmList.map(function (item, idx) {
373
+ return _react2.default.createElement(
374
+ 'div',
375
+ { key: 'attm_' + (item.attmAreaId || item.id || idx), className: 't-BCf t-PL16 t-PR16 t-PT12 t-PB12 dd-bottom-border' },
376
+ _react2.default.createElement(
377
+ HBox,
378
+ { vAlign: 'center' },
379
+ _react2.default.createElement(
380
+ Box,
381
+ { flex: 1, className: 't-FS14 t-FC3 t-omit' },
382
+ item.name || '附件'
383
+ ),
384
+ item.canDelete ? _react2.default.createElement(
385
+ Box,
386
+ null,
387
+ _react2.default.createElement(
388
+ 'span',
389
+ { className: 't-FCred t-FS14', onClick: t.deleteAttachment.bind(t, item) },
390
+ '\u5220\u9664'
391
+ )
392
+ ) : null
393
+ ),
394
+ _react2.default.createElement(
395
+ 'div',
396
+ { className: 't-FS12 t-FCddfontblue-40 t-MT6' },
397
+ (item.createdBy || '') + ' ' + t.formatMsgDate(item.createdDate)
398
+ )
399
+ );
400
+ })
401
+ );
402
+ }
403
+ }, {
404
+ key: 'renderMessageBlock',
405
+ value: function renderMessageBlock() {
406
+ var t = this;
407
+ if (this.props.enableMessageBoard !== '1') {
408
+ return null;
409
+ }
410
+ var msglist = this.state.msglist || [];
411
+ return _react2.default.createElement(
412
+ 'div',
413
+ null,
414
+ _react2.default.createElement(
415
+ 'div',
416
+ { className: 't-PL16 t-PR16 t-PT12 t-PB8 t-FS15 t-FC3' },
417
+ '\u7559\u8A00\u533A\uFF08',
418
+ msglist.length,
419
+ '\uFF09'
420
+ ),
421
+ _react2.default.createElement(
422
+ _Group2.default.List,
423
+ null,
424
+ _react2.default.createElement(
425
+ 'div',
426
+ { className: 't-PL16 t-PR16 t-PB12' },
427
+ _react2.default.createElement(_TextareaField2.default, {
428
+ label: '',
429
+ minRows: 3,
430
+ maxRows: 6,
431
+ placeholder: '\u8BF7\u8F93\u5165\u7559\u8A00',
432
+ value: t.state.messageContent,
433
+ onChange: t.onMessageChange.bind(t)
434
+ }),
435
+ _react2.default.createElement(
436
+ 'div',
437
+ { className: 't-TR t-MT10' },
438
+ _react2.default.createElement(
439
+ _Button2.default,
440
+ { type: 'primary', size: 'small', display: 'inline', onClick: t.saveMessage.bind(t) },
441
+ '\u6DFB\u52A0\u7559\u8A00'
442
+ )
443
+ )
444
+ )
445
+ ),
446
+ msglist.map(function (msg) {
447
+ var replies = msg.replies || [];
448
+ var open = t.state.replyOpenId === msg.id;
449
+ return _react2.default.createElement(
450
+ 'div',
451
+ { key: 'msg_' + msg.id, className: 't-BCf t-PL16 t-PR16 t-PT12 t-PB12 dd-bottom-border t-MB8' },
452
+ _react2.default.createElement(
453
+ HBox,
454
+ { vAlign: 'center' },
455
+ _react2.default.createElement(
456
+ Box,
457
+ { flex: 1, className: 't-FS13 t-FCddfontblue-40' },
458
+ (msg.msgusername || '') + ' ' + t.formatMsgDate(msg.msgdate) + ' 留言'
459
+ ),
460
+ msg.canDelete ? _react2.default.createElement(
461
+ Box,
462
+ null,
463
+ _react2.default.createElement(
464
+ 'span',
465
+ { className: 't-FCred t-FS14', onClick: t.deleteMessage.bind(t, msg.id) },
466
+ '\u5220\u9664'
467
+ )
468
+ ) : null
469
+ ),
470
+ _react2.default.createElement(
471
+ 'div',
472
+ { className: 't-FS15 t-FC3 t-MT8', style: { wordBreak: 'break-all' } },
473
+ msg.message_content
474
+ ),
475
+ _react2.default.createElement(
476
+ 'div',
477
+ { className: 't-TR t-MT8' },
478
+ _react2.default.createElement(
479
+ 'span',
480
+ { className: 'theme-color t-FS14', onClick: t.toggleReply.bind(t, msg.id) },
481
+ '\u56DE\u590D'
482
+ )
483
+ ),
484
+ open ? _react2.default.createElement(
485
+ 'div',
486
+ { className: 't-MT8' },
487
+ _react2.default.createElement(_TextareaField2.default, {
488
+ label: '',
489
+ minRows: 2,
490
+ maxRows: 5,
491
+ placeholder: '\u8BF7\u8F93\u5165\u56DE\u590D\u5185\u5BB9',
492
+ value: (t.state.replyDraft || {})[msg.id] || '',
493
+ onChange: function onChange(v) {
494
+ t.onReplyChange(msg.id, v);
495
+ }
496
+ }),
497
+ _react2.default.createElement(
498
+ 'div',
499
+ { className: 't-TR t-MT8' },
500
+ _react2.default.createElement(
501
+ _Button2.default,
502
+ { type: 'primary', size: 'small', display: 'inline', onClick: t.saveReply.bind(t, msg.id) },
503
+ '\u63D0\u4EA4'
504
+ )
505
+ )
506
+ ) : null,
507
+ replies.map(function (rep) {
508
+ return _react2.default.createElement(
509
+ 'div',
510
+ { key: 'rep_' + rep.id, className: 't-MT10 t-PL12', style: { borderLeft: '2px solid #e5e5e5' } },
511
+ _react2.default.createElement(
512
+ HBox,
513
+ { vAlign: 'center' },
514
+ _react2.default.createElement(
515
+ Box,
516
+ { flex: 1, className: 't-FS12 t-FCddfontblue-40' },
517
+ (rep.repusername || '') + ' ' + t.formatMsgDate(rep.repdate)
518
+ ),
519
+ rep.canDelete ? _react2.default.createElement(
520
+ Box,
521
+ null,
522
+ _react2.default.createElement(
523
+ 'span',
524
+ { className: 't-FCred t-FS12', onClick: t.deleteReply.bind(t, rep.id) },
525
+ '\u5220\u9664'
526
+ )
527
+ ) : null
528
+ ),
529
+ _react2.default.createElement(
530
+ 'div',
531
+ { className: 't-FS14 t-FC3 t-MT4', style: { wordBreak: 'break-all' } },
532
+ rep.reply_content
533
+ )
534
+ );
535
+ })
536
+ );
537
+ }),
538
+ msglist.length === 0 ? _react2.default.createElement(
539
+ VBox,
540
+ { vAlign: 'center', hAlign: 'center', className: 't-PT40 t-PB40' },
541
+ _react2.default.createElement(
542
+ Box,
543
+ { className: 't-FCddfontblue-40 t-FS14' },
544
+ '\u6682\u65E0\u7559\u8A00'
545
+ )
546
+ ) : null
547
+ );
548
+ }
549
+ }, {
550
+ key: 'render',
551
+ value: function render() {
552
+ return _react2.default.createElement(
553
+ 'div',
554
+ { className: 't-BCf7', style: { minHeight: 200 } },
555
+ this.renderAttachmentBlock(),
556
+ this.renderMessageBlock()
557
+ );
558
+ }
559
+ }]);
560
+
561
+ return MessageBoard;
562
+ }(_react2.default.Component);
563
+
564
+ exports.default = MessageBoard;
@@ -100,6 +100,10 @@ var _RelationProcess = require('./RelationProcess');
100
100
 
101
101
  var _RelationProcess2 = _interopRequireDefault(_RelationProcess);
102
102
 
103
+ var _MessageBoard = require('./MessageBoard');
104
+
105
+ var _MessageBoard2 = _interopRequireDefault(_MessageBoard);
106
+
103
107
  var _select = require('../selectMember/select');
104
108
 
105
109
  var _select2 = _interopRequireDefault(_select);
@@ -259,7 +263,20 @@ var PageHome = function (_React$Component) {
259
263
  var status = '0';
260
264
  var dataId = props.dataId;
261
265
  var editType = '';
262
- isSub = props.isSub ? props.isSub : '';
266
+ // 再次发起路由末段为 isSub=2;兼容 props 未透传时从 hash 解析
267
+ isSub = props.isSub != null && props.isSub !== '' && props.isSub !== 'undefined' && props.isSub !== 'null' ? String(props.isSub) : '';
268
+ if (isSub === '') {
269
+ try {
270
+ var hashParts = (window.location.hash || '').replace(/^#\/?/, '').split('/');
271
+ // process/processDetails/.../module/userId/search/isSub → isSub 在下标 11
272
+ if (hashParts.length >= 12 && hashParts[1] === 'processDetails') {
273
+ var lastSeg = hashParts[11];
274
+ if (lastSeg === '1' || lastSeg === '2') {
275
+ isSub = lastSeg;
276
+ }
277
+ }
278
+ } catch (e) {}
279
+ }
263
280
  // if(isSub!=''){
264
281
  // window.location.reload();
265
282
  // }
@@ -514,6 +531,8 @@ var PageHome = function (_React$Component) {
514
531
  endSelect: false,
515
532
  mobileFlowChar: '0', //是否开启流程图 1开启 0禁用
516
533
  mobileSubTblDefault: '1', //移动端子表默认 1展开 0收起;未设置按展开
534
+ enableMessageBoard: '0', //流程启用留言板
535
+ enableAttachmentArea: '0', //流程启用附件区
517
536
  readScopeId: '',
518
537
  readScopeList: [],
519
538
  readRangeType: '', //传阅范围 0全部 2本组织及下属组织 4自定义
@@ -996,6 +1015,8 @@ var PageHome = function (_React$Component) {
996
1015
  var mobileFlowChar = content.mobileFlowChar;
997
1016
  // 移动端子表默认:1展开 0收起;缺省按展开
998
1017
  var mobileSubTblDefault = content.mobileSubTblDefault != null && content.mobileSubTblDefault !== '' ? String(content.mobileSubTblDefault) : '1';
1018
+ var enableMessageBoard = content.enableMessageBoard != null && content.enableMessageBoard !== '' ? String(content.enableMessageBoard) : '0';
1019
+ var enableAttachmentArea = content.enableAttachmentArea != null && content.enableAttachmentArea !== '' ? String(content.enableAttachmentArea) : '0';
999
1020
 
1000
1021
  //项目开发模块统一扩展
1001
1022
  var mobileModuleExt;
@@ -1635,6 +1656,8 @@ var PageHome = function (_React$Component) {
1635
1656
  dealReminderContent: dealReminderContent,
1636
1657
  mobileFlowChar: mobileFlowChar,
1637
1658
  mobileSubTblDefault: mobileSubTblDefault,
1659
+ enableMessageBoard: enableMessageBoard,
1660
+ enableAttachmentArea: enableAttachmentArea,
1638
1661
  readScopeId: readScopeId,
1639
1662
  readScopeList: readScopeList,
1640
1663
  readRangeType: readRangeType,
@@ -1827,6 +1850,11 @@ var PageHome = function (_React$Component) {
1827
1850
  // }
1828
1851
  for (var b = 0; b < buttonArray.length; b++) {
1829
1852
  var buttonCode = buttonArray[b];
1853
+ // 再次发起(isSub=2):无论 start/pending,都不展示作废
1854
+ var againStart = String(t.state.isSub != null && t.state.isSub !== '' ? t.state.isSub : isSub || '') === '2';
1855
+ if (againStart && buttonCode == 'BASE_INVALID') {
1856
+ continue;
1857
+ }
1830
1858
  //PAGE_SAVE保存按钮只有当新建时才有,HELP_ADDLOTS加签只有在会签和串签才有,RADOM_FINISH随机流程完成按钮去掉
1831
1859
  if (buttonCode == 'OTHER_RELATION' || buttonCode == 'FLOW_REVOKE' || buttonCode == 'RADOM_FINISH' || buttonCode == 'FLOW_CANCEL' || buttonCode == 'FLOW_RECOVER' || buttonCode == 'PAGE_PRINT' || buttonCode == 'PAGE_URGE' || buttonCode == 'PAGE_REDSET' || buttonCode == 'PAGE_FEEDBACK' || buttonCode == 'RECORD' || buttonCode == 'HELP_ADDLOTS' && participantMode == '0') {
1832
1860
  continue;
@@ -1889,8 +1917,21 @@ var PageHome = function (_React$Component) {
1889
1917
  //发起人撤销按钮
1890
1918
  buttonList.push({ name: t.state.finalButtons.get("FLOW_REVOKE"), type: 'secondary', display: 'inline', no: 7 });
1891
1919
  }
1892
- // 发起人配置了作废,且流程在发起人节点时(退回/撤回后)可作废
1893
- if (startButtons.indexOf('BASE_INVALID') >= 0 && (isStart == true || isStart == 'true')) {
1920
+ // 与 PC 一致:发起人配置作废 + 进行中 + 当前待办在发起节点
1921
+ var processStatusNow = String(content.processStatus != null ? content.processStatus : content.status != null ? content.status : '');
1922
+ var backToInitiator = isStart == true || isStart == 'true';
1923
+ if (!backToInitiator && content.processLogList && content.processLogList.length > 0 && content.doingUserList && content.doingUserList.length > 0) {
1924
+ var startActId = content.processLogList[0].curactivityid;
1925
+ if (startActId) {
1926
+ for (var di = 0; di < content.doingUserList.length; di++) {
1927
+ if (content.doingUserList[di].activityId == startActId) {
1928
+ backToInitiator = true;
1929
+ break;
1930
+ }
1931
+ }
1932
+ }
1933
+ }
1934
+ if (startButtons.indexOf('BASE_INVALID') >= 0 && processStatusNow == '1' && backToInitiator) {
1894
1935
  buttonList.push({ name: t.state.finalButtons.get("BASE_INVALID"), type: 'danger', display: 'inline', no: 9 });
1895
1936
  }
1896
1937
  }
@@ -1917,7 +1958,8 @@ var PageHome = function (_React$Component) {
1917
1958
  if (buttonCode == 'PAGE_SAVE' || buttonCode == 'BASE_SUMBIT') {
1918
1959
  buttonArrayNew.push(buttonCode);
1919
1960
  }
1920
- if (buttonCode == 'BASE_INVALID' && dataId) {
1961
+ // 再次发起(isSub=2)不显示作废
1962
+ if (buttonCode == 'BASE_INVALID' && dataId && String(t.state.isSub || isSub || '') != '2') {
1921
1963
  buttonArrayNew.push(buttonCode);
1922
1964
  }
1923
1965
  }
@@ -3418,13 +3460,13 @@ var PageHome = function (_React$Component) {
3418
3460
  selectOptions.push(option);
3419
3461
  });
3420
3462
 
3421
- var processDataList = [{ value: '1', name: '保留', disable: false, checked: true, text: '保留' }, { value: '2', name: '清除', disable: false, checked: false, text: '清除(已办人的已办记录)' }];
3463
+ var processDataList = [{ value: '1', name: '保留', disable: false, checked: true, text: '保留' }, { value: '2', name: '删除流程数据', disable: false, checked: false, text: '删除流程数据' }];
3422
3464
  t.setState({
3423
3465
  allActivity: selectOptions, //所有环节名称
3424
3466
  designActivity: selectOptions[0].value, //选择的提醒环节id
3425
3467
  processDataList: processDataList,
3426
3468
  processDataListDefault: processDataList[0],
3427
- processData: '1', //1 保留流程数据,2清除已办数据
3469
+ processData: '1', //1 保留流程数据,2删除流程数据
3428
3470
  operate: operate,
3429
3471
  pageStatus: '1'
3430
3472
  }, function () {
@@ -7197,6 +7239,13 @@ var PageHome = function (_React$Component) {
7197
7239
  buttonCodeList.push({ 'buttonCode': 'subprocess', 'buttonName': '发起子流程' });
7198
7240
  }
7199
7241
  buttonCodeList = buttonCodeList.concat();
7242
+ // 再次发起不展示作废(后端可能仍返回 BASE_INVALID)
7243
+ var againStartBtn = String(_this4.state.isSub != null && _this4.state.isSub !== '' ? _this4.state.isSub : isSub || '') === '2';
7244
+ if (againStartBtn) {
7245
+ buttonCodeList = buttonCodeList.filter(function (item) {
7246
+ return item && item.buttonCode != 'BASE_INVALID';
7247
+ });
7248
+ }
7200
7249
  var alllength = buttonCodeList.length + extensionButtonList.length;
7201
7250
  if (alllength > 3) {
7202
7251
  buttonList.push({ name: '更多', type: 'secondary', display: 'inline', no: -1 });
@@ -9086,7 +9135,20 @@ var PageHome = function (_React$Component) {
9086
9135
  _react2.default.createElement(_RelationProcess2.default, { ref: "relationProcess_list", taskId: this.state.taskId, processInstanceId: this.state.processInstanceId, listType: this.state.listType })
9087
9136
  )
9088
9137
  )
9089
- )
9138
+ ),
9139
+ this.state.enableMessageBoard === '1' || this.state.enableAttachmentArea === '1' ? _react2.default.createElement(
9140
+ _Tab2.default.Item,
9141
+ { key: '4', title: '\u7559\u8A00' },
9142
+ _react2.default.createElement(
9143
+ 'div',
9144
+ { className: this.state.activeItemIndex == 4 ? '' : 't-DN' },
9145
+ _react2.default.createElement(_MessageBoard2.default, {
9146
+ processInstanceId: this.state.processInstanceId,
9147
+ enableMessageBoard: this.state.enableMessageBoard,
9148
+ enableAttachmentArea: this.state.enableAttachmentArea
9149
+ })
9150
+ )
9151
+ ) : ''
9090
9152
  )
9091
9153
  )
9092
9154
  ),
@@ -200,12 +200,20 @@ var ListItem = function (_React$Component) {
200
200
  try {
201
201
  _Popup2.default.hide();
202
202
  } catch (e) {}
203
+ var itemInfo = this.props.data;
204
+ var status = String(itemInfo.status != null ? itemInfo.status : '');
205
+ var canDelete = status === '3' || status === '4' || status === '5';
206
+ // 删除项用内联红色,避免主题色覆盖 ActionSheet destructive 样式
207
+ var options = canDelete ? [_react2.default.createElement(
208
+ 'span',
209
+ { style: { color: '#F03118' } },
210
+ '\u5220\u9664'
211
+ ), '详情', '再次发送'] : ['详情', '再次发送'];
203
212
  _ActionSheet2.default.show({
204
- options: ['详情', '再次发送'],
213
+ options: options,
214
+ destructiveButtonIndex: canDelete ? 0 : undefined,
205
215
  maskClosable: true
206
216
  }, function (index) {
207
- var itemInfo = _this3.props.data;
208
- console.log(itemInfo);
209
217
  var param_processKey = itemInfo.processKey; // 流程类型code
210
218
  var param_businessKey = itemInfo.businessKey; // 表单数据id;
211
219
  var param_startUserId = itemInfo.startUserId; // 流程发起人id
@@ -215,9 +223,41 @@ var ListItem = function (_React$Component) {
215
223
  var type = _this3.props.fromType; //self:本应用,all:全模块
216
224
  var projectPath = _this3.props.projectPath; //项目路径
217
225
 
218
- if (index == 0) {
226
+ var detailIndex = canDelete ? 1 : 0;
227
+ var resendIndex = canDelete ? 2 : 1;
228
+ if (canDelete && index == 0) {
229
+ var t = _this3;
230
+ _Dialog2.default.confirm({
231
+ locale: 'zh_CN',
232
+ title: '提示',
233
+ content: '确定删除该流程吗?',
234
+ onConfirm: function onConfirm() {
235
+ _db2.default.FlowModuleAPI.delMyProcess({
236
+ processInstanceId: itemInfo.processInstanceId,
237
+ module: module || 'approve'
238
+ }).then(function () {
239
+ _Toast2.default.show({ type: 'success', content: '删除成功' });
240
+ if (typeof t.props.onRefresh === 'function') {
241
+ t.props.onRefresh();
242
+ } else {
243
+ try {
244
+ window.location.reload();
245
+ } catch (e) {}
246
+ }
247
+ }).catch(function (error) {
248
+ _Toast2.default.show({
249
+ type: 'error',
250
+ content: error && (error.errorMsg || error.message) || '删除失败'
251
+ });
252
+ });
253
+ },
254
+ onCancel: function onCancel() {}
255
+ });
256
+ return;
257
+ }
258
+ if (index == detailIndex) {
219
259
  _this3.openProcessDetails(itemInfo, param_list_type);
220
- } else if (index == 1) {
260
+ } else if (index == resendIndex) {
221
261
  var param = {
222
262
  code: param_processKey
223
263
  };
@@ -328,10 +368,10 @@ var ListItem = function (_React$Component) {
328
368
  }
329
369
  } else {
330
370
  if (this.props.ableClick) {
331
- var itemInfo = this.props.data;
332
- console.log(itemInfo);
371
+ var _itemInfo = this.props.data;
372
+ console.log(_itemInfo);
333
373
  var param_list_type = this.props.listTabType;
334
- this.openProcessDetails(itemInfo, param_list_type);
374
+ this.openProcessDetails(_itemInfo, param_list_type);
335
375
  } else {
336
376
  this.props.updateAbleClick(true);
337
377
  }
@@ -546,7 +586,7 @@ var ListItem = function (_React$Component) {
546
586
  { className: this.props.isBatch == false ? 't-DN' : 'approve-check' },
547
587
  _react2.default.createElement(
548
588
  Box,
549
- { className: this.props.isBatch == false ? 't-DN' : 't-checkbox-field-icon-list un-checked t-MR10', 'data-taskId': this.props.id, 'data-module': this.props.module, 'data-processInstanceId': this.props.processInstanceId },
589
+ { className: this.props.isBatch == false ? 't-DN' : 't-checkbox-field-icon-list un-checked t-MR10', 'data-taskid': this.props.id, 'data-module': this.props.module, 'data-processinstanceid': this.props.processInstanceId },
550
590
  _react2.default.createElement('i', { className: 'iconfont icon-checked t-FCf t-FS14' })
551
591
  )
552
592
  ),
@@ -1199,7 +1239,7 @@ var PageHome = function (_React$Component2) {
1199
1239
  var _module = '';
1200
1240
  $(".checked").map(function (index, item) {
1201
1241
  taskIds += $(item).attr("data-taskid") + ",";
1202
- processInstanceIds += $(item).attr("data-processInstanceId") + ",";
1242
+ processInstanceIds += $(item).attr("data-processinstanceid") + ",";
1203
1243
 
1204
1244
  if (index == 0) {
1205
1245
  taskId = $(item).attr("data-taskid");
@@ -1305,7 +1345,7 @@ var PageHome = function (_React$Component2) {
1305
1345
  var permissionCode = "unRead";
1306
1346
  $(".checked").map(function (index, item) {
1307
1347
  taskIds += $(item).attr("data-taskid") + ",";
1308
- processInstanceIds += $(item).attr("data-processInstanceId") + ",";
1348
+ processInstanceIds += $(item).attr("data-processinstanceid") + ",";
1309
1349
 
1310
1350
  if (index == 0) {
1311
1351
  module = $(item).attr("data-module");
@@ -1518,7 +1558,7 @@ var PageHome = function (_React$Component2) {
1518
1558
  ),
1519
1559
  _react2.default.createElement(
1520
1560
  Box,
1521
- { className: this.state.hasBatch ? this.state.isBatch ? "t-FCc t-PR16" : "theme-color t-PR16" : "t-DN", isBatch: this.state.isBatch, onClick: this.clickBatch.bind(this, this.state.isBatch) },
1561
+ { className: this.state.hasBatch ? this.state.isBatch ? "t-FCc t-PR16" : "theme-color t-PR16" : "t-DN", onClick: this.clickBatch.bind(this, this.state.isBatch) },
1522
1562
  '\u6279\u91CF'
1523
1563
  )
1524
1564
  ),
@@ -1683,7 +1723,11 @@ var PageHome = function (_React$Component2) {
1683
1723
  currentPageKey: 'page'
1684
1724
 
1685
1725
  },
1686
- _react2.default.createElement(ListItem, { listTabType: '4', ableClick: this.state.ableClick, isBatch: this.state.isBatch, fromType: this.state.type, projectPath: this.state.projectPath, updateAbleClick: this.updateAbleClick.bind(this) })
1726
+ _react2.default.createElement(ListItem, { listTabType: '4', ableClick: this.state.ableClick, isBatch: this.state.isBatch, fromType: this.state.type, projectPath: this.state.projectPath, updateAbleClick: this.updateAbleClick.bind(this), onRefresh: function onRefresh() {
1727
+ if (_this7.refs.transaction_myself_ref) {
1728
+ _this7.refs.transaction_myself_ref.fetchData({ type: 'refresh' });
1729
+ }
1730
+ } })
1687
1731
  )
1688
1732
  )
1689
1733
  ) : ""
@@ -6,4 +6,9 @@
6
6
 
7
7
  .t-mask {
8
8
  display: none !important;
9
- }
9
+ }
10
+
11
+ /* 我的流程 ActionSheet「删除」强制红字 */
12
+ .t-action-sheet-panel-item.t-action-sheet-panel-item-destructive {
13
+ color: #F03118 !important;
14
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fmui-base",
3
- "version": "2.3.53",
3
+ "version": "2.3.54",
4
4
  "title": "fmui-base",
5
5
  "description": "fmui移动端组件",
6
6
  "main": "lib/index.js",