@zgfe/modules-settings 1.2.11 → 1.2.13

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 (47) hide show
  1. package/es/components/settingTabs/index.less +3 -0
  2. package/es/constants/api.d.ts +2 -1
  3. package/es/constants/api.js +2 -1
  4. package/es/constants/icons/demo.css +0 -0
  5. package/es/constants/icons/demo_index.html +0 -0
  6. package/es/constants/icons/iconfont.css +0 -0
  7. package/es/constants/icons/iconfont.js +0 -0
  8. package/es/constants/icons/iconfont.json +0 -0
  9. package/es/constants/icons/iconfont.ttf +0 -0
  10. package/es/constants/icons/iconfont.woff +0 -0
  11. package/es/constants/icons/iconfont.woff2 +0 -0
  12. package/es/modules/appSettings/demo/index.d.ts +3 -1
  13. package/es/modules/appSettings/demo/index.js +16 -12
  14. package/es/modules/appSettings/index.js +6 -7
  15. package/es/modules/appSettings/member/index.js +75 -82
  16. package/es/modules/appSettings/member/index.less +4 -1
  17. package/es/modules/appSettings/member/modal.js +1 -1
  18. package/es/modules/companySetting/appList/index.js +23 -20
  19. package/es/modules/companySetting/appList/index.less +22 -0
  20. package/es/modules/companySetting/cost/index.less +7 -0
  21. package/es/modules/companySetting/demo.js +3 -4
  22. package/es/modules/companySetting/department/index.js +104 -46
  23. package/es/modules/companySetting/department/index.less +57 -4
  24. package/es/modules/companySetting/index.d.ts +0 -2
  25. package/es/modules/companySetting/index.js +135 -137
  26. package/es/modules/companySetting/index.less +30 -4
  27. package/es/modules/companySetting/info/index.js +6 -1
  28. package/es/modules/companySetting/info/index.less +7 -0
  29. package/es/modules/companySetting/operationLog/index.js +10 -4
  30. package/es/modules/companySetting/operationLog/index.less +6 -0
  31. package/es/modules/companySetting/role/index.js +242 -87
  32. package/es/modules/companySetting/role/index.less +62 -2
  33. package/es/modules/companySetting/style/common.less +13 -2
  34. package/es/modules/companySetting/user/index.d.ts +1 -0
  35. package/es/modules/companySetting/user/index.js +75 -32
  36. package/es/modules/companySetting/user/index.less +90 -3
  37. package/es/modules/companySetting/user/invite.d.ts +1 -0
  38. package/es/modules/companySetting/user/invite.js +112 -27
  39. package/es/modules/companySetting/wechatBinding/index.less +10 -0
  40. package/es/modules/systemSetting/demo.d.ts +3 -0
  41. package/es/modules/systemSetting/demo.js +10 -0
  42. package/es/modules/systemSetting/notice/configItem/index.js +5 -1
  43. package/es/requests/role.d.ts +12 -3
  44. package/es/requests/role.js +6 -6
  45. package/es/types/companySetting.d.ts +1 -0
  46. package/es/utils/util.d.ts +7 -1
  47. package/package.json +4 -4
@@ -10,15 +10,18 @@ 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, { useEffect, useState } from 'react';
13
+ import React, { useEffect, useState, useContext } from 'react';
14
14
  import './index.less';
15
15
  import util from './../../../utils/util';
16
16
  import { Button, Form, Input, Spin, TreeSelect, notification } from 'antd';
17
17
  import moment from 'moment';
