@zgfe/modules-settings 2.0.0-zhongyuan.9 → 2.1.0-zhongyuan-set.1

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.
Files changed (133) hide show
  1. package/README.md +33 -33
  2. package/es/components/card/index.less +87 -87
  3. package/es/components/importMetaDialog/index.d.ts +13 -0
  4. package/es/components/importMetaDialog/index.js +217 -0
  5. package/es/components/importMetaDialog/styles/index.less +115 -0
  6. package/es/components/pageLoading/index.less +7 -7
  7. package/es/components/picCircleSelect/bak/index copy 2.tsx.bak +92 -92
  8. package/es/components/picCircleSelect/bak/index copy 3.tsx.bak +58 -58
  9. package/es/components/picCircleSelect/bak/index copy 4.tsx.bak +66 -66
  10. package/es/components/picCircleSelect/bak/index copy 5.tsx.bak +116 -116
  11. package/es/components/picCircleSelect/bak/index copy 6.tsx.bak +116 -116
  12. package/es/components/picCircleSelect/bak/index copy.tsx.bak +41 -41
  13. package/es/components/picCircleSelect/bak/index.tsx.bak +48 -48
  14. package/es/components/picCircleSelect/bak/index1.tsx.bak +46 -46
  15. package/es/components/picCircleSelect/bak/index2.tsx.bak +104 -104
  16. package/es/components/picCircleSelect/index.less +37 -37
  17. package/es/components/processCanvas/styles/customNode.less +149 -149
  18. package/es/components/processCanvas/styles/index.less +34 -34
  19. package/es/components/settingTabs/index.less +51 -51
  20. package/es/constants/api.d.ts +30 -0
  21. package/es/constants/api.js +43 -1
  22. package/es/constants/icons/demo.css +539 -539
  23. package/es/constants/icons/demo_index.html +9871 -9871
  24. package/es/constants/icons/iconfont.css +1699 -1699
  25. package/es/constants/icons/iconfont.json +2956 -2956
  26. package/es/global.d.ts +4 -4
  27. package/es/modules/appSettings/dataAccessFilter/index.js +2 -1
  28. package/es/modules/appSettings/dataAccessFilter/index.less +5 -5
  29. package/es/modules/appSettings/virtualSource/styles/index.less +28 -28
  30. package/es/modules/appSettings/virtualSource/styles/table.less +51 -51
  31. package/es/modules/companySetting/appList/index.less +126 -126
  32. package/es/modules/companySetting/application/applicationForm.d.ts +1 -0
  33. package/es/modules/companySetting/application/applicationForm.js +34 -4
  34. package/es/modules/companySetting/application/index.d.ts +13 -0
  35. package/es/modules/companySetting/application/index.js +276 -104
  36. package/es/modules/companySetting/application/index.less +144 -126
  37. package/es/modules/companySetting/business/index.less +92 -92
  38. package/es/modules/companySetting/cost/index.less +38 -38
  39. package/es/modules/companySetting/department/index.less +157 -157
  40. package/es/modules/companySetting/edit/styles/authConfig.less +3 -3
  41. package/es/modules/companySetting/edit/styles/authGroup.less +10 -10
  42. package/es/modules/companySetting/edit/styles/authModule.less +82 -82
  43. package/es/modules/companySetting/edit/styles/user.less +54 -54
  44. package/es/modules/companySetting/edit/styles/userGroup.less +44 -44
  45. package/es/modules/companySetting/index.js +37 -33
  46. package/es/modules/companySetting/index.less +90 -90
  47. package/es/modules/companySetting/info/index.less +42 -42
  48. package/es/modules/companySetting/mainPart/images/img2.svg +12 -12
  49. package/es/modules/companySetting/mainPart/index.less +239 -239
  50. package/es/modules/companySetting/operationLog/index.js +22 -5
  51. package/es/modules/companySetting/operationLog/index.less +33 -33
  52. package/es/modules/companySetting/role/index.less +296 -296
  53. package/es/modules/companySetting/role/setDataRangeDialog/index.less +37 -37
  54. package/es/modules/companySetting/style/common.less +79 -79
  55. package/es/modules/companySetting/style/reset.less +117 -117
  56. package/es/modules/companySetting/user/index.js +29 -24
  57. package/es/modules/companySetting/user/index.less +363 -363
  58. package/es/modules/companySetting/user/invite.js +30 -102
  59. package/es/modules/companySetting/virtualApp/styles/config.less +37 -37
  60. package/es/modules/companySetting/virtualApp/styles/index.less +21 -21
  61. package/es/modules/companySetting/virtualApp/styles/list.less +28 -28
  62. package/es/modules/companySetting/virtualApp/styles/sourceItem.less +33 -33
  63. package/es/modules/companySetting/virtualApp/styles/table.less +44 -44
  64. package/es/modules/companySetting/wechatBinding/index.less +58 -58
  65. package/es/modules/createDemand/constants.d.ts +15 -2
  66. package/es/modules/createDemand/constants.js +57 -4
  67. package/es/modules/createDemand/demo/selectPoint.js +1 -2
  68. package/es/modules/createDemand/index.d.ts +0 -1
  69. package/es/modules/createDemand/index.js +793 -179
  70. package/es/modules/createDemand/styles/index.less +403 -277
  71. package/es/modules/createDemand_bf/demo/index.js +0 -1
  72. package/es/modules/createDemand_bf/index.js +0 -1
  73. package/es/modules/createDemand_bf/styles/index.less +222 -222
  74. package/es/modules/createProcess/components/index.less +52 -52
  75. package/es/modules/createProcess/index.less +114 -114
  76. package/es/modules/createProcess/title/index.less +53 -53
  77. package/es/modules/dealDemand/demo/index.js +0 -1
  78. package/es/modules/dealDemand/demo/selectPoint.js +1 -1
  79. package/es/modules/dealDemand/index.js +0 -2
  80. package/es/modules/dealDemand/styles/index.less +265 -265
  81. package/es/modules/demandManage/index.js +174 -178
  82. package/es/modules/demandManage/styles/index.less +8 -68
  83. package/es/modules/getPassword/index.less +122 -122
  84. package/es/modules/messageList/index.d.ts +1 -1
  85. package/es/modules/messageList/index.js +6 -6
  86. package/es/modules/messageList/index.less +81 -81
  87. package/es/modules/personalSetting/demo/index.d.ts +3 -0
  88. package/es/modules/personalSetting/demo/index.js +12 -0
  89. package/es/modules/personalSetting/index.js +11 -1
  90. package/es/modules/personalSetting/info/index.js +23 -5
  91. package/es/modules/personalSetting/securityLog/index.less +11 -11
  92. package/es/modules/personalSetting/styles/unbinding.less +73 -73
  93. package/es/modules/pointMap/ImportModal/styles/index.less +91 -91
  94. package/es/modules/pointMap/createMetaDrawer.d.ts +5 -0
  95. package/es/modules/pointMap/createMetaDrawer.js +825 -0
  96. package/es/modules/pointMap/editTxt/index.less +55 -55
  97. package/es/modules/pointMap/pageInfo.js +401 -179
  98. package/es/modules/pointMap/record.d.ts +7 -0
  99. package/es/modules/pointMap/record.js +521 -0
  100. package/es/modules/pointMap/styles/index.less +165 -38
  101. package/es/modules/pointMap/styles/pageInfo.less +439 -244
  102. package/es/modules/pointMap/styles/tree.css +164 -145
  103. package/es/modules/pointMap/styles/tree.less +174 -149
  104. package/es/modules/pointMap/tree.js +232 -88
  105. package/es/modules/pointMap/types.d.ts +88 -0
  106. package/es/modules/pointMap/types.js +1 -0
  107. package/es/modules/systemSetting/Dictionary.d.ts +5 -2
  108. package/es/modules/systemSetting/Dictionary.js +54 -370
  109. package/es/modules/systemSetting/approvalmanage/approvalStrategy/index.less +14 -14
  110. package/es/modules/systemSetting/approvalmanage/index.less +5 -5
  111. package/es/modules/systemSetting/approvalmanage/processManage/index.less +39 -39
  112. package/es/modules/systemSetting/dictionaryItem/dictionaryManagement/create.d.ts +9 -0
  113. package/es/modules/systemSetting/dictionaryItem/dictionaryManagement/create.js +245 -0
  114. package/es/modules/systemSetting/dictionaryItem/dictionaryManagement/css/index.less +48 -0
  115. package/es/modules/systemSetting/dictionaryItem/dictionaryManagement/index.d.ts +4 -0
  116. package/es/modules/systemSetting/dictionaryItem/dictionaryManagement/index.js +207 -0
  117. package/es/modules/systemSetting/dictionaryItem/dictionaryManagement/type/index.d.ts +10 -0
  118. package/es/modules/systemSetting/dictionaryItem/dictionaryManagement/type/index.js +1 -0
  119. package/es/modules/systemSetting/dictionaryItem/eventTagManagement/create.d.ts +10 -0
  120. package/es/modules/systemSetting/dictionaryItem/eventTagManagement/create.js +124 -0
  121. package/es/modules/systemSetting/dictionaryItem/eventTagManagement/css/index.less +32 -0
  122. package/es/modules/systemSetting/dictionaryItem/eventTagManagement/index.d.ts +7 -0
  123. package/es/modules/systemSetting/dictionaryItem/eventTagManagement/index.js +264 -0
  124. package/es/modules/systemSetting/dictionaryItem/eventTagManagement/type/index.d.ts +9 -0
  125. package/es/modules/systemSetting/dictionaryItem/eventTagManagement/type/index.js +1 -0
  126. package/es/modules/systemSetting/document-setting/index.js +7 -6
  127. package/es/modules/systemSetting/index.css +161 -161
  128. package/es/modules/systemSetting/index.js +16 -16
  129. package/es/modules/systemSetting/index.less +169 -169
  130. package/es/modules/systemSetting/notice/configItem/index.less +21 -21
  131. package/es/modules/systemSetting/notice/edit/index.less +26 -26
  132. package/es/types/personal.d.ts +1 -0
  133. package/package.json +74 -74
