hd-idevvue3 3.0.0 → 3.0.2

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 (230) hide show
  1. package/.env.development +5 -0
  2. package/.env.production +5 -0
  3. package/README.md +22 -191
  4. package/dist/assets/index.774ef40e.css +1 -0
  5. package/dist/hd-idevvue3.mjs +45697 -0
  6. package/dist/hd-idevvue3.umd.js +153 -0
  7. package/index.html +1 -0
  8. package/npminstall-debug.log +10 -2
  9. package/package.json +35 -40
  10. package/pnpm-lock.yaml +2631 -0
  11. package/src/App.vue +15 -0
  12. package/src/assets/sound/notify.wav +0 -0
  13. package/src/demo/demo.vue +43 -0
  14. package/src/demo/dropdemo.vue +43 -0
  15. package/src/demo/extsets.vue +107 -0
  16. package/src/demo/formedit.vue +145 -0
  17. package/src/demo/hightquery.vue +169 -0
  18. package/src/demo/inlineedit.vue +88 -0
  19. package/src/demo/selfdrop.vue +41 -0
  20. package/src/demo//350/241/214/345/206/205/347/272/247/350/201/224.txt +2 -0
  21. package/src/directive/el-dragDialog/drag.js +124 -0
  22. package/src/directive/el-dragDialog/index.js +13 -0
  23. package/src/errorLog.js +16 -0
  24. package/src/hdcom/BigGrid.js +173 -0
  25. package/src/hdcom/BillShow.vue +90 -0
  26. package/src/hdcom/BillUpload.vue +253 -0
  27. package/src/hdcom/BtnRight.vue +98 -0
  28. package/src/hdcom/ErrHint.vue +30 -0
  29. package/src/hdcom/ExtendColumn.vue +108 -0
  30. package/src/hdcom/ExtendCommon.js +29 -0
  31. package/src/hdcom/ExtendForm.vue +114 -0
  32. package/src/hdcom/FacePicUpload.vue +71 -0
  33. package/src/hdcom/FaceRecTest.vue +104 -0
  34. package/src/hdcom/GridChart.vue +194 -0
  35. package/src/hdcom/GridExField.vue +281 -0
  36. package/src/hdcom/GridShow.vue +238 -0
  37. package/src/hdcom/HdAside.vue +178 -0
  38. package/src/hdcom/HdBtn.vue +113 -0
  39. package/src/hdcom/HdButton.vue +137 -0
  40. package/src/hdcom/HdComFaceRec.vue +58 -0
  41. package/src/hdcom/HdComGrid.vue +776 -0
  42. package/src/hdcom/HdComQuery.vue +273 -0
  43. package/src/hdcom/HdComQueryDetail.vue +161 -0
  44. package/src/hdcom/HdComSortDetail.vue +155 -0
  45. package/src/hdcom/HdDatePicker.vue +78 -0
  46. package/src/hdcom/HdDialog.vue +63 -0
  47. package/src/hdcom/HdDrop.vue +163 -0
  48. package/src/hdcom/HdFileUpload.vue +148 -0
  49. package/src/hdcom/HdFilterBox.vue +90 -0
  50. package/src/hdcom/HdFooter.vue +149 -0
  51. package/src/hdcom/HdForm.vue +278 -0
  52. package/src/hdcom/HdFormBtn.vue +89 -0
  53. package/src/hdcom/HdFormItem.vue +35 -0
  54. package/src/hdcom/HdGctosGrid +0 -0
  55. package/src/hdcom/HdGrid.vue +825 -0
  56. package/src/hdcom/HdGridEditBtn.vue +44 -0
  57. package/src/hdcom/HdGridExt.js +219 -0
  58. package/src/hdcom/HdGridSel.vue +223 -0
  59. package/src/hdcom/HdHeader.vue +148 -0
  60. package/src/hdcom/HdHotKey.vue +81 -0
  61. package/src/hdcom/HdInputHint.vue +49 -0
  62. package/src/hdcom/HdMain.vue +43 -0
  63. package/src/hdcom/HdMessage.vue +192 -0
  64. package/src/hdcom/HdNum.vue +69 -0
  65. package/src/hdcom/HdPopSel.vue +58 -0
  66. package/src/hdcom/HdRightMenu.vue +61 -0
  67. package/src/hdcom/HdSel/SelGridFieldcod.vue +36 -0
  68. package/src/hdcom/HdTableColumn.vue +334 -0
  69. package/src/hdcom/HdTempSave.vue +140 -0
  70. package/src/hdcom/HdTree.vue +86 -0
  71. package/src/hdcom/HdTreeTable/eval.js +34 -0
  72. package/src/hdcom/HdTreeTable/index.vue +174 -0
  73. package/src/hdcom/ImportExcel.vue +143 -0
  74. package/src/hdcom/index.js +80 -0
  75. package/src/idev.common.js +72 -0
  76. package/src/index.js +14 -0
  77. package/src/utils/HdQuery.js +54 -0
  78. package/src/utils/comutils.js +98 -0
  79. package/src/utils/utils.js +105 -0
  80. package/src/vendor/Blob.js +179 -0
  81. package/src/vendor/Export2Excel.js +220 -0
  82. package/src/vendor/Export2Zip.js +22 -0
  83. package/src/views/layout/AppMain.vue +32 -0
  84. package/src/views/layout/HdLayout.vue +78 -0
  85. package/src/views/layout/header/ElasticSearch.vue +225 -0
  86. package/src/views/layout/header/HZRecorder.js +231 -0
  87. package/src/views/layout/header/HeaderSearch.vue +198 -0
  88. package/src/views/layout/header/Levelbar.vue +49 -0
  89. package/src/views/layout/header/MainHeader.vue +271 -0
  90. package/src/views/layout/header/Navbar.vue +105 -0
  91. package/src/views/layout/header/ScrollPane.vue +81 -0
  92. package/src/views/layout/header/TagsView.vue +210 -0
  93. package/src/views/layout/header/VocRec.vue +97 -0
  94. package/src/views/layout/header/changepswform.vue +96 -0
  95. package/src/views/layout/index.js +12 -0
  96. package/src/views/layout/menu/Hamburger.vue +45 -0
  97. package/src/views/layout/menu/HdMenu.vue +167 -0
  98. package/src/views/layout/menu/css/menu.css +288 -0
  99. package/src/views/layout/menu/index.vue +25 -0
  100. package/src/views/privilege/commsg/commsg.vue +78 -0
  101. package/src/views/privilege/commsg/commsgOrgn.vue +42 -0
  102. package/src/views/privilege/commsg/commsgRole.vue +149 -0
  103. package/src/views/privilege/commsg/commsgform.vue +160 -0
  104. package/src/views/privilege/commsg/commsgiframe.vue +33 -0
  105. package/src/views/privilege/commsg/commsgto.vue +120 -0
  106. package/src/views/privilege/commsg/commsgtoform.vue +108 -0
  107. package/src/views/privilege/commsg/commsgtrans.vue +155 -0
  108. package/src/views/privilege/exfield/comexcolumn.vue +71 -0
  109. package/src/views/privilege/exfield/comexcolumnform.vue +101 -0
  110. package/src/views/privilege/exfield/comexfield.vue +31 -0
  111. package/src/views/privilege/exfield/comexfieldform.vue +94 -0
  112. package/src/views/privilege/exfield/comexfieldsub.vue +72 -0
  113. package/src/views/privilege/index.js +42 -0
  114. package/src/views/privilege/menu/comMenu.vue +41 -0
  115. package/src/views/privilege/menu/menu.vue +133 -0
  116. package/src/views/privilege/menu/menuinfo.vue +56 -0
  117. package/src/views/privilege/menu/rolelist.vue +47 -0
  118. package/src/views/privilege/menu/userlist.vue +49 -0
  119. package/src/views/privilege/mobile/authmobileupdate.vue +69 -0
  120. package/src/views/privilege/mobile/authmobileupdateform.vue +90 -0
  121. package/src/views/privilege/orgDept/authOrgn.vue +96 -0
  122. package/src/views/privilege/orgDept/authorgnform.vue +145 -0
  123. package/src/views/privilege/orgDept/orgDept.vue +37 -0
  124. package/src/views/privilege/orgDept/orgTree.vue +88 -0
  125. package/src/views/privilege/orgDept/orgnselect.vue +134 -0
  126. package/src/views/privilege/personDept/authuser.vue +123 -0
  127. package/src/views/privilege/personDept/authuserform.vue +154 -0
  128. package/src/views/privilege/personDept/facerec.vue +117 -0
  129. package/src/views/privilege/personDept/orgncascader.vue +125 -0
  130. package/src/views/privilege/personDept/personDept.vue +31 -0
  131. package/src/views/privilege/quartz/comquartzjob.vue +65 -0
  132. package/src/views/privilege/quartz/comquartzjobform.vue +99 -0
  133. package/src/views/privilege/quartz/comquartzlog.vue +59 -0
  134. package/src/views/privilege/role/btnRole.vue +117 -0
  135. package/src/views/privilege/role/menuRole.vue +64 -0
  136. package/src/views/privilege/role/orgnRole.vue +56 -0
  137. package/src/views/privilege/role/role.vue +67 -0
  138. package/src/views/privilege/role/rolelist.vue +67 -0
  139. package/src/views/privilege/role/roleselect.vue +57 -0
  140. package/src/views/privilege/search/comsearch.vue +105 -0
  141. package/src/views/privilege/search/menu.vue +52 -0
  142. package/src/views/privilege/syscode/syscode.vue +103 -0
  143. package/src/views/privilege/syscode/sysfield.vue +66 -0
  144. package/src/views/privilege/syscode/sysfieldframe.vue +30 -0
  145. package/src/views/privilege/syslog/menulog.vue +52 -0
  146. package/src/views/privilege/syslog/syslog.vue +115 -0
  147. package/src/views/privilege/syslog/syslogconfig.vue +61 -0
  148. package/src/views/privilege/syslog/syslogform.vue +83 -0
  149. package/src/views/privilege/syslog/syslogframe.vue +26 -0
  150. package/src/views/privilege/userRole/userRole.vue +122 -0
  151. package/src/views/privilege.zip +0 -0
  152. package/vite.config.js +93 -0
  153. package/.babelrc +0 -17
  154. package/.editorconfig +0 -14
  155. package/.eslintignore +0 -3
  156. package/.npminstall.done +0 -1
  157. package/.postcssrc.js +0 -8
  158. package/LICENSE +0 -21
  159. package/Listening +0 -28
  160. package/build/build.js +0 -70
  161. package/build/check-versions.js +0 -45
  162. package/build/config.js +0 -81
  163. package/build/dev-client.js +0 -9
  164. package/build/dev-server.js +0 -93
  165. package/build/utils.js +0 -78
  166. package/build/vue-loader.conf.js +0 -12
  167. package/build/webpack.common.js +0 -37
  168. package/build/webpack.component.js +0 -36
  169. package/build/webpack.prod.conf.js +0 -38
  170. package/components.json +0 -8
  171. package/conf.js +0 -42
  172. package/config/dev.env.js +0 -6
  173. package/config/index.js +0 -43
  174. package/config/prod.env.js +0 -6
  175. package/config/sit.env.js +0 -6
  176. package/favicon.ico +0 -0
  177. package/jsdoc-vue.js +0 -12
  178. package/lib/0.index.js +0 -12573
  179. package/lib/1.index.js +0 -6
  180. package/lib/2.index.js +0 -2
  181. package/lib/idev.common.js +0 -1
  182. package/lib/idv8.common.js +0 -1
  183. package/lib/index.js +0 -49170
  184. package/lib/js/ErrHint.js +0 -1
  185. package/lib/js/HdAside.js +0 -1
  186. package/lib/js/HdBtn.js +0 -1
  187. package/lib/js/HdButton.js +0 -1
  188. package/lib/js/HdComFaceRec.js +0 -1
  189. package/lib/js/HdComGrid.js +0 -1
  190. package/lib/js/HdDatePicker.js +0 -1
  191. package/lib/js/HdDialog.js +0 -1
  192. package/lib/js/HdDrop.js +0 -1
  193. package/lib/js/HdFileUpload.js +0 -1
  194. package/lib/js/HdFooter.js +0 -1
  195. package/lib/js/HdForm.js +0 -1
  196. package/lib/js/HdFormBtn.js +0 -1
  197. package/lib/js/HdFormItem.js +0 -1
  198. package/lib/js/HdGrid.js +0 -1
  199. package/lib/js/HdGridEditBtn.js +0 -1
  200. package/lib/js/HdGridSel.js +0 -1
  201. package/lib/js/HdHeader.js +0 -1
  202. package/lib/js/HdHotkey.js +0 -1
  203. package/lib/js/HdLayout.js +0 -1
  204. package/lib/js/HdMain.js +0 -1
  205. package/lib/js/HdMessage.js +0 -1
  206. package/lib/js/HdNum.js +0 -1
  207. package/lib/js/HdPopSel.js +0 -1
  208. package/lib/js/HdSearch.js +0 -1
  209. package/lib/js/HdTableColumn.js +0 -1
  210. package/lib/js/HdTempSave.js +0 -1
  211. package/lib/js/HdTree.js +0 -1
  212. package/lib/js/HdTreeTable.js +0 -1
  213. package/lib/js/authmobileupdate.js +0 -1
  214. package/lib/js/comexfield.js +0 -1
  215. package/lib/js/commsg.js +0 -1
  216. package/lib/js/commsgto.js +0 -1
  217. package/lib/js/comquartzjob.js +0 -1
  218. package/lib/js/comquartzlog.js +0 -1
  219. package/lib/js/comsearch.js +0 -1
  220. package/lib/js/menu.js +0 -1
  221. package/lib/js/menuinfo.js +0 -1
  222. package/lib/js/orgDept.js +0 -1
  223. package/lib/js/orgTree.js +0 -1
  224. package/lib/js/personDept.js +0 -1
  225. package/lib/js/role.js +0 -1
  226. package/lib/js/sysfieldframe.js +0 -1
  227. package/lib/js/syslog.js +0 -1
  228. package/lib/js/syslogframe.js +0 -1
  229. package/lib/js/userRole.js +0 -1
  230. package/ytgvue.rar +0 -0
