|
@@ -123,8 +123,15 @@
|
|
<el-form-item>
|
|
<el-form-item>
|
|
<el-button @click="submit" type="primary">搜索</el-button>
|
|
<el-button @click="submit" type="primary">搜索</el-button>
|
|
<el-button @click="reset" type="danger">重置</el-button>
|
|
<el-button @click="reset" type="danger">重置</el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ @click="onExport"
|
|
|
|
+ type="primary"
|
|
|
|
+ v-permission="'export/exportMusicScoreList'"
|
|
|
|
+ >导出</el-button
|
|
|
|
+ >
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</saveform>
|
|
</saveform>
|
|
|
|
+
|
|
<el-table
|
|
<el-table
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
:header-cell-style="{ background: '#EDEEF0', color: '#444' }"
|
|
:header-cell-style="{ background: '#EDEEF0', color: '#444' }"
|
|
@@ -373,6 +380,9 @@ import { vaildTeachingUrl } from "@/utils/validate";
|
|
import { getToken } from "@/utils/auth";
|
|
import { getToken } from "@/utils/auth";
|
|
import deepClone from "@/helpers/deep-clone/";
|
|
import deepClone from "@/helpers/deep-clone/";
|
|
import Tooltip from "@/components/Tooltip/index";
|
|
import Tooltip from "@/components/Tooltip/index";
|
|
|
|
+import { Export } from "@/utils/downLoadFile";
|
|
|
|
+import qs from "qs";
|
|
|
|
+import cleanDeep from "clean-deep";
|
|
export default {
|
|
export default {
|
|
name: "accompaniment",
|
|
name: "accompaniment",
|
|
components: {
|
|
components: {
|
|
@@ -385,7 +395,7 @@ export default {
|
|
return {
|
|
return {
|
|
parts: [],
|
|
parts: [],
|
|
selectPart: 0,
|
|
selectPart: 0,
|
|
- tabName: 'first',
|
|
|
|
|
|
+ tabName: "first",
|
|
type: "",
|
|
type: "",
|
|
activeUrl: "",
|
|
activeUrl: "",
|
|
songUseType,
|
|
songUseType,
|
|
@@ -434,11 +444,14 @@ export default {
|
|
},
|
|
},
|
|
async mounted() {
|
|
async mounted() {
|
|
const { query, params } = this.$route;
|
|
const { query, params } = this.$route;
|
|
- await this.FetchTree();
|
|
|
|
|
|
+ await this.FetchTree();
|
|
if (params.categoriesId) {
|
|
if (params.categoriesId) {
|
|
// console.log(this.tree)
|
|
// console.log(this.tree)
|
|
// console.log(this.formatParentId(params.categoriesId, this.tree))
|
|
// console.log(this.formatParentId(params.categoriesId, this.tree))
|
|
- this.searchForm.categoriesId = this.formatParentId(params.categoriesId, this.tree);
|
|
|
|
|
|
+ this.searchForm.categoriesId = this.formatParentId(
|
|
|
|
+ params.categoriesId,
|
|
|
|
+ this.tree
|
|
|
|
+ );
|
|
}
|
|
}
|
|
this.$store.dispatch("setSubjects");
|
|
this.$store.dispatch("setSubjects");
|
|
this.$store.dispatch("setBranchs");
|
|
this.$store.dispatch("setBranchs");
|
|
@@ -469,15 +482,18 @@ export default {
|
|
try {
|
|
try {
|
|
const res = await queryTree();
|
|
const res = await queryTree();
|
|
this.tree = res.data;
|
|
this.tree = res.data;
|
|
- this.formatTree(this.tree)
|
|
|
|
|
|
+ this.formatTree(this.tree);
|
|
} catch (error) {}
|
|
} catch (error) {}
|
|
},
|
|
},
|
|
- formatTree(data){
|
|
|
|
- for(let i of data) {
|
|
|
|
- if(i.sysMusicScoreCategoriesList && i.sysMusicScoreCategoriesList.length > 0) {
|
|
|
|
- this.formatTree(i.sysMusicScoreCategoriesList, i)
|
|
|
|
|
|
+ formatTree(data) {
|
|
|
|
+ for (let i of data) {
|
|
|
|
+ if (
|
|
|
|
+ i.sysMusicScoreCategoriesList &&
|
|
|
|
+ i.sysMusicScoreCategoriesList.length > 0
|
|
|
|
+ ) {
|
|
|
|
+ this.formatTree(i.sysMusicScoreCategoriesList, i);
|
|
} else {
|
|
} else {
|
|
- i.sysMusicScoreCategoriesList = null
|
|
|
|
|
|
+ i.sysMusicScoreCategoriesList = null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -508,32 +524,39 @@ export default {
|
|
this.FetchList();
|
|
this.FetchList();
|
|
},
|
|
},
|
|
getPartListNames(xml) {
|
|
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
|
|
|
|
|
|
+ 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) {
|
|
async looker(row, num) {
|
|
try {
|
|
try {
|
|
- this.selectPart = 0
|
|
|
|
- const res = await fetch(row.xmlUrl)
|
|
|
|
- const text = await res.text()
|
|
|
|
- this.parts = this.getPartListNames(text)
|
|
|
|
|
|
+ this.selectPart = 0;
|
|
|
|
+ const res = await fetch(row.xmlUrl);
|
|
|
|
+ const text = await res.text();
|
|
|
|
+ this.parts = this.getPartListNames(text);
|
|
} catch (error) {
|
|
} catch (error) {
|
|
- this.parts = []
|
|
|
|
- this.selectPart = 0
|
|
|
|
|
|
+ this.parts = [];
|
|
|
|
+ this.selectPart = 0;
|
|
}
|
|
}
|
|
this.accompanyUrl =
|
|
this.accompanyUrl =
|
|
vaildTeachingUrl() +
|
|
vaildTeachingUrl() +
|
|
"/accompany?Authorization=" +
|
|
"/accompany?Authorization=" +
|
|
getToken() +
|
|
getToken() +
|
|
- "&platform=web&isOpenMetronome="+ num +"#/detail/" +
|
|
|
|
|
|
+ "&platform=web&isOpenMetronome=" +
|
|
|
|
+ num +
|
|
|
|
+ "#/detail/" +
|
|
row.id;
|
|
row.id;
|
|
this.lookVisible = true;
|
|
this.lookVisible = true;
|
|
|
|
|
|
-
|
|
|
|
// this.$nextTick(() => {
|
|
// this.$nextTick(() => {
|
|
// console.log(this.$refs.iframe)
|
|
// console.log(this.$refs.iframe)
|
|
// let iframe = this.$refs.iframe
|
|
// let iframe = this.$refs.iframe
|
|
@@ -567,8 +590,8 @@ export default {
|
|
},
|
|
},
|
|
async transcod(row) {
|
|
async transcod(row) {
|
|
try {
|
|
try {
|
|
- const res = await Transcod(row)
|
|
|
|
- console.log(res)
|
|
|
|
|
|
+ const res = await Transcod(row);
|
|
|
|
+ console.log(res);
|
|
} catch (error) {}
|
|
} catch (error) {}
|
|
},
|
|
},
|
|
open(type) {
|
|
open(type) {
|
|
@@ -589,6 +612,25 @@ export default {
|
|
changeCategor(e) {
|
|
changeCategor(e) {
|
|
this.$refs.myCascader.dropDownVisible = false;
|
|
this.$refs.myCascader.dropDownVisible = false;
|
|
},
|
|
},
|
|
|
|
+ onExport() {
|
|
|
|
+ let { categoriesId, organId, ...search } = deepClone(this.searchForm);
|
|
|
|
+ Export(
|
|
|
|
+ this,
|
|
|
|
+ {
|
|
|
|
+ url: "/api-web/export/exportMusicScoreList",
|
|
|
|
+ params: {
|
|
|
|
+ ...search,
|
|
|
|
+ categoriesId:
|
|
|
|
+ categoriesId && categoriesId.length > 0
|
|
|
|
+ ? categoriesId.pop()
|
|
|
|
+ : null,
|
|
|
|
+ },
|
|
|
|
+ fileName: `教学伴奏导出.xls`,
|
|
|
|
+ method: "get",
|
|
|
|
+ },
|
|
|
|
+ "确定导出教学伴奏"
|
|
|
|
+ );
|
|
|
|
+ },
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
@@ -613,7 +655,7 @@ export default {
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
/deep/.el-dropdown {
|
|
/deep/.el-dropdown {
|
|
margin-right: 10px;
|
|
margin-right: 10px;
|
|
- color: #14928A;
|
|
|
|
|
|
+ color: #14928a;
|
|
}
|
|
}
|
|
.remark {
|
|
.remark {
|
|
display: inline;
|
|
display: inline;
|