Ver código fonte

提交一下

1
mo 4 anos atrás
pai
commit
73b7b4f536
3 arquivos alterados com 128 adições e 91 exclusões
  1. 5 0
      src/constant/index.js
  2. 2 0
      src/utils/vueFilter.js
  3. 121 91
      src/views/accompaniment/index.vue

+ 5 - 0
src/constant/index.js

@@ -272,3 +272,8 @@ export const withdrawalStatus = {
   PROCESSING: '处理中',
   PROCESSING: '处理中',
   CANCELED: '取消'
   CANCELED: '取消'
 }
 }
+
+export const clientStatus = {
+  NETWORK_ROOM:'网络教室',
+  SMART_PRACTICE:'智能陪练'
+}

+ 2 - 0
src/utils/vueFilter.js

@@ -187,6 +187,8 @@ Vue.filter('courseTypeFormat', val => constant.courseType[val])
 // 格式化签到签退记录 updateAttendanceEnum
 // 格式化签到签退记录 updateAttendanceEnum
 Vue.filter('updateAttendanceEnum', val => constant.updateAttendanceEnum[val])
 Vue.filter('updateAttendanceEnum', val => constant.updateAttendanceEnum[val])
 Vue.filter('clientTypeFilter',val=>constant.clientType[val])
 Vue.filter('clientTypeFilter',val=>constant.clientType[val])