@@ -0,0 +1,225 @@
1
+ <template>
2
+ <div :class="{'show':show}" class="header-search">
3
+ <svg @click="click" class="search-icon screenfull-svg" height="32" viewBox="-10 -10 150 150"
4
+ width="32" xmlns="http://www.w3.org/2000/svg">
5
+ <path
6
+ d="M124.884 109.812L94.256 79.166c-.357-.357-.757-.629-1.129-.914a50.366 50.366 0 0 0 8.186-27.59C101.327 22.689 78.656 0 50.67 0 22.685 0 0 22.688 0 50.663c0 27.989 22.685 50.663 50.656 50.663 10.186 0 19.643-3.03 27.6-8.201.286.385.557.771.9 1.114l30.628 30.632a10.633 10.633 0 0 0 7.543 3.129c2.728 0 5.457-1.043 7.543-3.115 4.171-4.157 4.171-10.915.014-15.073M50.671 85.338C31.557 85.338 16 69.78 16 50.663c0-19.102 15.557-34.661 34.67-34.661 19.115 0 34.657 15.559 34.657 34.675 0 19.102-15.557 34.661-34.656 34.661"/>
7
+ </svg>
8
+ <el-select
9
+ :placeholder="$t('菜单查询')"
10
+ :remote-method="querySearch"
11
+ @change="change"
12
+ class="header-search-select"
13
+ default-first-option
14
+ filterable
15
+ ref="headerSearchSelect"
16
+ remote
17
+ v-model="search"
18
+ >
19
+ <el-option-group :key="$t('检索菜单')" :label="$t('检索菜单')" v-if="options1.length>0">
20
+ <el-option :key="index" :label="item.title.join(' > ')" :value="item" v-for="item,index in options1"/>
21
+ </el-option-group>
22
+ <el-option-group :key="$t('更多结果')" :label="$t('更多结果')" v-if="options2.length>0">
23
+ <el-option :key="index" :label="item.text" :value="item" v-for="item,index in options2"/>
24
+ </el-option-group>
25
+ </el-select>
26
+ </div>
27
+ </template>
28
+
29
+ <script>
30
+ import Fuse from 'fuse.js'
31
+ import path from 'path'
32
+
33
+ export default {
34
+ name: 'ElasticSearch',
35
+ data() {
36
+ return {
37
+ search: '',
38
+ options1: [],
39
+ options2: [],
40
+ searchPool: [],
41
+ show: false,
42
+ fuse: undefined
43
+ }
44
+ },
45
+ computed: {
46
+ routes() {
47
+ return this.$store.state.permission.hdMenu;
48
+ },
49
+ lang() {
50
+ return this.$store.getters.language
51
+ }
52
+ },
53
+ watch: {
54
+ lang() {
55
+ this.searchPool = this.generateRoutes(this.routes)
56
+ },
57
+ routes() {
58
+ this.searchPool = this.generateRoutes(this.routes)
59
+ },
60
+ searchPool(list) {
61
+ this.initFuse(list)
62
+ },
63
+ show(value) {
64
+ if (value) {
65
+ document.body.addEventListener('click', this.close)
66
+ } else {
67
+ document.body.removeEventListener('click', this.close)
68
+ }
69
+ }
70
+ },
71
+ mounted() {
72
+ this.searchPool = this.generateRoutes(this.routes)
73
+ },
74
+ methods: {
75
+ click() {
76
+ this.show = !this.show
77
+ if (this.show) {
78
+ this.$refs.headerSearchSelect && this.$refs.headerSearchSelect.focus()
79
+ }
80
+ },
81
+ close() {
82
+ this.$refs.headerSearchSelect && this.$refs.headerSearchSelect.blur()
83
+ this.options1 = [];
84
+ this.options2 = [];
85
+ this.show = false
86
+ },
87
+ change(val) {
88
+ this.$router.push(val.path)
89
+ this.search = ''
90
+ this.options1 = [];
91
+ this.options2 = [];
92
+ this.$nextTick(() => {
93
+ this.show = false
94
+ })
95
+ },
96
+ initFuse(list) {
97
+ this.fuse = new Fuse(list, {
98
+ shouldSort: true,
99
+ threshold: 0.4,
100
+ location: 0,
101
+ distance: 100,
102
+ maxPatternLength: 32,
103
+ minMatchCharLength: 1,
104
+ keys: [{
105
+ name: 'title',
106
+ weight: 0.7
107
+ }, {
108
+ name: 'path',
109
+ weight: 0.3
110
+ }]
111
+ })
112
+ },
113
+ // Filter out the routes that can be displayed in the sidebar
114
+ // And generate the internationalized title
115
+ generateRoutes(routes, basePath = '/', prefixTitle = []) {
116
+ let res = []
117
+ for (const router of routes) {
118
+ // skip hidden router
119
+ if (router.hidden) {
120
+ continue
121
+ }
122
+
123
+ const data = {
124
+ path: path.resolve(basePath, router.path),
125
+ title: [...prefixTitle]
126
+ }
127
+
128
+ if (router.meta && router.meta.title) {
129
+ // generate internationalized title
130
+ const i18ntitle = this.$i18n.locale == 'zh' ? router.meta.title : router.meta.enTitle;
131
+
132
+ data.title = [...data.title, i18ntitle]
133
+
134
+ if (router.redirect !== 'noredirect') {
135
+ // only push the routes with title
136
+ // special case: need to exclude parent router without redirect
137
+ res.push(data)
138
+ }
139
+ }
140
+
141
+ // recursive child routes
142
+ if (router.children) {
143
+ const tempRoutes = this.generateRoutes(router.children, data.path, data.title)
144
+ if (tempRoutes.length >= 1) {
145
+ res = [...res, ...tempRoutes]
146
+ }
147
+ }
148
+ }
149
+
150
+ return res
151
+ },
152
+ querySearch(query) {
153
+ if (query !== '') {
154
+ this.options1 = this.fuse.search(query)
155
+ } else {
156
+ this.options1 = []
157
+ }
158
+
159
+ if (this.$store.state.app.elsearch) {//
160
+ this.options2 = [{text: this.$t('加载中...')}];
161
+ this.$http.get(`/webresources/login/com/ComSearch/search?q=${query}&type=${this.$i18n.locale}`).then(response => {
162
+
163
+ this.options2 = [];
164
+ response.data.forEach(v => {
165
+ let t = v.menuPath.reverse().join('=>')
166
+ if (this.$i18n.locale == 'en') {
167
+ t = v.menuEnPath.reverse().join('=>')
168
+ }
169
+
170
+ this.options2.push({
171
+ path: '/' + v.menuUrl + '?q=' + query,
172
+ text: t + '=>' + v.content
173
+ })
174
+ })
175
+ })
176
+ }
177
+ }
178
+ }
179
+ }
180
+ </script>
181
+
182
+ <style lang="scss" scoped>
183
+ .header-search {
184
+ font-size: 0 !important;
185
+
186
+ .search-icon {
187
+ font-size: 18px;
188
+ vertical-align: middle;
189
+ display: inline-block;
190
+ cursor: pointer;
191
+ fill: #e4e9ef;
192
+ /* width: 20px;
193
+ height: 20px;
194
+ vertical-align: 10px;*/
195
+ }
196
+
197
+ .header-search-select {
198
+ font-size: 18px;
199
+ transition: width 0.2s;
200
+ width: 0;
201
+ overflow: hidden;
202
+ background: transparent;
203
+ border-radius: 0;
204
+ display: inline-block;
205
+ vertical-align: middle;
206
+
207
+ :deep(.el-input__inner) {
208
+ border-radius: 0;
209
+ border: 0;
210
+ padding-left: 0;
211
+ padding-right: 0;
212
+ box-shadow: none !important;
213
+ border-bottom: 1px solid #d9d9d9;
214
+ vertical-align: middle;
215
+ }
216
+ }
217
+
218
+ &.show {
219
+ .header-search-select {
220
+ width: 150px;
221
+ margin-left: 10px;
222
+ }
223
+ }
224
+ }
225
+ </style>
@@ -0,0 +1,231 @@
1
+ var audioContext = null;
2
+
3
+ (function (window) {
4
+ // 兼容
5
+ window.URL = window.URL || window.webkitURL;
6
+ navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
7
+ var audoStream = null;
8
+ var HZRecorder = function (stream, config) {
9
+ config = config || {};
10
+ config.sampleBits = config.sampleBits || 16; // 采样数位 8, 16
11
+ config.sampleRate = config.sampleRate || (8000); // 采样率(1/6 44100)
12
+ if (!audioContext) {
13
+ audioContext = new AudioContext();
14
+ }
15
+ audoStream = stream;
16
+ var context = audioContext;
17
+ var audioInput = context.createMediaStreamSource(stream);
18
+ var recorder = context.createScriptProcessor(4096, 1, 1);
19
+ var audioData = {
20
+ size: 0 // 录音文件长度
21
+ , buffer: [] // 录音缓存
22
+ , inputSampleRate: context.sampleRate // 输入采样率
23
+ , inputSampleBits: 16 // 输入采样数位 8, 16
24
+ , outputSampleRate: config.sampleRate // 输出采样率
25
+ , oututSampleBits: config.sampleBits // 输出采样数位 8, 16
26
+ , input: function (data) {
27
+ this.buffer.push(new Float32Array(data));
28
+ this.size += data.length;
29
+ }
30
+ , compress: function () { // 合并压缩
31
+ // 合并
32
+ var data = new Float32Array(this.size);
33
+ var offset = 0;
34
+ for (var i = 0; i < this.buffer.length; i++) {
35
+ data.set(this.buffer[i], offset);
36
+ offset += this.buffer[i].length;
37
+ }
38
+ // 压缩
39
+ var compression = parseInt(this.inputSampleRate / this.outputSampleRate);
40
+ var length = data.length / compression;
41
+ var result = new Float32Array(length);
42
+ var index = 0, j = 0;
43
+ while (index < length) {
44
+ result[index] = data[j];
45
+ j += compression;
46
+ index++;
47
+ }
48
+ return result;
49
+ }
50
+ , encodeWAV: function () {
51
+ var sampleRate = Math.min(this.inputSampleRate, this.outputSampleRate);
52
+ var sampleBits = Math.min(this.inputSampleBits, this.oututSampleBits);
53
+ var bytes = this.compress();
54
+ var dataLength = bytes.length * (sampleBits / 8);
55
+ var buffer = new ArrayBuffer(44 + dataLength);
56
+ var data = new DataView(buffer);
57
+
58
+ var channelCount = 1;// 单声道
59
+ var offset = 0;
60
+
61
+ var writeString = function (str) {
62
+ for (var i = 0; i < str.length; i++) {
63
+ data.setUint8(offset + i, str.charCodeAt(i));
64
+ }
65
+ }
66
+
67
+ // 资源交换文件标识符
68
+ writeString('RIFF');
69
+ offset += 4;
70
+ // 下个地址开始到文件尾总字节数,即文件大小-8
71
+ data.setUint32(offset, 36 + dataLength, true);
72
+ offset += 4;
73
+ // WAV文件标志
74
+ writeString('WAVE');
75
+ offset += 4;
76
+ // 波形格式标志
77
+ writeString('fmt ');
78
+ offset += 4;
79
+ // 过滤字节,一般为 0x10 = 16
80
+ data.setUint32(offset, 16, true);
81
+ offset += 4;
82
+ // 格式类别 (PCM形式采样数据)
83
+ data.setUint16(offset, 1, true);
84
+ offset += 2;
85
+ // 通道数
86
+ data.setUint16(offset, channelCount, true);
87
+ offset += 2;
88
+ // 采样率,每秒样本数,表示每个通道的播放速度
89
+ data.setUint32(offset, sampleRate, true);
90
+ offset += 4;
91
+ // 波形数据传输率 (每秒平均字节数) 单声道×每秒数据位数×每样本数据位/8
92
+ data.setUint32(offset, channelCount * sampleRate * (sampleBits / 8), true);
93
+ offset += 4;
94
+ // 快数据调整数 采样一次占用字节数 单声道×每样本的数据位数/8
95
+ data.setUint16(offset, channelCount * (sampleBits / 8), true);
96
+ offset += 2;
97
+ // 每样本数据位数
98
+ data.setUint16(offset, sampleBits, true);
99
+ offset += 2;
100
+ // 数据标识符
101
+ writeString('data');
102
+ offset += 4;
103
+ // 采样数据总数,即数据总大小-44
104
+ data.setUint32(offset, dataLength, true);
105
+ offset += 4;
106
+ // 写入采样数据
107
+ if (sampleBits === 8) {
108
+ for (var i = 0; i < bytes.length; i++, offset++) {
109
+ var s = Math.max(-1, Math.min(1, bytes[i]));
110
+ var val = s < 0 ? s * 0x8000 : s * 0x7FFF;
111
+ val = parseInt(255 / (65535 / (val + 32768)));
112
+ data.setInt8(offset, val, true);
113
+ }
114
+ } else {
115
+ for (var i = 0; i < bytes.length; i++, offset += 2) {
116
+ var s = Math.max(-1, Math.min(1, bytes[i]));
117
+ data.setInt16(offset, s < 0 ? s * 0x8000 : s * 0x7FFF, true);
118
+ }
119
+ }
120
+
121
+ return new Blob([data], {type: 'audio/wav'});
122
+ }
123
+ };
124
+
125
+ // 开始录音
126
+ this.start = function () {
127
+ audioInput.connect(recorder);
128
+ recorder.connect(context.destination);
129
+ }
130
+
131
+ // 停止
132
+ this.stop = function () {
133
+ if (audioContext) {
134
+ audioContext.close();
135
+ }
136
+ audoStream.getTracks()[0].stop();
137
+ audioContext = null;
138
+ }
139
+
140
+ // 获取音频文件
141
+ this.getBlob = function () {
142
+ // this.stop();
143
+ return audioData.encodeWAV();
144
+ }
145
+
146
+ // 回放
147
+ this.play = function (audio) {
148
+ audio.src = window.URL.createObjectURL(this.getBlob());
149
+ }
150
+
151
+ // 上传
152
+ this.upload = function (url, callback) {
153
+ var fd = new FormData();
154
+ fd.append("file", this.getBlob());
155
+ fd.append('mp3Name', "myname.wav");
156
+ var xhr = new XMLHttpRequest();
157
+ if (callback) {
158
+ xhr.upload.addEventListener("progress", function (e) {
159
+ callback('uploading', e);
160
+ }, false);
161
+ xhr.addEventListener("load", function (e) {
162
+ callback('ok', e);
163
+ }, false);
164
+ xhr.addEventListener("error", function (e) {
165
+ callback('error', e);
166
+ }, false);
167
+ xhr.addEventListener("abort", function (e) {
168
+ callback('cancel', e);
169
+ }, false);
170
+ }
171
+ xhr.open("POST", url);
172
+ xhr.send(fd);
173
+ }
174
+
175
+ // 音频采集
176
+ recorder.onaudioprocess = function (e) {
177
+ audioData.input(e.inputBuffer.getChannelData(0));
178
+ // record(e.inputBuffer.getChannelData(0));
179
+ }
180
+
181
+ };
182
+ // 抛出异常
183
+ HZRecorder.throwError = function (message) {
184
+ alert(message);
185
+ throw new function () {
186
+ this.toString = function () {
187
+ return message;
188
+ }
189
+ }
190
+ }
191
+ // 是否支持录音
192
+ HZRecorder.canRecording = (navigator.getUserMedia != null);
193
+ // 获取录音机
194
+ HZRecorder.get = function (callback, config) {
195
+ if (callback) {
196
+ if (navigator.getUserMedia) {
197
+ navigator.getUserMedia(
198
+ {audio: true} // 只启用音频
199
+ , function (stream) {
200
+ var rec = new HZRecorder(stream, config);
201
+ callback(rec);
202
+ }
203
+ , function (error) {
204
+ switch (error.code || error.name) {
205
+ case 'PERMISSION_DENIED':
206
+ case 'PermissionDeniedError':
207
+ HZRecorder.throwError(this.$t('用户拒绝提供信息。'));
208
+ break;
209
+ case 'NOT_SUPPORTED_ERROR':
210
+ case 'NotSupportedError':
211
+ HZRecorder.throwError(this.$t('浏览器不支持硬件设备。'));
212
+ break;
213
+ case 'MANDATORY_UNSATISFIED_ERROR':
214
+ case 'MandatoryUnsatisfiedError':
215
+ HZRecorder.throwError(this.$t('无法发现指定的硬件设备。'));
216
+ break;
217
+ default:
218
+ HZRecorder.throwError(this.$t('无法打开麦克风。异常信息:') + (error.code || error.name));
219
+ break;
220
+ }
221
+ });
222
+ } else {
223
+ HZRecorder.throwErr(this.$t('当前浏览器不支持录音功能。'));
224
+ return;
225
+ }
226
+ }
227
+ }
228
+
229
+ window.HZRecorder = HZRecorder;
230
+
231
+ })(window);
@@ -0,0 +1,198 @@
1
+ <template>
2
+ <div :class="{'show':show}" class="header-search">
3
+ <svg @click="click" class="search-icon screenfull-svg" height="32" viewBox="-10 -10 150 150"
4
+ width="32" xmlns="http://www.w3.org/2000/svg">
5
+ <path
6
+ d="M124.884 109.812L94.256 79.166c-.357-.357-.757-.629-1.129-.914a50.366 50.366 0 0 0 8.186-27.59C101.327 22.689 78.656 0 50.67 0 22.685 0 0 22.688 0 50.663c0 27.989 22.685 50.663 50.656 50.663 10.186 0 19.643-3.03 27.6-8.201.286.385.557.771.9 1.114l30.628 30.632a10.633 10.633 0 0 0 7.543 3.129c2.728 0 5.457-1.043 7.543-3.115 4.171-4.157 4.171-10.915.014-15.073M50.671 85.338C31.557 85.338 16 69.78 16 50.663c0-19.102 15.557-34.661 34.67-34.661 19.115 0 34.657 15.559 34.657 34.675 0 19.102-15.557 34.661-34.656 34.661"/>
7
+ </svg>
8
+ <el-select
9
+ :remote-method="querySearch"
10
+ @change="change"
11
+ class="header-search-select"
12
+ default-first-option
13
+ filterable
14
+ :placeholder="$t('菜单查询')"
15
+ ref="headerSearchSelect"
16
+ remote
17
+ v-model="search"
18
+ >
19
+ <el-option :key="item.path" :label="item.title.join(' > ')" :value="item" v-for="item in options"/>
20
+ </el-select>
21
+ </div>
22
+ </template>
23
+
24
+ <script>
25
+ import Fuse from 'fuse.js'
26
+ import path from 'path'
27
+
28
+ export default {
29
+ name: 'HeaderSearch',
30
+ data() {
31
+ return {
32
+ search: '',
33
+ options: [],
34
+ searchPool: [],
35
+ show: false,
36
+ fuse: undefined
37
+ }
38
+ },
39
+ computed: {
40
+ routes() {
41
+ return this.$store.state.permission.hdMenu;
42
+ },
43
+ lang() {
44
+ return this.$store.getters.language
45
+ }
46
+ },
47
+ watch: {
48
+ lang() {
49
+ this.searchPool = this.generateRoutes(this.routes)
50
+ },
51
+ routes() {
52
+ this.searchPool = this.generateRoutes(this.routes)
53
+ },
54
+ searchPool(list) {
55
+ this.initFuse(list)
56
+ },
57
+ show(value) {
58
+ if (value) {
59
+ document.body.addEventListener('click', this.close)
60
+ } else {
61
+ document.body.removeEventListener('click', this.close)
62
+ }
63
+ }
64
+ },
65
+ mounted() {
66
+ this.searchPool = this.generateRoutes(this.routes)
67
+ },
68
+ methods: {
69
+ click() {
70
+ this.show = !this.show
71
+ if (this.show) {
72
+ this.$refs.headerSearchSelect && this.$refs.headerSearchSelect.focus()
73
+ }
74
+ },
75
+ close() {
76
+ this.$refs.headerSearchSelect && this.$refs.headerSearchSelect.blur()
77
+ this.options = []
78
+ this.show = false
79
+ },
80
+ change(val) {
81
+ this.$router.push(val.path)
82
+ this.search = ''
83
+ this.options = []
84
+ this.$nextTick(() => {
85
+ this.show = false
86
+ })
87
+ },
88
+ initFuse(list) {
89
+ this.fuse = new Fuse(list, {
90
+ shouldSort: true,
91
+ threshold: 0.4,
92
+ location: 0,
93
+ distance: 100,
94
+ maxPatternLength: 32,
95
+ minMatchCharLength: 1,
96
+ keys: [{
97
+ name: 'title',
98
+ weight: 0.7
99
+ }, {
100
+ name: 'path',
101
+ weight: 0.3
102
+ }]
103
+ })
104
+ },
105
+ // Filter out the routes that can be displayed in the sidebar
106
+ // And generate the internationalized title
107
+ generateRoutes(routes, basePath = '/', prefixTitle = []) {
108
+ let res = []
109
+ for (const router of routes) {
110
+ // skip hidden router
111
+ if (router.hidden) {
112
+ continue
113
+ }
114
+
115
+ const data = {
116
+ path: path.resolve(basePath, router.path),
117
+ title: [...prefixTitle]
118
+ }
119
+
120
+ if (router.meta && router.meta.title) {
121
+ // generate internationalized title
122
+ const i18ntitle = this.$i18n.locale == 'zh' ? router.meta.title : router.meta.enTitle;
123
+
124
+ data.title = [...data.title, i18ntitle]
125
+
126
+ if (router.redirect !== 'noredirect') {
127
+ // only push the routes with title
128
+ // special case: need to exclude parent router without redirect
129
+ res.push(data)
130
+ }
131
+ }
132
+
133
+ // recursive child routes
134
+ if (router.children) {
135
+ const tempRoutes = this.generateRoutes(router.children, data.path, data.title)
136
+ if (tempRoutes.length >= 1) {
137
+ res = [...res, ...tempRoutes]
138
+ }
139
+ }
140
+ }
141
+
142
+ return res
143
+ },
144
+ querySearch(query) {
145
+ if (query !== '') {
146
+ this.options = this.fuse.search(query)
147
+ } else {
148
+ this.options = []
149
+ }
150
+ }
151
+ }
152
+ }
153
+ </script>
154
+
155
+ <style lang="scss" scoped>
156
+ .header-search {
157
+ font-size: 0 !important;
158
+
159
+ .search-icon {
160
+ font-size: 18px;
161
+ vertical-align: middle;
162
+ display: inline-block;
163
+ cursor: pointer;
164
+ fill: #e4e9ef;
165
+ /* width: 20px;
166
+ height: 20px;
167
+ vertical-align: 10px;*/
168
+ }
169
+
170
+ .header-search-select {
171
+ font-size: 18px;
172
+ transition: width 0.2s;
173
+ width: 0;
174
+ overflow: hidden;
175
+ background: transparent;
176
+ border-radius: 0;
177
+ display: inline-block;
178
+ vertical-align: middle;
179
+
180
+ :deep(.el-input__inner) {
181
+ border-radius: 0;
182
+ border: 0;
183
+ padding-left: 0;
184
+ padding-right: 0;
185
+ box-shadow: none !important;
186
+ border-bottom: 1px solid #d9d9d9;
187
+ vertical-align: middle;
188
+ }
189
+ }
190
+
191
+ &.show {
192
+ .header-search-select {
193
+ width: 150px;
194
+ margin-left: 10px;
195
+ }
196
+ }
197
+ }
198
+ </style>
@@ -0,0 +1,49 @@
1
+ <template>
2
+ <el-breadcrumb class="app-levelbar" separator="/">
3
+ <el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
4
+ <span v-if='item.redirect==="noredirect"||index==levelList.length-1' class="no-redirect">{{item.name}}</span>
5
+ <router-link v-else :to="item.redirect||item.path">{{item.name}}</router-link>
6
+ </el-breadcrumb-item>
7
+ </el-breadcrumb>
8
+ </template>
9
+
10
+ <script>
11
+ export default {
12
+ created() {
13
+ this.getBreadcrumb()
14
+ },
15
+ data() {
16
+ return {
17
+ levelList: null
18
+ }
19
+ },
20
+ methods: {
21
+ getBreadcrumb() {
22
+ let matched = this.$route.matched.filter(item => item.name)
23
+ /* const first = matched[0]
24
+ if (first && (first.name !== '首页' || first.path !== '')) {
25
+ matched = [{ name: '首页', path: '/' }].concat(matched)
26
+ }*/
27
+ this.levelList = matched
28
+ }
29
+ },
30
+ watch: {
31
+ $route() {
32
+ this.getBreadcrumb()
33
+ }
34
+ }
35
+ }
36
+ </script>
37
+
38
+ <style rel="stylesheet/scss" lang="scss" scoped>
39
+ .app-levelbar.el-breadcrumb {
40
+ display: inline-block;
41
+ font-size: 14px;
42
+ line-height: 50px;
43
+ margin-left: 10px;
44
+ .no-redirect {
45
+ color: #97a8be;
46
+ cursor: text;
47
+ }
48
+ }
49
+ </style>