@zgfe/modules-page 1.0.1-alpha.3 → 1.0.1-alpha.30

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.
Files changed (33) hide show
  1. package/dist/esm/components/content/index.d.ts +1 -1
  2. package/dist/esm/components/content/index.js +5 -1
  3. package/dist/esm/components/content/types.d.ts +1 -0
  4. package/dist/esm/components/content/utils.d.ts +4 -15
  5. package/dist/esm/components/content/utils.js +12 -12
  6. package/dist/esm/components/detail/images/percent.png +0 -0
  7. package/dist/esm/components/detail/index.js +35 -56
  8. package/dist/esm/components/detail/index.less +9 -2
  9. package/dist/esm/components/groupModal/index.d.ts +2 -6
  10. package/dist/esm/components/groupModal/index.js +16 -12
  11. package/dist/esm/components/groupModal/index.less +23 -1
  12. package/dist/esm/components/groupModal/inputSelect.js +1 -0
  13. package/dist/esm/components/groupModal/types.d.ts +2 -0
  14. package/dist/esm/components/pageSelect/index.js +48 -37
  15. package/dist/esm/components/pageSelect/types.d.ts +0 -2
  16. package/dist/esm/components/searchPanel/index.d.ts +1 -1
  17. package/dist/esm/components/searchPanel/index.js +14 -37
  18. package/dist/esm/components/searchPanel/index.less +7 -34
  19. package/dist/esm/components/searchPanel/types.d.ts +3 -3
  20. package/dist/esm/components/searchPanel/util.d.ts +4 -4
  21. package/dist/esm/components/searchPanel/util.js +35 -29
  22. package/dist/esm/components/topContent/index.less +1 -0
  23. package/dist/esm/constants/api.js +1 -1
  24. package/dist/esm/modules/empty/index.js +3 -1
  25. package/dist/esm/modules/empty/index.less +11 -6
  26. package/dist/esm/modules/home/demo/index.js +60 -2
  27. package/dist/esm/modules/home/index.js +96 -50
  28. package/dist/esm/modules/home/style/index.less +23 -0
  29. package/dist/esm/modules/home/types.d.ts +9 -1
  30. package/dist/esm/modules/home/utils.d.ts +3 -3
  31. package/dist/esm/modules/home/utils.js +33 -12
  32. package/package.json +3 -3
  33. package/dist/esm/components/detail/images/color_pallete_percent.png +0 -0
@@ -7,7 +7,7 @@ declare const PageContent: React.FC<{
7
7
  value?: PageColumnType[];
8
8
  groupId?: number;
9
9
  hasUserGroup?: boolean;
10
- onClick?: (data: any) => void;
10
+ onClick?: (data: ModulesPageTypes.PageGroup | ModulesPageTypes.Page) => void;
11
11
  onEdit?: (data: ModulesPageTypes.PageGroup) => void;
12
12
  onCreate?: () => void;
13
13
  }>;
@@ -21,6 +21,9 @@ var PageContent = function PageContent(props) {
21
21
  }
22
22
  return data;
23
23
  }, [pageGroupList, props.groupId]);
