@chaoswise/business 0.0.5 → 0.0.7

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 (40) hide show
  1. package/lib/AggregateSearch/CLSPL/CLQLLexer.js +80 -0
  2. package/lib/AggregateSearch/CLSPL/CLQLParser.js +2797 -0
  3. package/lib/AggregateSearch/CLSPL/CLQLParserListener.js +349 -0
  4. package/lib/AggregateSearch/CLSPL/CLQLParserVisitor.js +253 -0
  5. package/lib/AggregateSearch/CLSPL/SPLStagy.js +189 -0
  6. package/lib/AggregateSearch/CLSPL/index.js +176 -0
  7. package/lib/AggregateSearch/CLSPL/makeTokenizeFn.js +18 -0
  8. package/lib/AggregateSearch/CLSPL/token.js +7 -0
  9. package/lib/AggregateSearch/components/DropDown/assets/combined.svg +22 -0
  10. package/lib/AggregateSearch/components/DropDown/assets/copy.svg +22 -0
  11. package/lib/AggregateSearch/components/DropDown/assets/delete.svg +24 -0
  12. package/lib/AggregateSearch/components/DropDown/assets/home.svg +20 -0
  13. package/lib/AggregateSearch/components/DropDown/assets/key.svg +21 -0
  14. package/lib/AggregateSearch/components/DropDown/assets/star.svg +22 -0
  15. package/lib/AggregateSearch/components/DropDown/assets/time-circle.svg +20 -0
  16. package/lib/AggregateSearch/components/DropDown/assets/value.svg +23 -0
  17. package/lib/AggregateSearch/components/DropDown/index.js +556 -0
  18. package/lib/AggregateSearch/components/DropDown/index.less +102 -0
  19. package/lib/AggregateSearch/components/SwitchBtn/assets/tag-icon.svg +17 -0
  20. package/lib/AggregateSearch/components/SwitchBtn/assets/text-icon.svg +18 -0
  21. package/lib/AggregateSearch/components/SwitchBtn/index.js +24 -0
  22. package/lib/AggregateSearch/components/SwitchBtn/index.less +15 -0
  23. package/lib/AggregateSearch/hooks/useDropDown.js +399 -0
  24. package/lib/AggregateSearch/index.js +350 -0
  25. package/lib/AggregateSearch/index.less +123 -0
  26. package/lib/AggregateSearch/utils/index.js +362 -0
  27. package/lib/PropertyControlViewer/assets/doSelect.less +1 -1
  28. package/lib/PropertyControlViewer/assets/index.less +3 -3
  29. package/lib/PropertyControlViewer/components/DoCiUnitBitmap.js +1 -1
  30. package/lib/PropertyControlViewer/components/DoDefaultPlaceholder.js +1 -1
  31. package/lib/PropertyControlViewer/components/DoUser.js +22 -4
  32. package/lib/PropertyControlViewer/components/TagShowMoreList/index.js +1 -1
  33. package/lib/PropertyControlViewer/config/utils.js +8 -6
  34. package/lib/PropertyControlViewer/index.js +77 -76
  35. package/lib/PropertyControlViewer/index.less +30 -0
  36. package/lib/index.js +2 -1
  37. package/lib/locale/en_US.js +9 -0
  38. package/lib/locale/index.js +12 -0
  39. package/lib/locale/zh_CN.js +9 -0
  40. package/package.json +5 -3
