|
@@ -1,6 +1,6 @@
|
|
import { defineComponent, nextTick, onMounted, reactive, ref } from "vue";
|
|
import { defineComponent, nextTick, onMounted, reactive, ref } from "vue";
|
|
import styles from "./index.module.less";
|
|
import styles from "./index.module.less";
|
|
-import { NButton, NSpace, NSpin, useDialog } from "naive-ui";
|
|
|
|
|
|
+import { NButton, NCheckbox, NRadio, NSpace, NSpin, useDialog } from "naive-ui";
|
|
import { getImage } from "../home/images";
|
|
import { getImage } from "../home/images";
|
|
import TheCreate from "./component/the-create";
|
|
import TheCreate from "./component/the-create";
|
|
import { storeData } from "/src/store";
|
|
import { storeData } from "/src/store";
|
|
@@ -13,7 +13,7 @@ export default defineComponent({
|
|
setup() {
|
|
setup() {
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
const dialog = useDialog();
|
|
const dialog = useDialog();
|
|
- console.log(storeData.user)
|
|
|
|
|
|
+ console.log(storeData.user);
|
|
const forms = reactive({
|
|
const forms = reactive({
|
|
teacherId: storeData.user.id,
|
|
teacherId: storeData.user.id,
|
|
page: 1,
|
|
page: 1,
|
|
@@ -32,6 +32,7 @@ export default defineComponent({
|
|
const res = await api_musicSheetCreationPage({ ...forms });
|
|
const res = await api_musicSheetCreationPage({ ...forms });
|
|
if (res?.code == 200) {
|
|
if (res?.code == 200) {
|
|
if (data.isCreated) {
|
|
if (data.isCreated) {
|
|
|
|
+ data.isCreated = false;
|
|
handleOpenNotaion(res.data.rows[0]);
|
|
handleOpenNotaion(res.data.rows[0]);
|
|
}
|
|
}
|
|
data.list = data.list.concat(res.data.rows);
|
|
data.list = data.list.concat(res.data.rows);
|
|
@@ -46,32 +47,45 @@ export default defineComponent({
|
|
getList();
|
|
getList();
|
|
};
|
|
};
|
|
const handleDelte = (item: any) => {
|
|
const handleDelte = (item: any) => {
|
|
|
|
+ const checked = ref(true);
|
|
dialog.warning({
|
|
dialog.warning({
|
|
- title: "警告",
|
|
|
|
- content: `确定删除${item.name}曲谱吗?`,
|
|
|
|
- positiveText: "确定",
|
|
|
|
- negativeText: "取消",
|
|
|
|
- onPositiveClick: async () => {
|
|
|
|
|
|
+ autoFocus: false,
|
|
|
|
+ class: "deleteDialog",
|
|
|
|
+ title: "删除曲谱",
|
|
|
|
+ content: () => (
|
|
|
|
+ <div onClick={() => checked.value = !checked.value}>
|
|
|
|
+ <NRadio checked={checked.value}>同步删除我的资源中的该曲目</NRadio>
|
|
|
|
+ </div>
|
|
|
|
+ ),
|
|
|
|
+ positiveText: "取消",
|
|
|
|
+ positiveButtonProps: {
|
|
|
|
+ type: "default",
|
|
|
|
+ },
|
|
|
|
+ negativeText: "删除",
|
|
|
|
+ negativeButtonProps: {
|
|
|
|
+ type: "primary",
|
|
|
|
+ ghost: false,
|
|
|
|
+ },
|
|
|
|
+ onPositiveClick: () => {},
|
|
|
|
+ onNegativeClick: async () => {
|
|
await api_musicSheetCreationRemove(item.id);
|
|
await api_musicSheetCreationRemove(item.id);
|
|
handleReset();
|
|
handleReset();
|
|
},
|
|
},
|
|
- onNegativeClick: () => {},
|
|
|
|
});
|
|
});
|
|
};
|
|
};
|
|
const loadingRef = ref();
|
|
const loadingRef = ref();
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
getList();
|
|
getList();
|
|
- if(loadingRef.value){
|
|
|
|
-
|
|
|
|
- const obv = new IntersectionObserver((entries) => {
|
|
|
|
- if (entries[0].isIntersecting) {
|
|
|
|
- if (data.finish || data.loading) return;
|
|
|
|
- forms.page++;
|
|
|
|
- getList();
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- obv.observe(loadingRef.value?.$el);
|
|
|
|
- }
|
|
|
|
|
|
+ if (loadingRef.value) {
|
|
|
|
+ const obv = new IntersectionObserver((entries) => {
|
|
|
|
+ if (entries[0].isIntersecting) {
|
|
|
|
+ if (data.finish || data.loading) return;
|
|
|
|
+ forms.page++;
|
|
|
|
+ getList();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ obv.observe(loadingRef.value?.$el);
|
|
|
|
+ }
|
|
});
|
|
});
|
|
const handleOpenNotaion = (item: any) => {
|
|
const handleOpenNotaion = (item: any) => {
|
|
window.parent.postMessage(
|
|
window.parent.postMessage(
|
|
@@ -83,9 +97,9 @@ export default defineComponent({
|
|
);
|
|
);
|
|
};
|
|
};
|
|
const productSvg = (abc: string, id: string) => {
|
|
const productSvg = (abc: string, id: string) => {
|
|
- if(abc) {
|
|
|
|
- const a = ABCJS.renderAbc(id, abc, {selectTypes: false, add_classes: true});
|
|
|
|
- }
|
|
|
|
|
|
+ if (abc) {
|
|
|
|
+ const a = ABCJS.renderAbc(id, abc, { selectTypes: false, add_classes: true });
|
|
|
|
+ }
|
|
};
|
|
};
|
|
return () => (
|
|
return () => (
|
|
<div class={styles.wrap}>
|
|
<div class={styles.wrap}>
|
|
@@ -115,14 +129,18 @@ export default defineComponent({
|
|
</div>
|
|
</div>
|
|
<div class={styles.time}>{item.updateTime}</div>
|
|
<div class={styles.time}>{item.updateTime}</div>
|
|
</div>
|
|
</div>
|
|
- <img style={{pointerEvents: 'none', opacity: .3}} class={styles.bottomBtn} src={getImage("icon_29_2.png")} />
|
|
|
|
|
|
+ <img
|
|
|
|
+ style={{ pointerEvents: "none", opacity: 0.3 }}
|
|
|
|
+ class={styles.bottomBtn}
|
|
|
|
+ src={getImage("icon_29_2.png")}
|
|
|
|
+ />
|
|
<img
|
|
<img
|
|
class={styles.bottomBtn}
|
|
class={styles.bottomBtn}
|
|
src={getImage("icon_29_3.png")}
|
|
src={getImage("icon_29_3.png")}
|
|
onClick={(e: Event) => {
|
|
onClick={(e: Event) => {
|
|
- e.stopPropagation();
|
|
|
|
- handleDelte(item)
|
|
|
|
- }}
|
|
|
|
|
|
+ e.stopPropagation();
|
|
|
|
+ handleDelte(item);
|
|
|
|
+ }}
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|