18
- import { BizTable, BizDialog, BizSelect, IconFont } from '@zgfe/business-lib';
19
- import { addDept, deleteDept, getGroupMembers, queryDeptList, updateDept } from '../../../requests/department';
18
+ import { BizTable, BizDialog, BizSelect, IconFont, BizGlobalDataContext } from '@zgfe/business-lib';
19
+ import { addDept, deleteDept,
20
+ // getGroupMembers,
21
+ queryDeptList, updateDept } from '../../../requests/department';
22
+ import { queryCompanyUser } from '../../../requests/role';
20
23
  var DepartmentList = function DepartmentList(props) {
21
- var _departmentList$, _departmentList$2;
24
+ var _departmentList$, _departmentList$2, _departmentList$3;
22
25
  var closeCreateCallback = props.closeCreateCallback;
23
26
  // 弹窗
24
27
  var _useState = useState(false),
@@ -37,6 +40,8 @@ var DepartmentList = function DepartmentList(props) {
37
40
  _useState8 = _slicedToArray(_useState7, 2),
38
41
  loading = _useState8[0],
39
42
  setLoading = _useState8[1];
43
+ var _useContext = useContext(BizGlobalDataContext),
44
+ authority = _useContext.authority;
40
45
  // 初始数据
41
46
  var _useState9 = useState(''),
42
47
  _useState10 = _slicedToArray(_useState9, 2),
@@ -68,49 +73,68 @@ var DepartmentList = function DepartmentList(props) {
68
73
  if (createdAppPanel || delPanelState) return;
69
74
  setLoading(true);
70
75
  // 请求部门列表数据
71
- queryDeptList({
72
- name: name
73
- }).then(function (res) {
74
- if (res && (res === null || res === void 0 ? void 0 : res.data) && res.code === '101000') {
75
- var app = util.convertData(res === null || res === void 0 ? void 0 : res.data, name);
76
- setLoading(false);
77
- setDepartmentList(app);
78
- } else {
79
- setTimeout(function () {
76
+ setTimeout(function () {
77
+ queryDeptList({
78
+ name: name
79
+ }).then(function (res) {
80
+ if (res && (res === null || res === void 0 ? void 0 : res.data) && res.code === '101000') {
81
+ var app = util.convertData(res === null || res === void 0 ? void 0 : res.data, name);
80
82
  setLoading(false);
81
- }, 2000);
82
- }
83
- }).catch(function (err) {
84
- setDepartmentList([]);
85
- console.error(err);
86
- });
83
+ setDepartmentList(app);
84
+ } else {
85
+ setTimeout(function () {
86
+ setLoading(false);
87
+ }, 2000);
88
+ }
89
+ }).catch(function (err) {
90
+ setDepartmentList([]);
91
+ console.error(err);
92
+ });
93
+ }, 500);
87
94
  if (name) return;
88
95
  // 请求负责人数据
89
- getGroupMembers().then(function (res) {
90
- var result = res; // 使用类型断言将返回的数据转换为ApiResult<void>
91
- if (result && (result === null || result === void 0 ? void 0 : result.company_members)) {
92
- setAllMembers(((result === null || result === void 0 ? void 0 : result.company_members) || []).map(function (item) {
93
- return _objectSpread(_objectSpread({}, item), {}, {
94
- value: item.email,
95
- label: item.email
96
- });
97
- }));
98
- } else {
99
- setAllMembers([]);
96
+ queryCompanyUser({
97
+ id: null
98
+ }).then(function (res) {
99
+ if (res === null || res === void 0 ? void 0 : res.data) {
100
+ setAllMembers(res === null || res === void 0 ? void 0 : res.data);
100
101
  }
101
102
  }).catch(function (err) {
102
103
  setAllMembers([]);
103
104
  console.error(err);
104
105
  });
106
+ // getGroupMembers()
107
+ // .then((res) => {
108
+ // const result = res as ApiResult<void>; // 使用类型断言将返回的数据转换为ApiResult<void>
109
+ // if (result && result?.company_members) {
110
+ // setAllMembers(
111
+ // (result?.company_members || []).map((item) => {
112
+ // return {
113
+ // ...item,
114
+ // value: item.email,
115
+ // label: item.email,
116
+ // };
117
+ // }),
118
+ // );
119
+ // } else {
120
+ // setAllMembers([]);
121
+ // }
122
+ // })
123
+ // .catch((err) => {
124
+ // setAllMembers([]);
125
+ // console.error(err);
126
+ // });
105
127
  }, [createdAppPanel, delPanelState, name]);
106
128
  // 列表数据
107
129
  var columns = [{
108
130
  title: '部门名称',
109
131
  dataIndex: 'name',
132
+ ellipsis: true,
110
133
  with: 334
111
134
  }, {
112
135
  title: '负责人',
113
136
  with: 334,
137
+ ellipsis: true,
114
138
  render: function render(data) {
115
139
  var _data$deptBoss;
116
140
  return data === null || data === void 0 ? void 0 : (_data$deptBoss = data.deptBoss) === null || _data$deptBoss === void 0 ? void 0 : _data$deptBoss.replace(/,/g, '、');
@@ -127,11 +151,11 @@ var DepartmentList = function DepartmentList(props) {
127
151
  render: function render(data) {
128
152
  return /*#__PURE__*/React.createElement("div", {
129
153
  className: "operating"
130
- }, data.parentId !== 0 && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("a", {
154
+ }, data.parentId !== 0 && /*#__PURE__*/React.createElement(React.Fragment, null, authority[10097] && /*#__PURE__*/React.createElement("a", {
131
155
  onClick: function onClick() {
132
156
  return toAppSetting(data);
133
157
  }
134
- }, "\u7F16\u8F91"), /*#__PURE__*/React.createElement("a", {
158
+ }, "\u7F16\u8F91"), authority[10098] && /*#__PURE__*/React.createElement("a", {
135
159
  onClick: function onClick() {
136
160
  return showDelPanel(data);
137
161
  }
@@ -141,13 +165,20 @@ var DepartmentList = function DepartmentList(props) {
141
165
  // 打开编辑弹窗
142
166
  var toAppSetting = function toAppSetting(data) {
143
167
  var _data$deptBoss$split;
168
+ var arr = (_data$deptBoss$split = data.deptBoss.split(',')) === null || _data$deptBoss$split === void 0 ? void 0 : _data$deptBoss$split.map(function (item) {
169
+ var _app$, _app$2;
170
+ var app = allMembers.filter(function (v) {
171
+ return v.email === item;
172
+ });
173
+ return {
174
+ email: (_app$ = app[0]) === null || _app$ === void 0 ? void 0 : _app$.email,
175
+ id: (_app$2 = app[0]) === null || _app$2 === void 0 ? void 0 : _app$2.id
176
+ };
177
+ });
144
178
  form.setFieldsValue(_objectSpread(_objectSpread({}, data), {}, {
145
179
  parentId: data.parentId,
146
- deptBoss: data.deptBoss ? (_data$deptBoss$split = data.deptBoss.split(',')) === null || _data$deptBoss$split === void 0 ? void 0 : _data$deptBoss$split.map(function (item) {
147
- return {
148
- label: item,
149
- value: item
150
- };
180
+ deptBoss: data.deptBoss ? arr.filter(function (v) {
181
+ return v.email !== undefined;
151
182
  }) : []
152
183
  }));
153
184
  setCreatedAppPanel(true);
@@ -193,7 +224,12 @@ var DepartmentList = function DepartmentList(props) {
193
224
  name: formParams.name
194
225
  };
195
226
  (formParams.id === -1 ? addDept : updateDept)(params).then(function (res) {
196
- if (!res) return;
227
+ if ((res === null || res === void 0 ? void 0 : res.code) !== '101000') {
228
+ setTimeout(function () {
229
+ setCreateAppLoading(false);
230
+ }, 1000);
231
+ return;
232
+ }
197
233
  setCreatedAppPanel(false);
198
234
  setCreateAppLoading(false);
199
235
  // 通知数据刷新
@@ -212,7 +248,12 @@ var DepartmentList = function DepartmentList(props) {
212
248
  spinning: loading
213
249
  }, /*#__PURE__*/React.createElement("div", {
214
250
  className: "department-list"
215
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Input, {
251
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
252
+ style: {
253
+ marginTop: '8px',
254
+ marginLeft: '2px'
255
+ }
256
+ }, /*#__PURE__*/React.createElement(Input, {
216
257
  prefix: /*#__PURE__*/React.createElement(IconFont, {
217
258
  type: "sousuo"
218
259
  }),
@@ -225,10 +266,11 @@ var DepartmentList = function DepartmentList(props) {
225
266
  marginBottom: '24px'
226
267
  },
227
268
  placeholder: '请输入部门名称'
228
- })), /*#__PURE__*/React.createElement("div", {
269
+ }))), /*#__PURE__*/React.createElement("div", {
229
270
  className: "app-list-head"
230
- }, /*#__PURE__*/React.createElement("div", null, "\u90E8\u95E8\u5217\u8868", name), /*#__PURE__*/React.createElement(Button, {
271
+ }, /*#__PURE__*/React.createElement("div", null, "\u90E8\u95E8\u5217\u8868"), /*#__PURE__*/React.createElement(Button, {
231
272
  type: "primary",
273
+ disabled: !authority[10096],
232
274
  onClick: function onClick() {
233
275
  setCreatedAppPanel(true);
234
276
  setFormParams({
@@ -241,6 +283,7 @@ var DepartmentList = function DepartmentList(props) {
241
283
  form.resetFields();
242
284
  }
243
285
  }, "\u65B0\u589E\u90E8\u95E8")), /*#__PURE__*/React.createElement(BizDialog, {
286
+ className: "setting-bizDialog",
244
287
  title: formParams.id === -1 ? '新增部门' : '编辑部门',
245
288
  open: createdAppPanel,
246
289
  width: 520,
@@ -288,8 +331,16 @@ var DepartmentList = function DepartmentList(props) {
288
331
  message: '请选择上级部门'
289
332
  }]
290
333
  }, /*#__PURE__*/React.createElement(TreeSelect, {
334
+ treeDefaultExpandedKeys: (_departmentList$ = departmentList[0]) === null || _departmentList$ === void 0 ? void 0 : _departmentList$.defaultRowKeys,
291
335
  placeholder: "\u8BF7\u9009\u62E9\u4E0A\u7EA7\u90E8\u95E8",
292
- treeData: departmentList
336
+ treeData: departmentList,
337
+ suffixIcon: /*#__PURE__*/React.createElement("i", {
338
+ style: {
339
+ fontSize: 14,
340
+ color: '#5f6085'
341
+ },
342
+ className: "bsicon xiangxia"
343
+ })
293
344
  })), /*#__PURE__*/React.createElement(Form.Item, {
294
345
  name: 'name',
295
346
  label: "\u90E8\u95E8\u540D\u79F0",
@@ -298,6 +349,12 @@ var DepartmentList = function DepartmentList(props) {
298
349
  message: '请输入部门名称'
299
350
  }]
300
351
  }, /*#__PURE__*/React.createElement(Input, {
352
+ onBlur: function onBlur(event) {
353
+ var _event$target, _event$target$value;
354
+ form.setFieldsValue({
355
+ name: event === null || event === void 0 ? void 0 : (_event$target = event.target) === null || _event$target === void 0 ? void 0 : (_event$target$value = _event$target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.replace(/ /g, '')
356
+ });
357
+ },
301
358
  maxLength: 50,
302
359
  placeholder: '请输入部门名称'
303
360
  })), /*#__PURE__*/React.createElement(Form.Item, {
@@ -312,12 +369,13 @@ var DepartmentList = function DepartmentList(props) {
312
369
  options: allMembers,
313
370
  multiple: true,
314
371
  placeholder: '请选择负责人',
315
- labelField: "label",
316
- keyField: "value"
372
+ labelField: "email",
373
+ keyField: "id"
317
374
  }))))), /*#__PURE__*/React.createElement(BizDialog, {
318
375
  title: "\u5220\u9664\u5E94\u7528",
319
376
  open: delPanelState,
320
377
  closable: true,
378
+ className: "setting-bizDialog",
321
379
  onOk: function onOk() {
322
380
  setDelPanelState(false);
323
381
  onDelConfirm();
@@ -327,11 +385,11 @@ var DepartmentList = function DepartmentList(props) {
327
385
  }
328
386
  }, "\u786E\u8BA4\u8981\u5220\u9664\u5F53\u524D\u90E8\u95E8\u5417?"), /*#__PURE__*/React.createElement("div", {
329
387
  className: "department-list-content"
330
- }, ((_departmentList$ = departmentList[0]) === null || _departmentList$ === void 0 ? void 0 : _departmentList$.defaultRowKeys.length) > 0 && !name ? /*#__PURE__*/React.createElement(BizTable, {
388
+ }, ((_departmentList$2 = departmentList[0]) === null || _departmentList$2 === void 0 ? void 0 : _departmentList$2.defaultRowKeys.length) > 0 && !name ? /*#__PURE__*/React.createElement(BizTable, {
331
389
  rowKey: "key",
332
390
  dataSource: departmentList,
333
391
  expandable: {
334
- defaultExpandedRowKeys: (_departmentList$2 = departmentList[0]) === null || _departmentList$2 === void 0 ? void 0 : _departmentList$2.defaultRowKeys
392
+ defaultExpandedRowKeys: (_departmentList$3 = departmentList[0]) === null || _departmentList$3 === void 0 ? void 0 : _departmentList$3.defaultRowKeys
335
393
  },
336
394
  columns: columns,
337
395
  scroll: {
@@ -1,6 +1,10 @@
1
1
  @import './../../../constants/icons/iconfont.css';
2
2
 
3
3
  .department-list {
4
+ height: 100%;
5
+ padding: 0;
6
+ overflow: auto;
7
+
4
8
  .ant-form-item {
5
9
  .ant-form-item-control-input {
6
10
  width: 392px;
@@ -24,10 +28,6 @@
24
28
  margin-top: 0;
25
29
  }
26
30
 
27
- height: 100%;
28
- padding: 0;
29
- overflow: auto;
30
-
31
31
  .app-list-head {
32
32
  display: flex;
33
33
  align-items: center;
@@ -43,6 +43,7 @@
43
43
  /* 150% */
44
44
  }
45
45
  }
46
+
46
47
  .platform-icons {
47
48
  display: flex;
48
49
  align-items: center;
@@ -58,6 +59,7 @@
58
59
 
59
60
  .department-list-content {
60
61
  margin-top: 16px;
62
+
61
63
  .c-grid-cell,
62
64
  .c-grid-header-cell {
63
65
  text-align: left !important;
@@ -96,7 +98,58 @@
96
98
  border-color: @primary-color !important;
97
99
  }
98
100
  }
101
+
102
+ .ant-select-selector {
103
+ border-color: @background-color-base !important;
104
+ }
105
+
106
+ .biz-select-handle-input {
107
+ .ant-input {
108
+ border-color: @background-color-base !important;
109
+
110
+ &:focus {
111
+ border-color: @background-color-base !important;
112
+ }
113
+ }
114
+
115
+ &:focus {
116
+ border-color: @primary-color !important;
117
+ }
118
+ }
119
+
120
+ .ant-input-status-error {
121
+ border: 1px solid #fb5547 !important;
122
+
123
+ &:focus {
124
+ border-color: #fb5547 !important;
125
+ }
126
+ }
127
+
128
+ .ant-select-status-error {
129
+ border: none !important;
130
+
131
+ &:focus {
132
+ box-shadow: 0 0 0 2px rgba(251, 85, 71, 0.2) !important;
133
+ }
134
+ }
135
+
136
+ .biz-select-handle-status-error.active:not(.disable) {
137
+ box-shadow: 0 0 0 2px rgba(251, 85, 71, 0.2) !important;
138
+ }
139
+
140
+ .biz-select-handle-status-error {
141
+ .ant-input.ant-input-status-error:focus:not(.ant-input-disable):not(.ant-input-borderless),
142
+ .ant-input.ant-input-status-error-focused:not(.ant-input-disable):not(.ant-input-borderless) {
143
+ box-shadow: none !important;
144
+ }
145
+ }
146
+
147
+ .ant-form-item:last-of-type {
148
+ margin-bottom: 0;
149
+ }
150
+
99
151
  color: #5f6085;
152
+
100
153
  .ant-form-item-label {
101
154
  width: 80px;
102
155
  text-align: right;
@@ -1,8 +1,6 @@
1
1
  import React from 'react';
2
2
  import './index.less';
3
3
  declare const CompanySetting: React.FC<{
4
- showWeChatMenu: boolean;
5
- showMarketMenu: boolean;
6
4
  action: string;
7
5
  settingCallback?: (type: string, obj?: {
8
6
  [key: string]: any;