@cloud-app-dev/vidc 1.0.47 → 2.0.0-alpha.0

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 (108) hide show
  1. package/.umirc.ts +1 -1
  2. package/README.md +4 -0
  3. package/es/AppContext/Sync.d.ts +6 -0
  4. package/es/AppContext/Sync.js +47 -0
  5. package/es/AppContext/index.d.ts +10 -0
  6. package/es/AppContext/index.js +111 -0
  7. package/es/AppContext/interface.d.ts +29 -0
  8. package/es/AppContext/static.d.ts +6 -0
  9. package/es/AppContext/static.js +6 -0
  10. package/es/AutoExit/index.d.ts +1 -1
  11. package/es/RefDrawer/index.d.ts +2 -2
  12. package/es/RefModal/index.d.ts +2 -2
  13. package/es/TreeMode/index.js +1 -2
  14. package/es/WorkerFlow/Demo.js +1 -0
  15. package/es/WorkerFlow/Form/Condition.js +8 -8
  16. package/es/WorkerFlow/Form/GroupList.d.ts +2 -1
  17. package/es/WorkerFlow/Form/GroupList.js +3 -2
  18. package/es/WorkerFlow/Form/GroupSelectModalContent.js +4 -2
  19. package/es/WorkerFlow/Form/UserSet.js +1 -6
  20. package/es/WorkerFlow/Nodes/TitleElement.js +13 -6
  21. package/es/WorkerFlow/index.js +40 -8
  22. package/es/WorkerFlow/utils.js +1 -1
  23. package/es/index.d.ts +1 -8
  24. package/es/index.js +1 -8
  25. package/package.json +4 -4
  26. package/es/AppLayout/AppHeader/index.css +0 -4
  27. package/es/AppLayout/AppHeader/index.d.ts +0 -18
  28. package/es/AppLayout/AppHeader/index.js +0 -41
  29. package/es/AppLayout/AppHorizontalMenu/MenuEmptyBox.d.ts +0 -1
  30. package/es/AppLayout/AppHorizontalMenu/MenuEmptyBox.js +0 -10
  31. package/es/AppLayout/AppHorizontalMenu/SubGroup.d.ts +0 -9
  32. package/es/AppLayout/AppHorizontalMenu/SubGroup.js +0 -57
  33. package/es/AppLayout/AppHorizontalMenu/index.css +0 -152
  34. package/es/AppLayout/AppHorizontalMenu/index.d.ts +0 -13
  35. package/es/AppLayout/AppHorizontalMenu/index.js +0 -230
  36. package/es/AppLayout/AppInlineMenu/SubGroup.d.ts +0 -9
  37. package/es/AppLayout/AppInlineMenu/SubGroup.js +0 -34
  38. package/es/AppLayout/AppInlineMenu/index.css +0 -110
  39. package/es/AppLayout/AppInlineMenu/index.d.ts +0 -12
  40. package/es/AppLayout/AppInlineMenu/index.js +0 -194
  41. package/es/AppLayout/AppLogo/index.css +0 -74
  42. package/es/AppLayout/AppLogo/index.d.ts +0 -13
  43. package/es/AppLayout/AppLogo/index.js +0 -100
  44. package/es/AppLayout/AppTools/index.css +0 -0
  45. package/es/AppLayout/AppTools/index.d.ts +0 -8
  46. package/es/AppLayout/AppTools/index.js +0 -10
  47. package/es/AppLayout/FunctionPreview/index.css +0 -128
  48. package/es/AppLayout/FunctionPreview/index.d.ts +0 -22
  49. package/es/AppLayout/FunctionPreview/index.js +0 -218
  50. package/es/AppLayout/Header/ListenceRoute.d.ts +0 -5
  51. package/es/AppLayout/Header/ListenceRoute.js +0 -28
  52. package/es/AppLayout/Header/ModifyPassword/index.d.ts +0 -6
  53. package/es/AppLayout/Header/ModifyPassword/index.js +0 -201
  54. package/es/AppLayout/Header/ModifyUserAvatar/index.css +0 -21
  55. package/es/AppLayout/Header/ModifyUserAvatar/index.d.ts +0 -10
  56. package/es/AppLayout/Header/ModifyUserAvatar/index.js +0 -98
  57. package/es/AppLayout/Header/NotifyAlarm.js +0 -122
  58. package/es/AppLayout/Header/ThemeTools.js +0 -69
  59. package/es/AppLayout/Header/Tools.d.ts +0 -11
  60. package/es/AppLayout/Header/Tools.js +0 -86
  61. package/es/AppLayout/Header/ToolsItem.d.ts +0 -1
  62. package/es/AppLayout/Header/ToolsItem.js +0 -12
  63. package/es/AppLayout/Header/UserAction.d.ts +0 -10
  64. package/es/AppLayout/Header/UserAction.js +0 -224
  65. package/es/AppLayout/Header/index.css +0 -136
  66. package/es/AppLayout/Header/index.d.ts +0 -9
  67. package/es/AppLayout/Header/index.js +0 -36
  68. package/es/AppLayout/index.css +0 -21
  69. package/es/AppLayout/index.d.ts +0 -12
  70. package/es/AppLayout/index.js +0 -38
  71. package/es/AppLayout/service/index.js +0 -174
  72. package/es/AppLayout/service/prefix.js +0 -4
  73. package/es/AppLayout/service/url.js +0 -35
  74. package/es/AppLayout/utils/menu.js +0 -24
  75. package/es/AppLayout/utils.d.ts +0 -4
  76. package/es/AppLayout/utils.js +0 -112
  77. package/es/DagInitialConfig/index.css +0 -0
  78. package/es/DagInitialConfig/index.d.ts +0 -10
  79. package/es/DagInitialConfig/index.js +0 -70
  80. package/es/DagInitialConfig/utils.js +0 -185
  81. package/es/DagInitialRequest/index.css +0 -0
  82. package/es/DagInitialRequest/index.d.ts +0 -10
  83. package/es/DagInitialRequest/index.js +0 -77
  84. package/es/DagInitialRequest/utils.js +0 -573
  85. package/es/FormContent/index.css +0 -27
  86. package/es/FormContent/index.d.ts +0 -19
  87. package/es/FormContent/index.js +0 -58
  88. package/es/OrgTree/index.css +0 -39
  89. package/es/OrgTree/index.d.ts +0 -16
  90. package/es/OrgTree/index.js +0 -177
  91. package/es/OrgUserTree/demo.d.ts +0 -2
  92. package/es/OrgUserTree/demo.js +0 -20
  93. package/es/OrgUserTree/index.css +0 -31
  94. package/es/OrgUserTree/index.d.ts +0 -28
  95. package/es/OrgUserTree/index.js +0 -132
  96. package/es/PlaceTree/demo.d.ts +0 -2
  97. package/es/PlaceTree/demo.js +0 -20
  98. package/es/PlaceTree/index.css +0 -40
  99. package/es/PlaceTree/index.d.ts +0 -26
  100. package/es/PlaceTree/index.js +0 -175
  101. package/es/Upload/AntUpload/index.css +0 -22
  102. package/es/Upload/AntUpload/index.d.ts +0 -19
  103. package/es/Upload/AntUpload/index.js +0 -226
  104. package/es/Upload/UploadChildren/index.css +0 -28
  105. package/es/Upload/UploadChildren/index.js +0 -26
  106. package/es/Upload/index.css +0 -0
  107. package/es/Upload/index.d.ts +0 -9
  108. package/es/Upload/index.js +0 -7
