eoss-ui 0.4.64 → 0.4.66
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/lib/button-group.js +33 -18
- package/lib/button.js +35 -20
- package/lib/checkbox-group.js +33 -18
- package/lib/data-table-form.js +33 -18
- package/lib/data-table.js +33 -18
- package/lib/date-picker.js +33 -18
- package/lib/dialog.js +36 -21
- package/lib/eoss-ui.common.js +7036 -6505
- package/lib/flow-group.js +33 -18
- package/lib/flow-list.js +33 -18
- package/lib/flow.js +38 -22
- package/lib/form.js +8659 -8284
- package/lib/handle-user.js +33 -18
- package/lib/handler.js +33 -18
- package/lib/index.js +1 -1
- package/lib/input-number.js +33 -18
- package/lib/input.js +53 -25
- package/lib/login.js +38 -25
- package/lib/main.js +95 -70
- package/lib/nav.js +36 -21
- package/lib/page.js +33 -18
- package/lib/player.js +33 -18
- package/lib/qr-code.js +33 -18
- package/lib/radio-group.js +33 -18
- package/lib/retrial-auth.js +33 -18
- package/lib/select-ganged.js +33 -18
- package/lib/select.js +35 -19
- package/lib/selector-panel.js +33 -18
- package/lib/selector.js +33 -18
- package/lib/sizer.js +33 -18
- package/lib/steps.js +33 -18
- package/lib/switch.js +33 -18
- package/lib/table-form.js +1336 -1214
- package/lib/tabs.js +33 -18
- package/lib/tips.js +33 -18
- package/lib/tree-group.js +36 -21
- package/lib/tree.js +33 -18
- package/lib/upload.js +384 -343
- package/lib/utils/util.js +33 -18
- package/lib/wujie.js +33 -18
- package/lib/wxlogin.js +33 -18
- package/package.json +2 -2
- package/packages/button/src/main.vue +2 -2
- package/packages/dialog/src/main.vue +1 -1
- package/packages/flow/src/main.vue +6 -5
- package/packages/form/src/main.vue +1435 -1314
- package/packages/form/src/table.vue +375 -318
- package/packages/input/src/main.vue +20 -7
- package/packages/login/src/main.vue +3 -5
- package/packages/main/src/main.vue +61 -54
- package/packages/nav/src/main.vue +1 -1
- package/packages/select/src/main.vue +2 -1
- package/packages/tree-group/src/main.vue +1 -1
- package/packages/upload/src/main.vue +10 -1
- package/src/index.js +1 -1
- package/src/utils/util.js +33 -19
|
@@ -48,9 +48,18 @@ export default {
|
|
|
48
48
|
scope: {},
|
|
49
49
|
exclude: Boolean
|
|
50
50
|
},
|
|
51
|
+
watch: {
|
|
52
|
+
data: {
|
|
53
|
+
immediate: true,
|
|
54
|
+
deep: true,
|
|
55
|
+
handler(val) {
|
|
56
|
+
this.results = val;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
51
60
|
data() {
|
|
52
61
|
return {
|
|
53
|
-
results:
|
|
62
|
+
results: []
|
|
54
63
|
};
|
|
55
64
|
},
|
|
56
65
|
computed: {
|
|
@@ -120,7 +129,7 @@ export default {
|
|
|
120
129
|
},
|
|
121
130
|
mounted() {},
|
|
122
131
|
methods: {
|
|
123
|
-
getData(query, callback) {
|
|
132
|
+
getData(query, callback, isChange) {
|
|
124
133
|
if (typeof this.url && this.results.length === 0) {
|
|
125
134
|
util
|
|
126
135
|
.ajax({
|
|
@@ -145,17 +154,21 @@ export default {
|
|
|
145
154
|
});
|
|
146
155
|
} else {
|
|
147
156
|
let results = query
|
|
148
|
-
? this.results.filter(this.searchFilter(query))
|
|
157
|
+
? this.results.filter(this.searchFilter(query, isChange))
|
|
149
158
|
: this.results;
|
|
150
159
|
callback(results);
|
|
151
160
|
}
|
|
152
161
|
},
|
|
153
|
-
searchFilter(query) {
|
|
162
|
+
searchFilter(query, isChange) {
|
|
154
163
|
return (state) => {
|
|
155
|
-
if (
|
|
156
|
-
return state.value.
|
|
164
|
+
if (isChange) {
|
|
165
|
+
return state.value.indexOf(query) > -1;
|
|
157
166
|
} else {
|
|
158
|
-
|
|
167
|
+
if (this.exclude) {
|
|
168
|
+
return state.value !== query;
|
|
169
|
+
} else {
|
|
170
|
+
return state.value === query;
|
|
171
|
+
}
|
|
159
172
|
}
|
|
160
173
|
};
|
|
161
174
|
},
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
:focusShow="focusShow"
|
|
66
66
|
:data="users"
|
|
67
67
|
@select="handleBlur"
|
|
68
|
-
autocomplete="
|
|
68
|
+
:autocomplete="true"
|
|
69
69
|
>
|
|
70
70
|
<template slot="prefix">
|
|
71
71
|
<i class="es-icon-zhanghao es-label-user"></i>
|
|
@@ -849,10 +849,8 @@ export default {
|
|
|
849
849
|
}
|
|
850
850
|
}
|
|
851
851
|
},
|
|
852
|
-
handleBlur() {
|
|
853
|
-
|
|
854
|
-
this.getRemember(this.formData.username);
|
|
855
|
-
}
|
|
852
|
+
handleBlur(res) {
|
|
853
|
+
this.getRemember(res.value);
|
|
856
854
|
},
|
|
857
855
|
handleRemember() {
|
|
858
856
|
let values = localStorage.getItem('unpd');
|
|
@@ -707,13 +707,16 @@ export default {
|
|
|
707
707
|
}
|
|
708
708
|
},
|
|
709
709
|
setTitle(id) {
|
|
710
|
+
let node;
|
|
710
711
|
for (let i = 0; i < this.menus.length; i++) {
|
|
711
712
|
let item = this.menus[i];
|
|
712
713
|
if (item.id == id) {
|
|
713
714
|
this.title = item.text;
|
|
714
|
-
|
|
715
|
+
node = item;
|
|
716
|
+
break;
|
|
715
717
|
}
|
|
716
718
|
}
|
|
719
|
+
return node;
|
|
717
720
|
},
|
|
718
721
|
renderMenu() {
|
|
719
722
|
if (this.data !== undefined && this.data.length) {
|
|
@@ -862,6 +865,7 @@ export default {
|
|
|
862
865
|
this.color = unescape(results[i].color).toLowerCase();
|
|
863
866
|
}
|
|
864
867
|
if (i === 'subsystemExtend' && results[i].webPageWatermark) {
|
|
868
|
+
util.win.top.webPageWatermark = results[i].webPageWatermark;
|
|
865
869
|
util.watermark(results[i].webPageWatermark);
|
|
866
870
|
}
|
|
867
871
|
store.set(i, results[i]);
|
|
@@ -1223,6 +1227,7 @@ export default {
|
|
|
1223
1227
|
},
|
|
1224
1228
|
//设置默认导航页面
|
|
1225
1229
|
setDefault(res, active) {
|
|
1230
|
+
this.navIds = JSON.parse(JSON.stringify(active));
|
|
1226
1231
|
this.sysId = '';
|
|
1227
1232
|
this.tabsId = '';
|
|
1228
1233
|
this.active = '';
|
|
@@ -1334,18 +1339,7 @@ export default {
|
|
|
1334
1339
|
},
|
|
1335
1340
|
//应用导航交互
|
|
1336
1341
|
handleSelect(res, type, open) {
|
|
1337
|
-
console.log(type, 11);
|
|
1338
1342
|
const { node, fourthTabs } = res;
|
|
1339
|
-
let openIdex = 0;
|
|
1340
|
-
if (
|
|
1341
|
-
node.extendData &&
|
|
1342
|
-
(node.extendData.subDefOpenIndex || node.extendData.subDefOpen)
|
|
1343
|
-
) {
|
|
1344
|
-
openIdex = parseInt(
|
|
1345
|
-
node.extendData.subDefOpenIndex || node.extendData.subDefOpen,
|
|
1346
|
-
10
|
|
1347
|
-
);
|
|
1348
|
-
}
|
|
1349
1343
|
if (!open) {
|
|
1350
1344
|
if (
|
|
1351
1345
|
node.extendData &&
|
|
@@ -1369,7 +1363,7 @@ export default {
|
|
|
1369
1363
|
this.menu = node.children;
|
|
1370
1364
|
this.title = node.text;
|
|
1371
1365
|
if (this.setFirstAsDefault) {
|
|
1372
|
-
let subNode = this.getFirst(node
|
|
1366
|
+
let subNode = this.getFirst(node);
|
|
1373
1367
|
if (subNode) {
|
|
1374
1368
|
this.active = subNode.id;
|
|
1375
1369
|
this.navIds = [
|
|
@@ -1391,7 +1385,14 @@ export default {
|
|
|
1391
1385
|
this.menu = node.children;
|
|
1392
1386
|
this.title = node.text;
|
|
1393
1387
|
if (this.setFirstAsDefault) {
|
|
1394
|
-
|
|
1388
|
+
let subNode = this.getFirst(node);
|
|
1389
|
+
if (subNode) {
|
|
1390
|
+
this.active = subNode.id;
|
|
1391
|
+
this.navIds = [
|
|
1392
|
+
node.id,
|
|
1393
|
+
...this.getId(node.children, subNode.url, true)
|
|
1394
|
+
];
|
|
1395
|
+
}
|
|
1395
1396
|
}
|
|
1396
1397
|
this.isSide = true;
|
|
1397
1398
|
}
|
|
@@ -1413,48 +1414,59 @@ export default {
|
|
|
1413
1414
|
case 'menu':
|
|
1414
1415
|
if (!open) {
|
|
1415
1416
|
this.tabs = [];
|
|
1416
|
-
if (this.
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
this.active = node.id;
|
|
1421
|
-
}
|
|
1417
|
+
if (this.biserial) {
|
|
1418
|
+
this.$set(this.active, 1, node.id);
|
|
1419
|
+
} else {
|
|
1420
|
+
this.active = node.id;
|
|
1422
1421
|
}
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1422
|
+
if (node.url) {
|
|
1423
|
+
if (node.children && node.children.length) {
|
|
1424
|
+
let tab = node.children.filter((item) => {
|
|
1425
|
+
return item.url === node.url;
|
|
1426
|
+
})[0];
|
|
1427
|
+
if (tab) {
|
|
1428
|
+
if (this.biserial) {
|
|
1429
|
+
this.$set(this.active, 1, tab.id);
|
|
1430
|
+
} else {
|
|
1431
|
+
this.active = tab.id;
|
|
1432
|
+
}
|
|
1433
|
+
this.navIds = this.getId(this.menus, tab.url, true);
|
|
1434
|
+
}
|
|
1435
|
+
} else {
|
|
1436
|
+
let tab = (node.fourthTabs || []).filter((item) => {
|
|
1437
|
+
return item.url === node.url;
|
|
1438
|
+
})[0];
|
|
1439
|
+
if (tab) {
|
|
1440
|
+
this.tabs = node.fourthTabs;
|
|
1441
|
+
this.tabsId = tab.id;
|
|
1442
|
+
this.navIds = this.getId(this.menus, tab.url, true);
|
|
1432
1443
|
} else {
|
|
1433
|
-
this.
|
|
1444
|
+
this.navIds = this.getId(this.menus, node.url, true);
|
|
1434
1445
|
}
|
|
1435
|
-
this.navIds = this.getId(this.menus, tab.url, true);
|
|
1436
1446
|
}
|
|
1437
1447
|
} else {
|
|
1438
|
-
|
|
1439
|
-
return item.url === node.url;
|
|
1440
|
-
})[0];
|
|
1441
|
-
if (tab) {
|
|
1448
|
+
if (node.fourthTabs.length) {
|
|
1442
1449
|
this.tabs = node.fourthTabs;
|
|
1443
|
-
this.tabsId =
|
|
1444
|
-
this.
|
|
1450
|
+
this.tabsId = this.tabs[0].id;
|
|
1451
|
+
this.handleJump(
|
|
1452
|
+
this.tabs[0].url,
|
|
1453
|
+
this.tabs[0].urlopenmode,
|
|
1454
|
+
this.tabs[0]
|
|
1455
|
+
);
|
|
1456
|
+
this.navIds = this.getId(this.menus, this.tabs[0].url, true);
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
} else if (this.setFirstAsDefault) {
|
|
1460
|
+
this.tabs = [];
|
|
1461
|
+
let subNode = this.getFirst(node);
|
|
1462
|
+
if (subNode) {
|
|
1463
|
+
if (this.biserial) {
|
|
1464
|
+
this.$set(this.active, 1, subNode.id);
|
|
1445
1465
|
} else {
|
|
1446
|
-
this.
|
|
1466
|
+
this.active = subNode.id;
|
|
1447
1467
|
}
|
|
1468
|
+
this.navIds = this.getId(this.menus, subNode.url, true);
|
|
1448
1469
|
}
|
|
1449
|
-
} else if (node.fourthTabs.length) {
|
|
1450
|
-
this.tabs = node.fourthTabs;
|
|
1451
|
-
this.tabsId = this.tabs[0].id;
|
|
1452
|
-
this.handleJump(
|
|
1453
|
-
this.tabs[0].url,
|
|
1454
|
-
this.tabs[0].urlopenmode,
|
|
1455
|
-
this.tabs[0]
|
|
1456
|
-
);
|
|
1457
|
-
this.navIds = this.getId(this.menus, this.tabs[0].url, true);
|
|
1458
1470
|
}
|
|
1459
1471
|
break;
|
|
1460
1472
|
case 'tabs':
|
|
@@ -1670,13 +1682,8 @@ export default {
|
|
|
1670
1682
|
}
|
|
1671
1683
|
}
|
|
1672
1684
|
} else {
|
|
1673
|
-
if (menus.fourthTabs && menus.fourthTabs.length) {
|
|
1674
|
-
|
|
1675
|
-
let item = menus.fourthTabs[i];
|
|
1676
|
-
if (item.id === id) {
|
|
1677
|
-
return item;
|
|
1678
|
-
}
|
|
1679
|
-
}
|
|
1685
|
+
if (menus.fourthTabs && menus.fourthTabs.length && menus.id === id) {
|
|
1686
|
+
return menus;
|
|
1680
1687
|
}
|
|
1681
1688
|
if (menus.children && menus.children.length) {
|
|
1682
1689
|
for (let i = 0; i < menus.children.length; i++) {
|
|
@@ -155,12 +155,13 @@ export default {
|
|
|
155
155
|
let ary = [];
|
|
156
156
|
this.filtrate.forEach((items) => {
|
|
157
157
|
let val = typeof items === 'string' ? items : items[this.valKey];
|
|
158
|
-
ary.concat(
|
|
158
|
+
ary = ary.concat(
|
|
159
159
|
this.data.filter((item) => {
|
|
160
160
|
return item[this.filtrateKey] == val;
|
|
161
161
|
})
|
|
162
162
|
);
|
|
163
163
|
});
|
|
164
|
+
return ary;
|
|
164
165
|
} else {
|
|
165
166
|
let val =
|
|
166
167
|
typeof this.filtrate === 'string'
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<el-upload
|
|
3
|
+
v-if="isRender"
|
|
3
4
|
ref="upload"
|
|
4
5
|
v-bind="$attrs"
|
|
5
6
|
class="es-upload"
|
|
@@ -408,7 +409,8 @@ export default {
|
|
|
408
409
|
previewScale: {
|
|
409
410
|
type: Boolean,
|
|
410
411
|
default: true
|
|
411
|
-
}
|
|
412
|
+
},
|
|
413
|
+
useCaseCode: String
|
|
412
414
|
},
|
|
413
415
|
data() {
|
|
414
416
|
return {
|
|
@@ -432,6 +434,13 @@ export default {
|
|
|
432
434
|
};
|
|
433
435
|
},
|
|
434
436
|
computed: {
|
|
437
|
+
isRender() {
|
|
438
|
+
let useCaseCodes = util.getStorage('useCaseCodes');
|
|
439
|
+
if (useCaseCodes && this.useCaseCode) {
|
|
440
|
+
return useCaseCodes.indexOf(this.useCaseCode) > -1;
|
|
441
|
+
}
|
|
442
|
+
return true;
|
|
443
|
+
},
|
|
435
444
|
_icons() {
|
|
436
445
|
return {
|
|
437
446
|
ppt: 'es-icon-ppt',
|
package/src/index.js
CHANGED
package/src/utils/util.js
CHANGED
|
@@ -2054,19 +2054,16 @@ const setStorage = function ({ type, key, value }) {
|
|
|
2054
2054
|
**/
|
|
2055
2055
|
const startWith = function (value, reg, or = true) {
|
|
2056
2056
|
if (Array.isArray(reg)) {
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
let item = reg[i];
|
|
2060
|
-
if (new RegExp('^' + item).test(value)) {
|
|
2061
|
-
if (or) {
|
|
2062
|
-
flag = true;
|
|
2063
|
-
return true;
|
|
2064
|
-
}
|
|
2065
|
-
} else {
|
|
2066
|
-
flag = false;
|
|
2067
|
-
}
|
|
2057
|
+
if (!reg.length) {
|
|
2058
|
+
return true;
|
|
2068
2059
|
}
|
|
2069
|
-
|
|
2060
|
+
let regs = reg.map(item => {
|
|
2061
|
+
return new RegExp('^' + item).test(value);
|
|
2062
|
+
});
|
|
2063
|
+
if (or) {
|
|
2064
|
+
return regs.indexOf(true) > -1;
|
|
2065
|
+
}
|
|
2066
|
+
return regs.indexOf(false) === -1;
|
|
2070
2067
|
}
|
|
2071
2068
|
if (new RegExp('^' + reg).test(value)) {
|
|
2072
2069
|
return true;
|
|
@@ -2252,14 +2249,18 @@ const uuid = function (len) {
|
|
|
2252
2249
|
**/
|
|
2253
2250
|
const watermark = function (option) {
|
|
2254
2251
|
// 默认设置
|
|
2252
|
+
let _width = parseInt(option.width || 480, 10) ;
|
|
2253
|
+
let _height = parseInt(option.width || 180, 10);
|
|
2254
|
+
let _rows = Math.round(document.body.clientHeight / _height);
|
|
2255
|
+
let _cols = Math.round(document.body.clientWidth / _width);
|
|
2255
2256
|
let config = {
|
|
2256
|
-
rows:
|
|
2257
|
-
cols:
|
|
2257
|
+
rows: _rows, // 水印行数
|
|
2258
|
+
cols: _cols,
|
|
2258
2259
|
html: '水印示例', // 水印文本内容
|
|
2259
2260
|
angle: -15, // 旋转角度
|
|
2260
2261
|
color: '#000', // 水印文字颜色
|
|
2261
|
-
|
|
2262
|
-
height:
|
|
2262
|
+
minWidth: _width, // 水印最小宽度
|
|
2263
|
+
height: _height, // 水印高度
|
|
2263
2264
|
lineHeight: 20, // 水印行高
|
|
2264
2265
|
opacity: 0.1, // 水印透明度
|
|
2265
2266
|
fontSize: 14, // 水印文字字体大小
|
|
@@ -2269,24 +2270,37 @@ const watermark = function (option) {
|
|
|
2269
2270
|
zIndex: 999999 // 水印文字的层级
|
|
2270
2271
|
};
|
|
2271
2272
|
let options = option ? extend(true, config, typeof option === 'string' ? { html: option } : option) : config;
|
|
2272
|
-
let wrap = document.
|
|
2273
|
+
let wrap = document.getElementById('watermark');
|
|
2274
|
+
if (!wrap) {
|
|
2275
|
+
wrap = document.createElement('div');
|
|
2276
|
+
wrap.id = 'watermark';
|
|
2277
|
+
} else {
|
|
2278
|
+
wrap.innerHTML = '';
|
|
2279
|
+
}
|
|
2273
2280
|
// 禁止选择和复制
|
|
2274
2281
|
wrap.onselectstart = wrap.oncontextmenu = function () {
|
|
2275
2282
|
return false;
|
|
2276
2283
|
};
|
|
2277
2284
|
let docFrag = document.createDocumentFragment();
|
|
2278
|
-
let { rows, cols, html, angle, color, height, lineHeight, opacity, fontSize, fontWeight, fontFamily, textAlign, zIndex } = options;
|
|
2285
|
+
let { rows, cols, html, angle, color, minWidth, height, lineHeight, opacity, fontSize, fontWeight, fontFamily, textAlign, zIndex } = options;
|
|
2279
2286
|
|
|
2280
2287
|
wrap.style.cssText = 'display: flex;align-items: center;justify-content: flex-start;flex-wrap: wrap;align-content: space-between;position: fixed;left: 50%;top: 50%;transform: translate(-50%, -50%);height: 100vh;width: 100vw;pointer-events: none;overflow: hidden;background: transparent;z-index: ' + zIndex + ';';
|
|
2281
2288
|
let num = rows * cols;
|
|
2282
2289
|
for (let i = 0; i < num; i++) {
|
|
2283
2290
|
let item = document.createElement('div');
|
|
2284
2291
|
item.innerHTML = html;
|
|
2285
|
-
item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + (100 / cols) + '%;height: ' + height + 'px;line-height: ' + lineHeight + 'px;font-size:' + fontSize + 'px;font-weight: ' + fontWeight + ';font-family: ' + fontFamily + ';text-align: ' + textAlign + ';transform: rotate(' + angle + 'deg);opacity: ' + opacity + ';';
|
|
2292
|
+
item.style.cssText = 'flex-grow: 1;flex-shrink: 0;color: ' + color + ';text-align: ' + textAlign + ';width: ' + (100 / cols) + '%;min-width: ' + (minWidth ? parseInt(minWidth, 10) + 'px' : '') + ';height: ' + height + 'px;line-height: ' + lineHeight + 'px;font-size:' + fontSize + 'px;font-weight: ' + fontWeight + ';font-family: ' + fontFamily + ';text-align: ' + textAlign + ';transform: rotate(' + angle + 'deg);opacity: ' + opacity + ';';
|
|
2286
2293
|
docFrag.appendChild(item);
|
|
2287
2294
|
}
|
|
2288
2295
|
wrap.appendChild(docFrag);
|
|
2289
2296
|
document.body.appendChild(wrap);
|
|
2297
|
+
let _timeout;
|
|
2298
|
+
window.onresize = function () {
|
|
2299
|
+
clearTimeout(_timeout);
|
|
2300
|
+
_timeout = setTimeout(function () {
|
|
2301
|
+
watermark(options);
|
|
2302
|
+
}, 1000);
|
|
2303
|
+
};
|
|
2290
2304
|
};
|
|
2291
2305
|
|
|
2292
2306
|
export default {
|