Browse Source

选题调整

zhangjie 2 years ago
parent
commit
a3894a5759
1 changed files with 12 additions and 2 deletions
  1. 12 2
      src/modules/questions/views/SelectQuestion.vue

+ 12 - 2
src/modules/questions/views/SelectQuestion.vue

@@ -82,6 +82,7 @@
           >
             <el-input
               slot="reference"
+              v-model="propertyNames"
               placeholder="选择属性"
               readonly
             ></el-input>
@@ -182,6 +183,7 @@ export default {
       },
       DIFFICULTY_LEVEL_ENUM,
       propertyTree: [],
+      propertyNames: "",
       defaultProps: {
         label: "questionPropertyName",
         children: "childrenProperty",
@@ -277,12 +279,20 @@ export default {
         nitem.questionPropertyId = `c${item.coursePropertyId}`;
         nitem.questionPropertyName = item.coursePropertyName;
         nitem.childrenProperty = item.questionPropertyTrees;
+        nitem.isCourse = true;
         return nitem;
       });
     },
     checkChange() {
-      this.formSearch.propertyIdList =
-        this.$refs.PropertyTreeRef.getCheckedKeys(true);
+      const validNodes = this.$refs.PropertyTreeRef.getCheckedNodes().filter(
+        (item) => !item.isCourse
+      );
+      this.formSearch.propertyIdList = validNodes.map(
+        (item) => item.questionPropertyId
+      );
+      this.propertyNames = validNodes
+        .map((item) => item.questionPropertyName)
+        .join(";");
     },
     quesTypeChange() {
       this.formSearch.quesName = "";