@zgfe/modules-page 1.0.1-alpha.20 → 1.0.1-alpha.22

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.
@@ -15,7 +15,7 @@ import "./index.less";
15
15
  import { BizGlobalDataContext, IconFont, SocketClient, ajax } from '@zgfe/business-lib';
16
16
  import { Tooltip } from 'antd';
17
17
  import { getNumPer, toThousands } from "../content/utils";
18
- import percentImg from "./images/color_pallete_percent.png";
18
+ import percentImg from "./images/percent.png";
19
19
  import renderImg from "./images/empty.png";
20
20
  import { ModulesPageContext } from "../../modules/home/types";
21
21
  import { getSocketSecret } from "../../modules/home/utils";
@@ -11,6 +11,7 @@
11
11
  justify-content: space-between;
12
12
  padding: 16px;
13
13
  background: #fafafb;
14
+ border-radius: 8px 8px 0 0;
14
15
  &-title {
15
16
  display: flex;
16
17
  flex: 1;
@@ -18,7 +19,7 @@
18
19
  }
19
20
  &-value {
20
21
  display: inline-block;
21
- width: calc(100% - 100px);
22
+ max-width: calc(100% - 100px);
22
23
  .__default-overflow();
23
24
  }
24
25
  &-label {
@@ -43,6 +44,9 @@
43
44
  color: #9aa1a9;
44
45
  font-size: 16px !important;
45
46
  cursor: pointer;
47
+ &:hover {
48
+ color: @primary-color;
49
+ }
46
50
  }
47
51
  }
48
52
  }
@@ -53,8 +57,10 @@
53
57
  min-height: 422px;
54
58
  padding: 16px;
55
59
  &-img {
56
- height: 22px;
57
60
  text-align: right;
61
+ img {
62
+ height: 22px;
63
+ }
58
64
  }
59
65
  &-panel {
60
66
  display: flex;
@@ -120,6 +120,7 @@ var GroupModal = function GroupModal(props) {
120
120
  };
121
121
  return /*#__PURE__*/React.createElement(BizDialog, {
122
122
  open: true,
123
+ closable: true,
123
124
  className: classPrefix,
124
125
  width: 720,
125
126
  title: props.value ? '修改分组' : '创建分组',
@@ -127,7 +128,8 @@ var GroupModal = function GroupModal(props) {
127
128
  okButtonProps: {
128
129
  disabled: isDemo
129
130
  },
130
- footer: btnList
131
+ footer: btnList,
132
+ onCancel: props.onCancel
131
133
  }, /*#__PURE__*/React.createElement(Spin, {
132
134
  spinning: loading
133
135
  }, /*#__PURE__*/React.createElement(Form, {
@@ -160,12 +162,13 @@ var GroupModal = function GroupModal(props) {
160
162
  }, /*#__PURE__*/React.createElement(Input, {
161
163
  className: "".concat(classPrefix, "-form-input"),
162
164
  placeholder: "\u8BF7\u8F93\u5165\u5728\u67E5\u770B\u70B9\u51FB\u56FE\u65F6\u7684\u80CC\u666F\u9875\u9762"
163
- })), /*#__PURE__*/React.createElement(Form.Item, {
165
+ })), /*#__PURE__*/React.createElement("div", {
164
166
  className: "".concat(classPrefix, "-form-title")
165
167
  }, " \u6DFB\u52A0\u9875\u9762"), /*#__PURE__*/React.createElement(Form.Item, {
166
- name: "filters"
168
+ name: "filters",
169
+ className: "".concat(classPrefix, "-form-item-filter")
167
170
  }, /*#__PURE__*/React.createElement(PageItem, {
168
171
  validate: validate
169
- }))), /*#__PURE__*/React.createElement(Button, null)));
172
+ })))));
170
173
  };
171
174
  export default GroupModal;
@@ -5,8 +5,8 @@
5
5
  border-color: #fafafb;
6
6
  }
7
7
  &-form-title {
8
- margin-bottom: 12px;
9
8
  color: @text-color-secondary;
9
+ line-height: 1;
10
10
  }
