|
@@ -51,6 +51,12 @@
|
|
|
<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-option :value="1" label="启用"></el-option>
|
|
|
+ <el-option :value="0" label="停用"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-button @click="submit" type="primary">搜索</el-button>
|
|
|
<el-button @click="reset" type="danger">重置</el-button>
|
|
|
</saveform>
|
|
@@ -112,6 +118,15 @@
|
|
|
</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
|
|
|
+ align="center"
|
|
|
prop="categoriesName"
|
|
|
label="客户端类型"
|
|
|
width="180px"
|
|
@@ -144,13 +159,24 @@
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
type="text"
|
|
|
+ @click="looker(scope.row)"
|
|
|
+ :disabled="!scope.row.url"
|
|
|
+ >预览</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
@click="player(scope.row)"
|
|
|
:disabled="!scope.row.url"
|
|
|
>播放</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
type="text"
|
|
|
+ @click="changeStatus(scope.row)"
|
|
|
+ >{{ scope.row.showFlag ? '停用' : '启用' }}</el-button>
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
@click="edit(scope.row)"
|
|
|
+ :disabled="scope.row.showFlag"
|
|
|
v-permission="'sysMusicScore/update'"
|
|
|
>修改</el-button
|
|
|
>
|
|
@@ -193,14 +219,28 @@
|
|
|
@close="visible = false"
|
|
|
/>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ v-if="lookVisible"
|
|
|
+ width="667px"
|
|
|
+ class="lookForm"
|
|
|
+ :visible.sync="lookVisible"
|
|
|
+ title="预览"
|
|
|
+ >
|
|
|
+ <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>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import saveform from "@/components/save-form";
|
|
|
import pagination from "@/components/Pagination/index";
|
|
|
import { songUseType } from "@/constant";
|
|
|
-import { QueryPage, Del } from "./api";
|
|
|
+import { QueryPage, Del, Show } from "./api";
|
|
|
import form from "./modals/form";
|
|
|
+import { vaildStudentUrl } from '@/utils/validate'
|
|
|
+import { getToken } from '@/utils/auth'
|
|
|
export default {
|
|
|
name: "accompaniment",
|
|
|
components: {
|
|
@@ -213,6 +253,8 @@ export default {
|
|
|
type: "",
|
|
|
activeUrl: "",
|
|
|
songUseType,
|
|
|
+ lookVisible: false,
|
|
|
+ accompanyUrl: null, // 预览地址
|
|
|
audioVisible: false,
|
|
|
tableList: [],
|
|
|
searchForm: {
|
|
@@ -221,6 +263,7 @@ export default {
|
|
|
subjectId: "",
|
|
|
clientType:'',
|
|
|
rankType: null,
|
|
|
+ showFlag: null
|
|
|
},
|
|
|
rules: {
|
|
|
// 分页规则
|
|
@@ -271,10 +314,36 @@ export default {
|
|
|
this.$refs.searchForm.resetFields();
|
|
|
this.FetchList();
|
|
|
},
|
|
|
+ looker(row) {
|
|
|
+ this.accompanyUrl = vaildStudentUrl() + '/accompany?Authorization=' + getToken() + '#/detail/' + row.id
|
|
|
+ this.lookVisible = true
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // console.log(this.$refs.iframe)
|
|
|
+ // let iframe = this.$refs.iframe
|
|
|
+ // iframe.onload = function() {
|
|
|
+ // console.log('完成', iframe)
|
|
|
+ // iframe.contentWindow.document.querySelector('#tips-step-0').style.display = 'none'
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ },
|
|
|
player(row) {
|
|
|
this.activeUrl = row.url;
|
|
|
this.audioVisible = true;
|
|
|
},
|
|
|
+ async changeStatus(row) {
|
|
|
+ try {
|
|
|
+ let status = row.showFlag ? '停用' : '启用'
|
|
|
+ await this.$confirm("是否确认"+ status +"此伴奏?", "提示", {
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
+ await Show({
|
|
|
+ sysMusicScoreId: row.id,
|
|
|
+ showFlag: row.showFlag ? 0 : 1
|
|
|
+ })
|
|
|
+ this.$message.success(status + "成功");
|
|
|
+ this.FetchList();
|
|
|
+ } catch (error) {}
|
|
|
+ },
|
|
|
edit(row) {
|
|
|
this.detail = row;
|
|
|
this.visible = true;
|
|
@@ -303,4 +372,37 @@ export default {
|
|
|
overflow: hidden;
|
|
|
white-space: pre;
|
|
|
}
|
|
|
+.lookForm {
|
|
|
+ /deep/.el-dialog__body {
|
|
|
+ padding: 0;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.iframe_back {
|
|
|
+ width: 195px;
|
|
|
+ height: 45px;
|
|
|
+ position: absolute;
|
|
|
+ bottom: 50px;
|
|
|
+ background: transparent;
|
|
|
+ left: 50%;
|
|
|
+ z-index: 99;
|
|
|
+ margin-left: -100px;
|
|
|
+}
|
|
|
+.iframe_help {
|
|
|
+ position: absolute;
|
|
|
+ background: transparent;
|
|
|
+ width: 50px;
|
|
|
+ height: 120px;
|
|
|
+ top: 50%;
|
|
|
+ right: 0;
|
|
|
+ margin-top: -35px;
|
|
|
+}
|
|
|
+.iframe_header_back {
|
|
|
+ background: transparent;
|
|
|
+ width: 225px;
|
|
|
+ height: 50px;
|
|
|
+ position: absolute;
|
|
|
+ top: 65px;
|
|
|
+ left: 20px;
|
|
|
+}
|
|
|
</style>
|