From 43f5661be59575a9ed3d1bd7e2cf9b6f0423e8d6 Mon Sep 17 00:00:00 2001 From: WANGFan <15871339963@163.com> Date: Wed, 25 Jun 2025 13:37:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BD=95=E9=9F=B3=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + pnpm-lock.yaml | 53 ++----- src/components.d.ts | 36 ++--- src/components/recorder-pcm/index.vue | 115 +++++++++++++++ src/lang/modules/enUS.ts | 1 + src/lang/modules/zhCN.ts | 1 + src/mock/_data/system_menu.ts | 21 +++ src/views/component/audio/audio.vue | 2 +- src/views/component/recorder/recorder.vue | 162 ++++++++++++++++++++++ 9 files changed, 329 insertions(+), 63 deletions(-) create mode 100644 src/components/recorder-pcm/index.vue create mode 100644 src/views/component/recorder/recorder.vue diff --git a/package.json b/package.json index 5bf1748..34d5437 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "pinyin-pro": "^3.26.0", "print-js": "^1.6.0", "qrcode": "^1.5.4", + "recorder-core": "^1.3.25011100", "sortablejs": "^1.15.2", "vue": "^3.5.15", "vue-codemirror6": "^1.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3425855..61ebaa9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -74,6 +74,9 @@ importers: qrcode: specifier: ^1.5.4 version: 1.5.4 + recorder-core: + specifier: ^1.3.25011100 + version: 1.3.25011100 sortablejs: specifier: ^1.15.2 version: 1.15.6 @@ -1218,9 +1221,6 @@ packages: '@types/svgo@2.6.4': resolution: {integrity: sha512-l4cmyPEckf8moNYHdJ+4wkHvFxjyW6ulm9l4YGaOxeyBWPhBOT0gvni1InpFPdzx1dKf/2s62qGITwxNWnPQng==} - '@types/web-bluetooth@0.0.16': - resolution: {integrity: sha512-oh8q2Zc32S6gd/j50GowEjKLoOVOwHP/bWVjKJInBwQqdOYMdPrf1oVlelTlyfFK3CKxL1uahMDAr+vy8T7yMQ==} - '@types/web-bluetooth@0.0.21': resolution: {integrity: sha512-oIQLCGWtcFZy2JW77j9k8nHzAOpqMHLQejDA48XXMWH6tjCQHz5RCFz1bzsmROyL6PUm+LLnUiI4BCn221inxA==} @@ -1420,21 +1420,12 @@ packages: '@vueuse/core@12.8.2': resolution: {integrity: sha512-HbvCmZdzAu3VGi/pWYm5Ut+Kd9mn1ZHnn4L5G8kOQTPs/IwIAmJoBrmYk2ckLArgMXZj0AW3n5CAejLUO+PhdQ==} - '@vueuse/core@9.13.0': - resolution: {integrity: sha512-pujnclbeHWxxPRqXWmdkKV5OX4Wk4YeK7wusHqRwU0Q7EFusHoqNA/aPhB6KCh9hEqJkLAJo7bb0Lh9b+OIVzw==} - '@vueuse/metadata@12.8.2': resolution: {integrity: sha512-rAyLGEuoBJ/Il5AmFHiziCPdQzRt88VxR+Y/A/QhJ1EWtWqPBBAxTAFaSkviwEuOEZNtW8pvkPgoCZQ+HxqW1A==} - '@vueuse/metadata@9.13.0': - resolution: {integrity: sha512-gdU7TKNAUVlXXLbaF+ZCfte8BjRJQWPCa2J55+7/h+yDtzw3vOoGQDRXzI6pyKyo6bXFT5/QoPE4hAknExjRLQ==} - '@vueuse/shared@12.8.2': resolution: {integrity: sha512-dznP38YzxZoNloI0qpEfpkms8knDtaoQ6Y/sfS0L7Yki4zh40LFHEhur0odJC6xTHG5dxWVPiUWBXn+wCG2s5w==} - '@vueuse/shared@9.13.0': - resolution: {integrity: sha512-UrnhU+Cnufu4S6JLCPZnkWh0WwZGUp72ktOF2DFptMlOs3TOdVv8xJN53zhHGARmVOsz5KqOls09+J1NR6sBKw==} - '@wangeditor/basic-modules@1.1.7': resolution: {integrity: sha512-cY9CPkLJaqF05STqfpZKWG4LpxTMeGSIIF1fHvfm/mz+JXatCagjdkbxdikOuKYlxDdeqvOeBmsUBItufDLXZg==} peerDependencies: @@ -3940,6 +3931,9 @@ packages: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} + recorder-core@1.3.25011100: + resolution: {integrity: sha512-trXsCH0zurhoizT4Z22C0OsM0SDOW+2OvtgRxeLQFwxoFeqFjDjYZsbZEZUiKMJLhBvamI4K7Ic+qZ2LBo74TA==} + reflect.getprototypeof@1.0.10: resolution: {integrity: sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==} engines: {node: '>= 0.4'} @@ -4821,9 +4815,6 @@ packages: vscode-uri@3.1.0: resolution: {integrity: sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==} - vue-audio-visual@3.0.11: - resolution: {integrity: sha512-toXUXswQqo/oHZuzVnhuZ+m9rM9OU5lgOkckQHGpXizF00XI1gZ1f2KpRrLMKj4e7LC23tZjcgMxDeBJRTenvg==} - vue-codemirror6@1.3.15: resolution: {integrity: sha512-KjcC1ru686qpsOXwHMWVE7Pv5+u1R1JX+nGd/ovXaLSju/3R1ywMU7HFydmEiFKnsSz9aksDcEy3GNCJMyMFWQ==} engines: {pnpm: '>=10.3.0'} @@ -5961,8 +5952,6 @@ snapshots: dependencies: '@types/node': 22.15.21 - '@types/web-bluetooth@0.0.16': {} - '@types/web-bluetooth@0.0.21': {} '@typescript-eslint/eslint-plugin@8.32.1(@typescript-eslint/parser@8.32.1(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)': @@ -6338,33 +6327,14 @@ snapshots: transitivePeerDependencies: - typescript - '@vueuse/core@9.13.0(vue@3.5.15(typescript@5.8.3))': - dependencies: - '@types/web-bluetooth': 0.0.16 - '@vueuse/metadata': 9.13.0 - '@vueuse/shared': 9.13.0(vue@3.5.15(typescript@5.8.3)) - vue-demi: 0.14.10(vue@3.5.15(typescript@5.8.3)) - transitivePeerDependencies: - - '@vue/composition-api' - - vue - '@vueuse/metadata@12.8.2': {} - '@vueuse/metadata@9.13.0': {} - '@vueuse/shared@12.8.2(typescript@5.8.3)': dependencies: vue: 3.5.15(typescript@5.8.3) transitivePeerDependencies: - typescript - '@vueuse/shared@9.13.0(vue@3.5.15(typescript@5.8.3))': - dependencies: - vue-demi: 0.14.10(vue@3.5.15(typescript@5.8.3)) - transitivePeerDependencies: - - '@vue/composition-api' - - vue - '@wangeditor/basic-modules@1.1.7(@wangeditor/core@1.1.19(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(dom7@3.0.0)(is-hotkey@0.2.0)(lodash.camelcase@4.3.0)(lodash.clonedeep@4.5.0)(lodash.debounce@4.0.8)(lodash.foreach@4.5.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(lodash.toarray@4.4.0)(nanoid@3.3.11)(slate@0.72.8)(snabbdom@3.6.2))(dom7@3.0.0)(lodash.throttle@4.1.1)(nanoid@3.3.11)(slate@0.72.8)(snabbdom@3.6.2)': dependencies: '@wangeditor/core': 1.1.19(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(dom7@3.0.0)(is-hotkey@0.2.0)(lodash.camelcase@4.3.0)(lodash.clonedeep@4.5.0)(lodash.debounce@4.0.8)(lodash.foreach@4.5.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(lodash.toarray@4.4.0)(nanoid@3.3.11)(slate@0.72.8)(snabbdom@3.6.2) @@ -9010,6 +8980,8 @@ snapshots: dependencies: picomatch: 2.3.1 + recorder-core@1.3.25011100: {} + reflect.getprototypeof@1.0.10: dependencies: call-bind: 1.0.8 @@ -9421,7 +9393,6 @@ snapshots: qrcode: 1.5.4 sortablejs: 1.15.6 vue: 3.5.15(typescript@5.8.3) - vue-audio-visual: 3.0.11(typescript@5.8.3) vue-codemirror6: 1.3.15(@popperjs/core@2.11.8)(core-js@3.42.0)(typescript@5.8.3)(vue@3.5.15(typescript@5.8.3)) vue-color-kit: 1.0.6(vue@3.5.15(typescript@5.8.3)) vue-i18n: 10.0.0-alpha.3(vue@3.5.15(typescript@5.8.3)) @@ -10043,14 +10014,6 @@ snapshots: vscode-uri@3.1.0: {} - vue-audio-visual@3.0.11(typescript@5.8.3): - dependencies: - '@vueuse/core': 9.13.0(vue@3.5.15(typescript@5.8.3)) - vue: 3.5.15(typescript@5.8.3) - transitivePeerDependencies: - - '@vue/composition-api' - - typescript - vue-codemirror6@1.3.15(@popperjs/core@2.11.8)(core-js@3.42.0)(typescript@5.8.3)(vue@3.5.15(typescript@5.8.3)): dependencies: '@codemirror/commands': 6.8.1 diff --git a/src/components.d.ts b/src/components.d.ts index 2712526..ab6f965 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -5,23 +5,25 @@ // Read more: https://github.com/vuejs/core/pull/3399 export {} -declare module "vue" { +declare module 'vue' { export interface GlobalComponents { - AudioVisualizer: (typeof import("./components/audio-visualizer/index.vue"))["default"]; - BarcodeDraw: (typeof import("./components/barcode-draw/index.vue"))["default"]; - CodeView: (typeof import("./components/code-view/index.vue"))["default"]; - ExternalLinkPage: (typeof import("./components/external-link-page/index.vue"))["default"]; - FillPage: (typeof import("./components/fill-page/index.vue"))["default"]; - InternalLinkPage: (typeof import("./components/internal-link-page/index.vue"))["default"]; - LangProvider: (typeof import("./components/lang-provider/index.vue"))["default"]; - MainTransition: (typeof import("./components/main-transition/index.vue"))["default"]; - PinyinPro: (typeof import("./components/pinyin-pro/index.vue"))["default"]; - QrcodeDraw: (typeof import("./components/qrcode-draw/index.vue"))["default"]; - RouterLink: (typeof import("vue-router"))["RouterLink"]; - RouterView: (typeof import("vue-router"))["RouterView"]; - SelectIcon: (typeof import("./components/select-icon/index.vue"))["default"]; - SvgAndIcon: (typeof import("./components/svg-and-icon/index.vue"))["default"]; - SvgIcon: (typeof import("./components/svg-icon/index.vue"))["default"]; - VerifyCode: (typeof import("./components/verify-code/index.vue"))["default"]; + AudioVisualizer: typeof import('./components/audio-visualizer/index.vue')['default'] + BarcodeDraw: typeof import('./components/barcode-draw/index.vue')['default'] + CodeView: typeof import('./components/code-view/index.vue')['default'] + ExternalLinkPage: typeof import('./components/external-link-page/index.vue')['default'] + FillPage: typeof import('./components/fill-page/index.vue')['default'] + InternalLinkPage: typeof import('./components/internal-link-page/index.vue')['default'] + LangProvider: typeof import('./components/lang-provider/index.vue')['default'] + MainTransition: typeof import('./components/main-transition/index.vue')['default'] + PinyinPro: typeof import('./components/pinyin-pro/index.vue')['default'] + QrcodeDraw: typeof import('./components/qrcode-draw/index.vue')['default'] + Recorder: (typeof import("./components/recorder/index.vue"))["default"] + RecorderPcm: typeof import('./components/recorder-pcm/index.vue')['default'] + RouterLink: typeof import('vue-router')['RouterLink'] + RouterView: typeof import('vue-router')['RouterView'] + SelectIcon: typeof import('./components/select-icon/index.vue')['default'] + SvgAndIcon: typeof import('./components/svg-and-icon/index.vue')['default'] + SvgIcon: typeof import('./components/svg-icon/index.vue')['default'] + VerifyCode: typeof import('./components/verify-code/index.vue')['default'] } } diff --git a/src/components/recorder-pcm/index.vue b/src/components/recorder-pcm/index.vue new file mode 100644 index 0000000..091ac80 --- /dev/null +++ b/src/components/recorder-pcm/index.vue @@ -0,0 +1,115 @@ + + + + + diff --git a/src/lang/modules/enUS.ts b/src/lang/modules/enUS.ts index 73d09f4..3e71af0 100644 --- a/src/lang/modules/enUS.ts +++ b/src/lang/modules/enUS.ts @@ -105,6 +105,7 @@ export default { ["test-common-route"]: "test common route", ["test-dynamic-route"]: "test dynamic route", ["audio"]: "audio", + ["recorder"]: "recorder", ["test"]: "test" } }; diff --git a/src/lang/modules/zhCN.ts b/src/lang/modules/zhCN.ts index 892dd2c..d3d8a7e 100644 --- a/src/lang/modules/zhCN.ts +++ b/src/lang/modules/zhCN.ts @@ -105,6 +105,7 @@ export default { ["test-common-route"]: "测试普通路由", ["test-dynamic-route"]: "测试动态路由", ["audio"]: "音频", + ["recorder"]: "录音", ["test"]: "测试" } }; diff --git a/src/mock/_data/system_menu.ts b/src/mock/_data/system_menu.ts index f7eb623..d400367 100644 --- a/src/mock/_data/system_menu.ts +++ b/src/mock/_data/system_menu.ts @@ -632,6 +632,27 @@ export const systemMenu = [ }, children: null }, + { + id: "0613", + parentId: "06", + path: "/component/recorder", + name: "recorder", + component: "component/recorder/recorder", + meta: { + title: "recorder", + hide: false, + disable: false, + keepAlive: true, + affix: false, + link: "", + iframe: false, + roles: ["admin"], + icon: "icon-menu", + sort: 13, + type: 2 + }, + children: null + }, { id: "07", parentId: "0", diff --git a/src/views/component/audio/audio.vue b/src/views/component/audio/audio.vue index 51eeebf..396d1c9 100644 --- a/src/views/component/audio/audio.vue +++ b/src/views/component/audio/audio.vue @@ -101,7 +101,7 @@ const onAudio = (blob: Blob) => {
本地录音需要https或localhost安全环境,是否为安全环境:{{ isSecureEnvironment() }} -
+
diff --git a/src/views/component/recorder/recorder.vue b/src/views/component/recorder/recorder.vue new file mode 100644 index 0000000..20f5ac9 --- /dev/null +++ b/src/views/component/recorder/recorder.vue @@ -0,0 +1,162 @@ + + + + +