|
@@ -18,12 +18,15 @@
|
|
|
</ElIcon>
|
|
</ElIcon>
|
|
|
</ElFormItem>
|
|
</ElFormItem>
|
|
|
<ElFormItem prop="type">
|
|
<ElFormItem prop="type">
|
|
|
- <ElSelect v-model="item.type">
|
|
|
|
|
|
|
+ <!-- <ElSelect v-model="item.type">
|
|
|
<ElOption v-for="key in TaskType" :key="key" :label="TaskType[key]" :value="key" />
|
|
<ElOption v-for="key in TaskType" :key="key" :label="TaskType[key]" :value="key" />
|
|
|
- </ElSelect>
|
|
|
|
|
|
|
+ </ElSelect> -->
|
|
|
|
|
+ <ElCascader v-model="item.type" :options="options" class="w-52" />
|
|
|
</ElFormItem>
|
|
</ElFormItem>
|
|
|
|
|
|
|
|
- <template v-if="item.type !== 'removeLiquidity' && item.type !== 'mint'">
|
|
|
|
|
|
|
+ <template
|
|
|
|
|
+ v-if="item.type && item.type.length && !/removeLiquidity|mint/.test(item.type.slice(-1))"
|
|
|
|
|
+ >
|
|
|
<ElFormItem prop="amountType">
|
|
<ElFormItem prop="amountType">
|
|
|
<ElRadioGroup v-model="item.amountType">
|
|
<ElRadioGroup v-model="item.amountType">
|
|
|
<ElRadio label="amount">随机金额</ElRadio>
|
|
<ElRadio label="amount">随机金额</ElRadio>
|
|
@@ -72,7 +75,7 @@
|
|
|
|
|
|
|
|
<div class="flex-1"></div>
|
|
<div class="flex-1"></div>
|
|
|
<ElFormItem class="">
|
|
<ElFormItem class="">
|
|
|
- <ElButton :icon="TrashX" type="danger" @click="removeItem(i)">删除</ElButton>
|
|
|
|
|
|
|
+ <ElButton :icon="TrashX" type="danger" @click="removeItem(i)" title="删除"></ElButton>
|
|
|
</ElFormItem>
|
|
</ElFormItem>
|
|
|
</ElForm>
|
|
</ElForm>
|
|
|
</ElCard>
|
|
</ElCard>
|
|
@@ -122,6 +125,130 @@ import { ElMessage } from 'element-plus'
|
|
|
import { http } from '@/plugins/http'
|
|
import { http } from '@/plugins/http'
|
|
|
import { useStorage } from '@vueuse/core'
|
|
import { useStorage } from '@vueuse/core'
|
|
|
|
|
|
|
|
|
|
+const options = [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '跨链',
|
|
|
|
|
+ value: 'bridge',
|
|
|
|
|
+ children: [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: 'ETH→ZK',
|
|
|
|
|
+ value: 'eth2zk',
|
|
|
|
|
+ children: [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '官方',
|
|
|
|
|
+ value: 'bridge2zk'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '小飞碟',
|
|
|
|
|
+ value: 'orbiter2zk'
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: 'ZK→ETH',
|
|
|
|
|
+ value: 'zk2eth',
|
|
|
|
|
+ children: [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '官方',
|
|
|
|
|
+ value: 'bridge2eth'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '小飞碟',
|
|
|
|
|
+ value: 'orbiter2eth'
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: 'Swap',
|
|
|
|
|
+ value: 'swap',
|
|
|
|
|
+ children: [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: 'ETH→USDC',
|
|
|
|
|
+ value: 'eth2usdc',
|
|
|
|
|
+ children: [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: 'iZUMi',
|
|
|
|
|
+ value: 'swapUsdc'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: 'SyncSwap',
|
|
|
|
|
+ value: 'syncSwapUsdc'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: 'Mute',
|
|
|
|
|
+ value: 'muteSwapUsdc'
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: 'USDC→ETH',
|
|
|
|
|
+ value: 'usdc2eth',
|
|
|
|
|
+ children: [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: 'iZUMi',
|
|
|
|
|
+ value: 'swapEth'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: 'SyncSwap',
|
|
|
|
|
+ value: 'syncSwapEth'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: 'Mute',
|
|
|
|
|
+ value: 'muteSwapEth'
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '流动性',
|
|
|
|
|
+ value: 'liquidity',
|
|
|
|
|
+ children: [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: 'Add',
|
|
|
|
|
+ value: 'add',
|
|
|
|
|
+ children: [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: 'iZUMi',
|
|
|
|
|
+ value: 'addLiquidity'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: 'SyncSwap',
|
|
|
|
|
+ value: 'addLiquiditySyncSwap'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: 'Mute',
|
|
|
|
|
+ value: 'addLiquidityMute'
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: 'Remove',
|
|
|
|
|
+ value: 'remove',
|
|
|
|
|
+ children: [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: 'iZUMi',
|
|
|
|
|
+ value: 'removeLiquidity'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: 'SyncSwap',
|
|
|
|
|
+ value: 'removeLiquiditySyncSwap'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: 'Mute',
|
|
|
|
|
+ value: 'removeLiquidityMute'
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: 'Mint',
|
|
|
|
|
+ value: 'mint'
|
|
|
|
|
+ }
|
|
|
|
|
+]
|
|
|
const props = defineProps(['modelValue', 'accounts'])
|
|
const props = defineProps(['modelValue', 'accounts'])
|
|
|
const emit = defineEmits(['update:modelValue', 'createTask'])
|
|
const emit = defineEmits(['update:modelValue', 'createTask'])
|
|
|
const creatingTask = ref(false)
|
|
const creatingTask = ref(false)
|
|
@@ -228,7 +355,7 @@ async function createTask() {
|
|
|
try {
|
|
try {
|
|
|
await http.put('/tasks', {
|
|
await http.put('/tasks', {
|
|
|
accounts: props.accounts.map((item) => item.id),
|
|
accounts: props.accounts.map((item) => item.id),
|
|
|
- items: items.value.map((i) => ({ ...i })),
|
|
|
|
|
|
|
+ items: items.value.map((i) => ({ ...i, type: i.type.slice(-1)[0] })),
|
|
|
startTime: data.value.startTime,
|
|
startTime: data.value.startTime,
|
|
|
delay: data.value.delay
|
|
delay: data.value.delay
|
|
|
})
|
|
})
|