@zgfe/modules-dm 1.0.57-zhongyuan.66 → 1.0.57-zhongyuan.68

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.
@@ -21,6 +21,7 @@ import { Card, Form, Input, Upload, message, Table, Button, Space, Empty, Spin }
21
21
  import { LoadingOutlined, PlusOutlined, SlidersTwoTone } from '@ant-design/icons';
22
22
  import React, { useState, useContext, useEffect } from 'react';
23
23
  import { IconFont, BizGlobalDataContext, ajax } from '@zgfe/business-lib';
24
+ import { fetchAllEvents } from '@zgfe/business-lib/es/utils/eventApi';
24
25
  import apis from '../../../constants/api';
25
26
  import request from '../../../utils/ajax';
26
27
  import { guid } from '../../../utils/index';
@@ -264,7 +265,7 @@ var RightDetail = function RightDetail(props) {
264
265
  }();
265
266
  var handleButtonPage = /*#__PURE__*/function () {
266
267
  var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(flag) {
267
- var filterJsonList, obj, xifenList, attrFilterJsonList, modulePageJsonList, _eventNameMap$current, _eventNameMap$current2, _eventNameMap$current3, _eventNameMap$current4, moduleAttrObj, pageAttrObj, _obj, obj1, allFilterObj, globalDimensionsList, resultParams;
268
+ var filterJsonList, obj, xifenList, attrFilterJsonList, modulePageJsonList, _attrListApi$filter, _attrListApi$filter2, attrListApi, moduleAttrObj, pageAttrObj, _obj, obj1, allFilterObj, globalDimensionsList, resultParams;
268
269
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
269
270
  while (1) switch (_context3.prev = _context3.next) {
270
271
  case 0:
@@ -300,40 +301,48 @@ var RightDetail = function RightDetail(props) {
300
301
  });
301
302
  // page module 的值拼接
302
303
  modulePageJsonList = [];
303
- if (eventNameMap && (currentMap === null || currentMap === void 0 ? void 0 : currentMap.eventName)) {
304
- moduleAttrObj = (_eventNameMap$current = eventNameMap[currentMap === null || currentMap === void 0 ? void 0 : currentMap.eventName]) === null || _eventNameMap$current === void 0 ? void 0 : (_eventNameMap$current2 = _eventNameMap$current.attrList.filter(function (o) {
305
- return o.label == (currentMap === null || currentMap === void 0 ? void 0 : currentMap.moduleAttrName);
306
- })) === null || _eventNameMap$current2 === void 0 ? void 0 : _eventNameMap$current2[0];
307
- pageAttrObj = (_eventNameMap$current3 = eventNameMap[currentMap === null || currentMap === void 0 ? void 0 : currentMap.eventName]) === null || _eventNameMap$current3 === void 0 ? void 0 : (_eventNameMap$current4 = _eventNameMap$current3.attrList.filter(function (o) {
308
- return o.label == (currentMap === null || currentMap === void 0 ? void 0 : currentMap.pageAttrName);
309
- })) === null || _eventNameMap$current4 === void 0 ? void 0 : _eventNameMap$current4[0];
310
- if (moduleAttrObj) {
311
- _obj = {
312
- attrId: moduleAttrObj.id,
313
- attrName: moduleAttrObj.label,
314
- dimensionSub: moduleAttrObj.dimensionSub,
315
- label: moduleAttrObj.label,
316
- operator: 'equal',
317
- propCategory: 'eventProp',
318
- type: moduleAttrObj.type,
319
- values: moduleAttrObj === null || moduleAttrObj === void 0 ? void 0 : moduleAttrObj.values
320
- };
321
- modulePageJsonList.push(_obj);
322
- }
323
- if (pageAttrObj) {
324
- obj1 = {
325
- attrId: pageAttrObj.id,
326
- attrName: pageAttrObj.label,
327
- dimensionSub: pageAttrObj.dimensionSub,
328
- label: pageAttrObj.label,
329
- operator: 'equal',
330
- propCategory: 'eventProp',
331
- type: pageAttrObj.type,
332
- values: pageAttrObj === null || pageAttrObj === void 0 ? void 0 : pageAttrObj.values
333
- };
334
- modulePageJsonList.push(obj1);
335
- }
304
+ if (!(eventNameMap && (currentMap === null || currentMap === void 0 ? void 0 : currentMap.eventName))) {
305
+ _context3.next = 14;
306
+ break;
307
+ }
308
+ _context3.next = 9;
309
+ return fetchAllEvents(currentMap === null || currentMap === void 0 ? void 0 : currentMap.eventId, currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId);
310
+ case 9:
311
+ attrListApi = _context3.sent;
312
+ // 事件下的细分
313
+ moduleAttrObj = (_attrListApi$filter = attrListApi.filter(function (o) {
314
+ return o.label == (currentMap === null || currentMap === void 0 ? void 0 : currentMap.moduleAttrName);
315
+ })) === null || _attrListApi$filter === void 0 ? void 0 : _attrListApi$filter[0];
316
+ pageAttrObj = (_attrListApi$filter2 = attrListApi.filter(function (o) {
317
+ return o.label == (currentMap === null || currentMap === void 0 ? void 0 : currentMap.pageAttrName);
318
+ })) === null || _attrListApi$filter2 === void 0 ? void 0 : _attrListApi$filter2[0];
319
+ if (moduleAttrObj) {
320
+ _obj = {
321
+ attrId: moduleAttrObj.id,
322
+ attrName: moduleAttrObj.label,
323
+ dimensionSub: moduleAttrObj.dimensionSub,
324
+ label: moduleAttrObj.label,
325
+ operator: 'equal',
326
+ propCategory: 'eventProp',
327
+ type: moduleAttrObj.type,
328
+ values: moduleAttrObj === null || moduleAttrObj === void 0 ? void 0 : moduleAttrObj.values
329
+ };
330
+ modulePageJsonList.push(_obj);
336
331
  }
332
+ if (pageAttrObj) {
333
+ obj1 = {
334
+ attrId: pageAttrObj.id,
335
+ attrName: pageAttrObj.label,
336
+ dimensionSub: pageAttrObj.dimensionSub,
337
+ label: pageAttrObj.label,
338
+ operator: 'equal',
339
+ propCategory: 'eventProp',
340
+ type: pageAttrObj.type,
341
+ values: pageAttrObj === null || pageAttrObj === void 0 ? void 0 : pageAttrObj.values
342
+ };
343
+ modulePageJsonList.push(obj1);
344
+ }
345
+ case 14:
337
346
  allFilterObj = {
338
347
  relation: 'and',
339
348
  conditions: [].concat(_toConsumableArray(filterJsonList), attrFilterJsonList, modulePageJsonList)
@@ -376,7 +385,7 @@ var RightDetail = function RightDetail(props) {
376
385
  }
377
386
  });
378
387
  });
