hd-idevvue3 3.0.7 → 3.0.9

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.
Files changed (151) hide show
  1. package/dist/{static/js/index-DbUA6jg0.js → index.js} +1 -1
  2. package/package.json +7 -2
  3. package/.env.development +0 -5
  4. package/.env.production +0 -5
  5. package/.eslintrc.js +0 -151
  6. package/dist/static/js/index-Dl4O91nB.js +0 -73768
  7. package/index.html +0 -18
  8. package/pnpm-lock.yaml +0 -3541
  9. package/src/App.vue +0 -11
  10. package/src/assets/sound/notify.wav +0 -0
  11. package/src/demo/demo.vue +0 -42
  12. package/src/demo/dropdemo.vue +0 -42
  13. package/src/demo/extsets.vue +0 -208
  14. package/src/demo/formedit.vue +0 -157
  15. package/src/demo/hightquery.vue +0 -366
  16. package/src/demo/inlineedit.vue +0 -182
  17. package/src/demo/selfdrop.vue +0 -58
  18. package/src/demo//350/241/214/345/206/205/347/272/247/350/201/224.txt +0 -2
  19. package/src/directive/el-dragDialog/drag.js +0 -124
  20. package/src/directive/el-dragDialog/index.js +0 -13
  21. package/src/errorLog.js +0 -16
  22. package/src/hdcom/BigGrid.js +0 -179
  23. package/src/hdcom/BillShow.vue +0 -111
  24. package/src/hdcom/BillUpload.vue +0 -311
  25. package/src/hdcom/BtnRight.vue +0 -101
  26. package/src/hdcom/ErrHint.vue +0 -42
  27. package/src/hdcom/ExtendColumn.vue +0 -115
  28. package/src/hdcom/ExtendCommon.js +0 -40
  29. package/src/hdcom/ExtendForm.vue +0 -141
  30. package/src/hdcom/FacePicUpload.vue +0 -80
  31. package/src/hdcom/FaceRecTest.vue +0 -114
  32. package/src/hdcom/GridChart.vue +0 -207
  33. package/src/hdcom/GridExField.vue +0 -375
  34. package/src/hdcom/GridShow.vue +0 -288
  35. package/src/hdcom/HdAside.vue +0 -225
  36. package/src/hdcom/HdBtn.vue +0 -125
  37. package/src/hdcom/HdButton.vue +0 -161
  38. package/src/hdcom/HdComFaceRec.vue +0 -106
  39. package/src/hdcom/HdComGrid.vue +0 -876
  40. package/src/hdcom/HdComQuery.vue +0 -362
  41. package/src/hdcom/HdComQueryDetail.vue +0 -205
  42. package/src/hdcom/HdComSortDetail.vue +0 -161
  43. package/src/hdcom/HdDatePicker.vue +0 -94
  44. package/src/hdcom/HdDialog.vue +0 -81
  45. package/src/hdcom/HdDrop.vue +0 -188
  46. package/src/hdcom/HdFileUpload.vue +0 -167
  47. package/src/hdcom/HdFilterBox.vue +0 -90
  48. package/src/hdcom/HdFooter.vue +0 -182
  49. package/src/hdcom/HdForm.vue +0 -351
  50. package/src/hdcom/HdFormBtn.vue +0 -131
  51. package/src/hdcom/HdFormItem.vue +0 -39
  52. package/src/hdcom/HdGctosGrid +0 -0
  53. package/src/hdcom/HdGrid.vue +0 -1022
  54. package/src/hdcom/HdGridEditBtn.vue +0 -58
  55. package/src/hdcom/HdGridExt.js +0 -250
  56. package/src/hdcom/HdGridSel.vue +0 -257
  57. package/src/hdcom/HdHeader.vue +0 -180
  58. package/src/hdcom/HdHotKey.vue +0 -84
  59. package/src/hdcom/HdInputHint.vue +0 -53
  60. package/src/hdcom/HdMain.vue +0 -41
  61. package/src/hdcom/HdMessage.vue +0 -201
  62. package/src/hdcom/HdNum.vue +0 -79
  63. package/src/hdcom/HdPopSel.vue +0 -80
  64. package/src/hdcom/HdRightMenu.vue +0 -63
  65. package/src/hdcom/HdSel/SelGridFieldcod.vue +0 -54
  66. package/src/hdcom/HdTableColumn.vue +0 -381
  67. package/src/hdcom/HdTempSave.vue +0 -162
  68. package/src/hdcom/HdTree.vue +0 -103
  69. package/src/hdcom/HdTreeTable/eval.js +0 -39
  70. package/src/hdcom/HdTreeTable/index.vue +0 -229
  71. package/src/hdcom/ImportExcel.vue +0 -178
  72. package/src/hdcom/index.js +0 -75
  73. package/src/idev.common.js +0 -79
  74. package/src/index.js +0 -11
  75. package/src/utils/HdQuery.js +0 -65
  76. package/src/utils/comutils.js +0 -120
  77. package/src/utils/gogocodeTransfer.js +0 -59
  78. package/src/utils/utils.js +0 -116
  79. package/src/vendor/Blob.js +0 -187
  80. package/src/vendor/Export2Excel.js +0 -231
  81. package/src/vendor/Export2Zip.js +0 -25
  82. package/src/views/layout/AppMain.vue +0 -34
  83. package/src/views/layout/HdLayout.vue +0 -90
  84. package/src/views/layout/header/ElasticSearch.vue +0 -262
  85. package/src/views/layout/header/HZRecorder.js +0 -259
  86. package/src/views/layout/header/HeaderSearch.vue +0 -218
  87. package/src/views/layout/header/Levelbar.vue +0 -55
  88. package/src/views/layout/header/MainHeader.vue +0 -315
  89. package/src/views/layout/header/Navbar.vue +0 -101
  90. package/src/views/layout/header/ScrollPane.vue +0 -103
  91. package/src/views/layout/header/TagsView.vue +0 -215
  92. package/src/views/layout/header/VocRec.vue +0 -105
  93. package/src/views/layout/header/changepswform.vue +0 -130
  94. package/src/views/layout/index.js +0 -10
  95. package/src/views/layout/menu/Hamburger.vue +0 -63
  96. package/src/views/layout/menu/HdMenu.vue +0 -204
  97. package/src/views/layout/menu/css/menu.css +0 -288
  98. package/src/views/layout/menu/index.vue +0 -27
  99. package/src/views/privilege/commsg/commsg.vue +0 -152
  100. package/src/views/privilege/commsg/commsgOrgn.vue +0 -51
  101. package/src/views/privilege/commsg/commsgRole.vue +0 -220
  102. package/src/views/privilege/commsg/commsgform.vue +0 -184
  103. package/src/views/privilege/commsg/commsgiframe.vue +0 -40
  104. package/src/views/privilege/commsg/commsgto.vue +0 -199
  105. package/src/views/privilege/commsg/commsgtoform.vue +0 -114
  106. package/src/views/privilege/commsg/commsgtrans.vue +0 -227
  107. package/src/views/privilege/exfield/comexcolumn.vue +0 -161
  108. package/src/views/privilege/exfield/comexcolumnform.vue +0 -128
  109. package/src/views/privilege/exfield/comexfield.vue +0 -29
  110. package/src/views/privilege/exfield/comexfieldform.vue +0 -112
  111. package/src/views/privilege/exfield/comexfieldsub.vue +0 -163
  112. package/src/views/privilege/index.js +0 -41
  113. package/src/views/privilege/menu/comMenu.vue +0 -49
  114. package/src/views/privilege/menu/menu.vue +0 -250
  115. package/src/views/privilege/menu/menuinfo.vue +0 -63
  116. package/src/views/privilege/menu/rolelist.vue +0 -92
  117. package/src/views/privilege/menu/userlist.vue +0 -92
  118. package/src/views/privilege/mobile/authmobileupdate.vue +0 -145
  119. package/src/views/privilege/mobile/authmobileupdateform.vue +0 -120
  120. package/src/views/privilege/orgDept/authOrgn.vue +0 -188
  121. package/src/views/privilege/orgDept/authorgnform.vue +0 -157
  122. package/src/views/privilege/orgDept/orgDept.vue +0 -38
  123. package/src/views/privilege/orgDept/orgTree.vue +0 -99
  124. package/src/views/privilege/orgDept/orgnselect.vue +0 -155
  125. package/src/views/privilege/personDept/authuser.vue +0 -229
  126. package/src/views/privilege/personDept/authuserform.vue +0 -206
  127. package/src/views/privilege/personDept/facerec.vue +0 -162
  128. package/src/views/privilege/personDept/orgncascader.vue +0 -144
  129. package/src/views/privilege/personDept/personDept.vue +0 -33
  130. package/src/views/privilege/quartz/comquartzjob.vue +0 -150
  131. package/src/views/privilege/quartz/comquartzjobform.vue +0 -115
  132. package/src/views/privilege/quartz/comquartzlog.vue +0 -143
  133. package/src/views/privilege/role/btnRole.vue +0 -173
  134. package/src/views/privilege/role/menuRole.vue +0 -84
  135. package/src/views/privilege/role/orgnRole.vue +0 -78
  136. package/src/views/privilege/role/role.vue +0 -84
  137. package/src/views/privilege/role/rolelist.vue +0 -136
  138. package/src/views/privilege/role/roleselect.vue +0 -74
  139. package/src/views/privilege/search/comsearch.vue +0 -196
  140. package/src/views/privilege/search/menu.vue +0 -68
  141. package/src/views/privilege/syscode/syscode.vue +0 -191
  142. package/src/views/privilege/syscode/sysfield.vue +0 -119
  143. package/src/views/privilege/syscode/sysfieldframe.vue +0 -30
  144. package/src/views/privilege/syslog/menulog.vue +0 -68
  145. package/src/views/privilege/syslog/syslog.vue +0 -182
  146. package/src/views/privilege/syslog/syslogconfig.vue +0 -128
  147. package/src/views/privilege/syslog/syslogform.vue +0 -85
  148. package/src/views/privilege/syslog/syslogframe.vue +0 -26
  149. package/src/views/privilege/userRole/userRole.vue +0 -220
  150. package/vite.config.js +0 -124
  151. /package/dist/{static/css/index-DRHIlcVU.css → index.css} +0 -0
