@zgfe/modules-event 0.1.8-alpha.1 → 0.1.9

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.
@@ -34,7 +34,8 @@ 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;
37
+ userPropList = _useContext.userPropList,
38
+ authority = _useContext.authority;
38
39
  var _useContext2 = useContext(EventContext),
39
40
  onUserDrill = _useContext2.onUserDrill,
40
41
  _useContext2$defaultS = _useContext2.defaultSearch,
@@ -179,9 +180,9 @@ var EventTable = function EventTable(props) {
179
180
  className: classPrefix
180
181
  }, /*#__PURE__*/React.createElement("div", {
181
182
  className: "".concat(classPrefix, "-table-header")
182
- }, /*#__PURE__*/React.createElement("span", null, "\u6307\u6807\u8BE6\u60C5"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
183
+ }, /*#__PURE__*/React.createElement("span", null, "\u6307\u6807\u8BE6\u60C5"), /*#__PURE__*/React.createElement("div", null, authority[100051] && /*#__PURE__*/React.createElement("div", {
183
184
  onClick: seeSql
184
- }, "\u67E5\u770BSQL"), /*#__PURE__*/React.createElement("div", {
185
+ }, "\u67E5\u770BSQL"), authority[100050] && /*#__PURE__*/React.createElement("div", {
185
186
  onClick: download
186
187
  }, /*#__PURE__*/React.createElement(IconFont, {
187
188
  type: "xiazai1"
@@ -19,7 +19,6 @@ 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,
23
22
  loading = _useContext.loading,
24
23
  onLossWarning = _useContext.onLossWarning,
25
24
  showWarning = _useContext.showWarning,
@@ -34,7 +33,8 @@ var TopBar = function TopBar(props) {
34
33
  setShowScene = _useState4[1];
35
34
  var _useContext2 = useContext(BizGlobalDataContext),
36
35
  currentApp = _useContext2.currentApp,
37
- eventGroupList = _useContext2.eventGroupList;
36
+ eventGroupList = _useContext2.eventGroupList,
37
+ authority = _useContext2.authority;
38
38
  var searchData = props.searchData,
39
39
  showList = props.showList,
40
40
  platformChange = props.platformChange,
@@ -89,6 +89,7 @@ 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],
92
93
  onClick: function onClick() {
93
94
  setShowPanel(true);
94
95
  }
@@ -107,9 +108,10 @@ var TopBar = function TopBar(props) {
107
108
  onOk: function onOk(data) {
108
109
  return _onOk('panel', data);
109
110
  }
110
- })), enableAddScene && /*#__PURE__*/React.createElement("div", {
111
+ })), !panelId && /*#__PURE__*/React.createElement("div", {
111
112
  className: "".concat(classPrefix, "-scene")
112
113
  }, /*#__PURE__*/React.createElement(Button, {
114
+ disabled: !authority[100048],
113
115
  onClick: function onClick() {
114
116
  setShowScene(true);
115
117
  }
@@ -132,11 +134,11 @@ var TopBar = function TopBar(props) {
132
134
  }, "\u6DFB\u52A0\u5230\u6570\u636E\u62A5\u544A")), showWarning && /*#__PURE__*/React.createElement(Button, {
133
135
  className: "".concat(classPrefix, "-earlywarning"),
134
136
  type: "primary",
135
- disabled: loading,
137
+ disabled: loading || !authority[100141],
136
138
  onClick: function onClick() {
137
139
  return onLossWarning(warningId);
138
140
  }
139
- }, "\u8BBE\u7F6E\u9884\u8B66\u6D41\u5931"), /*#__PURE__*/React.createElement("div", {
141
+ }, "\u8BBE\u7F6E\u6D41\u5931\u9884\u8B66"), /*#__PURE__*/React.createElement("div", {
140
142
  className: "".concat(classPrefix, "-platform")
141
143
  }, platformOption.map(function (item) {
142
144
  return /*#__PURE__*/React.createElement("div", {
@@ -25,7 +25,8 @@ 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;
28
+ currentApp = _useContext.currentApp,
29
+ authority = _useContext.authority;
29
30
  var _useContext2 = useContext(EventContext),
30
31
  searchData = _useContext2.searchData,
31
32
  setSearchData = _useContext2.setSearchData,
@@ -77,6 +78,10 @@ var EventContent = function EventContent(props) {
77
78
  handleSearch && handleSearch(loading);
78
79
  }, [loading]);
79
80
  var fetchRequest = function fetchRequest(flag) {
81
+ if (!authority[100047]) {
82
+ message.error('无查询权限');
83
+ return;
84
+ }
80
85
  if (JSON.stringify(searchData) === JSON.stringify(finalSearchData)) {
81
86
  return;
82
87
  }
@@ -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,8 +43,7 @@ var defaultValue = {
43
43
  }
44
44
  },
45
45
  chosen_data: [],
46
- source: 'EVENT',
47
- enableAddScene: false
46
+ source: 'EVENT'
48
47
  };
49
48
  export default (function () {
50
49
  var _useState = useState(false),
@@ -149,7 +149,6 @@ 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,
153
152
  afterEditTarget: props.afterEditTarget,
154
153
  onUserDrill: props.onUserDrill,
155
154
  onLossWarning: props.onLossWarning,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-event",
3
- "version": "0.1.8-alpha.1",
3
+ "version": "0.1.9",
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": "da16e1c4e9e8e3b226f412262d206c5375744af0",
52
+ "gitHead": "240bd13fb8ecc894adfc5c0c4ec1fc0cd5aaecfa",
53
53
  "dependencies": {
54
54
  "react-copy-to-clipboard": "^5.1.0",
55
55
  "react-highlight": "^0.15.0"