@lambo-design/shared 1.0.0-beta.82 → 1.0.0-beta.84

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.
@@ -90,7 +90,7 @@ export default {
90
90
  --table-td-hover-bg: #ebf7ff;
91
91
  --table-td-highlight-bg: #ebf7ff;
92
92
  --menu-dark-title: #333333;
93
- --menu-dark-active-bg: #363e4f;
93
+ --menu-dark-active-bg:fade(#000, 85%);
94
94
  --menu-dark-subsidiary-color: rgba(255, 255, 255, 0.7);
95
95
  --menu-dark-group-title-color: rgba(255, 255, 255, 0.36);
96
96
  --date-picker-cell-hover-bg: #e1f0fe;
@@ -1,9 +1,9 @@
1
1
  export default {
2
2
  key: "eap",
3
3
  title: "深邃蓝",
4
- primaryColor: "#0091FF",
4
+ primaryColor: "#306BE3",
5
5
  vars: `
6
- --primary-color: #0091FF;
6
+ --primary-color: #306BE3;
7
7
  --primary-color-tint-20: #33a7ff;
8
8
  --primary-color-tint-90: #e6f4ff;
9
9
  --primary-color-tint-80: #cce9ff;
@@ -89,18 +89,26 @@ export default {
89
89
  --table-td-stripe-bg: #f2fafe;
90
90
  --table-td-hover-bg: #eaf4fe;
91
91
  --table-td-highlight-bg: #b5def3;
92
- --menu-dark-title: #333333;
93
- --menu-dark-active-bg: #363e4f;
92
+ --menu-dark-title: #306BE3;
93
+ --menu-dark-item-active-bg: #02234C; /* 激活的一级菜单项 */
94
+ --menu-dark-submenu-bg: #0E356E; /* 二级菜单项 */
95
+ --menu-dark-item-selected-bg: rgb(2, 35, 76); /* 选中的内部菜单项 */
96
+ --menu-dark-bg:rgb(0, 44, 107);
97
+ --menu-dark-active-bg: rgb(0, 44, 107);
94
98
  --menu-dark-subsidiary-color: rgba(255, 255, 255, 0.7);
95
99
  --menu-dark-group-title-color: rgba(255, 255, 255, 0.36);
100
+ --selected-menu-item-bg: rgb(61, 123, 246);
101
+ --selected-submenu-bg: rgb(14, 53, 110);
102
+ --selected-innermost-bg: rgb(2, 35, 76);
103
+ --menu-item-hover-bg: darken(@menu-dark-bg, 5%);
96
104
  --date-picker-cell-hover-bg: #e1f0fe;
97
- --shadow-color: rgba(0, 0, 0, 0.2);
98
- --shadow-base: 0 1px 6px rgba(0, 0, 0, 0.2);
99
- --shadow-card: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
100
- --shadow-up: 0 -1px 6px rgba(0, 0, 0, 0.2);
101
- --shadow-down: 0 1px 6px rgba(0, 0, 0, 0.2);
102
- --shadow-left: -1px 0 6px rgba(0, 0, 0, 0.2);
103
- --shadow-right: 1px 0 6px rgba(0, 0, 0, 0.2);
105
+ --shadow-color: rgb(2, 35, 76);
106
+ --shadow-base: 0 1px 6px rgb(2, 35, 76);
107
+ --shadow-card: 0 1px 1px 0 rgb(14, 53, 110);
108
+ --shadow-up: 0 -1px 6px rgb(2, 35, 76);
109
+ --shadow-down: 0 1px 6px rgb(2, 35, 76);
110
+ --shadow-left: -1px 0 6px rgb(2, 35, 76);
111
+ --shadow-right: 1px 0 6px rgb(2, 35, 76);
104
112
  --btn-height-base: 26px;
105
113
  --btn-height-large: 32px;
106
114
  --btn-height-small: 20px;
@@ -155,12 +163,13 @@ export default {
155
163
  --grid-columns: 24;
156
164
  --grid-gutter-width: 0;
157
165
  --layout-body-background: #f5f7f9;
158
- --layout-header-background: #333333;
166
+ --layout-header-background: #306BE3;
159
167
  --layout-header-height: 64px;
168
+ --layout-header-selected-background: #306BE3;
160
169
  --layout-header-padding: 0 50px;
161
170
  --layout-footer-padding: 24px 50px;
162
171
  --layout-footer-background: #f5f7f9;
163
- --layout-sider-background: #333333;
172
+ --layout-sider-background: #002C6B;
164
173
  --layout-sider-background-tint-10: #474747;
165
174
  --layout-trigger-height: 48px;
166
175
  --layout-trigger-color: #fff;
@@ -374,7 +383,7 @@ export default {
374
383
  --vxe-table-checkbox-range-border-width: 1px;
375
384
  --vxe-table-checkbox-range-border-color: #006af1;
376
385
  --vxe-table-checkbox-range-background-color: rgba(50, 128, 252, 0.2);
377
- --vxe-table-fixed-left-scrolling-box-shadow: 8px 0px 10px -5px rgba(0, 0, 0, 0.12);
386
+ --vxe-table-fixed-left-scrolling-box-shadow: 8px 0px 10px -5px rgb(14, 53, 110);
378
387
  --vxe-table-fixed-right-scrolling-box-shadow: -8px 0px 10px -5px rgba(0, 0, 0, 0.12);
379
388
  /*filter*/
380
389
  --vxe-table-filter-panel-background-color: #fff;
@@ -512,4 +521,5 @@ export default {
512
521
  margin:0;
513
522
  }
514
523
  `
524
+
515
525
  };
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
- {
2
- "name": "@lambo-design/shared",
3
- "version": "1.0.0-beta.82",
4
- "description": "",
5
- "main": "index.js",
6
- "author": "lambo",
7
- "license": "ISC",
8
- "publishConfig": {
9
- "access": "public",
10
- "registry": "https://registry.npmjs.org/"
11
- },
12
- "dependencies": {
13
- "axios": "^0.24.0",
14
- "axios-cache-plugin": "^0.1.0",
15
- "classnames": "^2.3.1",
16
- "css-vars-ponyfill": "^2.4.8",
17
- "moment": "2.29.4",
18
- "qs": "^6.11.0",
19
- "xlsx": "http://cicd.lambo.top/package/cdn/xlsx-0.19.1.tgz",
20
- "xlsx-style": "^0.8.13"
21
- },
22
- "scripts": {}
23
- }
1
+ {
2
+ "name": "@lambo-design/shared",
3
+ "version": "1.0.0-beta.84",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {},
7
+ "author": "lambo",
8
+ "license": "ISC",
9
+ "publishConfig": {
10
+ "access": "public",
11
+ "registry": "https://registry.npmjs.org/"
12
+ },
13
+ "dependencies": {
14
+ "axios": "^0.24.0",
15
+ "axios-cache-plugin": "^0.1.0",
16
+ "classnames": "^2.3.1",
17
+ "css-vars-ponyfill": "^2.4.8",
18
+ "moment": "2.29.4",
19
+ "qs": "^6.11.0",
20
+ "xlsx": "http://cicd.lambo.top/package/cdn/xlsx-0.19.1.tgz",
21
+ "xlsx-style": "^0.8.13"
22
+ }
23
+ }
package/utils/assist.js CHANGED
@@ -116,3 +116,134 @@ export function isJson(arg) {
116
116
  export function isObject(item) {
117
117
  return (item && typeof item === 'object' && !Array.isArray(item));
118
118
  }
119
+
120
+
121
+ export const checkPhone = function (str) {
122
+ var reg = /^1[3456789]\d{9}$/
123
+ // ^1 以1开头
124
+ // [3456789] 第2位,使用原子表里的任意一个原子都可以
125
+ // \d{9}$ 第三位 朝后可以是任意数字 并且最后结尾必须是数字
126
+ if (reg.test(str)) {
127
+ return true
128
+ } else {
129
+ return false
130
+ }
131
+ }
132
+
133
+ export function checkIdCard(idcard) {
134
+ let Errors = new Array(
135
+ '验证通过!',
136
+ '身份证号码位数不对!',
137
+ '身份证号码出生日期超出范围或含有非法字符!',
138
+ '身份证号码校验错误!',
139
+ '身份证地区非法!',
140
+ )
141
+ let area = {
142
+ 11: '北京',
143
+ 12: '天津',
144
+ 13: '河北',
145
+ 14: '山西',
146
+ 15: '内蒙古',
147
+ 21: '辽宁',
148
+ 22: '吉林',
149
+ 23: '黑龙江',
150
+ 31: '上海',
151
+ 32: '江苏',
152
+ 33: '浙江',
153
+ 34: '安徽',
154
+ 35: '福建',
155
+ 36: '江西',
156
+ 37: '山东',
157
+ 41: '河南',
158
+ 42: '湖北',
159
+ 43: '湖南',
160
+ 44: '广东',
161
+ 45: '广西',
162
+ 46: '海南',
163
+ 50: '重庆',
164
+ 51: '四川',
165
+ 52: '贵州',
166
+ 53: '云南',
167
+ 54: '西藏',
168
+ 61: '陕西',
169
+ 62: '甘肃',
170
+ 63: '青海',
171
+ 64: '宁夏',
172
+ 65: '新疆',
173
+ 71: '台湾',
174
+ 81: '香港',
175
+ 82: '澳门',
176
+ 91: '国外',
177
+ }
178
+ let Y, JYM
179
+ let S, M, ereg
180
+ let idcard_array = new Array()
181
+ idcard_array = idcard.split('')
182
+ //地区检验
183
+ if (area[parseInt(idcard.substr(0, 2))] == null) return Errors[4]
184
+ //身份号码位数及格式检验
185
+ switch (idcard.length) {
186
+ case 15:
187
+ if (
188
+ (parseInt(idcard.substr(6, 2)) + 1900) % 4 == 0 ||
189
+ ((parseInt(idcard.substr(6, 2)) + 1900) % 100 == 0 &&
190
+ (parseInt(idcard.substr(6, 2)) + 1900) % 4 == 0)
191
+ ) {
192
+ ereg =
193
+ /^[1-9][0-9]{5}19[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|[1-2][0-9]))[0-9]{3}$/ //测试出生日期的合法性
194
+ } else {
195
+ ereg =
196
+ /^[1-9][0-9]{5}19[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|1[0-9]|2[0-8]))[0-9]{3}$/ //测试出生日期的合法性
197
+ }
198
+ if (ereg.test(idcard)) {
199
+ return Errors[0]
200
+ } else {
201
+ return Errors[2]
202
+ }
203
+ case 18:
204
+ if (
205
+ parseInt(idcard.substr(6, 4)) % 4 == 0 ||
206
+ (parseInt(idcard.substr(6, 4)) % 100 == 0 && parseInt(idcard.substr(6, 4)) % 4 == 0)
207
+ ) {
208
+ ereg =
209
+ /^[1-9][0-9]{5}(19|20)[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|[1-2][0-9]))[0-9]{3}[0-9Xx]$/ //闰年出生日期的合法性正则表达式
210
+ } else {
211
+ ereg =
212
+ /^[1-9][0-9]{5}(19|20)[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|1[0-9]|2[0-8]))[0-9]{3}[0-9Xx]$/ //平年出生日期的合法性正则表达式
213
+ }
214
+ if (ereg.test(idcard)) {
215
+ //测试出生日期的合法性
216
+ //计算校验位
217
+ S =
218
+ (parseInt(idcard_array[0]) + parseInt(idcard_array[10])) * 7 +
219
+ (parseInt(idcard_array[1]) + parseInt(idcard_array[11])) * 9 +
220
+ (parseInt(idcard_array[2]) + parseInt(idcard_array[12])) * 10 +
221
+ (parseInt(idcard_array[3]) + parseInt(idcard_array[13])) * 5 +
222
+ (parseInt(idcard_array[4]) + parseInt(idcard_array[14])) * 8 +
223
+ (parseInt(idcard_array[5]) + parseInt(idcard_array[15])) * 4 +
224
+ (parseInt(idcard_array[6]) + parseInt(idcard_array[16])) * 2 +
225
+ parseInt(idcard_array[7]) * 1 +
226
+ parseInt(idcard_array[8]) * 6 +
227
+ parseInt(idcard_array[9]) * 3
228
+ Y = S % 11
229
+ M = 'F'
230
+ JYM = '10X98765432'
231
+ M = JYM.substr(Y, 1) //判断校验位
232
+ if (M == idcard_array[17]) return Errors[0] //检测ID的校验位
233
+ else return Errors[3]
234
+ } else return Errors[2]
235
+ default:
236
+ return Errors[1]
237
+ }
238
+ }
239
+
240
+ export function getBirthday(a) {
241
+ if (15 == a.length || 18 == a.length) {
242
+ let left = a.length - 12
243
+ let right = a.length - 4
244
+ let b = a.slice(left, right)
245
+ if (8 == b.length) {
246
+ return b.substring(0, 4) + '-' + b.substring(4, 6) + '-' + b.substring(6)
247
+ } else return '1970-01-01' //0;
248
+ } else return '1970-01-01' //1;
249
+ }
package/utils/date.js CHANGED
@@ -351,3 +351,28 @@ export const addMonth = function (startDate, monthDifference) {
351
351
  startDate.getHours(), startDate.getMinutes(), startDate.getSeconds(), startDate.getMilliseconds()
352
352
  );