@@ -0,0 +1,245 @@
1
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
2
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
4
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
5
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
6
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
8
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
9
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
10
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
11
+ import { Drawer, Input, Button, Space, Form, Table, message } from 'antd';
12
+ import { CloseOutlined, PlusOutlined } from '@ant-design/icons';
13
+ import React, { useContext, useEffect, useState } from 'react';
14
+ import { BizGlobalDataContext } from '@zgfe/business-lib';
15
+ import ImportMetaDialog from '../../../../components/importMetaDialog/index';
16
+ import './css/index.less';
17
+ import request from '../../../../utils/ajax';
18
+ import apis from '../../../../constants/api';
19
+ var TextArea = Input.TextArea;
20
+ var clearDict = function clearDict(_ref) {
21
+ var addDictShow = _ref.addDictShow,
22
+ onSetclose = _ref.onSetclose,
23
+ currentDictDetail = _ref.currentDictDetail;
24
+ var _useContext = useContext(BizGlobalDataContext),
25
+ currentApp = _useContext.currentApp,
26
+ showProdDownload = _useContext.showProdDownload;
27
+ var _useState = useState(addDictShow),
28
+ _useState2 = _slicedToArray(_useState, 2),
29
+ open = _useState2[0],
30
+ setOpen = _useState2[1];
31
+ var _useState3 = useState([]),
32
+ _useState4 = _slicedToArray(_useState3, 2),
33
+ dictList = _useState4[0],
34
+ setDictList = _useState4[1];
35
+ var _useState5 = useState(false),
36
+ _useState6 = _slicedToArray(_useState5, 2),
37
+ openImportModal = _useState6[0],
38
+ setOpenImportModal = _useState6[1];
39
+ var columns = [{
40
+ title: '属性值',
41
+ dataIndex: 'name',
42
+ key: 'name',
43
+ render: function render(text, record, index) {
44
+ return /*#__PURE__*/React.createElement(Input, {
45
+ showCount: true,
46
+ maxLength: 50,
47
+ defaultValue: text,
48
+ placeholder: "\u8BF7\u8F93\u5165\u5C5E\u6027\u503C",
49
+ onChange: function onChange(e) {
50
+ onChangeName(index, e.target.value);
51
+ }
52
+ });
53
+ }
54
+ }, {
55
+ title: '操作',
56
+ key: 'action',
57
+ width: 80,
58
+ render: function render(_, record, index) {
59
+ return /*#__PURE__*/React.createElement(Space, {
60
+ size: "middle"
61
+ }, /*#__PURE__*/React.createElement("a", {
62
+ onClick: function onClick() {
63
+ return handleDeleteDict(index);
64
+ }
65
+ }, "\u5220\u9664"));
66
+ }
67
+ }];
68
+ var _Form$useForm = Form.useForm(),
69
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
70
+ dictForm = _Form$useForm2[0];
71
+ //确定按钮
72
+ var handleSave = function handleSave() {
73
+ dictForm.submit();
74
+ };
75
+ //表单请求
76
+ var onFinish = function onFinish(values) {
77
+ if (!dictList.length) {
78
+ message.error('字典属性值不能为空!');
79
+ return;
80
+ }
81
+ request((currentDictDetail === null || currentDictDetail === void 0 ? void 0 : currentDictDetail.id) ? apis.dict.dictUpdate : apis.dict.dictSave, {
82
+ method: 'post',
83
+ data: {
84
+ id: (currentDictDetail === null || currentDictDetail === void 0 ? void 0 : currentDictDetail.id) || undefined,
85
+ appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
86
+ dictName: values.dictName,
87
+ remark: values.remark,
88
+ dictValue: _toConsumableArray(new Set(dictList.map(function (res) {
89
+ return res.name;
90
+ })))
91
+ }
92
+ }).then(function (res) {
93
+ if (!res) return;
94
+ if ((res === null || res === void 0 ? void 0 : res.code) == '100000') {
95
+ message.success((currentDictDetail === null || currentDictDetail === void 0 ? void 0 : currentDictDetail.id) ? '字典修改成功' : '字典创建成功!');
96
+ onClose();
97
+ } else {
98
+ message.error(res.msg);
99
+ }
100
+ });
101
+ };
102
+ //取消退出
103
+ var onClose = function onClose() {
104
+ setOpen(false);
105
+ dictForm.resetFields(); // 表单重置
106
+ setTimeout(function () {
107
+ onSetclose();
108
+ }, 300);
109
+ };
110
+ //删除表单属性
111
+ var handleDeleteDict = function handleDeleteDict(index) {
112
+ setDictList(dictList.filter(function (res, filterIndex) {
113
+ return index != filterIndex;
114
+ }));
115
+ };
116
+ //修改属性名称
117
+ var onChangeName = function onChangeName(index, value) {
118
+ dictList[index]['name'] = value;
119
+ setDictList(dictList);
120
+ };
121
+ //属性添加
122
+ var onHandlePush = function onHandlePush() {
123
+ setDictList([].concat(_toConsumableArray(dictList), [{
124
+ name: '',
125
+ key: Math.random() * 10000
126
+ }]));
127
+ var tableBody = document.querySelector('.ant-table-body');
128
+ if (tableBody) {
129
+ setTimeout(function () {
130
+ tableBody === null || tableBody === void 0 ? void 0 : tableBody.scrollTo(0, tableBody.scrollHeight);
131
+ }, 0);
132
+ }
133
+ };
134
+ //属性添加文件上传
135
+ var onHandleUploading = function onHandleUploading() {
136
+ setOpenImportModal(true);
137
+ };
138
+ //初始请求初始化
139
+ useEffect(function () {
140
+ if (currentDictDetail) {
141
+ var _currentDictDetail$di;
142
+ dictForm.setFieldsValue({
143
+ dictName: currentDictDetail.dictName,
144
+ remark: currentDictDetail.remark
145
+ });
146
+ setDictList((_currentDictDetail$di = currentDictDetail.dictValue) === null || _currentDictDetail$di === void 0 ? void 0 : _currentDictDetail$di.split(',').map(function (res) {
147
+ return {
148
+ name: res,
149
+ key: Math.random() * 10000
150
+ };
151
+ }));
152
+ }
153
+ }, []);
154
+ return /*#__PURE__*/React.createElement("div", {
155
+ className: "clearDict"
156
+ }, /*#__PURE__*/React.createElement(Drawer, {
157
+ className: "clearDictForm",
158
+ title: /*#__PURE__*/React.createElement("div", null, currentDictDetail ? '修改' : '创建', "\u5C5E\u6027\u5B57\u5178", /*#__PURE__*/React.createElement("div", {
159
+ className: "clearDict-drawerCloseIcon",
160
+ onClick: onClose
161
+ }, /*#__PURE__*/React.createElement(CloseOutlined, null))),
162
+ onClose: onClose,
163
+ closeIcon: false,
164
+ open: open,
165
+ placement: "right",
166
+ width: "700px",
167
+ footer: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Button, {
168
+ onClick: onClose
169
+ }, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
170
+ type: "primary",
171
+ onClick: handleSave
172
+ }, "\u786E\u5B9A")))
173
+ }, /*#__PURE__*/React.createElement(Form, {
174
+ form: dictForm,
175
+ labelCol: {
176
+ span: 4
177
+ },
178
+ wrapperCol: {
179
+ span: 20
180
+ },
181
+ initialValues: {
182
+ dictName: '',
183
+ desctiption: ''
184
+ },
185
+ onFinish: onFinish,
186
+ labelAlign: "right"
187
+ }, /*#__PURE__*/React.createElement(Form.Item, {
188
+ label: "\u5C5E\u6027\u5B57\u5178\u540D",
189
+ name: "dictName",
190
+ rules: [{
191
+ required: true,
192
+ message: '请输入属性字典名'
193
+ }]
194
+ }, /*#__PURE__*/React.createElement(Input, {
195
+ showCount: true,
196
+ maxLength: 50,
197
+ placeholder: "\u8BF7\u8F93\u5165\u5C5E\u6027\u5B57\u5178\u540D"
198
+ })), /*#__PURE__*/React.createElement(Form.Item, {
199
+ label: "\u5907\u6CE8",
200
+ name: "remark"
201
+ }, /*#__PURE__*/React.createElement(TextArea, {
202
+ showCount: true,
203
+ maxLength: 100,
204
+ autoSize: {
205
+ minRows: 3,
206
+ maxRows: 6
207
+ },
208
+ placeholder: "\u8BF7\u8F93\u5165\u5907\u6CE8"
209
+ }))), /*#__PURE__*/React.createElement("div", {
210
+ className: "clearDict-tableContainer"
211
+ }, /*#__PURE__*/React.createElement(Table, {
212
+ rowKey: "key",
213
+ dataSource: dictList,
214
+ columns: columns,
215
+ pagination: false,
216
+ scroll: {
217
+ y: 'calc(100vh - 430px)'
218
+ }
219
+ })), /*#__PURE__*/React.createElement("div", {
220
+ className: "clearDict-addListBtn"
221
+ }, /*#__PURE__*/React.createElement(Button, {
222
+ type: "primary",
223
+ onClick: onHandlePush
224
+ }, /*#__PURE__*/React.createElement(PlusOutlined, null), "\u6DFB\u52A0\u503C"), showProdDownload && (/*#__PURE__*/React.createElement(Button, {
225
+ type: "primary",
226
+ onClick: onHandleUploading
227
+ }, /*#__PURE__*/React.createElement(PlusOutlined, null), "\u4ECE\u6587\u4EF6\u6DFB\u52A0")))), openImportModal && (/*#__PURE__*/React.createElement(ImportMetaDialog, {
228
+ uploadFile: apis.dict.dictUpload,
229
+ downloadTempleUrl: apis.dict.dictTemplate,
230
+ fileName: "\u5C5E\u6027\u503C\u5BFC\u5165\u6A21\u677F",
231
+ onCancel: function onCancel() {
232
+ setOpenImportModal(false);
233
+ },
234
+ onSuccess: function onSuccess(result) {
235
+ setDictList([].concat(_toConsumableArray(dictList), _toConsumableArray(result.map(function (res) {
236
+ return {
237
+ name: res,
238
+ key: Math.random() * 10000
239
+ };
240
+ }))));
241
+ setOpenImportModal(false);
242
+ }
243
+ })));
244
+ };
245
+ export default clearDict;
@@ -0,0 +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
+ height: calc(100vh - 380px);
42
+ min-height: 410px !important; /* 设置表格最小高度 */
43
+ }
44
+ .ant-empty-normal {
45
+ height: 260px; /* 设置表格最小高度 */
46
+ }
47
+ }
48
+ }
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import './css/index.less';
3
+ declare const DictionaryManagement: React.FC;
4
+ export default DictionaryManagement;
@@ -0,0 +1,207 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
8
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
10
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
11
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
13
+ import { Table, Button, Space, Modal, message, Tooltip, Typography } from 'antd';
14
+ import { PlusOutlined } from '@ant-design/icons';
15
+ import React, { useContext, useEffect, useState } from 'react';
16
+ import { BizGlobalDataContext } from '@zgfe/business-lib';
17
+ import CreateDict from './create';
18
+ import request from '../../../../utils/ajax';
19
+ import apis from '../../../../constants/api';
20
+ import './css/index.less';
21
+ import moment from 'moment';
22
+ var Text = Typography.Text;
23
+ var className = 'clearDict';
24
+ var DictionaryManagement = function DictionaryManagement() {
25
+ var _useContext = useContext(BizGlobalDataContext),
26
+ currentApp = _useContext.currentApp;
27
+ var columns = [{
28
+ title: '序号',
29
+ dataIndex: 'index',
30
+ key: 'index',
31
+ render: function render() {
32
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
33
+ args[_key] = arguments[_key];
34
+ }
35
+ return "".concat(args.pop() + 1);
36
+ },
37
+ width: 80
38
+ }, {
39
+ title: '属性字典名',
40
+ dataIndex: 'dictName',
41
+ key: 'dictName',
42
+ render: function render(text) {
43
+ return /*#__PURE__*/React.createElement(Tooltip, {
44
+ title: text
45
+ }, /*#__PURE__*/React.createElement(Text, null, text));
46
+ }
47
+ }, {
48
+ title: '创建时间',
49
+ width: 220,
50
+ dataIndex: 'createTime',
51
+ render: function render(text) {
52
+ return moment(text).format('YYYY-MM-DD HH:mm:ss');
53
+ }
54
+ }, {
55
+ title: '创建人',
56
+ dataIndex: 'creatorName',
57
+ key: 'creatorName',
58
+ width: 140
59
+ }, {
60
+ title: '备注',
61
+ dataIndex: 'remark',
62
+ render: function render(text) {
63
+ return /*#__PURE__*/React.createElement(Tooltip, {
64
+ title: text
65
+ }, /*#__PURE__*/React.createElement(Text, null, text));
66
+ }
67
+ }, {
68
+ title: '操作',
69
+ key: 'action',
70
+ width: 160,
71
+ render: function render(_, record) {
72
+ return /*#__PURE__*/React.createElement(Space, {
73
+ size: "middle"
74
+ }, /*#__PURE__*/React.createElement("a", {
75
+ onClick: function onClick() {
76
+ return getDetail(record);
77
+ }
78
+ }, "\u7F16\u8F91"), /*#__PURE__*/React.createElement("a", {
79
+ onClick: function onClick() {
80
+ return handleDeletet(record === null || record === void 0 ? void 0 : record.id);
81
+ }
82
+ }, "\u5220\u9664"));
83
+ }
84
+ }];
85
+ // 编辑字典
86
+ var _useState = useState(),
87
+ _useState2 = _slicedToArray(_useState, 2),
88
+ dictDetail = _useState2[0],
89
+ setDictDetail = _useState2[1];
90
+ var getDetail = function getDetail(record) {
91
+ setDictDetail(record);
92
+ setAddDictShow(true);
93
+ };
94
+ // 新建字典显示
95
+ var _useState3 = useState(false),
96
+ _useState4 = _slicedToArray(_useState3, 2),
97
+ addDictShow = _useState4[0],
98
+ setAddDictShow = _useState4[1];
99
+ var handleAddDict = function handleAddDict() {
100
+ setAddDictShow(true);
101
+ setDictDetail(undefined);
102
+ };
103
+ /**
104
+ * 字典列表, 搜索名称 删除字典
105
+ */
106
+ var _useState5 = useState([]),
107
+ _useState6 = _slicedToArray(_useState5, 2),
108
+ dictList = _useState6[0],
109
+ setDictList = _useState6[1];
110
+ var handlePage = function handlePage(pagination) {
111
+ setTableParams(pagination);
112
+ getList();
113
+ };
114
+ var _useState7 = useState({
115
+ current: 1,
116
+ pageSize: 10,
117
+ total: 0
118
+ }),
119
+ _useState8 = _slicedToArray(_useState7, 2),
120
+ tableParams = _useState8[0],
121
+ setTableParams = _useState8[1];
122
+ useEffect(function () {
123
+ getList();
124
+ }, []);
125
+ //分页搜索
126
+ var getList = function getList() {
127
+ request(apis.dict.getDictPage, {
128
+ method: 'post',
129
+ data: {
130
+ pageNo: tableParams.current,
131
+ pageSize: tableParams.pageSize,
132
+ appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId
133
+ }
134
+ }).then(function (res) {
135
+ if (!res) return;
136
+ if ((res === null || res === void 0 ? void 0 : res.code) == '100000') {
137
+ setDictList(res.data.dictList);
138
+ // 总页数
139
+ setTableParams(function (pre) {
140
+ return _objectSpread(_objectSpread({}, pre), {}, {
141
+ total: res.data.total
142
+ });
143
+ });
144
+ } else {
145
+ message.error('查询列表失败!');
146
+ }
147
+ });
148
+ };
149
+ //删除
150
+ var handleDeletet = function handleDeletet(id) {
151
+ Modal.confirm({
152
+ // wrapClassName: `${classPrefix}-confirm`,
153
+ title: '提示',
154
+ icon: null,
155
+ closable: true,
156
+ content: '您确定要删除当前字典?',
157
+ okText: '确定',
158
+ cancelText: '取消',
159
+ onOk: function onOk() {
160
+ handleDeleteMap(id);
161
+ }
162
+ });
163
+ };
164
+ var handleDeleteMap = function handleDeleteMap(id) {
165
+ request(apis.dict.dictDelete, {
166
+ method: 'post',
167
+ data: {
168
+ appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
169
+ id: id
170
+ }
171
+ }).then(function (res) {
172
+ if (!res) return;
173
+ if ((res === null || res === void 0 ? void 0 : res.code) == '100000') {
174
+ message.success("\u5220\u9664\u5B57\u5178\u6210\u529F\uFF01");
175
+ getList();
176
+ } else {
177
+ message.error('删除字典失败!');
178
+ }
179
+ });
180
+ };
181
+ return /*#__PURE__*/React.createElement("div", {
182
+ className: "".concat(className)
183
+ }, /*#__PURE__*/React.createElement("div", {
184
+ className: "".concat(className, "-searchTop")
185
+ }, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Button, {
186
+ type: "primary",
187
+ onClick: handleAddDict
188
+ }, /*#__PURE__*/React.createElement(PlusOutlined, null), "\u521B\u5EFA\u5B57\u5178"))), /*#__PURE__*/React.createElement(Table, {
189
+ rowKey: "id",
190
+ dataSource: dictList,
191
+ pagination: tableParams,
192
+ columns: columns,
193
+ onChange: handlePage,
194
+ scroll: {
195
+ x: 992,
196
+ y: 390
197
+ }
198
+ }), addDictShow && (/*#__PURE__*/React.createElement(CreateDict, {
199
+ addDictShow: addDictShow,
200
+ currentDictDetail: dictDetail || null,
201
+ onSetclose: function onSetclose() {
202
+ setAddDictShow(false);
203
+ getList();
204
+ }
205
+ })));
206
+ };
207
+ export default DictionaryManagement;
@@ -0,0 +1,10 @@
1
+ export interface DictDetailType {
2
+ id: number;
3
+ dictName: string;
4
+ remark: string;
5
+ dictValue: string;
6
+ }
7
+ export interface DictList {
8
+ name: string;
9
+ key: number;
10
+ }
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { DetailType } from './type';
3
+ import './css/index.less';
4
+ declare const clear: React.FC<{
5
+ addLocShow: boolean;
6
+ onSetclose: Function;
7
+ currentDetail: DetailType | undefined | null;
8
+ type: number;
9
+ }>;
10
+ export default clear;
@@ -0,0 +1,124 @@
1
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
4
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
7
+ import { Drawer, Input, Button, Space, Form, message } from 'antd';
8
+ import { CloseOutlined } from '@ant-design/icons';
9
+ import React, { useContext, useEffect, useState } from 'react';
10
+ import { BizGlobalDataContext } from '@zgfe/business-lib';
11
+ import './css/index.less';
12
+ import request from '../../../../utils/ajax';
13
+ import apis from '../../../../constants/api';
14
+ var TextArea = Input.TextArea;
15
+ var clear = function clear(_ref) {
16
+ var addLocShow = _ref.addLocShow,
17
+ onSetclose = _ref.onSetclose,
18
+ currentDetail = _ref.currentDetail,
19
+ type = _ref.type;
20
+ var _useContext = useContext(BizGlobalDataContext),
21
+ currentApp = _useContext.currentApp;
22
+ var _useState = useState(addLocShow),
23
+ _useState2 = _slicedToArray(_useState, 2),
24
+ open = _useState2[0],
25
+ setOpen = _useState2[1];
26
+ var _Form$useForm = Form.useForm(),
27
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
28
+ formRef = _Form$useForm2[0];
29
+ var handleSave = function handleSave() {
30
+ formRef.submit();
31
+ };
32
+ var onFinish = function onFinish(values) {
33
+ request((currentDetail === null || currentDetail === void 0 ? void 0 : currentDetail.id) ? apis.dict.tagUpdate : apis.dict.tagSave, {
34
+ method: 'post',
35
+ data: {
36
+ id: currentDetail === null || currentDetail === void 0 ? void 0 : currentDetail.id,
37
+ appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
38
+ labelName: values.labelName,
39
+ remark: values.remark,
40
+ labelType: type
41
+ }
42
+ }).then(function (res) {
43
+ if (!res) return;
44
+ if ((res === null || res === void 0 ? void 0 : res.code) == '100000') {
45
+ message.success((currentDetail === null || currentDetail === void 0 ? void 0 : currentDetail.id) ? '标签修改成功!' : '标签添加成功!');
46
+ onClose();
47
+ } else {
48
+ message.error(res.msg);
49
+ }
50
+ });
51
+ };
52
+ var onClose = function onClose() {
53
+ setOpen(false);
54
+ formRef.resetFields(); // 表单重置
55
+ setTimeout(function () {
56
+ onSetclose();
57
+ }, 300);
58
+ };
59
+ useEffect(function () {
60
+ if (currentDetail) {
61
+ formRef.setFieldsValue({
62
+ labelName: currentDetail.labelName,
63
+ remark: currentDetail.remark
64
+ });
65
+ }
66
+ }, []);
67
+ return /*#__PURE__*/React.createElement("div", {
68
+ className: "clearLoc"
69
+ }, /*#__PURE__*/React.createElement(Drawer, {
70
+ className: "clearformRef",
71
+ title: /*#__PURE__*/React.createElement("div", null, currentDetail ? '修改' : '创建', "\u6807\u7B7E", /*#__PURE__*/React.createElement("div", {
72
+ className: "clearLoc-drawerCloseIcon",
73
+ onClick: onClose
74
+ }, /*#__PURE__*/React.createElement(CloseOutlined, null))),
75
+ onClose: onClose,
76
+ closeIcon: false,
77
+ open: open,
78
+ placement: "right",
79
+ width: "700px",
80
+ footer: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Button, {
81
+ onClick: onClose
82
+ }, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
83
+ type: "primary",
84
+ onClick: handleSave
85
+ }, "\u786E\u5B9A")))
86
+ }, /*#__PURE__*/React.createElement(Form, {
87
+ form: formRef,
88
+ labelCol: {
89
+ span: 4
90
+ },
91
+ wrapperCol: {
92
+ span: 20
93
+ },
94
+ initialValues: {
95
+ labelName: '',
96
+ desctiption: ''
97
+ },
98
+ onFinish: onFinish,
99
+ labelAlign: "right"
100
+ }, /*#__PURE__*/React.createElement(Form.Item, {
101
+ label: "\u6807\u7B7E\u540D",
102
+ name: "labelName",
103
+ rules: [{
104
+ required: true,
105
+ message: '请输入标签名'
106
+ }]
107
+ }, /*#__PURE__*/React.createElement(Input, {
108
+ showCount: true,
109
+ maxLength: 50,
110
+ placeholder: "\u8BF7\u8F93\u5165\u6807\u7B7E\u540D"
111
+ })), /*#__PURE__*/React.createElement(Form.Item, {
112
+ label: "\u5907\u6CE8",
113
+ name: "remark"
114
+ }, /*#__PURE__*/React.createElement(TextArea, {
115
+ showCount: true,
116
+ maxLength: 100,
117
+ autoSize: {
118
+ minRows: 3,
119
+ maxRows: 6
120
+ },
121
+ placeholder: "\u8BF7\u8F93\u5165\u5907\u6CE8"
122
+ })))));
123
+ };
124
+ export default clear;