|
@@ -31,6 +31,7 @@ export default {
|
|
|
value: { type: [Number, String], default: "" },
|
|
|
clearable: { type: Boolean, default: true },
|
|
|
showCommonCard: { type: Boolean, default: true },
|
|
|
+ examId: { type: String, default: "" },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -45,13 +46,23 @@ export default {
|
|
|
this.selected = val;
|
|
|
},
|
|
|
},
|
|
|
+ examId(val, oldval) {
|
|
|
+ if (val !== oldval) {
|
|
|
+ this.search();
|
|
|
+ this.$emit("input", "");
|
|
|
+ this.$emit("change", {});
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
- async created() {
|
|
|
+ created() {
|
|
|
this.search();
|
|
|
},
|
|
|
methods: {
|
|
|
- async search(query) {
|
|
|
- const res = await cardRuleQuery(query);
|
|
|
+ async search() {
|
|
|
+ const datas = {};
|
|
|
+ if (this.examId) datas.examId = this.examId;
|
|
|
+
|
|
|
+ const res = await cardRuleQuery(datas);
|
|
|
this.optionList = res;
|
|
|
if (this.showCommonCard)
|
|
|
this.optionList.unshift({
|