|
@@ -1,4 +1,4 @@
|
|
|
-import { Popup, Snackbar } from "@varlet/ui";
|
|
|
+import { Popup } from "@varlet/ui";
|
|
|
import { Transition, defineComponent, onMounted, reactive, watch } from "vue";
|
|
|
import {
|
|
|
connectWebsocket,
|
|
@@ -17,7 +17,7 @@ import state from "/src/state";
|
|
|
import { storeData } from "/src/store";
|
|
|
import { browser } from "/src/utils";
|
|
|
import { getNoteByMeasuresSlursStart } from "/src/helpers/formateMusic";
|
|
|
-import { Icon } from "vant";
|
|
|
+import { Icon, showToast } from "vant";
|
|
|
import EvaluatResult from "./evaluat-result";
|
|
|
import EvaluatAudio from "./evaluat-audio";
|
|
|
import { api_openWebView, api_proxyServiceMessage, api_videoUpdate } from "/src/helpers/communication";
|
|
@@ -162,29 +162,48 @@ export default defineComponent({
|
|
|
}
|
|
|
evaluatingData.resulstMode = false;
|
|
|
};
|
|
|
+
|
|
|
/** 上传音视频 */
|
|
|
const hanldeUpdateVideoAndAudio = async (update = false) => {
|
|
|
if (!update) {
|
|
|
evaluatModel.evaluatUpdateAudio = false;
|
|
|
return;
|
|
|
}
|
|
|
- let res = null;
|
|
|
- if (evaluatModel.isSaveVideo) {
|
|
|
- res = await api_videoUpdate();
|
|
|
+ if (state.setting.camera && state.setting.saveToAlbum) {
|
|
|
+ evaluatModel.evaluatUpdateAudio = false;
|
|
|
+ api_videoUpdate((res: any) => {
|
|
|
+ if (res) {
|
|
|
+ if (res?.content?.type === 'success'){
|
|
|
+ handleSaveResult({
|
|
|
+ recordId: evaluatingData.resultData?.recordId,
|
|
|
+ filePath: res?.content?.filePath,
|
|
|
+ })
|
|
|
+ } else if (res?.content?.type === 'error') {
|
|
|
+ showToast({
|
|
|
+ message: res.content?.message || "上传失败",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return;
|
|
|
}
|
|
|
+ evaluatModel.evaluatUpdateAudio = false;
|
|
|
+ handleSaveResult({
|
|
|
+ recordId: evaluatingData.resultData?.recordId,
|
|
|
+ });
|
|
|
+ };
|
|
|
+ const handleSaveResult = (_body: any) => {
|
|
|
api_proxyServiceMessage({
|
|
|
header: {
|
|
|
commond: "videoUpload",
|
|
|
status: 200,
|
|
|
type: "SOUND_COMPARE",
|
|
|
},
|
|
|
- body: {
|
|
|
- filePath: res?.content?.filePath,
|
|
|
- recordId: res?.recordId,
|
|
|
- },
|
|
|
+ body: _body,
|
|
|
+ });
|
|
|
+ showToast({
|
|
|
+ message: "上传成功",
|
|
|
});
|
|
|
- Snackbar.success("上传成功");
|
|
|
- evaluatModel.evaluatUpdateAudio = false;
|
|
|
};
|
|
|
|
|
|
onMounted(() => {
|