This commit is contained in:
shilin
2025-02-22 10:17:48 +08:00
parent e86cddd74a
commit 4f573bef1d
5 changed files with 45 additions and 11 deletions

2
.gitignore vendored
View File

@ -18,6 +18,8 @@ selenium-debug.log
*.njsproj *.njsproj
*.sln *.sln
*.local *.local
*.rar
*.zip
package-lock.json package-lock.json
yarn.lock yarn.lock

View File

@ -665,7 +665,7 @@ export default {
}, },
onchangePattern(init = true) { onchangePattern(init = true) {
if (this.inForm.price_pattern === 'aicoin') { if (this.inForm.price_pattern === 'aicoin') {
init && (this.inForm.price = '') init && (this.inForm.price = '0')
init && (this.inForm.price_type = 'aicoin') init && (this.inForm.price_type = 'aicoin')
this.aicoinPrice = undefined this.aicoinPrice = undefined
if (this.inForm.symbol) { if (this.inForm.symbol) {
@ -683,8 +683,12 @@ export default {
if (this.inForm.price_pattern === 'aicoin') { if (this.inForm.price_pattern === 'aicoin') {
aicoinSymbol({ symbol: this.inForm.symbol, symbolType: this.inForm.symbol_type }).then(res => { aicoinSymbol({ symbol: this.inForm.symbol, symbolType: this.inForm.symbol_type }).then(res => {
this.aicoinPrice = undefined this.aicoinPrice = undefined
this.inForm.price = undefined this.inForm.price = 0
this.aicoins = res.data this.aicoins = res.data
}).catch(() => {
this.aicoinPrice = undefined
this.inForm.price = 0
this.aicoins = {}
}) })
} }
}, },
@ -719,7 +723,7 @@ export default {
this.inForm.api_id = [] this.inForm.api_id = []
return false return false
} }
this.inForm.api_id = this.userIdOptions.map(item => item.key) this.inForm.api_id = this.lineUsers.map(item => item.id + '')
}, },
// 获取杠杆api用户 // 获取杠杆api用户
getListLineApiUser(exchangeType) { getListLineApiUser(exchangeType) {
@ -859,6 +863,10 @@ export default {
this.getListLineApiUser() this.getListLineApiUser()
this.form.type === 2 && this.getSymbolGroup(this.inForm.symbol_type) this.form.type === 2 && this.getSymbolGroup(this.inForm.symbol_type)
this.form.type === 1 && this.onCalculate() this.form.type === 1 && this.onCalculate()
// 获取交易对用于计算
if (this.inForm.price_pattern === 'mixture') {
this.getSymbol(this.inForm.symbol)
}
this.open = true this.open = true
this.title = '修改委托下单模板' this.title = '修改委托下单模板'
this.isEdit = true this.isEdit = true

View File

@ -407,6 +407,15 @@
width="200" width="200"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column
label="触发时间"
align="center"
prop="triggerTime"
width="150"
:show-overflow-tooltip="true"
>
<template #default="{row}">{{ row.triggerTime && parseTime(row.triggerTime) }}</template>
</el-table-column>
<el-table-column <el-table-column
label="过期时间" label="过期时间"
align="center" align="center"

View File

@ -425,6 +425,15 @@
width="200" width="200"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column
label="触发时间"
align="center"
prop="triggerTime"
width="150"
:show-overflow-tooltip="true"
>
<template #default="{row}">{{ row.triggerTime && parseTime(row.triggerTime) }}</template>
</el-table-column>
<el-table-column <el-table-column
label="过期时间" label="过期时间"
align="center" align="center"
@ -1403,6 +1412,7 @@ export default {
reduce_num: [{ required: true, message: '主单减仓数量百分比不能为空', trigger: 'blur' }], reduce_num: [{ required: true, message: '主单减仓数量百分比不能为空', trigger: 'blur' }],
reduce_take_profit: [{ required: true, message: '主单减仓后止盈价百分比不能为空', trigger: 'blur' }], reduce_take_profit: [{ required: true, message: '主单减仓后止盈价百分比不能为空', trigger: 'blur' }],
// reduce_stop_price: [{ required: true, message: '主单减仓后止损价不能为空', trigger: 'blur' }], // reduce_stop_price: [{ required: true, message: '主单减仓后止损价不能为空', trigger: 'blur' }],
buy_price: [{ required: true, message: '购买金额不能为空', trigger: 'blur' }],
exchange_type: [{ required: true, message: '交易所不能为空', trigger: 'blur' }], exchange_type: [{ required: true, message: '交易所不能为空', trigger: 'blur' }],
api_id: [{ required: true, message: 'api用户不能为空', trigger: 'blur' }], api_id: [{ required: true, message: 'api用户不能为空', trigger: 'blur' }],
symbol: [{ required: true, message: '交易对不能为空', trigger: 'blur' }], symbol: [{ required: true, message: '交易对不能为空', trigger: 'blur' }],
@ -1524,7 +1534,7 @@ export default {
'form.price_pattern'(newValue) { 'form.price_pattern'(newValue) {
if (newValue === 'aicoin') { if (newValue === 'aicoin') {
this.aicoinPrice = undefined this.aicoinPrice = undefined
this.form.price = undefined this.form.price = 0
this.form.price_type = 'aicoin' this.form.price_type = 'aicoin'
if (this.form.symbol) { if (this.form.symbol) {
aicoinSymbol({ symbol: this.form.symbol, symbolType: this.form.symbol_type }).then(res => { aicoinSymbol({ symbol: this.form.symbol, symbolType: this.form.symbol_type }).then(res => {
@ -1564,6 +1574,10 @@ export default {
this.aicoinPrice = undefined this.aicoinPrice = undefined
this.form.price = undefined this.form.price = undefined
this.aicoins = res.data this.aicoins = res.data
}).catch(() => {
this.aicoinPrice = undefined
this.form.price = 0
this.aicoins = {}
}) })
} }
}, },
@ -1617,7 +1631,7 @@ export default {
this.form.api_id = [] this.form.api_id = []
return false return false
} }
this.form.api_id = this.apiIdOptions.map(item => item.key) this.form.api_id = this.lineUsers.map(item => item.id)
}, },
onAll() { onAll() {
if (this.modeForm.api_user_ids && this.modeForm.api_user_ids.length > 0) { if (this.modeForm.api_user_ids && this.modeForm.api_user_ids.length > 0) {
@ -2021,14 +2035,14 @@ export default {
if (this.form.id !== undefined) { if (this.form.id !== undefined) {
updateLinePreOrder(this.form).then(response => { updateLinePreOrder(this.form).then(response => {
if (response.code === 200) { if (response.code === 200) {
this.formLoading = false
this.msgSuccess(response.msg) this.msgSuccess(response.msg)
this.open = false this.open = false
this.getList() this.getList()
} else { } else {
this.formLoading = false
this.msgError(response.msg) this.msgError(response.msg)
} }
}).finally(() => {
this.formLoading = false
}) })
} else { } else {
if (this.title === '批量添加') { if (this.title === '批量添加') {
@ -2036,14 +2050,14 @@ export default {
delete params.symbol delete params.symbol
batchAddOrder(params).then(response => { batchAddOrder(params).then(response => {
if (response.code === 200) { if (response.code === 200) {
this.formLoading = false
this.msgSuccess(response.msg) this.msgSuccess(response.msg)
this.open = false this.open = false
this.getList() this.getList()
} else { } else {
this.formLoading = false
this.msgError(response.msg) this.msgError(response.msg)
} }
}).finally(() => {
this.formLoading = false
}) })
return false return false
} }
@ -2056,14 +2070,15 @@ export default {
api_id: this.form.api_id.toString() api_id: this.form.api_id.toString()
}).then(response => { }).then(response => {
if (response.code === 200) { if (response.code === 200) {
this.formLoading = false
this.msgSuccess(response.msg) this.msgSuccess(response.msg)
this.open = false this.open = false
this.getList() this.getList()
} else { } else {
this.formLoading = false this.formLoadng = false
this.msgError(response.msg) this.msgError(response.msg)
} }
}).finally(() => {
this.formLoading = false
}) })
} }
} }

BIN
xx.rar

Binary file not shown.