|
@@ -65,6 +65,9 @@ import { saveAs } from "file-saver";
|
|
|
import qs from "query-string";
|
|
|
import { useDocumentVisibility } from "@vueuse/core";
|
|
|
import request from "/src/utils/request";
|
|
|
+import { api_uploadFile } from "/src/utils/uploadFile";
|
|
|
+import { bufferToWave } from "/src/helpers/parseABC";
|
|
|
+import UploadToResources from "../component/upload-to-resources";
|
|
|
|
|
|
export const initMusic = (total: number): IMeasure[] => {
|
|
|
return new Array(total).fill(0).map((item, index) => {
|
|
@@ -132,10 +135,12 @@ export default defineComponent({
|
|
|
selectMearesShow: false, // 选择小节弹窗
|
|
|
});
|
|
|
const data = reactive({
|
|
|
+ uploadStatus: "",
|
|
|
+ saveLoading: false,
|
|
|
loading: true,
|
|
|
drawCount: 0,
|
|
|
isSave: true,
|
|
|
- musicId: "",
|
|
|
+ musicId: Date.now().toString(),
|
|
|
musicName: "", // 曲谱名称
|
|
|
creator: "", // 创建者
|
|
|
subjectId: "", // 声部
|
|
@@ -175,6 +180,13 @@ export default defineComponent({
|
|
|
moveKeyType: "inset" as "inset" | "up" | "down", // 移调类型
|
|
|
activePlayNote: null as any, // 当前演奏音符
|
|
|
times: [] as any[], // 节拍器数据
|
|
|
+
|
|
|
+ undoList: [] as any[], // 撤销列表
|
|
|
+ redoList: [] as any[], // 重做列表
|
|
|
+
|
|
|
+ uploadShow: false, // 上传弹窗
|
|
|
+ item: {} as any, // 上传数据
|
|
|
+ uploadClick: false, // 上传点击
|
|
|
});
|
|
|
const noteTypes = ABC_DATA.types.map((item) => item.value).filter(Boolean);
|
|
|
const accidentals = ABC_DATA.accidentals.map((item) => item.value).filter(Boolean);
|
|
@@ -687,6 +699,46 @@ export default defineComponent({
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ const handleClickExit = async () => {
|
|
|
+ if (data.saveLoading) return;
|
|
|
+ const msg = message.loading("保存中...", { duration: 0 });
|
|
|
+ await handleSaveMusic(false);
|
|
|
+ setTimeout(async () => {
|
|
|
+ msg.type = "success";
|
|
|
+ msg.content = "保存成功";
|
|
|
+ setTimeout(() => {
|
|
|
+ msg.destroy();
|
|
|
+ }, 500);
|
|
|
+ }, 300);
|
|
|
+ if (data.uploadStatus !== "NO") {
|
|
|
+ dialog.warning({
|
|
|
+ maskClosable: true,
|
|
|
+ autoFocus: false,
|
|
|
+ class: "deleteDialog saveDialog",
|
|
|
+ title: "温馨提示",
|
|
|
+ content: "是否更新到我的资源?",
|
|
|
+ positiveText: "更新",
|
|
|
+ positiveButtonProps: {
|
|
|
+ type: "primary",
|
|
|
+ },
|
|
|
+ negativeText: "不更新",
|
|
|
+ negativeButtonProps: {
|
|
|
+ type: "default",
|
|
|
+ ghost: false,
|
|
|
+ },
|
|
|
+ onPositiveClick: async () => {
|
|
|
+ data.uploadClick = true;
|
|
|
+ await handleUpdate();
|
|
|
+ },
|
|
|
+ onNegativeClick: () => {
|
|
|
+ handleClose();
|
|
|
+ },
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ handleClose();
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
/**
|
|
|
*
|
|
|
* @param key
|
|
@@ -694,6 +746,11 @@ export default defineComponent({
|
|
|
* @returns
|
|
|
*/
|
|
|
const handleChange = async (params: { type: string; value: any }) => {
|
|
|
+ // 最多记录30步
|
|
|
+ if (data.undoList.length > 30) {
|
|
|
+ data.undoList.shift();
|
|
|
+ }
|
|
|
+ data.undoList.push(cleanDeep(abcData.abc));
|
|
|
abcData.synthControl.disable(true);
|
|
|
if (data.playState) {
|
|
|
data.playState = false;
|
|
@@ -706,6 +763,7 @@ export default defineComponent({
|
|
|
if (type === "exit") {
|
|
|
if (!data.isSave) {
|
|
|
clearTimeout(saveTimer);
|
|
|
+ data.uploadClick = false;
|
|
|
dialog.warning({
|
|
|
maskClosable: true,
|
|
|
autoFocus: false,
|
|
@@ -721,17 +779,8 @@ export default defineComponent({
|
|
|
type: "default",
|
|
|
ghost: false,
|
|
|
},
|
|
|
- onPositiveClick: async () => {
|
|
|
- const msg = message.loading("保存中...");
|
|
|
- await handleSaveMusic(false);
|
|
|
- setTimeout(() => {
|
|
|
- msg.type = "success";
|
|
|
- msg.content = "保存成功";
|
|
|
- setTimeout(() => {
|
|
|
- msg.destroy();
|
|
|
- handleClose();
|
|
|
- }, 500);
|
|
|
- }, 300);
|
|
|
+ onPositiveClick: () => {
|
|
|
+ handleClickExit();
|
|
|
},
|
|
|
onNegativeClick: () => {
|
|
|
handleClose();
|
|
@@ -888,9 +937,15 @@ export default defineComponent({
|
|
|
// 谱号
|
|
|
if (type === "clef") {
|
|
|
if (data.active) {
|
|
|
- if (!activeNote) return;
|
|
|
- activeNote.clef = `[${value}]`;
|
|
|
- await handleResetRender();
|
|
|
+ if (data.active.measureIndex === 0 && data.active.noteIndex === 0) {
|
|
|
+ abcData.abc.celf = value;
|
|
|
+ handleResetRender();
|
|
|
+ } else {
|
|
|
+ if (!activeNote) return;
|
|
|
+ activeNote.clef = `[${value}]`;
|
|
|
+ await handleResetRender();
|
|
|
+ }
|
|
|
+ rangeHighlight(data.active.startChar);
|
|
|
} else {
|
|
|
abcData.abc.celf = value;
|
|
|
handleResetRender();
|
|
@@ -900,11 +955,21 @@ export default defineComponent({
|
|
|
// 调号
|
|
|
if (type === "key") {
|
|
|
if (data.active) {
|
|
|
- if (!activeNote) return;
|
|
|
- activeNote.key = `[${value}]`;
|
|
|
- await handleResetRender();
|
|
|
+ if (data.active.measureIndex === 0 && data.active.noteIndex === 0) {
|
|
|
+ abcData.abc.key = value;
|
|
|
+ abcData.abc.visualTranspose = 0;
|
|
|
+ abcData.abc.visualKey = "K:C";
|
|
|
+ await handleResetRender();
|
|
|
+ } else {
|
|
|
+ if (!activeNote) return;
|
|
|
+ activeNote.key = `[${value}]`;
|
|
|
+ await handleResetRender();
|
|
|
+ }
|
|
|
+ rangeHighlight(data.active.startChar);
|
|
|
} else {
|
|
|
abcData.abc.key = value;
|
|
|
+ abcData.abc.visualTranspose = 0;
|
|
|
+ abcData.abc.visualKey = "K:C";
|
|
|
await handleResetRender();
|
|
|
}
|
|
|
}
|
|
@@ -1050,9 +1115,9 @@ export default defineComponent({
|
|
|
if (value === "|:") {
|
|
|
const prevMeasure = abcData.abc.measures[data.active.measureIndex - 1] || null;
|
|
|
if (!prevMeasure) return;
|
|
|
- prevMeasure.barline = value;
|
|
|
+ prevMeasure.barline = prevMeasure.barline === value ? "|" : value;
|
|
|
} else {
|
|
|
- activeMeasure.barline = value;
|
|
|
+ activeMeasure.barline = activeMeasure.barline === value ? "|" : value;
|
|
|
}
|
|
|
await handleResetRender();
|
|
|
}
|
|
@@ -1235,6 +1300,7 @@ export default defineComponent({
|
|
|
// ? item.step
|
|
|
// : item.step + 12
|
|
|
// : item.step;
|
|
|
+ console.log(item);
|
|
|
abcData.abc.visualTranspose = item.step;
|
|
|
abcData.abc.visualKey = item.value;
|
|
|
popup.moveKeyShow = false;
|
|
@@ -1245,10 +1311,37 @@ export default defineComponent({
|
|
|
await handleResetRender();
|
|
|
};
|
|
|
|
|
|
+ const keyDownData = reactive({
|
|
|
+ wait: false,
|
|
|
+ control: false,
|
|
|
+ });
|
|
|
+ const handleKeyDonw = async (e: KeyboardEvent) => {
|
|
|
+ if ((e.target as HTMLElement).nodeName === "INPUT") return;
|
|
|
+ if (e.key === "Control" || e.key === "Meta") {
|
|
|
+ keyDownData.control = true;
|
|
|
+ }
|
|
|
+ if (e.key === "z" && keyDownData.control && !keyDownData.wait) {
|
|
|
+ e.preventDefault();
|
|
|
+ if (data.undoList.length) {
|
|
|
+ abcData.abc = cloneDeep(data.undoList[data.undoList.length - 1]);
|
|
|
+ data.undoList.pop();
|
|
|
+ keyDownData.wait = true;
|
|
|
+ await handleResetRender();
|
|
|
+ nextTick(() => {
|
|
|
+ keyDownData.wait = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
const handleKeyUp = (e: KeyboardEvent) => {
|
|
|
if ((e.target as HTMLElement).nodeName === "INPUT") return;
|
|
|
- if (!data.active) return false;
|
|
|
console.log(e.key);
|
|
|
+
|
|
|
+ if (e.key === "Control" || e.key === "Meta") {
|
|
|
+ keyDownData.control = false;
|
|
|
+ }
|
|
|
+ if (!data.active) return false;
|
|
|
if (e.key === "Backspace") {
|
|
|
handleChange({ type: "delete", value: "" });
|
|
|
}
|
|
@@ -1284,9 +1377,11 @@ export default defineComponent({
|
|
|
data.loading = true;
|
|
|
const res = await api_musicSheetCreationDetail(query.id);
|
|
|
if (res?.code == 200) {
|
|
|
+ data.uploadStatus = res.data.uploadStatus || "";
|
|
|
data.musicId = res.data.id || "";
|
|
|
data.musicName = res.data.name || "";
|
|
|
data.creator = res.data.creator || "";
|
|
|
+ data.subjectId = res.data.subjectId || "";
|
|
|
let abc = "" as any;
|
|
|
try {
|
|
|
abc = JSON.parse(res.data.creationData);
|
|
@@ -1312,56 +1407,79 @@ export default defineComponent({
|
|
|
data.loading = false;
|
|
|
return res;
|
|
|
};
|
|
|
+ const setSaveLoading = (tips: boolean) => {
|
|
|
+ data.saveLoading = true;
|
|
|
+ if (tips) {
|
|
|
+ message.loading("保存中...", { duration: 0 });
|
|
|
+ }
|
|
|
+ };
|
|
|
const handleSaveMusic = async (tips = true) => {
|
|
|
const query = getQuery();
|
|
|
abcData.abc.title = data.musicName;
|
|
|
abcData.abc.creator = data.creator;
|
|
|
- if (query.id) {
|
|
|
- await api_musicSheetCreationUpdate({
|
|
|
- name: data.musicName,
|
|
|
- creator: data.creator,
|
|
|
- creationConfig: renderMeasures(abcData.abc, {
|
|
|
- hiddenIndex: true,
|
|
|
- showTitle: true,
|
|
|
- showCreator: true,
|
|
|
- }),
|
|
|
- creationData: JSON.stringify(cleanDeep(abcData.abc)),
|
|
|
- id: query.id,
|
|
|
- subjectId: "",
|
|
|
- });
|
|
|
- } else {
|
|
|
- const res = await api_musicSheetCreationSave({
|
|
|
- name: data.musicName,
|
|
|
- creator: data.creator,
|
|
|
- creationConfig: renderMeasures(abcData.abc, {
|
|
|
- hiddenIndex: true,
|
|
|
- showTitle: true,
|
|
|
- showCreator: true,
|
|
|
- }),
|
|
|
- creationData: JSON.stringify(cleanDeep(abcData.abc)),
|
|
|
- subjectId: "",
|
|
|
- });
|
|
|
- if (res?.data) {
|
|
|
- const hash = location.hash.split("?");
|
|
|
- const qs_data = qs.parse(hash[1]);
|
|
|
- qs_data.id = res.data;
|
|
|
- try {
|
|
|
- delete qs_data.config;
|
|
|
- } catch (error) {
|
|
|
- console.log("🚀 ~ error:", error);
|
|
|
+ setSaveLoading(tips);
|
|
|
+ const wavUrl = await productWav(false);
|
|
|
+ const pngUrl = await productPng(false);
|
|
|
+ console.log("🚀 ~ pngUrl:", pngUrl);
|
|
|
+ try {
|
|
|
+ if (query.id) {
|
|
|
+ await api_musicSheetCreationUpdate({
|
|
|
+ name: data.musicName || "未命名乐谱",
|
|
|
+ creator: data.creator || "未命名乐谱",
|
|
|
+ creationConfig: renderMeasures(abcData.abc, {
|
|
|
+ hiddenIndex: true,
|
|
|
+ showTitle: true,
|
|
|
+ showCreator: true,
|
|
|
+ }),
|
|
|
+ creationData: JSON.stringify(cleanDeep(abcData.abc)),
|
|
|
+ id: query.id,
|
|
|
+ subjectId: data.subjectId,
|
|
|
+ filePath: wavUrl,
|
|
|
+ coverImg: pngUrl,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ const res = await api_musicSheetCreationSave({
|
|
|
+ name: data.musicName || "未命名乐谱",
|
|
|
+ creator: data.creator || "未命名乐谱",
|
|
|
+ creationConfig: renderMeasures(abcData.abc, {
|
|
|
+ hiddenIndex: true,
|
|
|
+ showTitle: true,
|
|
|
+ showCreator: true,
|
|
|
+ }),
|
|
|
+ creationData: JSON.stringify(cleanDeep(abcData.abc)),
|
|
|
+ subjectId: data.subjectId,
|
|
|
+ filePath: wavUrl,
|
|
|
+ coverImg: pngUrl,
|
|
|
+ });
|
|
|
+ if (res?.data) {
|
|
|
+ const hash = location.hash.split("?");
|
|
|
+ const qs_data = qs.parse(hash[1]);
|
|
|
+ qs_data.id = res.data;
|
|
|
+ try {
|
|
|
+ delete qs_data.config;
|
|
|
+ } catch (error) {
|
|
|
+ console.log("🚀 ~ error:", error);
|
|
|
+ }
|
|
|
+ location.hash = hash[0] + "?" + qs.stringify(qs_data);
|
|
|
}
|
|
|
- location.hash = hash[0] + "?" + qs.stringify(qs_data);
|
|
|
}
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
}
|
|
|
+
|
|
|
if (tips) {
|
|
|
+ message.destroyAll();
|
|
|
message.success("保存成功");
|
|
|
}
|
|
|
data.isSave = true;
|
|
|
+ data.saveLoading = false;
|
|
|
+ data.uploadClick = false;
|
|
|
};
|
|
|
const hanldeInitCreate = () => {
|
|
|
const query = getQuery();
|
|
|
const abc = decodeUrl(query.config);
|
|
|
console.log("🚀 ~ abc:", abc);
|
|
|
+ data.subjectId = abc.subjectId || "";
|
|
|
abcData.abc.celf = abc.celf ?? "K:treble";
|
|
|
abcData.abc.key = abc.key ?? "K:C";
|
|
|
abcData.abc.meter = abc.meter ?? "M:4/4";
|
|
@@ -1406,6 +1524,7 @@ export default defineComponent({
|
|
|
await handleResetRender();
|
|
|
loadMiniMp3();
|
|
|
document.addEventListener("keyup", handleKeyUp);
|
|
|
+ document.addEventListener("keydown", handleKeyDonw);
|
|
|
window.onbeforeunload = (e) => {
|
|
|
if (!data.isSave) {
|
|
|
e.preventDefault();
|
|
@@ -1423,6 +1542,7 @@ export default defineComponent({
|
|
|
});
|
|
|
onUnmounted(() => {
|
|
|
document.removeEventListener("keyup", handleKeyUp);
|
|
|
+ document.removeEventListener("keydown", handleKeyDonw);
|
|
|
});
|
|
|
|
|
|
const measureComputed = computed(() => {
|
|
@@ -1497,36 +1617,53 @@ export default defineComponent({
|
|
|
handleResetRender();
|
|
|
};
|
|
|
|
|
|
+ const productPng = (isUrl = true) => {
|
|
|
+ return new Promise((resolve) => {
|
|
|
+ const paper = document.getElementById("exportPng");
|
|
|
+ if (!paper) return;
|
|
|
+ const abc = renderMeasures(abcData.abc, {
|
|
|
+ hiddenIndex: true,
|
|
|
+ showTitle: true,
|
|
|
+ showCreator: true,
|
|
|
+ });
|
|
|
+ ABCJS.renderAbc(paper, abc, abcData.abcOptions);
|
|
|
+ const svg: any = paper.children[0]?.cloneNode(true);
|
|
|
+ const svgBox = paper.getBoundingClientRect();
|
|
|
+ svg.setAttribute("width", `${svgBox.width * 3}`);
|
|
|
+ svg.setAttribute("height", `${svgBox.height * 3}`);
|
|
|
+ const rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
|
+ rect.setAttribute("x", "0");
|
|
|
+ rect.setAttribute("y", "0");
|
|
|
+ rect.setAttribute("width", `${svgBox.width * 10}`);
|
|
|
+ rect.setAttribute("height", `${svgBox.height * 10}`);
|
|
|
+ rect.setAttribute("fill", "#fff");
|
|
|
+ svg.prepend(rect);
|
|
|
+ if (svg) {
|
|
|
+ const _canvas = svg2canvas(svg.outerHTML);
|
|
|
+ if (isUrl) {
|
|
|
+ // document.body.appendChild(_canvas);
|
|
|
+ let el: any = document.createElement("a");
|
|
|
+ // 设置 href 为图片经过 base64 编码后的字符串,默认为 png 格式
|
|
|
+ el.href = _canvas.toDataURL();
|
|
|
+ el.download = data.musicName + ".png";
|
|
|
+
|
|
|
+ // 创建一个点击事件并对 a 标签进行触发
|
|
|
+ const event = new MouseEvent("click");
|
|
|
+ el.dispatchEvent(event);
|
|
|
+ } else {
|
|
|
+ _canvas.toBlob(async (blob) => {
|
|
|
+ const pngUrl = await api_uploadFile(blob, data.musicId + ".png");
|
|
|
+ resolve(pngUrl);
|
|
|
+ }, "image/png");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
const downPng = async () => {
|
|
|
abcData.abc.title = `T:${data.musicName}`;
|
|
|
abcData.abc.creator = `R:${data.creator}`;
|
|
|
- const paper = document.getElementById("exportPng");
|
|
|
- if (!paper) return;
|
|
|
- const abc = renderMeasures(abcData.abc, { hiddenIndex: true, showTitle: true, showCreator: true });
|
|
|
- ABCJS.renderAbc(paper, abc, abcData.abcOptions);
|
|
|
- const svg: any = paper.children[0]?.cloneNode(true);
|
|
|
- const svgBox = paper.getBoundingClientRect();
|
|
|
- svg.setAttribute("width", `${svgBox.width * 3}`);
|
|
|
- svg.setAttribute("height", `${svgBox.height * 3}`);
|
|
|
- const rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
|
- rect.setAttribute("x", "0");
|
|
|
- rect.setAttribute("y", "0");
|
|
|
- rect.setAttribute("width", `${svgBox.width * 10}`);
|
|
|
- rect.setAttribute("height", `${svgBox.height * 10}`);
|
|
|
- rect.setAttribute("fill", "#fff");
|
|
|
- svg.prepend(rect);
|
|
|
- if (svg) {
|
|
|
- const _canvas = svg2canvas(svg.outerHTML);
|
|
|
- // document.body.appendChild(_canvas);
|
|
|
- let el: any = document.createElement("a");
|
|
|
- // 设置 href 为图片经过 base64 编码后的字符串,默认为 png 格式
|
|
|
- el.href = _canvas.toDataURL();
|
|
|
- el.download = data.musicName + ".png";
|
|
|
-
|
|
|
- // 创建一个点击事件并对 a 标签进行触发
|
|
|
- const event = new MouseEvent("click");
|
|
|
- el.dispatchEvent(event);
|
|
|
- }
|
|
|
+ productPng();
|
|
|
};
|
|
|
|
|
|
const downRef = ref();
|
|
@@ -1540,12 +1677,8 @@ export default defineComponent({
|
|
|
downRef.value.innerHTML = midi;
|
|
|
downRef.value.querySelector("a").click();
|
|
|
};
|
|
|
- const downWav = () => {
|
|
|
- try {
|
|
|
- if (abcData.synthControl) {
|
|
|
- abcData.synthControl.download("曲谱.wav");
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
+ const productWav = async (isUrl = true) => {
|
|
|
+ return new Promise((resolve) => {
|
|
|
const midiBuffer = new ABCJS.synth.CreateSynth();
|
|
|
midiBuffer
|
|
|
.init({
|
|
@@ -1553,11 +1686,25 @@ export default defineComponent({
|
|
|
options: abcData.synthOptions,
|
|
|
})
|
|
|
.then(() => {
|
|
|
- midiBuffer.prime().then(() => {
|
|
|
- // console.log(midiBuffer.download());
|
|
|
- downloadFile(midiBuffer.download(), "曲谱.wav");
|
|
|
+ midiBuffer.prime().then(async () => {
|
|
|
+ if (isUrl) {
|
|
|
+ downloadFile(midiBuffer.download(), (data.musicName || "曲谱") + ".wav");
|
|
|
+ } else {
|
|
|
+ const blob = bufferToWave((midiBuffer as any).getAudioBuffer());
|
|
|
+ const wavurl = await api_uploadFile(blob, data.musicId + ".wav");
|
|
|
+ resolve(wavurl);
|
|
|
+ }
|
|
|
});
|
|
|
});
|
|
|
+ });
|
|
|
+ };
|
|
|
+ const downWav = () => {
|
|
|
+ try {
|
|
|
+ if (abcData.synthControl) {
|
|
|
+ abcData.synthControl.download((data.musicName || "曲谱") + ".wav");
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ productWav();
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -1658,6 +1805,20 @@ export default defineComponent({
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ const handleUpdate = async () => {
|
|
|
+ if (!data.isSave) {
|
|
|
+ await handleSaveMusic();
|
|
|
+ }
|
|
|
+ const query = getQuery();
|
|
|
+ const res = await api_musicSheetCreationDetail(query.id);
|
|
|
+ if (res.data) {
|
|
|
+ if (res.data.uploadStatus !== "YES") {
|
|
|
+ data.item = { ...res.data, visualObj: abcData.visualObj };
|
|
|
+ data.uploadShow = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
return () => (
|
|
|
<>
|
|
|
<div class={styles.container}>
|
|
@@ -1671,6 +1832,7 @@ export default defineComponent({
|
|
|
</div>
|
|
|
<div class={styles.topBtn}>
|
|
|
<FileBtn
|
|
|
+ saveLoading={data.saveLoading}
|
|
|
onSelect={(val: IFileBtnType) => {
|
|
|
if (val === "newMusic") {
|
|
|
handleCreateMusic();
|
|
@@ -1679,13 +1841,11 @@ export default defineComponent({
|
|
|
} else if (["xml"].includes(val)) {
|
|
|
handleExport();
|
|
|
} else if (val === "upload") {
|
|
|
+ handleUpdate();
|
|
|
} else if (["png", "midi", "wav", "down-xml"].includes(val)) {
|
|
|
handleDownFile(val);
|
|
|
} else if (val === "print") {
|
|
|
}
|
|
|
- // else if (val === "exit") {
|
|
|
-
|
|
|
- // }
|
|
|
}}
|
|
|
/>
|
|
|
<div>文件</div>
|
|
@@ -2587,6 +2747,20 @@ export default defineComponent({
|
|
|
<div class={styles.exportPng}>
|
|
|
<div id="exportPng"></div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <UploadToResources
|
|
|
+ v-model:show={data.uploadShow}
|
|
|
+ item={data.item}
|
|
|
+ onSuccess={() => {
|
|
|
+ data.uploadStatus = "YES";
|
|
|
+ message.success("上传成功");
|
|
|
+ if (data.uploadClick) {
|
|
|
+ setTimeout(() => {
|
|
|
+ handleClose();
|
|
|
+ }, 300);
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ />
|
|
|
</>
|
|
|
);
|
|
|
},
|