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

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.
@@ -7,5 +7,7 @@ declare const ImportModal: React.FC<{
7
7
  downloadTempleUrl: string;
8
8
  uploadFile: string;
9
9
  fileName?: string;
10
+ params?: any;
11
+ showHistory?: boolean;
10
12
  }>;
11
13
  export default ImportModal;
@@ -29,7 +29,7 @@ var ImportModal = function ImportModal(props) {
29
29
  errorLoc = _useState4[0],
30
30
  setErrorLoc = _useState4[1];
31
31
  var handleImportResultOk = function handleImportResultOk() {
32
- setOpenImportModalResult(false);
32
+ props.onSuccess && props.onSuccess({});
33
33
  setErrorLoc(undefined);
34
34
  };
35
35
  var _useState5 = useState(),
@@ -92,14 +92,29 @@ var ImportModal = function ImportModal(props) {
92
92
  var formData = new FormData();
93
93
  formData.append('appId', currentApp.appId);
94
94
  formData.append('file', fileData);
95
+ if (props.params) {
96
+ for (var key in props.params) {
97
+ formData.append(key, props.params[key]);
98
+ }
99
+ }
95
100
  setLoading(true);
96
101
  request(props.uploadFile, {
97
102
  method: 'post',
98
103
  data: formData
99
104
  }).then(function (res) {
100
105
  if (!res) return;
101
- message.success('导入成功');
102
- props.onSuccess && props.onSuccess(res.data);
106
+ //进入历史记录
107
+ if (props.showHistory && res.data) {
108
+ setOpenImportModalResult(true);
109
+ setErrorLoc({
110
+ successLocCount: res.data['导入成功条数'],
111
+ failedLocCount: res.data['导入失败条数'],
112
+ failedLocNames: res.data['导入失败标签名']
113
+ });
114
+ } else {
115
+ message.success('导入成功');
116
+ props.onSuccess && props.onSuccess(res.data);
117
+ }
103
118
  }).catch(function (e) {
104
119
  console.log(e);
105
120
  }).finally(function () {
@@ -118,12 +118,14 @@ declare let apis: {
118
118
  };
119
119
  dict: {
120
120
  getDictList: string;
121
+ getDictPage: string;
121
122
  dictSave: string;
122
123
  dictUpdate: string;
123
124
  dictUpload: string;
124
125
  dictDelete: string;
125
126
  dictTemplate: string;
126
127
  getTagList: string;
128
+ getTagPage: string;
127
129
  tagSave: string;
128
130
  tagUpdate: string;
129
131
  tagUpload: string;
@@ -145,20 +145,22 @@ var apis = {
145
145
  dict: {
146
146
  //字典管理
147
147
  getDictList: '/zg/web/v2/systemSettings/attr/dict/list',
148
+ getDictPage: '/zg/web/v2/systemsetting/attr/dict/listByPage',
148
149
  dictSave: '/zg/web/v2/systemSettings/attr/dict/save',
149
150
  dictUpdate: '/zg/web/v2/systemSettings/attr/dict/update',
150
151
  dictUpload: '/zg/web/v2/systemSettings/attr/dict/upload',
151
152
  dictDelete: '/zg/web/v2/systemSettings/attr/dict/delete',
152
153
  dictTemplate: '/zg/web/v2/systemSettings/attr/dict/template',
153
154
  //位置标签管理
154
- getTagList: '/zg/web/v2/label/eventLabel/list',
155
- tagSave: '/zg/web/v2/label/eventLabel/save',
156
- tagUpdate: '/zg/web/v2/label/eventLabel/update',
157
- tagUpload: '/zg/web/v2/label/eventLabel/upload',
158
- tagDownload: '/zg/web/v2/label/eventLabel/download',
159
- tagDelete: '/zg/web/v2/label/eventLabel/delete',
155
+ getTagList: '/zg/web/v2/eventLabel/list',
156
+ getTagPage: '/zg/web/v2/eventLabel/listByPage',
157
+ tagSave: '/zg/web/v2/eventLabel/save',
158
+ tagUpdate: '/zg/web/v2/eventLabel/update',
159
+ tagUpload: '/zg/web/v2/eventLabel/upload',
160
+ tagDownload: '/zg/web/v2/eventLabel/download',
161
+ tagDelete: '/zg/web/v2/eventLabel/delete',
160
162
  //标签模板
161
- tagTemplate: '/zg/web/v2/label/template'
163
+ tagTemplate: '/zg/web/v2/eventLabel/template'
162
164
  },
163
165
  // 查询公司下所有用户
164
166
  queryUserByCompanyId: '/zg/web/v2/user/queryUserByCompanyId',
@@ -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
  * 字典列表, 搜索名称 删除字典
@@ -123,7 +124,7 @@ var DictionaryManagement = function DictionaryManagement() {
123
124
  }, []);
124
125
  //分页搜索
125
126
  var getList = function getList() {
126
- request(apis.dict.getDictList, {
127
+ request(apis.dict.getDictPage, {
127
128
  method: 'post',
128
129
  data: {
129
130
  pageNo: tableParams.current,
@@ -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;
@@ -33,10 +33,11 @@ var clear = function clear(_ref) {
33
33
  request((currentDetail === null || currentDetail === void 0 ? void 0 : currentDetail.id) ? apis.dict.tagUpdate : apis.dict.tagSave, {
34
34
  method: 'post',
35
35
  data: {
36
+ id: currentDetail === null || currentDetail === void 0 ? void 0 : currentDetail.id,
36
37
  appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
37
- name: values.name,
38
+ labelName: values.labelName,
38
39
  remark: values.remark,
39
- type: type
40
+ labelType: type
40
41
  }
41
42
  }).then(function (res) {
42
43
  if (!res) return;
@@ -58,7 +59,7 @@ var clear = function clear(_ref) {
58
59
  useEffect(function () {
59
60
  if (currentDetail) {
60
61
  formRef.setFieldsValue({
61
- name: currentDetail.name,
62
+ labelName: currentDetail.labelName,
62
63
  remark: currentDetail.remark
63
64
  });
64
65
  }
@@ -70,10 +71,7 @@ var clear = function clear(_ref) {
70
71
  title: /*#__PURE__*/React.createElement("div", null, currentDetail ? '修改' : '创建', "\u6807\u7B7E", /*#__PURE__*/React.createElement("div", {
71
72
  className: "clearLoc-drawerCloseIcon",
72
73
  onClick: onClose
73
- }, /*#__PURE__*/React.createElement(CloseOutlined, {
74
- onPointerEnterCapture: undefined,
75
- onPointerLeaveCapture: undefined
76
- }))),
74
+ }, /*#__PURE__*/React.createElement(CloseOutlined, null))),
77
75
  onClose: onClose,
78
76
  closeIcon: false,
79
77
  open: open,
@@ -94,14 +92,14 @@ var clear = function clear(_ref) {
94
92
  span: 20
95
93
  },
96
94
  initialValues: {
97
- name: '',
95
+ labelName: '',
98
96
  desctiption: ''
99
97
  },
100
98
  onFinish: onFinish,
101
99
  labelAlign: "right"
102
100
  }, /*#__PURE__*/React.createElement(Form.Item, {
103
101
  label: "\u6807\u7B7E\u540D",
104
- name: "name",
102
+ name: "labelName",
105
103
  rules: [{
106
104
  required: true,
107
105
  message: '请输入标签名'
@@ -40,8 +40,8 @@ var locationTagManagement = function locationTagManagement(_ref) {
40
40
  width: 80
41
41
  }, {
42
42
  title: title + '名',
43
- dataIndex: 'name',
44
- key: 'name',
43
+ dataIndex: 'labelName',
44
+ key: 'labelName',
45
45
  render: function render(text) {
46
46
  return /*#__PURE__*/React.createElement(Tooltip, {
47
47
  title: text
@@ -56,8 +56,8 @@ var locationTagManagement = function locationTagManagement(_ref) {
56
56
  }
57
57
  }, {
58
58
  title: '创建人',
59
- dataIndex: 'createUser',
60
- key: 'createUser',
59
+ dataIndex: 'creatorName',
60
+ key: 'creatorName',
61
61
  width: 140
62
62
  }, {
63
63
  title: '备注',
@@ -151,18 +151,18 @@ var locationTagManagement = function locationTagManagement(_ref) {
151
151
  }, []);
152
152
  //分页搜索
153
153
  var getList = function getList() {
154
- request(apis.dict.getTagList, {
154
+ request(apis.dict.getTagPage, {
155
155
  method: 'post',
156
156
  data: {
157
157
  pageNo: tableParams.current,
158
158
  pageSize: tableParams.pageSize,
159
159
  appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
160
- type: type
160
+ labelType: type
161
161
  }
162
162
  }).then(function (res) {
163
163
  if (!res) return;
164
164
  if ((res === null || res === void 0 ? void 0 : res.code) == '100000') {
165
- setLocList(res.data.data);
165
+ setLocList(res.data.labelList);
166
166
  // 总页数
167
167
  setTableParams(function (pre) {
168
168
  return _objectSpread(_objectSpread({}, pre), {}, {
@@ -245,7 +245,13 @@ var locationTagManagement = function locationTagManagement(_ref) {
245
245
  onCancel: function onCancel() {
246
246
  setOpenImportModal(false);
247
247
  },
248
- onSuccess: function onSuccess(result) {}
248
+ showHistory: true,
249
+ params: {
250
+ labelType: type
251
+ },
252
+ onSuccess: function onSuccess(result) {
253
+ setOpenImportModal(false);
254
+ }
249
255
  })));
250
256
  };
251
257
  export default locationTagManagement;
@@ -1,6 +1,6 @@
1
1
  export interface DetailType {
2
2
  id: number;
3
- name: string;
3
+ labelName: string;
4
4
  remark: string;
5
5
  }
6
6
  export interface List {
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.4",
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": "4767afec1ef7fe458973efa32bf1195c4cc2c93c",
71
71
  "gitHooks": {
72
72
  "pre-commit": "lint-staged"
73
73
  }