hd-idevvue3 3.0.3 → 3.0.4
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/dist/assets/index.9c127719.css +1 -0
- package/dist/hd-idevvue3.mjs +3521 -3305
- package/dist/hd-idevvue3.umd.js +29 -29
- package/npminstall-debug.log +2 -10
- package/package.json +3 -1
- package/pnpm-lock.yaml +37 -4
- package/src/App.vue +11 -15
- package/src/assets/sound/notify.wav +0 -0
- package/src/demo/demo.vue +9 -10
- package/src/demo/dropdemo.vue +42 -43
- package/src/demo/extsets.vue +140 -39
- package/src/demo/formedit.vue +157 -145
- package/src/demo/hightquery.vue +263 -66
- package/src/demo/inlineedit.vue +129 -35
- package/src/demo/selfdrop.vue +32 -15
- package/src/directive/el-dragDialog/drag.js +13 -13
- package/src/directive/el-dragDialog/index.js +13 -13
- package/src/errorLog.js +3 -3
- package/src/hdcom/BigGrid.js +54 -48
- package/src/hdcom/BillShow.vue +84 -63
- package/src/hdcom/BillUpload.vue +144 -86
- package/src/hdcom/BtnRight.vue +26 -23
- package/src/hdcom/ErrHint.vue +36 -24
- package/src/hdcom/ExtendColumn.vue +97 -90
- package/src/hdcom/ExtendCommon.js +24 -13
- package/src/hdcom/ExtendForm.vue +107 -80
- package/src/hdcom/FacePicUpload.vue +59 -50
- package/src/hdcom/FaceRecTest.vue +87 -77
- package/src/hdcom/GridChart.vue +175 -162
- package/src/hdcom/GridExField.vue +328 -234
- package/src/hdcom/GridShow.vue +89 -39
- package/src/hdcom/HdAside.vue +192 -145
- package/src/hdcom/HdBtn.vue +44 -32
- package/src/hdcom/HdButton.vue +141 -117
- package/src/hdcom/HdComFaceRec.vue +80 -32
- package/src/hdcom/HdComGrid.vue +329 -229
- package/src/hdcom/HdComQuery.vue +179 -90
- package/src/hdcom/HdComQueryDetail.vue +159 -115
- package/src/hdcom/HdComSortDetail.vue +136 -130
- package/src/hdcom/HdDatePicker.vue +32 -16
- package/src/hdcom/HdDialog.vue +62 -44
- package/src/hdcom/HdDrop.vue +163 -138
- package/src/hdcom/HdFileUpload.vue +138 -119
- package/src/hdcom/HdFilterBox.vue +62 -62
- package/src/hdcom/HdFooter.vue +152 -119
- package/src/hdcom/HdForm.vue +276 -203
- package/src/hdcom/HdFormBtn.vue +81 -39
- package/src/hdcom/HdFormItem.vue +14 -10
- package/src/hdcom/HdGrid.vue +353 -156
- package/src/hdcom/HdGridEditBtn.vue +34 -20
- package/src/hdcom/HdGridExt.js +78 -47
- package/src/hdcom/HdGridSel.vue +227 -193
- package/src/hdcom/HdHeader.vue +149 -117
- package/src/hdcom/HdHotKey.vue +70 -67
- package/src/hdcom/HdInputHint.vue +40 -36
- package/src/hdcom/HdMain.vue +25 -27
- package/src/hdcom/HdMessage.vue +180 -171
- package/src/hdcom/HdNum.vue +67 -57
- package/src/hdcom/HdPopSel.vue +46 -24
- package/src/hdcom/HdRightMenu.vue +63 -61
- package/src/hdcom/HdSel/SelGridFieldcod.vue +46 -28
- package/src/hdcom/HdTableColumn.vue +156 -109
- package/src/hdcom/HdTempSave.vue +138 -116
- package/src/hdcom/HdTree.vue +89 -72
- package/src/hdcom/HdTreeTable/eval.js +8 -3
- package/src/hdcom/HdTreeTable/index.vue +229 -174
- package/src/hdcom/ImportExcel.vue +69 -34
- package/src/hdcom/index.js +39 -44
- package/src/idev.common.js +54 -47
- package/src/index.js +3 -6
- package/src/utils/HdQuery.js +25 -14
- package/src/utils/comutils.js +50 -28
- package/src/utils/gogocodeTransfer.js +59 -0
- package/src/utils/utils.js +30 -19
- package/src/vendor/Blob.js +187 -179
- package/src/vendor/Export2Excel.js +231 -220
- package/src/vendor/Export2Zip.js +25 -22
- package/src/views/layout/AppMain.vue +34 -32
- package/src/views/layout/HdLayout.vue +64 -52
- package/src/views/layout/header/ElasticSearch.vue +196 -159
- package/src/views/layout/header/HZRecorder.js +163 -135
- package/src/views/layout/header/HeaderSearch.vue +165 -145
- package/src/views/layout/header/Levelbar.vue +55 -49
- package/src/views/layout/header/MainHeader.vue +233 -189
- package/src/views/layout/header/Navbar.vue +74 -78
- package/src/views/layout/header/ScrollPane.vue +103 -81
- package/src/views/layout/header/TagsView.vue +169 -164
- package/src/views/layout/header/VocRec.vue +86 -78
- package/src/views/layout/header/changepswform.vue +98 -64
- package/src/views/layout/index.js +5 -7
- package/src/views/layout/menu/Hamburger.vue +63 -45
- package/src/views/layout/menu/HdMenu.vue +155 -118
- package/src/views/layout/menu/index.vue +21 -19
- package/src/views/privilege/commsg/commsg.vue +115 -41
- package/src/views/privilege/commsg/commsgOrgn.vue +40 -31
- package/src/views/privilege/commsg/commsgRole.vue +180 -109
- package/src/views/privilege/commsg/commsgform.vue +125 -101
- package/src/views/privilege/commsg/commsgiframe.vue +30 -23
- package/src/views/privilege/commsg/commsgto.vue +163 -84
- package/src/views/privilege/commsg/commsgtoform.vue +64 -58
- package/src/views/privilege/commsg/commsgtrans.vue +187 -115
- package/src/views/privilege/exfield/comexcolumn.vue +133 -43
- package/src/views/privilege/exfield/comexcolumnform.vue +85 -58
- package/src/views/privilege/exfield/comexfield.vue +15 -17
- package/src/views/privilege/exfield/comexfieldform.vue +71 -53
- package/src/views/privilege/exfield/comexfieldsub.vue +137 -46
- package/src/views/privilege/index.js +19 -20
- package/src/views/privilege/menu/comMenu.vue +49 -41
- package/src/views/privilege/menu/menu.vue +166 -49
- package/src/views/privilege/menu/menuinfo.vue +41 -34
- package/src/views/privilege/menu/rolelist.vue +78 -33
- package/src/views/privilege/menu/userlist.vue +76 -33
- package/src/views/privilege/mobile/authmobileupdate.vue +119 -43
- package/src/views/privilege/mobile/authmobileupdateform.vue +76 -46
- package/src/views/privilege/orgDept/authOrgn.vue +157 -65
- package/src/views/privilege/orgDept/authorgnform.vue +50 -38
- package/src/views/privilege/orgDept/orgDept.vue +38 -37
- package/src/views/privilege/orgDept/orgTree.vue +99 -88
- package/src/views/privilege/orgDept/orgnselect.vue +132 -111
- package/src/views/privilege/personDept/authuser.vue +197 -91
- package/src/views/privilege/personDept/authuserform.vue +123 -71
- package/src/views/privilege/personDept/facerec.vue +128 -83
- package/src/views/privilege/personDept/orgncascader.vue +134 -115
- package/src/views/privilege/personDept/personDept.vue +9 -7
- package/src/views/privilege/quartz/comquartzjob.vue +123 -38
- package/src/views/privilege/quartz/comquartzjobform.vue +67 -51
- package/src/views/privilege/quartz/comquartzlog.vue +116 -32
- package/src/views/privilege/role/btnRole.vue +123 -67
- package/src/views/privilege/role/menuRole.vue +65 -45
- package/src/views/privilege/role/orgnRole.vue +63 -41
- package/src/views/privilege/role/role.vue +26 -9
- package/src/views/privilege/role/rolelist.vue +114 -45
- package/src/views/privilege/role/roleselect.vue +34 -17
- package/src/views/privilege/search/comsearch.vue +164 -73
- package/src/views/privilege/search/menu.vue +38 -22
- package/src/views/privilege/syscode/syscode.vue +157 -69
- package/src/views/privilege/syscode/sysfield.vue +96 -43
- package/src/views/privilege/syscode/sysfieldframe.vue +30 -30
- package/src/views/privilege/syslog/menulog.vue +38 -22
- package/src/views/privilege/syslog/syslog.vue +145 -78
- package/src/views/privilege/syslog/syslogconfig.vue +91 -24
- package/src/views/privilege/syslog/syslogform.vue +45 -43
- package/src/views/privilege/syslog/syslogframe.vue +26 -26
- package/src/views/privilege/userRole/userRole.vue +187 -89
- package/vite.config.js +7 -0
- package/dist/assets/index.774ef40e.css +0 -1
- package/src/views/privilege.zip +0 -0
package/src/hdcom/HdMessage.vue
CHANGED
|
@@ -1,192 +1,201 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
</template>
|
|
3
|
-
<script>
|
|
1
|
+
<template></template>
|
|
4
2
|
|
|
3
|
+
<script>
|
|
4
|
+
/**
|
|
5
|
+
* websocket消息
|
|
6
|
+
* @module HdMessage
|
|
7
|
+
*/
|
|
8
|
+
export default {
|
|
9
|
+
name: 'HdMessage',
|
|
10
|
+
data() {
|
|
11
|
+
return {
|
|
12
|
+
hdQuery: new HdQuery(this),
|
|
13
|
+
websocket: null,
|
|
14
|
+
}
|
|
15
|
+
},
|
|
5
16
|
/**
|
|
6
|
-
*
|
|
7
|
-
* @
|
|
17
|
+
* prop
|
|
18
|
+
* @prop {allProto} 完整格式 如 wss://gctos.huadong.net/ws,与ipAddr和port互斥
|
|
19
|
+
* @prop {String} ipAddr 有值时,使用该值,无值时,localhost下 为localhost:8080,其它用浏览器的url
|
|
20
|
+
* @prop {Event} msgRec 消息接收的事件,类型1的会弹出系统自带的消息框
|
|
8
21
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
22
|
+
props: ['ipAddr', 'port', 'allProto'],
|
|
23
|
+
mounted() {
|
|
24
|
+
window._tabOpen = (path) => {
|
|
25
|
+
//这里必须是全局的
|
|
26
|
+
if (path.indexOf('http') == 0) {
|
|
27
|
+
//http开头的在新窗口打开
|
|
28
|
+
window.open(path)
|
|
29
|
+
} else if (path.indexOf('iframe://') == 0) {
|
|
30
|
+
// this.$refs['commsgiframe'].show(path.substring(9));
|
|
31
|
+
} else {
|
|
32
|
+
this.$router.push({
|
|
33
|
+
path: path,
|
|
34
|
+
})
|
|
15
35
|
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
// this.$refs['commsgiframe'].show(path.substring(9));
|
|
30
|
-
} else {
|
|
31
|
-
this.$router.push({
|
|
32
|
-
path: path,
|
|
33
|
-
});
|
|
34
|
-
}
|
|
36
|
+
}
|
|
37
|
+
this.init()
|
|
38
|
+
this.readMessage()
|
|
39
|
+
},
|
|
40
|
+
methods: {
|
|
41
|
+
init() {
|
|
42
|
+
this.socketConnect()
|
|
43
|
+
|
|
44
|
+
// 连接发生错误的回调方法
|
|
45
|
+
this.websocket.onerror = () => {
|
|
46
|
+
this.websocket = -1
|
|
47
|
+
console.info('连接发生错误')
|
|
48
|
+
//this.doMsg("连接发生错误");
|
|
35
49
|
}
|
|
36
|
-
this.init()
|
|
37
|
-
this.readMessage();
|
|
38
|
-
},
|
|
39
|
-
methods: {
|
|
40
|
-
init() {
|
|
41
|
-
this.socketConnect()
|
|
42
50
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
51
|
+
// 连接成功建立的回调方法
|
|
52
|
+
this.websocket.onopen = () => {
|
|
53
|
+
console.info('websocket success')
|
|
54
|
+
this.doHeartConnect() //开启心跳连接
|
|
55
|
+
//this.doMsg("连接成功");
|
|
56
|
+
}
|
|
49
57
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
58
|
+
// 接收到消息的回调方法,此处添加处理接收消息方法,当前是将接收到的信息显示在网页上
|
|
59
|
+
this.websocket.onmessage = (event) => {
|
|
60
|
+
let msgObj = JSON.parse(event.data)
|
|
61
|
+
if (msgObj.msgType == -2) {
|
|
62
|
+
//单用户登录:退出到登录页
|
|
63
|
+
this.singleLoginNotify(msgObj)
|
|
64
|
+
return false
|
|
55
65
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return false
|
|
63
|
-
}
|
|
64
|
-
//未读消息加一
|
|
65
|
-
this.$store.state.user.messageNum = this.$store.state.user.messageNum + 1;
|
|
66
|
-
if (msgObj.msgType == 1) {//type 1为普通消息,默认提示,其它类型发送给业务系统判断
|
|
67
|
-
this.doMsgObj(msgObj);
|
|
68
|
-
}
|
|
69
|
-
this.$emit('msgRec', msgObj)//父类处理事件
|
|
66
|
+
//未读消息加一
|
|
67
|
+
this.$store.state.user.messageNum =
|
|
68
|
+
this.$store.state.user.messageNum + 1
|
|
69
|
+
if (msgObj.msgType == 1) {
|
|
70
|
+
//type 1为普通消息,默认提示,其它类型发送给业务系统判断
|
|
71
|
+
this.doMsgObj(msgObj)
|
|
70
72
|
}
|
|
73
|
+
this.$emit('msgRec', msgObj) //父类处理事件
|
|
74
|
+
}
|
|
71
75
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
// 连接关闭的回调方法
|
|
77
|
+
this.websocket.onclose = () => {
|
|
78
|
+
console.info('websocket close,restart')
|
|
79
|
+
if (this.websocket != -1) {
|
|
80
|
+
//连接错误,停止使用
|
|
81
|
+
this.websocket = null
|
|
82
|
+
this.init() //重新连接
|
|
79
83
|
}
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
,
|
|
83
|
-
singleLoginNotify(msgObj) {
|
|
84
|
-
this.$notify({
|
|
85
|
-
title: '',
|
|
86
|
-
message: this.$t('该账号已在其它地方登录,5秒后将退出系统'),
|
|
87
|
-
duration: 5000,
|
|
88
|
-
onClose: () => {
|
|
89
|
-
this.$store.dispatch('LogOut').then(() => {
|
|
90
|
-
location.reload()// 为了重新实例化vue-router对象 避免bug
|
|
91
|
-
})
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
84
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
85
|
+
},
|
|
86
|
+
singleLoginNotify(msgObj) {
|
|
87
|
+
this.$notify({
|
|
88
|
+
title: '',
|
|
89
|
+
message: this.$t('该账号已在其它地方登录,5秒后将退出系统'),
|
|
90
|
+
duration: 5000,
|
|
91
|
+
onClose: () => {
|
|
92
|
+
this.$store.dispatch('LogOut').then(() => {
|
|
93
|
+
location.reload() // 为了重新实例化vue-router对象 避免bug
|
|
94
|
+
})
|
|
95
|
+
},
|
|
96
|
+
})
|
|
97
|
+
},
|
|
98
|
+
socketConnect() {
|
|
99
|
+
// 判断当前浏览器是否支持WebSocket
|
|
100
|
+
let inPort = this.port
|
|
101
|
+
if ('WebSocket' in window) {
|
|
102
|
+
if (!this.port) {
|
|
103
|
+
inPort = '8080'
|
|
104
|
+
}
|
|
105
|
+
// let host = "127.0.0.1:8080" //window.location.host
|
|
106
|
+
let host = window.location.host //window.location.host
|
|
107
|
+
// 创建一个WebSocket连接,URL:127.0.0.1:8080/realTimeWebSocket/webSocket
|
|
108
|
+
if (host.indexOf('localhost') >= 0) {
|
|
109
|
+
host = '127.0.0.1:' + inPort
|
|
110
|
+
}
|
|
111
|
+
if (this.ipAddr) {
|
|
112
|
+
host = this.ipAddr + ':' + inPort
|
|
113
|
+
}
|
|
114
|
+
if (this.allProto) {
|
|
115
|
+
this.websocket = new WebSocket(
|
|
116
|
+
this.allProto + '?token=' + this.$store.getters.token
|
|
117
|
+
)
|
|
117
118
|
} else {
|
|
118
|
-
|
|
119
|
+
this.websocket = new WebSocket(
|
|
120
|
+
'ws://' + host + '/ws?token=' + this.$store.getters.token
|
|
121
|
+
)
|
|
119
122
|
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
} else {
|
|
124
|
+
alert('当前浏览器 不支持WebSocket')
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
readMessage() {
|
|
128
|
+
this.hdQuery.query.readFlg = '0'
|
|
129
|
+
this.hdQuery.rows = '1000'
|
|
130
|
+
this.hdQuery.sort = 'sendTim'
|
|
125
131
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
msg.title = this.$t('消息提示');
|
|
132
|
-
msg.content = this.$t('您有{total}条未读消息', {total: response.data.total});
|
|
133
|
-
msg.url = '/privilege/commsgto'
|
|
134
|
-
this.$store.state.user.messageNum = response.data.total;
|
|
135
|
-
this.doMsgObj(msg);
|
|
136
|
-
// let data = response.data.rows;
|
|
137
|
-
// for (let i = 0; i < data.length; i++) {
|
|
138
|
-
// this.doMsgObj(data[i]);
|
|
139
|
-
// }
|
|
132
|
+
this.$http
|
|
133
|
+
.post('/webresources/login/com/ComMsg/find/rec', this.hdQuery)
|
|
134
|
+
.then((response) => {
|
|
135
|
+
if (response.data.total === 0) {
|
|
136
|
+
return
|
|
140
137
|
}
|
|
141
|
-
|
|
138
|
+
var msg = {}
|
|
139
|
+
msg.title = this.$t('消息提示')
|
|
140
|
+
msg.content = this.$t('您有{total}条未读消息', {
|
|
141
|
+
total: response.data.total,
|
|
142
|
+
})
|
|
143
|
+
msg.url = '/privilege/commsgto'
|
|
144
|
+
this.$store.state.user.messageNum = response.data.total
|
|
145
|
+
this.doMsgObj(msg)
|
|
146
|
+
// let data = response.data.rows;
|
|
147
|
+
// for (let i = 0; i < data.length; i++) {
|
|
148
|
+
// this.doMsgObj(data[i]);
|
|
149
|
+
// }
|
|
150
|
+
})
|
|
151
|
+
},
|
|
152
|
+
doMsgObj(con) {
|
|
153
|
+
let msgcon = ''
|
|
154
|
+
if (con.url) {
|
|
155
|
+
msgcon = `<a onclick="_tabOpen('${con.url}')">${con.content}</a>`
|
|
156
|
+
} else {
|
|
157
|
+
msgcon = con.content
|
|
142
158
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
msgcon = con.content
|
|
150
|
-
}
|
|
151
|
-
//document.getElementById("video").src=require('../assets/sound/notify.wav')
|
|
152
|
-
//this.notify = new Audio(require('../assets/sound/notify.wav'));
|
|
153
|
-
this.notify = new Audio(`/webresources/login/com/comwav/txtRead?text=${con.content}`);
|
|
154
|
-
this.notify.play();
|
|
159
|
+
//document.getElementById("video").src=require('../assets/sound/notify.wav')
|
|
160
|
+
//this.notify = new Audio(require('../assets/sound/notify.wav'));
|
|
161
|
+
this.notify = new Audio(
|
|
162
|
+
`/webresources/login/com/comwav/txtRead?text=${con.content}`
|
|
163
|
+
)
|
|
164
|
+
this.notify.play()
|
|
155
165
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
//消息展示完不在把消息标为已读
|
|
168
|
-
// this.$http.post('/webresources/login/com/ComMsg/read', {recId: con.msgRecId}).then(response => {
|
|
169
|
-
// var data = response.data;
|
|
170
|
-
// if (data.code != '1') {
|
|
171
|
-
// this.$message({
|
|
172
|
-
// type: 'error',
|
|
173
|
-
// message: data.message
|
|
174
|
-
// })
|
|
175
|
-
// }
|
|
176
|
-
// })
|
|
166
|
+
this.$notify({
|
|
167
|
+
dangerouslyUseHTMLString: true,
|
|
168
|
+
title: con.title,
|
|
169
|
+
message: msgcon,
|
|
170
|
+
duration: 10000,
|
|
171
|
+
position: 'bottom-right',
|
|
172
|
+
})
|
|
173
|
+
if (!con.msgRecId) {
|
|
174
|
+
con.msgRecId = con.recId
|
|
177
175
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
176
|
+
|
|
177
|
+
//消息展示完不在把消息标为已读
|
|
178
|
+
// this.$http.post('/webresources/login/com/ComMsg/read', {recId: con.msgRecId}).then(response => {
|
|
179
|
+
// var data = response.data;
|
|
180
|
+
// if (data.code != '1') {
|
|
181
|
+
// this.$message({
|
|
182
|
+
// type: 'error',
|
|
183
|
+
// message: data.message
|
|
184
|
+
// })
|
|
185
|
+
// }
|
|
186
|
+
// })
|
|
187
|
+
},
|
|
188
|
+
doHeartConnect() {
|
|
189
|
+
setInterval(() => {
|
|
190
|
+
try {
|
|
191
|
+
if (this.websocket && this.websocket != -1) {
|
|
192
|
+
this.websocket.send('ping')
|
|
187
193
|
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
194
|
+
} catch (e) {
|
|
195
|
+
console.error(e)
|
|
196
|
+
}
|
|
197
|
+
}, 30000)
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
}
|
|
192
201
|
</script>
|
package/src/hdcom/HdNum.vue
CHANGED
|
@@ -1,69 +1,79 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-input
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
<el-input
|
|
3
|
+
:clearable="false"
|
|
4
|
+
:disabled="disabled"
|
|
5
|
+
:step="step"
|
|
6
|
+
@blur="myblur"
|
|
7
|
+
@change="mychange"
|
|
8
|
+
class="hdnum"
|
|
9
|
+
onkeypress='return( "e"!=(String.fromCharCode(event.keyCode).toLowerCase()))'
|
|
10
|
+
ref="numInput"
|
|
11
|
+
type="number"
|
|
12
|
+
v-model.lazy="mynum"
|
|
13
|
+
></el-input>
|
|
6
14
|
</template>
|
|
7
|
-
|
|
15
|
+
|
|
8
16
|
<script>
|
|
17
|
+
/**
|
|
18
|
+
* 输入区为数字时使用,请勿直接使用el-input(校验时空处理有问题)
|
|
19
|
+
* @module HdNum
|
|
20
|
+
*/
|
|
21
|
+
export default {
|
|
22
|
+
name: 'HdNum',
|
|
23
|
+
data() {
|
|
24
|
+
return {
|
|
25
|
+
mynum: null,
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
inheritAttrs: false,
|
|
9
29
|
/**
|
|
10
|
-
*
|
|
11
|
-
* @
|
|
30
|
+
* Props 不继承任何属性
|
|
31
|
+
* @prop {int} value 值,组件使用 v-model=""
|
|
32
|
+
* @prop {int} step 步长
|
|
33
|
+
* @prop {boolean} disabled
|
|
34
|
+
* @change
|
|
35
|
+
* @blur
|
|
12
36
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
37
|
+
props: ['value', 'step', 'disabled'],
|
|
38
|
+
methods: {
|
|
39
|
+
mychange(evt) {
|
|
40
|
+
if (typeof evt == 'undefined' || evt === '') {
|
|
41
|
+
// 空字符串设置为null
|
|
42
|
+
this.mynum = null
|
|
43
|
+
this.$emit('input', null)
|
|
44
|
+
} else {
|
|
45
|
+
this.mynum = parseFloat(evt)
|
|
46
|
+
this.$emit('input', parseFloat(evt))
|
|
47
|
+
}
|
|
48
|
+
this.$emit('change', evt)
|
|
49
|
+
},
|
|
50
|
+
myblur(evt) {
|
|
51
|
+
this.$emit('blur', evt)
|
|
52
|
+
},
|
|
53
|
+
isNumber(val) {
|
|
54
|
+
var regPos = /^\d+(\.\d+)?$/ //非负浮点数
|
|
55
|
+
var regNeg =
|
|
56
|
+
/^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/ //负浮点数
|
|
57
|
+
if (regPos.test(val) || regNeg.test(val)) {
|
|
58
|
+
return true
|
|
59
|
+
} else {
|
|
60
|
+
return false
|
|
18
61
|
}
|
|
19
62
|
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
*/
|
|
29
|
-
props: ['value', 'step', 'disabled'],
|
|
30
|
-
methods: {
|
|
31
|
-
mychange(evt) {
|
|
32
|
-
if (typeof (evt) == 'undefined' || evt === '') { // 空字符串设置为null
|
|
33
|
-
this.mynum = null
|
|
34
|
-
this.$emit('input', null)
|
|
63
|
+
},
|
|
64
|
+
watch: {
|
|
65
|
+
// 给外层v-model赋值
|
|
66
|
+
value: {
|
|
67
|
+
handler: function (val, oldVal) {
|
|
68
|
+
if (val && this.isNumber(val)) {
|
|
69
|
+
this.mynum = parseFloat(val)
|
|
70
|
+
this.$emit('input', parseFloat(val))
|
|
35
71
|
} else {
|
|
36
|
-
this.mynum =
|
|
37
|
-
this.$emit('input', parseFloat(evt))
|
|
72
|
+
this.mynum = val
|
|
38
73
|
}
|
|
39
|
-
this.$emit('change', evt)
|
|
40
|
-
},
|
|
41
|
-
myblur(evt) {
|
|
42
|
-
this.$emit('blur', evt)
|
|
43
74
|
},
|
|
44
|
-
|
|
45
|
-
var regPos = /^\d+(\.\d+)?$/; //非负浮点数
|
|
46
|
-
var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
|
|
47
|
-
if (regPos.test(val) || regNeg.test(val)) {
|
|
48
|
-
return true;
|
|
49
|
-
} else {
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
75
|
+
immediate: true,
|
|
53
76
|
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
handler: function (val, oldVal) {
|
|
57
|
-
if(val && this.isNumber(val)){
|
|
58
|
-
this.mynum = parseFloat(val)
|
|
59
|
-
this.$emit('input', parseFloat(val))
|
|
60
|
-
} else {
|
|
61
|
-
this.mynum = val
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
immediate: true
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
77
|
+
},
|
|
78
|
+
}
|
|
69
79
|
</script>
|
package/src/hdcom/HdPopSel.vue
CHANGED
|
@@ -1,44 +1,60 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-input
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
<el-input
|
|
3
|
+
v-bind="$attrs"
|
|
4
|
+
v-on="$listeners"
|
|
5
|
+
:placeholder="placeholder ? placeholder : ''"
|
|
6
|
+
:model-value="txtVal"
|
|
7
|
+
readonly
|
|
8
|
+
@focus="$emit('focus')"
|
|
9
|
+
:disabled="disabled"
|
|
10
|
+
ref="sel"
|
|
11
|
+
@mouseenter.native="doMouseEnter"
|
|
12
|
+
@mouseleave.native="doMouseLeave"
|
|
13
|
+
:clearable="false"
|
|
14
|
+
>
|
|
15
|
+
<el-icon class="el-input__icon" style="cursor: pointer"
|
|
16
|
+
><el-icon-circle-close
|
|
17
|
+
/></el-icon>
|
|
18
|
+
<el-icon class="el-input__icon" style="cursor: pointer"
|
|
19
|
+
><el-icon-more
|
|
20
|
+
/></el-icon>
|
|
9
21
|
</el-input>
|
|
10
22
|
</template>
|
|
11
|
-
|
|
12
|
-
.lucencyInput .el-input__inner {
|
|
13
|
-
border: 0px;
|
|
14
|
-
}
|
|
15
|
-
</style>
|
|
23
|
+
|
|
16
24
|
<script>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
import {
|
|
26
|
+
CircleClose as ElIconCircleClose,
|
|
27
|
+
More as ElIconMore,
|
|
28
|
+
} from '@element-plus/icons'
|
|
21
29
|
export default {
|
|
30
|
+
components: {
|
|
31
|
+
ElIconCircleClose,
|
|
32
|
+
ElIconMore,
|
|
33
|
+
},
|
|
22
34
|
name: 'HdPoPSel',
|
|
23
35
|
data() {
|
|
24
36
|
return {
|
|
25
37
|
popShow: this.show,
|
|
26
|
-
threePointShow: true
|
|
38
|
+
threePointShow: true,
|
|
27
39
|
}
|
|
28
40
|
},
|
|
29
41
|
inheritAttrs: false,
|
|
42
|
+
// 设置value为props属性-必须
|
|
30
43
|
props: {
|
|
31
|
-
show: Boolean,
|
|
32
|
-
|
|
44
|
+
show: Boolean,
|
|
45
|
+
txtVal: String,
|
|
46
|
+
idVal: String,
|
|
47
|
+
placeholder: String,
|
|
48
|
+
disabled: Boolean,
|
|
49
|
+
},
|
|
33
50
|
mounted() {
|
|
34
|
-
$(this.$parent.$el).find('.el-popover__reference').removeAttr('tabIndex')// 焦点用
|
|
51
|
+
$(this.$parent.$el).find('.el-popover__reference').removeAttr('tabIndex') // 焦点用
|
|
35
52
|
},
|
|
36
53
|
methods: {
|
|
37
54
|
focus() {
|
|
38
55
|
this.$refs.sel.focus()
|
|
39
56
|
},
|
|
40
|
-
doQuery() {
|
|
41
|
-
},
|
|
57
|
+
doQuery() {},
|
|
42
58
|
doClear() {
|
|
43
59
|
this.$emit('clear')
|
|
44
60
|
},
|
|
@@ -52,7 +68,13 @@ export default {
|
|
|
52
68
|
},
|
|
53
69
|
doMouseLeave() {
|
|
54
70
|
this.threePointShow = true
|
|
55
|
-
}
|
|
56
|
-
}
|
|
71
|
+
},
|
|
72
|
+
},
|
|
57
73
|
}
|
|
58
74
|
</script>
|
|
75
|
+
|
|
76
|
+
<style>
|
|
77
|
+
.lucencyInput .el-input__inner {
|
|
78
|
+
border: 0px;
|
|
79
|
+
}
|
|
80
|
+
</style>
|