@@ -0,0 +1,362 @@
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
+ 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."); }
4
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
6
+ 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; } }
7
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
10
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
11
+ import makeTokenizeFn from "../CLSPL/makeTokenizeFn";
12
+ import MyGrammarLexer from "../CLSPL/CLQLLexer.js";
13
+ import { TOKEN_TYPES } from "../CLSPL/token";
14
+ import SPLCheck from "../CLSPL/index";
15
+ import classNames from "classnames";
16
+ import { v4 as uid } from 'uuid';
17
+ export var parseStringToToken = function parseStringToToken(value) {
18
+ var TOKEN_MAPPING = new Map([[MyGrammarLexer.COLON, TOKEN_TYPES.MATCH],
19
+ // 冒号
20
+ [MyGrammarLexer.LPAREN, TOKEN_TYPES.IDENTIFIER],
21
+ // 左括号
22
+ [MyGrammarLexer.RPAREN, TOKEN_TYPES.IDENTIFIER],
23
+ // 右括号
24
+ [MyGrammarLexer.LT, TOKEN_TYPES.MATCH],
25
+ // <
26
+ [MyGrammarLexer.GT, TOKEN_TYPES.MATCH],
27
+ // >
28
+ [MyGrammarLexer.LE, TOKEN_TYPES.MATCH],
29
+ // <=
30
+ [MyGrammarLexer.GE, TOKEN_TYPES.MATCH],
31
+ // >=
32
+ [MyGrammarLexer.QUESTION, TOKEN_TYPES.IDENTIFIER],
33
+ // ?
34
+ [MyGrammarLexer.STAR, TOKEN_TYPES.IDENTIFIER],
35
+ // *
36
+ [MyGrammarLexer.LBRAKET, TOKEN_TYPES.IDENTIFIER],
37
+ // [
38
+ [MyGrammarLexer.RBRAKET, TOKEN_TYPES.IDENTIFIER],
39
+ // ]
40
+ [MyGrammarLexer.LCURLY, TOKEN_TYPES.IDENTIFIER],
41
+ // {
42
+ [MyGrammarLexer.RCURLY, TOKEN_TYPES.IDENTIFIER],
43
+ // }
44
+ [MyGrammarLexer.WAVE, TOKEN_TYPES.IDENTIFIER],
45
+ // ~
46
+ [MyGrammarLexer.PLUS, TOKEN_TYPES.IDENTIFIER],
47
+ // +
48
+ [MyGrammarLexer.MINUS, TOKEN_TYPES.IDENTIFIER],
49
+ // -
50
+ [MyGrammarLexer.K_AND, TOKEN_TYPES.KEYWORD],
51
+ // 关键字 AND
52
+ [MyGrammarLexer.K_OR, TOKEN_TYPES.KEYWORD],
53
+ // 关键字 OR
54
+ [MyGrammarLexer.K_NOT, TOKEN_TYPES.KEYWORD],
55
+ // 关键字 NOT
56
+ [MyGrammarLexer.K_TO, TOKEN_TYPES.KEYWORD] // 关键字 TO
57
+ ]);
58
+
59
+ var tokenize = makeTokenizeFn(MyGrammarLexer, TOKEN_MAPPING);
60
+ return tokenize(value);
61
+ };
62
+
63
+ // 语法检测
64
+ export var checkSyntax = function checkSyntax(value) {
65
+ return new Promise(function (resolve) {
66
+ new SPLCheck({
67
+ spl: value || ""
68
+ }).resolving(function (result) {
69
+ if ((result === null || result === void 0 ? void 0 : result.type) === "error") {
70
+ resolve(result);
71
+ } else {
72
+ resolve("");
73
+ }
74
+ });
75
+ });
76
+ };
77
+
78
+ // 以空格分隔内容,但是不包括()内和NOT后的空格
79
+ var splitBySpace = function splitBySpace(str) {
80
+ var res = [];
81
+ var temp = "";
82
+ var isBracket = false;
83
+ for (var i = 0; i < str.length; i++) {
84
+ var _char = str[i];
85
+ // 检测当前字符与前面的字符拼接是否为 "NOT "
86
+ var isNot = "".concat(temp).concat(_char).toUpperCase() === "NOT ";
87
+ if (["("].includes(_char)) {
88
+ isBracket = true;
89
+ }
90
+ if ([")"].includes(_char)) {
91
+ isBracket = false;
92
+ }
93
+ if (_char === " " && !isBracket && !isNot) {
94
+ res.push(temp);
95
+ // '1 2 3 4' ==> ['1', ' ', '3', ' ', '4']
96
+ res.push(" ");
97
+ temp = "";
98
+ } else {
99
+ temp += _char;
100
+ }
101
+ }
102
+ if (temp) {
103
+ res.push(temp);
104
+ }
105
+ return res;
106
+ };
107
+
108
+ // 按token结果生成html
109
+ export var genHtmlAndSyntaxCheckResByString = function genHtmlAndSyntaxCheckResByString(originalStr) {
110
+ var tags = splitBySpace(originalStr.endsWith(" ") ? originalStr : originalStr + " ");
111
+ var htmlString = tags.map(function (inputString) {
112
+ var html = "";
113
+ var tagId = "";
114
+ if (!inputString.trim()) {
115
+ html = inputString;
116
+ } else {
117
+ tagId = uid();
118
+ var tokenList = parseStringToToken(inputString);
119
+ var matchIndex = tokenList.findIndex(function (item) {
120
+ return item.type === TOKEN_TYPES.MATCH;
121
+ });
122
+ var hasMatch = matchIndex !== -1;
123
+ html = tokenList.map(function (token, index) {
124
+ var genClassName = function genClassName(typeClass) {
125
+ var _classNames;
126
+ return classNames((_classNames = {
127
+ "tag-con": true
128
+ }, _defineProperty(_classNames, typeClass, true), _defineProperty(_classNames, "tag-con-key", hasMatch ? index < matchIndex : false), _defineProperty(_classNames, "tag-con-key-last", matchIndex ? index === matchIndex - 1 : false), _defineProperty(_classNames, "tag-con-value", hasMatch ? index > matchIndex : false), _classNames));
129
+ };
130
+ var genDataType = function genDataType(index) {
131
+ if (hasMatch) {
132
+ if (index < matchIndex) {
133
+ return "key";
134
+ }
135
+ if (index === matchIndex) {
136
+ return "match";
137
+ }
138
+ return "value";
139
+ }
140
+ return "key";
141
+ };
142
+ var dataType = genDataType(index);
143
+ var getEleProps = function getEleProps(type) {
144
+ var _typeMap;
145
+ var typeMap = (_typeMap = {}, _defineProperty(_typeMap, TOKEN_TYPES.MATCH, {
146
+ tagName: "span",
147
+ props: {
148
+ "class": genClassName("tag-con-match"),
149
+ "data-attr": "match",
150
+ "data-type": dataType
151
+ }
152
+ }), _defineProperty(_typeMap, TOKEN_TYPES.KEYWORD, {
153
+ tagName: "span",
154
+ props: {
155
+ "class": genClassName("tag-con-keyword"),
156
+ "data-attr": "keyword",
157
+ "data-type": dataType
158
+ }
159
+ }), _defineProperty(_typeMap, TOKEN_TYPES.IDENTIFIER, {
160
+ tagName: "span",
161
+ props: {
162
+ "class": genClassName("tag-con-identifier"),
163
+ "data-attr": "identifier",
164
+ "data-type": dataType
165
+ }
166
+ }), _defineProperty(_typeMap, TOKEN_TYPES.NONE, {
167
+ tagName: "span",
168
+ props: {
169
+ "class": genClassName("tag-con-none"),
170
+ "data-attr": "none",
171
+ "data-type": dataType
172
+ }
173
+ }), _typeMap);
174
+ return typeMap[type];
175
+ };
176
+ var type = token.type,
177
+ text = token.text;
178
+ var curProps = getEleProps(type);
179
+ var elePropsString = Object.entries(curProps.props).map(function (_ref) {
180
+ var _ref2 = _slicedToArray(_ref, 2),
181
+ key = _ref2[0],
182
+ value = _ref2[1];
183
+ return "".concat(key, "=\"").concat(value, "\"");
184
+ }).join(" ");
185
+ return "<".concat(curProps.tagName, " ").concat(elePropsString, ">").concat(text, "</").concat(curProps.tagName, ">");
186
+ }).join("");
187
+ }
188
+ if (!html.trim()) {
189
+ return html;
190
+ }
191
+ return "<span class=\"tag-box\" data-attr=\"tag-box\" id=\"".concat(tagId, "\">").concat(html, "</span>");
192
+ }).join("");
193
+ return htmlString;
194
+ };
195
+
196
+ // 获取光标所在节点
197
+ export var getCurrentNode = function getCurrentNode() {
198
+ var selection = window.getSelection();
199
+ var range = selection.getRangeAt(0);
200
+ var currentNode = range.endContainer;
201
+ // 光标记录的大多数情况下是文本节点,需要获取父节点作为当前节点
202
+ if (currentNode.nodeType === 3) {
203
+ return currentNode.parentNode;
204
+ }
205
+ return currentNode;
206
+ };
207
+
208
+ // 获取当前光标所在的tag
209
+ export var getCurrentTag = function getCurrentTag() {
210
+ var _currentNode$dataset, _currentNode$parentEl;
211
+ var currentNode = getCurrentNode();
212
+ var curTag;
213
+ var type = currentNode === null || currentNode === void 0 || (_currentNode$dataset = currentNode.dataset) === null || _currentNode$dataset === void 0 ? void 0 : _currentNode$dataset["attr"];
214
+ var parentType = (_currentNode$parentEl = currentNode.parentElement) === null || _currentNode$parentEl === void 0 || (_currentNode$parentEl = _currentNode$parentEl.dataset) === null || _currentNode$parentEl === void 0 ? void 0 : _currentNode$parentEl["attr"];
215
+ if (type === "tag-box") {
216
+ curTag = currentNode;
217
+ }
218
+ if (parentType === "tag-box") {
219
+ curTag = currentNode.parentElement;
220
+ }
221
+ return curTag;
222
+ };
223
+
224
+ // 删除当前内容
225
+ export var deleteCurrentContent = function deleteCurrentContent() {
226
+ var _anchorNode$parentEle;
227
+ var selection = window.getSelection();
228
+ var anchorNode = selection.anchorNode;
229
+ if (((_anchorNode$parentEle = anchorNode.parentElement.dataset) === null || _anchorNode$parentEle === void 0 ? void 0 : _anchorNode$parentEle["attr"]) !== "container") {
230
+ // FIXED 自动创建span标签导致的问题
231
+ anchorNode = anchorNode.parentElement;
232
+ container.current.removeChild(anchorNode);
233
+ } else {
234
+ var con = anchorNode.data;
235
+ // tags间保留空格,处理光标不能插入tags间的问题
236
+ var offset = con.startsWith("\xA0") ? 1 : 0;
237
+ var selRange = selection.getRangeAt(0);
238
+ selRange.setStart(anchorNode, offset);
239
+ selRange.setEndAfter(anchorNode);
240
+ selRange.deleteContents();
241
+ }
242
+ };
243
+
244
+ // 光标位置插入节点
245
+ export var insertRang = function insertRang(node) {
246
+ var selection = window.getSelection();
247
+ var selRange = selection.getRangeAt(0);
248
+ selRange.insertNode(node);
249
+ };
250
+
251
+ // 粘贴去除格式
252
+ export function textInit(e) {
253
+ // cancel paste
254
+ e.preventDefault();
255
+ // get text representation of clipboard
256
+ var text = (e.originalEvent || e).clipboardData.getData("text/plain");
257
+ // insert text manually
258
+ document.execCommand("insertHTML", false, text);
259
+ }
260
+
261
+ // 获取当前输入的光标位置(纯文本模式)
262
+ export var getCursorPosition = function getCursorPosition(node) {
263
+ var _endContainer$dataset;
264
+ var selection = window.getSelection();
265
+ if (selection.type !== 'Caret') {
266
+ return null;
267
+ }
268
+ var range = selection.getRangeAt(0);
269
+ var endContainer = range.endContainer;
270
+ if (((_endContainer$dataset = endContainer.dataset) === null || _endContainer$dataset === void 0 ? void 0 : _endContainer$dataset['attr']) === 'container') {
271
+ return 0;
272
+ }
273
+
274
+ // 计算纯文本模式下,当前光标所处的位置
275
+ var positionIndex = 0;
276
+ var isBreak = false;
277
+ var loop = function loop(node) {
278
+ var nodes = node.childNodes;
279
+ for (var index = 0; index < nodes.length; index++) {
280
+ if (isBreak) {
281
+ break;
282
+ }
283
+ var element = nodes[index];
284
+ if (element.nodeType === 3) {
285
+ if (element === endContainer) {
286
+ positionIndex += range.endOffset;
287
+ isBreak = true;
288
+ break;
289
+ } else {
290
+ positionIndex += element.data.length;
291
+ }
292
+ } else {
293
+ loop(element);
294
+ }
295
+ }
296
+ };
297
+ loop(node);
298
+ return positionIndex;
299
+ };
300
+
301
+ // 根据纯文本模式下的光标位置,设置html模式下的光标位置
302
+ export var getCursorNodeAndIndex = function getCursorNodeAndIndex(node, positionIndex) {
303
+ var targetNode;
304
+ var targetIndex;
305
+ var sum = 0;
306
+ var isBreak = false;
307
+ var loop = function loop(node) {
308
+ var nodes = node.childNodes;
309
+ for (var index = 0; index < nodes.length; index++) {
310
+ if (isBreak) {
311
+ break;
312
+ }
313
+ var element = nodes[index];
314
+ if (element.nodeType === 3) {
315
+ var _element$data;
316
+ var elementLength = ((_element$data = element.data) === null || _element$data === void 0 ? void 0 : _element$data.length) || 0;
317
+ if (sum <= positionIndex && sum + elementLength >= positionIndex) {
318
+ targetNode = element;
319
+ targetIndex = positionIndex - sum;
320
+ isBreak = true;
321
+ break;
322
+ } else {
323
+ sum += elementLength;
324
+ }
325
+ } else {
326
+ loop(element);
327
+ }
328
+ }
329
+ };
330
+ loop(node);
331
+ return {
332
+ targetNode: targetNode,
333
+ targetIndex: targetIndex
334
+ };
335
+ };
336
+
337
+ // 光标跳转到指定位置
338
+ export var setCursorPosition = function setCursorPosition(targetNode, targetIndex) {
339
+ if (!targetNode) {
340
+ return;
341
+ }
342
+ var selection = window.getSelection();
343
+ var range = new Range();
344
+ range.setStart(targetNode, targetIndex);
345
+ range.collapse(true);
346
+ selection.removeAllRanges();
347
+ selection.addRange(range);
348
+ };
349
+ export function isObjectEqual(obj1, obj2) {
350
+ var obj1Keys = Object.keys(obj1);
351
+ var obj2Keys = Object.keys(obj2);
352
+ if (obj1Keys.length !== obj2Keys.length) {
353
+ return false;
354
+ }
355
+ for (var _i = 0, _obj1Keys = obj1Keys; _i < _obj1Keys.length; _i++) {
356
+ var key = _obj1Keys[_i];
357
+ if (obj1[key] !== obj2[key]) {
358
+ return false;
359
+ }
360
+ }
361
+ return true;
362
+ }
@@ -3,7 +3,7 @@
3
3
  height: 28px;
