|
@@ -35,7 +35,8 @@ export default {
|
|
disabled: { type: Boolean, default: false },
|
|
disabled: { type: Boolean, default: false },
|
|
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 },
|
|
|
|
+ collegeId: { type: [Number, String], default: "" }
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -50,6 +51,13 @@ export default {
|
|
handler(val) {
|
|
handler(val) {
|
|
this.selected = val;
|
|
this.selected = val;
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ collegeId(val, oldval) {
|
|
|
|
+ if (val !== oldval) {
|
|
|
|
+ this.search();
|
|
|
|
+ this.$emit("input", "");
|
|
|
|
+ this.$emit("change", {});
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -58,15 +66,21 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
async search() {
|
|
async search() {
|
|
this.optionList = [];
|
|
this.optionList = [];
|
|
|
|
+ if (!this.collegeId) return;
|
|
|
|
|
|
- const res = await ecsExamQuery();
|
|
|
|
|
|
+ const res = await ecsExamQuery(this.collegeId);
|
|
this.optionList = res;
|
|
this.optionList = res;
|
|
},
|
|
},
|
|
async toSync() {
|
|
async toSync() {
|
|
|
|
+ if (!this.collegeId) {
|
|
|
|
+ this.$message.error("请先选择学院!");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
if (this.loading) return;
|
|
if (this.loading) return;
|
|
this.loading = true;
|
|
this.loading = true;
|
|
|
|
|
|
- const res = await ecsExamSync().catch(() => {});
|
|
|
|
|
|
+ const res = await ecsExamSync(this.collegeId).catch(() => {});
|
|
this.loading = false;
|
|
this.loading = false;
|
|
if (res) this.optionList = res;
|
|
if (res) this.optionList = res;
|
|
},
|
|
},
|