@zgfe/modules-settings 1.2.14 → 1.2.15-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.
- package/es/constants/api.js +2 -2
- package/es/modules/systemSetting/notice/configItem/index.js +40 -2
- package/es/modules/systemSetting/notice/configItem/index.less +5 -0
- package/es/modules/systemSetting/notice/edit/index.js +92 -1
- package/es/modules/systemSetting/notice/index.js +12 -2
- package/es/types/system.d.ts +1 -0
- package/package.json +4 -4
package/es/constants/api.js
CHANGED
|
@@ -43,8 +43,8 @@ var apis = {
|
|
|
43
43
|
createFilter: '/user/createFilter.jsp',
|
|
44
44
|
queryFilter: '/user/queryFilter.jsp',
|
|
45
45
|
//系统设置
|
|
46
|
-
queryNoticeConfig:
|
|
47
|
-
editNoticeConfig:
|
|
46
|
+
queryNoticeConfig: '/zg/web/v2/systemSettings/queryNoticeSettings',
|
|
47
|
+
editNoticeConfig: '/zg/web/v2/systemSettings/setNoticeSettings',
|
|
48
48
|
// 部门管理
|
|
49
49
|
queryDeptList: '/zg/web/v2/company/setting/queryDeptList',
|
|
50
50
|
addDept: '/zg/web/v2/company/setting/addDept',
|
|
@@ -19,10 +19,47 @@ var ConfigItem = function ConfigItem(_ref) {
|
|
|
19
19
|
}, {
|
|
20
20
|
name: 'fromName',
|
|
21
21
|
value: '发件人昵称'
|
|
22
|
+
}]).set('message', [{
|
|
23
|
+
name: 'accountSId',
|
|
24
|
+
value: 'ACCOUNT SID(主账户 ID)',
|
|
25
|
+
isSecret: true
|
|
26
|
+
}, {
|
|
27
|
+
name: 'accountToken',
|
|
28
|
+
value: 'Account Token(账户授权令牌)',
|
|
29
|
+
isSecret: true
|
|
30
|
+
}, {
|
|
31
|
+
name: 'templateId',
|
|
32
|
+
value: 'Templateid(模板ID)',
|
|
33
|
+
isSecret: true
|
|
34
|
+
}, {
|
|
35
|
+
name: 'accountAppId',
|
|
36
|
+
value: 'Account Appid(应用ID)',
|
|
37
|
+
isSecret: true
|
|
38
|
+
}]).set('phone', [{
|
|
39
|
+
name: 'dataSourceName',
|
|
40
|
+
value: 'DataSourceName(数据源名称)',
|
|
41
|
+
isSecret: true
|
|
42
|
+
}, {
|
|
43
|
+
name: 'contactGroupName',
|
|
44
|
+
value: 'ContactGroupName(联系人组名称)',
|
|
45
|
+
isSecret: true
|
|
46
|
+
}, {
|
|
47
|
+
name: 'botName',
|
|
48
|
+
value: 'BotName(机器人名称)',
|
|
49
|
+
isSecret: true
|
|
50
|
+
}, {
|
|
51
|
+
name: 'accountToken',
|
|
52
|
+
value: 'Account Token(账户授权令牌)',
|
|
53
|
+
isSecret: true
|
|
54
|
+
}, {
|
|
55
|
+
name: 'taskShowNumber',
|
|
56
|
+
value: '外显号码'
|
|
22
57
|
}]);
|
|
23
58
|
var _useContext = useContext(BizGlobalDataContext),
|
|
24
59
|
authority = _useContext.authority;
|
|
25
|
-
return /*#__PURE__*/React.createElement("div",
|
|
60
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
className: "setting-config-view"
|
|
62
|
+
}, /*#__PURE__*/React.createElement(Row, {
|
|
26
63
|
className: "item-title"
|
|
27
64
|
}, /*#__PURE__*/React.createElement(Col, {
|
|
28
65
|
span: 12,
|
|
@@ -43,10 +80,11 @@ var ConfigItem = function ConfigItem(_ref) {
|
|
|
43
80
|
}), "\u7F16\u8F91"))), /*#__PURE__*/React.createElement(Descriptions, {
|
|
44
81
|
column: 1
|
|
45
82
|
}, (_configFieldMap$get = configFieldMap.get(item.type)) === null || _configFieldMap$get === void 0 ? void 0 : _configFieldMap$get.map(function (field) {
|
|
83
|
+
var txt = item.config && item.config[field.name] || '';
|
|
46
84
|
return /*#__PURE__*/React.createElement(Descriptions.Item, {
|
|
47
85
|
key: field.value,
|
|
48
86
|
label: field.value
|
|
49
|
-
},
|
|
87
|
+
}, field.isSecret ? txt.replace(/./g, '*') : txt);
|
|
50
88
|
})));
|
|
51
89
|
};
|
|
52
90
|
export default ConfigItem;
|
|
@@ -68,6 +68,93 @@ var ItemEdit = function ItemEdit(props) {
|
|
|
68
68
|
}],
|
|
69
69
|
required: false
|
|
70
70
|
}]
|
|
71
|
+
}).set('message', {
|
|
72
|
+
config: [{
|
|
73
|
+
name: 'accountSId',
|
|
74
|
+
field: 'ACCOUNT SID(主账户 ID)',
|
|
75
|
+
rules: [{
|
|
76
|
+
required: true,
|
|
77
|
+
message: '请输入ACCOUNT SID(主账户 ID)'
|
|
78
|
+
}],
|
|
79
|
+
type: 'password',
|
|
80
|
+
placeholder: '请输入ACCOUNT SID(主账户 ID)'
|
|
81
|
+
}, {
|
|
82
|
+
name: 'accountToken',
|
|
83
|
+
field: 'Account Token(账户授权令牌)',
|
|
84
|
+
rules: [{
|
|
85
|
+
required: true,
|
|
86
|
+
message: '请输入Account Token(账户授权令牌)'
|
|
87
|
+
}],
|
|
88
|
+
type: 'password',
|
|
89
|
+
placeholder: '请输入您的Account Token(账户授权令牌)'
|
|
90
|
+
}, {
|
|
91
|
+
name: 'accountAppId',
|
|
92
|
+
field: 'Account Appid(应用ID)',
|
|
93
|
+
rules: [{
|
|
94
|
+
required: true,
|
|
95
|
+
message: '请输入Account Appid(应用ID)'
|
|
96
|
+
}],
|
|
97
|
+
type: 'password',
|
|
98
|
+
placeholder: '请输入您的Account Appid(应用ID)'
|
|
99
|
+
}, {
|
|
100
|
+
name: 'templateId',
|
|
101
|
+
field: 'Templateid(模板ID)',
|
|
102
|
+
rules: [{
|
|
103
|
+
required: true,
|
|
104
|
+
message: '请输入Templateid(模板ID)'
|
|
105
|
+
}],
|
|
106
|
+
type: 'password',
|
|
107
|
+
placeholder: '请输入Templateid(模板ID)'
|
|
108
|
+
}]
|
|
109
|
+
}).set('phone', {
|
|
110
|
+
config: [{
|
|
111
|
+
name: 'dataSourceName',
|
|
112
|
+
field: 'DataSourceName(数据源名称)',
|
|
113
|
+
rules: [{
|
|
114
|
+
required: true,
|
|
115
|
+
message: '请输入DataSourceName(数据源名称)'
|
|
116
|
+
}],
|
|
117
|
+
placeholder: '请输入DataSourceName(数据源名称)L',
|
|
118
|
+
type: 'password'
|
|
119
|
+
}, {
|
|
120
|
+
name: 'contactGroupName',
|
|
121
|
+
field: 'ContactGroupName(联系人组名称)',
|
|
122
|
+
rules: [{
|
|
123
|
+
required: true,
|
|
124
|
+
message: '请输入ContactGroupName(联系人组名称)'
|
|
125
|
+
}],
|
|
126
|
+
placeholder: '请输入ContactGroupName(联系人组名称)',
|
|
127
|
+
type: 'password'
|
|
128
|
+
}, {
|
|
129
|
+
name: 'botName',
|
|
130
|
+
field: 'BotName(机器人名称)',
|
|
131
|
+
rules: [{
|
|
132
|
+
required: true,
|
|
133
|
+
message: '请输入BotName(机器人名称)'
|
|
134
|
+
}],
|
|
135
|
+
type: 'password',
|
|
136
|
+
placeholder: '请输入BotName(机器人名称)'
|
|
137
|
+
}, {
|
|
138
|
+
name: 'accountToken',
|
|
139
|
+
field: 'Account Token(账户授权令牌)',
|
|
140
|
+
rules: [{
|
|
141
|
+
required: true,
|
|
142
|
+
message: '请输入Account Token(账户授权令牌)'
|
|
143
|
+
}],
|
|
144
|
+
placeholder: '请输入Account Token(账户授权令牌)',
|
|
145
|
+
type: 'password'
|
|
146
|
+
}, {
|
|
147
|
+
name: 'taskShowNumber',
|
|
148
|
+
field: '外显号码',
|
|
149
|
+
rules: [{
|
|
150
|
+
required: true,
|
|
151
|
+
message: '请输入外显号码'
|
|
152
|
+
}, {
|
|
153
|
+
pattern: /^\d{1,11}$/,
|
|
154
|
+
message: '外显号码长度小于11的数字'
|
|
155
|
+
}],
|
|
156
|
+
placeholder: '请输入外显号码'
|
|
157
|
+
}]
|
|
71
158
|
});
|
|
72
159
|
// 确认
|
|
73
160
|
var onFinish = function onFinish() {
|
|
@@ -95,7 +182,11 @@ var ItemEdit = function ItemEdit(props) {
|
|
|
95
182
|
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
96
183
|
label: config.field,
|
|
97
184
|
name: config.name,
|
|
98
|
-
rules: config.rules
|
|
185
|
+
rules: config.rules,
|
|
186
|
+
labelCol: {
|
|
187
|
+
span: 0,
|
|
188
|
+
offset: 0
|
|
189
|
+
}
|
|
99
190
|
}, /*#__PURE__*/React.createElement(Input, {
|
|
100
191
|
placeholder: config.placeholder,
|
|
101
192
|
type: config.type === 'password' ? 'password' : 'text'
|
|
@@ -17,11 +17,20 @@ import request, { urlRequest } from '../../../utils/ajax';
|
|
|
17
17
|
import ConfigItem from './configItem';
|
|
18
18
|
import ItemEdit from './edit';
|
|
19
19
|
var Notice = function Notice() {
|
|
20
|
-
var typeMap = new Map([[1, 'email']]);
|
|
20
|
+
var typeMap = new Map([[1, 'email'], [2, 'message'], [3, 'phone']]);
|
|
21
|
+
var keyMap = new Map([['email', 1], ['message', 2], ['phone', 3]]);
|
|
21
22
|
var _useState = useState(new Map().set('email', {
|
|
22
23
|
type: 'email',
|
|
23
24
|
name: '邮件',
|
|
24
25
|
config: {}
|
|
26
|
+
}).set('message', {
|
|
27
|
+
type: 'message',
|
|
28
|
+
name: '短信',
|
|
29
|
+
config: {}
|
|
30
|
+
}).set('phone', {
|
|
31
|
+
type: 'phone',
|
|
32
|
+
name: '电话',
|
|
33
|
+
config: {}
|
|
25
34
|
})),
|
|
26
35
|
_useState2 = _slicedToArray(_useState, 2),
|
|
27
36
|
settingMap = _useState2[0],
|
|
@@ -64,11 +73,12 @@ var Notice = function Notice() {
|
|
|
64
73
|
var formData = new FormData();
|
|
65
74
|
formData.set('type', editSetting.type);
|
|
66
75
|
formData.set('config', JSON.stringify(values));
|
|
76
|
+
console.log('editSetting.type', editSetting.type);
|
|
67
77
|
urlRequest(apis.setting.editNoticeConfig, {
|
|
68
78
|
method: 'post',
|
|
69
79
|
// data: formData,
|
|
70
80
|
data: {
|
|
71
|
-
type: editSetting.type
|
|
81
|
+
type: keyMap.get(editSetting.type) || null,
|
|
72
82
|
config: JSON.stringify(values)
|
|
73
83
|
}
|
|
74
84
|
}).then(function (res) {
|
package/es/types/system.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/modules-settings",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.15-alpha.0",
|
|
4
4
|
"module": "es/index.js",
|
|
5
5
|
"typings": "es/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@types/lodash": "^4.14.182",
|
|
39
39
|
"@umijs/fabric": "^2.8.1",
|
|
40
40
|
"@umijs/test": "^3.0.5",
|
|
41
|
-
"@zgfe/business-lib": "1.1.
|
|
41
|
+
"@zgfe/business-lib": "1.1.95",
|
|
42
42
|
"@zgfe/modules-demo-manage": "^1.0.1",
|
|
43
43
|
"antd": "^4.22.6",
|
|
44
44
|
"dumi": "^1.1.0",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"umi-request": "^1.4.0",
|
|
52
52
|
"yorkie": "^2.0.0"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "01d24b4fa9842c953f44d25c8cf4daf0935ef746",
|
|
55
55
|
"gitHooks": {
|
|
56
56
|
"pre-commit": "lint-staged"
|
|
57
57
|
}
|
|
58
|
-
}
|
|
58
|
+
}
|