4
4
  font-size: 12px;
5
5
  display: flex;
6
- align-items: center;
6
+ // align-items: center;
7
7
  // margin-left: -6px;
8
8
 
9
9
  .wrapper-inner {
@@ -2,11 +2,11 @@
2
2
  width: 100%;
3
3
  display: flex;
4
4
  flex-wrap: wrap;
5
- line-height: 28px;
5
+ // line-height: 28px;
6
6
 
7
7
  .ci-detail-user-item {
8
8
  display: flex;
9
- align-items: center;
9
+ // align-items: center;
10
10
  }
11
11
 
12
12
  .ci-detail-user-name {
@@ -33,7 +33,7 @@
33
33
  display: inline-block;
34
34
  height: 25px;
35
35
  padding: 0 5px;
36
- line-height: 25px;
36
+ // line-height: 25px;
37
37
  border-radius: 10px;
38
38
  margin-right: 5px;
39
39
  }
@@ -46,6 +46,6 @@ var DoUnitBitmap = function DoUnitBitmap(_ref) {
46
46
  key: item.index,
47
47
  className: classnames('lattice', (_classnames2 = {}, _defineProperty(_classnames2, 'locked_lattice', item.status === 1), _defineProperty(_classnames2, 'usaged_lattice', item.status === 2), _classnames2))
48
48
  }, item.index));
