Browse Source

自动缓存

skyblued 2 years ago
parent
commit
ab6ded4248
1 changed files with 18 additions and 18 deletions
  1. 18 18
      src/subpages/colexiu/popups/productJson/index.tsx

+ 18 - 18
src/subpages/colexiu/popups/productJson/index.tsx

@@ -14,24 +14,24 @@ export default defineComponent({
     const autoProduct = (val: any) => {
       if (search.modeType === 'json') return
       console.log(musicData.rended, '渲染是否结束')
-      // if (!musicData.svg){
-      //   musicData.svg = document.getElementById('osmdSvgPage1')?.outerHTML || '';
-      // }
-      // if (!musicData.svg) {
-      //   return
-      // }
-      // if (SettingState.sett.type === 'staff') {
-      //   if (!detailState.activeDetail?.musicSvg) {
-      //     handleSave(false)
-      //   }
-      // } else {
-      //   if (
-      //     (SettingState.sett.keySignature && !detailState.activeDetail?.musicFirstSvg) ||
-      //     (!SettingState.sett.keySignature && !detailState.activeDetail?.musicJianSvg)
-      //   ) {
-      //     handleSave(false)
-      //   }
-      // }
+      if (!musicData.svg){
+        musicData.svg = document.getElementById('osmdSvgPage1')?.outerHTML || '';
+      }
+      if (!musicData.svg) {
+        return
+      }
+      if (SettingState.sett.type === 'staff') {
+        if (!detailState.activeDetail?.musicSvg) {
+          handleSave(false)
+        }
+      } else {
+        if (
+          (SettingState.sett.keySignature && !detailState.activeDetail?.musicFirstSvg) ||
+          (!SettingState.sett.keySignature && !detailState.activeDetail?.musicJianSvg)
+        ) {
+          handleSave(false)
+        }
+      }
     }
     expose({
       autoProduct,