@zgfe/modules-settings 2.1.0-zhongyuan.2 → 2.1.0-zhongyuan.3

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.
@@ -36,7 +36,7 @@ var clearDict = function clearDict(_ref) {
36
36
  openImportModal = _useState6[0],
37
37
  setOpenImportModal = _useState6[1];
38
38
  var columns = [{
39
- title: '字典名',
39
+ title: '属性值',
40
40
  dataIndex: 'name',
41
41
  key: 'name',
42
42
  render: function render(text, record, index) {
@@ -80,12 +80,13 @@ var clearDict = function clearDict(_ref) {
80
80
  request((currentDictDetail === null || currentDictDetail === void 0 ? void 0 : currentDictDetail.id) ? apis.dict.dictUpdate : apis.dict.dictSave, {
81
81
  method: 'post',
82
82
  data: {
83
+ id: (currentDictDetail === null || currentDictDetail === void 0 ? void 0 : currentDictDetail.id) || undefined,
83
84
  appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
84
- name: values.name,
85
+ dictName: values.dictName,
85
86
  remark: values.remark,
86
- dictValue: dictList.map(function (res) {
87
+ dictValue: _toConsumableArray(new Set(dictList.map(function (res) {
87
88
  return res.name;
88
- })
89
+ })))
89
90
  }
90
91
  }).then(function (res) {
91
92
  if (!res) return;
@@ -136,11 +137,12 @@ var clearDict = function clearDict(_ref) {
136
137
  //初始请求初始化
137
138
  useEffect(function () {
138
139
  if (currentDictDetail) {
140
+ var _currentDictDetail$di;
139
141
  dictForm.setFieldsValue({
140
- name: currentDictDetail.name,
142
+ dictName: currentDictDetail.dictName,
141
143
  remark: currentDictDetail.remark
142
144
  });
143
- setDictList(currentDictDetail.dictValue.map(function (res) {
145
+ setDictList((_currentDictDetail$di = currentDictDetail.dictValue) === null || _currentDictDetail$di === void 0 ? void 0 : _currentDictDetail$di.split(',').map(function (res) {
144
146
  return {
145
147
  name: res,
146
148
  key: Math.random() * 10000
@@ -155,10 +157,7 @@ var clearDict = function clearDict(_ref) {
155
157
  title: /*#__PURE__*/React.createElement("div", null, currentDictDetail ? '修改' : '创建', "\u5C5E\u6027\u5B57\u5178", /*#__PURE__*/React.createElement("div", {
156
158
  className: "clearDict-drawerCloseIcon",
157
159
  onClick: onClose
158
- }, /*#__PURE__*/React.createElement(CloseOutlined, {
159
- onPointerEnterCapture: undefined,
160
- onPointerLeaveCapture: undefined
161
- }))),
160
+ }, /*#__PURE__*/React.createElement(CloseOutlined, null))),
162
161
  onClose: onClose,
163
162
  closeIcon: false,
164
163
  open: open,
@@ -179,22 +178,22 @@ var clearDict = function clearDict(_ref) {
179
178
  span: 20
180
179
  },
181
180
  initialValues: {
182
- name: '',
181
+ dictName: '',
183
182
  desctiption: ''
184
183
  },
185
184
  onFinish: onFinish,
186
185
  labelAlign: "right"
187
186
  }, /*#__PURE__*/React.createElement(Form.Item, {
188
- label: "\u5C5E\u6027\u503C",
189
- name: "name",
187
+ label: "\u5C5E\u6027\u5B57\u5178\u540D",
188
+ name: "dictName.",
190
189
  rules: [{
191
190
  required: true,
192
- message: '请输入属性值'
191
+ message: '请输入属性字典名'
193
192
  }]
194
193
  }, /*#__PURE__*/React.createElement(Input, {
195
194
  showCount: true,
196
195
  maxLength: 50,
197
- placeholder: "\u8BF7\u8F93\u5165\u5C5E\u6027\u503C"
196
+ placeholder: "\u8BF7\u8F93\u5165\u5C5E\u6027\u5B57\u5178\u540D"
198
197
  })), /*#__PURE__*/React.createElement(Form.Item, {
199
198
  label: "\u5907\u6CE8",
200
199
  name: "remark"
@@ -214,7 +213,7 @@ var clearDict = function clearDict(_ref) {
214
213
  columns: columns,
215
214
  pagination: false,
216
215
  scroll: {
217
- y: 396
216
+ y: 'calc(100vh - 430px)'
218
217
  }
219
218
  })), /*#__PURE__*/React.createElement("div", {
220
219
  className: "clearDict-addListBtn"
@@ -232,7 +231,13 @@ var clearDict = function clearDict(_ref) {
232
231
  setOpenImportModal(false);
233
232
  },
234
233
  onSuccess: function onSuccess(result) {
235
- console.log(result);
234
+ setDictList([].concat(_toConsumableArray(dictList), _toConsumableArray(result.map(function (res) {
235
+ return {
236
+ name: res,
237
+ key: Math.random() * 10000
238
+ };
239
+ }))));
240
+ setOpenImportModal(false);
236
241
  }
237
242
  })));
238
243
  };
@@ -1,47 +1,48 @@
1
- .clearDict {
2
- height: 100%;
3
- padding: 24px;
4
- background: #fff;
5
- border-radius: 8px;
6
- border-radius: 8px;
7
- &-searchTop {
8
- display: grid;
9
- grid-template-columns: 1fr;
10
- align-items: center;
11
- justify-items: self-end;
12
- margin-bottom: 20px;
13
- }
14
- &-modal {
15
- .ant-modal-body {
16
- height: 350px;
17
- }
18
- .ant-picker-dropdown {
19
- top: 133px !important;
20
- left: 13px !important;
21
- }
22
- }
23
- &-content {
24
- display: flex;
25
- align-items: center;
26
- justify-content: space-between;
27
- }
28
- &-drawerCloseIcon {
29
- float: right;
30
- cursor: pointer;
31
- }
32
- &-addListBtn {
33
- display: flex;
34
- align-items: center;
35
- justify-content: space-between;
36
- margin-top: 20px;
37
- }
38
- &-tableContainer {
39
- margin-top: 10px;
40
- .ant-table {
41
- min-height: 448px !important; /* 设置表格最小高度 */
42
- }
43
- .ant-empty-normal {
44
- height: 299px; /* 设置表格最小高度 */
45
- }
46
- }
47
- }
1
+ .clearDict {
2
+ height: 100%;
3
+ padding: 24px;
4
+ background: #fff;
5
+ border-radius: 8px;
6
+ border-radius: 8px;
7
+ &-searchTop {
8
+ display: grid;
9
+ grid-template-columns: 1fr;
10
+ align-items: center;
11
+ justify-items: self-end;
12
+ margin-bottom: 20px;
13
+ }
14
+ &-modal {
15
+ .ant-modal-body {
16
+ height: 350px;
17
+ }
18
+ .ant-picker-dropdown {
19
+ top: 133px !important;
20
+ left: 13px !important;
21
+ }
22
+ }
23
+ &-content {
24
+ display: flex;
25
+ align-items: center;
26
+ justify-content: space-between;
27
+ }
28
+ &-drawerCloseIcon {
29
+ float: right;
30
+ cursor: pointer;
31
+ }
32
+ &-addListBtn {
33
+ display: flex;
34
+ align-items: center;
35
+ justify-content: space-between;
36
+ margin-top: 20px;
37
+ }
38
+ &-tableContainer {
39
+ margin-top: 10px;
40
+ .ant-table {
41
+ height: calc(100vh - 380px);
42
+ min-height: 410px !important; /* 设置表格最小高度 */
43
+ }
44
+ .ant-empty-normal {
45
+ height: 260px; /* 设置表格最小高度 */
46
+ }
47
+ }
48
+ }
@@ -36,9 +36,9 @@ var DictionaryManagement = function DictionaryManagement() {
36
36
  },
37
37
  width: 80
38
38
  }, {
39
- title: '字典名',
40
- dataIndex: 'name',
41
- key: 'name',
39
+ title: '属性字典名',
40
+ dataIndex: 'dictName',
41
+ key: 'dictName',
42
42
  render: function render(text) {
43
43
  return /*#__PURE__*/React.createElement(Tooltip, {
44
44
  title: text
@@ -53,8 +53,8 @@ var DictionaryManagement = function DictionaryManagement() {
53
53
  }
54
54
  }, {
55
55
  title: '创建人',
56
- dataIndex: 'createUser',
57
- key: 'createUser',
56
+ dataIndex: 'creatorName',
57
+ key: 'creatorName',
58
58
  width: 140
59
59
  }, {
60
60
  title: '备注',
@@ -98,6 +98,7 @@ var DictionaryManagement = function DictionaryManagement() {
98
98
  setAddDictShow = _useState4[1];
99
99
  var handleAddDict = function handleAddDict() {
100
100
  setAddDictShow(true);
101
+ setDictDetail(undefined);
101
102
  };
102
103
  /**
103
104
  * 字典列表, 搜索名称 删除字典
@@ -133,7 +134,7 @@ var DictionaryManagement = function DictionaryManagement() {
133
134
  }).then(function (res) {
134
135
  if (!res) return;
135
136
  if ((res === null || res === void 0 ? void 0 : res.code) == '100000') {
136
- setDictList(res.data.data);
137
+ setDictList(res.data.dictList);
137
138
  // 总页数
138
139
  setTableParams(function (pre) {
139
140
  return _objectSpread(_objectSpread({}, pre), {}, {
@@ -1,8 +1,8 @@
1
1
  export interface DictDetailType {
2
2
  id: number;
3
- name: string;
3
+ dictName: string;
4
4
  remark: string;
5
- dictValue: string[];
5
+ dictValue: string;
6
6
  }
7
7
  export interface DictList {
8
8
  name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-settings",
3
- "version": "2.1.0-zhongyuan.2",
3
+ "version": "2.1.0-zhongyuan.3",
4
4
  "private": false,
5
5
  "module": "es/index.js",
6
6
  "typings": "es/index.d.ts",
@@ -67,7 +67,7 @@
67
67
  "publishConfig": {
68
68
  "access": "public"
69
69
  },
70
- "gitHead": "d567e909df16d3e8b1fdea55cb831c0085e779fe",
70
+ "gitHead": "60eebc50842994397f89204eb0eaccbe4dbcd9d8",
71
71
  "gitHooks": {
72
72
  "pre-commit": "lint-staged"
73
73
  }