49
- })) : '--');
49
+ })) : '-');
50
50
  };
51
51
  export default DoUnitBitmap;
@@ -4,6 +4,6 @@ var DoDefaultPlaceholder = function DoDefaultPlaceholder() {
4
4
  style: {
5
5
  marginLeft: "2px"
6
6
  }
7
- }, "--");
7
+ }, "-");
8
8
  };
9
9
  export default DoDefaultPlaceholder;
@@ -1,8 +1,10 @@
1
1
  import _Tooltip from "@chaoswise/ui/lib/Tooltip";
2
2
  import _Avatar from "@chaoswise/ui/lib/Antd/Avatar";
3
+ import _ConfigProvider from "@chaoswise/ui/lib/ConfigProvider";
3
4
  import React, { Fragment } from 'react';
4
5
  import '../assets/index.less';
5
6
  import TagShowMoreList from './TagShowMoreList';
7
+ import { getLocale } from "../../locale";
6
8
  var DoUser = function DoUser(_ref) {
7
9
  var data = _ref.data;
8
10
  var belongComponentType = data.belongComponentType,
@@ -10,13 +12,29 @@ var DoUser = function DoUser(_ref) {
10
12
  tooltipContent = data.tooltipContent,
11
13
  list = data.list,
12
14
  componentType = data.componentType;
15
+ var _ConfigProvider$useLo = _ConfigProvider.useLocale(),
16
+ _ConfigProvider$useLo2 = _ConfigProvider$useLo.locale,
17
+ locale = _ConfigProvider$useLo2 === void 0 ? "zh" : _ConfigProvider$useLo2;
18
+ var localeObj = getLocale(locale);
19
+ var userTooltip = {
20
+ userName: localeObj.name + ":",
21
+ userAlias: localeObj.userName + ":",
22
+ department: localeObj.department + ":",
23
+ email: localeObj.emil + ":",
24
+ mobile: localeObj.mobile + ":"
25
+ };
26
+ var userGroupTooltip = {
27
+ groupName: localeObj.groupName + ":",
28
+ groupDetails: localeObj.groupDetails + ":"
29
+ };
30
+ tooltipContent = componentType === "USER_GROUP" ? userGroupTooltip : userTooltip;
13
31
  var gridShare = belongComponentType === "TABLE" ? '100%' : fieldWidth == 'WHOLE_LINE' ? '25%' : '50%';
14
32
  var tooltipContentFuc = function tooltipContentFuc(item) {
15
33
  return Object.keys(tooltipContent).map(function (key) {
16
34
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, tooltipContent[key], " ", item[key] || "", " "), /*#__PURE__*/React.createElement("br", null));
17
35
  });
18
36
  };
