|
@@ -15,7 +15,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { pageNumberQuery } from "../../modules/exam/api";
|
|
|
+import { conditionListCourse } from "../../modules/base/api";
|
|
|
+import { objFilterNull } from "../../plugins/utils";
|
|
|
|
|
|
export default {
|
|
|
name: "paper-number-select",
|
|
@@ -24,6 +25,9 @@ export default {
|
|
|
placeholder: { type: String, default: "请选择" },
|
|
|
value: { type: [Number, String], default: "" },
|
|
|
clearable: { type: Boolean, default: true },
|
|
|
+ semesterId: { type: String, default: "" },
|
|
|
+ examId: { type: String, default: "" },
|
|
|
+ courseCode: { type: String, default: "" },
|
|
|
printPlanId: { type: [String, Array], default: "" }
|
|
|
},
|
|
|
data() {
|
|
@@ -39,9 +43,30 @@ export default {
|
|
|
this.selected = val;
|
|
|
}
|
|
|
},
|
|
|
+ semesterId(val, oldval) {
|
|
|
+ if (val !== oldval) {
|
|
|
+ this.search();
|
|
|
+ this.$emit("input", "");
|
|
|
+ this.$emit("change", {});
|
|
|
+ }
|
|
|
+ },
|
|
|
+ examId(val, oldval) {
|
|
|
+ if (val !== oldval) {
|
|
|
+ this.search();
|
|
|
+ this.$emit("input", "");
|
|
|
+ this.$emit("change", {});
|
|
|
+ }
|
|
|
+ },
|
|
|
printPlanId(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("change", {});
|
|
|
}
|
|
@@ -51,11 +76,14 @@ export default {
|
|
|
this.search();
|
|
|
},
|
|
|
methods: {
|
|
|
- async search(query) {
|
|
|
- const res = await pageNumberQuery({
|
|
|
- param: query,
|
|
|
- printPlanId: this.printPlanId
|
|
|
- });
|
|
|
+ async search() {
|
|
|
+ let data = {
|
|
|
+ semesterId: this.semesterId,
|
|
|
+ examId: this.examId,
|
|
|
+ printPlanId: this.printPlanId,
|
|
|
+ courseCode: this.courseCode
|
|
|
+ };
|
|
|
+ const res = await conditionListCourse(objFilterNull(data));
|
|
|
this.optionList = res;
|
|
|
},
|
|
|
select() {
|