eoss-ui 0.5.11 → 0.5.13
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 +215 -123
- package/lib/button.js +154 -74
- package/lib/card.js +2 -2
- package/lib/cascader.js +2 -2
- package/lib/checkbox-group.js +154 -75
- package/lib/clients.js +2 -2
- package/lib/data-table-form.js +154 -75
- package/lib/data-table.js +192 -99
- package/lib/date-picker.js +159 -79
- package/lib/dialog.js +163 -84
- package/lib/enterprise.js +2 -2
- package/lib/eoss-ui.common.js +357 -219
- package/lib/error-page.js +2 -2
- package/lib/flow-group.js +154 -74
- package/lib/flow-list.js +189 -84
- package/lib/flow.js +215 -119
- package/lib/form.js +247 -152
- package/lib/handle-user.js +155 -75
- package/lib/handler.js +154 -74
- package/lib/icons.js +4 -4
- package/lib/index.js +1 -1
- package/lib/input-number.js +154 -74
- package/lib/input.js +156 -76
- package/lib/label.js +5 -4
- package/lib/layout.js +4 -4
- package/lib/login.js +157 -78
- package/lib/main.js +203 -122
- package/lib/menu.js +2 -2
- package/lib/nav.js +154 -74
- package/lib/notify.js +2 -2
- package/lib/page.js +154 -74
- package/lib/pagination.js +2 -2
- package/lib/player.js +160 -80
- package/lib/qr-code.js +156 -76
- package/lib/radio-group.js +155 -75
- package/lib/retrial-auth.js +154 -74
- package/lib/select-ganged.js +154 -74
- package/lib/select.js +155 -75
- package/lib/selector-panel.js +155 -76
- package/lib/selector.js +156 -76
- package/lib/sizer.js +156 -76
- package/lib/steps.js +154 -74
- package/lib/switch.js +154 -74
- package/lib/table-form.js +156 -76
- package/lib/tabs-panel.js +2 -2
- package/lib/tabs.js +159 -79
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/nav.css +1 -1
- package/lib/tips.js +154 -74
- package/lib/toolbar.js +2 -2
- package/lib/tree-group.js +154 -74
- package/lib/tree.js +154 -74
- package/lib/upload.js +157 -78
- package/lib/utils/util.js +8 -61
- package/lib/utils/webSocket.js +131 -0
- package/lib/wujie.js +154 -74
- package/lib/wxlogin.js +154 -74
- package/package.json +1 -1
- package/packages/data-table/src/column copy.vue +977 -0
- package/packages/data-table/src/main copy.vue +1325 -0
- package/packages/data-table/src/main.vue +31 -8
- package/packages/data-table/src/sizer.vue +1 -1
- package/packages/flow/src/component/taskUnionExamine.vue +1 -1
- package/packages/flow/src/main.vue +3 -1
- package/packages/flow/src/processForm.vue +24 -10
- package/packages/flow/src/processReject.vue +1 -1
- package/packages/flow/src/startTaskRead.vue +1 -1
- package/packages/flow-list/src/main.vue +25 -2
- package/packages/label/src/main.vue +3 -2
- package/packages/main/src/main.vue +19 -18
- package/packages/theme-chalk/lib/index.css +1 -1
- package/packages/theme-chalk/lib/nav.css +1 -1
- package/packages/theme-chalk/src/nav.scss +21 -2
- package/src/index.js +1 -1
- package/src/utils/util.js +29 -81
- package/src/utils/webSocket.js +100 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.es-nav,.es-nav .es-nav-main{display:inline-block;overflow:hidden}.es-nav{transition:all .2s;-webkit-transition:all .2s}.es-nav .el-menu,.es-nav .es-menu{background-color:transparent}.es-nav .es-nav-main{position:relative;height:100%;background-color:#002766;border-right:1px solid #d9d9d9}.es-nav .es-nav-main .es-nav-title{width:100%;height:45px;font-size:
|
|
1
|
+
@charset "UTF-8";.es-nav,.es-nav .es-nav-main{display:inline-block;overflow:hidden}.es-nav{transition:all .2s;-webkit-transition:all .2s}.es-nav .el-menu,.es-nav .es-menu{background-color:transparent}.es-nav .es-nav-main{position:relative;height:100%;background-color:#002766;border-right:1px solid #d9d9d9}.es-nav .es-nav-main .es-nav-title{width:100%;height:45px;font-size:15px;line-height:30px;text-align:center;overflow:hidden;padding:7px 32px 7px 0;background-color:#096dd9;color:#fff;position:relative;z-index:1;-webkit-box-shadow:0 4px 10px 0 rgba(0,0,0,.2);box-shadow:0 4px 10px 0 rgba(0,0,0,.2)}.es-nav .es-nav-main .es-nav-title .es-collapse-handle{font-size:20px;cursor:pointer;position:absolute;right:12px;top:50%;margin-top:-10px;color:#fff}.es-nav .es-nav-main .es-nav-title .es-collapse-handle.es-icon-zengjiasuojinliang{right:50%;margin-right:-10px}.es-nav .es-nav-main .es-nav-title .el-tooltip{text-align:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;position:relative;padding:0 4px}.es-nav .es-nav-main .es-nav-title .el-tooltip.es-nav-title-filter{padding-right:10px;cursor:pointer}.es-nav .es-nav-main .es-nav-title .el-tooltip.es-nav-title-filter .el-icon--right{position:absolute;right:6px;top:50%;margin-top:-4px}.es-nav .es-nav-initial{width:70px;-webkit-box-shadow:0 6px 30px 5px rgba(0,0,0,.05),0 16px 24px 2px rgba(0,0,0,.04),0 8px 10px -5px rgba(0,0,0,.08);box-shadow:0 6px 30px 5px rgba(0,0,0,.05),0 16px 24px 2px rgba(0,0,0,.04),0 8px 10px -5px rgba(0,0,0,.08);position:relative;z-index:2;height:100%;background:#003a8c}.es-nav .es-nav-initial .el-menu-item,.es-nav .es-nav-initial .es-menu-vertical{height:auto}.es-nav .es-nav-initial .el-menu-item.is-active,.es-nav .es-nav-initial .es-menu-vertical.is-active{background:#096dd9}.es-nav.es-nav-biserial{position:relative}.es-nav.es-nav-biserial .es-nav-main{position:absolute;left:70px;top:0;bottom:0}.es-nav.es-nav-biserial .es-menu-title-vertical{margin-right:0}
|
|
@@ -18,10 +18,11 @@
|
|
|
18
18
|
.es-nav-title {
|
|
19
19
|
width: 100%;
|
|
20
20
|
height: 45px;
|
|
21
|
-
font-size:
|
|
22
|
-
line-height:
|
|
21
|
+
font-size: 15px;
|
|
22
|
+
line-height: 30px;
|
|
23
23
|
text-align: center;
|
|
24
24
|
overflow: hidden;
|
|
25
|
+
padding: 7px 32px 7px 0;
|
|
25
26
|
padding-right: 32px;
|
|
26
27
|
background-color: $--color-primary-light-7;
|
|
27
28
|
color: #fff;
|
|
@@ -41,6 +42,24 @@
|
|
|
41
42
|
margin-right: -10px;
|
|
42
43
|
}
|
|
43
44
|
}
|
|
45
|
+
.el-tooltip {
|
|
46
|
+
text-align: center;
|
|
47
|
+
text-overflow: ellipsis;
|
|
48
|
+
white-space: nowrap;
|
|
49
|
+
overflow: hidden;
|
|
50
|
+
position: relative;
|
|
51
|
+
padding: 0 4px;
|
|
52
|
+
&.es-nav-title-filter {
|
|
53
|
+
padding-right: 10px;
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
.el-icon--right {
|
|
56
|
+
position: absolute;
|
|
57
|
+
right: 6px;
|
|
58
|
+
top: 50%;
|
|
59
|
+
margin-top: -4px;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
44
63
|
}
|
|
45
64
|
}
|
|
46
65
|
.es-nav-initial {
|
package/src/index.js
CHANGED
package/src/utils/util.js
CHANGED
|
@@ -7,12 +7,11 @@
|
|
|
7
7
|
|
|
8
8
|
/* eslint-disable indent */
|
|
9
9
|
const sm2 = require('sm-crypto').sm2;
|
|
10
|
-
import { authCenter
|
|
10
|
+
import { authCenter } from '../config/api';
|
|
11
11
|
import axios from 'axios';
|
|
12
12
|
import qs from 'qs';
|
|
13
13
|
import JSONbig from 'json-bigint';
|
|
14
|
-
import
|
|
15
|
-
import Stomp from 'stompjs';
|
|
14
|
+
import WebSocket from './webSocket';
|
|
16
15
|
|
|
17
16
|
const win = window.__WUJIE_RAW_WINDOW__ ? window.__WUJIE_RAW_WINDOW__ : window;
|
|
18
17
|
|
|
@@ -1997,29 +1996,29 @@ const isLogined = function ({
|
|
|
1997
1996
|
}).catch(e => { });
|
|
1998
1997
|
} else
|
|
1999
1998
|
if (
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
} else {
|
|
2013
|
-
if (loginPage) {
|
|
2014
|
-
win.top.location.replace(loginPage);
|
|
2015
|
-
} else if (document.referrer) {
|
|
2016
|
-
win.top.location.replace(document.referrer);
|
|
2017
|
-
} else if (win.top.location.href.indexOf('main.html') > -1) {
|
|
2018
|
-
win.top.location.href = './login.html';
|
|
1999
|
+
token ||
|
|
2000
|
+
to.path === '/' ||
|
|
2001
|
+
to.path === '/404' ||
|
|
2002
|
+
exclude.indexOf(to.path) > -1 || exclude.indexOf(to.name) > -1 ||
|
|
2003
|
+
to.path === '/login' ||
|
|
2004
|
+
(token && to.path === '/main')
|
|
2005
|
+
) {
|
|
2006
|
+
if (redirect && (to.path === '/main' || to.path === '/login')) {
|
|
2007
|
+
window.location.replace(urlJoinParams({ url: `.${to.path}.html`, param: to.query }));
|
|
2008
|
+
} else {
|
|
2009
|
+
next();
|
|
2010
|
+
}
|
|
2019
2011
|
} else {
|
|
2020
|
-
|
|
2012
|
+
if (loginPage) {
|
|
2013
|
+
win.top.location.replace(loginPage);
|
|
2014
|
+
} else if (document.referrer) {
|
|
2015
|
+
win.top.location.replace(document.referrer);
|
|
2016
|
+
} else if (win.top.location.href.indexOf('main.html') > -1) {
|
|
2017
|
+
win.top.location.href = './login.html';
|
|
2018
|
+
} else {
|
|
2019
|
+
next('/login');
|
|
2020
|
+
}
|
|
2021
2021
|
}
|
|
2022
|
-
}
|
|
2023
2022
|
}
|
|
2024
2023
|
};
|
|
2025
2024
|
const isLogged = function (res) {
|
|
@@ -2475,64 +2474,13 @@ const setStorage = function ({ type, key, value }) {
|
|
|
2475
2474
|
* @param {String} [take] - 订阅地址
|
|
2476
2475
|
* @param {String} [debug] - 调试
|
|
2477
2476
|
* @param {String} [interval] - 重连间隔时间
|
|
2477
|
+
* @param {Function} [success] - 调试
|
|
2478
|
+
* @param {Function} [error] - 重连间隔时间
|
|
2478
2479
|
**/
|
|
2479
|
-
function socket(
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
return
|
|
2483
|
-
let wshost = getStorage('wshost') || '';
|
|
2484
|
-
let option = {
|
|
2485
|
-
url: wshost + wss,
|
|
2486
|
-
take: topic,
|
|
2487
|
-
debug: true,
|
|
2488
|
-
interval: 20
|
|
2489
|
-
};
|
|
2490
|
-
let websocket = win.websocket || {};
|
|
2491
|
-
if (options && isObject(options)) {
|
|
2492
|
-
option = { ...option, ...options };
|
|
2493
|
-
}
|
|
2494
|
-
let key = window.btoa(option.url);
|
|
2495
|
-
if (!websocket[key]) {
|
|
2496
|
-
websocket[key] = { socket: new SockJS(option.url) };
|
|
2497
|
-
win.websocket = websocket;
|
|
2498
|
-
}
|
|
2499
|
-
|
|
2500
|
-
let client = websocket[key] ? websocket[key].client : null;
|
|
2501
|
-
if (!client) {
|
|
2502
|
-
client = websocket[key].client = Stomp.over(websocket[key].socket);
|
|
2503
|
-
!option.debug && (client.debug = null);
|
|
2504
|
-
}
|
|
2505
|
-
client.connect(
|
|
2506
|
-
{},
|
|
2507
|
-
() => {
|
|
2508
|
-
client.subscribe(option.take, (response) => {
|
|
2509
|
-
let res = JSON.parse(response.body);
|
|
2510
|
-
resolve(res, () => {
|
|
2511
|
-
client.disconnect();
|
|
2512
|
-
win.top.websocket && win.top.websocket[key] && delete win.top.websocket[key];
|
|
2513
|
-
}, client, websocket[key]);
|
|
2514
|
-
});
|
|
2515
|
-
},
|
|
2516
|
-
(error) => {
|
|
2517
|
-
let diffSecond = parseInt((new Date() - nextDate) / 1000, 10);
|
|
2518
|
-
if (connect > 5 && diffSecond < option.interval) {
|
|
2519
|
-
client.disconnect();
|
|
2520
|
-
if (win.top.websocket) {
|
|
2521
|
-
if (Object.keys(win.top.websocket).length > 1) {
|
|
2522
|
-
delete win.top.websocket[key];
|
|
2523
|
-
} else {
|
|
2524
|
-
delete win.top.websocket;
|
|
2525
|
-
}
|
|
2526
|
-
}
|
|
2527
|
-
} else {
|
|
2528
|
-
win.top.websocket && win.top.websocket[key] && setTimeout(() => {
|
|
2529
|
-
socket(options);
|
|
2530
|
-
}, 5000);
|
|
2531
|
-
}
|
|
2532
|
-
reject(error);
|
|
2533
|
-
}
|
|
2534
|
-
);
|
|
2535
|
-
});
|
|
2480
|
+
function socket(option, vm) {
|
|
2481
|
+
const socket = new WebSocket();
|
|
2482
|
+
socket.init(option, vm);
|
|
2483
|
+
return socket;
|
|
2536
2484
|
}
|
|
2537
2485
|
/**
|
|
2538
2486
|
* sum
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import SockJS from 'sockjs-client';
|
|
2
|
+
import Stomp from 'stompjs';
|
|
3
|
+
class WebSocket {
|
|
4
|
+
// 构造函数
|
|
5
|
+
constructor() {
|
|
6
|
+
this.host = sessionStorage.getItem('wshost') || '';
|
|
7
|
+
this.tryTimes = 1; // 重连次数
|
|
8
|
+
this.callback = null; // 回调函数
|
|
9
|
+
this.client = null; // stomp对象
|
|
10
|
+
this.reconTimeout = null; // 重连延时器
|
|
11
|
+
this.debug = true; // 调试
|
|
12
|
+
this.interval = 20; // 重连间隔时间
|
|
13
|
+
this.vm = null;
|
|
14
|
+
this.nextDate = 0;
|
|
15
|
+
this.connects = 1;
|
|
16
|
+
this.recon = false;
|
|
17
|
+
this.sendTimeout = null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** socket连接 */
|
|
21
|
+
connect() {
|
|
22
|
+
if (!this.client) {
|
|
23
|
+
// 连接SockJS
|
|
24
|
+
let socket = new SockJS(this.host + this.url);
|
|
25
|
+
// 获取STOMP子协议的客户端对象
|
|
26
|
+
this.client = Stomp.over(socket);
|
|
27
|
+
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// 日志不打印
|
|
31
|
+
if (!this.debug) {
|
|
32
|
+
console.log(111);
|
|
33
|
+
this.client.debug = () => {};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// 向服务器发起websocket连接
|
|
37
|
+
this.client.connect({}, () => {
|
|
38
|
+
this.recon = true;
|
|
39
|
+
// tryTimes定义重置
|
|
40
|
+
this.connects = 1;
|
|
41
|
+
// 订阅消息
|
|
42
|
+
this.subscribe();
|
|
43
|
+
}, (error) => {
|
|
44
|
+
let diffSecond = parseInt((new Date() - this.nextDate) / 1000, 10);
|
|
45
|
+
if (this.connects > 5 && diffSecond < this.interval) {
|
|
46
|
+
this.client.disconnect();
|
|
47
|
+
this.error && this.error(error);
|
|
48
|
+
} else {
|
|
49
|
+
this.reconTimeout = setTimeout(() => {
|
|
50
|
+
this.connect();
|
|
51
|
+
this.connects++;
|
|
52
|
+
}, 5000);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/** 订阅服务端 */
|
|
57
|
+
subscribe() {
|
|
58
|
+
// 订阅服务端提供的某个topic
|
|
59
|
+
this.client.subscribe(this.take, (response) => {
|
|
60
|
+
if (response && (this.callback || this.success)) {
|
|
61
|
+
let callback = this.callback || this.success;
|
|
62
|
+
callback(JSON.parse(response.body));
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** 赋值、初始化socket */
|
|
68
|
+
init(option, vm) {
|
|
69
|
+
for (let i in option) {
|
|
70
|
+
this[i] = option[i];
|
|
71
|
+
}
|
|
72
|
+
this.vm = vm;
|
|
73
|
+
// 初始化连接
|
|
74
|
+
this.connect();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** 发送消息 */
|
|
78
|
+
send(data) {
|
|
79
|
+
if (this.recon) {
|
|
80
|
+
clearTimeout(this.sendTimeout);
|
|
81
|
+
this.client.send(this.take, {}, typeof data === 'string' ? data : JSON.stringify(data));
|
|
82
|
+
} else {
|
|
83
|
+
this.sendTimeout = setTimeout(() => {
|
|
84
|
+
this.send(data);
|
|
85
|
+
}, 1000);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** 销毁 */
|
|
90
|
+
destroy() {
|
|
91
|
+
// 断开连接,清除定时器
|
|
92
|
+
if (this.client) {
|
|
93
|
+
this.client.disconnect();
|
|
94
|
+
};
|
|
95
|
+
this.reconTimeout && clearTimeout(this.reconTimeout);
|
|
96
|
+
this.sendTimeout && clearTimeout(this.sendTimeout);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export default WebSocket;
|