19
- var nameKey = componentType === "USER_GROUP" ? 'groupName' : 'userName';
37
+ var nameKey = componentType === "USER_GROUP" ? 'groupName' : 'userAlias';
20
38
  return /*#__PURE__*/React.createElement(Fragment, null, belongComponentType === "TABLE" ? /*#__PURE__*/React.createElement(TagShowMoreList, {
21
39
  text: list,
22
40
  tagCount: 1,
@@ -26,7 +44,7 @@ var DoUser = function DoUser(_ref) {
26
44
  }) : /*#__PURE__*/React.createElement("div", {
27
45
  className: 'ci-detail-user'
28
46
  }, (list || []).map(function (item) {
29
- var _item$name;
47
+ var _item$userAlias;
30
48
  return /*#__PURE__*/React.createElement(_Tooltip, {
31
49
  placement: "topLeft",
32
50
  title: tooltipContentFuc(item),
@@ -39,9 +57,9 @@ var DoUser = function DoUser(_ref) {
39
57
  }, /*#__PURE__*/React.createElement(_Avatar, {
40
58
  className: 'ci-detail-avatar',
41
59
  size: "small"
42
- }, (_item$name = item.name) === null || _item$name === void 0 ? void 0 : _item$name.substring(0, 1)), /*#__PURE__*/React.createElement("div", {
60
+ }, (_item$userAlias = item.userAlias) === null || _item$userAlias === void 0 ? void 0 : _item$userAlias.substring(0, 1)), /*#__PURE__*/React.createElement("div", {
43
61
  className: 'ci-detail-user-name'
44
- }, item.name)));
62
+ }, item.userAlias)));
45
63
  })));
