Browse Source

feat(问题编辑): 为选项添加编辑按钮并调整对话框逻辑

yz 1 month ago
parent
commit
2044324d20

+ 14 - 0
src/components/survey-question-editor/index.scss

@@ -263,4 +263,18 @@
       }
     }
   }
+}
+.option-item {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  
+  .option-edit-btn {
+    margin-left: 10px;
+    color: #409EFF;
+    
+    &:hover {
+      color: #66b1ff;
+    }
+  }
 }

+ 10 - 0
src/components/survey-question-editor/index.vue

@@ -73,6 +73,15 @@
             >
               <span class="option-no">{{ option.optionNo }}.</span>
               <span class="option-text">{{ option.optionText }}</span>
+              <el-button
+                type="text"
+                size="mini"
+                icon="el-icon-edit"
+                @click="handleEditOption(option)"
+                class="option-edit-btn"
+              >
+                编辑
+              </el-button>
             </div>
           </div>
         </div>
@@ -279,4 +288,5 @@ export default {
 
 <style lang="scss" scoped>
 @import './index.scss';
+
 </style>

+ 2 - 1
src/mixins/survey/questionEditor.js

@@ -394,7 +394,8 @@ export default {
     handleEditOption(option) {
       this.optionDialogMode = 'edit'
       this.setOptionForm(option)
-      this.optionDialogVisible = true
+        this.currentQuestionId = option.questionId
+      // this.optionDialogVisible = true
       this.optionAddDialogVisible = true
     },