@chaoswise/business 0.0.5 → 0.0.6

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.
@@ -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,6 +12,22 @@ 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) {
@@ -133,8 +133,10 @@ export var judgmentTypeFunc = function judgmentTypeFunc(type, value) {
133
133
  break;
134
134
  case "UNIT_BITMAP":
135
135
  judgmentType = Object.prototype.toString.call(value) === "[object Object]";
136
+ break;
136
137
  default:
137
138
  judgmentType = true;
139
+ break;
138
140
  }
139
141
  return judgmentType;
140
142
  };
@@ -164,7 +166,7 @@ export var getDataFunc = function getDataFunc(value, item, rest) {
164
166
  expandable: true
165
167
  },
166
168
  list: [{
167
- value: value ? unit ? value + " " + unit : value : '--'
169
+ value: unit ? value + " " + unit : value
168
170
  }]
169
171
  };
170
172
  break;
@@ -173,7 +175,7 @@ export var getDataFunc = function getDataFunc(value, item, rest) {
173
175
  case "AUTO_CALCULATE":
174
176
  data = {
175
177
  list: [{
176
- value: value ? unit ? value + " " + unit : value : '--'
178
+ value: !(value === undefined || value === null || value === '') ? unit ? value + " " + unit : value : '--'
177
179
  }]
178
180
  };
179
181
  break;
@@ -257,7 +259,6 @@ export var getDataFunc = function getDataFunc(value, item, rest) {
257
259
  email: "邮箱:",
258
260
  mobile: "手机:"
259
261
  };
260
- console.log(value, 'value]]]]]]');
261
262
  data = {
262
263
  fieldWidth: fieldWidth,
263
264
  tooltipContent: userTooltipContent || userTooltip,
@@ -0,0 +1,9 @@
1
+ export default {
2
+ name: 'Name',
3
+ userName: 'Username',
4
+ department: 'Department',
5
+ emil: 'Email',
6
+ mobile: "Phone",
7
+ groupName: 'User group',
8
+ groupDetails: 'Description'
9
+ };
@@ -0,0 +1,12 @@
1
+ import zhCN from './zh_CN.js';
2
+ import enUS from './en_US.js';
3
+ export var getLocale = function getLocale(locale) {
4
+ switch (locale) {
5
+ case 'zh':
6
+ return zhCN;
7
+ case 'en':
8
+ return enUS;
9
+ default:
10
+ return zhCN;
11
+ }
12
+ };
@@ -0,0 +1,9 @@
1
+ export default {
2
+ name: '姓名',
3
+ userName: '用户名',
4
+ department: '部门',
5
+ emil: '邮箱',
6
+ mobile: "手机",
7
+ groupName: '用户组',
8
+ groupDetails: '描述'
9
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chaoswise/business",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "业务组件库",
5
5
  "keywords": [
6
6
  "ui",
@@ -102,5 +102,5 @@
102
102
  "access": "public"
103
103
  },
104
104
  "license": "MIT",
105
- "gitHead": "780a8854dd697d36c4d9b7d83fd45cf7aabf082e"
105
+ "gitHead": "e5466e86469163cd6a3964a7e03684ab71c5c20f"
106
106
  }