|
@@ -10,6 +10,10 @@ export default defineComponent({
|
|
|
type: Array,
|
|
|
default: () => [],
|
|
|
},
|
|
|
+ changeSubjectShow: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
subject: {
|
|
|
type: String,
|
|
|
default: "",
|
|
@@ -71,9 +75,27 @@ export default defineComponent({
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ const onConfirm = () => {
|
|
|
+ if (state.selectList.length > 0 && !state.instrumentCode) {
|
|
|
+ showToast("请选择乐器");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ emit("confirm", state.instrumentCode || state.subjectValue);
|
|
|
+ };
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
console.log(props.subjectList, "subjectList", props.subject, query);
|
|
|
selectItem();
|
|
|
+ document.addEventListener("keydown", (e: KeyboardEvent) => {
|
|
|
+ if (e.code === "Tab") {
|
|
|
+ e.stopPropagation();
|
|
|
+ e.preventDefault();
|
|
|
+ // onStartPlayState();
|
|
|
+ if (props.changeSubjectShow) {
|
|
|
+ onConfirm();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
return () => (
|
|
|
<div class={[styles.changeSubject, query.platform === "pc" && styles.changeSubjectPc]}>
|
|
@@ -152,11 +174,7 @@ export default defineComponent({
|
|
|
class={[styles.btn, styles.confirmBtn]}
|
|
|
onClick={() => {
|
|
|
console.log(state.selectList, state.instrumentCode);
|
|
|
- if (state.selectList.length > 0 && !state.instrumentCode) {
|
|
|
- showToast("请选择乐器");
|
|
|
- return;
|
|
|
- }
|
|
|
- emit("confirm", state.instrumentCode || state.subjectValue);
|
|
|
+ onConfirm();
|
|
|
}}
|
|
|
></div>
|
|
|
{/* <Button
|