@@ -1,218 +0,0 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
2
-
3
- import _IconFont from "@cloud-app-dev/basic-components/es/IconFont";
4
- import _Store from "@cloud-app-dev/basic-components/es/Store";
5
- import _cache from "@cloud-app-dev/utils/es/cache";
6
-
7
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8
-
9
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
10
-
11
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
12
-
13
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
14
-
15
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
16
-
17
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
18
-
19
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
20
-
21
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
22
-
23
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
24
-
25
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
26
-
27
- import { __awaiter } from "tslib";
28
- import React from 'react';
29
- import { getFunctionCount, clearFunctionCount, deleteFunctionItemCount } from '../utils';
30
- import "./index.css";
31
- var CACHE_KEY = 'functionCount';
32
- var _global = window;
33
-
34
- var FunctionPreview = /*#__PURE__*/function (_React$Component) {
35
- _inherits(FunctionPreview, _React$Component);
36
-
37
- var _super = _createSuper(FunctionPreview);
38
-
39
- function FunctionPreview(props) {
40
- var _this;
41
-
42
- _classCallCheck(this, FunctionPreview);
43
-
44
- _this = _super.call(this, props);
45
- _this.menuList = []; // eslint-disable-next-line no-undef
46
-
47
- _this.getNearList = function () {
48
- getFunctionCount().then(function (counts) {
49
- _cache.setUserCache(CACHE_KEY, counts);
50
-
51
- _this.setState({
52
- nearList: counts.map(function (item) {
53
- return _Store.auth.getInfoByName(item.id);
54
- }).filter(function (v) {
55
- return !!v;
56
- })
57
- });
58
- });
59
- };
60
-
61
- _this.clearNearList = function () {
62
- return __awaiter(_assertThisInitialized(_this), void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
63
- return regeneratorRuntime.wrap(function _callee$(_context) {
64
- while (1) {
65
- switch (_context.prev = _context.next) {
66
- case 0:
67
- _context.next = 2;
68
- return clearFunctionCount();
69
-
70
- case 2:
71
- _cache.setUserCache(CACHE_KEY, []);
72
-
73
- this.setState({
74
- nearList: []
75
- });
76
-
77
- case 4:
78
- case "end":
79
- return _context.stop();
80
- }
81
- }
82
- }, _callee, this);
83
- }));
84
- };
85
-
86
- _this.deleteCountItem = function (event, item) {
87
- return __awaiter(_assertThisInitialized(_this), void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
88
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
89
- while (1) {
90
- switch (_context2.prev = _context2.next) {
91
- case 0:
92
- event.stopPropagation();
93
- _context2.next = 3;
94
- return deleteFunctionItemCount(item.alias);
95
-
96
- case 3:
97
- this.getNearList();
98
-
99
- case 4:
100
- case "end":
101
- return _context2.stop();
102
- }
103
- }
104
- }, _callee2, this);
105
- }));
106
- };
107
-
108
- var counts = _cache.getUserCache(CACHE_KEY) || [];
109
- _this.state = {
110
- nearList: counts.map(function (item) {
111
- return _Store.auth.getInfoByName(item.id);
112
- }).filter(function (v) {
113
- return !!v;
114
- }),
115
- keyword: ''
116
- };
117
-
118
- _this.getNearList();
119
-
120
- _this.menuList = props.menuList.filter(function (v) {
121
- return v.level === 3 && v.type !== 0;
122
- });
123
- return _this;
124
- }
125
-
126
- _createClass(FunctionPreview, [{
127
- key: "render",
128
- value: function render() {
129
- var _this2 = this;
130
-
131
- var _this$props = this.props,
132
- style = _this$props.style,
133
- onMenuSelect = _this$props.onMenuSelect,
134
- className = _this$props.className;
135
- var keyword = this.state.keyword;
136
- var list = this.menuList.filter(function (v2) {
137
- return v2.name.includes(keyword) || _global.pinyinUtil.getFirstLetter(v2.name).includes(keyword.toUpperCase()) || _global.pinyinUtil.getPinyin(v2.name).replace(/\s/g, '').includes(keyword.toLowerCase());
138
- });
139
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
140
- className: "app-inline-menu-sub-container app-inline-funs-sub-container ".concat(className),
141
- style: style
142
- }, /*#__PURE__*/React.createElement("div", {
143
- className: "top-search"
144
- }, /*#__PURE__*/React.createElement("input", {
145
- className: "fun-search",
146
- type: "text",
147
- value: keyword,
148
- onChange: function onChange(e) {
149
- return _this2.setState({
150
- keyword: e.target.value
151
- });
152
- },
153
- placeholder: "\u805A\u7126\u641C\u7D22"
154
- }), /*#__PURE__*/React.createElement(_IconFont, {
155
- type: "icon-sousuoanniu"
156
- }), /*#__PURE__*/React.createElement("div", {
157
- className: "input-mask"
158
- })), this.state.nearList.length > 0 && /*#__PURE__*/React.createElement("div", {
159
- className: "func-part"
160
- }, /*#__PURE__*/React.createElement("div", {
161
- className: "func-title func-title-ext"
162
- }, /*#__PURE__*/React.createElement("span", null, "\u6700\u8FD1\u4F7F\u7528"), " ", /*#__PURE__*/React.createElement("span", {
163
- onClick: this.clearNearList
164
- }, "\u6E05\u7A7A"), ' '), /*#__PURE__*/React.createElement("div", {
165
- className: "func-list-content"
166
- }, this.state.nearList.map(function (item) {
167
- return /*#__PURE__*/React.createElement("div", {
168
- className: "func-card",
169
- key: item.code,
170
- onClick: function onClick(e) {
171
- return onMenuSelect(e, item, true);
172
- }
173
- }, /*#__PURE__*/React.createElement(_IconFont, {
174
- type: item.icon || 'icon-L_Bar_Objectification1'
175
- }), /*#__PURE__*/React.createElement("span", {
176
- title: item.name
177
- }, item.name), /*#__PURE__*/React.createElement(_IconFont, {
178
- type: "icon-S_Edit_LineClose",
179
- className: "delete-function",
180
- onClick: function onClick(e) {
181
- return _this2.deleteCountItem(e, item);
182
- }
183
- }), /*#__PURE__*/React.createElement("div", {
184
- className: "func-card-mask"
185
- }));
186
- }))), /*#__PURE__*/React.createElement("div", {
187
- className: "func-part",
188
- style: {
189
- marginTop: 20
190
- }
191
- }, /*#__PURE__*/React.createElement("div", {
192
- className: "func-title"
193
- }, "\u5168\u529F\u80FD"), list.length > 0 ? /*#__PURE__*/React.createElement("div", {
194
- className: "func-list-content"
195
- }, list.map(function (item) {
196
- return /*#__PURE__*/React.createElement("div", {
197
- className: "func-card",
198
- key: item.code,
199
- onClick: function onClick(e) {
200
- return onMenuSelect(e, item, true);
201
- }
202
- }, /*#__PURE__*/React.createElement(_IconFont, {
203
- type: item.icon || 'icon-L_Bar_Objectification1'
204
- }), /*#__PURE__*/React.createElement("span", {
205
- title: item.name
206
- }, item.name), /*#__PURE__*/React.createElement("div", {
207
- className: "func-card-mask"
208
- }));
209
- })) : /*#__PURE__*/React.createElement("div", {
210
- className: "no-funcs"
211
- }, "\u6682\u65E0\u6570\u636E"))));
212
- }
213
- }]);
214
-
215
- return FunctionPreview;
216
- }(React.Component);
217
-
218
- export default FunctionPreview;
@@ -1,5 +0,0 @@
1
- import * as H from 'history';
2
- declare function ListenceRoute({ history }: {
3
- history: H.History;
4
- }): JSX.Element;
5
- export default ListenceRoute;
@@ -1,28 +0,0 @@
1
- import _Store from "@cloud-app-dev/basic-components/es/Store";
2
- import React, { useEffect } from 'react';
3
- import { setMenuKeys } from '../utils/menu';
4
- var timer;
5
-
6
- function ListenceRoute(_ref) {
7
- var history = _ref.history;
8
- useEffect(function () {
9
- var unlisten = history.listen(function () {
10
- var pathname = history.location.pathname;
11
-
12
- var item = _Store.auth.getInfoByRoute(pathname);
13
-
14
- clearTimeout(timer);
15
- timer = setTimeout(function () {
16
- if (item) {
17
- setMenuKeys([item.code]);
18
- }
19
- }, 200);
20
- });
21
- return function () {
22
- unlisten();
23
- }; // eslint-disable-next-line react-hooks/exhaustive-deps
24
- }, []);
25
- return /*#__PURE__*/React.createElement(React.Fragment, null);
26
- }
27
-
28
- export default ListenceRoute;
@@ -1,6 +0,0 @@
1
- interface IModifyPasswordProps {
2
- visible?: boolean;
3
- onClose?: () => void;
4
- }
5
- declare function ModifyPassword({ visible, onClose }: IModifyPasswordProps): JSX.Element;
6
- export default ModifyPassword;
@@ -1,201 +0,0 @@
1
- import "antd/lib/input/style";
2
- import _Input from "antd/lib/input";
3
- import _ContentBox from "@cloud-app-dev/basic-components/es/ContentBox";
4
- import _Drawer from "@cloud-app-dev/basic-components/es/Drawer";
5
- import "antd/lib/message/style";
6
- import _message from "antd/lib/message";
7
- import _Store from "@cloud-app-dev/basic-components/es/Store";
8
- import _Service from "@cloud-app-dev/basic-components/es/Service";
9
- import "antd/lib/form/style";
10
- import _Form from "antd/lib/form";
11
-
12
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
13
-
14
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15
-
16
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
17
-
18
- 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; }
19
-
20
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
21
-
22
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
23
-
24
- import { __awaiter } from "tslib";
25
- import React, { useCallback } from 'react';
26
- import AppService from '../../service';
27
- var FormItem = _Form.Item;
28
-
29
- function ModifyPassword(_ref) {
30
- var _this = this;
31
-
32
- var visible = _ref.visible,
33
- _onClose = _ref.onClose;
34
-
35
- var _Form$useForm = _Form.useForm(),
36
- _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
37
- form = _Form$useForm2[0];
38
-
39
- var onOk = useCallback(function () {
40
- form.validateFields().then(function (values) {
41
- return __awaiter(_this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
42
- var _a, res, msg;
43
-
44
- return regeneratorRuntime.wrap(function _callee$(_context) {
45
- while (1) {
46
- switch (_context.prev = _context.next) {
47
- case 0:
48
- _Service.logger.save({
49
- description: "\u3010".concat(_Store.app.userInfo.loginName, "\u3011\u4FEE\u6539\u5BC6\u7801"),
50
- module: 120300,
51
- function: 120301
52
- });
53
-
54
- _context.prev = 1;
55
- _context.next = 4;
56
- return AppService.changePassword({
57
- id: _Store.app.userInfo.id,
58
- oldPassword: values.oldPassword,
59
- newPassword: values.newPassword
60
- });
61
-
62
- case 4:
63
- res = _context.sent;
64
-
65
- if (!((res === null || res === void 0 ? void 0 : res.code) !== 0)) {
66
- _context.next = 7;
67
- break;
68
- }
69
-
70
- return _context.abrupt("return", _message.warn((res === null || res === void 0 ? void 0 : res.message) || '请求失败'));
71
-
72
- case 7:
73
- _message.success('密码修改成功!');
74
-
75
- _context.next = 10;
76
- return AppService.loginOut();
77
-
78
- case 10:
79
- _onClose();
80
-
81
- setTimeout(function () {
82
- sessionStorage.clear();
83
- window.location.replace('/login');
84
- }, 100);
85
- _context.next = 19;
86
- break;
87
-
88
- case 14:
89
- _context.prev = 14;
90
- _context.t0 = _context["catch"](1);
91
- console.error(_context.t0);
92
-
93
- try {
94
- msg = (_a = _context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.data) === null || _a === void 0 ? void 0 : _a.message;
95
- } catch (e) {
96
- msg = '密码修改失败!';
97
- }
98
-
99
- _message.error(msg);
100
-
101
- case 19:
102
- case "end":
103
- return _context.stop();
104
- }
105
- }
106
- }, _callee, null, [[1, 14]]);
107
- }));
108
- });
109
- }, [form, _onClose]);
110
- return /*#__PURE__*/React.createElement(_Drawer, {
111
- destroyOnClose: true,
112
- width: 540,
113
- title: "\u4FEE\u6539\u5BC6\u7801",
114
- visible: visible,
115
- onOk: onOk,
116
- onClose: function onClose() {
117
- return _onClose();
118
- },
119
- style: {
120
- zIndex: 999999
121
- }
122
- }, /*#__PURE__*/React.createElement(_Form, {
123
- form: form,
124
- labelCol: {
125
- span: 5
126
- },
127
- wrapperCol: {
128
- span: 19
129
- }
130
- }, /*#__PURE__*/React.createElement(_ContentBox.InfoBox, {
131
- contentStyle: {
132
- padding: 20
133
- }
134
- }, /*#__PURE__*/React.createElement(FormItem, {
135
- label: "\u65E7\u5BC6\u7801",
136
- name: "oldPassword",
137
- dependencies: ['newPassword'],
138
- rules: [{
139
- required: true,
140
- message: '请输入旧密码!'
141
- }, function (_ref2) {
142
- var getFieldValue = _ref2.getFieldValue;
143
- return {
144
- validator: function validator(_, value) {
145
- if (value && getFieldValue('newPassword') === value) {
146
- return Promise.reject('新旧密码一致!');
147
- }
148
-
149
- return Promise.resolve();
150
- }
151
- };
152
- }]
153
- }, /*#__PURE__*/React.createElement(_Input.Password, null)), /*#__PURE__*/React.createElement(FormItem, {
154
- label: "\u65B0\u5BC6\u7801",
155
- name: "newPassword",
156
- dependencies: ['oldPassword'],
157
- rules: [{
158
- required: true,
159
- message: '请输入新密码!'
160
- }, function () {
161
- return {
162
- validator: function validator(_, value) {
163
- var regs = [/[a-z]/g, /[A-Z]/g, /[0-9]/g, /[`~!@#$%^&*()_\-+=<>?:"{}|,.\\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/g];
164
- var flags = regs.map(function (v) {
165
- return v.test(value);
166
- });
167
- var flag = flags.filter(function (v) {
168
- return v;
169
- }).length < 3 || value.length < 8 || value.length > 18;
170
-
171
- if (flag) {
172
- return Promise.reject('密码为8-18位,包含大写字母,小写字母,数字,特殊字符中的三种');
173
- }
174
-
175
- return Promise.resolve();
176
- }
177
- };
178
- }]
179
- }, /*#__PURE__*/React.createElement(_Input.Password, null)), /*#__PURE__*/React.createElement(FormItem, {
180
- label: "\u91CD\u590D\u65B0\u5BC6\u7801",
181
- name: "confirm",
182
- dependencies: ['newPassword'],
183
- rules: [{
184
- required: true,
185
- message: '请重复新密码!'
186
- }, function (_ref3) {
187
- var getFieldValue = _ref3.getFieldValue;
188
- return {
189
- validator: function validator(_, value) {
190
- if (!value || getFieldValue('newPassword') === value) {
191
- return Promise.resolve();
192
- }
193
-
194
- return Promise.reject('密码不一致!');
195
- }
196
- };
197
- }]
198
- }, /*#__PURE__*/React.createElement(_Input.Password, null)))));
199
- }
200
-
201
- export default ModifyPassword;
@@ -1,21 +0,0 @@
1
- .lm-c-modify-user-avatar-box {
2
- padding: 20px 40px;
3
- position: relative;
4
- display: flex;
5
- }
6
- .lm-c-modify-user-avatar-box .user-avatar-label {
7
- font-size: var(--fs-small);
8
- color: var(--color);
9
- }
10
- .lm-c-modify-user-avatar-box .user-avatar-upload {
11
- width: 110px;
12
- height: 110px;
13
- margin: 0 10px;
14
- }
15
- .lm-c-modify-user-avatar-box .user-avatar-tip {
16
- width: 238px;
17
- font-size: var(--fs-small);
18
- color: var(--color);
19
- display: flex;
20
- align-items: flex-end;
21
- }
@@ -1,10 +0,0 @@
1
- import { AppStoreInterface } from '@cloud-app-dev/basic-components/es/Store/app';
2
- import './index.less';
3
- interface IModifyUserAvatarProps {
4
- visible?: boolean;
5
- onClose?: () => void;
6
- app?: AppStoreInterface;
7
- }
8
- declare function ModifyUserAvatar({ visible, onClose, app }: IModifyUserAvatarProps): JSX.Element;
9
- declare const _default: typeof ModifyUserAvatar & import("mobx-react").IWrappedComponent<IModifyUserAvatarProps>;
10
- export default _default;
@@ -1,98 +0,0 @@
1
- import _IconFont from "@cloud-app-dev/basic-components/es/IconFont";
2
- import _ImageView from "@cloud-app-dev/basic-components/es/ImageView";
3
- import _CBox from "@cloud-app-dev/basic-components/es/CBox";
4
- import _ContentBox from "@cloud-app-dev/basic-components/es/ContentBox";
5
- import _Drawer from "@cloud-app-dev/basic-components/es/Drawer";
6
- import "antd/lib/message/style";
7
- import _message from "antd/lib/message";
8
- import _Service from "@cloud-app-dev/basic-components/es/Service";
9
-
10
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
-
12
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
13
-
14
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
15
-
16
- 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; }
17
-
18
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
19
-
20
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
21
-
22
- import React, { useCallback, useState } from 'react';
23
- import { inject, observer } from 'mobx-react';
24
- import Upload from '../../../Upload';
25
- import UserService from '../../service';
26
- import "./index.css";
27
- var FormUpload = Upload.AntUpload;
28
-
29
- function ModifyUserAvatar(_ref) {
30
- var visible = _ref.visible,
31
- onClose = _ref.onClose,
32
- app = _ref.app;
33
-
34
- var _useState = useState(app.userInfo.userAvatarUrl || ''),
35
- _useState2 = _slicedToArray(_useState, 2),
36
- userAvatarUrl = _useState2[0],
37
- setUserAvatarUrl = _useState2[1];
38
-
39
- var onOk = function onOk() {
40
- _Service.logger.save({
41
- description: "\u3010".concat(app.userInfo.loginName, "\u3011\u4FEE\u6539\u5934\u50CF"),
42
- module: 120100,
43
- function: 120101
44
- });
45
-
46
- UserService.changeUserAvatar({
47
- id: app.userInfo.id,
48
- userAvatarUrl: userAvatarUrl
49
- }).then(function () {
50
- app.updateUserInfo(Object.assign(Object.assign({}, app.userInfo), {
51
- userAvatarUrl: userAvatarUrl
52
- }));
53
- onClose();
54
- });
55
- }; // 图片上传
56
-
57
-
58
- var uploadImg = useCallback(function (file) {
59
- var formData = new FormData();
60
- formData.append('file', file);
61
- UserService.uploadImg(formData).then(function (res) {
62
- setUserAvatarUrl(res.data.url);
63
- }).catch(function (err) {
64
- return _message.error('上传文件失败');
65
- });
66
- }, []);
67
- return /*#__PURE__*/React.createElement(_Drawer, {
68
- destroyOnClose: true,
69
- width: 540,
70
- title: "\u4FEE\u6539\u5934\u50CF",
71
- visible: visible,
72
- onOk: onOk,
73
- onClose: onClose,
74
- style: {
75
- zIndex: 999999
76
- }
77
- }, /*#__PURE__*/React.createElement(_ContentBox.InfoBox, null, /*#__PURE__*/React.createElement("div", {
78
- className: "lm-c-modify-user-avatar-box"
79
- }, /*#__PURE__*/React.createElement("div", {
80
- className: "user-avatar-label"
81
- }, "\u5934\u50CF :"), /*#__PURE__*/React.createElement("div", {
82
- className: "user-avatar-upload"
83
- }, /*#__PURE__*/React.createElement(FormUpload, {
84
- customUpload: uploadImg
85
- }, userAvatarUrl ? /*#__PURE__*/React.createElement(_CBox, {
86
- className: "lm-upload-content"
87
- }, /*#__PURE__*/React.createElement(_ImageView, {
88
- src: userAvatarUrl
89
- })) : /*#__PURE__*/React.createElement(_CBox, {
90
- className: "lm-upload-content lm-c-normol-box"
91
- }, /*#__PURE__*/React.createElement(_IconFont, {
92
- type: "icon-L_Bar_AddImg"
93
- }), "\u8BF7\u9009\u62E9\u5934\u50CF"))), /*#__PURE__*/React.createElement("div", {
94
- className: "user-avatar-tip"
95
- }, "\u652F\u6301jpg/png\u683C\u5F0F \u4E0D\u8D85\u8FC72M"))));
96
- }
97
-
98
- export default inject('app')(observer(ModifyUserAvatar));