fmui-base 2.3.52 → 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 +2 -0
- package/lib/ScrollList/ScrollList.js +11 -3
- package/lib/db/db.js +101 -0
- package/lib/db/variables.js +12 -1
- package/lib/form_info/formInfo.js +1 -0
- package/lib/process_info/MessageBoard.js +564 -0
- package/lib/process_info/processInfo.js +220 -9
- package/lib/process_list/processList.js +291 -252
- package/lib/process_list/processList.less +6 -1
- package/package.json +1 -1
|
@@ -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;
|