浏览代码

标引的优化

zhuliu 2 年之前
父节点
当前提交
a363d83322
共有 1 个文件被更改,包括 12 次插入1 次删除
  1. 12 1
      RMS-FrontEnd/src/views/components/articles/components/PatentField.vue

+ 12 - 1
RMS-FrontEnd/src/views/components/articles/components/PatentField.vue

@@ -22,7 +22,7 @@
                 <template v-if="item.type === 4">
                   <el-radio-group v-model="selected[item.id]" @change="onChange( item)">
                     <div v-for="option in item.option">
-                      <el-radio class="custom-radio" :label="option.id">{{ option.name }}</el-radio>
+                      <el-radio class="custom-radio" :label="option.id" @click.native.prevent="getSelect(item,option.id)">{{ option.name }}</el-radio>
                     </div>
                   </el-radio-group>
                 </template>
@@ -99,6 +99,7 @@ export default {
       selected: {},
       isReloaData: true,
       look:true,
+      radioValue:null,
     }
   },
 watch: {
@@ -256,6 +257,10 @@ watch: {
         })
       })
     },
+    getSelect(val,option){
+      this.radioValue = option
+      this.onChange(val)
+    },
     //标引事件
     onChange(val, input) {
       if (!this.$permission('/workspace/details/indexing')) {
@@ -283,9 +288,15 @@ watch: {
           break
         case 3:
         case 4:
+        if(this.selected[val.id] == this.radioValue){
+            this.selected[val.id] = 0
+          }else{
+            this.selected[val.id]= this.radioValue
+          }
           data.selected = [{
             value: this.selected[val.id]
           }]
+          this.radioValue = null
           break
         case 5:
           data.selected = this.selected[val.id].map(item => {