24
+ var columns = useMemo(function () {
25
+ return getColumns(props.type, props.hasUserGroup, props.onClick, props.onEdit);
26
+ }, [props.type, props.hasUserGroup]);
24
27
  if (props.type === 'pageGroup' && !groupList.length) {
25
28
  return /*#__PURE__*/React.createElement("div", {
26
29
  className: "".concat(classPrefix, "-empty")
@@ -43,8 +46,9 @@ var PageContent = function PageContent(props) {
43
46
  return /*#__PURE__*/React.createElement("div", {
44
47
  className: classPrefix
45
48
  }, /*#__PURE__*/React.createElement(BizTable, {
49
+ rowKey: "id",
46
50
  dataSource: props.type === 'pageGroup' ? groupList : props.value,
47
- columns: getColumns(props.type, props.hasUserGroup, props.onClick, props.onEdit)
51
+ columns: columns
48
52
  }));
49
53
  };
50
54
  export default PageContent;
@@ -1,4 +1,5 @@
1
1
  export interface PageColumnType {
2
+ id?: string;
2
3
  userGroup?: string;
3
4
  pageTitle?: string;
4
5
  pageUrl?: string;
@@ -1,17 +1,6 @@
1
- import { ColumnGroupType, ColumnType, ColumnsType } from 'antd/lib/table';
2
- import React from 'react';
3
- export declare const getColumns: (type: string, hasUserGroup?: boolean, onClickCallback?: Function, onEditCallback?: Function) => ((ColumnGroupType<object> | ColumnType<object>)[] & ColumnsType<any>) | ({
4
- title: string;
5
- dataIndex: string;
6
- key: string;
7
- render: (txt: string, record: any) => React.JSX.Element;
8
- width?: undefined;
9
- } | {
10
- title: string;
11
- dataIndex: string;
12
- key: string;
13
- width: number;
14
- render?: undefined;
15
- })[];
1
+ import { ColumnsType } from 'antd/lib/table';
2
+ import { PageColumnType } from './types';
3
+ import { ModulesPageTypes } from '../../modules/home/types';
4
+ export declare const getColumns: (type: string, hasUserGroup?: boolean, onClickCallback?: Function, onEditCallback?: Function) => ColumnsType<PageColumnType> | ColumnsType<ModulesPageTypes.PageGroup>;
16
5
  export declare const getNumPer: (viewUser: number, clickUser: number) => string;
17
6
  export declare const toThousands: (num?: number) => string | number | undefined;
@@ -19,7 +19,10 @@ export var getColumns = function getColumns(type, hasUserGroup, onClickCallback,
19
19
  return /*#__PURE__*/React.createElement("div", {
20
20
  className: "table-td-page",
21
21
  onClick: function onClick() {
22
- return onClickCallback && onClickCallback(record);
22
+ return onClickCallback && onClickCallback({
23
+ pageTitle: record.pageTitle,
24
+ pageUrl: record.pageUrl
25
+ });
23
26
  }
24
27
  }, /*#__PURE__*/React.createElement(Tooltip, {
25
28
  title: record.pageTitle
@@ -37,9 +40,10 @@ export var getColumns = function getColumns(type, hasUserGroup, onClickCallback,
37
40
  onClick: function onClick(e) {
38
41
  var _navigator, _navigator$clipboard;
39
42
  e.stopPropagation();
40
- (_navigator = navigator) === null || _navigator === void 0 ? void 0 : (_navigator$clipboard = _navigator.clipboard) === null || _navigator$clipboard === void 0 ? void 0 : _navigator$clipboard.writeText(record.pageUrl).catch(function () {
43
+ if (!(record !== null && record !== void 0 && record.pageUrl)) return;
44
+ (_navigator = navigator) === null || _navigator === void 0 ? void 0 : (_navigator$clipboard = _navigator.clipboard) === null || _navigator$clipboard === void 0 ? void 0 : _navigator$clipboard.writeText(record === null || record === void 0 ? void 0 : record.pageUrl).catch(function () {
41
45
  var el = document.createElement('textarea');
42
- el.value = record.pageUrl;
46
+ el.value = record.pageUrl || '';
43
47
  document.body.appendChild(el);
44
48
  el.select();
45
49
  document.execCommand('copy');
@@ -117,7 +121,7 @@ export var getColumns = function getColumns(type, hasUserGroup, onClickCallback,
117
121
  },
118
122
  showSorterTooltip: false,
119
123
  render: function render(_txt, record) {
120
- return getNumPer(record.viewUser, record.clickUser);
124
+ return getNumPer(record.viewUser || 0, record.clickUser || 0);
121
125
  }
122
126
  }];
123
127
  if (hasUserGroup) {
@@ -125,7 +129,8 @@ export var getColumns = function getColumns(type, hasUserGroup, onClickCallback,
125
129
  title: '用户群',
126
130
  dataIndex: 'userGroup',
127
131
  key: 'userGroup',
128
- align: 'left'
132
+ align: 'left',
133
+ ellipsis: true
129
134
  });
130
135
  }
131
136
  var groupColumns = [{
@@ -140,7 +145,7 @@ export var getColumns = function getColumns(type, hasUserGroup, onClickCallback,
140
145
  onClick: function onClick() {
141
146
  return onClickCallback && onClickCallback(record);
142
147
  }
143
- }, ' ', txt), /*#__PURE__*/React.createElement(IconFont, {
148
+ }, txt), /*#__PURE__*/React.createElement(IconFont, {
144
149
  type: "bianji1",
145
150
  onClick: function onClick() {
146
151
  return onEditCallback && onEditCallback(record);
@@ -156,7 +161,7 @@ export var getColumns = function getColumns(type, hasUserGroup, onClickCallback,
156
161
  return type === 'page' ? pageColumns : groupColumns;
157
162
  };
158
163
  export var getNumPer = function getNumPer(viewUser, clickUser) {
159
- if (viewUser === -1) {
164
+ if (!viewUser || viewUser === -1) {
160
165
  return '-';
161
166
  }
162
167
  return viewUser ? (clickUser / viewUser * 100).toFixed(1) + '%' : 0 + '%';
@@ -166,9 +171,4 @@ export var toThousands = function toThousands(num) {
166
171
  return num === -1 ? '-' : util.toThousands(num);
167
172
  }
168
173
  return num;
169
- };
170
- var sorter = function sorter(a, b) {
171
- if (a.viewUser === -1 || !a.viewUser) return 0;
172
- if (b.viewUser === -1 || !b.viewUser) return 1;
173
- return a.clickUser / a.viewUser - b.clickUser / b.viewUser;
174
174
  };
@@ -10,48 +10,37 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
10
10
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
11
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
- import React, { useContext, useEffect, useState } from 'react';
13
+ import React, { useContext, useEffect, useMemo, useState } from 'react';
14
14
  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
- import api from "../../constants/api";
22
21
  import { getSocketSecret } from "../../modules/home/utils";
22
+ import api from "../../constants/api";
23
23
  var DetailContent = function DetailContent(props) {
24
24
  var classPrefix = 'detail-content';
25
- var _useState = useState([]),
26
- _useState2 = _slicedToArray(_useState, 2),
27
- detailList = _useState2[0],
28
- setDetailList = _useState2[1];
29
- var _useState3 = useState(true),
30
- _useState4 = _slicedToArray(_useState3, 2),
31
- loading = _useState4[0],
32
- setLoading = _useState4[1];
33
- var _useState5 = useState(0),
34
- _useState6 = _slicedToArray(_useState5, 2),
35
- timer = _useState6[0],
36
- setTimer = _useState6[1];
37
25
  var _useContext = useContext(BizGlobalDataContext),
38
26
  currentApp = _useContext.currentApp;
39
27
  var _useContext2 = useContext(ModulesPageContext),
40
28
  pageGroupList = _useContext2.pageGroupList,
41
29
  pageList = _useContext2.pageList,
42
30
  setCurrentClickPage = _useContext2.setCurrentClickPage;
43
- var _useState7 = useState(),
44
- _useState8 = _slicedToArray(_useState7, 2),
45
- client = _useState8[0],
46
- setClient = _useState8[1];
31
+ var _useState = useState(),
32
+ _useState2 = _slicedToArray(_useState, 2),
33
+ client = _useState2[0],
34
+ setClient = _useState2[1];
47
35
  // 当前url
48
- var _useState9 = useState(),
49
- _useState10 = _slicedToArray(_useState9, 2),
50
- pageUrl = _useState10[0],
51
- setPageUrl = _useState10[1];
36
+ var _useState3 = useState(),
37
+ _useState4 = _slicedToArray(_useState3, 2),
38
+ pageUrl = _useState4[0],
39
+ setPageUrl = _useState4[1];
52
40
  useEffect(function () {
53
41
  var secret = getSocketSecret();
54
- var socket = new SocketClient(api.socket, currentApp === null || currentApp === void 0 ? void 0 : currentApp.appKey, {
42
+ var url = "wss://".concat(location.host).concat(api.socket);
43
+ var socket = new SocketClient(url, currentApp === null || currentApp === void 0 ? void 0 : currentApp.appKey, {
55
44
  appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
56
45
  origin: 4,
57
46
  role: 'server',
@@ -88,8 +77,8 @@ var DetailContent = function DetailContent(props) {
88
77
  });
89
78
  client.onConnected(function () {
90
79
  client.emit('openAutoTrack', _objectSpread({
91
- app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
92
- platform: (currentApp === null || currentApp === void 0 ? void 0 : currentApp.platform) || 0
80
+ appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
81
+ platform: 3
93
82
  }, props.params));
94
83
  });
95
84
  client.onError(function (err) {
@@ -99,8 +88,7 @@ var DetailContent = function DetailContent(props) {
99
88
  console.log('连接已存在');
100
89
  });
101
90
  client.on('pageInfo', function (message) {
102
- console.log('接收消息', message);
103
- if (message.href !== pageUrl) {
91
+ if (message.href !== openUrl) {
104
92
  setPageUrl(message.href);
105
93
  // 如果当前类型是单页面,则更新页面选择
106
94
  if (props.type === 'page') {
@@ -131,33 +119,24 @@ var DetailContent = function DetailContent(props) {
131
119
  href: pageUrl
132
120
  });
133
121
  client.emit('updateAutoTrackParam', _objectSpread({
134
- app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
135
- platform: (currentApp === null || currentApp === void 0 ? void 0 : currentApp.platform) || 0
122
+ appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
123
+ platform: 3
136
124
  }, props.params));
137
- // if (timer) {
138
- // clearTimeout(timer);
139
- // }
140
- // setTimer(
141
- // setTimeout(() => {
142
- // setLoading(true);
143
- // ajax(api.getDetailResult, {
144
- // method:'post',
145
- // data: {
146
- // appId: currentApp?.appId,
147
- // platform: currentApp?.platform || 0,
148
- // // ...props.params,
149
- // },
150
- // })
151
- // .then((res) => {
152
- // if (!res) return;
153
- // setDetailList(res.data as PageColumnType[]);
154
- // })
155
- // .finally(() => {
156
- // setLoading(false);
157
- // });
158
- // }, 500),
159
- // );
160
125
  }, [props.params]);
126
+ var openUrl = useMemo(function () {
127
+ if (!pageUrl) return '';
128
+ var pUrl = pageUrl,
129
+ url = '';
130
+ var hash = pUrl.match(/#\S*$/) || [''];
131
+ if (hash) pUrl = pUrl.replace(hash[0], '');
132
+ var secret = 'autoTrack-' + getSocketSecret();
133
+ if (/\?/.test(pageUrl)) {
134
+ url = "".concat(pUrl.replace(/\/$/, ''), "&zgSecret=").concat(secret).concat(hash);
135
+ } else {
136
+ url = "".concat(pUrl.replace(/\/$/, ''), "?zgSecret=").concat(secret).concat(hash);
137
+ }
138
+ return url;
139
+ }, [pageUrl]);
161
140
  return /*#__PURE__*/React.createElement("div", {
162
141
  className: classPrefix
163
142
  }, /*#__PURE__*/React.createElement("div", {
@@ -170,14 +149,14 @@ var DetailContent = function DetailContent(props) {
170
149
  title: pageUrl
171
150
  }, /*#__PURE__*/React.createElement("span", {
172
151
  className: "".concat(classPrefix, "-top-value")
173
- }, pageUrl))), /*#__PURE__*/React.createElement("div", {
152
+ }, decodeURI(pageUrl || '')))), /*#__PURE__*/React.createElement("div", {
174
153
  className: "".concat(classPrefix, "-top-content")
175
154
  }, props.result.map(function (item, index) {
176
155
  var _props$params2, _props$params$userGro;
177
156
  return /*#__PURE__*/React.createElement("div", {
178
157
  className: "".concat(classPrefix, "-top-item"),
179
158
  key: index
180
- }, (_props$params2 = props.params) !== null && _props$params2 !== void 0 && _props$params2.userGroup && ((_props$params$userGro = props.params.userGroup) === null || _props$params$userGro === void 0 ? void 0 : _props$params$userGro.length) > 1 ? /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("span", null, "\u7528\u6237\u7FA4\uFF1A"), /*#__PURE__*/React.createElement("span", null, item.userGroup)) : null, /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("span", null, "\u6D4F\u89C8\uFF1A"), /*#__PURE__*/React.createElement("span", null, toThousands(item.viewTimes), "\u6B21"), /*#__PURE__*/React.createElement("span", null, toThousands(item.viewUser), "\u4EBA")), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("span", null, "\u9875\u9762\u5185\u70B9\u51FB\uFF1A"), /*#__PURE__*/React.createElement("span", null, toThousands(item.clickTimes), "\u6B21"), /*#__PURE__*/React.createElement("span", null, toThousands(item.clickUser), "\u4EBA")), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("span", null, "\u70B9\u51FB\u4EBA\u6570\u5360\u6BD4\uFF1A"), /*#__PURE__*/React.createElement("span", null, getNumPer(item.viewUser, item.clickUser)), /*#__PURE__*/React.createElement(Tooltip, {
159
+ }, (_props$params2 = props.params) !== null && _props$params2 !== void 0 && _props$params2.userGroup && ((_props$params$userGro = props.params.userGroup) === null || _props$params$userGro === void 0 ? void 0 : _props$params$userGro.length) > 1 ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u7528\u6237\u7FA4\uFF1A"), /*#__PURE__*/React.createElement("span", null, item.userGroup)) : null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u6D4F\u89C8\uFF1A"), /*#__PURE__*/React.createElement("span", null, toThousands(item.viewTimes), "\u6B21"), /*#__PURE__*/React.createElement("span", null, toThousands(item.viewUser), "\u4EBA")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u9875\u9762\u5185\u70B9\u51FB\uFF1A"), /*#__PURE__*/React.createElement("span", null, toThousands(item.clickTimes), "\u6B21"), /*#__PURE__*/React.createElement("span", null, toThousands(item.clickUser), "\u4EBA")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u70B9\u51FB\u4EBA\u6570\u5360\u6BD4\uFF1A"), /*#__PURE__*/React.createElement("span", null, getNumPer(item.viewUser, item.clickUser)), /*#__PURE__*/React.createElement(Tooltip, {
181
160
  title: "\u70B9\u51FB\u4EBA\u6570\u5360\u6BD4\uFF1D\u9875\u9762\u5185\u70B9\u51FB\u4EBA\u6570\uFF0F\u9875\u9762\u6D4F\u89C8\u4EBA\u6570"
182
161
  }, /*#__PURE__*/React.createElement(IconFont, {
183
162
  type: "tishi"
@@ -193,7 +172,7 @@ var DetailContent = function DetailContent(props) {
193
172
  }, /*#__PURE__*/React.createElement("img", {
194
173
  src: renderImg
195
174
  }), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", {
196
- href: pageUrl === null || pageUrl === void 0 ? void 0 : pageUrl.trim(),
175
+ href: openUrl,
197
176
  target: "_blank"
198
177
  }, "\u6253\u5F00\u65B0\u6807\u7B7E\u9875", /*#__PURE__*/React.createElement(IconFont, {
199
178
  type: "zhuanfa"
@@ -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 {
@@ -36,12 +37,16 @@
36
37
  &-item {
37
38
  display: flex;
38
39
  gap: 40px;
40
+ align-items: center;
39
41
  color: #67727f;
40
42
  .bsicon {
41
43
  margin-left: 8px;
42
44
  color: #9aa1a9;
43
45
  font-size: 16px !important;
44
46
  cursor: pointer;
47
+ &:hover {
48
+ color: @primary-color;
49
+ }
45
50
  }
46
51
  }
47
52
  }
@@ -52,8 +57,10 @@
52
57
  min-height: 422px;
53
58
  padding: 16px;
54
59
  &-img {
55
- height: 22px;
56
60
  text-align: right;
61
+ img {
62
+ height: 22px;
63
+ }
57
64
  }
58
65
  &-panel {
59
66
  display: flex;
@@ -1,10 +1,6 @@
1
1
  import React from 'react';
2
2
  import './index.less';
3
+ import { GroupModalType } from './types';
3
4
  export declare const classPrefix = "group-modal";
4
- declare const GroupModal: React.FC<{
5
- value?: any;
6
- type?: string;
7
- onOk?: () => void;
8
- onCancel?: () => void;
9
- }>;
5
+ declare const GroupModal: React.FC<GroupModalType.Props>;
10
6
  export default GroupModal;
@@ -62,13 +62,14 @@ var GroupModal = function GroupModal(props) {
62
62
  });
63
63
  }, []);
64
64
  var onDelete = function onDelete() {
65
+ var _props$value;
65
66
  setLoading(true);
66
67
  ajax(api.deletePageGroup, {
67
68
  method: 'post',
68
69
  data: {
69
70
  appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
70
71
  platform: 3,
71
- id: props.value.id
72
+ id: (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.id
72
73
  }
73
74
  }).then(function (res) {
74
75
  if (!res) {
@@ -86,7 +87,7 @@ var GroupModal = function GroupModal(props) {
86
87
  (_refForm$current = refForm.current) === null || _refForm$current === void 0 ? void 0 : _refForm$current.submit();
87
88
  };
88
89
  var onSubmit = function onSubmit(data) {
89
- var _props$value;
90
+ var _props$value2;
90
91
  setValidate(true);
91
92
  var flag = true;
92
93
  data.filters.forEach(function (item) {
@@ -102,16 +103,16 @@ var GroupModal = function GroupModal(props) {
102
103
  data: _objectSpread({
103
104
  appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
104
105
  platform: 3,
105
- id: (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.id
106
+ id: (_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.id
106
107
  }, data)
107
108
  }).then(function (res) {
108
- var _props$value3;
109
+ var _props$value4;
109
110
  if (!res) {
110
- var _props$value2;
111
- message.error("".concat((_props$value2 = props.value) !== null && _props$value2 !== void 0 && _props$value2.id ? '修改' : '创建', "\u5931\u8D25"));
111
+ var _props$value3;
112
+ message.error("".concat((_props$value3 = props.value) !== null && _props$value3 !== void 0 && _props$value3.id ? '修改' : '创建', "\u5931\u8D25"));
112
113
  return;
113
114
  }
114
- message.success("".concat((_props$value3 = props.value) !== null && _props$value3 !== void 0 && _props$value3.id ? '修改' : '创建', "\u6210\u529F"));
115
+ message.success("".concat((_props$value4 = props.value) !== null && _props$value4 !== void 0 && _props$value4.id ? '修改' : '创建', "\u6210\u529F"));
115
116
  props.onOk && props.onOk();
116
117
  }).finally(function () {
117
118
  setLoading(false);
@@ -119,6 +120,7 @@ var GroupModal = function GroupModal(props) {
119
120
  };
120
121
  return /*#__PURE__*/React.createElement(BizDialog, {
121
122
  open: true,
123
+ closable: true,
122
124
  className: classPrefix,
123
125
  width: 720,
124
126
  title: props.value ? '修改分组' : '创建分组',
@@ -126,7 +128,8 @@ var GroupModal = function GroupModal(props) {
126
128
  okButtonProps: {
127
129
  disabled: isDemo
128
130
  },
129
- footer: btnList
131
+ footer: btnList,
132
+ onCancel: props.onCancel
130
133
  }, /*#__PURE__*/React.createElement(Spin, {
131
134
  spinning: loading
132
135
  }, /*#__PURE__*/React.createElement(Form, {
@@ -150,7 +153,7 @@ var GroupModal = function GroupModal(props) {
150
153
  name: "initPage",
151
154
  rules: [{
152
155
  validator: function validator(_, value) {
153
- var reg = /^(?:(http|https|ftp):\/\/)?((?:[\w-]+\.)+[a-z0-9]+)((?:\/[^/?#]*)+)?(\?[^#]+)?(#.+)?$/i;
156
+ var reg = /^((http:\/\/)|(https:\/\/)|(\/\/))[A-Za-z0-9]/;
154
157
  if (!value || !/\S+/.test(value)) return Promise.reject("\u8BF7\u8F93\u5165\u80CC\u666F\u9875\u5730\u5740");
155
158
  if (!reg.test(value)) return Promise.reject('必须是合法的网页链接');
156
159
  return Promise.resolve();
@@ -159,12 +162,13 @@ var GroupModal = function GroupModal(props) {
159
162
  }, /*#__PURE__*/React.createElement(Input, {
160
163
  className: "".concat(classPrefix, "-form-input"),
161
164
  placeholder: "\u8BF7\u8F93\u5165\u5728\u67E5\u770B\u70B9\u51FB\u56FE\u65F6\u7684\u80CC\u666F\u9875\u9762"
162
- })), /*#__PURE__*/React.createElement(Form.Item, {
165
+ })), /*#__PURE__*/React.createElement("div", {
163
166
  className: "".concat(classPrefix, "-form-title")
164
167
  }, " \u6DFB\u52A0\u9875\u9762"), /*#__PURE__*/React.createElement(Form.Item, {
165
- name: "filters"
168
+ name: "filters",
169
+ className: "".concat(classPrefix, "-form-item-filter")
166
170
  }, /*#__PURE__*/React.createElement(PageItem, {
167
171
  validate: validate
168
- }))), /*#__PURE__*/React.createElement(Button, null)));
172
+ })))));
169
173
  };
170
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 {
@@ -163,9 +172,22 @@
163
172
  border-top: 1px solid #f2f3f4 !important;
164
173
 
165
174
  .group-modal-footer-del {
175
+ display: flex;
176
+ align-items: center;
166
177
  float: left;
178
+ background: #f2f3f4 !important;
167
179
  .bsicon {
168
180
  margin-right: 8px;
181
+ font-size: 16px !important;
182
+ line-height: 1;
183
+ }
184
+ &.ant-btn-text:hover {
185
+ color: #fb5547 !important;
186
+ background: #f2f3f4 !important;
187
+ }
188
+ &.ant-btn-text:focus {
189
+ color: #e24c40 !important;
190
+ background: #f2f3f4 !important;
169
191
  }
170
192
  }
171
193
  }
@@ -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,
@@ -2,6 +2,8 @@ import { ModulesPageTypes } from '../../modules/home/types';
2
2
  export declare namespace GroupModalType {
3
3
  interface Props {
4
4
  value?: ModulesPageTypes.PageGroup;
5
+ onOk?: () => void;
6
+ onCancel?: () => void;
5
7
  }
6
8
  interface ItemProps {
7
9
  value?: ModulesPageTypes.ItemValue[];