Browse Source

将语音矩阵数量限制放宽到 18 * 18

dusenyao 2 years ago
parent
commit
141eb37250

+ 19 - 12
src/components/Adult/inputModules/VoiceMatrix.vue

@@ -71,13 +71,13 @@
     <div class="voice-matrix-input">
       <el-input
         v-model="rowNumber"
-        :maxlength="1"
+        :maxlength="2"
         @input="number('rowNumber')"
       />
       <el-input
         v-model="columnNumber"
-        :maxlength="1"
+        :maxlength="2"
         @input="number('columnNumber')"
       />
@@ -466,14 +466,14 @@ export default {
 
     // 删除生成的mp3
     delMp3() {
-        this.$confirm("确定要删除吗?", "提示", {
-            confirmButtonText: "确定",
-            cancelButtonText: "取消",
-            type: "warning",
-        })
+      this.$confirm("确定要删除吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
         .then(() => {
-            this.curQue.mp3_list.splice(0, 1);
-        })
+          this.curQue.mp3_list.splice(0, 1);
+        });
     },
 
     changeMp3(fileList) {
@@ -516,9 +516,16 @@ export default {
       this.curQue.lrc_list = lrc_list;
     },
 
-    number(value) {
-      let match = this[value].match(/^\d{1}/g);
-      this[value] = match ? Number(match[0]) : "";
+    number(attr) {
+      let val = this[attr];
+      if (val.length <= 0) return '';
+      if (/(^1[12345678]$)|(^\d{1}$)/g.test(val)) {
+        return (this[attr] = Number(val));
+      }
+      if (val.length >= 2 && /^\d*$/g.test(val)) {
+        return (this[attr] = 18);
+      }
+      this[attr] = '';
     }
   }
 };

+ 3 - 0
src/components/Adult/preview/VoiceMatrix.vue

@@ -949,6 +949,7 @@ $select-color-brown-active: #a37557;
   }
   // 语音矩阵
   &-container {
+    overflow: auto;
     height: calc(100% - 80px);
     background-color: #f5f5f5;
     border-left: 1px solid $border-color;
@@ -1104,6 +1105,7 @@ $select-color-brown-active: #a37557;
 
           > span {
             display: inline-block;
+            white-space: nowrap;
             padding: 4px 12px;
             line-height: 24px;
           }
@@ -1236,6 +1238,7 @@ $select-color-brown-active: #a37557;
 
           .inside-wrapper {
             padding: 4px 12px;
+            white-space: nowrap;
 
             .pinyin {
               font-family: "GB-PINYINOK-B";