11
11
 
12
12
  &-item {
@@ -109,6 +109,7 @@
109
109
  align-items: center;
110
110
  width: fit-content;
111
111
  height: 32px;
112
+ margin-bottom: 12px;
112
113
  color: @primary-color;
113
114
  cursor: pointer;
114
115
 
@@ -137,6 +138,9 @@
137
138
  }
138
139
  }
139
140
 
141
+ &-form-item-filter.ant-form-item {
142
+ margin-bottom: 12px;
143
+ }
140
144
  &-dropdown {
141
145
  width: 300px;
142
146
  &-handle {
@@ -153,9 +157,14 @@
153
157
  &:not([disabled]):focus {
154
158
  border-color: @primary-color;
155
159
  }
160
+ &[disabled] {
161
+ color: #ccd0d4;
162
+ background: @background-color-gray;
163
+ }
156
164
  }
157
165
  .ant-modal-content {
158
166
  .ant-modal-body {
167
+ padding-top: 8px;
159
168
  padding-bottom: 0;
160
169
  }
161
170
  .ant-modal-footer {
@@ -164,8 +173,19 @@
164
173
 
165
174
  .group-modal-footer-del {
166
175
  float: left;
176
+ background: #f2f3f4 !important;
167
177
  .bsicon {
168
178
  margin-right: 8px;
179
+ font-size: 16px !important;
180
+ line-height: 1;
181
+ }
182
+ &.ant-btn-text:hover {
183
+ color: #fb5547 !important;
184
+ background: #f2f3f4 !important;
185
+ }
186
+ &.ant-btn-text:focus {
187
+ color: #e24c40 !important;
188
+ background: #f2f3f4 !important;
169
189
  }
170
190
  }
171
191
  }
@@ -52,6 +52,7 @@ var InputSelect = function InputSelect(props) {
52
52
  }, "\u6682\u65E0\u6570\u636E");
53
53
  }
