fmui-base 2.1.43 → 2.1.46

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.
@@ -0,0 +1,722 @@
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 _umi = require('umi');
15
+
16
+ var _reactGridLayout = require('react-grid-layout');
17
+
18
+ var _reactGridLayout2 = _interopRequireDefault(_reactGridLayout);
19
+
20
+ var _Badge = require('saltui/lib/Badge');
21
+
22
+ var _Badge2 = _interopRequireDefault(_Badge);
23
+
24
+ var _Grid = require('saltui/lib/Grid');
25
+
26
+ var _Grid2 = _interopRequireDefault(_Grid);
27
+
28
+ var _Boxs = require('saltui/lib/Boxs');
29
+
30
+ var _Boxs2 = _interopRequireDefault(_Boxs);
31
+
32
+ var _TextField = require('saltui/lib/TextField');
33
+
34
+ var _TextField2 = _interopRequireDefault(_TextField);
35
+
36
+ var _Tab = require('saltui/lib/Tab');
37
+
38
+ var _Tab2 = _interopRequireDefault(_Tab);
39
+
40
+ var _Carousel = require('saltui/lib/Carousel');
41
+
42
+ var _Carousel2 = _interopRequireDefault(_Carousel);
43
+
44
+ var _Button = require('saltui/lib/Button');
45
+
46
+ var _Button2 = _interopRequireDefault(_Button);
47
+
48
+ var _Toast = require('saltui/lib/Toast');
49
+
50
+ var _Toast2 = _interopRequireDefault(_Toast);
51
+
52
+ var _Refreshcontrol = require('saltui/lib/Refreshcontrol');
53
+
54
+ var _Refreshcontrol2 = _interopRequireDefault(_Refreshcontrol);
55
+
56
+ require('react-grid-layout/css/styles.css');
57
+
58
+ require('react-resizable/css/styles.css');
59
+
60
+ require('./react_grid.less');
61
+
62
+ var _db = require('../db/db');
63
+
64
+ var _db2 = _interopRequireDefault(_db);
65
+
66
+ var _variables = require('../db/variables');
67
+
68
+ var _variables2 = _interopRequireDefault(_variables);
69
+
70
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
71
+
72
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
73
+
74
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
75
+
76
+ 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; }
77
+
78
+ 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; }
79
+
80
+ // import Chart from '../chart/chart';
81
+ var projectMenuUrl = _variables2.default.projectMenuUrl;
82
+ var HBox = _Boxs2.default.HBox,
83
+ Box = _Boxs2.default.Box,
84
+ VBox = _Boxs2.default.VBox;
85
+ var RightAddon = _TextField2.default.RightAddon;
86
+
87
+ var context = document.getElementById("context").value;
88
+
89
+ var MyGrid = function (_React$Component) {
90
+ _inherits(MyGrid, _React$Component);
91
+
92
+ function MyGrid(props) {
93
+ _classCallCheck(this, MyGrid);
94
+
95
+ var _this = _possibleConstructorReturn(this, (MyGrid.__proto__ || Object.getPrototypeOf(MyGrid)).call(this, props));
96
+
97
+ _this.initPage = function () {
98
+ var t = _this;
99
+ // 部件的初始化信息
100
+ _db2.default.reactGrid.getPortalPage({ id: t.state.portalId, module: t.state.module }).then(function (res) {
101
+ if (res && res.length > 0) {
102
+ _this.setState({
103
+ data: res
104
+ });
105
+ res.map(function (item) {
106
+ if (item.portletCode == 'banner') {
107
+ _this.setState(_defineProperty({}, item.portletCode + '_' + item.id, JSON.parse(item.personalSetting)));
108
+ _this.getRemindCount();
109
+ } else if (item.portletCode == 'image') {
110
+ _this.setState(_defineProperty({}, item.portletCode + '_' + item.id, JSON.parse(item.personalSetting)));
111
+ } else if (item.portletCode == 'cyyy') {
112
+ var cyyyCols = JSON.parse(item.personalSetting).cols;
113
+ t.getShoucangAppInfo(item.id);
114
+ t.getOftenList(item.id, cyyyCols);
115
+ _this.getRemindCount();
116
+ } else if (item.portletCode !== 'tbgl') {
117
+ var _params = {
118
+ code: item.portletCode,
119
+ ppId: item.id
120
+ };
121
+ _db2.default.reactGrid.getComponentInfoListAll(_params).then(function (res) {
122
+ _this.setState(_defineProperty({}, item.portletCode + '_' + item.id, res));
123
+ });
124
+ }
125
+ });
126
+ } else {
127
+ _Toast2.default.show({
128
+ type: 'fail',
129
+ content: '未找到门户信息',
130
+ duration: 2000
131
+ });
132
+ }
133
+ }).catch(function (error) {
134
+ _Toast2.default.show({
135
+ type: 'fail',
136
+ content: error.errorMsg,
137
+ duration: 2000
138
+ });
139
+ });
140
+
141
+ var params = {};
142
+ _db2.default.reactGrid.getNewHomePageTodoData(params).then(function (content) {
143
+ var openModule = content.hpOpenModule ? content.hpOpenModule : "";
144
+ localStorage.setItem('hpOpenModule', openModule);
145
+ // let todoData = content.todoData != null ? content.todoData.entity : {};
146
+ // let pageTitle = todoData.pageTitle;
147
+ // if (!pageTitle || pageTitle == '') {
148
+ // pageTitle = '一网通办管理平台'
149
+ // }
150
+ // setPageTitle(pageTitle);
151
+ });
152
+ };
153
+
154
+ _this.getShoucangAppInfo = function (id) {
155
+ _db2.default.reactGrid.getNewHomePageCollectAppInfoList({ showClient: "DING" }).then(function (result) {
156
+ _this.setState(_defineProperty({}, 'wdsc' + '_' + id, result.data), function () {
157
+ // console.log(this.state, 'mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm');
158
+ });
159
+ }).catch(function (error) {});
160
+ };
161
+
162
+ _this.getOftenList = function (id, cyyyCols) {
163
+ var data = getLoginUserInfo();
164
+ var thirdMenuType = data.thirdMenuType;
165
+ var params = { code: "cyyy", cols: cyyyCols };
166
+ if (thirdMenuType == null || thirdMenuType == 'null' || thirdMenuType == undefined || thirdMenuType == 'undefined') {
167
+ thirdMenuType = 'DING';
168
+ }
169
+ params.showClient = thirdMenuType;
170
+ _db2.default.reactGrid.getComponentInfoListAll(params).then(function (content) {
171
+ if (content) {
172
+ _this.setState(_defineProperty({}, 'cyyy' + '_' + id, content));
173
+ var appOftenListlocal = JSON.stringify(content);
174
+ // localStorage.setItem(['cyyy' + '_' + id], appOftenListlocal);
175
+ localStorage.setItem('appOftenList', appOftenListlocal);
176
+ }
177
+ }).catch(function (error) {
178
+ console.error(error);
179
+ });
180
+ };
181
+
182
+ var portalId = props.portalId;
183
+ var module = props.module;
184
+ _this.state = {
185
+ portalId: portalId,
186
+ module: module,
187
+ data: [],
188
+ isDraggable: false,
189
+ //标题样式
190
+ titleStatus: true,
191
+ titleFontFamily: '',
192
+ titleFontWeight: 400,
193
+ titleColor: '',
194
+ titleFontSize: '',
195
+ titleFontStyle: '',
196
+ titleBgColor: '',
197
+ // 部件圆角
198
+ borderTopLeftRadius: '10px',
199
+ borderTopRightRadius: '10px',
200
+ borderBottomLeftRadius: '10px',
201
+ borderBottomRightRadius: '10px',
202
+ // 部件边框样式
203
+ borderColor: '',
204
+ borderWidth: '',
205
+ // 部件内边距
206
+ paddingLeft: '',
207
+ paddingright: '',
208
+ paddingTop: '',
209
+ paddingBottom: '',
210
+
211
+ // todoList: [],//移动集成 配置提醒项信息
212
+ todoList: ["banshi", "zixun", "yingyong", "daiban", "wode"],
213
+ pageImage: projectMenuUrl.pageImage, //提醒项背景图
214
+ appInfoList: [], //移动集成 配置应用信息
215
+ bannerPicPath: '',
216
+ activeIndex: 2,
217
+ undo: 0, //待办数量
218
+ approveundo: 0, //审批数量
219
+ toBeAttendedCount: 0, //会议数量
220
+ unreadMailCount: 0, //未读邮件
221
+ unreadPubMailCount: 0, //未读公共邮件
222
+ appOftenList: [], //常用应用
223
+ collectAppInfoList: [], //收藏应用
224
+ bssx: [], // 办事事项
225
+ bssx_per: [], // 办事事项_个人办事
226
+ bssx_org: [], // 办事事项_部门办事
227
+ jxzt: [], // 精选专题
228
+ ttxx: [], // 头条信息
229
+ xwzx: [], // 新闻资讯
230
+ gryj: [], // 个人邮件
231
+ grrc: [], // 个人日程
232
+ grrc_list: [], // 个人日程-日程信息
233
+ grhy: [], // 个人会议
234
+ showbssx: true, // 办事事项
235
+ showjxzt: true, // 精选专题
236
+ showttxx: true, // 头条信息
237
+ showxwzx: true, // 新闻资讯
238
+ showgryj: true, // 个人邮件
239
+ showgrrc: true, // 个人日程
240
+ showgrhy: true, // 个人会议
241
+ showcyyy: true, // 常用应用
242
+ initCleader: false,
243
+ bannerList: [],
244
+ showSlide: false,
245
+ refreshing: false, //下拉刷新
246
+ showMobileComponent: "", // 显示部件显示模块
247
+ componentList: [], // 显示部件显示模块数组
248
+ pageImageList: [],
249
+ showItem: 0,
250
+ searchVal: '', //顶部搜索input值
251
+ filterValue: { //顶部搜索分类值
252
+ sort: [{ text: '全部', value: 'all' }]
253
+ },
254
+ modelCode: 'all',
255
+ bssxPer_show: true, //办事事项_个人_是否显示
256
+ bssxOrg_show: true, //办事事项_个人_是否显示,
257
+ cyyyUsuTab_show: true, //常用应用_是否显示
258
+ cyyyPerTab_show: true, //我的收藏_是否显示
259
+ activeIndex_mail: 0
260
+
261
+ };
262
+ return _this;
263
+ }
264
+
265
+ _createClass(MyGrid, [{
266
+ key: 'componentDidMount',
267
+ value: function componentDidMount() {
268
+ this.initPage();
269
+ }
270
+ // 遍历初始化得到的data,奖id给请求部件的内容的接口
271
+ // 如果有两个相同的部件,将会用id请求部件内容,接口返回的数据需要 this.setState({【id】:result.data});这样存值
272
+ // 取值的时候根据id取值
273
+
274
+
275
+ // 获取收藏应用
276
+
277
+
278
+ // 获取用户设置常用应用
279
+ // getComAppInfo = (id) => {
280
+ // let userId = getLoginUserInfo().userId;
281
+ // var userAppOftenList = [];
282
+ // var params = { userId: userId };
283
+ // DB.reactGrid.getComAppInfo(params).then((result) => {
284
+ // if (result.data) {
285
+ // this.setState({
286
+ // ['cyyy' + '_' + id]: JSON.parse(result.data)
287
+ // });
288
+ // localStorage.setItem(['cyyy' + '_' + id], result.data);
289
+ // userAppOftenList = JSON.parse(result.data);
290
+ // }
291
+ // if (userAppOftenList.length < 1) {
292
+ // // 没有用户设置,取系统默认值
293
+ // this.getOftenList(id);
294
+ // }
295
+ // }).catch((error) => {
296
+ // this.getOftenList();
297
+ // console.error(error);
298
+ // });
299
+ // }
300
+ // 获取默认系统常用应用
301
+
302
+ }, {
303
+ key: 'getRemindCount',
304
+ value: function getRemindCount() {
305
+ var _this2 = this;
306
+
307
+ _db2.default.reactGrid.getNewHomePageRemindCount({ codes: "undo,unreadMail,unreadPubMail,toBeAttended,approveundo" }).then(function (content) {
308
+ if (content.undo || content.approveundo || content.toBeAttendedCount || content.unreadPubMailCount || content.unreadMailCount) {
309
+ _this2.setState({
310
+ undo: content.undo,
311
+ unreadMailCount: content.unreadMailCount,
312
+ approveundo: content.approveundo,
313
+ toBeAttendedCount: content.toBeAttendedCount,
314
+ unreadPubMailCount: content.unreadPubMailCount
315
+ });
316
+ }
317
+ });
318
+ }
319
+ }, {
320
+ key: 'initCleader',
321
+ value: function initCleader(event, id) {
322
+ if (!this.state["initCleader_" + id] || this.state["initCleader_" + id] == false) {
323
+ var t = this;
324
+ var calendar = document.getElementById('calendar_ ' + id);
325
+ if (calendar) {
326
+ var cld = new CalendarMobile({
327
+ el: 'box',
328
+ value: '', // 默认为new Date();
329
+ type: 1,
330
+ parentNode: calendar,
331
+ // fold: false,
332
+ fn: function fn(obj) {
333
+ // 日期选择后回调
334
+ var YY = obj.year;
335
+ var MM = obj.month >= 10 ? obj.month : "0" + obj.month;
336
+ var DD = obj.day >= 10 ? obj.day : "0" + obj.day;
337
+ var Date = YY + "-" + MM + "-" + DD;
338
+ t.showCalendarList(Date, event, id);
339
+ },
340
+ //点击上一个月
341
+ prevMonth: function prevMonth(obj) {},
342
+ //点击下一个月
343
+ nextMonth: function nextMonth(obj) {},
344
+ calendarInit: function calendarInit(obj) {
345
+ var YY = obj.year;
346
+ var MM = obj.month >= 10 ? obj.month : "0" + obj.month;
347
+ var DD = obj.day >= 10 ? obj.day : "0" + obj.day;
348
+ var Date = YY + "-" + MM + "-" + DD;
349
+ t.showCalendarEvent(event);
350
+ t.showCalendarList(Date, event, id);
351
+ }
352
+ });
353
+ this.setState(_defineProperty({}, "initCleader_" + id, true));
354
+ }
355
+ }
356
+ }
357
+
358
+ //在日历上显示日程事件(显示点)
359
+
360
+ }, {
361
+ key: 'showCalendarEvent',
362
+ value: function showCalendarEvent(dates, obj, t) {
363
+ var $span = $(".canChoose").find('span');
364
+ $span.removeClass('hasEvent');
365
+ // var dates = this.state.grrc.dateList
366
+ var dates = dates.dateList;
367
+ if (dates) {
368
+ for (var i = 0; i < dates.length; i++) {
369
+ var date = new Date(dates[i]);
370
+ var day = date.getDate();
371
+ $span.eq(parseInt(day) - 1).addClass('hasEvent');
372
+ }
373
+ }
374
+ }
375
+ //显示日程信息
376
+
377
+ }, {
378
+ key: 'showCalendarList',
379
+ value: function showCalendarList(Date, data, id) {
380
+ if (data.dataMap && data.dataMap[Date]) {
381
+ this.setState(_defineProperty({}, 'grrc_list_' + id, data.dataMap[Date]));
382
+ } else {
383
+ this.setState(_defineProperty({}, 'grrc_list_' + id, []));
384
+ }
385
+ }
386
+ }, {
387
+ key: 'globalSearchChange',
388
+ value: function globalSearchChange(newValue) {
389
+ // this.setState({
390
+ // searchVal: newValue
391
+ // });
392
+ location.hash = "homepage/home/fullSearch";
393
+ }
394
+ }, {
395
+ key: 'globalSearchClick',
396
+ value: function globalSearchClick() {
397
+ var modelCode = this.state.modelCode;
398
+ var searchCondition = this.state.searchVal;
399
+ location.hash = "homepage/home/fullSearch/" + modelCode + '/' + searchCondition;
400
+ }
401
+ //跳转到语典
402
+
403
+ }, {
404
+ key: 'gotoYd',
405
+ value: function gotoYd() {
406
+ pageSkipDirectly(_variables2.default.ydPath);
407
+ }
408
+ // 应用跳转
409
+
410
+ }, {
411
+ key: 'newPageSkip',
412
+ value: function newPageSkip(dingUrl, wxUrl, mhUrl, cocallUrl, id) {
413
+ var dingVal = "DING";
414
+ var wxVal = "WX";
415
+ var mhVal = "MH";
416
+ _db2.default.portal.saveAppCount({ mobileAppId: id }).then(function (content) {}).catch(function (err) {
417
+ console.log(err);
418
+ });
419
+
420
+ var data = getLoginUserInfo();
421
+ var thirdMenuType = data.thirdMenuType;
422
+ if (thirdMenuType == dingVal) {
423
+ dd.biz.util.openLink({
424
+ url: dingUrl, //要打开链接的地址
425
+ onSuccess: function onSuccess(result) {
426
+ /**/
427
+ },
428
+ onFail: function onFail(err) {}
429
+ });
430
+ } else if (thirdMenuType == wxVal) {
431
+ window.open(wxUrl);
432
+ } else if (thirdMenuType == mhVal) {
433
+ window.location = mhUrl;
434
+ /**
435
+ emp.navigateTo({
436
+ url: mhUrl,//跳转地址
437
+ success: function () {
438
+ }, //跳转成功回调
439
+ error: function () {
440
+ } //跳转失败回调
441
+ }); */
442
+ } else {
443
+ window.location = dingUrl;
444
+ }
445
+ }
446
+ }, {
447
+ key: 'skipPage',
448
+ value: function skipPage(url) {
449
+ var dingVal = "DING";
450
+ var wxVal = "WX";
451
+ var mhVal = "MH";
452
+ var data = getLoginUserInfo();
453
+ var thirdMenuType = data.thirdMenuType;
454
+ var urlComplete = data.contextPageUrl + "/" + url;
455
+
456
+ if (thirdMenuType == dingVal) {
457
+ dd.biz.util.openLink({
458
+ url: urlComplete, //要打开链接的地址
459
+ onSuccess: function onSuccess(result) {
460
+ /**/
461
+ },
462
+ onFail: function onFail(err) {}
463
+ });
464
+ } else if (thirdMenuType == wxVal) {
465
+ window.open(urlComplete);
466
+ } else if (thirdMenuType == mhVal) {
467
+ window.location = urlComplete;
468
+ } else {
469
+ window.location = urlComplete;
470
+ }
471
+ }
472
+ }, {
473
+ key: 'jumpPage',
474
+ value: function jumpPage(url) {
475
+ location.hash = url;
476
+ }
477
+ //跳转到应用
478
+
479
+ }, {
480
+ key: 'skip2Project',
481
+ value: function skip2Project(code, pagePath) {
482
+ location.hash = pagePath;
483
+ }
484
+
485
+ //跳转到专题
486
+
487
+ }, {
488
+ key: 'skip2Zhuanti',
489
+ value: function skip2Zhuanti(item) {
490
+ var code = item.data.props.code;
491
+ location.hash = "topicservice/" + code;
492
+ }
493
+
494
+ //跳转更多
495
+
496
+ }, {
497
+ key: 'skip2More',
498
+ value: function skip2More(type) {
499
+ var url = "";
500
+ if (type == 'grhy') {
501
+ //会议
502
+ url = getLoginUserInfo().context + '/mobile/modules/meeting/dist/index.html?&context=' + getLoginUserInfo().context + '&hasBottomTab=1';
503
+ pageSkipDirectly(url);
504
+ } else if (type == 'gryj') {
505
+ //个人邮件
506
+ url = getLoginUserInfo().context + '/mobile/modules/mail/dist/index.html?&context=' + getLoginUserInfo().context + '&hasBottomTab=1&isPublic=0#/mail/home/1/';
507
+ pageSkipDirectly(url);
508
+ } else if (type == 'ggyj') {
509
+ //公共邮件
510
+ url = getLoginUserInfo().context + '/mobile/modules/mail/dist/index.html?&context=' + getLoginUserInfo().context + '&hasBottomTab=1&isPublic=1#/mail/home/1/';
511
+ pageSkipDirectly(url);
512
+ } else if (type == 'lcfq') {
513
+ //流程发起
514
+ location.hash = "officehall";
515
+ } else if (type == 'wdsx') {
516
+ //我的事项
517
+ location.hash = "approval/all/5";
518
+ } else if (type == 'bssx') {
519
+ //办事事项
520
+ location.hash = "officehall";
521
+ } else if (type == "jxzt") {
522
+ location.hash = "officehall";
523
+ }
524
+ }
525
+
526
+ //跳转到我的事项
527
+
528
+ }, {
529
+ key: 'skip2Process',
530
+ value: function skip2Process(itemInfo, param_list_type) {
531
+ console.log(itemInfo);
532
+ var param_processKey = itemInfo.processKey; // 流程类型code
533
+ var param_formKey = itemInfo.formKey; // 表单id
534
+ var param_businessKey = itemInfo.businessKey; // 表单数据id;
535
+ var param_startUserId = itemInfo.startUserId; // 流程发起人id
536
+ // let param_list_type = "5"; // 列表类型 待办-0,待阅-1,
537
+ var processName = itemInfo.processName; // 流程名称
538
+ var module = itemInfo.module; // 流程名称
539
+ var type = "all"; //self:本应用,all:全模块
540
+ var projectPath = "modules/mobilehall"; //项目路径
541
+
542
+ var taskId = '';
543
+ var processInstanceId = itemInfo.processInstanceId;
544
+ if (param_list_type == '2') {
545
+ taskId = itemInfo.taskId;
546
+ } else {
547
+ taskId = itemInfo.id;
548
+ }
549
+ var queryurl = "";
550
+ if (param_list_type == "5") {
551
+ queryurl = "?isDraft=1";
552
+ param_list_type = 0;
553
+ }
554
+ var loginUserId = getLoginUserInfo().userId;
555
+ // location.hash = 'approval/approval-details/detail-servlet/' + param_list_type + '/1/' + param_processKey + '/' + param_formKey + '/' +param_businessKey +
556
+ // '/' + param_startUserId;
557
+ // alert(searchVal);
558
+ if (type == "all") {
559
+ if (module == "hall_service") {
560
+ var url = "process/processDetails/" + taskId + "/" + param_formKey + "/" + param_businessKey + "/" + param_list_type + "/0/" + processInstanceId + "/" + module + "/" + loginUserId;
561
+ // if (searchVal != '') {
562
+ // url += "/" + searchVal;
563
+ // }
564
+ url = url + queryurl;
565
+ decodeURI(url);
566
+ location.hash = url;
567
+ } else {
568
+ var fullUrl = window.location.href;
569
+ var mobilePath = module;
570
+ if (module.indexOf("_") > 0) {
571
+ var category = module.split("_")[0];
572
+ mobilePath = module.substring(module.indexOf("_") + 1);
573
+ fullUrl = fullUrl.replace("/" + projectPath + "/", "/" + category + "/" + mobilePath + "/").split('?_')[0].split('/approval/all')[0];
574
+ } else {
575
+ fullUrl = fullUrl.replace("/" + projectPath + "/", "/modules/" + mobilePath + "/").split('?_')[0].split('/approval/all')[0];
576
+ }
577
+ //alert(fullUrl);
578
+ var _url = "process/processDetails/" + taskId + "/" + param_formKey + "/" + param_businessKey + "/" + param_list_type + "/0/" + processInstanceId + "/" + module + "/" + loginUserId;
579
+ _url = fullUrl + '/' + _url;
580
+ _url = _url + queryurl;
581
+ decodeURI(_url);
582
+ location.href = _url;
583
+ }
584
+ }
585
+ }
586
+
587
+ // 区分个人邮件和公共邮件
588
+
589
+ }, {
590
+ key: 'handleChange',
591
+ value: function handleChange(id, obj) {
592
+
593
+ var t = this;
594
+ console.log({
595
+ activeIndex: obj.active,
596
+ preActiveIndex: obj.preActive,
597
+ data: id
598
+ });
599
+ if (obj.active == '1') {
600
+ var _setState4;
601
+
602
+ this.setState((_setState4 = {}, _defineProperty(_setState4, 'activeIndex_ggyj_' + id, true), _defineProperty(_setState4, 'activeIndex_gryj_' + id, false), _setState4));
603
+ } else {
604
+ var _setState5;
605
+
606
+ this.setState((_setState5 = {}, _defineProperty(_setState5, 'activeIndex_gryj_' + id, true), _defineProperty(_setState5, 'activeIndex_ggyj_' + id, false), _setState5));
607
+ }
608
+ }
609
+
610
+ // 部件内容渲染处理函数
611
+
612
+ }, {
613
+ key: 'portalContent',
614
+ value: function portalContent(item) {
615
+ var t = this;
616
+
617
+ if (item.portletCode === 'banner') {
618
+ componentContent = _react2.default.createElement(
619
+ 'div',
620
+ null,
621
+ '1111111'
622
+ );
623
+ }
624
+ if (item.portletCode === 'cyyy') {
625
+ componentContent = _react2.default.createElement(
626
+ 'div',
627
+ null,
628
+ '2222222'
629
+ );
630
+ }
631
+ if (item.portletCode === 'bssx') {
632
+ componentContent = _react2.default.createElement(
633
+ 'div',
634
+ null,
635
+ '3333333'
636
+ );
637
+ }
638
+ if (item.portletCode === 'ttxx') {
639
+ componentContent = _react2.default.createElement(
640
+ 'div',
641
+ null,
642
+ '44444444'
643
+ );
644
+ }
645
+
646
+ return _react2.default.createElement(
647
+ 'div',
648
+ null,
649
+ componentContent
650
+ );
651
+ }
652
+
653
+ // 下拉刷新
654
+
655
+ }, {
656
+ key: 'onRefresh',
657
+ value: function onRefresh() {
658
+ var _this3 = this;
659
+
660
+ // debugger;
661
+ this.setState({ refreshing: true });
662
+ this.initPage();
663
+ // this.setState({
664
+ // refreshing: false,
665
+ // });
666
+ setTimeout(function () {
667
+ _this3.setState({
668
+ refreshing: false
669
+ });
670
+ }, 1000);
671
+ }
672
+ }, {
673
+ key: 'render',
674
+ value: function render() {
675
+ var t = this;
676
+ var context = localStorage.getItem('context');
677
+ var userId = getLoginUserInfo().userId;
678
+ var token = getLoginUserInfo().token;
679
+ var layout = this.state.data.map(function (item) {
680
+ return {
681
+ i: item.id,
682
+ x: item.positionX,
683
+ y: item.positionY,
684
+ w: item.portletWidth,
685
+ h: item.portletHeight,
686
+ static: true //禁止修改部件大小
687
+ };
688
+ });
689
+
690
+ if (!layout || layout.length === 0) {
691
+ return null;
692
+ } else {
693
+ return _react2.default.createElement(
694
+ 'div',
695
+ { className: 'react-grid' },
696
+ _react2.default.createElement(
697
+ _reactGridLayout2.default,
698
+ {
699
+ className: 'layout',
700
+ layout: layout,
701
+ cols: 12,
702
+ rowHeight: 20,
703
+ width: window.innerWidth,
704
+ isDraggable: this.state.isDraggable,
705
+ margin: [0, 15],
706
+ containerPadding: [8, 0]
707
+ },
708
+ this.state.data.map(function (item) {
709
+ return t.portalContent(item) || null;
710
+
711
+ // 添加一个默认返回值,以避免未指定键的错误
712
+ })
713
+ )
714
+ );
715
+ }
716
+ }
717
+ }]);
718
+
719
+ return MyGrid;
720
+ }(_react2.default.Component);
721
+
722
+ exports.default = MyGrid;