Bläddra i källkod

Merge branch 'iteration_0802'

lex-xin 3 år sedan
förälder
incheckning
fee4cc2a57

+ 4 - 4
src/utils/validate.js

@@ -29,11 +29,11 @@ export function vaildStudentUrl() {
   if (/online/.test(url)) { //线上
     returnUrl = 'https://mstuonline.dayaedu.com'
   } else if (/dev/.test(url)) { // dev 环境
-    returnUrl = 'http://mstudev.dayaedu.com'
+    returnUrl = 'https://mstudev.dayaedu.com'
   } else if (/test/.test(url)) { // dev 环境
     returnUrl = 'http://mstutest.dayaedu.com'
   } else { // 默认dev环境
-    returnUrl = 'http://mstudev.dayaedu.com'
+    returnUrl = 'https://mstutest.dayaedu.com'
   }
   return returnUrl
 }
@@ -49,7 +49,7 @@ export function vaildTeacherUrl() {
   } else if (/test/.test(url)) { // dev 环境
     returnUrl = 'http://mteatest.dayaedu.com'
   } else { // 默认dev环境
-    returnUrl = 'http://mteadev.dayaedu.com'
+    returnUrl = 'https://mteatest.dayaedu.com'
   }
   return returnUrl
 }
@@ -65,7 +65,7 @@ export function vaildTeachingUrl() {
   } else if (/test/.test(url)) { // dev 环境
     returnUrl = 'http://mantest.dayaedu.com'
   } else { // 默认dev环境
-    returnUrl = 'http://mandev.dayaedu.com'
+    returnUrl = 'https://mantest.dayaedu.com'
   }
   return returnUrl
 }

+ 9 - 0
src/views/accompaniment/api.js

@@ -27,6 +27,15 @@ export const Update = data => {
   })
 }
 
+export const Show = data => {
+  return request({
+    url: '/api-web/sysMusicScore/show',
+    method: 'post',
+    data,
+    requestType: 'form'
+  })
+}
+
 export const queryPageSysExam = data => {
   return request({
     url: '/api-web/sysMusicScoreAccompaniment/queryPage',

+ 103 - 1
src/views/accompaniment/index.vue

@@ -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>

+ 2 - 0
src/views/accompaniment/modals/form.vue

@@ -320,6 +320,7 @@ export default {
               sysMusicScore: {
                 ...this.form.sysMusicScore,
                 type: 'COMMON',
+                showFlag: 0,
                 musicScoreCategoriesId: (this.form.sysMusicScore.musicScoreCategoriesId || []).pop(),
               }
             })
@@ -331,6 +332,7 @@ export default {
                 ...this.form.sysMusicScore,
                 type: 'COMMON',
                 id: this.detail.id,
+                showFlag: this.detail.showFlag,
                 musicScoreCategoriesId: (this.form.sysMusicScore.musicScoreCategoriesId || []).pop(),
               }
             })

+ 31 - 4
src/views/teamBuild/components/teamRemainTime.vue

@@ -10,6 +10,21 @@
           <el-option label="否" value="0"></el-option>
         </el-select>
       </el-form-item>
+      <el-form-item prop="classGroupId">
+        <el-select
+          v-model.trim="search.classGroupId"
+          clearable
+          filterable
+          placeholder="请选择班级"
+        >
+          <el-option
+            v-for="(item, index) in classList"
+            :key="index"
+            :value="item.id"
+            :label="item.name"
+          ></el-option>
+        </el-select>
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" native-type="submit">搜索</el-button>
         <el-button type="danger" native-type="reset">重置</el-button>
@@ -82,6 +97,7 @@
 
 <script>
 import { queryStudentSubTotalCourseTimes } from '@/views/teamDetail/api'
+import { getMusicGroupAllClass } from "@/api/buildTeam";
 import { courseType } from '@/constant'
 export default {
   props: ['detail'],
@@ -93,14 +109,24 @@ export default {
       extra: [],
       search: {
         keyword: '',
-        hastimer: ''
-      }
+        hastimer: '',
+        classGroupId: null,
+      },
+      classList: []
     }
   },
   mounted() {
     this.FetchDetail()
+    this.getMusicClass()
   },
   methods: {
+    getMusicClass() {
+      getMusicGroupAllClass({ musicGroupId: this.$route.query.id, }).then((res) => {
+        if (res.code == 200) {
+          this.classList = res.data;
+        }
+      });
+    },
     array2object(list = []) {
       const data = {}
       for (const item of list) {
@@ -109,7 +135,7 @@ export default {
       return data
     },
     filter() {
-      const { keyword, hastimer } = this.search
+      const { keyword, hastimer, classGroupId } = this.search
       this.filterlist = this.list.filter(item => {
         const user = !keyword || (
           ('' + item.userId).indexOf(keyword) > -1 ||
@@ -118,7 +144,8 @@ export default {
         )
         const length = item.mapDtos.filter(dto => dto.value > 0).length
         const couse = !hastimer || (hastimer == '1' && length || hastimer == '0' && !length)
-        return user && couse
+        const classGroup = !classGroupId || item.classGroupId.indexOf(classGroupId) >= 0
+        return user && couse && classGroup
       })
     },
     submit(evt) {