@zgfe/modules-settings 2.1.0-zhongyuan.3 → 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',
@@ -124,7 +124,7 @@ var DictionaryManagement = function DictionaryManagement() {
124
124
  }, []);
125
125
  //分页搜索
126
126
  var getList = function getList() {
127
- request(apis.dict.getDictList, {
127
+ request(apis.dict.getDictPage, {
128
128
  method: 'post',
129
129
  data: {
130
130
  pageNo: tableParams.current,
@@ -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.3",
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": "60eebc50842994397f89204eb0eaccbe4dbcd9d8",
70
+ "gitHead": "4767afec1ef7fe458973efa32bf1195c4cc2c93c",
71
71
  "gitHooks": {
72
72
  "pre-commit": "lint-staged"
73
73
  }