|
@@ -12,14 +12,14 @@
|
|
v-for="item in optionList"
|
|
v-for="item in optionList"
|
|
:key="item.id"
|
|
:key="item.id"
|
|
:value="item.id"
|
|
:value="item.id"
|
|
- :label="item.name"
|
|
|
|
|
|
+ :label="item.clazzName"
|
|
>
|
|
>
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { unitQueryByType } from "../../modules/base/api";
|
|
|
|
|
|
+import { conditionListClazz } from "../../modules/base/api";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "class-select",
|
|
name: "class-select",
|
|
@@ -28,12 +28,9 @@ export default {
|
|
placeholder: { type: String, default: "请选择" },
|
|
placeholder: { type: String, default: "请选择" },
|
|
value: { type: [Number, String], default: "" },
|
|
value: { type: [Number, String], default: "" },
|
|
clearable: { type: Boolean, default: true },
|
|
clearable: { type: Boolean, default: true },
|
|
- majorId: { type: String, default: "" },
|
|
|
|
- cascader: { type: Boolean, default: false },
|
|
|
|
- type: {
|
|
|
|
- type: String,
|
|
|
|
- default: "CLAZZ"
|
|
|
|
- }
|
|
|
|
|
|
+ semesterId: { type: String, default: "" },
|
|
|
|
+ examId: { type: String, default: "" },
|
|
|
|
+ courseCode: { type: String, default: "" }
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -48,9 +45,23 @@ export default {
|
|
this.selected = val;
|
|
this.selected = val;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- majorId(val, oldval) {
|
|
|
|
|
|
+ semesterId(val, oldval) {
|
|
|
|
+ if (val !== oldval) {
|
|
|
|
+ this.search();
|
|
|
|
+ this.$emit("input", "");
|
|
|
|
+ this.$emit("change", {});
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ examId(val, oldval) {
|
|
if (val !== oldval) {
|
|
if (val !== oldval) {
|
|
- this.search("");
|
|
|
|
|
|
+ this.search();
|
|
|
|
+ this.$emit("input", "");
|
|
|
|
+ this.$emit("change", {});
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ courseCode(val, oldval) {
|
|
|
|
+ if (val !== oldval) {
|
|
|
|
+ this.search();
|
|
this.$emit("input", "");
|
|
this.$emit("input", "");
|
|
this.$emit("change", {});
|
|
this.$emit("change", {});
|
|
}
|
|
}
|
|
@@ -61,14 +72,12 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
async search() {
|
|
async search() {
|
|
- this.optionList = [];
|
|
|
|
- if (this.cascader && !this.majorId) return;
|
|
|
|
- const res = await unitQueryByType(
|
|
|
|
- {
|
|
|
|
- majorId: this.majorId
|
|
|
|
- },
|
|
|
|
- this.type
|
|
|
|
- );
|
|
|
|
|
|
+ let data = {
|
|
|
|
+ semesterId: this.semesterId,
|
|
|
|
+ examId: this.examId,
|
|
|
|
+ courseCode: this.courseCode
|
|
|
|
+ };
|
|
|
|
+ const res = await conditionListClazz(data);
|
|
this.optionList = res;
|
|
this.optionList = res;
|
|
},
|
|
},
|
|
select() {
|
|
select() {
|