@lambo-design/shared 1.0.0-beta.41 → 1.0.0-beta.43
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.
- package/package.json +1 -1
- package/utils/excel.js +16 -14
- package/utils/menu/index.js +3 -1
package/package.json
CHANGED
package/utils/excel.js
CHANGED
|
@@ -15,7 +15,9 @@ const typeRules = {
|
|
|
15
15
|
'index': 'index',
|
|
16
16
|
'select': 'select',
|
|
17
17
|
'selection': 'selection',
|
|
18
|
-
'single-selection': 'single-selection'
|
|
18
|
+
'single-selection': 'single-selection',
|
|
19
|
+
'checkbox': 'checkbox',
|
|
20
|
+
'radio': 'radio'
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
function auto_width(ws, data) {
|
|
@@ -127,7 +129,7 @@ function add_style(ws, title) {
|
|
|
127
129
|
Object.keys(ws).forEach(item => {
|
|
128
130
|
if (/^[A-Z]+\d+$/.test(item)) {
|
|
129
131
|
var alphabet = item.replace(/[^a-z]+/ig, "");
|
|
130
|
-
if (colhash.indexOf(alphabet)
|
|
132
|
+
if (colhash.indexOf(alphabet) === -1) {
|
|
131
133
|
colhash.push(alphabet)
|
|
132
134
|
for (var i = 1; i <= rowSum; i++) {
|
|
133
135
|
if (!ws.hasOwnProperty(alphabet + i)) {
|
|
@@ -141,7 +143,7 @@ function add_style(ws, title) {
|
|
|
141
143
|
}
|
|
142
144
|
})
|
|
143
145
|
|
|
144
|
-
let
|
|
146
|
+
let titleStyle = {
|
|
145
147
|
border: {
|
|
146
148
|
left: {style: 'thin', color: {rgb: "000000"}},
|
|
147
149
|
top: {style: 'thin', color: {rgb: "000000"}},
|
|
@@ -177,14 +179,14 @@ function add_style(ws, title) {
|
|
|
177
179
|
*/
|
|
178
180
|
var reg = new RegExp("^[A-Z]+[1 -" + title.length + "]$", "gim");
|
|
179
181
|
if (reg.test(item)) {
|
|
180
|
-
ws[item].s =
|
|
182
|
+
ws[item].s = titleStyle
|
|
181
183
|
} else
|
|
182
184
|
|
|
183
185
|
/**
|
|
184
186
|
* 表体样式: 垂直居中,边框
|
|
185
187
|
*/
|
|
186
188
|
if (/^[A-Z]+\d+$/.test(item)) {
|
|
187
|
-
if (parseInt(item.replace(/[^0-9]/ig, "")) % 2
|
|
189
|
+
if (parseInt(item.replace(/[^0-9]/ig, "")) % 2 === 0) {
|
|
188
190
|
ws[item].s = bodyStyle
|
|
189
191
|
} else {
|
|
190
192
|
ws[item].s = bodyPairStyle
|
|
@@ -203,9 +205,9 @@ function add_style(ws, title) {
|
|
|
203
205
|
function title_filter(data) {
|
|
204
206
|
let filterData = deepCopy(data);
|
|
205
207
|
for (var i = 0; i < filterData.length; i++) {
|
|
206
|
-
if ((filterData[i].hasOwnProperty('type') && filterData[i].type
|
|
208
|
+
if ((filterData[i].hasOwnProperty('type') && filterData[i].type !== undefined && filterData[i].type === typeRules[filterData[i].type]) ||
|
|
207
209
|
// !filterData[i].hasOwnProperty('title') ||
|
|
208
|
-
filterData[i].title
|
|
210
|
+
filterData[i].title === titleRules[filterData[i].title]) {
|
|
209
211
|
filterData.splice(i, 1)
|
|
210
212
|
i--
|
|
211
213
|
}
|
|
@@ -217,9 +219,9 @@ function title_el_filter(data) {
|
|
|
217
219
|
let filterData = deepCopy(data);
|
|
218
220
|
|
|
219
221
|
for (var i = 0; i < filterData.length; i++) {
|
|
220
|
-
if ((filterData[i].hasOwnProperty('property') && filterData[i].property
|
|
222
|
+
if ((filterData[i].hasOwnProperty('property') && filterData[i].property === typeRules[filterData[i].property]) ||
|
|
221
223
|
// !filterData[i].hasOwnProperty('title') ||
|
|
222
|
-
filterData[i].label
|
|
224
|
+
filterData[i].label === titleRules[filterData[i].label]) {
|
|
223
225
|
filterData.splice(i, 1)
|
|
224
226
|
i--
|
|
225
227
|
}
|
|
@@ -456,13 +458,13 @@ export const export_array_to_excel = ({key, data, title, filename, spanColumns,
|
|
|
456
458
|
|
|
457
459
|
function s2ab(s) {
|
|
458
460
|
if (typeof ArrayBuffer !== 'undefined') {
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
for (
|
|
461
|
+
let buf = new ArrayBuffer(s.length);
|
|
462
|
+
let view = new Uint8Array(buf);
|
|
463
|
+
for (let i = 0; i !== s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
|
|
462
464
|
return buf;
|
|
463
465
|
} else {
|
|
464
|
-
|
|
465
|
-
for (
|
|
466
|
+
let buf = new Array(s.length);
|
|
467
|
+
for (let i = 0; i !== s.length; ++i) buf[i] = s.charCodeAt(i) & 0xFF;
|
|
466
468
|
return buf;
|
|
467
469
|
}
|
|
468
470
|
}
|
package/utils/menu/index.js
CHANGED
|
@@ -65,7 +65,9 @@ const listToMenuTree = (list, menuTree, pageNode, parentId, crumbs, root, appId)
|
|
|
65
65
|
title: item.label,
|
|
66
66
|
icon: item.icon,
|
|
67
67
|
crumbs: [...crumbs],
|
|
68
|
-
activeName: item.name
|
|
68
|
+
activeName: item.name,
|
|
69
|
+
notCache: item.notCache ? true : false,
|
|
70
|
+
hideInMenu: item.hideInMenu ? true : false
|
|
69
71
|
},
|
|
70
72
|
type: item.type,
|
|
71
73
|
pid: item.pid,
|