@@ -1,180 +0,0 @@
1
- <template>
2
- <ExHeader
3
- :height="nowHeight"
4
- ref="header"
5
- style="display: flex; flex-direction: column"
6
- >
7
- <div class="hdHeader">
8
- <template v-if="title">
9
- <div class="hd-title">
10
- <div align="left" style="float: left">{{ $t(title) }}</div>
11
- <slot name="title"></slot>
12
- <div align="right" v-if="arrowShow">
13
- <i
14
- @click="isShrink ? doShrink(false) : doShrink(true)"
15
- style="cursor: pointer"
16
- v-bind:class="[fa, arrowClass]"
17
- >
18
- </i>
19
- </div>
20
- </div>
21
- </template>
22
- <!--title有20的高度-->
23
- <div style="flex: 1; height: 100%; position: relative" v-show="!isShrink">
24
- <div style="position: absolute; width: 100%; height: 100%">
25
- <slot></slot>
26
- </div>
27
- </div>
28
- <div
29
- :class="{ dragShowCls: dragShow }"
30
- @mousedown="mousedown($event)"
31
- @mouseout="dragShow = false"
32
- @mouseover="dragShow = true"
33
- class="asideDrag"
34
- v-if="!noDrag"
35
- ></div>
36
- <div class="moveline" ref="moveline" v-show="dragFrom != null"></div>
37
- </div>
38
- </ExHeader>
39
- </template>
40
-
41
- <script>
42
- /**
43
- * 覆写ElHeader,增加拖动和title
44
- * 插槽:<slot name="title"></slot> title进行额外扩展如增加按钮等
45
- * @module HdHeader
46
- */
47
- export default {
48
- name: 'HdHeader',
49
- component: {},
50
- /**
51
- * Props 继承ElHeader属性和事件,如果仅需要elementui的ElHeader请使用ExHeader
52
- * @prop {String} title 标题
53
- * @prop {Boolen} arrowShow 是否显示一键收缩
54
- * @prop {Boolen} noDrag 是否可拖动,默认否
55
- */
56
- props: {
57
- height: String,
58
- title: String,
59
- arrowShow: { type: Boolean, default: true },
60
- noDrag: { type: Boolean, default: false },
61
- },
62
- inheritAttrs: false,
63
- data() {
64
- return {
65
- inputHeight: 0, //未拖拽时的高度
66
- iconCls: 'el-icon-d-caret',
67
- arrowClass: 'fa-chevron-up',
68
- fa: 'fa',
69
- isShrink: false,
70
- dragFrom: null,
71
- nowHeight: '100px',
72
- dragShow: false,
73
- }
74
- },
75
- mounted() {
76
- if (this.height) {
77
- this.nowHeight = this.height
78
- }
79
- this.inputHeight = this.nowHeight
80
- },
81
- methods: {
82
- doShrink(isShrink) {
83
- if (isShrink) {
84
- if (this.title) {
85
- this.nowHeight = '30px'
86
- } else {
87
- this.nowHeight = '15px'
88
- }
89
- this.arrowClass = 'fa-chevron-down'
90
- } else {
91
- this.nowHeight = this.inputHeight
92
- this.arrowClass = 'fa-chevron-up'
93
- }
94
- this.isShrink = isShrink
95
- },
96
- mousedown: function (event) {
97
- this.$set(this.$store.state, 'hotKey', '-1') //避免热键样式影响体验
98
- this.dragFrom = event.y
99
- this.$refs.moveline.style.top = this.dragFrom + 'px'
100
- document.documentElement.addEventListener(
101
- 'mousemove',
102
- this.handleMove,
103
- true
104
- )
105
- document.documentElement.addEventListener(
106
- 'mouseup',
107
- this.handleMouseup,
108
- true
109
- )
110
- },
111
- handleMove: function (event) {
112
- this.$refs.moveline.style.top = event.y + 'px'
113
- },
114
- handleMouseup: function (event) {
115
- document.documentElement.removeEventListener(
116
- 'mousemove',
117
- this.handleMove,
118
- true
119
- )
120
- document.documentElement.removeEventListener(
121
- 'mouseup',
122
- this.handleMouseup,
123
- true
124
- )
125
- let newHeight =
126
- this.$refs.header.$el.offsetHeight + event.y - this.dragFrom
127
- this.nowHeight = newHeight + 'px'
128
- this.dragFrom = null
129
- this.$set(this.$store.state, 'hotKey', null) //避免热键样式影响体验
130
- if (newHeight <= 70) {
131
- // 少于一定宽度自动收缩
132
- this.doShrink(true)
133
- }
134
- if (newHeight >= 100) {
135
- // 少于一定宽度自动收缩
136
- this.isShrink = false
137
- }
138
- },
139
- },
140
- watch: {
141
- nowHeight(val) {
142
- this.$emit('update:height', val)
143
- },
144
- width(val) {
145
- this.nowHeight = val
146
- },
147
- },
148
- }
149
- </script>
150
-
151
- <style lang="scss" rel="stylesheet/scss">
152
- .hdHeader {
153
- display: flex;
154
- flex-direction: column;
155
- flex: 1;
156
- }
157
-
158
- .asideDrag {
159
- width: 100%;
160
- height: 5px;
161
- overflow: hidden;
162
- cursor: ns-resize;
163
- user-select: none;
164
- }
165
-
166
- .moveline {
167
- width: 100%;
168
- height: 5px;
169
- overflow: hidden;
170
- position: fixed;
171
- cursor: ns-resize;
172
- background-color: red;
173
- z-index: 9999;
174
- user-select: none;
175
- }
176
-
177
- .dragShowCls {
178
- background-color: #409eff;
179
- }
180
- </style>
@@ -1,84 +0,0 @@
1
- <template>
2
- <div v-shortkey="keyMap" @shortkey="doMethod" v-if="isFocus"></div>
3
- </template>
4
-
5
- <script>
6
- /**
7
- * 通常不需要直接调用,HdButton中已经集成,不需要绑定按钮的快捷键,可能用到
8
- * @module HdHotKey
9
- */
10
- export default {
11
- name: 'HdHotKey',
12
- data() {
13
- return {
14
- isFocus: false,
15
- rangeThis: {}, // 快捷键有效区域
16
- }
17
- },
18
- // hdResult展示 hdQuery查询 defaultSort默认排序 pageHide true隐藏分页
19
- props: ['keyMap', 'hotKeyRange'],
20
- created() {
21
- this.rangeThis = this.getRangeThis()
22
- this.$set(this.$store.state, 'IdevFocus', -1) // 必须在watch之前先初始化
23
- },
24
- mounted() {
25
- this.$nextTick(() => {
26
- if (this.rangeThis) {
27
- const rgThisEl = this.rangeThis.$el
28
- rgThisEl.onmouseenter = () => {
29
- if (this.$store.state.hotKey != '-1')
30
- //aside拖动时,会有样式干扰
31
- this.$set(this.$store.state, 'IdevFocus', this.rangeThis._uid)
32
- }
33
- rgThisEl.onmouseleave = () => {
34
- this.$set(this.$store.state, 'IdevFocus', '-1')
35
- // this.$set(this.$route.meta, 'focusAreaId', "-1")
36
- }
37
- }
38
- })
39
- },
40
- methods: {
41
- getRangeThis() {
42
- let par = this.$parent
43
- while (par) {
44
- if (par.$options._componentTag == this.hotKeyRange) {
45
- return par
46
- }
47
- par = par.$parent
48
- }
49
- return null
50
- },
51
-
52
- doMethod(e) {
53
- this.$emit('do', e)
54
- },
55
- },
56
- watch: {
57
- '$store.state.IdevFocus'() {
58
- if (!this.rangeThis) {
59
- return false
60
- }
61
- const rgThisEl = this.rangeThis.$el
62
- if (rgThisEl) {
63
- if (this.$store.state.IdevFocus == this.rangeThis._uid) {
64
- this.isFocus = true
65
- //rgThisEl.classList.add("mouseEnter");
66
- } else {
67
- //rgThisEl.classList.remove("mouseEnter");
68
- this.isFocus = false
69
- }
70
- }
71
- },
72
- },
73
- }
74
- </script>
75
-
76
- <style lang="scss" rel="stylesheet/scss">
77
- .mouseEnter {
78
- //1.15 wxl去掉用途不大
79
- /*border-width: 0 0 2px 0;*/
80
- /*border-color: #2d8ac7;*/
81
- /*border-style: solid;*/
82
- //padding: 1px;
83
- }
84
- </style>
@@ -1,53 +0,0 @@
1
- <template>
2
- <el-autocomplete
3
- :fetch-suggestions="querySearch"
4
- :placeholder="$t(placeholder)"
5
- :model-value="value"
6
- @input="(v) => $emit('input', v)"
7
- @select="handleSelect"
8
- style="width: 100%"
9
- ></el-autocomplete>
10
- </template>
11
-
12
- <script>
13
- export default {
14
- data() {
15
- return {
16
- options: [],
17
- }
18
- },
19
- props: ['value', 'field', 'placeholder'],
20
- mounted() {
21
- this.doQuery()
22
- },
23
- methods: {
24
- doQuery() {
25
- let quUrl =
26
- '/webresources/login/privilege/SysCode/findAll?fieldCod=' + this.field
27
- this.$http.get(quUrl).then((response) => {
28
- response.data.forEach((v) => {
29
- this.options.push({ value: v.name })
30
- })
31
- })
32
- },
33
- querySearch(queryString, cb) {
34
- console.info(this.options)
35
- let results = queryString
36
- ? this.options.filter(this.createFilter(queryString))
37
- : this.options
38
- // 调用 callback 返回建议列表的数据
39
- cb(results)
40
- },
41
- createFilter(queryString) {
42
- return (dropLs) => {
43
- return (
44
- dropLs.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
45
- )
46
- }
47
- },
48
- handleSelect(item) {
49
- this.$emit('input', item.value)
50
- },
51
- },
52
- }
53
- </script>
@@ -1,41 +0,0 @@
1
- <template>
2
- <ExMain v-bind="$attrs" class="hdMain">
3
- <template v-if="title">
4
- <div class="hd-title">
5
- {{ $t(title) }}
6
- <slot name="title"></slot>
7
- </div>
8
- </template>
9
- <div style="flex: 1; height: 100%; position: relative">
10
- <!--需要这样写 上下布局-->
11
- <div style="position: absolute; width: 100%; height: 100%">
12
- <slot></slot>
13
- </div>
14
- </div>
15
- </ExMain>
16
- </template>
17
-
18
- <script>
19
- /**
20
- * 覆写ElMain,增加title
21
- * 插槽:<slot name="title"></slot> title进行额外扩展如增加按钮等
22
- * @module HdMain
23
- */
24
- export default {
25
- name: 'HdMain',
26
- component: {},
27
- props: ['title'],
28
- inheritAttrs: false,
29
- data() {
30
- return {}
31
- },
32
- mounted() {},
33
- }
34
- </script>
35
-
36
- <style lang="scss" rel="stylesheet/scss">
37
- .hdMain {
38
- display: flex !important; //在主题切换时,会被el-main取消,所以需要important
39
- flex-direction: column;
40
- }
41
- </style>
@@ -1,201 +0,0 @@
1
- <template></template>
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
- },
16
- /**
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的会弹出系统自带的消息框
21
- */
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
- })
35
- }
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("连接发生错误");
49
- }
50
-
51
- // 连接成功建立的回调方法
52
- this.websocket.onopen = () => {
53
- console.info('websocket success')
54
- this.doHeartConnect() //开启心跳连接
55
- //this.doMsg("连接成功");
56
- }
57
-
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
65
- }
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)
72
- }
73
- this.$emit('msgRec', msgObj) //父类处理事件
74
- }
75
-
76
- // 连接关闭的回调方法
77
- this.websocket.onclose = () => {
78
- console.info('websocket close,restart')
79
- if (this.websocket != -1) {
80
- //连接错误,停止使用
81
- this.websocket = null
82
- this.init() //重新连接
83
- }
84
- }
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
- )
118
- } else {
119
- this.websocket = new WebSocket(
120
- 'ws://' + host + '/ws?token=' + this.$store.getters.token
121
- )
122
- }
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'
131
-
132
- this.$http
133
- .post('/webresources/login/com/ComMsg/find/rec', this.hdQuery)
134
- .then((response) => {
135
- if (response.data.total === 0) {
136
- return
137
- }
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
158
- }
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()
165
-
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
175
- }
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')
193
- }
194
- } catch (e) {
195
- console.error(e)
196
- }
197
- }, 30000)
198
- },
199
- },
200
- }
201
- </script>
@@ -1,79 +0,0 @@
1
- <template>
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>
14
- </template>
15
-
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,
29
- /**
30
- * Props 不继承任何属性
31
- * @prop {int} value 值,组件使用 v-model=""
32
- * @prop {int} step 步长
33
- * @prop {boolean} disabled
34
- * @change
35
- * @blur
36
- */
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
61
- }
62
- },
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))
71
- } else {
72
- this.mynum = val
73
- }
74
- },
75
- immediate: true,
76
- },
77
- },
78
- }
79
- </script>