@zgfe/modules-settings 2.0.0-zhongyuan.15 → 2.0.0-zhongyuan.17

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,8 +16,8 @@ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
16
16
  import React, { useEffect, useState, useRef, useContext } from 'react';
17
17
  import request from '../../../utils/ajax';
18
18
  import apis from '../../../constants/api';
19
- import { notification, Tooltip, Modal, Row, Col, Drawer, Button, Divider, message } from 'antd';
20
- import { BizGlobalDataContext, BizLoading, IconFont } from '@zgfe/business-lib';
19
+ import { notification, Tooltip, Modal, Drawer, Button, Divider, message, Table, Spin } from 'antd';
20
+ import { BizGlobalDataContext, IconFont } from '@zgfe/business-lib';
21
21
  import ApplicationForm from './applicationForm';
22
22
  import './index.less';
23
23
  import ApplicationSetting from './applicationSetting';
@@ -62,9 +62,128 @@ var Application = function Application(_ref) {
62
62
  setLoading = _useState8[1];
63
63
  var formRef = useRef();
64
64
  var settingRef = useRef();
65
+ var columns = [{
66
+ title: '应用名称',
67
+ dataIndex: 'name',
68
+ width: 230,
69
+ ellipsis: true,
70
+ render: function render(data) {
71
+ return /*#__PURE__*/React.createElement(Tooltip, {
72
+ title: data,
73
+ placement: "top"
74
+ }, /*#__PURE__*/React.createElement("span", {
75
+ className: "".concat(classPrefix, "-contentList-item-name")
76
+ }, data));
77
+ }
78
+ }, {
79
+ title: '实时数据延迟',
80
+ dataIndex: 'realTimeDelay',
81
+ ellipsis: true,
82
+ width: 150,
83
+ render: function render(data) {
84
+ return data || '-';
85
+ }
86
+ }, {
87
+ title: '入库数据延迟',
88
+ dataIndex: 'joinDatabaseDelay',
89
+ ellipsis: true,
90
+ width: 150,
91
+ render: function render(data) {
92
+ return data || '-';
93
+ }
94
+ }, {
95
+ title: '接入平台',
96
+ dataIndex: 'platform',
97
+ render: function render(data) {
98
+ return data && (data === null || data === void 0 ? void 0 : data.length) > 0 ? data === null || data === void 0 ? void 0 : data.map(function (plat) {
99
+ return /*#__PURE__*/React.createElement(Tooltip, {
100
+ title: getPlatText(plat),
101
+ placement: "top"
102
+ }, /*#__PURE__*/React.createElement("span", {
103
+ key: plat,
104
+ className: "icon-".concat(getPlatIcon(plat))
105
+ }));
106
+ }) : '未接入平台';
107
+ }
108
+ }, {
109
+ title: '版本',
110
+ dataIndex: 'appVersionName'
111
+ }, {
112
+ title: '状态切换时间',
113
+ dataIndex: 'stopTime',
114
+ ellipsis: true,
115
+ width: 180,
116
+ render: function render(data) {
117
+ return data || '-';
118
+ }
119
+ }, {
120
+ title: '状态',
121
+ dataIndex: 'status',
122
+ render: function render(data) {
123
+ return /*#__PURE__*/React.createElement("span", {
124
+ className: "".concat(classPrefix, "-contentList-item-status")
125
+ }, /*#__PURE__*/React.createElement("span", {
126
+ className: "".concat(classPrefix, "-contentList-item-status-icon").concat(data || 0)
127
+ }), data ? '运行中' : '关闭');
128
+ }
129
+ }, {
130
+ title: '操作',
131
+ dataIndex: 'operation',
132
+ width: 300,
133
+ render: function render(text, record) {
134
+ return /*#__PURE__*/React.createElement("div", {
135
+ className: "".concat(classPrefix, "-contentList-btn")
136
+ }, /*#__PURE__*/React.createElement(Button, {
137
+ type: "link",
138
+ style: {
139
+ padding: '0 10px'
140
+ },
141
+ disabled: !authority[1716284934],
142
+ onClick: function onClick() {
143
+ return authority[1716284934] && landleStatusClick(record);
144
+ }
145
+ }, record.status ? '关闭' : '开启'), /*#__PURE__*/React.createElement(Button, {
146
+ type: "link",
147
+ style: {
148
+ padding: '0 10px'
149
+ },
150
+ disabled: !authority[1716284360],
151
+ onClick: function onClick() {
152
+ return authority[1716284360] && handleEditClick(record);
153
+ }
154
+ }, "\u4FEE\u6539\u540D\u79F0"), /*#__PURE__*/React.createElement(Button, {
155
+ type: "link",
156
+ style: {
157
+ padding: '0 10px'
158
+ },
159
+ disabled: !authority[10101],
160
+ onClick: function onClick() {
161
+ return authority[10101] && handleDeleteClick(record);
162
+ }
163
+ }, "\u5220\u9664"), !isOpen && (/*#__PURE__*/React.createElement(Button, {
164
+ type: "link",
165
+ style: {
166
+ padding: '0 10px'
167
+ },
168
+ disabled: !authority[1716285396],
169
+ onClick: function onClick() {
170
+ return authority[1716285396] && handleSettingClick(record);
171
+ }
172
+ }, "\u8BBE\u7F6E")), isOpen && (/*#__PURE__*/React.createElement(Button, {
173
+ type: "link",
174
+ style: {
175
+ padding: '0 10px'
176
+ },
177
+ disabled: !authority[1716284934],
178
+ onClick: function onClick() {
179
+ return authority[1716284934] && openMainPart && openMainPart(record.id, record.name);
180
+ }
181
+ }, "\u4E3B\u4F53\u7BA1\u7406")));
182
+ }
183
+ }];
65
184
  var handleQueryList = /*#__PURE__*/function () {
66
185
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
67
- var _res$data, _res$data2, _res$data5, _res$data6, _res$data7, res, _res$data3, _res$data4;
186
+ var _res$data, _res$data2, _res$data4, _res$data5, _res$data6, res, _res$data3;
68
187
  return _regeneratorRuntime().wrap(function _callee$(_context) {
69
188
  while (1) switch (_context.prev = _context.next) {
70
189
  case 0:
@@ -91,53 +210,14 @@ var Application = function Application(_ref) {
91
210
  item.platform = item.platform.reverse();
92
211
  }
93
212
  });
94
- //添加列表数据
95
- res === null || res === void 0 ? void 0 : (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.list.forEach(function (item) {
96
- item.children = [{
97
- label: '',
98
- key: 'name',
99
- type: 'text',
100
- style: {
101
- fontWeight: 'bold',
102
- fontSize: '14px',
103
- color: '#000000',
104
- minWidth: '100px'
105
- }
106
- }, {
107
- label: '实时数据延迟',
108
- key: 'realTimeDelay',
109
- type: 'text'
110
- }, {
111
- label: '入库数据延迟',
112
- key: 'joinDatabaseDelay',
113
- type: 'text'
114
- }, {
115
- label: '接入平台',
116
- key: 'platform',
117
- type: 'icon',
118
- list: item.platform || []
119
- }, {
120
- label: '版本',
121
- key: 'appVersionName',
122
- type: 'text'
123
- }, {
124
- label: item.status ? '开始时间' : '停止时间 ',
125
- key: item.status ? 'startTime' : 'stopTime',
126
- type: 'text'
127
- }, {
128
- label: '状态',
129
- key: 'status',
130
- type: 'status'
131
- }];
132
- });
133
213
  }
134
- setList((res === null || res === void 0 ? void 0 : (_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : _res$data5.list) || []);
214
+ setList((res === null || res === void 0 ? void 0 : (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.list) || []);
135
215
  // 如果无应用,自定展示新建应用弹窗
136
- if (!(res === null || res === void 0 ? void 0 : (_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : _res$data6.list)) {
216
+ if (!(res === null || res === void 0 ? void 0 : (_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : _res$data5.list)) {
137
217
  handleAddClick();
138
218
  }
139
219
  //对实时渲染数据进行处理
140
- getRealTimeData((res === null || res === void 0 ? void 0 : (_res$data7 = res.data) === null || _res$data7 === void 0 ? void 0 : _res$data7.list) || []);
220
+ getRealTimeData((res === null || res === void 0 ? void 0 : (_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : _res$data6.list) || []);
141
221
  _context.next = 18;
142
222
  break;
143
223
  case 14:
@@ -171,7 +251,7 @@ var Application = function Application(_ref) {
171
251
  onCancel: function onCancel() {},
172
252
  onOk: function () {
173
253
  var _onOk = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
174
- var _formRef$current, _formRef$current2, _res$data8, data, res;
254
+ var _formRef$current, _formRef$current2, _res$data7, data, res;
175
255
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
176
256
  while (1) switch (_context2.prev = _context2.next) {
177
257
  case 0:
@@ -201,7 +281,7 @@ var Application = function Application(_ref) {
201
281
  message.success('创建成功');
202
282
  handleQueryList();
203
283
  settingCallback && settingCallback('settingAddApplicationCallback', {
204
- id: res === null || res === void 0 ? void 0 : (_res$data8 = res.data) === null || _res$data8 === void 0 ? void 0 : _res$data8.appId
284
+ id: res === null || res === void 0 ? void 0 : (_res$data7 = res.data) === null || _res$data7 === void 0 ? void 0 : _res$data7.appId
205
285
  });
206
286
  _context2.next = 19;
207
287
  break;
@@ -313,8 +393,8 @@ var Application = function Application(_ref) {
313
393
  // 主体开关关闭时,设置的是默认主体
314
394
  var handleSettingClick = /*#__PURE__*/function () {
315
395
  var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(record) {
316
- var _res$data9, _res$data10, _res$data10$results;
317
- var res, _res$data11, mainPart;
396
+ var _res$data8, _res$data9, _res$data9$results;
397
+ var res, _res$data10, mainPart;
318
398
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
319
399
  while (1) switch (_context6.prev = _context6.next) {
320
400
  case 0:
@@ -328,8 +408,8 @@ var Application = function Application(_ref) {
328
408
  });
329
409
  case 2:
330
410
  res = _context6.sent;
331
- if ((res === null || res === void 0 ? void 0 : (_res$data9 = res.data) === null || _res$data9 === void 0 ? void 0 : _res$data9.results) && (res === null || res === void 0 ? void 0 : (_res$data10 = res.data) === null || _res$data10 === void 0 ? void 0 : (_res$data10$results = _res$data10.results) === null || _res$data10$results === void 0 ? void 0 : _res$data10$results.length) > 0) {
332
- mainPart = res === null || res === void 0 ? void 0 : (_res$data11 = res.data) === null || _res$data11 === void 0 ? void 0 : _res$data11.results[0];
411
+ if ((res === null || res === void 0 ? void 0 : (_res$data8 = res.data) === null || _res$data8 === void 0 ? void 0 : _res$data8.results) && (res === null || res === void 0 ? void 0 : (_res$data9 = res.data) === null || _res$data9 === void 0 ? void 0 : (_res$data9$results = _res$data9.results) === null || _res$data9$results === void 0 ? void 0 : _res$data9$results.length) > 0) {
412
+ mainPart = res === null || res === void 0 ? void 0 : (_res$data10 = res.data) === null || _res$data10 === void 0 ? void 0 : _res$data10.results[0];
333
413
  setProfile(mainPart);
334
414
  setShowSetting(true);
335
415
  }
@@ -614,94 +694,17 @@ var Application = function Application(_ref) {
614
694
  type: "primary",
615
695
  size: "small",
616
696
  onClick: handleAddClick
617
- }, "\u521B\u5EFA\u5E94\u7528")), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(Row, {
618
- className: "".concat(classPrefix, "-rowContent"),
619
- gutter: [0, 16]
620
- }, list.length > 0 && (list === null || list === void 0 ? void 0 : list.map(function (item) {
621
- var content = /*#__PURE__*/React.createElement("div", {
622
- className: "".concat(classPrefix, "-contentList")
623
- }, item.children && item.children.length > 0 && item.children.map(function (child) {
624
- var _child$list, _child$list2, _child$list3;
625
- return /*#__PURE__*/React.createElement("div", {
626
- className: "".concat(classPrefix, "-contentList-item")
627
- }, child.label && (/*#__PURE__*/React.createElement("div", {
628
- className: "".concat(classPrefix, "-contentList-item-label")
629
- }, child.label)), /*#__PURE__*/React.createElement("div", {
630
- className: "".concat(classPrefix, "-contentList-item-value")
631
- }, child.type === 'icon' && child.list && ((_child$list = child.list) === null || _child$list === void 0 ? void 0 : _child$list.length) > 0 && ((_child$list2 = child.list) === null || _child$list2 === void 0 ? void 0 : _child$list2.map(function (plat) {
632
- return /*#__PURE__*/React.createElement(Tooltip, {
633
- title: getPlatText(plat),
634
- placement: "top"
635
- }, /*#__PURE__*/React.createElement("span", {
636
- key: plat,
637
- className: "icon-".concat(getPlatIcon(plat))
638
- }));
639
- })), child.type === 'icon' && ((_child$list3 = child.list) === null || _child$list3 === void 0 ? void 0 : _child$list3.length) === 0 && (/*#__PURE__*/React.createElement("span", {
640
- className: "".concat(classPrefix, "-contentList-item-label-text")
641
- }, "\u672A\u63A5\u5165\u5E73\u53F0")), child.type === 'text' && (/*#__PURE__*/React.createElement(Tooltip, {
642
- title: item[child.key],
643
- placement: "top"
644
- }, /*#__PURE__*/React.createElement("span", {
645
- className: "".concat(classPrefix, "-contentList-item-label-text"),
646
- style: child.style
647
- }, item[child.key] || '-'))), child.type === 'status' && (/*#__PURE__*/React.createElement("span", {
648
- className: "".concat(classPrefix, "-contentList-item-status")
649
- }, /*#__PURE__*/React.createElement("span", {
650
- className: "".concat(classPrefix, "-contentList-item-status-icon").concat(item[child.key] || 0)
651
- }), item[child.key] ? '运行中' : '关闭'))));
652
- }), /*#__PURE__*/React.createElement("div", {
653
- className: "".concat(classPrefix, "-contentList-btn")
654
- }, /*#__PURE__*/React.createElement(Button, {
655
- type: "link",
656
- style: {
657
- padding: '0 10px'
658
- },
659
- disabled: !authority[1716284934],
660
- onClick: function onClick() {
661
- return authority[1716284934] && landleStatusClick(item);
662
- }
663
- }, item.status ? '关闭' : '开启'), /*#__PURE__*/React.createElement(Button, {
664
- type: "link",
665
- style: {
666
- padding: '0 10px'
667
- },
668
- disabled: !authority[1716284360],
669
- onClick: function onClick() {
670
- return authority[1716284360] && handleEditClick(item);
671
- }
672
- }, "\u4FEE\u6539\u540D\u79F0"), /*#__PURE__*/React.createElement(Button, {
673
- type: "link",
674
- style: {
675
- padding: '0 10px'
676
- },
677
- disabled: !authority[10101],
678
- onClick: function onClick() {
679
- return authority[10101] && handleDeleteClick(item);
680
- }
681
- }, "\u5220\u9664"), !isOpen && (/*#__PURE__*/React.createElement(Button, {
682
- type: "link",
683
- style: {
684
- padding: '0 10px'
685
- },
686
- disabled: !authority[1716285396],
687
- onClick: function onClick() {
688
- return authority[1716285396] && handleSettingClick(item);
689
- }
690
- }, "\u8BBE\u7F6E")), isOpen && (/*#__PURE__*/React.createElement(Button, {
691
- type: "link",
692
- style: {
693
- padding: '0 10px'
694
- },
695
- disabled: !authority[1716284934],
696
- onClick: function onClick() {
697
- return authority[1716284934] && openMainPart && openMainPart(item.id, item.name);
698
- }
699
- }, "\u4E3B\u4F53\u7BA1\u7406"))));
700
- return /*#__PURE__*/React.createElement(Col, {
701
- key: item.id,
702
- span: 24
703
- }, content);
704
- })), loading && /*#__PURE__*/React.createElement(BizLoading, null)), /*#__PURE__*/React.createElement(Drawer, {
697
+ }, "\u521B\u5EFA\u5E94\u7528")), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(Spin, {
698
+ spinning: loading
699
+ }, /*#__PURE__*/React.createElement(Table, {
700
+ dataSource: list,
701
+ columns: columns,
702
+ pagination: false,
703
+ scroll: {
704
+ x: 1000,
705
+ y: 500
706
+ }
707
+ })), /*#__PURE__*/React.createElement(Drawer, {
705
708
  className: "".concat(classPrefix, "-drawer"),
706
709
  open: showSetting,
707
710
  closable: true,
@@ -111,58 +111,34 @@
111
111
  height: 120px;
112
112
  }
113
113
  &-rowContent {
114
- height: calc(100vh - 254px);
115
- overflow: auto;
114
+ height: calc(100vh - 302px);
115
+ overflow: overlay;
116
116
  }
117
- &-contentList {
117
+ &-contentList-label {
118
118
  display: grid;
119
119
  grid-template-columns: 230px repeat(4, minmax(90px, 1fr)) 135px 90px 260px;
120
120
  align-items: center;
121
- &-item {
122
- flex: 1;
123
- color: var(--io-N6-, #67727f);
124
- text-align: center;
125
- &-label {
126
- font-size: 14px;
127
- }
128
- &-value {
129
- display: flex;
130
- grid-gap: 4px;
131
- gap: 4px;
132
- align-items: center;
133
- justify-content: center;
134
- white-space: nowrap;
135
- }
136
- &-label-text {
137
- overflow: hidden;
138
- white-space: nowrap;
139
- text-overflow: ellipsis;
140
- }
141
- &-status-icon0,
142
- &-status-icon1 {
143
- display: inline-block;
144
- width: 6px;
145
- height: 6px;
146
- margin-right: 3px;
147
- border-radius: 50%;
148
- transform: translateY(-1px);
149
- }
150
- &-status-icon0 {
151
- background: #67727f;
152
- }
153
- &-status-icon1 {
154
- background: #165dff;
155
- }
156
- }
157
- &-btn {
158
- position: sticky;
159
- top: 0;
160
- right: 0;
161
- display: flex;
162
- align-items: center;
163
- height: 100%;
164
- background-color: #fff;
165
- box-shadow: -12px 0px 8px -8px #0505050f;
166
- }
121
+ padding-right: 14px;
122
+ border-bottom: 1px solid #ecedf0;
123
+ }
124
+ &-contentList-item-name {
125
+ color: #000;
126
+ font-weight: bold;
127
+ font-size: 14px;
128
+ }
129
+ &-contentList-item-status-icon0,
130
+ &-contentList-item-status-icon1 {
131
+ display: inline-block;
132
+ width: 6px;
133
+ height: 6px;
134
+ margin-right: 3px;
135
+ border-radius: 50%;
136
+ transform: translateY(-1px);
137
+ }
138
+ &-contentList-item-status-icon0 {
139
+ background: #67727f;
140
+ }
141
+ &-contentList-item-status-icon1 {
142
+ background: #165dff;
167
143
  }
168
144
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-settings",
3
- "version": "2.0.0-zhongyuan.15",
3
+ "version": "2.0.0-zhongyuan.17",
4
4
  "private": false,
5
5
  "module": "es/index.js",
6
6
  "typings": "es/index.d.ts",
@@ -67,7 +67,7 @@
67
67
  "publishConfig": {
68
68
  "access": "public"
69
69
  },
70
- "gitHead": "73daa4832ed6af7a6dff89949855e0b53b72041b",
70
+ "gitHead": "a0eae458b5795a8b9a9dc71da95c0adbaccee962",
71
71
  "gitHooks": {
72
72
  "pre-commit": "lint-staged"
73
73
  }