379
- case 12:
388
+ case 19:
380
389
  case "end":
381
390
  return _context3.stop();
382
391
  }
@@ -396,31 +405,36 @@ var RightDetail = function RightDetail(props) {
396
405
  }, [currentTreeData]);
397
406
  var xunapi = /*#__PURE__*/function () {
398
407
  var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
399
- var haveEventName, haveModuleAttr, havePageAttr, objConditions, b1, b7, b30;
408
+ var haveEventName, attrListApi, haveModuleAttr, havePageAttr, objConditions, b1, b7, b30;
400
409
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
401
410
  while (1) switch (_context4.prev = _context4.next) {
402
411
  case 0:
403
412
  // console.log(currentTreeData, currentMap, eventGroupList,eventNameMap, 'currentTreeData');
404
413
  haveEventName = eventNameMap === null || eventNameMap === void 0 ? void 0 : eventNameMap[currentTreeData.eventName]; // 查找事件
405
- haveModuleAttr = haveEventName === null || haveEventName === void 0 ? void 0 : haveEventName.attrList.find(function (o) {
414
+ _context4.next = 3;
415
+ return fetchAllEvents(currentTreeData === null || currentTreeData === void 0 ? void 0 : currentTreeData.eventId, currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId);
416
+ case 3:
417
+ attrListApi = _context4.sent;
418
+ // 事件下的细分
419
+ haveModuleAttr = attrListApi.find(function (o) {
406
420
  return o.label == (currentMap === null || currentMap === void 0 ? void 0 : currentMap.moduleAttrName);
407
421
  }); // 事件模块的属性
408
422
  if (haveModuleAttr) {
409
423
  haveModuleAttr['values'] = [currentTreeData.moduleAttrName];
410
424
  }
411
- havePageAttr = haveEventName === null || haveEventName === void 0 ? void 0 : haveEventName.attrList.find(function (o) {
425
+ havePageAttr = attrListApi.find(function (o) {
412
426
  return o.label == (currentMap === null || currentMap === void 0 ? void 0 : currentMap.pageAttrName);
413
427
  }); // 事件页面的属性
414
428
  if (havePageAttr) {
415
429
  havePageAttr['values'] = [currentTreeData.pageAttrName];
416
430
  }
417
431
  if (haveModuleAttr) {
418
- _context4.next = 8;
432
+ _context4.next = 11;
419
433
  break;
420
434
  }
421
435
  message.warning("".concat(currentMap === null || currentMap === void 0 ? void 0 : currentMap.moduleAttrName, "\u4E0B\u7684").concat(currentMap === null || currentMap === void 0 ? void 0 : currentMap.pageAttrName, "\u6CA1\u6709"));
422
436
  return _context4.abrupt("return");
423
- case 8:
437
+ case 11:
424
438
  objConditions = [{
425
439
  attrId: haveModuleAttr === null || haveModuleAttr === void 0 ? void 0 : haveModuleAttr.id,
426
440
  propCategory: 'eventProp',
@@ -441,17 +455,17 @@ var RightDetail = function RightDetail(props) {
441
455
  attrName: havePageAttr === null || havePageAttr === void 0 ? void 0 : havePageAttr.label
442
456
  }]; // console.log(objConditions, 'kkk');
443
457
  setInterviewLoading(true);
444
- _context4.next = 12;
458
+ _context4.next = 15;
445
459
  return dayValues(objConditions, moment().subtract(1, 'days').format('YYYY-MM-DD'), moment().format('YYYY-MM-DD'), [1, 0]);
446
- case 12:
460
+ case 15:
447
461
  b1 = _context4.sent;
448
- _context4.next = 15;
462
+ _context4.next = 18;
449
463
  return dayValues(objConditions, moment().subtract(7, 'days').format('YYYY-MM-DD'), moment().format('YYYY-MM-DD'), [7, 0]);
450
- case 15:
464
+ case 18:
451
465
  b7 = _context4.sent;
452
- _context4.next = 18;
466
+ _context4.next = 21;
453
467
  return dayValues(objConditions, moment().subtract(30, 'days').format('YYYY-MM-DD'), moment().format('YYYY-MM-DD'), [30, 0]);
454
- case 18:
468
+ case 21:
455
469
  b30 = _context4.sent;
456
470
  setInterviewLoading(false);
457
471
  setData([{
@@ -461,7 +475,7 @@ var RightDetail = function RightDetail(props) {
461
475
  nearlyDays: b7,
462
476
  nearlyDays1: b30
463
477
  }]);
464
- case 21:
478
+ case 24:
465
479
  case "end":
466
480
  return _context4.stop();
467
481
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-dm",
3
- "version": "1.0.57-zhongyuan.66",
3
+ "version": "1.0.57-zhongyuan.68",
4
4
  "license": "ISC",
5
5
  "module": "es/index.js",
6
6
  "typings": "es/index.d.ts",
@@ -46,7 +46,7 @@
46
46
  "@types/lodash": "^4.14.182",
47
47
  "@umijs/fabric": "^2.8.1",
48
48
  "@umijs/test": "^3.0.5",
49
- "@zgfe/business-lib": "1.2.70-hxd.1",
49
+ "@zgfe/business-lib": "1.2.71-hxd.39",
50
50
  "antd": "4.24.10",
51
51
  "dumi": "^1.1.0",
52
52
  "father-build": "^1.17.2",
@@ -57,7 +57,7 @@
57
57
  "umi-request": "^1.4.0",
58
58
  "yorkie": "^2.0.0"
59
59
  },
60
- "gitHead": "d8374986d034d8bc9129dc2b6be6598e7d3ff0f7",
60
+ "gitHead": "5d29d195368def27f68c28f3e72174fcb44e60d8",
61
61
  "gitHooks": {
62
62
  "pre-commit": "lint-staged"
63
63
  }