|
@@ -57,8 +57,8 @@ const props = withDefaults(
|
|
|
{ modal: false, toggleModal: true, score: () => [], mainNumber: null, id: null, autoVisible: true }
|
|
|
)
|
|
|
|
|
|
-const emits = defineEmits(['submit', 'update:score', 'update:visible'])
|
|
|
-
|
|
|
+const emits = defineEmits(['submit', 'update:score', 'update:visible', 'update:modal'])
|
|
|
+const dialogModeBeforeSubmit = ref<boolean>(false)
|
|
|
const dialogMode = ref<boolean>(props.modal)
|
|
|
|
|
|
const LessRenderComponent = defineComponent({
|
|
@@ -87,8 +87,9 @@ const activeIndex = ref<number | null>(0)
|
|
|
|
|
|
const scoreValidFail = ref<boolean[]>([])
|
|
|
|
|
|
-watch(modalVisible, () => {
|
|
|
+watch(modalVisible, (val) => {
|
|
|
activeIndex.value = 0
|
|
|
+ dialogMode.value = dialogModeBeforeSubmit.value
|
|
|
})
|
|
|
|
|
|
const { fetch: getQuestionStruct, reset: resetQuestionStruct, result: questionStruct } = useFetch('getQuestionStruct')
|
|
@@ -136,6 +137,7 @@ const onSubmit = () => {
|
|
|
}
|
|
|
|
|
|
const onEnter = (index: number) => {
|
|
|
+ dialogModeBeforeSubmit.value = dialogMode.value
|
|
|
nextTick(() => {
|
|
|
if (scoreValues.value.length >= questionList.value?.length) {
|
|
|
const nullScoreIndex = scoreValues.value?.findIndex((v) => !`${v}`)
|