|
@@ -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("属性已存在!");
|