@zgfe/modules-event 0.1.8 → 0.1.10

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.
@@ -24,7 +24,8 @@ var classPrefix = 'event-mi-table';
24
24
  var EventTable = function EventTable(props) {
25
25
  var dataSource = props.dataSource,
26
26
  searchData = props.searchData,
27
- showList = props.showList;
27
+ showList = props.showList,
28
+ sourcePanel = props.sourcePanel;
28
29
  var _useState = useState([]),
29
30
  _useState2 = _slicedToArray(_useState, 2),
30
31
  tableData = _useState2[0],
@@ -34,7 +35,8 @@ var EventTable = function EventTable(props) {
34
35
  _useContext$eventGrou = _useContext.eventGroupList,
35
36
  eventGroupList = _useContext$eventGrou === void 0 ? [] : _useContext$eventGrou,
36
37
  eventEnvList = _useContext.eventEnvList,
37
- userPropList = _useContext.userPropList;
38
+ userPropList = _useContext.userPropList,
39
+ authority = _useContext.authority;
38
40
  var _useContext2 = useContext(EventContext),
39
41
  onUserDrill = _useContext2.onUserDrill,
40
42
  _useContext2$defaultS = _useContext2.defaultSearch,
@@ -177,16 +179,16 @@ var EventTable = function EventTable(props) {
177
179
  };
178
180
  return /*#__PURE__*/React.createElement("div", {
179
181
  className: classPrefix
180
- }, /*#__PURE__*/React.createElement("div", {
182
+ }, !sourcePanel && /*#__PURE__*/React.createElement("div", {
181
183
  className: "".concat(classPrefix, "-table-header")
182
- }, /*#__PURE__*/React.createElement("span", null, "\u6307\u6807\u8BE6\u60C5"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
184
+ }, /*#__PURE__*/React.createElement("span", null, "\u6307\u6807\u8BE6\u60C5"), /*#__PURE__*/React.createElement("div", null, authority[100051] && /*#__PURE__*/React.createElement("div", {
183
185
  onClick: seeSql
184
- }, "\u67E5\u770BSQL"), /*#__PURE__*/React.createElement("div", {
186
+ }, "\u67E5\u770BSQL"), authority[100050] && /*#__PURE__*/React.createElement("div", {
185
187
  onClick: download
186
188
  }, /*#__PURE__*/React.createElement(IconFont, {
187
189
  type: "xiazai1"
188
190
  }), "\u4E0B\u8F7D\u6570\u636E"))), /*#__PURE__*/React.createElement("div", {
189
- className: "table-area"
191
+ className: "table-area ".concat(sourcePanel ? 'sourcepanel-table-header' : '')
190
192
  }, /*#__PURE__*/React.createElement(ConfigProvider, {
191
193
  renderEmpty: tableEmptyRender
192
194
  }, /*#__PURE__*/React.createElement(Table, {
@@ -45,6 +45,10 @@
45
45
  }
46
46
  }
47
47
  }
48
+ .sourcepanel-table-header {
49
+ overflow: hidden;
50
+ border-radius: 8px 8px 0 0;
51
+ }
48
52
  .ant-table {
49
53
  max-height: 550px;
50
54
  overflow: auto;
@@ -1,6 +1,7 @@
1
1
  import { ResponseDataProps, SearchValue } from '../../types';
2
2
  export interface EventTableProps {
3
3
  dataSource: ResponseDataProps;
4
+ sourcePanel: boolean;
4
5
  searchData: SearchValue;
5
6
  showList: string[];
6
7
  isOverview?: boolean;
@@ -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", {
@@ -168,6 +168,7 @@ var EventChart = /*#__PURE__*/React.forwardRef(function (props, ref) {
168
168
  case 'grid':
169
169
  return /*#__PURE__*/React.createElement(EventTable, {
170
170
  dataSource: dataSource,
171
+ sourcePanel: !props.dataSource,
171
172
  searchData: params,
172
173
  showList: showList,
173
174
  changeShow: onChangeShow,
@@ -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",
3
+ "version": "0.1.10",
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": "f0352496d73da9ee248b0b552d143ef37b7d4069",
52
+ "gitHead": "9ba57d0ce3b608d08c9cfb9f4956d716f760ea20",
53
53
  "dependencies": {
54
54
  "react-copy-to-clipboard": "^5.1.0",
55
55
  "react-highlight": "^0.15.0"