Rmengdi 11 месяцев назад
Родитель
Сommit
34e324db9d
2 измененных файлов с 21 добавлено и 18 удалено
  1. 10 0
      pdaaphm-ui/src/main.js
  2. 11 18
      pdaaphm-ui/src/views/index.vue

+ 10 - 0
pdaaphm-ui/src/main.js

@@ -84,6 +84,16 @@ Vue.use(Element, {
 
 Vue.config.productionTip = false
 
+// 解决el-radio-group组件,浏览器和vue协议问题而报错
+Vue.directive('removeAriaHidden', {
+  bind(el, binding) {
+    let ariaEls = el.querySelectorAll('.el-radio__original');
+    ariaEls.forEach((item) => {
+      item.removeAttribute('aria-hidden');
+    });
+  }
+});
+
 new Vue({
   el: '#app',
   router,

+ 11 - 18
pdaaphm-ui/src/views/index.vue

@@ -182,9 +182,9 @@
     <el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :close-on-click-modal="false">
       <el-form ref="formRef" :model="form" :rules="rules" label-width="80px">
         <el-form-item v-if="dialogType === 4" label="选择数据类型" label-width="120px">
-          <el-radio-group v-model="type">
-            <el-radio :label="2">补全</el-radio>
+          <el-radio-group  v-removeAriaHidden v-model="type">
             <el-radio :label="1">去噪</el-radio>
+            <el-radio :label="3">扩充</el-radio>
             <!-- <el-radio :label="4">特征提取</el-radio> -->
           </el-radio-group>
         </el-form-item>
@@ -273,7 +273,7 @@ export default {
       fileType: null,
       chart: null,
       imgPreviewUrl: null,
-      type: 2,
+      type: 1,
       dialogType: null
     }
   },
@@ -329,21 +329,14 @@ export default {
     handleProcess(type) {
       this.dialogVisible = true;
       this.dialogType = type
-      if (type === 4) {
-        getDataByType(this.type).then(res => {
-          this.optionalData = res.data;
-        });
-        getAlgConfigByType(this.type).then(res => {
-          this.optionalAglo = res.data;
-        });
-      } else {
-        getDataByType(type).then(res => {
-          this.optionalData = res.data;
-        });
-        getAlgConfigByType(type).then(res => {
-          this.optionalAglo = res.data;
-        });
-      }
+      const relation = [[2, 0], [1, 2], [3, 1],[4, 1], [4, 3] , [5, 4], [6, 4]]
+      const match = relation.find(item => item[0] === type)[1];
+      getDataByType(match).then(res => {
+        this.optionalData = res.data;
+      });
+      getAlgConfigByType(match).then(res => {
+        this.optionalAglo = res.data;
+      });
     },
     submitHandle() {
       addProcess(this.form).then(response => {