|
@@ -281,6 +281,13 @@
|
|
|
}}</el-button>
|
|
|
<el-button
|
|
|
type="text"
|
|
|
+ @click="transcod(scope.row)"
|
|
|
+ :disabled="!!scope.row.showFlag"
|
|
|
+ v-permission="'sysMusicScore/transcod'"
|
|
|
+ >转码</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
@click="edit(scope.row)"
|
|
|
:disabled="!!scope.row.showFlag"
|
|
|
v-permission="'sysMusicScore/update'"
|
|
@@ -332,12 +339,23 @@
|
|
|
:visible.sync="lookVisible"
|
|
|
title="预览"
|
|
|
>
|
|
|
+ <template slot="title">
|
|
|
+ <span style="color: #fff;">预览</span>
|
|
|
+ <el-select v-model="selectPart" placeholder="请选择分谱">
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in parts"
|
|
|
+ :key="item"
|
|
|
+ :label="item"
|
|
|
+ :value="index">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
<iframe
|
|
|
id="iframe"
|
|
|
v-if="lookVisible"
|
|
|
style="width: 667px; height: 386px"
|
|
|
ref="iframe"
|
|
|
- :src="accompanyUrl"
|
|
|
+ :src="accompanyUrl + '?part-index=' + selectPart"
|
|
|
/>
|
|
|
<div class="iframe_back"></div>
|
|
|
<div class="iframe_help"></div>
|
|
@@ -349,7 +367,7 @@
|
|
|
import saveform from "@/components/save-form";
|
|
|
import pagination from "@/components/Pagination/index";
|
|
|
import { songUseType } from "@/constant";
|
|
|
-import { QueryPage, Del, Show, queryTree } from "./api";
|
|
|
+import { QueryPage, Del, Show, queryTree, Transcod } from "./api";
|
|
|
import form from "./modals/form";
|
|
|
import { vaildTeachingUrl } from "@/utils/validate";
|
|
|
import { getToken } from "@/utils/auth";
|
|
@@ -365,6 +383,8 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ parts: [],
|
|
|
+ selectPart: 0,
|
|
|
tabName: 'first',
|
|
|
type: "",
|
|
|
activeUrl: "",
|
|
@@ -487,7 +507,24 @@ export default {
|
|
|
this.$refs.searchForm.resetFields();
|
|
|
this.FetchList();
|
|
|
},
|
|
|
- looker(row, num) {
|
|
|
+ getPartListNames(xml) {
|
|
|
+ if (!xml) return []
|
|
|
+ const xmlParse = new DOMParser().parseFromString(xml, 'text/xml')
|
|
|
+ const partList = xmlParse.getElementsByTagName('part-list')?.[0]?.getElementsByTagName('score-part') || []
|
|
|
+ const partListNames = Array.from(partList).map(item => item.getElementsByTagName('part-name')?.[0].textContent || '')
|
|
|
+ this.xmlFirstSpeed = xmlParse.getElementsByTagName('per-minute')?.[0]?.textContent || ''
|
|
|
+ return partListNames
|
|
|
+ },
|
|
|
+ async looker(row, num) {
|
|
|
+ try {
|
|
|
+ this.selectPart = 0
|
|
|
+ const res = await fetch(row.xmlUrl)
|
|
|
+ const text = await res.text()
|
|
|
+ this.parts = this.getPartListNames(text)
|
|
|
+ } catch (error) {
|
|
|
+ this.parts = []
|
|
|
+ this.selectPart = 0
|
|
|
+ }
|
|
|
this.accompanyUrl =
|
|
|
vaildTeachingUrl() +
|
|
|
"/accompany?Authorization=" +
|
|
@@ -528,6 +565,12 @@ export default {
|
|
|
this.detail = row;
|
|
|
this.visible = true;
|
|
|
},
|
|
|
+ async transcod(row) {
|
|
|
+ try {
|
|
|
+ const res = await Transcod(row)
|
|
|
+ console.log(res)
|
|
|
+ } catch (error) {}
|
|
|
+ },
|
|
|
open(type) {
|
|
|
this.type = type;
|
|
|
this.detail = null;
|