zhangjie 2 anni fa
parent
commit
d1666a74a4
1 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  1. 4 4
      src/modules/question/components/QuestionInfoEdit.vue

+ 4 - 4
src/modules/question/components/QuestionInfoEdit.vue

@@ -51,7 +51,7 @@
       <el-form-item label="属性列表">
         <el-tag
           v-for="item in modalForm.quesProperties"
-          :key="item.id"
+          :key="item.key"
           style="margin-right: 5px"
           closable
           effect="dark"
@@ -129,19 +129,19 @@ export default {
     },
     removeProperty(property) {
       this.modalForm.quesProperties = this.modalForm.quesProperties.filter(
-        (item) => property.id !== item.id
+        (item) => property.key !== item.key
       );
       this.emitChange();
     },
     addProperty() {
       if (!this.propSelected) return;
       const newProperty = {
-        id: `${this.properties.coursePropertyId}_${this.properties.firstPropertyId}_${this.properties.secondPropertyId}`,
+        key: `${this.properties.coursePropertyId}_${this.properties.firstPropertyId}_${this.properties.secondPropertyId}`,
         name: `${this.selection.courseProperty.name},${this.selection.firstProperty.name},${this.selection.secondProperty.name}`,
         ...this.properties,
       };
       const propertyExist = this.modalForm.quesProperties.find(
-        (item) => item.id === newProperty.id
+        (item) => item.key === newProperty.key
       );
       if (propertyExist) {
         this.$message.error("属性已存在!");