@zgfe/modules-event 0.1.7-heyh.3 → 0.1.8-alpha.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.
@@ -16,7 +16,8 @@ import './styles/index.less';
16
16
  var classPrefix = 'search-panel';
17
17
  var SearchPanel = function SearchPanel(props) {
18
18
  var _useContext = useContext(EventContext),
19
- includeToday = _useContext.includeToday;
19
+ includeToday = _useContext.includeToday,
20
+ searchData = _useContext.searchData;
20
21
  var _useState = useState(props.time || getInitDate(includeToday)),
21
22
  _useState2 = _slicedToArray(_useState, 2),
22
23
  time = _useState2[0],
@@ -36,30 +37,30 @@ var SearchPanel = function SearchPanel(props) {
36
37
  dimension = _useState8[0],
37
38
  setDimension = _useState8[1];
38
39
  useEffect(function () {
39
- if (props.chartType && props.chartType !== chart.value) {
40
- if (props.chartType.indexOf(',') !== -1) {
40
+ if (searchData.chartType && searchData.chartType !== chart.value) {
41
+ if (searchData.chartType.indexOf(',') !== -1) {
41
42
  setChart({
42
- value: props.chartType.split(',')[0]
43
+ value: searchData.chartType.split(',')[0]
43
44
  });
44
45
  } else {
45
46
  setChart({
46
- value: props.chartType
47
+ value: searchData.chartType
47
48
  });
48
49
  }
49
50
  }
50
51
  var _dimension = {
51
52
  analysisIndex: 'number'
52
53
  };
53
- if (props.analysisIndex) {
54
+ if (searchData.analysisIndex) {
54
55
  _dimension = {
55
- analysisIndex: props.analysisIndex
56
+ analysisIndex: searchData.analysisIndex
56
57
  };
57
58
  }
58
- if (props.analysisAttr) {
59
- _dimension['analysisAttr'] = props.analysisAttr;
59
+ if (searchData.analysisAttr) {
60
+ _dimension['analysisAttr'] = searchData.analysisAttr;
60
61
  }
61
62
  setDimension(_objectSpread({}, _dimension));
62
- }, []);
63
+ }, [searchData]);
63
64
  useEffect(function () {
64
65
  if (!props.enableSelectChart && chart.value === 'map') {
65
66
  setChart({
@@ -34,8 +34,7 @@ var EventTable = function EventTable(props) {
34
34
  _useContext$eventGrou = _useContext.eventGroupList,
35
35
  eventGroupList = _useContext$eventGrou === void 0 ? [] : _useContext$eventGrou,
36
36
  eventEnvList = _useContext.eventEnvList,
37
- userPropList = _useContext.userPropList,
38
- authority = _useContext.authority;
37
+ userPropList = _useContext.userPropList;
39
38
  var _useContext2 = useContext(EventContext),
40
39
  onUserDrill = _useContext2.onUserDrill,
41
40
  _useContext2$defaultS = _useContext2.defaultSearch,
@@ -180,9 +179,9 @@ var EventTable = function EventTable(props) {
180
179
  className: classPrefix
181
180
  }, /*#__PURE__*/React.createElement("div", {
182
181
  className: "".concat(classPrefix, "-table-header")
183
- }, /*#__PURE__*/React.createElement("span", null, "\u6307\u6807\u8BE6\u60C5"), /*#__PURE__*/React.createElement("div", null, authority[100051] && /*#__PURE__*/React.createElement("div", {
182
+ }, /*#__PURE__*/React.createElement("span", null, "\u6307\u6807\u8BE6\u60C5"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
184
183
  onClick: seeSql
185
- }, "\u67E5\u770BSQL"), authority[100050] && /*#__PURE__*/React.createElement("div", {
184
+ }, "\u67E5\u770BSQL"), /*#__PURE__*/React.createElement("div", {
186
185
  onClick: download
187
186
  }, /*#__PURE__*/React.createElement(IconFont, {
188
187
  type: "xiazai1"
@@ -19,6 +19,7 @@ var TopBar = function TopBar(props) {
19
19
  var _useContext = useContext(EventContext),
20
20
  panelId = _useContext.panelId,
21
21
  afterEditTarget = _useContext.afterEditTarget,
22
+ enableAddScene = _useContext.enableAddScene,
22
23
  loading = _useContext.loading,
23
24
  onLossWarning = _useContext.onLossWarning,
24
25
  showWarning = _useContext.showWarning,
@@ -33,8 +34,7 @@ var TopBar = function TopBar(props) {
33
34
  setShowScene = _useState4[1];
34
35
  var _useContext2 = useContext(BizGlobalDataContext),
35
36
  currentApp = _useContext2.currentApp,
36
- eventGroupList = _useContext2.eventGroupList,
37
- authority = _useContext2.authority;
37
+ eventGroupList = _useContext2.eventGroupList;
38
38
  var searchData = props.searchData,
39
39
  showList = props.showList,
40
40
  platformChange = props.platformChange,
@@ -89,7 +89,6 @@ var TopBar = function TopBar(props) {
89
89
  }, !panelId && /*#__PURE__*/React.createElement("div", {
90
90
  className: "".concat(classPrefix, "-panel")
91
91
  }, /*#__PURE__*/React.createElement(Button, {
92
- disabled: !authority[100049],
93
92
  onClick: function onClick() {
94
93
  setShowPanel(true);
95
94
  }
@@ -108,10 +107,9 @@ var TopBar = function TopBar(props) {
108
107
  onOk: function onOk(data) {
109
108
  return _onOk('panel', data);
110
109
  }
111
- })), !panelId && /*#__PURE__*/React.createElement("div", {
110
+ })), enableAddScene && /*#__PURE__*/React.createElement("div", {
112
111
  className: "".concat(classPrefix, "-scene")
113
112
  }, /*#__PURE__*/React.createElement(Button, {
114
- disabled: !authority[100048],
115
113
  onClick: function onClick() {
116
114
  setShowScene(true);
117
115
  }
@@ -134,11 +132,11 @@ var TopBar = function TopBar(props) {
134
132
  }, "\u6DFB\u52A0\u5230\u6570\u636E\u62A5\u544A")), showWarning && /*#__PURE__*/React.createElement(Button, {
135
133
  className: "".concat(classPrefix, "-earlywarning"),
136
134
  type: "primary",
137
- disabled: loading || !authority[100141],
135
+ disabled: loading,
138
136
  onClick: function onClick() {
139
137
  return onLossWarning(warningId);
140
138
  }
141
- }, "\u8BBE\u7F6E\u6D41\u5931\u9884\u8B66"), /*#__PURE__*/React.createElement("div", {
139
+ }, "\u8BBE\u7F6E\u9884\u8B66\u6D41\u5931"), /*#__PURE__*/React.createElement("div", {
142
140
  className: "".concat(classPrefix, "-platform")
143
141
  }, platformOption.map(function (item) {
144
142
  return /*#__PURE__*/React.createElement("div", {
@@ -25,8 +25,7 @@ var cancel;
25
25
  var classPrefix = 'event-content';
26
26
  var EventContent = function EventContent(props) {
27
27
  var _useContext = useContext(BizGlobalDataContext),
28
- currentApp = _useContext.currentApp,
29
- authority = _useContext.authority;
28
+ currentApp = _useContext.currentApp;
30
29
  var _useContext2 = useContext(EventContext),
31
30
  searchData = _useContext2.searchData,
32
31
  setSearchData = _useContext2.setSearchData,
@@ -78,10 +77,6 @@ var EventContent = function EventContent(props) {
78
77
  handleSearch && handleSearch(loading);
79
78
  }, [loading]);
80
79
  var fetchRequest = function fetchRequest(flag) {
81
- if (!authority[100047]) {
82
- message.error('无查询权限');
83
- return;
84
- }
85
80
  if (JSON.stringify(searchData) === JSON.stringify(finalSearchData)) {
86
81
  return;
87
82
  }
@@ -13,7 +13,7 @@ export var judgeFilterValue = function judgeFilterValue(data, count) {
13
13
  }
14
14
  data.conditions.map(function (item) {
15
15
  var _item$values;
16
- if (item.values && (((_item$values = item.values) === null || _item$values === void 0 ? void 0 : _item$values.length) <= 0 || item.values[0] === '')) flag = false;
16
+ if (item.values && (((_item$values = item.values) === null || _item$values === void 0 ? void 0 : _item$values.length) <= 0 || item.values[0] === '') && !((item === null || item === void 0 ? void 0 : item.operator) && /^is null$|^is not null$/.test(item === null || item === void 0 ? void 0 : item.operator))) flag = false;
17
17
  });
18
18
  }
19
19
  return flag;
@@ -39,7 +39,7 @@ export default (function () {
39
39
  console.log('查询参数改变了:', data);
40
40
  };
41
41
  var onLossWarning = function onLossWarning(warningId) {
42
- console.log('设置流失预警', warningId);
42
+ console.log('设置预警流失', warningId);
43
43
  };
44
44
  return /*#__PURE__*/React.createElement(DemoWrapper, {
45
45
  needMeta: true,
@@ -43,7 +43,8 @@ var defaultValue = {
43
43
  }
44
44
  },
45
45
  chosen_data: [],
46
- source: 'EVENT'
46
+ source: 'EVENT',
47
+ enableAddScene: false
47
48
  };
48
49
  export default (function () {
49
50
  var _useState = useState(false),
@@ -149,6 +149,7 @@ var ModuleEvent = function ModuleEvent(props) {
149
149
  panelName: title,
150
150
  includeToday: props.includeToday,
151
151
  showWarning: props.showWarning,
152
+ enableAddScene: props.defaultValue && props.defaultValue.enableAddScene === false ? false : true,
152
153
  afterEditTarget: props.afterEditTarget,
153
154
  onUserDrill: props.onUserDrill,
154
155
  onLossWarning: props.onLossWarning,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-event",
3
- "version": "0.1.7-heyh.3",
3
+ "version": "0.1.8-alpha.0",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -49,7 +49,7 @@
49
49
  "react": "^16.12.0 || ^17.0.0",
50
50
  "yorkie": "^2.0.0"
51
51
  },
52
- "gitHead": "19a381129050e920c2f4996d1365e803617bdc35",
52
+ "gitHead": "407c01609bf6d86be468b4ff1612dafd644cd983",
53
53
  "dependencies": {
54
54
  "react-copy-to-clipboard": "^5.1.0",
55
55
  "react-highlight": "^0.15.0"