@zgfe/modules-interval 1.0.10 → 1.0.11-zbank.0

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.
@@ -12,12 +12,12 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
13
  import React, { useContext, useEffect, useState } from 'react';
14
14
  import { Spin } from 'antd';
15
- import { BizGlobalDataContext, BizTargetFromPanel, ajax } from '@zgfe/business-lib';
15
+ import { BizGlobalDataContext, BizTargetFromPanel } from '@zgfe/business-lib';
16
16
  import "./styles/index.less";
17
17
  import { IntervalContext } from "../../types";
18
18
  import { getInitDate } from "../../constants/initData";
19
19
  import EventContent from "../content";
20
- import { Apis, chartTypes } from "../../constants";
20
+ import { chartTypes } from "../../constants";
21
21
  var classPrefix = 'interval-module-container';
22
22
  var ModuleInterval = function ModuleInterval(props) {
23
23
  // 属性
@@ -53,35 +53,18 @@ var ModuleInterval = function ModuleInterval(props) {
53
53
  _useState12 = _slicedToArray(_useState11, 2),
54
54
  showList = _useState12[0],
55
55
  setShowList = _useState12[1];
56
- var _useState13 = useState(false),
57
- _useState14 = _slicedToArray(_useState13, 2),
58
- subjectEnable = _useState14[0],
59
- setSubjectEnable = _useState14[1];
60
56
  // 初始化
61
57
  useEffect(function () {
62
- setLoading(true);
63
- ajax(Apis.querySubjectDisplay, {
64
- method: 'post',
65
- data: {
66
- appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId
67
- }
68
- }).then(function (res) {
69
- if (!res) return;
70
- setSubjectEnable(res.data);
71
- // 设置初始值
72
- if (!props.defaultValue) {
73
- initSearch();
74
- } else {
75
- setShowList(props.defaultValue.chosen_data);
76
- setPanelId(props.defaultValue.panelId);
77
- setElementId(props.defaultValue.id);
78
- setTitle(props.defaultValue.name);
79
- setSearchData(props.defaultValue.data);
80
- }
81
- setTimeout(function () {
82
- setLoading(false);
83
- });
84
- });
58
+ // 设置初始值
59
+ if (!props.defaultValue) {
60
+ initSearch();
61
+ } else {
62
+ setShowList(props.defaultValue.chosen_data);
63
+ setPanelId(props.defaultValue.panelId);
64
+ setElementId(props.defaultValue.id);
65
+ setTitle(props.defaultValue.name);
66
+ setSearchData(props.defaultValue.data);
67
+ }
85
68
  }, []);
86
69
 
87
70
  // 查询条件初始化
@@ -12,7 +12,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
13
  import React, { useContext, useEffect, useState } from 'react';
14
14
  import { Form, Button, Radio, Space, Switch } from 'antd';
15
- import { BizAttributeSelector, BizSelect, BizUserGroupHeader, useSubject } from '@zgfe/business-lib';
15
+ import { BizAttributeSelector, BizSelect, BizUserGroupHeader } from '@zgfe/business-lib';
16
16
  import EventFilter from "../../components/eventFilter";
17
17
  import "./styles/index.less";
18
18
  import { AnalysisMode } from "./types";
@@ -40,9 +40,6 @@ var TopPanel = function TopPanel(props) {
40
40
  _useState6 = _slicedToArray(_useState5, 2),
41
41
  relevancy = _useState6[0],
42
42
  setRelevancy = _useState6[1];
43
- var _useSubject = useSubject(),
44
- subjectList = _useSubject.subjectList,
45
- subjectLoading = _useSubject.loading;
46
43
  var _useContext = useContext(IntervalContext),
47
44
  subjectEnable = _useContext.subjectEnable;
48
45
  var _ref = defaultValue || {},
@@ -98,7 +95,6 @@ var TopPanel = function TopPanel(props) {
98
95
  }, true);
99
96
  };
100
97
  useEffect(function () {
101
- if (subjectLoading) return;
102
98
  if (!defaultValue) {
103
99
  setInited(true);
104
100
  return;
@@ -109,14 +105,8 @@ var TopPanel = function TopPanel(props) {
109
105
  } else {
110
106
  setAnalysisType('user');
111
107
  }
112
- if (defaultValue.analysisSubject) {
113
- setCurrentSubject(subjectList.find(function (item) {
114
- var _defaultValue$analysi;
115
- return item.id === (defaultValue === null || defaultValue === void 0 ? void 0 : (_defaultValue$analysi = defaultValue.analysisSubject) === null || _defaultValue$analysi === void 0 ? void 0 : _defaultValue$analysi.subjectId);
116
- }));
117
- }
118
108
  setInited(true);
119
- }, [subjectLoading]);
109
+ }, []);
120
110
  if (!inited) return null;
