|
|
@@ -1,11 +1,11 @@
|
|
|
<template>
|
|
|
<ElConfigProvider size="small">
|
|
|
- <ElRow :gutter="20" class="h-full">
|
|
|
- <ElCol :span="12" class="h-full">
|
|
|
+ <ElRow :gutter="20" class="home-view h-full">
|
|
|
+ <ElCol class="h-full" :xs="24" :sm="12">
|
|
|
<AccountsView ref="accountsView" class="h-full" />
|
|
|
</ElCol>
|
|
|
- <ElCol :span="12" class="!flex flex-col h-full">
|
|
|
- <TaskView class=" flex-1" @createTask="onCreateTask" />
|
|
|
+ <ElCol class="!flex flex-col h-full mt-4 md:mt-0" :xs="24" :sm="12">
|
|
|
+ <TaskView class="flex-1" @createTask="onCreateTask" />
|
|
|
<LogsView class="flex-1 mt-4" />
|
|
|
</ElCol>
|
|
|
</ElRow>
|
|
|
@@ -23,7 +23,11 @@
|
|
|
<ElOption v-for="key in TaskType" :key="key" :label="TaskType[key]" :value="key"></ElOption>
|
|
|
</ElSelect>
|
|
|
</ElFormItem>
|
|
|
- <ElFormItem prop="amount" label="金额">
|
|
|
+ <ElFormItem
|
|
|
+ prop="amount"
|
|
|
+ label="金额"
|
|
|
+ v-if="!(createTaskForm.type === 'mint' || createTaskForm.type === 'removeLiquidity')"
|
|
|
+ >
|
|
|
<ElInput v-model="createTaskForm.minAmount" class="!w-36">
|
|
|
<template #prepend>MIN</template>
|
|
|
</ElInput>
|
|
|
@@ -46,9 +50,6 @@
|
|
|
import { ref, onMounted, inject, watch } from 'vue'
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
import { http } from '@/plugins/http'
|
|
|
-import { ArrowNarrowRight, ArrowsRightLeft } from '@vicons/tabler'
|
|
|
-import { useFileDialog, useIntervalFn } from '@vueuse/core'
|
|
|
-import WalletAddress from '@/components/WalletAddress.vue'
|
|
|
import { TaskType } from '@/enums'
|
|
|
import AccountsView from './AccountsView.vue'
|
|
|
import TaskView from '@/views/TaskView.vue'
|
|
|
@@ -63,23 +64,25 @@ const showCreateTaskDialog = ref(false)
|
|
|
const createTaskFormRef = ref(null)
|
|
|
const createTaskForm = ref({})
|
|
|
const createTaskRule = {
|
|
|
- type: [{ required: true, message: '请选择类型', trigger: 'change' }],
|
|
|
+ type: [{ required: true, message: '请选择类型' }],
|
|
|
amount: [
|
|
|
{
|
|
|
validator: (rule, value, callback) => {
|
|
|
if (createTaskForm.value.type !== 'min') {
|
|
|
if (!(createTaskForm.value.minAmount && createTaskForm.value.maxAmount)) {
|
|
|
callback(new Error('请输入金额'))
|
|
|
+ } else if (Number(createTaskForm.value.minAmount) > Number(createTaskForm.value.maxAmount)) {
|
|
|
+ callback(new Error('最小金额不能大于最大金额'))
|
|
|
} else {
|
|
|
callback()
|
|
|
}
|
|
|
} else {
|
|
|
callback()
|
|
|
}
|
|
|
- },
|
|
|
- trigger: 'change'
|
|
|
+ }
|
|
|
}
|
|
|
- ]
|
|
|
+ ],
|
|
|
+ startTime: [{ required: true, message: '请选择执行时间' }]
|
|
|
}
|
|
|
const creatingTask = ref(false)
|
|
|
function onCreateTask() {
|
|
|
@@ -87,6 +90,10 @@ function onCreateTask() {
|
|
|
ElMessage.warning('请先选择账号')
|
|
|
return
|
|
|
}
|
|
|
+ createTaskForm.value = {}
|
|
|
+ if (createTaskFormRef.value) {
|
|
|
+ createTaskFormRef.value.clearValidate()
|
|
|
+ }
|
|
|
showCreateTaskDialog.value = true
|
|
|
}
|
|
|
function createTask() {
|
|
|
@@ -100,7 +107,8 @@ function createTask() {
|
|
|
mintAmount: createTaskForm.value.mintAmount,
|
|
|
maxAmount: createTaskForm.value.maxAmount
|
|
|
},
|
|
|
- type: createTaskForm.value.type
|
|
|
+ type: createTaskForm.value.type,
|
|
|
+ startTime: createTaskForm.value.startTime
|
|
|
})
|
|
|
ElMessage.success('任务添加成功')
|
|
|
creatingTask.value = false
|