hd-idevvue3 3.0.2 → 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 +4 -2
- 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
|
@@ -2,209 +2,214 @@
|
|
|
2
2
|
<div class="tags-view-container">
|
|
3
3
|
<scroll-pane class="tags-view-container" ref="scrollPane">
|
|
4
4
|
<router-link
|
|
5
|
-
:class="isActive(tag)?'active':''"
|
|
5
|
+
:class="isActive(tag) ? 'active' : ''"
|
|
6
6
|
:key="tag.name"
|
|
7
|
-
:to="{ name: tag.name, params: tag.addQuery}"
|
|
7
|
+
:to="{ name: tag.name, params: tag.addQuery }"
|
|
8
8
|
@click.middle.native="closeSelectedTag(tag)"
|
|
9
|
-
@contextmenu.prevent.native="openMenu(tag
|
|
9
|
+
@contextmenu.prevent.native="openMenu(tag, $event)"
|
|
10
10
|
class="tags-view-item"
|
|
11
11
|
ref="tag"
|
|
12
|
-
v-for="tag in Array.from(visitedViews)"
|
|
12
|
+
v-for="tag in Array.from(visitedViews)"
|
|
13
|
+
>
|
|
14
|
+
<!--name是menuId -->
|
|
13
15
|
{{ $i18n.locale == 'zh' ? tag.title : tag.enTitle }}
|
|
14
|
-
<span @click.stop="closeViewTags(tag
|
|
16
|
+
<span @click.stop="closeViewTags(tag, $event)" class="el-icon-close" />
|
|
15
17
|
</router-link>
|
|
16
|
-
<div @click="headerToggle()" style="position: fixed;right: 20px"
|
|
17
|
-
|
|
18
|
+
<div @click="headerToggle()" style="position: fixed; right: 20px">
|
|
19
|
+
<i :class="showHeaderCls" style="font-size: 20px; color: #4d90fe"></i>
|
|
18
20
|
</div>
|
|
19
21
|
</scroll-pane>
|
|
20
|
-
<ul
|
|
22
|
+
<ul
|
|
23
|
+
:style="{ left: left + 'px', top: top + 'px' }"
|
|
24
|
+
class="context-menu"
|
|
25
|
+
v-show="visible"
|
|
26
|
+
>
|
|
21
27
|
<li @click="refreshSelectedTag()">{{ $t('tagsView.refresh') }}</li>
|
|
22
28
|
<li @click="closeOthersTags">{{ $t('tagsView.closeOthers') }}</li>
|
|
23
29
|
<li @click="closeAllTags">{{ $t('tagsView.closeAll') }}</li>
|
|
24
30
|
<li @click="openInNewWin()">{{ $t('tagsView.openNew') }}</li>
|
|
25
31
|
</ul>
|
|
26
|
-
|
|
27
32
|
</div>
|
|
28
33
|
</template>
|
|
29
34
|
|
|
30
35
|
<script>
|
|
31
|
-
|
|
36
|
+
import ScrollPane from './ScrollPane'
|
|
32
37
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
export default {
|
|
39
|
+
components: { ScrollPane },
|
|
40
|
+
data() {
|
|
41
|
+
return {
|
|
42
|
+
visible: false,
|
|
43
|
+
top: 0,
|
|
44
|
+
left: 0,
|
|
45
|
+
showHeaderCls: 'el-icon-upload2',
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
computed: {
|
|
49
|
+
visitedViews() {
|
|
50
|
+
return this.$store.state.app.visitedViews
|
|
42
51
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
52
|
+
},
|
|
53
|
+
watch: {
|
|
54
|
+
$route() {
|
|
55
|
+
this.addViewTags()
|
|
47
56
|
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
visible(value) {
|
|
54
|
-
if (value) {
|
|
55
|
-
document.body.addEventListener('click', this.closeMenu)
|
|
56
|
-
} else {
|
|
57
|
-
document.body.removeEventListener('click', this.closeMenu)
|
|
58
|
-
}
|
|
57
|
+
visible(value) {
|
|
58
|
+
if (value) {
|
|
59
|
+
document.body.addEventListener('click', this.closeMenu)
|
|
60
|
+
} else {
|
|
61
|
+
document.body.removeEventListener('click', this.closeMenu)
|
|
59
62
|
}
|
|
60
63
|
},
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
},
|
|
65
|
+
mounted() {
|
|
66
|
+
this.addViewTags()
|
|
67
|
+
},
|
|
68
|
+
methods: {
|
|
69
|
+
headerToggle() {
|
|
70
|
+
let st = this.$store.state.app.headerShow
|
|
71
|
+
if (st === false) {
|
|
72
|
+
this.showHeaderCls = 'el-icon-upload2'
|
|
73
|
+
this.$set(this.$store.state.app, 'headerShow', true)
|
|
74
|
+
} else {
|
|
75
|
+
this.showHeaderCls = 'el-icon-download'
|
|
76
|
+
this.$set(this.$store.state.app, 'headerShow', false)
|
|
77
|
+
}
|
|
63
78
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
this.$set(this.$store.state.app, 'headerShow', false)
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
closeViewTags(view, $event) {
|
|
76
|
-
this.$store.dispatch('delView', view).then((views) => {
|
|
77
|
-
if (this.isActive(view)) {
|
|
78
|
-
const latestView = views.slice(-1)[0]
|
|
79
|
-
if (latestView) {
|
|
80
|
-
this.$router.push(latestView.path)
|
|
81
|
-
} else {
|
|
82
|
-
this.$router.push('/')
|
|
83
|
-
}
|
|
79
|
+
closeViewTags(view, $event) {
|
|
80
|
+
this.$store.dispatch('delView', view).then((views) => {
|
|
81
|
+
if (this.isActive(view)) {
|
|
82
|
+
const latestView = views.slice(-1)[0]
|
|
83
|
+
if (latestView) {
|
|
84
|
+
this.$router.push(latestView.path)
|
|
85
|
+
} else {
|
|
86
|
+
this.$router.push('/')
|
|
84
87
|
}
|
|
85
|
-
})
|
|
86
|
-
$event.preventDefault()
|
|
87
|
-
},
|
|
88
|
-
generateRoute() {
|
|
89
|
-
if (this.$route.name) {
|
|
90
|
-
return this.$route
|
|
91
88
|
}
|
|
89
|
+
})
|
|
90
|
+
$event.preventDefault()
|
|
91
|
+
},
|
|
92
|
+
generateRoute() {
|
|
93
|
+
if (this.$route.name) {
|
|
94
|
+
return this.$route
|
|
95
|
+
}
|
|
96
|
+
return false
|
|
97
|
+
},
|
|
98
|
+
addViewTags() {
|
|
99
|
+
const route = this.generateRoute()
|
|
100
|
+
if (!route) {
|
|
92
101
|
return false
|
|
93
|
-
},
|
|
94
|
-
addViewTags() {
|
|
95
|
-
const route = this.generateRoute()
|
|
96
|
-
if (!route) {
|
|
97
|
-
return false
|
|
98
|
-
}
|
|
99
|
-
this.$store.dispatch('addView', route)
|
|
100
|
-
},
|
|
101
|
-
isActive(route) {
|
|
102
|
-
return route.name === this.$route.name
|
|
103
|
-
},
|
|
104
|
-
refreshSelectedTag() {
|
|
105
|
-
this.$store.dispatch('refreshView', this.$store.state.app.selectedView)
|
|
106
|
-
},
|
|
107
|
-
closeOthersTags() {
|
|
108
|
-
this.$router.push(this.$store.state.app.selectedView)
|
|
109
|
-
this.$store.dispatch('delOthersViews', this.$store.state.app.selectedView).then(() => {
|
|
110
|
-
})
|
|
111
|
-
},
|
|
112
|
-
closeAllTags() {
|
|
113
|
-
this.$store.dispatch('delAllViews')
|
|
114
|
-
this.$router.push('/')
|
|
115
|
-
},
|
|
116
|
-
openMenu(tag, e) {
|
|
117
|
-
const menuMinWidth = 105
|
|
118
|
-
const offsetLeft = this.$el.getBoundingClientRect().left // container margin left
|
|
119
|
-
const offsetWidth = this.$el.offsetWidth // container width
|
|
120
|
-
const maxLeft = offsetWidth - menuMinWidth // left boundary
|
|
121
|
-
const left = e.clientX - offsetLeft + 15 // 15: margin right
|
|
122
|
-
if (left > maxLeft) {
|
|
123
|
-
this.left = maxLeft
|
|
124
|
-
} else {
|
|
125
|
-
this.left = left
|
|
126
|
-
}
|
|
127
|
-
this.top = e.clientY - 40
|
|
128
|
-
this.visible = true
|
|
129
|
-
this.$store.state.app.selectedView = tag
|
|
130
|
-
console.log(this.$store.state.app.selectedView)
|
|
131
|
-
},
|
|
132
|
-
closeMenu() {
|
|
133
|
-
this.visible = false
|
|
134
|
-
},
|
|
135
|
-
openInNewWin() {
|
|
136
|
-
const view = this.$store.state.app.selectedView;
|
|
137
|
-
const routeData = this.$router.resolve({
|
|
138
|
-
name: view.name,
|
|
139
|
-
params: view.params,
|
|
140
|
-
query: {onlycontent: 1}
|
|
141
|
-
})
|
|
142
|
-
window.open(routeData.href, view.name)
|
|
143
102
|
}
|
|
144
|
-
|
|
145
|
-
|
|
103
|
+
this.$store.dispatch('addView', route)
|
|
104
|
+
},
|
|
105
|
+
isActive(route) {
|
|
106
|
+
return route.name === this.$route.name
|
|
107
|
+
},
|
|
108
|
+
refreshSelectedTag() {
|
|
109
|
+
this.$store.dispatch('refreshView', this.$store.state.app.selectedView)
|
|
110
|
+
},
|
|
111
|
+
closeOthersTags() {
|
|
112
|
+
this.$router.push(this.$store.state.app.selectedView)
|
|
113
|
+
this.$store
|
|
114
|
+
.dispatch('delOthersViews', this.$store.state.app.selectedView)
|
|
115
|
+
.then(() => {})
|
|
116
|
+
},
|
|
117
|
+
closeAllTags() {
|
|
118
|
+
this.$store.dispatch('delAllViews')
|
|
119
|
+
this.$router.push('/')
|
|
120
|
+
},
|
|
121
|
+
openMenu(tag, e) {
|
|
122
|
+
const menuMinWidth = 105
|
|
123
|
+
const offsetLeft = this.$el.getBoundingClientRect().left // container margin left
|
|
124
|
+
const offsetWidth = this.$el.offsetWidth // container width
|
|
125
|
+
const maxLeft = offsetWidth - menuMinWidth // left boundary
|
|
126
|
+
const left = e.clientX - offsetLeft + 15 // 15: margin right
|
|
127
|
+
if (left > maxLeft) {
|
|
128
|
+
this.left = maxLeft
|
|
129
|
+
} else {
|
|
130
|
+
this.left = left
|
|
131
|
+
}
|
|
132
|
+
this.top = e.clientY - 40
|
|
133
|
+
this.visible = true
|
|
134
|
+
this.$store.state.app.selectedView = tag
|
|
135
|
+
console.log(this.$store.state.app.selectedView)
|
|
136
|
+
},
|
|
137
|
+
closeMenu() {
|
|
138
|
+
this.visible = false
|
|
139
|
+
},
|
|
140
|
+
openInNewWin() {
|
|
141
|
+
const view = this.$store.state.app.selectedView
|
|
142
|
+
const routeData = this.$router.resolve({
|
|
143
|
+
name: view.name,
|
|
144
|
+
params: view.params,
|
|
145
|
+
query: { onlycontent: 1 },
|
|
146
|
+
})
|
|
147
|
+
window.open(routeData.href, view.name)
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
}
|
|
146
151
|
</script>
|
|
147
152
|
|
|
148
|
-
<style
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
153
|
+
<style lang="scss" rel="stylesheet/scss" scoped>
|
|
154
|
+
.tags-view-container {
|
|
155
|
+
.tags-view-item {
|
|
156
|
+
display: inline-block;
|
|
157
|
+
position: relative;
|
|
158
|
+
height: 26px;
|
|
159
|
+
line-height: 26px;
|
|
160
|
+
border: 1px solid #d8dce5;
|
|
161
|
+
color: #495060;
|
|
162
|
+
background: #fff;
|
|
163
|
+
padding: 0 8px;
|
|
164
|
+
font-size: 12px;
|
|
165
|
+
margin-left: 5px;
|
|
166
|
+
margin-top: 4px;
|
|
162
167
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
168
|
+
&:first-of-type {
|
|
169
|
+
margin-left: 15px;
|
|
170
|
+
}
|
|
166
171
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
172
|
+
&.active {
|
|
173
|
+
background-color: #409eff;
|
|
174
|
+
color: #fff;
|
|
175
|
+
border-color: #409eff;
|
|
171
176
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
177
|
+
&::before {
|
|
178
|
+
content: '';
|
|
179
|
+
background: #fff;
|
|
180
|
+
display: inline-block;
|
|
181
|
+
width: 8px;
|
|
182
|
+
height: 8px;
|
|
183
|
+
border-radius: 50%;
|
|
184
|
+
position: relative;
|
|
185
|
+
margin-right: 2px;
|
|
182
186
|
}
|
|
183
187
|
}
|
|
184
188
|
}
|
|
189
|
+
}
|
|
185
190
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
191
|
+
.tags-view-container {
|
|
192
|
+
.tags-view-item {
|
|
193
|
+
.el-icon-close {
|
|
194
|
+
width: 16px;
|
|
195
|
+
height: 16px;
|
|
196
|
+
vertical-align: 2px;
|
|
197
|
+
border-radius: 50%;
|
|
198
|
+
text-align: center;
|
|
199
|
+
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
200
|
+
transform-origin: 100% 50%;
|
|
196
201
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
+
&:before {
|
|
203
|
+
transform: scale(0.6);
|
|
204
|
+
display: inline-block;
|
|
205
|
+
vertical-align: -3px;
|
|
206
|
+
}
|
|
202
207
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
208
|
+
&:hover {
|
|
209
|
+
background-color: #b4bccc;
|
|
210
|
+
color: #fff;
|
|
207
211
|
}
|
|
208
212
|
}
|
|
209
213
|
}
|
|
214
|
+
}
|
|
210
215
|
</style>
|
|
@@ -1,97 +1,105 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
|
|
2
|
+
import './HZRecorder.js'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
4
|
+
export default {
|
|
5
|
+
name: 'VocRec',
|
|
6
|
+
components: {},
|
|
7
|
+
mounted() {
|
|
8
|
+
this.vocRec()
|
|
9
|
+
},
|
|
10
|
+
data() {
|
|
11
|
+
return {
|
|
12
|
+
vocTimeHandle: null,
|
|
13
|
+
vocTime: 0, //录制的毫秒数,低于1秒的丢弃
|
|
14
|
+
recorder: null,
|
|
15
|
+
hotKeyDown: false,
|
|
16
|
+
isRecording: false, //是否正在录音由于录音设备异步问题,需要标志位控制
|
|
17
|
+
//log: errLogStore.state.errLog
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
methods: {
|
|
21
|
+
vocHotKey() {
|
|
22
|
+
if (!this.hotKeyDown) {
|
|
23
|
+
this.hotKeyDown = true
|
|
24
|
+
this.startRecording()
|
|
25
|
+
} else {
|
|
26
|
+
this.hotKeyDown = false
|
|
27
|
+
this.endRecording()
|
|
18
28
|
}
|
|
19
29
|
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} else {
|
|
26
|
-
this.hotKeyDown = false
|
|
27
|
-
this.endRecording();
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
vocRec() {
|
|
31
|
-
$(".mainHeader .mike").mousedown(() => {
|
|
32
|
-
console.info('startClick')
|
|
33
|
-
this.startRecording()
|
|
34
|
-
});
|
|
30
|
+
vocRec() {
|
|
31
|
+
$('.mainHeader .mike').mousedown(() => {
|
|
32
|
+
console.info('startClick')
|
|
33
|
+
this.startRecording()
|
|
34
|
+
})
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
})
|
|
50
|
-
this.vocTime = new Date().getTime()
|
|
51
|
-
this.$message({
|
|
52
|
-
message: this.$t('正在录音...'),
|
|
53
|
-
type: 'warn',
|
|
54
|
-
duration: 999999,
|
|
55
|
-
showClose: true
|
|
56
|
-
})
|
|
57
|
-
},
|
|
58
|
-
endRecording() {
|
|
59
|
-
this.stopRecording()
|
|
60
|
-
this.$message.closeAll()
|
|
61
|
-
let nowTime = new Date().getTime()
|
|
62
|
-
if (nowTime - this.vocTime < 1000) {//低于一秒的录制不处理
|
|
63
|
-
return false
|
|
36
|
+
$('.mainHeader .mike').mouseup(() => {
|
|
37
|
+
this.endRecording()
|
|
38
|
+
})
|
|
39
|
+
},
|
|
40
|
+
startRecording() {
|
|
41
|
+
this.isRecording = true
|
|
42
|
+
HZRecorder.get((rec) => {
|
|
43
|
+
this.recorder = rec
|
|
44
|
+
if (this.isRecording) {
|
|
45
|
+
//还未启动就释放的
|
|
46
|
+
this.recorder.start()
|
|
47
|
+
} else {
|
|
48
|
+
this.recorder.stop()
|
|
64
49
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
this
|
|
50
|
+
})
|
|
51
|
+
this.vocTime = new Date().getTime()
|
|
52
|
+
this.$message({
|
|
53
|
+
message: this.$t('正在录音...'),
|
|
54
|
+
type: 'warn',
|
|
55
|
+
duration: 999999,
|
|
56
|
+
showClose: true,
|
|
57
|
+
})
|
|
58
|
+
},
|
|
59
|
+
endRecording() {
|
|
60
|
+
this.stopRecording()
|
|
61
|
+
this.$message.closeAll()
|
|
62
|
+
let nowTime = new Date().getTime()
|
|
63
|
+
if (nowTime - this.vocTime < 1000) {
|
|
64
|
+
//低于一秒的录制不处理
|
|
65
|
+
return false
|
|
66
|
+
}
|
|
67
|
+
this.uploadAudio()
|
|
68
|
+
},
|
|
69
|
+
uploadAudio() {
|
|
70
|
+
//doClose是否关闭录音,repeate是否同时上传
|
|
71
|
+
this.recorder.upload(
|
|
72
|
+
'/webresources/login/com/comwav/vocRec',
|
|
73
|
+
(state, e) => {
|
|
69
74
|
switch (state) {
|
|
70
75
|
case 'uploading':
|
|
71
76
|
//var percentComplete = Math.round(e.loaded * 100 / e.total) + '%';
|
|
72
|
-
break
|
|
77
|
+
break
|
|
73
78
|
case 'ok':
|
|
74
|
-
var genJson = eval('(' + e.target.responseText + ')')
|
|
79
|
+
var genJson = eval('(' + e.target.responseText + ')')
|
|
75
80
|
if (genJson.message) {
|
|
76
|
-
if (genJson.code == '1') {
|
|
77
|
-
|
|
81
|
+
if (genJson.code == '1') {
|
|
82
|
+
//根据id打开菜单
|
|
83
|
+
this.$router.push({ name: genJson.message })
|
|
78
84
|
} else {
|
|
79
|
-
this.$store.state.app.vocRec = genJson.message//识别为拼音名
|
|
85
|
+
this.$store.state.app.vocRec = genJson.message //识别为拼音名
|
|
80
86
|
console.info(genJson.message)
|
|
81
87
|
}
|
|
82
88
|
}
|
|
83
|
-
break
|
|
89
|
+
break
|
|
84
90
|
case 'error':
|
|
85
|
-
break
|
|
91
|
+
break
|
|
86
92
|
case 'cancel':
|
|
87
|
-
break
|
|
93
|
+
break
|
|
88
94
|
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
},
|
|
98
|
+
stopRecording() {
|
|
99
|
+
//停止录音
|
|
100
|
+
this.isRecording = false
|
|
101
|
+
this.recorder.stop()
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
}
|
|
97
105
|
</script>
|