353
353
  }
354
+
355
+
356
+ export const formatDate = function(value) {
357
+ if (value) {
358
+ switch (value.length) {
359
+ case 14: {
360
+ return moment(value, 'YYYYMMDDHHmmss').format('YYYY-MM-DD HH:mm:ss')
361
+ }
362
+ case 12: {
363
+ return moment(value, 'YYYYMMDDHHmmss').format('YYYY-MM-DD HH:mm')
364
+ }
365
+ case 8: {
366
+ return moment(value, 'YYYYMMDD').format('YYYY-MM-DD')
367
+ }
368
+ case 6: {
369
+ return moment(value, 'YYYYMM').format('YYYY-MM')
370
+ }
371
+ case 4: {
372
+ return value.substring(0, 2) + '-' + value.substring(2, 2)
373
+ }
374
+ }
375
+ } else {
376
+ return '-'
377
+ }
378
+ }
@@ -0,0 +1,20 @@
1
+ export const builtInDictKeys = [
2
+ 'SEX_ENUM',
3
+ 'WHETHER_ENUM'
4
+ ]
5
+
6
+ export const builtInDictMap = {
7
+ 'SEX_ENUM' : { '0': '女', '1': '男' },
8
+ 'WHETHER_ENUM' : { '0': '否', '1': '是' }
9
+ }
10
+
11
+ export const builtInDictList = {
12
+ 'SEX_ENUM' : [
13
+ { K: '0', V: '女' },
14
+ { K: '1', V: '男' },
15
+ ],
16
+ 'WHETHER_ENUM' : [
17
+ { K: '0', V: '否' },
18
+ { K: '1', V: '是' },
19
+ ]
20
+ }
@@ -0,0 +1,75 @@
1
+ import config from '../../config/config'
2
+ import ajax from '../ajax'
3
+ import { builtInDictKeys, builtInDictMap, builtInDictList} from './built-in-dict'
4
+ import { setSessionStorage, getSessionStorage} from "../platform";
5
+
6
+ export async function getAllDict(dictIdArray) {
7
+ if (dictIdArray.length > 0) {
8
+ try {
9
+ const { data } = await ajax.get(`${config.upmsServerContext}/manage/acDict/getDictsForMulti`, { params: { dictIds : dictIdArray.join(",") } })
10
+ let result = {}
11
+ if (data.code == 1) {
12
+ let dictList = data.data;
13
+ for (let key in dictList) {
14
+ let dicts = dictList[key]
15
+ result[key] = {};
16
+ if (dicts.length > 0) {
17
+ result[key]['enumList'] = dicts
18
+ setSessionStorage(key + '_LIST', dicts)
19
+ let dictMap = {}
20
+ for(let dict of dicts) {
21
+ dictMap[dict.K] = dict.V;
22
+ }
23
+ result[key]['enumData'] = dictMap
24
+ setSessionStorage(key + '_MAP', dictMap)
25
+ } else if (builtInDictKeys.includes(key)) {
26
+ let dicts = builtInDictList[key]
27
+ result[key]['enumList'] = dicts
28
+ setSessionStorage(key + '_LIST', dicts)
29
+ let dictMap = {}
30
+ for(let dict of dicts) {
31
+ dictMap[dict.K] = dict.V;
32
+ }
33
+ result[key]['enumData'] = dictMap
34
+ setSessionStorage(key + '_MAP', dictMap)
35
+ }
36
+ }
37
+ }
38
+ return result
39
+ } catch (error) {
40
+ console.error(`getDictsForMulti error dictId=${dictIdArray}`, error)
41
+ }
42
+ }
43
+ }
44
+
45
+ export async function getDictList(dictId) {
46
+ if (builtInDictKeys.includes(dictId)) {
47
+ return builtInDictList[dictId]
48
+ }
49
+ const dictValue = getSessionStorage(dictId + '_LIST')
50
+ if (!!dictValue) {
51
+ return dictValue
52
+ }
53
+ let data = await getAllDict([dictId]);
54
+ return data[dictId];
55
+ }
56
+
57
+ export async function getDictMap(dictId) {
58
+ if (builtInDictKeys.includes(dictId)) {
59
+ return builtInDictMap[dictId]
60
+ }
61
+ const dictValue = getSessionStorage(dictId + '_MAP')
62
+ if (!!dictValue) {
63
+ return dictValue
64
+ }
65
+
66
+ try {
67
+ const { data } = await ajax.get(`${config.upmsServerContext}/manage/acDict/getDictsMap`, { params: { dictId : dictId } })
68
+ if (data.code == 1) {
69
+ setSessionStorage(dictId + '_MAP', data.data)
70
+ }
71
+ return data.data
72
+ } catch (error) {
73
+ console.error(`getDictsMap error dictId=${dictId}`, error)
74
+ }
75
+ }