@zgfe/modules-settings 1.0.1-a.8 → 1.0.1-a.9

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.
@@ -1465,3 +1465,10 @@
1465
1465
  content: "\e6b7";
1466
1466
  }
1467
1467
 
1468
+ .qingchu:before {
1469
+ /* content: "\e759"; */
1470
+
1471
+ content: "\e674";
1472
+
1473
+ }
1474
+
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  declare const PersonalSetting: React.FC<{
3
3
  settingsCallback: (type: string) => void;
4
- showVirtualApp: boolean;
5
4
  }>;
6
5
  export default PersonalSetting;
@@ -9,8 +9,7 @@ import { BizGlobalDataContext } from '@zgfe/business-lib';
9
9
  import SettingTabs from "../../components/settingTabs";
10
10
  import AppVirtualSource from "./virtualSource";
11
11
  var PersonalSetting = function PersonalSetting(props) {
12
- var settingsCallback = props.settingsCallback,
13
- showVirtualApp = props.showVirtualApp;
12
+ var settingsCallback = props.settingsCallback;
14
13
  // const [currentTab, setCurrentTab] = useState('1');
15
14
  var _useContext = useContext(BizGlobalDataContext),
16
15
  currentApp = _useContext.currentApp;
@@ -31,7 +30,7 @@ var PersonalSetting = function PersonalSetting(props) {
31
30
  key: '3',
32
31
  label: '配置数据源',
33
32
  content: /*#__PURE__*/React.createElement(AppVirtualSource, null),
34
- hidden: !showVirtualApp
33
+ hidden: (currentApp === null || currentApp === void 0 ? void 0 : currentApp.appType) !== 'virtual'
35
34
  }, {
36
35
  key: '4',
37
36
  label: 'Secret Key',
@@ -59,7 +59,7 @@ var CompanySettingUserGroup = function CompanySettingUserGroup(props) {
59
59
  _useState12 = _slicedToArray(_useState11, 2),
60
60
  CEPData = _useState12[0],
61
61
  setCEPData = _useState12[1];
62
- var _useState13 = useState('io'),
62
+ var _useState13 = useState(serviceType === 2 ? 'cep' : 'io'),
63
63
  _useState14 = _slicedToArray(_useState13, 2),
64
64
  currentTab = _useState14[0],
65
65
  setCurrentTab = _useState14[1];
@@ -158,7 +158,7 @@ var CompanySettingUserGroup = function CompanySettingUserGroup(props) {
158
158
  return;
159
159
  }
160
160
  setBtnLoading(true);
161
- var authConfig = refAuthConfig.current.getFormData();
161
+ var authConfig = serviceType !== 2 ? refAuthConfig.current.getFormData() : {};
162
162
  var userIdArr = user.map(function (item) {
163
163
  return item.id;
164
164
  });
@@ -13,6 +13,13 @@ var ItemEdit = function ItemEdit(props) {
13
13
  var _Form$useForm = Form.useForm(),
14
14
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
15
15
  form = _Form$useForm2[0];
16
+ var editSetting = props.editSetting,
17
+ editCancel = props.editCancel,
18
+ onSubmit = props.onSubmit;
19
+ var _useState = useState(editSetting.config),
20
+ _useState2 = _slicedToArray(_useState, 2),
21
+ initialValues = _useState2[0],
22
+ setInitialValues = _useState2[1];
16
23
  var settingsOptionsMap = new Map().set('email', {
17
24
  config: [{
18
25
  name: 'host',
@@ -63,17 +70,10 @@ var ItemEdit = function ItemEdit(props) {
63
70
  required: false
64
71
  }]
65
72
  });
66
- var editSetting = props.editSetting,
67
- editCancel = props.editCancel,
68
- onSubmit = props.onSubmit;
69
- var _useState = useState(editSetting.config),
70
- _useState2 = _slicedToArray(_useState, 2),
71
- initialValues = _useState2[0],
72
- setInitialValues = _useState2[1];
73
73
 
74
74
  // 确认
75
- var onFinish = function onFinish(values) {
76
- onSubmit(values);
75
+ var onFinish = function onFinish() {
76
+ onSubmit(form.getFieldsValue());
77
77
  };
78
78
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
79
79
  className: "item-edit-title"
@@ -102,16 +102,24 @@ var ItemEdit = function ItemEdit(props) {
102
102
  placeholder: config.placeholder,
103
103
  type: config.type === 'password' ? 'password' : 'text'
104
104
  })));
105
- }))), /*#__PURE__*/React.createElement("div", {
105
+ }), /*#__PURE__*/React.createElement(Col, {
106
+ span: 24,
106
107
  className: "operation-container"
107
- }, /*#__PURE__*/React.createElement(Button, {
108
- type: "primary",
109
- htmlType: "submit"
110
- }, "\u786E\u8BA4"), /*#__PURE__*/React.createElement(Button, {
111
- htmlType: "submit",
112
- onClick: function onClick() {
113
- return editCancel();
114
- }
115
- }, "\u53D6\u6D88")));
108
+ }, /*#__PURE__*/React.createElement(Form.Item, {
109
+ shouldUpdate: true
110
+ }, function () {
111
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
112
+ type: "primary",
113
+ htmlType: "submit",
114
+ disabled: !!form.getFieldsError().filter(function (_ref) {
115
+ var errors = _ref.errors;
116
+ return errors.length;
117
+ }).length || JSON.stringify(initialValues) === JSON.stringify(form.getFieldsValue())
118
+ }, "\u786E\u8BA4"), /*#__PURE__*/React.createElement(Button, {
119
+ onClick: function onClick() {
120
+ return editCancel();
121
+ }
122
+ }, "\u53D6\u6D88"));
123
+ })))));
116
124
  };
117
125
  export default ItemEdit;
@@ -1,3 +1,9 @@
1
1
  import React from 'react';
2
+ import { ISystemSettingItem } from './edit';
3
+ export interface IConfigItem {
4
+ name: string;
5
+ type: string;
6
+ config: ISystemSettingItem;
7
+ }
2
8
  declare const Notice: React.FC;
3
9
  export default Notice;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-settings",
3
- "version": "1.0.1-a.8",
3
+ "version": "1.0.1-a.9",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -50,7 +50,7 @@
50
50
  "umi-request": "^1.4.0",
51
51
  "yorkie": "^2.0.0"
52
52
  },
53
- "gitHead": "31363d1290e14408ae32cd7ea4d35f37c1aeb5ca",
53
+ "gitHead": "46b6d784fa0b2a7e6789f520cc8ce1763e568218",
54
54
  "gitHooks": {
55
55
  "pre-commit": "lint-staged"
56
56
  }