|
@@ -40,6 +40,7 @@ import {
|
|
|
NSelect,
|
|
|
NSpace,
|
|
|
NSpin,
|
|
|
+ useDialog,
|
|
|
useMessage,
|
|
|
} from "naive-ui";
|
|
|
import { LongArrowAltDown, LongArrowAltUp, GripLinesVertical } from "@vicons/fa";
|
|
@@ -102,6 +103,7 @@ function moveNote(note: string, step: number) {
|
|
|
export default defineComponent({
|
|
|
name: "Home",
|
|
|
setup() {
|
|
|
+ const dialog = useDialog();
|
|
|
const route = useRoute();
|
|
|
const message = useMessage();
|
|
|
const popup = reactive({
|
|
@@ -622,11 +624,22 @@ export default defineComponent({
|
|
|
|
|
|
if (type === "exit") {
|
|
|
if (!data.isSave) {
|
|
|
- showConfirmDialog({
|
|
|
+ dialog.warning({
|
|
|
+ maskClosable: true,
|
|
|
+ autoFocus: false,
|
|
|
+ class: "deleteDialog saveDialog",
|
|
|
title: "温馨提示",
|
|
|
- message: "还没保存,是否保存?",
|
|
|
- })
|
|
|
- .then(async () => {
|
|
|
+ content: '是否保存当前曲谱?',
|
|
|
+ positiveText: "保存",
|
|
|
+ positiveButtonProps: {
|
|
|
+ type: "primary",
|
|
|
+ },
|
|
|
+ negativeText: "不保存",
|
|
|
+ negativeButtonProps: {
|
|
|
+ type: "default",
|
|
|
+ ghost: false,
|
|
|
+ },
|
|
|
+ onPositiveClick: async () => {
|
|
|
const msg = message.loading("保存中...");
|
|
|
await handleSaveMusic(false);
|
|
|
setTimeout(() => {
|
|
@@ -637,10 +650,11 @@ export default defineComponent({
|
|
|
handleClose();
|
|
|
}, 500);
|
|
|
}, 300);
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
+ },
|
|
|
+ onNegativeClick: () => {
|
|
|
handleClose();
|
|
|
- });
|
|
|
+ },
|
|
|
+ });
|
|
|
return;
|
|
|
}
|
|
|
handleClose();
|
|
@@ -1006,7 +1020,7 @@ export default defineComponent({
|
|
|
|
|
|
// 移动音符
|
|
|
if (type === "move") {
|
|
|
- const step = value._step ? value._step : value.action === "up" ? -1 : 1;
|
|
|
+ const step = value.action === "drag" ? value.step : value.action === "up" ? -1 : 1;
|
|
|
if (!activeNote) return;
|
|
|
activeNote.content = moveNote(activeNote.content, step);
|
|
|
// arr now contains elements that are either a chord, a decoration, a note name, or anything else. It can be put back to its original string with .join("").
|