46
64
  };
47
65
  export default DoUser;
@@ -89,7 +89,7 @@ var TagShowMoreList = function TagShowMoreList(props) {
89
89
  },
90
90
  type: item.iconPath || 'icon-1'
91
91
  })
92
- }), _name || '--')));
92
+ }), _name || '-')));
93
93
  });
94
94
  };
95
95
  var renderItem = function renderItem() {
@@ -7,19 +7,20 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
7
7
  import moment from 'moment';
8
8
  import React from 'react';
9
9
  import { ATTR_DES_ENUM, DATE_FORMATE_ENUM } from './constants';
10
+ import { intl } from '@chaoswise/intl';
10
11
 
11
12
  //根据属性类型获取对应的组件
12
13
  export var getDescriptionComp = function getDescriptionComp(type) {
13
14
  if (ATTR_DES_ENUM[type]) {
14
15
  return ATTR_DES_ENUM[type].generate_comp;
15
16
  }
16
- return /*#__PURE__*/React.createElement("span", null, "\u6682\u672A\u6CE8\u518C\u7EC4\u4EF6");
17
+ return /*#__PURE__*/React.createElement("span", null, intl.get('fc7ca498-ab95-4a4b-9f5f-0d024cc127c3').d('暂未注册组件'));
17
18
  };
18
19
 
19
20
  // 时间格式化
20
21
  export var dateFormatFunc = function dateFormatFunc(timestamp) {
21
22
  var fmt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'YYYY-MM-DD HH:mm:ss';
22
- return timestamp ? moment(timestamp).format(fmt) : '--';
23
+ return timestamp ? moment(timestamp).format(fmt) : '-';
23
24
  };
24
25
 
25
26
  // 判断是否浅色
@@ -133,8 +134,10 @@ export var judgmentTypeFunc = function judgmentTypeFunc(type, value) {
133
134
  break;
134
135
  case "UNIT_BITMAP":
135
136
  judgmentType = Object.prototype.toString.call(value) === "[object Object]";
137
+ break;
136
138
  default:
137
139
  judgmentType = true;
140
+ break;
138
141
  }
139
142
  return judgmentType;
140
143
  };