121
111
  return /*#__PURE__*/React.createElement(Form, {
122
112
  form: form,
@@ -173,31 +163,6 @@ var TopPanel = function TopPanel(props) {
173
163
  setAnalysisType(val.value);
174
164
  resetting();
175
165
  }
176
- })), analysisType === 'eventProp' && /*#__PURE__*/React.createElement(Form.Item, {
177
- label: "\u4E3B\u4F53\u540D\u79F0",
178
- name: "analysisSubject",
179
- className: "panel-form-interval-item",
180
- rules: [{
181
- validator: function validator(rule, value) {
182
- if (!value) {
183
- return Promise.reject('请选择主体名称');
184
- }
185
- return Promise.resolve();
186
- }
187
- }]
188
- }, /*#__PURE__*/React.createElement(BizSelect, {
189
- options: subjectList,
190
- aliasField: "subjectAlias",
191
- labelField: "subjectName",
192
- keyField: "id",
193
- onChange: function onChange(val) {
194
- var _formRef$current, _formRef$current2, _formRef$current3;
195
- setCurrentSubject(val);
196
- setRelevancy(false);
197
- (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.setFieldValue('start', undefined);
198
- (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : _formRef$current2.setFieldValue('end', undefined);
199
- (_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : _formRef$current3.setFieldValue('dimension', undefined);
200
- }
201
166
  })), analysisType === 'user' && /*#__PURE__*/React.createElement(Form.Item, {
202
167
  label: "",
203
168
  name: "userGroup",
@@ -248,9 +213,9 @@ var TopPanel = function TopPanel(props) {
248
213
  key: "".concat(currentSubject === null || currentSubject === void 0 ? void 0 : currentSubject.subjectName, "-start"),
249
214
  analysisType: analysisType,
250
215
  onChange: function onChange(evt) {
251
- var _formRef$current4;
216
+ var _formRef$current;
252
217
  setStartEvent(evt);
253
- (_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 ? void 0 : _formRef$current4.setFieldValue('dimension', undefined);
218
+ (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.setFieldValue('dimension', undefined);
254
219
  }
255
220
  })), /*#__PURE__*/React.createElement(Space, {
256
221
  align: "baseline",
@@ -295,8 +260,8 @@ var TopPanel = function TopPanel(props) {
295
260
  enableDelete: true,
296
261
  key: "".concat(startEvent === null || startEvent === void 0 ? void 0 : startEvent.id, "-").concat(endEvent === null || endEvent === void 0 ? void 0 : endEvent.id, "-pre"),
297
262
  onDelete: function onDelete() {
298
- var _formRef$current5;
299
- (_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 ? void 0 : _formRef$current5.setFieldValue('associatedPreAttr', undefined);
263
+ var _formRef$current2;
264
+ (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : _formRef$current2.setFieldValue('associatedPreAttr', undefined);
300
265
  }
301
266
  }))), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
302
267
  className: "associated-label"
@@ -318,8 +283,8 @@ var TopPanel = function TopPanel(props) {
318
283
  enableDelete: true,
319
284
  key: "".concat(startEvent === null || startEvent === void 0 ? void 0 : startEvent.id, "-").concat(endEvent === null || endEvent === void 0 ? void 0 : endEvent.id, "-next"),
320
285
  onDelete: function onDelete() {
321
- var _formRef$current6;
322
- (_formRef$current6 = formRef.current) === null || _formRef$current6 === void 0 ? void 0 : _formRef$current6.setFieldValue('associatedNextAttr', undefined);
286
+ var _formRef$current3;
287
+ (_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : _formRef$current3.setFieldValue('associatedNextAttr', undefined);
323
288
  }
324
289
  }))), /*#__PURE__*/React.createElement("i", {
325
290
  style: {
@@ -328,9 +293,9 @@ var TopPanel = function TopPanel(props) {
328
293
  cursor: 'pointer'
329
294
  },
330
295
  onClick: function onClick() {
331
- var _formRef$current7, _formRef$current8;
332
- (_formRef$current7 = formRef.current) === null || _formRef$current7 === void 0 ? void 0 : _formRef$current7.setFieldValue('associatedPreAttr', undefined);
333
- (_formRef$current8 = formRef.current) === null || _formRef$current8 === void 0 ? void 0 : _formRef$current8.setFieldValue('associatedNextAttr', undefined);
296
+ var _formRef$current4, _formRef$current5;
297
+ (_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 ? void 0 : _formRef$current4.setFieldValue('associatedPreAttr', undefined);
298
+ (_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 ? void 0 : _formRef$current5.setFieldValue('associatedNextAttr', undefined);
334
299
  setRelevancy(false);
335
300
  },
336
301
  className: "bsicon qingchu"
@@ -363,9 +328,9 @@ var TopPanel = function TopPanel(props) {
363
328
  analysisType: analysisType,
364
329
  key: "".concat(currentSubject === null || currentSubject === void 0 ? void 0 : currentSubject.subjectName, "-start"),
365
330
  onChange: function onChange(val) {
366
- var _formRef$current9;
331
+ var _formRef$current6;
367
332
  setEndEvent(val);
368
- (_formRef$current9 = formRef.current) === null || _formRef$current9 === void 0 ? void 0 : _formRef$current9.setFieldValue('dimension', undefined);
333
+ (_formRef$current6 = formRef.current) === null || _formRef$current6 === void 0 ? void 0 : _formRef$current6.setFieldValue('dimension', undefined);
369
334
  }
370
335
  })), /*#__PURE__*/React.createElement(Form.Item, {
371
336
  label: "\u6309\u5C5E\u6027\u7EC6\u5206",
@@ -380,8 +345,8 @@ var TopPanel = function TopPanel(props) {
380
345
  showCommonProp: true,
381
346
  enableDelete: true,
382
347
  onDelete: function onDelete() {
383
- var _formRef$current10;
384
- (_formRef$current10 = formRef.current) === null || _formRef$current10 === void 0 ? void 0 : _formRef$current10.setFieldValue('dimension', undefined);
348
+ var _formRef$current7;
349
+ (_formRef$current7 = formRef.current) === null || _formRef$current7 === void 0 ? void 0 : _formRef$current7.setFieldValue('dimension', undefined);
385
350
  }
386
351
  })), /*#__PURE__*/React.createElement(Form.Item, {
387
352
  label: "\u5206\u6790\u6A21\u578B",
@@ -396,11 +361,11 @@ var TopPanel = function TopPanel(props) {
396
361
  }, /*#__PURE__*/React.createElement(Button, {
397
362
  onClick: resetting
398
363
  }, "\u91CD\u7F6E"), /*#__PURE__*/React.createElement(Button, {
399
- loading: loading || subjectLoading,
364
+ loading: loading,
400
365
  type: "primary",
401
366
  onClick: function onClick() {
402
- var _formRef$current11;
403
- (_formRef$current11 = formRef.current) === null || _formRef$current11 === void 0 ? void 0 : _formRef$current11.submit();
367
+ var _formRef$current8;
368
+ (_formRef$current8 = formRef.current) === null || _formRef$current8 === void 0 ? void 0 : _formRef$current8.submit();
404
369
  }
405
370
  }, "\u67E5\u8BE2"))));
406
371
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-interval",
3
- "version": "1.0.10",
3
+ "version": "1.0.11-zbank.0",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -62,5 +62,5 @@
62
62
  "umi-request": "^1.4.0",
63
63
  "yorkie": "^2.0.0"
64
64
  },
65
- "gitHead": "31ad9068745026d4a5bfee57ad6d175cb1c8a573"
65
+ "gitHead": "8ec9fa9b85c23d416be5ababb681cdbbad413975"
66
66
  }