54
54
  }, /*#__PURE__*/React.createElement(Input, {
55
+ placeholder: "\u8BF7\u9009\u62E9",
55
56
  className: "".concat(classPrefix, "-dropdown-handle"),
56
57
  value: searchValue,
57
58
  allowClear: true,
@@ -39,23 +39,24 @@ var PageSelect = function PageSelect(props) {
39
39
  currentClickPage = _useContext.currentClickPage;
40
40
  useEffect(function () {
41
41
  var _props$value, _props$value2;
42
- if (!props.value) return;
43
42
  var type = (_props$value = props.value) !== null && _props$value !== void 0 && _props$value.pageGroup || ((_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.pageGroup) === 0 ? 1 : 0;
44
43
  setCurrentType(pageTypes[type]);
45
- setCurrentValue(function () {
46
- if (type === 0) {
47
- var data = props.value;
48
- return {
49
- id: "".concat(data.pageTitle ? data.pageTitle + '-' : '').concat(data.pageUrl),
50
- pageTitle: data.pageTitle,
51
- pageUrl: data.pageUrl
52
- };
53
- }
54
- return pageGroupList.filter(function (item) {
55
- var _props$value3;
56
- return item.id == ((_props$value3 = props.value) === null || _props$value3 === void 0 ? void 0 : _props$value3.pageGroup);
57
- })[0];
58
- });
44
+ if (props.value) {
45
+ setCurrentValue(function () {
46
+ if (type === 0) {
47
+ var data = props.value;
48
+ return {
49
+ id: "".concat(data.pageTitle ? data.pageTitle + '-' : '').concat(data.pageUrl),
50
+ pageTitle: data.pageTitle,
51
+ pageUrl: data.pageUrl
52
+ };
53
+ }
54
+ return pageGroupList.filter(function (item) {
55
+ var _props$value3;
56
+ return item.id == ((_props$value3 = props.value) === null || _props$value3 === void 0 ? void 0 : _props$value3.pageGroup);
57
+ })[0];
58
+ });
59
+ }
59
60
  setTimeout(function () {
60
61
  setIsFirst(false);
61
62
  }, 0);
@@ -80,9 +81,13 @@ var PageSelect = function PageSelect(props) {
80
81
  setCurrentValue(list[0]);
81
82
  }, [currentType]);
82
83
  useEffect(function () {
83
- props.onChange && props.onChange(_objectSpread(_objectSpread({}, currentValue || {}), {}, {
84
- pageGroup: currentType.value === 'pageGroup' ? currentValue === null || currentValue === void 0 ? void 0 : currentValue.id : undefined,
85
- type: currentType.value
84
+ if (props.value) return;
85
+ setCurrentValue(pageList[0]);
86
+ }, [pageList.length]);
87
+ useEffect(function () {
88
+ if (!currentValue) return;
89
+ props.onChange && props.onChange(_objectSpread(_objectSpread({}, currentValue), {}, {
90
+ pageGroup: currentType.value === 'pageGroup' ? currentValue === null || currentValue === void 0 ? void 0 : currentValue.id : undefined
86
91
  }));
87
92
  }, [currentType, currentValue]);
88
93
  var getCustomLabel = function getCustomLabel(node, option) {
@@ -2,9 +2,7 @@ import _ from 'lodash';
2
2
  import { OperateTypes } from '@zgfe/business-lib/es/attrConditions/types';
3
3
  export var formValue = function formValue(source) {
4
4
  var data = _.cloneDeep(source) || {};
5
- var type = data !== null && data !== void 0 && data.pageGroup || (data === null || data === void 0 ? void 0 : data.pageGroup) === 0 ? 'pageGroup' : 'page';
6
- var page = {
7
- type: type,
5
+ var page = !data.pageUrl && !data.pageTitle && !data.pageGroup && data.pageGroup != 0 ? undefined : {
8
6
  pageGroup: data === null || data === void 0 ? void 0 : data.pageGroup,
9
7
  pageUrl: data === null || data === void 0 ? void 0 : data.pageUrl,
10
8
  pageTitle: data === null || data === void 0 ? void 0 : data.pageTitle
@@ -1,6 +1,7 @@
1
1
  .top-content {
2
2
  display: flex;
3
3
  justify-content: space-between;
4
+ font-size: 14px;
4
5
  .ant-btn {
5
6
  .bsicon {
6
7
  margin-right: 8px;
@@ -28,6 +28,8 @@ var EmptyPanel = function EmptyPanel() {
28
28
  }, /*#__PURE__*/React.createElement("div", {
29
29
  className: "".concat(classPrefix, "-title")
30
30
  }, "\u9875\u9762\u70B9\u51FB\u5206\u6790"), /*#__PURE__*/React.createElement("p", null, "\u9875\u9762\u7684\u70B9\u51FB\u6548\u679C\u5C55\u793A\uFF0C\u53EF\u4EE5\u66F4\u52A0\u76F4\u89C2\u7684\u770B\u51FA\u9875\u9762\u4E2D\u70B9\u51FB\u7684\u5206\u5E03\u60C5\u51B5"), /*#__PURE__*/React.createElement("div", {
31
+ className: "".concat(classPrefix, "-content2")
32
+ }, /*#__PURE__*/React.createElement("div", {
31
33
  className: "".concat(classPrefix, "-title-secondary")
32
34
  }, "\u8BBE\u7F6E\u65B9\u6CD5"), /*#__PURE__*/React.createElement("p", null, "\u70B9\u51FB\u5206\u6790\u6570\u636E\u9ED8\u8BA4\u4E3A\u4E0D\u91C7\u96C6\uFF0C\u5982\u9700\u91C7\u96C6\uFF0C\u53EF\u5728\u76F8\u5E94\u9875\u9762\u7684SDK\u4EE3\u7801\u4E2D\u52A0\u5165\u4EE5\u4E0B\u53C2\u6570\u914D\u7F6E"), /*#__PURE__*/React.createElement("div", {
33
35
  className: "".concat(classPrefix, "-code-container")
@@ -40,7 +42,7 @@ var EmptyPanel = function EmptyPanel() {
40
42
  className: "".concat(classPrefix, "-code")
41
43
  }, "autoTrack: true,", /*#__PURE__*/React.createElement("span", null, "//\u5168\u57CB\u70B9\u5F00\u5173")), /*#__PURE__*/React.createElement("div", {
42
44
  className: "".concat(classPrefix, "-code")
43
- }, "singlePage: false", /*#__PURE__*/React.createElement("span", null, "//\u662F\u5426\u4E3A\u5355\u9875\u9762\u5E94\u7528 \u9ED8\u8BA4\u4E3Afalse")), /*#__PURE__*/React.createElement("div", null, '}', ");")), /*#__PURE__*/React.createElement("p", null, "\u9002\u7528\u4E8ELanding Page\u3001\u6D3B\u52A8\u9875\u3001\u5B98\u7F51\uFF0C\u9875\u9762\u7B80\u5355\u53EF\u4F7F\u7528\u9875\u9762\u70B9\u51FB\u5206\u6790\u63D0\u5347\u6548\u7387\uFF0C\u5EFA\u8BAE\u4E0D\u8981\u5728\u590D\u6742\u9875\u9762\u4F7F\u7528\u3002")), /*#__PURE__*/React.createElement("img", {
45
+ }, "singlePage: false", /*#__PURE__*/React.createElement("span", null, "//\u662F\u5426\u4E3A\u5355\u9875\u9762\u5E94\u7528 \u9ED8\u8BA4\u4E3Afalse")), /*#__PURE__*/React.createElement("div", null, '}', ");")), /*#__PURE__*/React.createElement("p", null, "\u9002\u7528\u4E8ELanding Page\u3001\u6D3B\u52A8\u9875\u3001\u5B98\u7F51\uFF0C\u9875\u9762\u7B80\u5355\u53EF\u4F7F\u7528\u9875\u9762\u70B9\u51FB\u5206\u6790\u63D0\u5347\u6548\u7387\uFF0C\u5EFA\u8BAE\u4E0D\u8981\u5728\u590D\u6742\u9875\u9762\u4F7F\u7528\u3002"))), /*#__PURE__*/React.createElement("img", {
44
46
  className: "".concat(classPrefix, "-img"),
45
47
  src: chartImg
46
48
  }));
@@ -9,13 +9,16 @@
9
9
  background: url(./img/bg.png);
10
10
  background-size: cover;
11
11
  &-content {
12
- width: 400px;
12
+ width: 406px;
13
13
  margin-left: 136px;
14
14
  p {
15
15
  color: #9aa1a9;
16
16
  font-size: 14px;
17
17
  }
18
18
  }
19
+ &-content2 {
20
+ width: 400px;
21
+ }
19
22
  &-title {
20
23
  margin-bottom: 24px;
21
24
  font-weight: 500;
@@ -32,7 +35,7 @@
32
35
  position: relative;
33
36
  height: 200px;
34
37
  padding: 16px;
35
- background: #fff;
38
+ background: #fafafb;
36
39
  border-radius: 8px;
37
40
 
38
41
  &:hover {
@@ -57,12 +60,11 @@
57
60
  }
58
61
  &-code-copy {
59
62
  position: absolute;
60
- top: 8px;
61
- right: 0;
63
+ top: 16px;
64
+ right: 16px;
62
65
  display: flex;
63
66
  display: none;
64
67
  align-items: center;
65
- align-items: center;
66
68
  height: 24px;
67
69
  padding: 0 8px;
68
70
  background: #f2f3f4;
@@ -132,13 +132,18 @@ var ModulesPage = function ModulesPage(props) {
132
132
  }
133
133
  if (type === 'pageGroup' && !(searchValue !== null && searchValue !== void 0 && searchValue.pageGroup)) return;
134
134
  if (type === 'page' || pageType === 'detail') {
135
+ if (!searchValue.pageUrl && !searchValue.pageTitle && !searchValue.pageGroup && searchValue.pageGroup != 0) return;
135
136
  fetch();
136
137
  } else if (type === 'pageGroup') {
137
- props.onChange && props.onChange(_objectSpread({
138
+ if (!searchValue.pageGroup && searchValue.pageGroup != 0) return;
139
+ props.onChange && props.onChange(_objectSpread(_objectSpread({
138
140
  appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
139
141
  platform: 3,
140
142
  module: 'page'
141
- }, searchValue));
143
+ }, searchValue), {}, {
144
+ pageUrl: undefined,
145
+ pageTitle: undefined
146
+ }));
142
147
  }
143
148
  }, [searchValue]);
144
149
  // 查询结果
@@ -148,17 +153,17 @@ var ModulesPage = function ModulesPage(props) {
148
153
  }
149
154
  setLoading(true);
150
155
  setTimer(setTimeout(function () {
151
- if (_.isEqual(originSearchValue, searchValue)) {
152
- setLoading(false);
153
- return;
154
- }
155
- setOriginSearchValue(_.cloneDeep(searchValue));
156
156
  var param = _objectSpread({
157
157
  appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
158
158
  platform: 3,
159
159
  module: 'page'
160
160
  }, searchValue);
161
161
  props.onChange && props.onChange(param);
162
+ if (_.isEqual(originSearchValue, searchValue)) {
163
+ setLoading(false);
164
+ return;
165
+ }
166
+ setOriginSearchValue(_.cloneDeep(searchValue));
162
167
  getPageResult(param, setResult, setLoading);
163
168
  }, 500));
164
169
  };
@@ -215,6 +220,7 @@ var ModulesPage = function ModulesPage(props) {
215
220
  setCurrentClickPage: setCurrentClickPage
216
221
  }
217
222
  }, /*#__PURE__*/React.createElement(BizLayout, {
223
+ className: classPrefix,
218
224
  title: "\u9875\u9762\u5206\u6790",
219
225
  hasCollapse: true,
220
226
  topPanel: /*#__PURE__*/React.createElement(Skeleton, {
@@ -29,4 +29,10 @@
29
29
  margin-top: 60px;
30
30
  background-color: #fff;
31
31
  }
32
+ .ant-btn {
33
+ .bsicon {
34
+ font-size: 16px !important;
35
+ line-height: 1;
36
+ }
37
+ }
32
38
  }
@@ -41,6 +41,6 @@ export declare namespace ModulesPageTypes {
41
41
  export declare const ModulesPageContext: import("react").Context<{
42
42
  pageList: ModulesPageTypes.Page[];
43
43
  pageGroupList: ModulesPageTypes.PageGroup[];
44
- currentClickPage?: ModulesPageTypes.PageGroup | ModulesPageTypes.Page | undefined;
44
+ currentClickPage?: ModulesPageTypes.Page | ModulesPageTypes.PageGroup | undefined;
45
45
  setCurrentClickPage?: ((data: ModulesPageTypes.Page) => void) | undefined;
46
46
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-page",
3
- "version": "1.0.1-alpha.20",
3
+ "version": "1.0.1-alpha.22",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -39,7 +39,7 @@
39
39
  "@types/lodash": "^4.14.197",
40
40
  "@umijs/fabric": "^2.8.1",
41
41
  "@umijs/test": "^3.0.5",
42
- "@zgfe/business-lib": "1.1.81-page.10",
42
+ "@zgfe/business-lib": "1.1.81-page.16",
43
43
  "antd": "^4.22.6",
44
44
  "dumi": "^1.1.0",
45
45
  "father": "^4.0.0-rc.2",
@@ -50,5 +50,5 @@
50
50
  "prettier": "^2.2.1",
51
51
  "yorkie": "^2.0.0"
52
52
  },
53
- "gitHead": "ec25eecbfc957817643b49e2df5d8f03e14463e4"
53
+ "gitHead": "521427cd3566eba3e8d0dad2bcd9c266cc627545"
54
54
  }