@@ -164,7 +167,7 @@ export var getDataFunc = function getDataFunc(value, item, rest) {
164
167
  expandable: true
165
168
  },
166
169
  list: [{
167
- value: value ? unit ? value + " " + unit : value : '--'
170
+ value: unit ? value + " " + unit : value
168
171
  }]
169
172
  };
170
173
  break;
@@ -173,7 +176,7 @@ export var getDataFunc = function getDataFunc(value, item, rest) {
173
176
  case "AUTO_CALCULATE":
174
177
  data = {
175
178
  list: [{
176
- value: value ? unit ? value + " " + unit : value : '--'
179
+ value: !(value === undefined || value === null || value === '') ? unit ? value + " " + unit : value : '-'
177
180
  }]
178
181
  };
179
182
  break;
@@ -230,7 +233,7 @@ export var getDataFunc = function getDataFunc(value, item, rest) {
230
233
  case "NUMBER_RANGE":
231
234
  data = {
232
235
  list: [{
233
- value: value ? unit ? (value === null || value === void 0 ? void 0 : value.join(" - ")) + ' ' + unit : value === null || value === void 0 ? void 0 : value.join(" - ") : '--'
236
+ value: value ? unit ? (value === null || value === void 0 ? void 0 : value.join(" - ")) + ' ' + unit : value === null || value === void 0 ? void 0 : value.join(" - ") : '-'
234
237
  }]
235
238
  };
236
239
  break;
@@ -257,7 +260,6 @@ export var getDataFunc = function getDataFunc(value, item, rest) {
257
260
  email: "邮箱:",
258
261
  mobile: "手机:"
259
262
  };
260
- console.log(value, 'value]]]]]]');
261
263
  data = {
262
264
  fieldWidth: fieldWidth,
263
265
  tooltipContent: userTooltipContent || userTooltip,