+// 教学伴奏
+Vue.filter('clientType',val=>constant.clientStatus[val])
 // 时间处理
 // 时间处理
 Vue.filter('timer', (value) => {
 Vue.filter('timer', (value) => {
   if (value) {
   if (value) {

+ 121 - 91
src/views/accompaniment/index.vue

@@ -1,17 +1,36 @@
 <template>
 <template>
-    <div class='m-container'>
+  <div class="m-container">
     <h2>
     <h2>
-      <div class="squrt"></div>教学伴奏
+      <div class="squrt"></div>
+      教学伴奏
     </h2>
     </h2>
     <div class="m-core">
     <div class="m-core">
-      <el-button @click="open('COMMON')" type="primary" v-permission="'sysMusicScore/add'">添加公用伴奏</el-button>
+      <el-button
+        @click="open('COMMON')"
+        type="primary"
+        v-permission="'sysMusicScore/add'"
+        >添加公用伴奏</el-button
+      >
       <!-- <el-button @click="open('PERSON')" type="primary" v-permission="'sysMusicScore/add'">添加个人伴奏</el-button> -->
       <!-- <el-button @click="open('PERSON')" type="primary" v-permission="'sysMusicScore/add'">添加个人伴奏</el-button> -->
-      <saveform ref="searchForm" :model.sync="searchForm" inline style="margin-top: 20px">
+      <saveform
+        ref="searchForm"
+        :model.sync="searchForm"
+        inline
+        style="margin-top: 20px"
+      >
         <el-form-item prop="search">
         <el-form-item prop="search">
-          <el-input v-model="searchForm.search" clearable placeholder="伴奏编号/伴奏名称"/>
+          <el-input
+            v-model="searchForm.search"
+            clearable
+            placeholder="伴奏编号/伴奏名称"
+          />
         </el-form-item>
         </el-form-item>
         <el-form-item prop="type">
         <el-form-item prop="type">
-          <el-select v-model="searchForm.type" clearable placeholder="请选择类型">
+          <el-select
+            v-model="searchForm.type"
+            clearable
+            placeholder="请选择类型"
+          >
             <el-option
             <el-option
               v-for="(item, key) in songUseType"
               v-for="(item, key) in songUseType"
               :key="key"
               :key="key"
@@ -30,39 +49,26 @@
       </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' }"
         :data="tableList"
         :data="tableList"
       >
       >
-        <el-table-column
-          align="center"
-          prop="id"
-          label="编号"
-        >
-                <template slot-scope="scope">
-              <div>
-                <copy-text>{{ scope.row.id }}</copy-text>
-              </div>
-            </template>
+        <el-table-column align="center" prop="id" label="编号">
+          <template slot-scope="scope">
+            <div>
+              <copy-text>{{ scope.row.id }}</copy-text>
+            </div>
+          </template>
         </el-table-column>
         </el-table-column>
-        <el-table-column
-          align="center"
-          prop="name"
-          label="名称"
-          width="180px"
-        >
-         <template slot-scope="scope">
-              <div>
-                <copy-text>{{ scope.row.name }}</copy-text>
-              </div>
-            </template>
+        <el-table-column align="center" prop="name" label="名称" width="180px">
+          <template slot-scope="scope">
+            <div>
+              <copy-text>{{ scope.row.name }}</copy-text>
+            </div>
+          </template>
         </el-table-column>
         </el-table-column>
-        <el-table-column
-          align="center"
-          prop="type"
-          label="类型"
-        >
+        <el-table-column align="center" prop="type" label="类型">
           <template slot-scope="scope">
           <template slot-scope="scope">
-            {{scope.row.type | songUseTypeFormat}}
+            {{ scope.row.type | songUseTypeFormat }}
           </template>
           </template>
         </el-table-column>
         </el-table-column>
         <!-- <el-table-column
         <!-- <el-table-column
@@ -90,6 +96,19 @@
         />
         />
         <el-table-column
         <el-table-column
           align="center"
           align="center"
+          prop="categoriesName"
+          label="客户端类型"
+          width="180px"
+        >
+        <template slot-scope="scope">
+          <div>
+            {{scope.row.clientType | clientType}}
+          </div>
+        </template>
+        </el-table-column>
+        <!-- clientType -->
+        <el-table-column
+          align="center"
           prop="createUserName"
           prop="createUserName"
           label="上传人"
           label="上传人"
           width="180px"
           width="180px"
@@ -107,18 +126,24 @@
           fixed="right"
           fixed="right"
         >
         >
           <template slot-scope="scope">
           <template slot-scope="scope">
-            <el-button type="text"
+            <el-button
+              type="text"
               @click="player(scope.row)"
               @click="player(scope.row)"
               :disabled="!scope.row.url"
               :disabled="!scope.row.url"
-            >播放</el-button>
-            <el-button type="text"
+              >播放</el-button
+            >
+            <el-button
+              type="text"
               @click="edit(scope.row)"
               @click="edit(scope.row)"
               v-permission="'sysMusicScore/update'"
               v-permission="'sysMusicScore/update'"
-            >修改</el-button>
-            <el-button type="text"
+              >修改</el-button
+            >
+            <el-button
+              type="text"
               @click="remove(scope.row)"
               @click="remove(scope.row)"
               v-permission="'sysMusicScore/del'"
               v-permission="'sysMusicScore/del'"
-            >删除</el-button>
+              >删除</el-button
+            >
           </template>
           </template>
         </el-table-column>
         </el-table-column>
       </el-table>
       </el-table>
@@ -131,8 +156,13 @@
         @pagination="FetchList"
         @pagination="FetchList"
       />
       />
     </div>
     </div>
-    <el-dialog v-if="audioVisible" width="400px" :visible.sync="audioVisible" title="播放伴奏">
-      <audio style="display: block; margin: auto" controls :src="activeUrl"/>
+    <el-dialog
+      v-if="audioVisible"
+      width="400px"
+      :visible.sync="audioVisible"
+      title="播放伴奏"
+    >
+      <audio style="display: block; margin: auto" controls :src="activeUrl" />
     </el-dialog>
     </el-dialog>
     <el-dialog
     <el-dialog
       :title="title"
       :title="title"
@@ -150,54 +180,54 @@
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
-import saveform from '@/components/save-form'
-import pagination from '@/components/Pagination/index'
-import { songUseType } from '@/constant'
-import { QueryPage, Del } from './api'
-import form from './modals/form'
+import saveform from "@/components/save-form";
+import pagination from "@/components/Pagination/index";
+import { songUseType } from "@/constant";
+import { QueryPage, Del } from "./api";
+import form from "./modals/form";
 export default {
 export default {
-  name: 'accompaniment',
+  name: "accompaniment",
   components: {
   components: {
     saveform,
     saveform,
     pagination,
     pagination,
-    'submit-form': form
+    "submit-form": form,
   },
   },
   data() {
   data() {
     return {
     return {
-      type: '',
-      activeUrl: '',
+      type: "",
+      activeUrl: "",
       songUseType,
       songUseType,
       audioVisible: false,
       audioVisible: false,
       tableList: [],
       tableList: [],
       searchForm: {
       searchForm: {
-        search: '',
-        type: '',
-        subjectId: ''
+        search: "",
+        type: "",
+        subjectId: "",
       },
       },
       rules: {
       rules: {
         // 分页规则
         // 分页规则
         limit: 10, // 限制显示条数
         limit: 10, // 限制显示条数
         page: 1, // 当前页
         page: 1, // 当前页
         total: 0, // 总条数
         total: 0, // 总条数
-        page_size: [10, 20, 40, 50] // 选择限制显示条数
+        page_size: [10, 20, 40, 50], // 选择限制显示条数
       },
       },
       detail: null,
       detail: null,
       visible: false,
       visible: false,
-    }
+    };
   },
   },
   computed: {
   computed: {
     title() {
     title() {
-      const t1 = this.detail ? '修改' : '添加'
-      let t2 = this.type === 'COMMON' ? '公用' : '个人'
+      const t1 = this.detail ? "修改" : "添加";
+      let t2 = this.type === "COMMON" ? "公用" : "个人";
       if (this.detail) {
       if (this.detail) {
-        t2 = this.detail.type === 'COMMON' ? '公用' : '个人'
+        t2 = this.detail.type === "COMMON" ? "公用" : "个人";
       }
       }
-      return t1 + t2 + '伴奏'
+      return t1 + t2 + "伴奏";
     },
     },
   },
   },
   mounted() {
   mounted() {
-    this.$store.dispatch('setSubjects')
-    this.FetchList()
+    this.$store.dispatch("setSubjects");
+    this.FetchList();
   },
   },
   methods: {
   methods: {
     async FetchList() {
     async FetchList() {
@@ -206,53 +236,53 @@ export default {
           ...this.searchForm,
           ...this.searchForm,
           page: this.rules.page,
           page: this.rules.page,
           rows: this.rules.limit,
           rows: this.rules.limit,
-        })
-        this.tableList = res.data.rows
-        this.$set(this.rules, 'total', res.data.total)
+        });
+        this.tableList = res.data.rows;
+        this.$set(this.rules, "total", res.data.total);
       } catch (error) {}
       } catch (error) {}
     },
     },
     submit() {
     submit() {
-      this.$set(this.rules, 'page', 1)
-      this.$refs.searchForm.validate(valid => {
+      this.$set(this.rules, "page", 1);
+      this.$refs.searchForm.validate((valid) => {
         if (valid) {
         if (valid) {
-          this.FetchList()
+          this.FetchList();
         }
         }
-      })
+      });
     },
     },
     reset() {
     reset() {
-      this.$refs.searchForm.resetFields()
-      this.FetchList()
+      this.$refs.searchForm.resetFields();
+      this.FetchList();
     },
     },
     player(row) {
     player(row) {
-      this.activeUrl = row.url
-      this.audioVisible = true
+      this.activeUrl = row.url;
+      this.audioVisible = true;
     },
     },
     edit(row) {
     edit(row) {
-      this.detail = row
-      this.visible = true
+      this.detail = row;
+      this.visible = true;
     },
     },
     open(type) {
     open(type) {
-      this.type = type
-      this.detail = null
-      this.visible = true
+      this.type = type;
+      this.detail = null;
+      this.visible = true;
     },
     },
     async remove(row) {
     async remove(row) {
       try {
       try {
-        await this.$confirm('是否确认删除此伴奏?', '提示', {
-          type: 'warning',
-        })
-        await Del(row.id)
-        this.$message.success('删除成功')
-        this.FetchList()
+        await this.$confirm("是否确认删除此伴奏?", "提示", {
+          type: "warning",
+        });
+        await Del(row.id);
+        this.$message.success("删除成功");
+        this.FetchList();
       } catch (error) {}
       } catch (error) {}
     },
     },
-  }
-}
+  },
+};
 </script>
 </script>
 <style lang="less" scoped>
 <style lang="less" scoped>
-  .remark{
-    display: inline;
-    overflow: hidden;
-    white-space: pre;
-  }
+.remark {
+  display: inline;
+  overflow: hidden;
+  white-space: pre;
+}
 </style>
 </style>