Przeglądaj źródła

添加额外字段

wolyshaw 2 lat temu
rodzic
commit
6fec53c3dc
1 zmienionych plików z 51 dodań i 2 usunięć
  1. 51 2
      src/views/accompaniment/modals/form.vue

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

@@ -91,6 +91,38 @@
           ></el-option>
         </el-select>
       </el-form-item>
+      <el-form-item
+        label="重复节拍时长"
+      >
+        <template slot="label">
+          <span>
+            重复节拍时长
+            <el-tooltip placement="top" popper-class="mTooltip">
+              <div slot="content">
+                2/4拍类似的节拍器是否重复时长
+              </div>
+              <i
+                class="el-icon-question"
+                style="font-size: 18px; color: #f56c6c"
+              ></i>
+            </el-tooltip>
+          </span>
+        </template>
+        <el-select
+          style="width: 100% !important"
+          v-model="form.repeatedBeats"
+          placeholder="请选择是否重复节拍器时长"
+        >
+          <el-option
+            :value="0"
+            label="不重复"
+          ></el-option>
+          <el-option
+            :value="1"
+            label="重复"
+          ></el-option>
+        </el-select>
+      </el-form-item>
       <!-- <el-form-item
         prop="sysMusicScore.clientType"
         label="客户端类型"
@@ -353,6 +385,9 @@
 import axios from 'axios'
 import { Add, Update, queryPageSysExam, queryTree } from "../api";
 import { getAllmemberRank } from "@/views/resetTeaming/api";
+const initailExtConfigJson = {
+  repeatedBeats: 0
+}
 export default {
   props: ["detail", "type"],
   data() {
@@ -360,10 +395,11 @@ export default {
       xmlFirstSpeed: '',
       partListNames: [],
       tree: [],
+      extConfigJson: {},
       memberRankList: [], // 会员列表
       form: {
         rankIdType: 0, // 收费会员类型 默认免费
-
+        repeatedBeats: 0, // 重复节拍
         sysMusicScore: {
           isOpenMetronome: 0, // 是否开启节拍器 默认关闭
           name: "",
@@ -377,7 +413,8 @@ export default {
           clientType: "SMART_PRACTICE",
           renderFrom: "",
           playMode: "MP3",
-          enableEvaluation: 1
+          enableEvaluation: 1,
+          extConfigJson: "{}"
         },
         sysMusicScoreAccompaniments: [
           {
@@ -404,6 +441,12 @@ export default {
     await this.FetchTree();
     await this.memberRank();
     if (this.detail) {
+      try {
+        this.extConfigJson = JSON.parse(this.detail.extConfigJson);
+      } catch (error) {
+        this.extConfigJson = {...initailExtConfigJson}
+      }
+      this.form.repeatedBeats = this.extConfigJson.repeatedBeats;
       this.$set(this.form, "sysMusicScore", {
         isOpenMetronome:Number(this.detail.isOpenMetronome),
         name: this.detail.name,
@@ -583,6 +626,9 @@ export default {
               ...this.form,
               sysMusicScore: {
                 ...this.form.sysMusicScore,
+                extConfigJson: JSON.stringify({
+                  repeatedBeats: this.form.repeatedBeats,
+                }),
                 type: "COMMON",
                 showFlag: 0,
                 musicScoreCategoriesId: (
@@ -596,6 +642,9 @@ export default {
               ...this.form,
               sysMusicScore: {
                 ...this.form.sysMusicScore,
+                extConfigJson: JSON.stringify({
+                  repeatedBeats: this.form.repeatedBeats,
+                }),
                 type: "COMMON",
                 id: this.detail.id,
                 showFlag: this.detail.showFlag,