diff --git a/package.json b/package.json index 610a243..b3c7aaa 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "echarts-liquidfill": "^3.1.0", "element-plus": "^2.3.0", "pinia": "^2.0.30", + "recorder-core": "^1.3.23122400", "register-service-worker": "^1.7.2", "swiper": "^9.0.5", "three": "^0.150.1", diff --git a/src/http/Recorder/index.ts b/src/http/Recorder/index.ts new file mode 100644 index 0000000..3c79f07 --- /dev/null +++ b/src/http/Recorder/index.ts @@ -0,0 +1,6 @@ +import {get,post,} from "@/utils/http" + +//url +export function postwavUpload(data:any){ + return get('/screen/voice2Text/getFileText',data) +} \ No newline at end of file diff --git a/src/http/index.ts b/src/http/index.ts index 736f8c1..4de82ae 100644 --- a/src/http/index.ts +++ b/src/http/index.ts @@ -7,7 +7,7 @@ * * 版权信息 : 2023 by ${再登软件}, All Rights Reserved. */ -import {get,post} from "@/utils/http" +import {get,post,postupLoad} from "@/utils/http" //报警数据 export function getAlarmListData(data:any){ @@ -16,4 +16,9 @@ export function getAlarmListData(data:any){ //报警历史数据查询 export function getAlarmListHistoryData(data:any){ return get('/screen/alarm/getAlarmListHistory',data) +} + +//文件上传 +export function upload(data:any){ + return postupLoad('/common/upload',data) } \ No newline at end of file diff --git a/src/router/index.ts b/src/router/index.ts index df73fc5..875eea4 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -304,6 +304,11 @@ const routes: Array = [ name: "Elevator", component: () => import("../views/Elevator/index.vue"), }, + { + path: "/Recorder", + name: "Recorder", + component: () => import("../views/Recorder/index.vue"), + }, diff --git a/src/utils/http.ts b/src/utils/http.ts index 2e83dd4..620dccf 100644 --- a/src/utils/http.ts +++ b/src/utils/http.ts @@ -175,3 +175,34 @@ export function post(staurl: string, data: any = "", method: string = "POST") { } + +export function postupLoad(staurl: string, data: any = "", method: string = "POST") { + + + let _url = url + staurl //+ "?" + strData; + let METHOD = method || "POST" + let header = { //请求头设置 + "Content-Type": "multipart/form-data" + } + return new Promise((resolve, rejects) => { + let params: any = {} + // 处理表单结果中文件的操作 + + axios({ + url: _url, + method: METHOD, + data: data, + headers: header + }).then(function (res) { + // console.log(val) // axios会对我们请求来的结果进行再一次的封装( 让安全性提高 ) + resolve(res.data) + }).catch(function (err) { + // console.log(err) + rejects(err) + }) + + + }) +} + + diff --git a/src/views/Recorder/index.vue b/src/views/Recorder/index.vue new file mode 100644 index 0000000..0287c9c --- /dev/null +++ b/src/views/Recorder/index.vue @@ -0,0 +1,186 @@ + + + + + + \ No newline at end of file