lex-xin 5 月之前
父節點
當前提交
bcbab07a02

文件差異過大導致無法顯示
+ 0 - 0
dist/css/677.5d67a7eb.css


+ 4 - 0
dist/index.html

@@ -1,6 +1,10 @@
 <!doctype html><html lang=""><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="renderer" content="webkit"/><meta name="force-rendering" content="webkit"/><link rel="icon" href="/favicon.ico"/><title>乐教通</title><script>if (!!window.ActiveXObject || "ActiveXObject" in window) {
             window.location.href = "./ieIncompatible/index.html"
+<<<<<<< HEAD
          }</script><script defer="defer" src="/js/chunk-vendors.5249fc2d.js"></script><script defer="defer" src="/js/app.53b8fd13.js"></script><link href="/css/app.2ae84a6b.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but classroom doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"><style>.firstLoading {
+=======
+         }</script><script defer="defer" src="/js/chunk-vendors.806b057d.js"></script><script defer="defer" src="/js/app.8645f9ac.js"></script><link href="/css/app.2ae84a6b.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but classroom doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"><style>.firstLoading {
+>>>>>>> iteration-temp-http
                position: fixed;
                left: 50%;
                top: 50%;

文件差異過大導致無法顯示
+ 0 - 0
dist/js/677.32f29fd7.js


文件差異過大導致無法顯示
+ 0 - 0
dist/js/app.8645f9ac.js


文件差異過大導致無法顯示
+ 0 - 0
dist/js/chunk-vendors.806b057d.js


+ 26 - 3
src/views/cloudPractice/cloudPractice.tsx

@@ -34,8 +34,9 @@ import PlayLoading from "./component/play-loading"
 import PracticeForm from "@/businessComponents/practiceForm"
 import { saveAs } from "file-saver"
 import JSZip from "jszip"
-import { svgtoblob } from "./formatSvgToImg"
+import { canvasAddTitle, imgToCanvas, svgtoblob } from "./formatSvgToImg"
 import { penShow, whitePenShow } from "@/businessComponents/globalTools/globalTools"
+import { handleFullscreen } from "@/libs/fullscreen"
 
 export default defineComponent({
    name: "cloudPractice",
@@ -102,6 +103,9 @@ export default defineComponent({
                musicSheetType: item?.musicSheetType,
                audioFileUrl,
                // titleImg: list?.titleImg,
+               musicImg: list.musicImg,
+               musicJianImg: list.musicJianSvg,
+               musicFirstImg: list.musicFirstSvg,
                isScoreRender: item?.isScoreRender,
                defaultScoreRender: item?.defaultScoreRender,
                musicPdfUrl: item?.musicPdfUrl // 独奏使用PDF
@@ -115,6 +119,9 @@ export default defineComponent({
                musicSheetType: list?.musicSheetType,
                audioFileUrl: list?.audioFileUrl,
                titleImg: list?.titleImg,
+               musicImg: list.musicImg,
+               musicJianImg: list.musicJianSvg,
+               musicFirstImg: list.musicFirstSvg,
                isScoreRender: list?.isScoreRender,
                defaultScoreRender: list?.defaultScoreRender,
                musicPdfUrl: list?.musicPdfUrl
@@ -129,6 +136,9 @@ export default defineComponent({
                musicSheetType: list?.musicSheetType,
                audioFileUrl: item?.audioFileUrl,
                titleImg: list?.titleImg,
+               musicImg: list.musicImg,
+               musicJianImg: list.musicJianSvg,
+               musicFirstImg: list.musicFirstSvg,
                isScoreRender: false,
                defaultScoreRender: false,
                musicPdfUrl: list?.musicPdfUrl
@@ -695,6 +705,8 @@ export default defineComponent({
          renderStaff()
       }
 
+      // 全屏显示
+      handleFullscreen(true, false)
       __init()
 
       const handleResh = () => {
@@ -728,6 +740,19 @@ export default defineComponent({
          if (row.musicSheetType === "SINGLE") {
             loading.value = false
             state.musicPdfUrl = row.musicPdfUrl
+
+            if (userStoreHook.roles === "GYM") {
+               const imgs = row.musicImg ? row.musicImg.split(",") : []
+               state.imgs = []
+               imgs.forEach(async (item: string, index: number) => {
+                  const imgCanvas = await imgToCanvas(item)
+                  const img = await canvasAddTitle(imgCanvas, row.name)
+                  state.imgs.push({
+                     name: index + 1 + ".png",
+                     url: img
+                  })
+               })
+            }
             return
          }
          state.partNames = await getPartNames(row.xmlUrl)
@@ -900,8 +925,6 @@ export default defineComponent({
       // // 多个文件下载
       const downLoadMultiFile = (files: any, filesName: string) => {
          const zip = new JSZip()
-         // const result = []
-         // console.log(files)
          for (const i in files) {
             zip.file(files[i].name, files[i].url, { binary: true })
          }

+ 39 - 0
src/views/cloudPractice/formatSvgToImg.ts

@@ -131,6 +131,45 @@ const canvasAddPadding = async (sourceCanvas: any, name: string) => {
    return blob
 }
 
+export const canvasAddTitle = async (sourceCanvas: any, name: string) => {
+   const targetCanvas = document.createElement("canvas")
+   targetCanvas.width = sourceCanvas.width
+   targetCanvas.height = sourceCanvas.height + 90
+
+   // 坐标(0,0) 表示从此处开始绘制,相当于偏移。
+   const targetContext = targetCanvas.getContext("2d") as CanvasRenderingContext2D
+
+   // const sourceContext = sourceCanvas.getContext("2d") as CanvasRenderingContext2D
+
+   // 从源canvas中获取图像数据
+   // const imageData = sourceContext.getImageData(0, 0, sourceCanvas.width, sourceCanvas.height)
+
+   // 清空目标canvas
+   targetContext.clearRect(0, 0, targetCanvas.width, targetCanvas.height)
+
+   // 将图像数据绘制到目标canvas上,并添加边距
+   // targetContext.putImageData(imageData, 200, 100)
+   targetContext.fillStyle = "#fff"
+   targetContext.fillRect(0, 0, targetCanvas.width, targetCanvas.height)
+   // targetCanvas = await addMusicTitle(targetCanvas, name)
+
+   // 小水印画布大小
+   // const waterCtx = water.getContext("2d") as CanvasRenderingContext2D
+   targetContext.font = `30pt Calibri`
+   targetContext.fillStyle = "#000"
+   targetContext.textAlign = "center"
+   targetContext.drawImage(sourceCanvas, 0, 70)
+   targetContext.fillText(name, targetCanvas.width / 2, 100)
+   const blob = await convertToBlob(targetCanvas)
+   // const base64 = await blobToBase64(blob)
+   targetContext.clearRect(0, 0, targetCanvas.width, targetCanvas.height)
+   return blob
+}
+
+export const convasToImg = (canvas: any) => {
+   return canvas.toDataURL("image/png")
+}
+
 // // 获取文件blob格式
 export const imgToCanvas = async (url: string) => {
    const img = document.createElement("img")

+ 3 - 0
src/views/cloudTextbooks/cloudTextbooks.vue

@@ -76,6 +76,7 @@ import { debounce } from "@/libs/tools"
 import { getLessonCoursewareSubjectList_gym, queryPageSubject_klx } from "@/api/cloudTextbooks.api"
 import { httpAjax } from "@/plugin/httpAjax"
 import myInput from "@/components/myInput"
+import { handleFullscreen } from "@/libs/fullscreen"
 
 const userStoreHook = userStore()
 const { handleGetList, listData, loading, albumId, albumOpt, handleListQuery } = useDataList()
@@ -93,6 +94,8 @@ const classType = ref("")
 const classTypeOpt = shallowRef<{ value: string; label: string }[]>([])
 const queryStr = ref("")
 
+// 全屏显示
+handleFullscreen(true, false)
 handleGetClassTypeOpt()
 handleGetList()
 

+ 3 - 0
src/views/curriculum/curriculum.vue

@@ -58,6 +58,7 @@ import { httpAjax } from "@/plugin/httpAjax"
 import { CODE_ERR_CANCELED } from "@/libs/auth"
 import { ElMessage } from "element-plus"
 import { useRoute } from "vue-router"
+import { handleFullscreen } from "@/libs/fullscreen"
 
 const route = useRoute()
 const userStoreHook = userStore()
@@ -82,6 +83,8 @@ watch(dateValue, () => {
    handleDayChange(dateValue.value)
 })
 
+// 全屏显示
+handleFullscreen(true, false)
 handleMonthChange(dateValue.value)
 handleDayChange(dateValue.value)
 function handleMonthChange(date: Date) {

部分文件因文件數量過多而無法顯示