cnhis-design-vue 3.1.54-beta.21 → 3.1.54-beta.22
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.
|
@@ -1,4 +1,16 @@
|
|
|
1
|
+
import 'recorder-core/src/engine/mp3';
|
|
2
|
+
import 'recorder-core/src/engine/mp3-engine';
|
|
3
|
+
import { AnyObject } from '../../../../es/shared/types';
|
|
1
4
|
export default class ChatSDK {
|
|
5
|
+
private recorder;
|
|
6
|
+
private recorderStatus;
|
|
7
|
+
constructor(option?: AnyObject);
|
|
8
|
+
recorderOpen(): Promise<unknown>;
|
|
9
|
+
recorderStart(): Promise<{
|
|
10
|
+
result: string;
|
|
11
|
+
}>;
|
|
12
|
+
recorderStop(isRecognition?: boolean): Promise<AnyObject>;
|
|
13
|
+
destroy(): void;
|
|
2
14
|
static audioRecognition(params: FormData): Promise<import("axios").AxiosResponse<any, any>>;
|
|
3
15
|
static audioRevise(params: {
|
|
4
16
|
file_id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r from"axios";import e from"recorder-core";import"recorder-core/src/engine/mp3";import"recorder-core/src/engine/mp3-engine";import{uuidGenerator as t}from"../../../shared/utils/index.js";class s{constructor(r){this.recorder=null,this.recorderStatus=!1,this.recorder=e({type:"mp3",sampleRate:16e3,bitRate:16,...r})}async recorderOpen(){const r={};return new Promise(((e,t)=>{this.recorder.open((()=>{this.recorderStatus=!0,r.result="success",e(r)}),((e,s)=>{this.recorderStatus=!1,Object.assign(r,{result:"fail",msg:e,isUserNotAllow:s}),t(r)}))}))}async recorderStart(){return this.recorderStatus?(this.recorder.start(),Promise.resolve({result:"success"})):Promise.reject({result:"fail",msg:"请先打开麦克风"})}async recorderStop(r=!0){return new Promise(((e,o)=>{this.recorder.stop((async(i,a)=>{const c=new File([i],`${t()}.mp3`,{type:i.type});try{let t;if(r){const r=new FormData;r.append("audio",c);const{data:e}=await s.audioRecognition(r);t=e}e({result:"success",file:c,duration:a,...t?{data:t}:{}})}catch(r){o({result:"fail",msg:r})}}),(r=>{o({result:"fail",msg:r})}))}))}destroy(){var r;null==(r=this.recorder)||r.close(),this.recorder=null}static async audioRecognition(e){return await r.post("/audio/recognition",e,{headers:{"Content-Type":"multipart/form-data"}})}static async audioRevise(e){return await r.post("/audio/revise",e)}}export{s as default};
|
|
@@ -1783,9 +1783,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1783
1783
|
handleDisplayCategoryRemove: (index: number, item: import("../../../../es/components/table-filter/src/types").ICategoryItemType) => void;
|
|
1784
1784
|
handleDisplayCategoryAdd: (cb?: any) => void;
|
|
1785
1785
|
handlerBlur: () => void;
|
|
1786
|
-
initDisplayCategories: (rawDataDisplayCategories: any, displayCategory: any) => void;
|
|
1787
|
-
* 改变展示方式
|
|
1788
|
-
*/
|
|
1786
|
+
initDisplayCategories: (rawDataDisplayCategories: any, displayCategory: any) => void;
|
|
1789
1787
|
FilterConditionsState: any;
|
|
1790
1788
|
paramOptions: import("vue").ComputedRef<any>;
|
|
1791
1789
|
addFilterCondition: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e="@cnhis-design-vue/shared",i="3.1.54-beta.
|
|
1
|
+
var e="@cnhis-design-vue/shared",i="3.1.54-beta.22",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.1.54-beta.22",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cnhis-design-vue",
|
|
3
|
-
"version": "3.1.54-beta.
|
|
3
|
+
"version": "3.1.54-beta.22",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"module": "./es/components/index.js",
|
|
6
6
|
"main": "./es/components/index.js",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"min-dom": "^3.2.1",
|
|
43
43
|
"moment": "^2.29.1",
|
|
44
44
|
"naive-ui": "^2.30.0",
|
|
45
|
+
"recorder-core": "^1.2.23070100",
|
|
45
46
|
"sockjs-client": "^1.6.1",
|
|
46
47
|
"sortablejs": "^1.15.0",
|
|
47
48
|
"spark-md5": "^3.0.2",
|
|
@@ -63,5 +64,5 @@
|
|
|
63
64
|
"iOS 7",
|
|
64
65
|
"last 3 iOS versions"
|
|
65
66
|
],
|
|
66
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "b77c4d202b7fcaab5e31c5db4144b7b0ee381fbb"
|
|
67
68
|
}
|