|
@@ -40,20 +40,29 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="clientType">
|
|
|
- <el-select v-model="searchForm.clientType" clearable filterable placeholder="请选择客户端类型">
|
|
|
- <el-option value="NETWORK_ROOM" label="网络教室" ></el-option>
|
|
|
- <el-option value="SMART_PRACTICE" label="智能陪练" ></el-option>
|
|
|
+ <el-select
|
|
|
+ v-model="searchForm.clientType"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ placeholder="请选择客户端类型"
|
|
|
+ >
|
|
|
+ <el-option value="NETWORK_ROOM" label="网络教室"></el-option>
|
|
|
+ <el-option value="SMART_PRACTICE" label="智能陪练"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="categoriesId">
|
|
|
- <el-cascader v-model="searchForm.categoriesId"
|
|
|
- style="width:100%"
|
|
|
- :options="tree"
|
|
|
- placeholder="请选择分类"
|
|
|
-
|
|
|
- clearable
|
|
|
- :show-all-levels="true"
|
|
|
- :props="treeProps"></el-cascader>
|
|
|
+ <el-cascader
|
|
|
+ ref='myCascader'
|
|
|
+ popper-class="myCascader"
|
|
|
+ v-model="searchForm.categoriesId"
|
|
|
+ style="width: 100%"
|
|
|
+ :options="tree"
|
|
|
+ placeholder="请选择分类"
|
|
|
+ clearable
|
|
|
+ :show-all-levels="true"
|
|
|
+ :props="treeProps"
|
|
|
+ @change="changeCategor"
|
|
|
+ ></el-cascader>
|
|
|
</el-form-item>
|
|
|
<!-- <el-form-item
|
|
|
prop="subjectId"
|
|
@@ -68,13 +77,23 @@
|
|
|
</el-select>
|
|
|
</el-form-item> -->
|
|
|
<el-form-item prop="rankType">
|
|
|
- <el-select v-model="searchForm.rankType" clearable filterable placeholder="请选择是否收费">
|
|
|
+ <el-select
|
|
|
+ v-model="searchForm.rankType"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ placeholder="请选择是否收费"
|
|
|
+ >
|
|
|
<el-option :value="0" label="免费"></el-option>
|
|
|
<el-option :value="1" label="收费"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="showFlag">
|
|
|
- <el-select v-model="searchForm.showFlag" clearable filterable placeholder="请选择伴奏状态">
|
|
|
+ <el-select
|
|
|
+ v-model="searchForm.showFlag"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ placeholder="请选择伴奏状态"
|
|
|
+ >
|
|
|
<el-option :value="1" label="启用"></el-option>
|
|
|
<el-option :value="0" label="停用"></el-option>
|
|
|
</el-select>
|
|
@@ -131,22 +150,19 @@
|
|
|
label="分类"
|
|
|
width="180px"
|
|
|
/>
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- label="是否收费"
|
|
|
- width="180px"
|
|
|
- >
|
|
|
+ <el-table-column align="center" label="是否收费" width="180px">
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.rankIds ? '收费' : '免费' }}
|
|
|
+ {{ scope.row.rankIds ? "收费" : "免费" }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- label="伴奏状态"
|
|
|
- width="180px"
|
|
|
- >
|
|
|
+ <el-table-column align="center" label="节拍器" width="180px">
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.showFlag ? '启用' : '停用' }}
|
|
|
+ {{ scope.row.isOpenMetronome ? "播放" : "不播放" }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="伴奏状态" width="180px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.showFlag ? "启用" : "停用" }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
@@ -155,11 +171,11 @@
|
|
|
label="客户端类型"
|
|
|
width="180px"
|
|
|
>
|
|
|
- <template slot-scope="scope">
|
|
|
- <div>
|
|
|
- {{scope.row.clientType | clientType}}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ {{ scope.row.clientType | clientType }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<!-- clientType -->
|
|
|
<el-table-column
|
|
@@ -184,7 +200,9 @@
|
|
|
<el-button
|
|
|
type="text"
|
|
|
@click="looker(scope.row)"
|
|
|
- :disabled="!scope.row.url || scope.row.clientType != 'SMART_PRACTICE'"
|
|
|
+ :disabled="
|
|
|
+ !scope.row.url || scope.row.clientType != 'SMART_PRACTICE'
|
|
|
+ "
|
|
|
>预览</el-button
|
|
|
>
|
|
|
<el-button
|
|
@@ -193,10 +211,9 @@
|
|
|
:disabled="!scope.row.url"
|
|
|
>播放</el-button
|
|
|
>
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- @click="changeStatus(scope.row)"
|
|
|
- >{{ scope.row.showFlag ? '停用' : '启用' }}</el-button>
|
|
|
+ <el-button type="text" @click="changeStatus(scope.row)">{{
|
|
|
+ scope.row.showFlag ? "停用" : "启用"
|
|
|
+ }}</el-button>
|
|
|
<el-button
|
|
|
type="text"
|
|
|
@click="edit(scope.row)"
|
|
@@ -250,7 +267,13 @@
|
|
|
:visible.sync="lookVisible"
|
|
|
title="预览"
|
|
|
>
|
|
|
- <iframe id="iframe" v-if="lookVisible" style="width: 667px; height: 386px" ref="iframe" :src="accompanyUrl" />
|
|
|
+ <iframe
|
|
|
+ id="iframe"
|
|
|
+ v-if="lookVisible"
|
|
|
+ style="width: 667px; height: 386px"
|
|
|
+ ref="iframe"
|
|
|
+ :src="accompanyUrl"
|
|
|
+ />
|
|
|
<div class="iframe_back"></div>
|
|
|
<div class="iframe_help"></div>
|
|
|
<div class="iframe_header_back"></div>
|
|
@@ -263,9 +286,9 @@ import pagination from "@/components/Pagination/index";
|
|
|
import { songUseType } from "@/constant";
|
|
|
import { QueryPage, Del, Show, queryTree } from "./api";
|
|
|
import form from "./modals/form";
|
|
|
-import { vaildTeachingUrl } from '@/utils/validate'
|
|
|
-import { getToken } from '@/utils/auth'
|
|
|
-import deepClone from '@/helpers/deep-clone/'
|
|
|
+import { vaildTeachingUrl } from "@/utils/validate";
|
|
|
+import { getToken } from "@/utils/auth";
|
|
|
+import deepClone from "@/helpers/deep-clone/";
|
|
|
export default {
|
|
|
name: "accompaniment",
|
|
|
components: {
|
|
@@ -286,10 +309,10 @@ export default {
|
|
|
search: "",
|
|
|
type: "",
|
|
|
subjectId: "",
|
|
|
- categoriesId: null,
|
|
|
- clientType:'',
|
|
|
+ categoriesId: [],
|
|
|
+ clientType: "",
|
|
|
rankType: null,
|
|
|
- showFlag: null
|
|
|
+ showFlag: null,
|
|
|
},
|
|
|
rules: {
|
|
|
// 分页规则
|
|
@@ -302,11 +325,12 @@ export default {
|
|
|
visible: false,
|
|
|
tree: [],
|
|
|
treeProps: {
|
|
|
- value: 'id',
|
|
|
- label: 'name',
|
|
|
- children: 'sysMusicScoreCategoriesList',
|
|
|
- checkStrictly: true
|
|
|
- }
|
|
|
+ value: "id",
|
|
|
+ label: "name",
|
|
|
+ children: "sysMusicScoreCategoriesList",
|
|
|
+ checkStrictly: true,
|
|
|
+ expandTrigger: "hover",
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -320,29 +344,30 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
async mounted() {
|
|
|
- const { query,params } = this.$route;
|
|
|
- if(params.categoriesId){
|
|
|
- this.searchForm.categoriesId = [params.categoriesId];
|
|
|
+ const { query, params } = this.$route;
|
|
|
+ if (params.categoriesId) {
|
|
|
+ this.searchForm.categoriesId = [params.categoriesId];
|
|
|
}
|
|
|
this.$store.dispatch("setSubjects");
|
|
|
- await this.FetchTree()
|
|
|
+ await this.FetchTree();
|
|
|
await this.FetchList();
|
|
|
+
|
|
|
+ // 点击Cascader label选中
|
|
|
},
|
|
|
methods: {
|
|
|
async FetchTree() {
|
|
|
try {
|
|
|
- const res = await queryTree()
|
|
|
- this.tree = res.data
|
|
|
- } catch (error) {
|
|
|
-
|
|
|
- }
|
|
|
+ const res = await queryTree();
|
|
|
+ this.tree = res.data;
|
|
|
+ } catch (error) {}
|
|
|
},
|
|
|
async FetchList() {
|
|
|
try {
|
|
|
- let { categoriesId, ...search } = deepClone(this.searchForm)
|
|
|
+ let { categoriesId, ...search } = deepClone(this.searchForm);
|
|
|
const res = await QueryPage({
|
|
|
...search,
|
|
|
- categoriesId: categoriesId && categoriesId.length > 0 ? categoriesId.pop() : null,
|
|
|
+ categoriesId:
|
|
|
+ categoriesId && categoriesId.length > 0 ? categoriesId.pop() : null,
|
|
|
page: this.rules.page,
|
|
|
rows: this.rules.limit,
|
|
|
});
|
|
@@ -363,8 +388,13 @@ export default {
|
|
|
this.FetchList();
|
|
|
},
|
|
|
looker(row) {
|
|
|
- this.accompanyUrl = vaildTeachingUrl() + '/accompany?Authorization=' + getToken() + '&platform=web#/detail/' + row.id
|
|
|
- this.lookVisible = true
|
|
|
+ this.accompanyUrl =
|
|
|
+ vaildTeachingUrl() +
|
|
|
+ "/accompany?Authorization=" +
|
|
|
+ getToken() +
|
|
|
+ "&platform=web#/detail/" +
|
|
|
+ row.id;
|
|
|
+ this.lookVisible = true;
|
|
|
// this.$nextTick(() => {
|
|
|
// console.log(this.$refs.iframe)
|
|
|
// let iframe = this.$refs.iframe
|
|
@@ -380,14 +410,14 @@ export default {
|
|
|
},
|
|
|
async changeStatus(row) {
|
|
|
try {
|
|
|
- let status = row.showFlag ? '停用' : '启用'
|
|
|
- await this.$confirm("是否确认"+ status +"此伴奏?", "提示", {
|
|
|
+ let status = row.showFlag ? "停用" : "启用";
|
|
|
+ await this.$confirm("是否确认" + status + "此伴奏?", "提示", {
|
|
|
type: "warning",
|
|
|
});
|
|
|
await Show({
|
|
|
sysMusicScoreId: row.id,
|
|
|
- showFlag: row.showFlag ? 0 : 1
|
|
|
- })
|
|
|
+ showFlag: row.showFlag ? 0 : 1,
|
|
|
+ });
|
|
|
this.$message.success(status + "成功");
|
|
|
this.FetchList();
|
|
|
} catch (error) {}
|
|
@@ -411,9 +441,30 @@ export default {
|
|
|
this.FetchList();
|
|
|
} catch (error) {}
|
|
|
},
|
|
|
+ changeCategor(e){
|
|
|
+ this.$refs.myCascader.dropDownVisible =false;
|
|
|
+ }
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
+<style lang="less">
|
|
|
+.myCascader {
|
|
|
+ .el-radio {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ z-index: 10;
|
|
|
+ position: absolute;
|
|
|
+ top: 10px;
|
|
|
+ right: 10px;
|
|
|
+ }
|
|
|
+ .el-radio__input {
|
|
|
+ visibility: hidden;
|
|
|
+ }
|
|
|
+ .el-cascader-node__postfix {
|
|
|
+ top: 10px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|
|
|
<style lang="less" scoped>
|
|
|
.remark {
|
|
|
display: inline;
|
|
@@ -446,11 +497,11 @@ export default {
|
|
|
margin-top: -35px;
|
|
|
}
|
|
|
.iframe_header_back {
|
|
|
- background: transparent;
|
|
|
- width: 225px;
|
|
|
- height: 50px;
|
|
|
- position: absolute;
|
|
|
- top: 65px;
|
|
|
- left: 20px;
|
|
|
+ background: transparent;
|
|
|
+ width: 225px;
|
|
|
+ height: 50px;
|
|
|
+ position: absolute;
|
|
|
+ top: 65px;
|
|
|
+ left: 20px;
|
|
|
}
|
|
|
</style>
|