<template>
    <div class="app-container">
        <div class="submitFrom">
            <el-input-number v-model="state.backLength" :min="0" :max="10000" />
            <span class="input">分钟</span>
            <el-button type="primary" @click="submit">提交</el-button>
        </div>
    </div>
</template>

<script lang="ts" setup>
import { reactive } from "vue";
import { setbackLength } from "@/api/swap/index";
import { ElMessage } from "element-plus";
const state = reactive({
    backLength: 0,
});
const submit = async () => {
    if (state.backLength == 0) return;
    let res = await setbackLength(state);
    if (res.code == 0) {
        ElMessage.success(res.message);
        state.backLength = 0;
    }
};
</script>

<style lang="scss" scoped>
.submitFrom {
    width: 300px;
    display: flex;
    align-items: center;
    .input {
        margin: 0 20px;
    }
}
</style>
