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

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,120 @@ 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
+ }, {
83
+ title: '入库数据延迟',
84
+ dataIndex: 'joinDatabaseDelay',
85
+ ellipsis: true
86
+ }, {
87
+ title: '接入平台',
88
+ dataIndex: 'platform',
89
+ render: function render(data) {
90
+ return data && (data === null || data === void 0 ? void 0 : data.length) > 0 ? data === null || data === void 0 ? void 0 : data.map(function (plat) {
91
+ return /*#__PURE__*/React.createElement(Tooltip, {
92
+ title: getPlatText(plat),
93
+ placement: "top"
94
+ }, /*#__PURE__*/React.createElement("span", {
95
+ key: plat,
96
+ className: "icon-".concat(getPlatIcon(plat))
97
+ }));
98
+ }) : '未接入平台';
99
+ }
100
+ }, {
101
+ title: '版本',
102
+ dataIndex: 'appVersionName'
103
+ }, {
104
+ title: '状态切换时间',
105
+ dataIndex: 'stopTime',
106
+ ellipsis: true,
107
+ width: 180,
108
+ render: function render(data) {
109
+ return data || '-';
110
+ }
111
+ }, {
112
+ title: '状态',
113
+ dataIndex: 'status',
114
+ render: function render(data) {
115
+ return /*#__PURE__*/React.createElement("span", {
116
+ className: "".concat(classPrefix, "-contentList-item-status")
117
+ }, /*#__PURE__*/React.createElement("span", {
118
+ className: "".concat(classPrefix, "-contentList-item-status-icon").concat(data || 0)
119
+ }), data ? '运行中' : '关闭');
120
+ }
121
+ }, {
122
+ title: '操作',
123
+ dataIndex: 'operation',
124
+ width: 300,
125
+ render: function render(text, record) {
126
+ return /*#__PURE__*/React.createElement("div", {
127
+ className: "".concat(classPrefix, "-contentList-btn")
128
+ }, /*#__PURE__*/React.createElement(Button, {
129
+ type: "link",
130
+ style: {
131
+ padding: '0 10px'
132
+ },
133
+ disabled: !authority[1716284934],
134
+ onClick: function onClick() {
135
+ return authority[1716284934] && landleStatusClick(record);
136
+ }
137
+ }, record.status ? '关闭' : '开启'), /*#__PURE__*/React.createElement(Button, {
138
+ type: "link",
139
+ style: {
140
+ padding: '0 10px'
141
+ },
142
+ disabled: !authority[1716284360],
143
+ onClick: function onClick() {
144
+ return authority[1716284360] && handleEditClick(record);
145
+ }
146
+ }, "\u4FEE\u6539\u540D\u79F0"), /*#__PURE__*/React.createElement(Button, {
147
+ type: "link",
148
+ style: {
149
+ padding: '0 10px'
150
+ },
151
+ disabled: !authority[10101],
152
+ onClick: function onClick() {
153
+ return authority[10101] && handleDeleteClick(record);
154
+ }
155
+ }, "\u5220\u9664"), !isOpen && (/*#__PURE__*/React.createElement(Button, {
156
+ type: "link",
157
+ style: {
158
+ padding: '0 10px'
159
+ },
160
+ disabled: !authority[1716285396],
161
+ onClick: function onClick() {
162
+ return authority[1716285396] && handleSettingClick(record);
163
+ }
164
+ }, "\u8BBE\u7F6E")), isOpen && (/*#__PURE__*/React.createElement(Button, {
165
+ type: "link",
166
+ style: {
167
+ padding: '0 10px'
168
+ },
169
+ disabled: !authority[1716284934],
170
+ onClick: function onClick() {
171
+ return authority[1716284934] && openMainPart && openMainPart(record.id, record.name);
172
+ }
173
+ }, "\u4E3B\u4F53\u7BA1\u7406")));
174
+ }
175
+ }];
65
176
  var handleQueryList = /*#__PURE__*/function () {
66
177
  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;
178
+ var _res$data, _res$data2, _res$data4, _res$data5, _res$data6, res, _res$data3;
68
179
  return _regeneratorRuntime().wrap(function _callee$(_context) {
69
180
  while (1) switch (_context.prev = _context.next) {
70
181
  case 0:
@@ -91,53 +202,14 @@ var Application = function Application(_ref) {
91
202
  item.platform = item.platform.reverse();
92
203
  }
93
204
  });
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
205
  }
134
- setList((res === null || res === void 0 ? void 0 : (_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : _res$data5.list) || []);
206
+ setList((res === null || res === void 0 ? void 0 : (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.list) || []);
135
207
  // 如果无应用,自定展示新建应用弹窗
136
- if (!(res === null || res === void 0 ? void 0 : (_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : _res$data6.list)) {
208
+ if (!(res === null || res === void 0 ? void 0 : (_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : _res$data5.list)) {
137
209
  handleAddClick();
138
210
  }
139
211
  //对实时渲染数据进行处理
140
- getRealTimeData((res === null || res === void 0 ? void 0 : (_res$data7 = res.data) === null || _res$data7 === void 0 ? void 0 : _res$data7.list) || []);
212
+ getRealTimeData((res === null || res === void 0 ? void 0 : (_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : _res$data6.list) || []);
141
213
  _context.next = 18;
142
214
  break;
143
215
  case 14:
@@ -171,7 +243,7 @@ var Application = function Application(_ref) {
171
243
  onCancel: function onCancel() {},
172
244
  onOk: function () {
173
245
  var _onOk = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
174
- var _formRef$current, _formRef$current2, _res$data8, data, res;
246
+ var _formRef$current, _formRef$current2, _res$data7, data, res;
175
247
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
176
248
  while (1) switch (_context2.prev = _context2.next) {
177
249
  case 0:
@@ -201,7 +273,7 @@ var Application = function Application(_ref) {
201
273
  message.success('创建成功');
202
274
  handleQueryList();
203
275
  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
276
+ id: res === null || res === void 0 ? void 0 : (_res$data7 = res.data) === null || _res$data7 === void 0 ? void 0 : _res$data7.appId
205
277
  });
206
278
  _context2.next = 19;
207
279
  break;
@@ -313,8 +385,8 @@ var Application = function Application(_ref) {
313
385
  // 主体开关关闭时,设置的是默认主体
314
386
  var handleSettingClick = /*#__PURE__*/function () {
315
387
  var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(record) {
316
- var _res$data9, _res$data10, _res$data10$results;
317
- var res, _res$data11, mainPart;
388
+ var _res$data8, _res$data9, _res$data9$results;
389
+ var res, _res$data10, mainPart;
318
390
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
319
391
  while (1) switch (_context6.prev = _context6.next) {
320
392
  case 0:
@@ -328,8 +400,8 @@ var Application = function Application(_ref) {
328
400
  });
329
401
  case 2:
330
402
  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];
403
+ 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) {
404
+ mainPart = res === null || res === void 0 ? void 0 : (_res$data10 = res.data) === null || _res$data10 === void 0 ? void 0 : _res$data10.results[0];
333
405
  setProfile(mainPart);
334
406
  setShowSetting(true);
335
407
  }
@@ -614,94 +686,17 @@ var Application = function Application(_ref) {
614
686
  type: "primary",
615
687
  size: "small",
616
688
  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, {
689
+ }, "\u521B\u5EFA\u5E94\u7528")), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(Spin, {
690
+ spinning: loading
691
+ }, /*#__PURE__*/React.createElement(Table, {
692
+ dataSource: list,
693
+ columns: columns,
694
+ pagination: false,
695
+ scroll: {
696
+ x: 1000,
697
+ y: 550
698
+ }
699
+ })), /*#__PURE__*/React.createElement(Drawer, {
705
700
  className: "".concat(classPrefix, "-drawer"),
706
701
  open: showSetting,
707
702
  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.16",
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": "07261475514dd4751a793aaa72b52aeee8de7772",
71
71
  "gitHooks": {
72
72
  "pre-commit": "lint-staged"
73
73
  }