Compare commits
14 Commits
1069707953
...
dabb3e6ce6
| Author | SHA1 | Date | |
|---|---|---|---|
| dabb3e6ce6 | |||
| 3fe0558954 | |||
| a5e774e6f1 | |||
| ee5934973c | |||
| 3342cc220b | |||
| a686354f2e | |||
| 3cf626e60e | |||
| 63a5dfbdf3 | |||
| 06b3771f66 | |||
| 443778cf36 | |||
| 9d34d37c11 | |||
| f54cd7beaa | |||
| ea32ec317c | |||
| 9d4c6e5f6e |
@ -2,5 +2,5 @@
|
|||||||
ENV = 'development'
|
ENV = 'development'
|
||||||
|
|
||||||
# base api
|
# base api
|
||||||
VUE_APP_BASE_API = 'http://192.168.1.11:6789'
|
VUE_APP_BASE_API = 'http://192.168.2.102:6789'
|
||||||
|
|
||||||
|
|||||||
53
src/api/admin/line-api-user-group.js
Normal file
53
src/api/admin/line-api-user-group.js
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询LineApiUserGroup列表
|
||||||
|
export function listLineApiUserGroup(query) {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/line-api-user-group',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询LineApiUserGroup详细
|
||||||
|
export function getLineApiUserGroup(id) {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/line-api-user-group/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增LineApiUserGroup
|
||||||
|
export function addLineApiUserGroup(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/line-api-user-group',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改LineApiUserGroup
|
||||||
|
export function updateLineApiUserGroup(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/line-api-user-group/' + data.id,
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除LineApiUserGroup
|
||||||
|
export function delLineApiUserGroup(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/line-api-user-group',
|
||||||
|
method: 'delete',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getLineApiUserGroupList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/line-api-user-group/options',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
@ -82,13 +82,6 @@ export function orderMarginType(data) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
export function manuallyCover(data) {
|
|
||||||
return request({
|
|
||||||
url: '/api/v1/line-pre-order/manuallyCover',
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
export function closePosition(data) {
|
export function closePosition(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/v1/line-pre-order/closePosition',
|
url: '/api/v1/line-pre-order/closePosition',
|
||||||
|
|||||||
46
src/api/admin/line-reduce-strategy.js
Normal file
46
src/api/admin/line-reduce-strategy.js
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询LineReduceStrategy列表
|
||||||
|
export function listLineReduceStrategy(query) {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/line-reduce-strategy',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询LineReduceStrategy详细
|
||||||
|
export function getLineReduceStrategy(id) {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/line-reduce-strategy/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增LineReduceStrategy
|
||||||
|
export function addLineReduceStrategy(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/line-reduce-strategy',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改LineReduceStrategy
|
||||||
|
export function updateLineReduceStrategy(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/line-reduce-strategy/' + data.id,
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除LineReduceStrategy
|
||||||
|
export function delLineReduceStrategy(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/line-reduce-strategy',
|
||||||
|
method: 'delete',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
46
src/api/admin/line-strategy-template.js
Normal file
46
src/api/admin/line-strategy-template.js
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询LineStrategyTemplate列表
|
||||||
|
export function listLineStrategyTemplate(query) {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/line-strategy-template',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询LineStrategyTemplate详细
|
||||||
|
export function getLineStrategyTemplate(id) {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/line-strategy-template/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增LineStrategyTemplate
|
||||||
|
export function addLineStrategyTemplate(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/line-strategy-template',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改LineStrategyTemplate
|
||||||
|
export function updateLineStrategyTemplate(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/line-strategy-template/' + data.id,
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除LineStrategyTemplate
|
||||||
|
export function delLineStrategyTemplate(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/line-strategy-template',
|
||||||
|
method: 'delete',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
@ -10,14 +10,13 @@ export function listLineSymbolBlack(query) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 查询LineSymbolBlack详细
|
// 查询LineSymbolBlack详细
|
||||||
export function getLineSymbolBlack (id) {
|
export function getLineSymbolBlack(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/v1/line-symbol-black/' + id,
|
url: '/api/v1/line-symbol-black/' + id,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 新增LineSymbolBlack
|
// 新增LineSymbolBlack
|
||||||
export function addLineSymbolBlack(data) {
|
export function addLineSymbolBlack(data) {
|
||||||
return request({
|
return request({
|
||||||
@ -30,7 +29,7 @@ export function addLineSymbolBlack(data) {
|
|||||||
// 修改LineSymbolBlack
|
// 修改LineSymbolBlack
|
||||||
export function updateLineSymbolBlack(data) {
|
export function updateLineSymbolBlack(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/v1/line-symbol-black/'+data.id,
|
url: '/api/v1/line-symbol-black/' + data.id,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
@ -45,9 +44,8 @@ export function delLineSymbolBlack(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 重新加载交易对
|
||||||
//重新加载交易对
|
export function reloadSymbol() {
|
||||||
export function reloadSymbol(){
|
|
||||||
return request({
|
return request({
|
||||||
url: '/api/v1/line-symbol-black/reload-symbol',
|
url: '/api/v1/line-symbol-black/reload-symbol',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
|
|||||||
46
src/api/admin/line-symbol-price.js
Normal file
46
src/api/admin/line-symbol-price.js
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询LineSymbolPrice列表
|
||||||
|
export function listLineSymbolPrice(query) {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/line-symbol-price',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询LineSymbolPrice详细
|
||||||
|
export function getLineSymbolPrice(id) {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/line-symbol-price/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增LineSymbolPrice
|
||||||
|
export function addLineSymbolPrice(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/line-symbol-price',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改LineSymbolPrice
|
||||||
|
export function updateLineSymbolPrice(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/line-symbol-price/' + data.id,
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除LineSymbolPrice
|
||||||
|
export function delLineSymbolPrice(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/line-symbol-price',
|
||||||
|
method: 'delete',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
@ -10,14 +10,13 @@ export function listLineUser(query) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 查询LineUser详细
|
// 查询LineUser详细
|
||||||
export function getLineUser (id) {
|
export function getLineUser(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/v1/line-user/' + id,
|
url: '/api/v1/line-user/' + id,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 新增LineUser
|
// 新增LineUser
|
||||||
export function addLineUser(data) {
|
export function addLineUser(data) {
|
||||||
return request({
|
return request({
|
||||||
@ -30,7 +29,7 @@ export function addLineUser(data) {
|
|||||||
// 修改LineUser
|
// 修改LineUser
|
||||||
export function updateLineUser(data) {
|
export function updateLineUser(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/v1/line-user/'+data.id,
|
url: '/api/v1/line-user/' + data.id,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
@ -45,7 +44,7 @@ export function delLineUser(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function reloadProperty(data){
|
export function reloadProperty(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/v1/line-user/property',
|
url: '/api/v1/line-user/property',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
|
|||||||
@ -10,14 +10,13 @@ export function listMemberBalanceLog(query) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 查询MemberBalanceLog详细
|
// 查询MemberBalanceLog详细
|
||||||
export function getMemberBalanceLog (id) {
|
export function getMemberBalanceLog(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/v1/member-balance-log/' + id,
|
url: '/api/v1/member-balance-log/' + id,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 新增MemberBalanceLog
|
// 新增MemberBalanceLog
|
||||||
export function addMemberBalanceLog(data) {
|
export function addMemberBalanceLog(data) {
|
||||||
return request({
|
return request({
|
||||||
@ -30,7 +29,7 @@ export function addMemberBalanceLog(data) {
|
|||||||
// 修改MemberBalanceLog
|
// 修改MemberBalanceLog
|
||||||
export function updateMemberBalanceLog(data) {
|
export function updateMemberBalanceLog(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/v1/member-balance-log/'+data.id,
|
url: '/api/v1/member-balance-log/' + data.id,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
|
|||||||
@ -10,14 +10,13 @@ export function listMemberBalance(query) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 查询MemberBalance详细
|
// 查询MemberBalance详细
|
||||||
export function getMemberBalance (id) {
|
export function getMemberBalance(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/v1/member-balance/' + id,
|
url: '/api/v1/member-balance/' + id,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 新增MemberBalance
|
// 新增MemberBalance
|
||||||
export function addMemberBalance(data) {
|
export function addMemberBalance(data) {
|
||||||
return request({
|
return request({
|
||||||
@ -30,7 +29,7 @@ export function addMemberBalance(data) {
|
|||||||
// 修改MemberBalance
|
// 修改MemberBalance
|
||||||
export function updateMemberBalance(data) {
|
export function updateMemberBalance(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/v1/member-balance/'+data.id,
|
url: '/api/v1/member-balance/' + data.id,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
|
|||||||
@ -10,14 +10,13 @@ export function listMemberRenwaLog(query) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 查询MemberRenwaLog详细
|
// 查询MemberRenwaLog详细
|
||||||
export function getMemberRenwaLog (id) {
|
export function getMemberRenwaLog(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/v1/member-renwa-log/' + id,
|
url: '/api/v1/member-renwa-log/' + id,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 新增MemberRenwaLog
|
// 新增MemberRenwaLog
|
||||||
export function addMemberRenwaLog(data) {
|
export function addMemberRenwaLog(data) {
|
||||||
return request({
|
return request({
|
||||||
@ -30,7 +29,7 @@ export function addMemberRenwaLog(data) {
|
|||||||
// 修改MemberRenwaLog
|
// 修改MemberRenwaLog
|
||||||
export function updateMemberRenwaLog(data) {
|
export function updateMemberRenwaLog(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/v1/member-renwa-log/'+data.id,
|
url: '/api/v1/member-renwa-log/' + data.id,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
|
|||||||
@ -10,14 +10,13 @@ export function listMemberRenwalConfig(query) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 查询MemberRenwalConfig详细
|
// 查询MemberRenwalConfig详细
|
||||||
export function getMemberRenwalConfig (id) {
|
export function getMemberRenwalConfig(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/v1/member-renwal-config/' + id,
|
url: '/api/v1/member-renwal-config/' + id,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 新增MemberRenwalConfig
|
// 新增MemberRenwalConfig
|
||||||
export function addMemberRenwalConfig(data) {
|
export function addMemberRenwalConfig(data) {
|
||||||
return request({
|
return request({
|
||||||
@ -30,7 +29,7 @@ export function addMemberRenwalConfig(data) {
|
|||||||
// 修改MemberRenwalConfig
|
// 修改MemberRenwalConfig
|
||||||
export function updateMemberRenwalConfig(data) {
|
export function updateMemberRenwalConfig(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/v1/member-renwal-config/'+data.id,
|
url: '/api/v1/member-renwal-config/' + data.id,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
|
|||||||
@ -10,14 +10,13 @@ export function listMemberWithdrawalLog(query) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 查询MemberWithdrawalLog详细
|
// 查询MemberWithdrawalLog详细
|
||||||
export function getMemberWithdrawalLog (id) {
|
export function getMemberWithdrawalLog(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/v1/member-withdrawal-log/' + id,
|
url: '/api/v1/member-withdrawal-log/' + id,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 新增MemberWithdrawalLog
|
// 新增MemberWithdrawalLog
|
||||||
export function addMemberWithdrawalLog(data) {
|
export function addMemberWithdrawalLog(data) {
|
||||||
return request({
|
return request({
|
||||||
@ -30,7 +29,7 @@ export function addMemberWithdrawalLog(data) {
|
|||||||
// 修改MemberWithdrawalLog
|
// 修改MemberWithdrawalLog
|
||||||
export function updateMemberWithdrawalLog(data) {
|
export function updateMemberWithdrawalLog(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/v1/member-withdrawal-log/'+data.id,
|
url: '/api/v1/member-withdrawal-log/' + data.id,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
@ -45,9 +44,9 @@ export function delMemberWithdrawalLog(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//确认提现申请
|
// 确认提现申请
|
||||||
|
|
||||||
export function approve(data){
|
export function approve(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/v1/member-withdrawal-log/approve',
|
url: '/api/v1/member-withdrawal-log/approve',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
@ -55,8 +54,8 @@ export function approve(data){
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//到账提现申请
|
// 到账提现申请
|
||||||
export function confirm(data){
|
export function confirm(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/v1/member-withdrawal-log/confirm',
|
url: '/api/v1/member-withdrawal-log/confirm',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
|
|||||||
@ -9,8 +9,13 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="字典标签" prop="dictLabel">
|
<el-form-item label="字典标签" prop="dictLabel">
|
||||||
<el-input v-model="queryParams.dictLabel" placeholder="请输入字典标签" clearable size="small"
|
<el-input
|
||||||
@keyup.enter.native="handleQuery" />
|
v-model="queryParams.dictLabel"
|
||||||
|
placeholder="请输入字典标签"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态" prop="status">
|
<el-form-item label="状态" prop="status">
|
||||||
<el-select v-model="queryParams.status" placeholder="数据状态" clearable size="small">
|
<el-select v-model="queryParams.status" placeholder="数据状态" clearable size="small">
|
||||||
@ -25,16 +30,33 @@
|
|||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-permisaction="['admin:sysDictData:add']" type="primary" icon="el-icon-plus" size="mini"
|
<el-button
|
||||||
@click="handleAdd">新增</el-button>
|
v-permisaction="['admin:sysDictData:add']"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
>新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-permisaction="['admin:sysDictData:edit']" type="success" icon="el-icon-edit" size="mini"
|
<el-button
|
||||||
:disabled="single" @click="handleUpdate">修改</el-button>
|
v-permisaction="['admin:sysDictData:edit']"
|
||||||
|
type="success"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
>修改</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-permisaction="['admin:sysDictData:remove']" type="danger" icon="el-icon-delete" size="mini"
|
<el-button
|
||||||
:disabled="multiple" @click="handleDelete">删除</el-button>
|
v-permisaction="['admin:sysDictData:remove']"
|
||||||
|
type="danger"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
>删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
@ -53,16 +75,31 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button v-permisaction="['admin:sysDictData:edit']" size="mini" type="text" icon="el-icon-edit"
|
<el-button
|
||||||
@click="handleUpdate(scope.row)">修改</el-button>
|
v-permisaction="['admin:sysDictData:edit']"
|
||||||
<el-button v-permisaction="['admin:sysDictData:remove']" size="mini" type="text" icon="el-icon-delete"
|
size="mini"
|
||||||
@click="handleDelete(scope.row)">删除</el-button>
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
v-permisaction="['admin:sysDictData:remove']"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
>删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageIndex"
|
<pagination
|
||||||
:limit.sync="queryParams.pageSize" @pagination="getList" />
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageIndex"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改参数配置对话框 -->
|
<!-- 添加或修改参数配置对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" :close-on-click-modal="false">
|
<el-dialog :title="title" :visible.sync="open" width="500px" :close-on-click-modal="false">
|
||||||
@ -89,13 +126,23 @@
|
|||||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div style="text-align: right;"><el-button @click="addLuanguage">新增多语言</el-button></div>
|
<div style="text-align: right;"><el-button @click="addLuanguage">新增多语言</el-button></div>
|
||||||
<el-form-item v-for="(item, index) in form.languageData" :key="'luanguage_' + index"
|
<el-form-item
|
||||||
:label="'多语言' + (index + 1)" prop="languageData">
|
v-for="(item, index) in form.languageData"
|
||||||
|
:key="'luanguage_' + index"
|
||||||
|
:label="'多语言' + (index + 1)"
|
||||||
|
prop="languageData"
|
||||||
|
>
|
||||||
<div class="luanguage-item">
|
<div class="luanguage-item">
|
||||||
<el-input v-model="item.k" placeholder="多语言key(zh-CN,en)" style="width: 45%;" />
|
<el-input v-model="item.k" placeholder="多语言key(zh-CN,en)" style="width: 45%;" />
|
||||||
<el-input v-model="item.v" placeholder="请输入多语言文本" style="width: 45%;" />
|
<el-input v-model="item.v" placeholder="请输入多语言文本" style="width: 45%;" />
|
||||||
<el-button type="warning" size="mini" circle icon="el-icon-delete" @click="luanguageDel(index)"
|
<el-button
|
||||||
round></el-button>
|
type="warning"
|
||||||
|
size="mini"
|
||||||
|
circle
|
||||||
|
icon="el-icon-delete"
|
||||||
|
round
|
||||||
|
@click="luanguageDel(index)"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
@ -255,10 +302,10 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm: function () {
|
submitForm: function() {
|
||||||
this.$refs['form'].validate(valid => {
|
this.$refs['form'].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
console.log('form',this.form)
|
console.log('form', this.form)
|
||||||
this.form.status = parseInt(this.form.status)
|
this.form.status = parseInt(this.form.status)
|
||||||
if (this.form.dictCode !== undefined) {
|
if (this.form.dictCode !== undefined) {
|
||||||
updateData(this.form).then(response => {
|
updateData(this.form).then(response => {
|
||||||
@ -291,7 +338,7 @@ export default {
|
|||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(function () {
|
}).then(function() {
|
||||||
return delData({ 'ids': dictCodes })
|
return delData({ 'ids': dictCodes })
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
@ -301,7 +348,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.msgError(response.msg)
|
this.msgError(response.msg)
|
||||||
}
|
}
|
||||||
}).catch(function () { })
|
}).catch(function() { })
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
@ -310,14 +357,14 @@ export default {
|
|||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(function () {
|
}).then(function() {
|
||||||
return exportData(queryParams)
|
return exportData(queryParams)
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
this.download(response.msg)
|
this.download(response.msg)
|
||||||
}).catch(function () { })
|
}).catch(function() { })
|
||||||
},
|
},
|
||||||
addLuanguage() {
|
addLuanguage() {
|
||||||
this.form.languageData.push({ k: "", v: "" })
|
this.form.languageData.push({ k: '', v: '' })
|
||||||
},
|
},
|
||||||
luanguageDel(index) {
|
luanguageDel(index) {
|
||||||
if (this.form.languageData) {
|
if (this.form.languageData) {
|
||||||
|
|||||||
367
src/views/admin/line-api-user-group/index.vue
Normal file
367
src/views/admin/line-api-user-group/index.vue
Normal file
@ -0,0 +1,367 @@
|
|||||||
|
<template>
|
||||||
|
<BasicLayout>
|
||||||
|
<template #wrapper>
|
||||||
|
<el-card class="box-card">
|
||||||
|
<el-form ref="queryForm" :model="queryParams" :inline="true" label-width="68px">
|
||||||
|
<el-form-item label="分组名称" prop="groupName"><el-input
|
||||||
|
v-model="queryParams.groupName"
|
||||||
|
placeholder="请输入分组名称"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
v-permisaction="['admin:lineApiUserGroup:add']"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
>新增
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
v-permisaction="['admin:lineApiUserGroup:edit']"
|
||||||
|
type="success"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
>修改
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
v-permisaction="['admin:lineApiUserGroup:remove']"
|
||||||
|
type="danger"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
>删除
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="lineApiUserGroupList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
|
||||||
|
<el-table-column label="交易所" align="center" prop="exchangeType" :show-overflow-tooltip="true">
|
||||||
|
<template #default="{ row }">
|
||||||
|
{{ exchangeTypeFormat(row) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="分组名称" align="center" prop="groupName" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="数量" align="center" prop="count" />
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-popconfirm
|
||||||
|
class="delete-popconfirm"
|
||||||
|
title="确认要修改吗?"
|
||||||
|
confirm-button-text="修改"
|
||||||
|
@confirm="handleUpdate(scope.row)"
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
slot="reference"
|
||||||
|
v-permisaction="['admin:lineApiUserGroup:edit']"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
>修改
|
||||||
|
</el-button>
|
||||||
|
</el-popconfirm>
|
||||||
|
<el-popconfirm
|
||||||
|
class="delete-popconfirm"
|
||||||
|
title="确认要删除吗?"
|
||||||
|
confirm-button-text="删除"
|
||||||
|
@confirm="handleDelete(scope.row)"
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
slot="reference"
|
||||||
|
v-permisaction="['admin:lineApiUserGroup:remove']"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
>删除
|
||||||
|
</el-button>
|
||||||
|
</el-popconfirm>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageIndex"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 添加或修改对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="500px">
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="交易所" prop="exchangeType">
|
||||||
|
<el-select
|
||||||
|
v-model="form.exchangeType"
|
||||||
|
style="width: 100%;"
|
||||||
|
placeholder="请选择交易所"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
size="small"
|
||||||
|
@change="exchangeTypeChange"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in exchangeTypes"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="分组名称" prop="groupName">
|
||||||
|
<el-input v-model="form.groupName" show-word-limit maxlength="30" placeholder="请输入分组名称" />
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="api用户" prop="userIds">
|
||||||
|
<el-select
|
||||||
|
v-model="form.userIds"
|
||||||
|
multiple
|
||||||
|
style="width: 100%;"
|
||||||
|
placeholder="请选择api用户"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in lineUsers"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.apiName"
|
||||||
|
:value="dict.id"
|
||||||
|
:disabled="dict.openStatus === 0"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-radio-group v-model="form.status">
|
||||||
|
<el-radio :label="1">开启</el-radio>
|
||||||
|
<el-radio :label="0">关闭</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button v-loading="loading" type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</el-card>
|
||||||
|
</template>
|
||||||
|
</BasicLayout>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { addLineApiUserGroup, delLineApiUserGroup, getLineApiUserGroup, listLineApiUserGroup, updateLineApiUserGroup } from '@/api/admin/line-api-user-group'
|
||||||
|
import { listLineApiUser } from '@/api/admin/line-api-user'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'LineApiUserGroup',
|
||||||
|
components: {
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 弹出层标题
|
||||||
|
title: '',
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
isEdit: false,
|
||||||
|
// 类型数据字典
|
||||||
|
typeOptions: [],
|
||||||
|
lineApiUserGroupList: [],
|
||||||
|
lineUsers: [],
|
||||||
|
lineTotal: 0,
|
||||||
|
// 关系表类型
|
||||||
|
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageIndex: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
groupName: undefined
|
||||||
|
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {
|
||||||
|
},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
groupName: [{ required: true, message: '分组名称不能为空', trigger: 'blur' }],
|
||||||
|
userIds: [{ required: true, message: '用户不能为空', trigger: 'blur' }]
|
||||||
|
},
|
||||||
|
exchangeTypes: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList()
|
||||||
|
// 获取交易所字典数据
|
||||||
|
this.getDicts('exchange_type').then(response => {
|
||||||
|
this.exchangeTypes = response.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
exchangeTypeFormat(row) {
|
||||||
|
return this.selectDictLabel(this.exchangeTypes || [], row.exchangeType)
|
||||||
|
},
|
||||||
|
/** 查询参数列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true
|
||||||
|
listLineApiUserGroup(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||||
|
this.lineApiUserGroupList = response.data.list
|
||||||
|
this.total = response.data.count
|
||||||
|
this.loading = false
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false
|
||||||
|
this.reset()
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: undefined,
|
||||||
|
exchangeType: this.exchangeTypes.length ? this.exchangeTypes[0].value : '',
|
||||||
|
groupName: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
status: 1,
|
||||||
|
userIds: []
|
||||||
|
}
|
||||||
|
this.resetForm('form')
|
||||||
|
},
|
||||||
|
getImgList: function() {
|
||||||
|
this.form[this.fileIndex] = this.$refs['fileChoose'].resultList[0].fullUrl
|
||||||
|
},
|
||||||
|
fileClose: function() {
|
||||||
|
this.fileOpen = false
|
||||||
|
},
|
||||||
|
getLineApiUser() {
|
||||||
|
listLineApiUser({ pageIndex: 1, pageSize: 999, exchangeType: this.form.exchangeType }).then(response => {
|
||||||
|
this.lineUsers = response.data.list
|
||||||
|
this.lineTotal = response.data.count
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 关系
|
||||||
|
// 文件
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageIndex = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.dateRange = []
|
||||||
|
this.resetForm('queryForm')
|
||||||
|
this.handleQuery()
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset()
|
||||||
|
this.open = true
|
||||||
|
this.title = '添加api用户分组'
|
||||||
|
this.isEdit = false
|
||||||
|
|
||||||
|
this.getLineApiUser()
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length !== 1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset()
|
||||||
|
this.getLineApiUser()
|
||||||
|
const id =
|
||||||
|
row.id || this.ids
|
||||||
|
getLineApiUserGroup(id).then(response => {
|
||||||
|
this.form = response.data
|
||||||
|
this.open = true
|
||||||
|
this.title = '修改api用户分组'
|
||||||
|
this.isEdit = true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
exchangeTypeChange() {
|
||||||
|
this.form.userIds = []
|
||||||
|
this.getLineApiUser()
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm: function() {
|
||||||
|
this.$refs['form'].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id !== undefined) {
|
||||||
|
updateLineApiUserGroup(this.form).then(response => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.msgSuccess(response.msg)
|
||||||
|
this.open = false
|
||||||
|
this.getList()
|
||||||
|
} else {
|
||||||
|
this.msgError(response.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
addLineApiUserGroup(this.form).then(response => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.msgSuccess(response.msg)
|
||||||
|
this.open = false
|
||||||
|
this.getList()
|
||||||
|
} else {
|
||||||
|
this.msgError(response.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
var Ids = (row.id && [row.id]) || this.ids
|
||||||
|
|
||||||
|
this.$confirm('是否确认删除编号为"' + Ids + '"的数据项?', '警告', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(function() {
|
||||||
|
return delLineApiUserGroup({ 'ids': Ids })
|
||||||
|
}).then((response) => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.msgSuccess(response.msg)
|
||||||
|
this.open = false
|
||||||
|
this.getList()
|
||||||
|
} else {
|
||||||
|
this.msgError(response.msg)
|
||||||
|
}
|
||||||
|
}).catch(function() {
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@ -97,14 +97,14 @@
|
|||||||
>
|
>
|
||||||
<template #default="{row}">{{ ['现货','合约','现货合约'][row.affiliation-1] }}</template>
|
<template #default="{row}">{{ ['现货','合约','现货合约'][row.affiliation-1] }}</template>
|
||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
<el-table-column
|
<!-- <el-table-column
|
||||||
label="是否超管可见"
|
label="是否超管可见"
|
||||||
align="center"
|
align="center"
|
||||||
prop="adminShow"
|
prop="adminShow"
|
||||||
:show-overflow-tooltip="true"
|
:show-overflow-tooltip="true"
|
||||||
>
|
>
|
||||||
<template #default="{row}">{{ ['否','是'][row.adminShow] }}</template>
|
<template #default="{row}">{{ ['否','是'][row.adminShow] }}</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<!-- <el-table-column
|
<!-- <el-table-column
|
||||||
label="允许下单的方向"
|
label="允许下单的方向"
|
||||||
align="center"
|
align="center"
|
||||||
@ -113,7 +113,7 @@
|
|||||||
>
|
>
|
||||||
<template #default="{row}">{{ ['多','空','多空'][row.site-1] }}</template>
|
<template #default="{row}">{{ ['多','空','多空'][row.site-1] }}</template>
|
||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
<el-table-column
|
<!-- <el-table-column
|
||||||
label="从属关系"
|
label="从属关系"
|
||||||
align="center"
|
align="center"
|
||||||
prop="subordinate"
|
prop="subordinate"
|
||||||
@ -124,7 +124,8 @@
|
|||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ groupIdFormat(scope.row) }}
|
{{ groupIdFormat(scope.row) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column><el-table-column
|
</el-table-column> -->
|
||||||
|
<el-table-column
|
||||||
label="开启状态"
|
label="开启状态"
|
||||||
align="center"
|
align="center"
|
||||||
prop="openStatus"
|
prop="openStatus"
|
||||||
@ -300,7 +301,7 @@
|
|||||||
import { addLineApiUser, delLineApiUser, getLineApiUser, listLineApiUser, updateLineApiUser } from '@/api/admin/line-api-user'
|
import { addLineApiUser, delLineApiUser, getLineApiUser, listLineApiUser, updateLineApiUser } from '@/api/admin/line-api-user'
|
||||||
|
|
||||||
import { listLineUser } from '@/api/admin/line-user'
|
import { listLineUser } from '@/api/admin/line-user'
|
||||||
import { listLineApiGroup } from '@/api/admin/line-api-group'
|
// import { listLineApiGroup } from '@/api/admin/line-api-group'
|
||||||
export default {
|
export default {
|
||||||
name: 'LineApiUser',
|
name: 'LineApiUser',
|
||||||
components: {
|
components: {
|
||||||
@ -349,7 +350,7 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
this.getList()
|
this.getList()
|
||||||
this.getLineUserItems()
|
this.getLineUserItems()
|
||||||
this.getLineApiGroupItems()
|
// this.getLineApiGroupItems()
|
||||||
// 获取交易所字典数据
|
// 获取交易所字典数据
|
||||||
this.getDicts('exchange_type').then(response => {
|
this.getDicts('exchange_type').then(response => {
|
||||||
this.exchangeTypes = response.data
|
this.exchangeTypes = response.data
|
||||||
@ -414,11 +415,11 @@ export default {
|
|||||||
this.userIdOptions = this.setItems(res, 'id', 'username')
|
this.userIdOptions = this.setItems(res, 'id', 'username')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getLineApiGroupItems() {
|
// getLineApiGroupItems() {
|
||||||
this.getItems(listLineApiGroup, undefined).then(res => {
|
// this.getItems(listLineApiGroup, undefined).then(res => {
|
||||||
this.groupIdOptions = this.setItems(res, 'id', 'groupName')
|
// this.groupIdOptions = this.setItems(res, 'id', 'groupName')
|
||||||
})
|
// })
|
||||||
},
|
// },
|
||||||
// 文件
|
// 文件
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
|
|||||||
@ -12,18 +12,35 @@
|
|||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-permisaction="['admin:lineCoinnetwork:add']" type="primary" icon="el-icon-plus"
|
<el-button
|
||||||
size="mini" @click="handleAdd">新增
|
v-permisaction="['admin:lineCoinnetwork:add']"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
>新增
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-permisaction="['admin:lineCoinnetwork:edit']" type="success" icon="el-icon-edit"
|
<el-button
|
||||||
size="mini" :disabled="single" @click="handleUpdate">修改
|
v-permisaction="['admin:lineCoinnetwork:edit']"
|
||||||
|
type="success"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
>修改
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-permisaction="['admin:lineCoinnetwork:remove']" type="danger" icon="el-icon-delete"
|
<el-button
|
||||||
size="mini" :disabled="multiple" @click="handleDelete">删除
|
v-permisaction="['admin:lineCoinnetwork:remove']"
|
||||||
|
type="danger"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
>删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -40,24 +57,47 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-popconfirm class="delete-popconfirm" title="确认要修改吗?" confirm-button-text="修改"
|
<el-popconfirm
|
||||||
@confirm="handleUpdate(scope.row)">
|
class="delete-popconfirm"
|
||||||
<el-button slot="reference" v-permisaction="['admin:lineCoinnetwork:edit']" size="mini"
|
title="确认要修改吗?"
|
||||||
type="text" icon="el-icon-edit">修改
|
confirm-button-text="修改"
|
||||||
|
@confirm="handleUpdate(scope.row)"
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
slot="reference"
|
||||||
|
v-permisaction="['admin:lineCoinnetwork:edit']"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
>修改
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-popconfirm>
|
</el-popconfirm>
|
||||||
<el-popconfirm class="delete-popconfirm" title="确认要删除吗?" confirm-button-text="删除"
|
<el-popconfirm
|
||||||
@confirm="handleDelete(scope.row)">
|
class="delete-popconfirm"
|
||||||
<el-button slot="reference" v-permisaction="['admin:lineCoinnetwork:remove']"
|
title="确认要删除吗?"
|
||||||
size="mini" type="text" icon="el-icon-delete">删除
|
confirm-button-text="删除"
|
||||||
|
@confirm="handleDelete(scope.row)"
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
slot="reference"
|
||||||
|
v-permisaction="['admin:lineCoinnetwork:remove']"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
>删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-popconfirm>
|
</el-popconfirm>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageIndex"
|
<pagination
|
||||||
:limit.sync="queryParams.pageSize" @pagination="getList" />
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageIndex"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改对话框 -->
|
<!-- 添加或修改对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px">
|
<el-dialog :title="title" :visible.sync="open" width="500px">
|
||||||
@ -67,7 +107,7 @@
|
|||||||
<el-input v-model="form.networkName" placeholder="网络名称" />
|
<el-input v-model="form.networkName" placeholder="网络名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="最小提现金额" prop="minWithdrawal">
|
<el-form-item label="最小提现金额" prop="minWithdrawal">
|
||||||
<el-input v-model="form.minWithdrawal" placeholder="最小提现金额"></el-input>
|
<el-input v-model="form.minWithdrawal" placeholder="最小提现金额" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="网络token名称" prop="tokenName">
|
<!-- <el-form-item label="网络token名称" prop="tokenName">
|
||||||
<el-input v-model="form.tokenName" placeholder="网络token名称"
|
<el-input v-model="form.tokenName" placeholder="网络token名称"
|
||||||
@ -89,9 +129,13 @@
|
|||||||
<el-input v-model="form.fee" placeholder="手续费(百分比)" />
|
<el-input v-model="form.fee" placeholder="手续费(百分比)" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态" prop="status">
|
<el-form-item label="状态" prop="status">
|
||||||
<el-switch v-model="form.status" active-text="启用" :active-value="1" :inactive-value="2"
|
<el-switch
|
||||||
inactive-text="禁用">
|
v-model="form.status"
|
||||||
</el-switch>
|
active-text="启用"
|
||||||
|
:active-value="1"
|
||||||
|
:inactive-value="2"
|
||||||
|
inactive-text="禁用"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
@ -132,10 +176,10 @@ export default {
|
|||||||
typeOptions: [],
|
typeOptions: [],
|
||||||
lineCoinnetworkList: [],
|
lineCoinnetworkList: [],
|
||||||
statusOptions: [{
|
statusOptions: [{
|
||||||
label: "启用",
|
label: '启用',
|
||||||
value: 1
|
value: 1
|
||||||
}, {
|
}, {
|
||||||
label: "禁用",
|
label: '禁用',
|
||||||
value: 2
|
value: 2
|
||||||
}],
|
}],
|
||||||
// 关系表类型
|
// 关系表类型
|
||||||
@ -144,7 +188,7 @@ export default {
|
|||||||
queryParams: {
|
queryParams: {
|
||||||
pageIndex: 1,
|
pageIndex: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
idOrder:"desc",
|
idOrder: 'desc'
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {
|
form: {
|
||||||
@ -153,7 +197,7 @@ export default {
|
|||||||
rules: {
|
rules: {
|
||||||
networkName: [{ required: true, message: '网络名称不能为空', trigger: 'blur' }],
|
networkName: [{ required: true, message: '网络名称不能为空', trigger: 'blur' }],
|
||||||
minWithdrawal: [{ required: true, message: '最小提现金额不能为空', trigger: 'blur' }],
|
minWithdrawal: [{ required: true, message: '最小提现金额不能为空', trigger: 'blur' }],
|
||||||
fee: [{ required: true, message: '手续费不能为空', trigger: 'blur' }],
|
fee: [{ required: true, message: '手续费不能为空', trigger: 'blur' }]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -184,14 +228,14 @@ export default {
|
|||||||
networkName: undefined,
|
networkName: undefined,
|
||||||
status: 1,
|
status: 1,
|
||||||
minWithdrawal: undefined,
|
minWithdrawal: undefined,
|
||||||
fee: undefined,
|
fee: undefined
|
||||||
}
|
}
|
||||||
this.resetForm('form')
|
this.resetForm('form')
|
||||||
},
|
},
|
||||||
getImgList: function () {
|
getImgList: function() {
|
||||||
this.form[this.fileIndex] = this.$refs['fileChoose'].resultList[0].fullUrl
|
this.form[this.fileIndex] = this.$refs['fileChoose'].resultList[0].fullUrl
|
||||||
},
|
},
|
||||||
fileClose: function () {
|
fileClose: function() {
|
||||||
this.fileOpen = false
|
this.fileOpen = false
|
||||||
},
|
},
|
||||||
// 关系
|
// 关系
|
||||||
@ -233,7 +277,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm: function () {
|
submitForm: function() {
|
||||||
this.$refs['form'].validate(valid => {
|
this.$refs['form'].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.id !== undefined) {
|
if (this.form.id !== undefined) {
|
||||||
@ -268,7 +312,7 @@ export default {
|
|||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(function () {
|
}).then(function() {
|
||||||
return delLineCoinnetwork({ 'ids': Ids })
|
return delLineCoinnetwork({ 'ids': Ids })
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
@ -278,7 +322,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.msgError(response.msg)
|
this.msgError(response.msg)
|
||||||
}
|
}
|
||||||
}).catch(function () {
|
}).catch(function() {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,17 +48,11 @@
|
|||||||
>新增
|
>新增
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col> -->
|
</el-col> -->
|
||||||
<el-col :span="1.5">
|
<!-- <el-col :span="1.5">
|
||||||
<el-button
|
<el-button v-permisaction="['admin:lineOrderTemplateLogs:edit']" type="success" icon="el-icon-edit"
|
||||||
v-permisaction="['admin:lineOrderTemplateLogs:edit']"
|
size="mini" :disabled="single" @click="handleUpdate">修改
|
||||||
type="success"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
size="mini"
|
|
||||||
:disabled="single"
|
|
||||||
@click="handleUpdate"
|
|
||||||
>修改
|
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
v-permisaction="['admin:lineOrderTemplateLogs:remove']"
|
v-permisaction="['admin:lineOrderTemplateLogs:remove']"
|
||||||
@ -107,6 +101,21 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
<el-popconfirm
|
||||||
|
class="delete-popconfirm"
|
||||||
|
title="确认要复制吗?"
|
||||||
|
confirm-button-text="复制"
|
||||||
|
@confirm="handleCopy(scope.row)"
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
slot="reference"
|
||||||
|
v-permisaction="['admin:lineOrderTemplateLogs:copy']"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-document-copy"
|
||||||
|
>复制
|
||||||
|
</el-button>
|
||||||
|
</el-popconfirm>
|
||||||
<el-popconfirm
|
<el-popconfirm
|
||||||
class="delete-popconfirm"
|
class="delete-popconfirm"
|
||||||
title="确认要修改吗?"
|
title="确认要修改吗?"
|
||||||
@ -150,7 +159,7 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改对话框 -->
|
<!-- 添加或修改对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="1200px" :close-on-click-modal="false">
|
<el-dialog :title="title" :visible.sync="open" width="1300px" :close-on-click-modal="false">
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="模板名称" prop="name">
|
<el-form-item label="模板名称" prop="name">
|
||||||
<el-input v-model="form.name" placeholder="模板名称" />
|
<el-input v-model="form.name" placeholder="模板名称" />
|
||||||
@ -181,6 +190,13 @@
|
|||||||
<el-radio :label="2">合约</el-radio>
|
<el-radio :label="2">合约</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="api用户类型" prop="api_id_type">
|
||||||
|
<el-radio-group v-model="inForm.api_id_type" @change="apiIdTypeChange">
|
||||||
|
<el-radio :label="1">单个</el-radio>
|
||||||
|
<el-radio :label="2">分组</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
<!-- <el-form-item label="对冲类型" prop="cover_type">
|
<!-- <el-form-item label="对冲类型" prop="cover_type">
|
||||||
<el-radio-group v-model="inForm.cover_type">
|
<el-radio-group v-model="inForm.cover_type">
|
||||||
<el-radio :label="1" :disabled="inForm.order_type==2">现货对合约</el-radio>
|
<el-radio :label="1" :disabled="inForm.order_type==2">现货对合约</el-radio>
|
||||||
@ -188,7 +204,7 @@
|
|||||||
<el-radio :label="3" :disabled="inForm.order_type==1">合约对现货</el-radio>
|
<el-radio :label="3" :disabled="inForm.order_type==1">合约对现货</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
<el-form-item label="api用户" prop="api_id">
|
<el-form-item v-if="inForm.api_id_type === 1" label="api用户" prop="api_id">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="21">
|
<el-col :span="21">
|
||||||
<el-select
|
<el-select
|
||||||
@ -213,6 +229,24 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item v-if="inForm.api_id_type === 2" label="api用户组" prop="api_user_group_id">
|
||||||
|
<el-select
|
||||||
|
v-model="inForm.api_user_group_id"
|
||||||
|
size="small"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
@change="apiUserGroupChange"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="(op, index) in apiUserGroupList"
|
||||||
|
:key="'op_user_group' + index"
|
||||||
|
:label="op.label"
|
||||||
|
:value="op.id"
|
||||||
|
:disabled="op.disabled"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item v-if="form.type === 2" label="交易对组" prop="symbol_group_id">
|
<el-form-item v-if="form.type === 2" label="交易对组" prop="symbol_group_id">
|
||||||
<el-select
|
<el-select
|
||||||
v-if="form.type === 2"
|
v-if="form.type === 2"
|
||||||
@ -267,6 +301,47 @@
|
|||||||
<el-form-item label="购买金额(U)" prop="buy_price">
|
<el-form-item label="购买金额(U)" prop="buy_price">
|
||||||
<el-input v-model="inForm.buy_price" placeholder="购买金额(U)" />
|
<el-input v-model="inForm.buy_price" placeholder="购买金额(U)" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="策略类型">
|
||||||
|
<el-radio-group v-model="inForm.strategy_template_type" @input="changeStrategyTemplateType">
|
||||||
|
<el-radio
|
||||||
|
v-for="(item, index) in strategyTemplateTypeOptions"
|
||||||
|
:key="'strategyTemplateType' + index"
|
||||||
|
:label="item.value"
|
||||||
|
>{{ item.label }}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-if="inForm.strategy_template_type === 1" label="策略模板">
|
||||||
|
<el-select
|
||||||
|
v-model="inForm.strategy_template_id"
|
||||||
|
style="width: 100%;"
|
||||||
|
placeholder="请选择策略"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
:remote-method="queryStrategyTemplate"
|
||||||
|
:loading="searchLoding"
|
||||||
|
remote
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in strategyTemplateOptions"
|
||||||
|
:key="'strategyTemplateId' + dict.id"
|
||||||
|
:label="dict.name"
|
||||||
|
:value="dict.id"
|
||||||
|
/>
|
||||||
|
<div class="page">
|
||||||
|
<pagination
|
||||||
|
v-show="strategyTemplatePagition.total > 0"
|
||||||
|
:background="false"
|
||||||
|
:total="strategyTemplatePagition.total"
|
||||||
|
layout="prev, pager, next"
|
||||||
|
:page.sync="strategyTemplatePagition.pageIndex"
|
||||||
|
:limit.sync="strategyTemplatePagition.pageSize"
|
||||||
|
@pagination="queryStrategyTemplate"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="价格模式" prop="price_pattern">
|
<el-form-item label="价格模式" prop="price_pattern">
|
||||||
<el-radio-group v-model="inForm.price_pattern" @change="onchangePattern">
|
<el-radio-group v-model="inForm.price_pattern" @change="onchangePattern">
|
||||||
<el-radio label="percentage">百分比</el-radio>
|
<el-radio label="percentage">百分比</el-radio>
|
||||||
@ -315,8 +390,18 @@
|
|||||||
<el-button type="primary" style="margin-left: 50px;" @click="onCalc">计算</el-button>
|
<el-button type="primary" style="margin-left: 50px;" @click="onCalc">计算</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-form-item label="止盈百分比" prop="profit">
|
<el-form-item :label="inForm.price_pattern === 'mixture' ? '止盈价格' : '止盈百分比'" prop="profit">
|
||||||
<el-input v-model="inForm.profit" placeholder="止盈百分比" />
|
<el-input v-model="inForm.profit" :placeholder="inForm.price_pattern === 'mixture' ? '止盈价格' : '止盈百分比'">
|
||||||
|
<template v-if="inForm.price_pattern === 'mixture'" slot="append">{{ comTakePrice }}</template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="inForm.price_pattern === 'mixture' ? '止损价格' : '止损价百分比'" prop="stop_loss">
|
||||||
|
<el-input
|
||||||
|
v-model="inForm.stop_loss"
|
||||||
|
min="0"
|
||||||
|
type="number"
|
||||||
|
:placeholder="inForm.price_pattern === 'mixture' ? '止损价格' : '止损价百分比'"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="止盈数量百分比" prop="profit_num_ratio">
|
<el-form-item label="止盈数量百分比" prop="profit_num_ratio">
|
||||||
<el-input v-model="inForm.profit_num_ratio" placeholder="止盈数量百分比" />
|
<el-input v-model="inForm.profit_num_ratio" placeholder="止盈数量百分比" />
|
||||||
@ -403,8 +488,45 @@
|
|||||||
<el-radio label="0">直接执行</el-radio>
|
<el-radio label="0">直接执行</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="主单亏损百分比" prop="reduce_price">
|
<el-form-item label="减仓策略">
|
||||||
<el-input v-model.number="inForm.reduce_price" type="number" placeholder="主单亏损百分比" />
|
<el-select
|
||||||
|
v-model="inForm.reduce_strategy_id"
|
||||||
|
style="width: 100%;"
|
||||||
|
placeholder="请选择策略"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
:remote-method="queryReduceStrategy"
|
||||||
|
:loading="searchLoding"
|
||||||
|
remote
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in reduceStrategyPagition.reduceStrategyList"
|
||||||
|
:key="'reduce_stratefy.' + dict.id"
|
||||||
|
:label="dict.name"
|
||||||
|
:value="dict.id"
|
||||||
|
/>
|
||||||
|
<div class="page">
|
||||||
|
<pagination
|
||||||
|
v-show="reduceStrategyPagition.total > 0"
|
||||||
|
:background="false"
|
||||||
|
:total="reduceStrategyPagition.total"
|
||||||
|
layout="prev, pager, next"
|
||||||
|
:page.sync="reduceStrategyPagition.pageIndex"
|
||||||
|
:limit.sync="reduceStrategyPagition.pageSize"
|
||||||
|
@pagination="queryReduceStrategy"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="inForm.price_pattern === 'mixture' ? '主单亏损价格' : '主单亏损百分比'" prop="reduce_price">
|
||||||
|
<el-input
|
||||||
|
v-model="inForm.reduce_price"
|
||||||
|
type="number"
|
||||||
|
:placeholder="inForm.price_pattern === 'mixture' ? '主单亏损价格' : '主单亏损百分比'"
|
||||||
|
>
|
||||||
|
<template v-if="inForm.price_pattern === 'mixture'" slot="append">{{ comReducePrice }}</template>
|
||||||
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="主单减仓数量百分比" prop="reduce_num">
|
<el-form-item label="主单减仓数量百分比" prop="reduce_num">
|
||||||
<el-input v-model.number="inForm.reduce_num" type="number" placeholder="主单减仓数量百分比" />
|
<el-input v-model.number="inForm.reduce_num" type="number" placeholder="主单减仓数量百分比" />
|
||||||
@ -428,6 +550,7 @@
|
|||||||
@click="onCalculate"
|
@click="onCalculate"
|
||||||
>计算</el-button></el-col>
|
>计算</el-button></el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<el-form ref="extForm" :model="inForm" label-position="top" :rules="inRules" class="ext-form">
|
||||||
<div v-for="(item, index) in inForm.ext" :key="index" class="exts">
|
<div v-for="(item, index) in inForm.ext" :key="index" class="exts">
|
||||||
<el-row v-if="item.addType === 1" :gutter="20" style="margin-bottom: 20px;">
|
<el-row v-if="item.addType === 1" :gutter="20" style="margin-bottom: 20px;">
|
||||||
<el-col :span="5">
|
<el-col :span="5">
|
||||||
@ -447,15 +570,31 @@
|
|||||||
|
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="3">{{ item.addType === 1 ? '加仓下跌百分比' : '减仓下跌百分比' }}
|
<el-col :span="3">
|
||||||
|
<!-- {{ item.addType === 1 ? '加仓下跌百分比' : '减仓下跌百分比' }} -->
|
||||||
|
<el-form-item
|
||||||
|
:prop="'ext.' + index + '.priceRatio'"
|
||||||
|
:rules="inRules.priceRatio"
|
||||||
|
class="ext-form-item"
|
||||||
|
:label="item.addType === 1 ? '加仓下跌百分比' : '减仓下跌百分比'"
|
||||||
|
>
|
||||||
<el-input
|
<el-input
|
||||||
v-model.number="item.priceRatio"
|
v-model.number="item.priceRatio"
|
||||||
min="0"
|
min="0"
|
||||||
size="mini"
|
size="mini"
|
||||||
type="number"
|
type="number"
|
||||||
:placeholder="item.addType === 1 ? '加仓下跌百分比' : '减仓下跌百分比'"
|
:placeholder="item.addType === 1 ? '加仓下跌百分比' : '减仓下跌百分比'"
|
||||||
/></el-col>
|
/>
|
||||||
<el-col :span="3">{{ item.addType === 1 ? '加仓数值' : '减仓百分比' }}
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="3">
|
||||||
|
<!-- {{ item.addType === 1 ? '加仓数值' : '减仓百分比' }} -->
|
||||||
|
<el-form-item
|
||||||
|
:prop="'ext.' + index + '.addPositionVal'"
|
||||||
|
:label="item.addType === 1 ? '加仓数值' : '减仓百分比'"
|
||||||
|
:rules="inRules.addPositionVal"
|
||||||
|
class="ext-form-item"
|
||||||
|
>
|
||||||
<el-input
|
<el-input
|
||||||
v-model.number="item.addPositionVal"
|
v-model.number="item.addPositionVal"
|
||||||
min="0"
|
min="0"
|
||||||
@ -463,9 +602,16 @@
|
|||||||
type="number"
|
type="number"
|
||||||
:placeholder="item.addType === 1 ? '加仓数值' : '减仓百分比'"
|
:placeholder="item.addType === 1 ? '加仓数值' : '减仓百分比'"
|
||||||
/>
|
/>
|
||||||
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<span>止盈/止损百分比</span>
|
<!-- <span>止盈/止损百分比</span> -->
|
||||||
|
<el-form-item
|
||||||
|
label="止盈/止损百分比"
|
||||||
|
:prop="'ext.' + index + '.takeProfitRatio'"
|
||||||
|
:rules="[{ validator: validateTakeProfitAndStopLoss, trigger: 'blur' }]"
|
||||||
|
class="ext-form-item"
|
||||||
|
>
|
||||||
<div>
|
<div>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="item.takeProfitRatio"
|
v-model="item.takeProfitRatio"
|
||||||
@ -487,20 +633,35 @@
|
|||||||
placeholder="止损百分比"
|
placeholder="止损百分比"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<!-- <el-col :span="3">止损百分比<el-input v-model.number="item.stopLossRatio" size="mini" type="number" placeholder="止损百分比" /></el-col> -->
|
<!-- <el-col :span="3">止损百分比<el-input v-model.number="item.stopLossRatio" size="mini" type="number" placeholder="止损百分比" /></el-col> -->
|
||||||
|
|
||||||
<template v-if="item.addType === 1">
|
<template v-if="item.addType === 1">
|
||||||
<el-col :span="3">
|
<el-col :span="3">
|
||||||
止盈数量百分比<el-input
|
<!-- 止盈数量百分比 -->
|
||||||
|
<el-form-item
|
||||||
|
label="止盈数量(%)"
|
||||||
|
:prop="'ext.' + index + '.takeProfitNumRatio'"
|
||||||
|
:rules="inRules.takeProfitNumRatio"
|
||||||
|
class="ext-form-item"
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
v-model.number="item.takeProfitNumRatio"
|
v-model.number="item.takeProfitNumRatio"
|
||||||
size="mini"
|
size="mini"
|
||||||
type="number"
|
type="number"
|
||||||
placeholder="止盈数量百分比"
|
placeholder="止盈数量百分比"
|
||||||
/>
|
/>
|
||||||
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="4">
|
||||||
<span>第二止盈/止损百分比</span>
|
<!-- <span>第二止盈/止损百分比</span> -->
|
||||||
|
<el-form-item
|
||||||
|
label="第二止盈/止损百分比"
|
||||||
|
:prop="'ext.' + index + '.tpTpPriceRatio'"
|
||||||
|
:rules="[{ validator: validateTp, trigger: 'blur' }]"
|
||||||
|
class="ext-form-item"
|
||||||
|
>
|
||||||
<div>
|
<div>
|
||||||
<el-input
|
<el-input
|
||||||
v-model.number="item.tpTpPriceRatio"
|
v-model.number="item.tpTpPriceRatio"
|
||||||
@ -520,8 +681,19 @@
|
|||||||
placeholder="第二止损价百分比"
|
placeholder="第二止损价百分比"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</template>
|
</template>
|
||||||
|
<el-col :span="2">
|
||||||
|
<el-form-item
|
||||||
|
label="过期(H)"
|
||||||
|
:prop="'ext.' + index + '.expirateHour'"
|
||||||
|
:rules="inRules.expirateHour"
|
||||||
|
class="ext-form-item"
|
||||||
|
>
|
||||||
|
<el-input v-model.number="item.expirateHour" size="mini" type="number" placeholder="过期时间(小时)" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col :span="3">
|
<el-col :span="3">
|
||||||
<div style="margin-bottom: 14px;" /><el-button
|
<div style="margin-bottom: 14px;" /><el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -531,6 +703,8 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
<!-- <el-form-item label="是否保存模板" prop="save_template">
|
<!-- <el-form-item label="是否保存模板" prop="save_template">
|
||||||
<el-radio-group v-model="inForm.save_template">
|
<el-radio-group v-model="inForm.save_template">
|
||||||
<el-radio label="0">否</el-radio>
|
<el-radio label="0">否</el-radio>
|
||||||
@ -569,6 +743,10 @@ import { addLineOrderTemplateLogs, delLineOrderTemplateLogs, getLineOrderTemplat
|
|||||||
import { listLineSymbolGroup } from '@/api/admin/line-symbol-group'
|
import { listLineSymbolGroup } from '@/api/admin/line-symbol-group'
|
||||||
import { getMainUser, listLineApiUser } from '@/api/admin/line-api-user'
|
import { getMainUser, listLineApiUser } from '@/api/admin/line-api-user'
|
||||||
import { calculate, aicoinSymbol, quickAddPreOrder } from '@/api/admin/line-pre-order'
|
import { calculate, aicoinSymbol, quickAddPreOrder } from '@/api/admin/line-pre-order'
|
||||||
|
import { getLineApiUserGroupList } from '@/api/admin/line-api-user-group'
|
||||||
|
import { listLineStrategyTemplate } from '@/api/admin/line-strategy-template'
|
||||||
|
import { listLineReduceStrategy } from '@/api/admin/line-reduce-strategy'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'LineOrderTemplateLogs',
|
name: 'LineOrderTemplateLogs',
|
||||||
components: {
|
components: {
|
||||||
@ -608,6 +786,7 @@ export default {
|
|||||||
|
|
||||||
// 关系表类型
|
// 关系表类型
|
||||||
userIdOptions: [],
|
userIdOptions: [],
|
||||||
|
apiUserGroupList: [],
|
||||||
|
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
@ -636,17 +815,62 @@ export default {
|
|||||||
percenter: undefined,
|
percenter: undefined,
|
||||||
symbolGroups: [],
|
symbolGroups: [],
|
||||||
inRules: {
|
inRules: {
|
||||||
reduce_price: [{ required: true, message: '主单亏损减仓百分比不能为空', trigger: 'blur' }],
|
price: [{ required: true, message: '请输入下单百分比不能为空', trigger: 'blur' },
|
||||||
reduce_num: [{ required: true, message: '主单减仓数量百分比不能为空', trigger: 'blur' }],
|
{ validator: this.validatePercentage, trigger: 'blur' }
|
||||||
reduce_take_profit: [{ required: true, message: '主单减仓后止盈价百分比不能为空', trigger: 'blur' }],
|
],
|
||||||
// reduce_stop_price: [{ required: true, message: '主单减仓后止损价不能为空', trigger: 'blur' }],
|
profit: [{ required: true, message: '请输入', trigger: 'blur' },
|
||||||
buy_price: [{ required: true, message: '购买金额不能为空', trigger: 'blur' }],
|
{ validator: this.validateProfit, trigger: 'blur' }],
|
||||||
|
|
||||||
|
stop_loss: [{ required: true, message: '请输入止损', trigger: 'blur' }, { validator: this.validateStopLoss, trigger: 'blur' }],
|
||||||
|
reduce_price: [
|
||||||
|
{ required: true, message: '主单亏损不能为空', trigger: 'blur' },
|
||||||
|
{ validator: this.validateReducePrice, trigger: 'blur' }],
|
||||||
|
reduce_num: [
|
||||||
|
{ required: true, message: '主单减仓数量百分比不能为空', trigger: 'blur' },
|
||||||
|
{ validator: this.validateReduceNum, trigger: 'blur' }],
|
||||||
|
reduce_take_profit: [
|
||||||
|
{ required: true, message: '主单减仓后止盈价百分比不能为空', trigger: 'blur' },
|
||||||
|
{ validator: this.validateReduceTakeProfit, trigger: 'blur' }],
|
||||||
|
reduce_stop_price: [{ required: true, message: '主单减仓后止损价百分比不能为空', trigger: 'blur' }],
|
||||||
|
buy_price: [
|
||||||
|
{ required: true, message: '购买金额不能为空', trigger: 'blur' },
|
||||||
|
{ validator: this.validateBuyPrice, 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' }],
|
||||||
symbol_group_id: [{ required: true, message: '交易对组不能为空', trigger: 'blur' }],
|
symbol_group_id: [{ required: true, message: '交易对组不能为空', trigger: 'blur' }],
|
||||||
quote_symbol: [{ required: true, message: '计较货币不能为空', trigger: 'blur' }],
|
quote_symbol: [{ required: true, message: '计价货币不能为空', trigger: 'blur' }],
|
||||||
order_sn: [{ required: true, message: '订单号不能为空', trigger: 'blur' }]
|
order_sn: [{ required: true, message: '订单号不能为空', trigger: 'blur' }],
|
||||||
|
profit_num_ratio: [
|
||||||
|
{ required: true, message: '止盈数量百分比不能为空', trigger: 'blur' },
|
||||||
|
{ validator: this.validateProfitNumRatio, trigger: 'blur' }
|
||||||
|
],
|
||||||
|
profit_tp_tp_price_ratio: [{ validator: this.validateTptpPriceRatio, trigger: 'blur' }],
|
||||||
|
|
||||||
|
priceRatio: [{ required: true, message: '下跌百分比不能为空', trigger: 'blur' }, { validator: this.validateExtPriceRatio, trigger: 'blur' }],
|
||||||
|
addPositionVal: [
|
||||||
|
{ required: true, message: '追加仓位不能为空', trigger: 'blur' },
|
||||||
|
{ validator: this.validateAddPosition, trigger: 'blur' }],
|
||||||
|
takeProfitRatio: [
|
||||||
|
{ required: true, message: '请输入止盈百分比', trigger: 'blur' },
|
||||||
|
{ type: 'number', message: '止盈百分比必须为数字', trigger: 'blur' },
|
||||||
|
{ min: 0, message: '止盈百分比不能小于 0', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
stopLossRatio: [
|
||||||
|
{ required: true, message: '请输入止损百分比', trigger: 'blur' },
|
||||||
|
{ type: 'number', message: '止损百分比必须为数字', trigger: 'blur' },
|
||||||
|
{ min: 0, message: '止损百分比不能小于 0', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
takeProfitNumRatio: [
|
||||||
|
{ required: true, message: '止盈数量不能为空', trigger: 'blur' },
|
||||||
|
{ validator: this.validateExtTakeProfitNumRatio, trigger: 'blur' }
|
||||||
|
],
|
||||||
|
tpTpPriceRatio: [{ required: true, message: '第二止盈价格百分比不能为空', trigger: 'blur' }],
|
||||||
|
slSlPriceRatio: [{ required: true, message: '第二止损价格百分比不能为空', trigger: 'blur' }],
|
||||||
|
expirateHour: [{ required: true, message: '请输入过期时间(H)', trigger: 'blur' }],
|
||||||
|
api_id_type: [{ required: true, message: '请选择用户类型', trigger: 'blur' }],
|
||||||
|
api_user_group_id: [{ required: true, message: '请选择用户组', trigger: 'blur' }]
|
||||||
},
|
},
|
||||||
inForm: {},
|
inForm: {},
|
||||||
searchLoding: false,
|
searchLoding: false,
|
||||||
@ -656,7 +880,28 @@ export default {
|
|||||||
aicoins: {},
|
aicoins: {},
|
||||||
aicoinPrice: undefined,
|
aicoinPrice: undefined,
|
||||||
ext: [],
|
ext: [],
|
||||||
re_take_profit_ratio: 0
|
re_take_profit_ratio: 0,
|
||||||
|
strategyTemplateOptions: [],
|
||||||
|
// 策略分页数据
|
||||||
|
strategyTemplatePagition: {
|
||||||
|
total: 0,
|
||||||
|
pageIndex: 1,
|
||||||
|
pageSize: 10
|
||||||
|
},
|
||||||
|
reduceStrategyPagition: {
|
||||||
|
total: 0,
|
||||||
|
pageIndex: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
// 减仓策略信息
|
||||||
|
reduceStrategyList: []
|
||||||
|
},
|
||||||
|
strategyTemplateTypeOptions: [{
|
||||||
|
value: 0,
|
||||||
|
label: '无'
|
||||||
|
}, {
|
||||||
|
value: 1,
|
||||||
|
label: '波段涨跌幅'
|
||||||
|
}]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -671,15 +916,51 @@ export default {
|
|||||||
const s = this.comSymbols.find(item => item.symbol === symbol)
|
const s = this.comSymbols.find(item => item.symbol === symbol)
|
||||||
if (s) {
|
if (s) {
|
||||||
const res = ((price - s.lastPrice) / s.lastPrice) * 100
|
const res = ((price - s.lastPrice) / s.lastPrice) * 100
|
||||||
return `${res}%`
|
return `${res.toFixed(2)}%`
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
return 0
|
||||||
|
},
|
||||||
|
/* 计算止盈百分比 */
|
||||||
|
comTakePrice() {
|
||||||
|
// console.log('this.form', this.form)
|
||||||
|
const { profit, price, price_pattern, site } = this.inForm
|
||||||
|
|
||||||
|
if (price_pattern === 'mixture' && Number(price) > 0 && Number(profit) > 0) {
|
||||||
|
let res = 0
|
||||||
|
|
||||||
|
if (site === 'BUY') {
|
||||||
|
res = ((Number(profit) - Number(price)) / Number(price)) * 100
|
||||||
|
} else {
|
||||||
|
res = ((Number(price) - Number(profit)) / Number(price)) * 100
|
||||||
|
}
|
||||||
|
|
||||||
|
return `${res.toFixed(2)}%` // 取绝对值并保留两位小数
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0
|
||||||
|
},
|
||||||
|
/* 计算减仓百分比 */
|
||||||
|
comReducePrice() {
|
||||||
|
const { reduce_price, price, price_pattern, site } = this.inForm
|
||||||
|
|
||||||
|
if (price_pattern === 'mixture' && Number(price) > 0 && Number(reduce_price) > 0) {
|
||||||
|
let res = 0
|
||||||
|
if (site === 'BUY') {
|
||||||
|
res = ((Number(price) - Number(reduce_price)) / Number(price)) * 100
|
||||||
|
} else {
|
||||||
|
res = ((Number(reduce_price) - Number(price)) / Number(price)) * 100
|
||||||
|
}
|
||||||
|
return `${res.toFixed(2)}%` // 取绝对值并保留两位小数
|
||||||
|
}
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList()
|
this.getList()
|
||||||
|
this.queryReduceStrategy()
|
||||||
// this.getLineApiUserItems()
|
// this.getLineApiUserItems()
|
||||||
this.getSymbolGroup()
|
this.getSymbolGroup()
|
||||||
// 获取交易所字典数据
|
// 获取交易所字典数据
|
||||||
@ -688,6 +969,162 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
/** 主单止损价 */
|
||||||
|
validateStopLoss(rule, value, callback) {
|
||||||
|
if (value < 0) {
|
||||||
|
callback(new Error('止损价不能小于0'))
|
||||||
|
} else if (this.inForm.price_pattern !== 'mixture' && value > 100) {
|
||||||
|
callback(new Error('止损价不能大于100'))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
validatePercentage(rule, value, callback) {
|
||||||
|
if (value <= 0 || value === undefined || value === null || value === '') {
|
||||||
|
callback(new Error('百分比必须大于0'))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
validateExtTakeProfitNumRatio(rule, value, callback) {
|
||||||
|
if (value === 0 || value === undefined || value === null || value === '') {
|
||||||
|
callback(new Error('止盈数量百分比必须大于0'))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
validateReducePrice(rule, value, callback) {
|
||||||
|
if (value === 0 || value === undefined || value === null || value === '') {
|
||||||
|
callback(new Error('必须大于0'))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
validateBuyPrice(rule, value, callback) {
|
||||||
|
if (value === 0) {
|
||||||
|
callback(new Error('购买金额必须大于0'))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
validateReduceTakeProfit(rule, value, callback) {
|
||||||
|
if (this.inForm.reduce_num > 0 && this.inForm.reduce_num < 100 && this.inForm.reduce_take_profit === 0) {
|
||||||
|
callback(new Error('主单减仓后止盈必须大于0'))
|
||||||
|
} else if (this.inForm.reduce_num === 100 && this.inForm.reduce_take_profit > 0) {
|
||||||
|
callback(new Error('主单减仓全部后无需止盈'))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 主单减仓数量 */
|
||||||
|
validateReduceNum(rule, value, callback) {
|
||||||
|
if (value <= 0) {
|
||||||
|
callback(new Error('主单减仓数量必须大于0'))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 主单止盈数量 */
|
||||||
|
validateProfitNumRatio(rule, value, callback) {
|
||||||
|
if (value <= 0) {
|
||||||
|
callback(new Error('止盈数量比例必须大于0'))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 验证第二止盈止损 */
|
||||||
|
validateTptpPriceRatio(rule, value, callback) {
|
||||||
|
if (!this.inForm) {
|
||||||
|
callback(new Error('表单未初始化'))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.inForm.profit_num_ratio > 0 && this.inForm.profit_num_ratio < 100 && (!value || value <= 0)) {
|
||||||
|
callback(new Error('第二止盈百分比不能为空且必须大于 0'))
|
||||||
|
} else if (this.inForm.profit_num_ratio === 100 && value > 0) {
|
||||||
|
callback(new Error('第一止盈已经全部止盈了,不需要第二止盈百分比'))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
validateProfit(rule, value, callback) {
|
||||||
|
if (this.inForm.profit === '' || this.inForm.profit === undefined || this.inForm.profit === null) {
|
||||||
|
callback(new Error('不能为空'))
|
||||||
|
} else if (this.inForm.profit <= 0) {
|
||||||
|
callback(new Error('不能小于0'))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
validateExtPriceRatio(rule, value, callback) {
|
||||||
|
const index = rule.fullField.split('.')[1] // 获取索引
|
||||||
|
const item = this.inForm.ext[index]
|
||||||
|
const message = item.addType === 1 ? '加仓下跌百分比' : '减仓下跌百分比'
|
||||||
|
|
||||||
|
if (item.priceRatio === '') {
|
||||||
|
callback(new Error(message + '不能为空'))
|
||||||
|
} else if (isNaN(item.priceRatio)) {
|
||||||
|
callback(new Error('必须输入数字'))
|
||||||
|
} else if (item.priceRatio < 0) {
|
||||||
|
callback(new Error('百分比不能小于 0'))
|
||||||
|
}
|
||||||
|
|
||||||
|
if (index === 0 && Number(item.priceRatio) <= Number(this.inForm.reduce_price)) {
|
||||||
|
callback(new Error('下跌百分比不能小于上一节点'))
|
||||||
|
} else if (index > 0 && Number(item.priceRatio) <= Number(this.inForm.ext[index - 1].priceRatio)) {
|
||||||
|
callback(new Error('下跌百分比不能小于上一节点'))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
validateAddPosition(rule, value, callback) {
|
||||||
|
const index = rule.fullField.split('.')[1] // 获取索引
|
||||||
|
const item = this.inForm.ext[index]
|
||||||
|
const message = item.addType === 1 ? '加仓数值' : '减仓百分比'
|
||||||
|
|
||||||
|
if (item.addPositionVal === '') {
|
||||||
|
callback(new Error(message + '不能为空'))
|
||||||
|
} else if (isNaN(item.addPositionVal)) {
|
||||||
|
callback(new Error('必须输入数字'))
|
||||||
|
} else if (item.addPositionVal <= 0) {
|
||||||
|
callback(new Error(message + '必须大于 0'))
|
||||||
|
} else {
|
||||||
|
callback() // 校验通过
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 自定义校验逻辑
|
||||||
|
validateTakeProfitAndStopLoss(rule, value, callback) {
|
||||||
|
const index = rule.fullField.split('.')[1] // 获取索引
|
||||||
|
const item = this.inForm.ext[index]
|
||||||
|
|
||||||
|
if (item.takeProfitRatio === '' || item.stopLossRatio === '') {
|
||||||
|
callback(new Error('止盈和止损百分比都不能为空'))
|
||||||
|
} else if (isNaN(item.takeProfitRatio) || isNaN(item.stopLossRatio)) {
|
||||||
|
callback(new Error('必须输入数字'))
|
||||||
|
} else if (item.takeProfitRatio < 0 || item.stopLossRatio < 0) {
|
||||||
|
callback(new Error('百分比不能小于 0'))
|
||||||
|
} else if (item.addType === 2 && item.addPositionVal < 100 && item.takeProfitRatio === 0) {
|
||||||
|
callback(new Error('止盈百分比不能为0'))
|
||||||
|
} else {
|
||||||
|
callback() // 校验通过
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 自定义 第二止盈止损校验
|
||||||
|
validateTp(rule, value, callback) {
|
||||||
|
const index = rule.fullField.split('.')[1] // 获取索引
|
||||||
|
const item = this.inForm.ext[index]
|
||||||
|
if (item.tpTpPriceRatio === '' || item.tpSlPriceRatio === '') {
|
||||||
|
callback(new Error('第二止盈、止损百分比不能为空'))
|
||||||
|
} else if (isNaN(item.tpTpPriceRatio) || isNaN(item.tpSlPriceRatio)) {
|
||||||
|
callback(new Error('必须输入数字'))
|
||||||
|
} else if (item.tpTpPriceRatio < 0 || item.tpSlPriceRatio < 0) {
|
||||||
|
callback(new Error('百分比不能小于 0'))
|
||||||
|
} else if (item.takeProfitNumRatio < 100 && item.takeProfitNumRatio > 0 && item.tpTpPriceRatio <= 0) {
|
||||||
|
callback(new Error('第二止盈百分比必须大于0'))
|
||||||
|
} else {
|
||||||
|
callback() // 校验通过
|
||||||
|
}
|
||||||
|
},
|
||||||
onChangeSymbolType() {
|
onChangeSymbolType() {
|
||||||
if (this.inForm.symbol_type === 1) {
|
if (this.inForm.symbol_type === 1) {
|
||||||
this.inForm.cover_type = 0
|
this.inForm.cover_type = 0
|
||||||
@ -736,7 +1173,7 @@ export default {
|
|||||||
this.inForm.ext.splice(index, 1)
|
this.inForm.ext.splice(index, 1)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
console.log('ext', this.inForm.ext)
|
|
||||||
this.inForm.ext.push({
|
this.inForm.ext.push({
|
||||||
// 类型 订单类型 加仓类型 加仓数值 价格百分比 止盈百分比 止损百分比
|
// 类型 订单类型 加仓类型 加仓数值 价格百分比 止盈百分比 止损百分比
|
||||||
addType: type === 0 ? 1 : 2,
|
addType: type === 0 ? 1 : 2,
|
||||||
@ -747,20 +1184,10 @@ export default {
|
|||||||
takeProfitRatio: 0,
|
takeProfitRatio: 0,
|
||||||
stopLossRatio: 0,
|
stopLossRatio: 0,
|
||||||
// 止盈数量百分比 止盈后止盈价格百分比 止盈后止损价格百分比
|
// 止盈数量百分比 止盈后止盈价格百分比 止盈后止损价格百分比
|
||||||
takeProfitNumRatio: 0,
|
takeProfitNumRatio: 100,
|
||||||
tpTpPriceRatio: 0,
|
tpTpPriceRatio: 0,
|
||||||
tpSlPriceRatio: 0
|
tpSlPriceRatio: 0,
|
||||||
|
expirateHour: 0
|
||||||
// reducePriceRatio: undefined,
|
|
||||||
// reduceNumRatio: undefined,
|
|
||||||
// reduceTakeProfitRatio: undefined,
|
|
||||||
// reduceStopLossRatio: undefined,
|
|
||||||
|
|
||||||
// takeProfitRatio: undefined,
|
|
||||||
// addPositionPriceRatio: undefined,
|
|
||||||
// addPositionOrderType: 'LIMIT',
|
|
||||||
// addPositionType: 1,
|
|
||||||
// addPositionVal: undefined
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onchangeForm() {
|
onchangeForm() {
|
||||||
@ -777,11 +1204,17 @@ export default {
|
|||||||
},
|
},
|
||||||
// 获取杠杆api用户
|
// 获取杠杆api用户
|
||||||
getListLineApiUser(exchangeType) {
|
getListLineApiUser(exchangeType) {
|
||||||
listLineApiUser({ pageIndex: 1, pageSize: 999, exchangeType: exchangeType || this.inForm.exchange_type }).then(response => {
|
listLineApiUser({ pageIndex: 1, pageSize: 999, exchangeType: exchangeType || this.inForm.exchange_type, openStatus: 1 }).then(response => {
|
||||||
this.lineUsers = response.data.list
|
this.lineUsers = response.data.list
|
||||||
this.lineTotal = response.data.count
|
this.lineTotal = response.data.count
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 获取api用户分组
|
||||||
|
getApiUserGroupList(exchangeType) {
|
||||||
|
getLineApiUserGroupList({ exchangeType: exchangeType || this.inForm.exchange_type }).then(response => {
|
||||||
|
this.apiUserGroupList = response.data
|
||||||
|
})
|
||||||
|
},
|
||||||
// 交易对列表
|
// 交易对列表
|
||||||
getSymbol(e, type, exchangeType) {
|
getSymbol(e, type, exchangeType) {
|
||||||
this.searchLoding = true
|
this.searchLoding = true
|
||||||
@ -812,7 +1245,7 @@ export default {
|
|||||||
res = (1 + (this.percenter / 100)) * Number(this.inForm.price)
|
res = (1 + (this.percenter / 100)) * Number(this.inForm.price)
|
||||||
}
|
}
|
||||||
const [num, decimal] = String(res).split('.')
|
const [num, decimal] = String(res).split('.')
|
||||||
console.log(num, decimal, '?')
|
// console.log(num, decimal, '?')
|
||||||
if (decimal) {
|
if (decimal) {
|
||||||
this.inForm.price = decimal.length > 4 ? `${num}.${decimal.substring(0, 4)}` : res
|
this.inForm.price = decimal.length > 4 ? `${num}.${decimal.substring(0, 4)}` : res
|
||||||
} else {
|
} else {
|
||||||
@ -840,6 +1273,27 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
/* 切换用户选择 */
|
||||||
|
apiIdTypeChange() {
|
||||||
|
this.inForm.api_id = undefined
|
||||||
|
this.inForm.api_user_group_id = undefined
|
||||||
|
},
|
||||||
|
/* 用户分组选中 */
|
||||||
|
apiUserGroupChange(selection) {
|
||||||
|
console.log(selection)
|
||||||
|
if (selection) {
|
||||||
|
// 过滤出匹配的项
|
||||||
|
const matchedGroup = this.apiUserGroupList.find(x => x.id === selection)
|
||||||
|
|
||||||
|
console.log(matchedGroup)
|
||||||
|
// 确保 matchedGroup 存在,并且有 value 数组
|
||||||
|
if (matchedGroup && matchedGroup.value) {
|
||||||
|
this.inForm.api_id = matchedGroup.value // 转字符串
|
||||||
|
} else {
|
||||||
|
this.inForm.api_id = undefined // 处理未找到的情况
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
this.open = false
|
this.open = false
|
||||||
@ -854,7 +1308,8 @@ export default {
|
|||||||
userId: undefined,
|
userId: undefined,
|
||||||
params: undefined,
|
params: undefined,
|
||||||
type: 1,
|
type: 1,
|
||||||
switch: '0'
|
switch: '0',
|
||||||
|
ext: []
|
||||||
}
|
}
|
||||||
this.resetForm('form')
|
this.resetForm('form')
|
||||||
},
|
},
|
||||||
@ -873,6 +1328,36 @@ export default {
|
|||||||
this.userIdOptions = this.setItems(res, 'id', 'apiName')
|
this.userIdOptions = this.setItems(res, 'id', 'apiName')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
changeStrategyTemplateType(val) {
|
||||||
|
if (val === 1) {
|
||||||
|
this.queryStrategyTemplate()
|
||||||
|
} else {
|
||||||
|
this.form.strategy_template_id = undefined
|
||||||
|
}
|
||||||
|
},
|
||||||
|
queryStrategyTemplate() {
|
||||||
|
this.searchLoding = true
|
||||||
|
|
||||||
|
listLineStrategyTemplate({ pageIndex: this.strategyTemplatePagition.pageIndex, pageSize: this.strategyTemplatePagition.pageSize }).then(res => {
|
||||||
|
this.strategyTemplatePagition.total = res.data.count
|
||||||
|
this.strategyTemplateOptions = res.data.list
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.searchLoding = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 查询减仓策略
|
||||||
|
queryReduceStrategy() {
|
||||||
|
this.searchLoding = true
|
||||||
|
listLineReduceStrategy({ pageIndex: this.reduceStrategyPagition.pageIndex, pageSize: this.reduceStrategyPagition.pageSize }).then(res => {
|
||||||
|
this.reduceStrategyPagition.reduceStrategyList = res.data.list
|
||||||
|
this.reduceStrategyPagition.total = res.data.count
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.searchLoding = false
|
||||||
|
})
|
||||||
|
},
|
||||||
// 文件
|
// 文件
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
@ -898,8 +1383,7 @@ export default {
|
|||||||
this.single = selection.length !== 1
|
this.single = selection.length !== 1
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
handleCopy(row) {
|
||||||
handleUpdate(row) {
|
|
||||||
this.reset()
|
this.reset()
|
||||||
this.ext = []
|
this.ext = []
|
||||||
const id =
|
const id =
|
||||||
@ -915,6 +1399,41 @@ export default {
|
|||||||
this.form.type === 1 && this.onCalculate()
|
this.form.type === 1 && this.onCalculate()
|
||||||
// 获取交易对用于计算
|
// 获取交易对用于计算
|
||||||
this.getSymbol(this.inForm.symbol)
|
this.getSymbol(this.inForm.symbol)
|
||||||
|
this.form.id = undefined
|
||||||
|
this.open = true
|
||||||
|
this.title = '添加委托下单模板'
|
||||||
|
this.isEdit = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset()
|
||||||
|
this.ext = []
|
||||||
|
const id =
|
||||||
|
row.id || this.ids
|
||||||
|
|
||||||
|
getLineOrderTemplateLogs(id).then(response => {
|
||||||
|
this.form = response.data
|
||||||
|
const x = JSON.parse(response.data.params)
|
||||||
|
this.inForm = {
|
||||||
|
...x,
|
||||||
|
api_id: x.api_id.split(','),
|
||||||
|
api_id_type: x.api_id_type ? x.api_id_type : 1,
|
||||||
|
api_user_group_id: x.api_user_group_id ? x.api_user_group_id : undefined,
|
||||||
|
symbol_group_id: x.symbol_group_id ? Number(x.symbol_group_id) : undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.inForm.price_pattern === 'aicoin') {
|
||||||
|
this.inForm.price = null
|
||||||
|
}
|
||||||
|
|
||||||
|
this.getApiUserGroupList()
|
||||||
|
this.onchangePattern(false)
|
||||||
|
this.getListLineApiUser()
|
||||||
|
this.form.type === 2 && this.getSymbolGroup(this.inForm.symbol_type)
|
||||||
|
this.form.type === 1 && this.onCalculate()
|
||||||
|
// 获取交易对用于计算
|
||||||
|
this.getSymbol(this.inForm.symbol)
|
||||||
this.open = true
|
this.open = true
|
||||||
this.title = '修改委托下单模板'
|
this.title = '修改委托下单模板'
|
||||||
this.isEdit = true
|
this.isEdit = true
|
||||||
@ -922,12 +1441,18 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm: function() {
|
submitForm: function() {
|
||||||
this.$refs['form'].validate(valid => {
|
Promise.all([
|
||||||
if (valid) {
|
this.$refs['inForm'].validate(), // 验证第一个表单
|
||||||
|
this.$refs['extForm'].validate() // 验证第二个表单
|
||||||
|
])
|
||||||
|
.then((formValid) => {
|
||||||
|
if (formValid.every(valid => valid)) {
|
||||||
this.inForm.price = this.inForm.price ? String(this.inForm.price) : ''
|
this.inForm.price = this.inForm.price ? String(this.inForm.price) : ''
|
||||||
if (this.form.id !== undefined) {
|
|
||||||
this.$refs['inForm'].validate(valided => {
|
if (this.inForm.api_user_group_id && this.inForm.api_id_type === 2) {
|
||||||
if (!valided) return false
|
this.apiUserGroupChange(this.inForm.api_user_group_id)
|
||||||
|
}
|
||||||
|
|
||||||
const params = JSON.stringify({
|
const params = JSON.stringify({
|
||||||
...this.inForm,
|
...this.inForm,
|
||||||
reduce_price: this.inForm.reduce_price || 0,
|
reduce_price: this.inForm.reduce_price || 0,
|
||||||
@ -947,10 +1472,14 @@ export default {
|
|||||||
stopLossRatio: item.stopLossRatio || 0,
|
stopLossRatio: item.stopLossRatio || 0,
|
||||||
takeProfitNumRatio: item.takeProfitNumRatio || 0,
|
takeProfitNumRatio: item.takeProfitNumRatio || 0,
|
||||||
tpTpPriceRatio: item.tpTpPriceRatio || 0,
|
tpTpPriceRatio: item.tpTpPriceRatio || 0,
|
||||||
tpSlPriceRatio: item.tpSlPriceRatio || 0
|
tpSlPriceRatio: item.tpSlPriceRatio || 0,
|
||||||
|
expirateHour: item.expirateHour || 0
|
||||||
}))
|
}))
|
||||||
: []
|
: []
|
||||||
})
|
})
|
||||||
|
if (this.form.id !== undefined) {
|
||||||
|
this.$refs['inForm'].validate(valided => {
|
||||||
|
if (!valided) return false
|
||||||
|
|
||||||
updateLineOrderTemplateLogs({ ...this.form, params }).then(response => {
|
updateLineOrderTemplateLogs({ ...this.form, params }).then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
@ -963,7 +1492,7 @@ export default {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
addLineOrderTemplateLogs({ ...this.inForm, symbol_group_id: String(this.inForm.symbol_group_id), api_id: this.inForm.api_id.toString() }).then(response => {
|
addLineOrderTemplateLogs({ ...this.form, params }).then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.msgSuccess(response.msg)
|
this.msgSuccess(response.msg)
|
||||||
this.open = false
|
this.open = false
|
||||||
@ -1007,9 +1536,17 @@ export default {
|
|||||||
return quickAddPreOrder({ ids: Ids.toString() })
|
return quickAddPreOrder({ ids: Ids.toString() })
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
|
if (response.data !== '') {
|
||||||
|
this.$notify({
|
||||||
|
title: '部分失败',
|
||||||
|
message: response.data,
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.msgSuccess(response.msg)
|
||||||
|
}
|
||||||
this.ids = []
|
this.ids = []
|
||||||
this.$refs.table?.clearSelection()
|
this.$refs.table?.clearSelection()
|
||||||
this.msgSuccess(response.msg)
|
|
||||||
} else {
|
} else {
|
||||||
this.msgError(response.msg)
|
this.msgError(response.msg)
|
||||||
}
|
}
|
||||||
@ -1033,6 +1570,20 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
::v-deep.ext-form-item {
|
||||||
|
.el-form-item__label {
|
||||||
|
padding: 0px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form--label-top .el-form-item__label {
|
||||||
|
padding: 0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ext-form .el-form-item__content .el-input-group {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
.page {
|
.page {
|
||||||
.pagination-container {
|
.pagination-container {
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
|
|||||||
@ -98,10 +98,29 @@
|
|||||||
v-model="queryParams.status"
|
v-model="queryParams.status"
|
||||||
placeholder="请选择状态"
|
placeholder="请选择状态"
|
||||||
size="small"
|
size="small"
|
||||||
|
clearable
|
||||||
>
|
>
|
||||||
<el-option v-for="dict in statuss" :key="dict.k" :label="dict.l" :value="dict.v" />
|
<el-option v-for="dict in statuss" :key="dict.k" :label="dict.l" :value="dict.v" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="下单百分比">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.percentStart"
|
||||||
|
placeholder="下单百分比"
|
||||||
|
style="width: 100px;"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
/>
|
||||||
|
-
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.percentEnd"
|
||||||
|
placeholder="下单百分比"
|
||||||
|
style="width: 100px;"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
@ -964,7 +983,9 @@ export default {
|
|||||||
idOrder: 'desc',
|
idOrder: 'desc',
|
||||||
addPositionStatus: -1,
|
addPositionStatus: -1,
|
||||||
hedgeStatus: -1,
|
hedgeStatus: -1,
|
||||||
status: ''
|
status: '',
|
||||||
|
percentStart: undefined,
|
||||||
|
percentEnd: undefined
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {
|
form: {
|
||||||
|
|||||||
@ -365,10 +365,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { resetForm } from '@/utils/costum';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "AddPosition",
|
name: 'AddPosition',
|
||||||
props: {
|
props: {
|
||||||
open: {
|
open: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@ -377,7 +376,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
form:{},
|
form: {},
|
||||||
options: [
|
options: [
|
||||||
{ label: '买入点1', value: 'buyPoint1' },
|
{ label: '买入点1', value: 'buyPoint1' },
|
||||||
{ label: '买入点2', value: 'buyPoint2' },
|
{ label: '买入点2', value: 'buyPoint2' },
|
||||||
@ -389,38 +388,38 @@ export default {
|
|||||||
buyer: [
|
buyer: [
|
||||||
{ v: 'BUY', l: '买(多)' },
|
{ v: 'BUY', l: '买(多)' },
|
||||||
{ v: 'SELL', l: '卖(空)' }
|
{ v: 'SELL', l: '卖(空)' }
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
resetForm(){
|
resetForm() {
|
||||||
this.form={
|
this.form = {
|
||||||
id:null,
|
id: null,
|
||||||
exchangeType:"",
|
exchangeType: '',
|
||||||
orderType:1,
|
orderType: 1,
|
||||||
symbol:"",
|
symbol: '',
|
||||||
apiId:null,
|
apiId: null,
|
||||||
site:'',
|
site: '',
|
||||||
buyPrice:null,
|
buyPrice: null,
|
||||||
pricePattern:'',
|
pricePattern: '',
|
||||||
price:null,
|
price: null,
|
||||||
profit:null,
|
profit: null,
|
||||||
addPositionOrderType:'LIMIT',
|
addPositionOrderType: 'LIMIT',
|
||||||
priceType:null,
|
priceType: null,
|
||||||
reTakeProfitRatio:null,
|
reTakeProfitRatio: null,
|
||||||
reducePriceRatio:null,
|
reducePriceRatio: null,
|
||||||
reduceNumRatio:null,
|
reduceNumRatio: null,
|
||||||
reduceTakeProfitRatio:null,
|
reduceTakeProfitRatio: null,
|
||||||
reduceStopLossRatio:null,
|
reduceStopLossRatio: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//提交
|
// 提交
|
||||||
submitForm() {
|
submitForm() {
|
||||||
|
|
||||||
},
|
},
|
||||||
//取消
|
// 取消
|
||||||
cancel() {
|
cancel() {
|
||||||
this.$emit("update:open", false)
|
this.$emit('update:open', false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
448
src/views/admin/line-reduce-strategy/index.vue
Normal file
448
src/views/admin/line-reduce-strategy/index.vue
Normal file
@ -0,0 +1,448 @@
|
|||||||
|
<template>
|
||||||
|
<BasicLayout>
|
||||||
|
<template #wrapper>
|
||||||
|
<el-card class="box-card">
|
||||||
|
<el-form ref="queryForm" :model="queryParams" :inline="true" label-width="68px">
|
||||||
|
<el-form-item label="策略名称" prop="name"><el-input
|
||||||
|
v-model="queryParams.name"
|
||||||
|
placeholder="请输入策略名称"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-select v-model="queryParams.status" size="mini" placeholder="请选择订单类型" clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="(item2, index2) in statusOptions"
|
||||||
|
:key="'queryStatus.' + index2"
|
||||||
|
:label="item2.label"
|
||||||
|
:value="item2.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
v-permisaction="['admin:lineReduceStrategy:add']"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
>新增
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
v-permisaction="['admin:lineReduceStrategy:edit']"
|
||||||
|
type="success"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
>修改
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
v-permisaction="['admin:lineReduceStrategy:remove']"
|
||||||
|
type="danger"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
>删除
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="lineReduceStrategyList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="策略名称" align="center" prop="name" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ statusFormat(scope.row.status) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createdAt"
|
||||||
|
width="150"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
>
|
||||||
|
<template #default="{ row }">{{ parseTime(row.createdAt) }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-popconfirm
|
||||||
|
class="delete-popconfirm"
|
||||||
|
title="确认要修改吗?"
|
||||||
|
confirm-button-text="修改"
|
||||||
|
@confirm="handleUpdate(scope.row)"
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
slot="reference"
|
||||||
|
v-permisaction="['admin:lineReduceStrategy:edit']"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
>修改
|
||||||
|
</el-button>
|
||||||
|
</el-popconfirm>
|
||||||
|
<el-popconfirm
|
||||||
|
class="delete-popconfirm"
|
||||||
|
title="确认要删除吗?"
|
||||||
|
confirm-button-text="删除"
|
||||||
|
@confirm="handleDelete(scope.row)"
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
slot="reference"
|
||||||
|
v-permisaction="['admin:lineReduceStrategy:remove']"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
>删除
|
||||||
|
</el-button>
|
||||||
|
</el-popconfirm>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageIndex"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 添加或修改对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="800px">
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="策略名称" prop="name">
|
||||||
|
<el-input v-model="form.name" placeholder="减仓策略名称" show-word-limit maxlength="50" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-radio-group v-model="form.status">
|
||||||
|
<el-radio v-for="dict in statusOptions" :key="dict.value" :label="dict.value">{{
|
||||||
|
dict.label
|
||||||
|
}}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="4"><el-form-item label="减仓配置" /></el-col>
|
||||||
|
<el-col :span="2"><el-button
|
||||||
|
type="primary"
|
||||||
|
size="mini"
|
||||||
|
@click="onAddItem"
|
||||||
|
>新增减仓</el-button></el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row
|
||||||
|
v-for="(item, index) in form.items"
|
||||||
|
:key="'item_' + index"
|
||||||
|
style="margin-top: 10px;"
|
||||||
|
:gutter="20"
|
||||||
|
>
|
||||||
|
<!-- <el-card shadow="hover"> -->
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item
|
||||||
|
label="亏损比例"
|
||||||
|
:prop="'items.' + index + '.lossPercent'"
|
||||||
|
:rules="rules.lossPercent"
|
||||||
|
>
|
||||||
|
<el-input v-model="item.lossPercent" size="mini" placeholder="请输入亏损比例" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="减仓比例" :prop="'items.' + index + '.quantityPercent'" :rules="rules.quantityPercent">
|
||||||
|
<el-input v-model="item.quantityPercent" size="mini" placeholder="请输入减仓数量比例" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item
|
||||||
|
label="订单类型"
|
||||||
|
:prop="'items.' + index + '.orderType'"
|
||||||
|
:rules="rules.orderType"
|
||||||
|
>
|
||||||
|
<el-select v-model="item.orderType" size="mini" placeholder="请选择订单类型">
|
||||||
|
<el-option
|
||||||
|
v-for="(item2, index2) in orderTypeOptions"
|
||||||
|
:key="index + '.orderType.' + index2"
|
||||||
|
:label="item2.label"
|
||||||
|
:value="item2.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<!-- <el-form-item> -->
|
||||||
|
<!-- </el-form-item> -->
|
||||||
|
<el-col :span="4" style="height: 36px; line-height: 36px;"><el-button
|
||||||
|
size="mini"
|
||||||
|
type="danger"
|
||||||
|
@click="removeItem(index)"
|
||||||
|
>删除</el-button></el-col>
|
||||||
|
<!-- </el-card> -->
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</el-card>
|
||||||
|
</template>
|
||||||
|
</BasicLayout>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { addLineReduceStrategy, delLineReduceStrategy, getLineReduceStrategy, listLineReduceStrategy, updateLineReduceStrategy } from '@/api/admin/line-reduce-strategy'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'LineReduceStrategy',
|
||||||
|
components: {
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 弹出层标题
|
||||||
|
title: '',
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
isEdit: false,
|
||||||
|
// 类型数据字典
|
||||||
|
typeOptions: [],
|
||||||
|
lineReduceStrategyList: [],
|
||||||
|
orderTypeOptions: [{
|
||||||
|
value: 'LIMIT',
|
||||||
|
label: '限价'
|
||||||
|
}, {
|
||||||
|
value: 'MARKET',
|
||||||
|
label: '市价'
|
||||||
|
}],
|
||||||
|
statusOptions: [{
|
||||||
|
value: 1,
|
||||||
|
label: '启用'
|
||||||
|
}, {
|
||||||
|
value: 2,
|
||||||
|
label: '禁用'
|
||||||
|
}],
|
||||||
|
// 关系表类型
|
||||||
|
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageIndex: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
name: undefined,
|
||||||
|
status: undefined,
|
||||||
|
idOrder: 'desc'
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {
|
||||||
|
},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
name: [{ required: true, message: '减仓策略名称不能为空', trigger: 'blur' }],
|
||||||
|
status: [{ required: true, message: '状态 1-启用 2-禁用不能为空', trigger: 'blur' }],
|
||||||
|
lossPercent: [{ required: true, message: '亏损百分比不能为空', trigger: 'blur' },
|
||||||
|
{ validator: this.validateOrderType, trigger: 'blur' }],
|
||||||
|
orderType: [{ required: true, message: '订单类型不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
quantityPercent: [{ required: true, message: '减仓数量百分比不能为空', trigger: 'blur' },
|
||||||
|
{ validator: this.validateQuantityPercent, trigger: 'blur' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 校验节点百分比
|
||||||
|
validateOrderType(rule, value, callback) {
|
||||||
|
const index = rule.fullField.split('.')[1] // 获取索引
|
||||||
|
const item = this.form.items[index]
|
||||||
|
|
||||||
|
if (value === '') {
|
||||||
|
callback(new Error('不能为空'))
|
||||||
|
} else if (isNaN(value)) {
|
||||||
|
callback(new Error('必须输入数字'))
|
||||||
|
} else if (value < 0) {
|
||||||
|
callback(new Error('百分比不能小于 0'))
|
||||||
|
}
|
||||||
|
|
||||||
|
if (index > 0 && item.lossPercent <= this.form.items[index - 1].lossPercent) {
|
||||||
|
callback(new Error('亏损百分比不能小于上一节点'))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
validateQuantityPercent(rule, value, callback) {
|
||||||
|
// const index = rule.fullField.split('.')[1] // 获取索引
|
||||||
|
|
||||||
|
if (value === '') {
|
||||||
|
callback(new Error('不能为空'))
|
||||||
|
} else if (isNaN(value)) {
|
||||||
|
callback(new Error('必须输入数字'))
|
||||||
|
} else if (value < 0) {
|
||||||
|
callback(new Error('百分比不能小于 0'))
|
||||||
|
} else if (value > 100) {
|
||||||
|
callback(new Error('百分比不能大于 100'))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 查询参数列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true
|
||||||
|
listLineReduceStrategy(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||||
|
this.lineReduceStrategyList = response.data.list
|
||||||
|
this.total = response.data.count
|
||||||
|
this.loading = false
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
statusFormat(status) {
|
||||||
|
const op = this.statusOptions.find(x => x.value === status)
|
||||||
|
|
||||||
|
if (op) {
|
||||||
|
return op.label
|
||||||
|
}
|
||||||
|
|
||||||
|
return ''
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false
|
||||||
|
this.reset()
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
|
||||||
|
id: undefined,
|
||||||
|
name: undefined,
|
||||||
|
status: 1,
|
||||||
|
items: []
|
||||||
|
}
|
||||||
|
this.resetForm('form')
|
||||||
|
},
|
||||||
|
getImgList: function() {
|
||||||
|
this.form[this.fileIndex] = this.$refs['fileChoose'].resultList[0].fullUrl
|
||||||
|
},
|
||||||
|
fileClose: function() {
|
||||||
|
this.fileOpen = false
|
||||||
|
},
|
||||||
|
// 关系
|
||||||
|
// 文件
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageIndex = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.dateRange = []
|
||||||
|
this.resetForm('queryForm')
|
||||||
|
this.handleQuery()
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset()
|
||||||
|
this.open = true
|
||||||
|
this.title = '添加减仓策略'
|
||||||
|
this.isEdit = false
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length !== 1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset()
|
||||||
|
const id =
|
||||||
|
row.id || this.ids
|
||||||
|
getLineReduceStrategy(id).then(response => {
|
||||||
|
this.form = response.data
|
||||||
|
this.open = true
|
||||||
|
this.title = '修改减仓策略'
|
||||||
|
this.isEdit = true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm: function() {
|
||||||
|
this.$refs['form'].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id !== undefined) {
|
||||||
|
updateLineReduceStrategy(this.form).then(response => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.msgSuccess(response.msg)
|
||||||
|
this.open = false
|
||||||
|
this.getList()
|
||||||
|
} else {
|
||||||
|
this.msgError(response.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
addLineReduceStrategy(this.form).then(response => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.msgSuccess(response.msg)
|
||||||
|
this.open = false
|
||||||
|
this.getList()
|
||||||
|
} else {
|
||||||
|
this.msgError(response.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
var Ids = (row.id && [row.id]) || this.ids
|
||||||
|
|
||||||
|
this.$confirm('是否确认删除编号为"' + Ids + '"的数据项?', '警告', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(function() {
|
||||||
|
return delLineReduceStrategy({ 'ids': Ids })
|
||||||
|
}).then((response) => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.msgSuccess(response.msg)
|
||||||
|
this.open = false
|
||||||
|
this.getList()
|
||||||
|
} else {
|
||||||
|
this.msgError(response.msg)
|
||||||
|
}
|
||||||
|
}).catch(function() {
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onAddItem() {
|
||||||
|
this.form.items.push({ lossPercent: undefined, orderType: 'LIMIT' })
|
||||||
|
},
|
||||||
|
removeItem(index) {
|
||||||
|
this.form.items.splice(index, 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
416
src/views/admin/line-strategy-template/index.vue
Normal file
416
src/views/admin/line-strategy-template/index.vue
Normal file
@ -0,0 +1,416 @@
|
|||||||
|
<template>
|
||||||
|
<BasicLayout>
|
||||||
|
<template #wrapper>
|
||||||
|
<el-card class="box-card">
|
||||||
|
<el-form ref="queryForm" :model="queryParams" :inline="true" label-width="68px">
|
||||||
|
<el-form-item label="涨跌方向" prop="direction">
|
||||||
|
<el-select v-model="queryParams.direction" placeholder="请选择涨跌方向" clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="item in directionOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="比较类型" prop="compareType">
|
||||||
|
<el-select v-model="queryParams.compareType" placeholder="请选择比较类型" clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="item in compareTypeOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.description"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="策略名称" prop="name" />
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
v-permisaction="['admin:lineStrategyTemplate:add']"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
>新增
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
v-permisaction="['admin:lineStrategyTemplate:edit']"
|
||||||
|
type="success"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
>修改
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
v-permisaction="['admin:lineStrategyTemplate:remove']"
|
||||||
|
type="danger"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
>删除
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="lineStrategyTemplateList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="策略名称" align="center" prop="name" />
|
||||||
|
<el-table-column label="涨跌方向" align="center" prop="direction" :show-overflow-tooltip="true">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ directionFormat(scope.row.direction) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="涨跌点数" align="center" prop="percentag" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="比较类型" align="center" prop="compareType" :show-overflow-tooltip="true">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ compareTypeFormat(scope.row.compareType) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="时间段(分)"
|
||||||
|
align="center"
|
||||||
|
prop="timeSlotStart"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
<!-- <el-table-column label="时间断截至(分)" align="center" prop="timeSlotEnd" :show-overflow-tooltip="true" /> -->
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createdAt"
|
||||||
|
width="150"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
>
|
||||||
|
<template #default="{ row }">{{ parseTime(row.createdAt) }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-popconfirm
|
||||||
|
class="delete-popconfirm"
|
||||||
|
title="确认要修改吗?"
|
||||||
|
confirm-button-text="修改"
|
||||||
|
@confirm="handleUpdate(scope.row)"
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
slot="reference"
|
||||||
|
v-permisaction="['admin:lineStrategyTemplate:edit']"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
>修改
|
||||||
|
</el-button>
|
||||||
|
</el-popconfirm>
|
||||||
|
<el-popconfirm
|
||||||
|
class="delete-popconfirm"
|
||||||
|
title="确认要删除吗?"
|
||||||
|
confirm-button-text="删除"
|
||||||
|
@confirm="handleDelete(scope.row)"
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
slot="reference"
|
||||||
|
v-permisaction="['admin:lineStrategyTemplate:remove']"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
>删除
|
||||||
|
</el-button>
|
||||||
|
</el-popconfirm>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageIndex"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 添加或修改对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="500px">
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||||
|
<el-form-item label="策略名称" prop="name">
|
||||||
|
<el-input v-model="form.name" placeholder="策略名称" maxlength="50" show-word-limit />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="涨跌方向" prop="direction">
|
||||||
|
<el-radio-group v-model="form.direction">
|
||||||
|
<el-radio v-for="dict in directionOptions" :key="dict.value" :label="dict.value">{{
|
||||||
|
dict.label
|
||||||
|
}}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="涨跌点数" prop="percentag">
|
||||||
|
<el-input v-model="form.percentag" placeholder="涨跌点数" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="比较类型" prop="compareType">
|
||||||
|
<el-select v-model="form.compareType" placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in compareTypeOptions"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="时间段(分)" prop="timeSlotStart">
|
||||||
|
<el-input v-model.number="form.timeSlotStart" placeholder="时间段(分)" />
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="时间断截至(分)" prop="timeSlotEnd">
|
||||||
|
<el-input v-model.number="form.timeSlotEnd" placeholder="时间断截至(分)" />
|
||||||
|
</el-form-item> -->
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</el-card>
|
||||||
|
</template>
|
||||||
|
</BasicLayout>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { addLineStrategyTemplate, delLineStrategyTemplate, getLineStrategyTemplate, listLineStrategyTemplate, updateLineStrategyTemplate } from '@/api/admin/line-strategy-template'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'LineStrategyTemplate',
|
||||||
|
components: {
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 弹出层标题
|
||||||
|
title: '',
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
isEdit: false,
|
||||||
|
// 类型数据字典
|
||||||
|
typeOptions: [],
|
||||||
|
lineStrategyTemplateList: [],
|
||||||
|
|
||||||
|
// 关系表类型
|
||||||
|
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageIndex: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
direction: undefined,
|
||||||
|
percentag: undefined,
|
||||||
|
compareType: undefined,
|
||||||
|
idOrder: 'desc'
|
||||||
|
},
|
||||||
|
directionOptions: [
|
||||||
|
{
|
||||||
|
value: 1,
|
||||||
|
label: '涨'
|
||||||
|
}, {
|
||||||
|
value: 2,
|
||||||
|
label: '跌'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
compareTypeOptions: [{
|
||||||
|
value: 1,
|
||||||
|
label: '>',
|
||||||
|
description: '大于'
|
||||||
|
}, {
|
||||||
|
value: 2,
|
||||||
|
label: '>=',
|
||||||
|
description: '大于等于'
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// value: 3,
|
||||||
|
// label: '<',
|
||||||
|
// description: '小于'
|
||||||
|
// }, {
|
||||||
|
// value: 4,
|
||||||
|
// label: '<=',
|
||||||
|
// description: '小于等于'
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
value: 5,
|
||||||
|
label: '=',
|
||||||
|
description: '等于'
|
||||||
|
}],
|
||||||
|
// 表单参数
|
||||||
|
form: {
|
||||||
|
},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
direction: [{ required: true, message: '涨跌方向不能为空', trigger: 'blur' }],
|
||||||
|
compareType: [{ required: true, message: '比较类型不能为空', trigger: 'blur' }],
|
||||||
|
percentag: [{ required: true, message: '涨跌点数不能为空', trigger: 'blur' }],
|
||||||
|
timeSlotStart: [{ required: true, message: '时间段开始', trigger: 'blur' }],
|
||||||
|
timeSlotEnd: [{ required: true, message: '时间段截至', trigger: 'blur' }],
|
||||||
|
name: [{ required: true, message: '策略名称不能为空', trigger: 'blur' }]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
compareTypeFormat(compareType) {
|
||||||
|
const op = this.compareTypeOptions.find(x => x.value === compareType)
|
||||||
|
|
||||||
|
if (op && op.description) {
|
||||||
|
return op.description
|
||||||
|
}
|
||||||
|
},
|
||||||
|
directionFormat(direction) {
|
||||||
|
const op = this.directionOptions.find(x => x.value === direction)
|
||||||
|
|
||||||
|
if (op && op.label) {
|
||||||
|
return op.label
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 查询参数列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true
|
||||||
|
listLineStrategyTemplate(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||||
|
this.lineStrategyTemplateList = response.data.list
|
||||||
|
this.total = response.data.count
|
||||||
|
this.loading = false
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false
|
||||||
|
this.reset()
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
|
||||||
|
id: undefined,
|
||||||
|
direction: 1,
|
||||||
|
percentag: undefined,
|
||||||
|
compareType: undefined,
|
||||||
|
timeSlotStart: undefined,
|
||||||
|
timeSlotEnd: undefined
|
||||||
|
}
|
||||||
|
this.resetForm('form')
|
||||||
|
},
|
||||||
|
getImgList: function() {
|
||||||
|
this.form[this.fileIndex] = this.$refs['fileChoose'].resultList[0].fullUrl
|
||||||
|
},
|
||||||
|
fileClose: function() {
|
||||||
|
this.fileOpen = false
|
||||||
|
},
|
||||||
|
// 关系
|
||||||
|
// 文件
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageIndex = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.dateRange = []
|
||||||
|
this.resetForm('queryForm')
|
||||||
|
this.handleQuery()
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset()
|
||||||
|
this.open = true
|
||||||
|
this.title = '添加波段策略'
|
||||||
|
this.isEdit = false
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length !== 1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset()
|
||||||
|
const id =
|
||||||
|
row.id || this.ids
|
||||||
|
getLineStrategyTemplate(id).then(response => {
|
||||||
|
this.form = response.data
|
||||||
|
this.open = true
|
||||||
|
this.title = '修改波段策略'
|
||||||
|
this.isEdit = true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm: function() {
|
||||||
|
this.$refs['form'].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id !== undefined) {
|
||||||
|
updateLineStrategyTemplate(this.form).then(response => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.msgSuccess(response.msg)
|
||||||
|
this.open = false
|
||||||
|
this.getList()
|
||||||
|
} else {
|
||||||
|
this.msgError(response.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
addLineStrategyTemplate(this.form).then(response => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.msgSuccess(response.msg)
|
||||||
|
this.open = false
|
||||||
|
this.getList()
|
||||||
|
} else {
|
||||||
|
this.msgError(response.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
var Ids = (row.id && [row.id]) || this.ids
|
||||||
|
|
||||||
|
this.$confirm('是否确认删除编号为"' + Ids + '"的数据项?', '警告', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(function() {
|
||||||
|
return delLineStrategyTemplate({ 'ids': Ids })
|
||||||
|
}).then((response) => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.msgSuccess(response.msg)
|
||||||
|
this.open = false
|
||||||
|
this.getList()
|
||||||
|
} else {
|
||||||
|
this.msgError(response.msg)
|
||||||
|
}
|
||||||
|
}).catch(function() {
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@ -171,7 +171,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { addLineSymbolBlack, delLineSymbolBlack, getLineSymbolBlack, listLineSymbolBlack, updateLineSymbolBlack,reloadSymbol } from '@/api/admin/line-symbol-black'
|
import { addLineSymbolBlack, delLineSymbolBlack, getLineSymbolBlack, listLineSymbolBlack, updateLineSymbolBlack, reloadSymbol } from '@/api/admin/line-symbol-black'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'LineSymbolBlack',
|
name: 'LineSymbolBlack',
|
||||||
@ -206,7 +206,7 @@ export default {
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
symbol: undefined,
|
symbol: undefined,
|
||||||
type: undefined,
|
type: undefined,
|
||||||
idOrder:"desc",
|
idOrder: 'desc'
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {
|
form: {
|
||||||
@ -349,7 +349,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
/** 重置交易对按钮操作 */
|
/** 重置交易对按钮操作 */
|
||||||
handleReload(){
|
handleReload() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
reloadSymbol().then((response) => {
|
reloadSymbol().then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
|
|||||||
330
src/views/admin/line-symbol-price/index.vue
Normal file
330
src/views/admin/line-symbol-price/index.vue
Normal file
@ -0,0 +1,330 @@
|
|||||||
|
<template>
|
||||||
|
<BasicLayout>
|
||||||
|
<template #wrapper>
|
||||||
|
<el-card class="box-card">
|
||||||
|
<el-form ref="queryForm" :model="queryParams" :inline="true" label-width="68px">
|
||||||
|
<el-form-item label="交易对" prop="symbol"><el-input
|
||||||
|
v-model="queryParams.symbol"
|
||||||
|
placeholder="请输入交易对"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-select v-model="queryParams.status" placeholder="请选择比较类型" clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="item in statusOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
v-permisaction="['admin:lineSymbolPrice:add']"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
>新增
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
v-permisaction="['admin:lineSymbolPrice:edit']"
|
||||||
|
type="success"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
>修改
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
v-permisaction="['admin:lineSymbolPrice:remove']"
|
||||||
|
type="danger"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
>删除
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="lineSymbolPriceList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="交易对" align="center" prop="symbol" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true">
|
||||||
|
<template slot-scope="scope">{{ scope.row.status === 1 ? "已启用" : "禁用" }} </template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createdAt"
|
||||||
|
width="150"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
>
|
||||||
|
<template #default="{ row }">{{ parseTime(row.createdAt) }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-popconfirm
|
||||||
|
class="delete-popconfirm"
|
||||||
|
title="确认要修改吗?"
|
||||||
|
confirm-button-text="修改"
|
||||||
|
@confirm="handleUpdate(scope.row)"
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
slot="reference"
|
||||||
|
v-permisaction="['admin:lineSymbolPrice:edit']"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
>修改
|
||||||
|
</el-button>
|
||||||
|
</el-popconfirm>
|
||||||
|
<el-popconfirm
|
||||||
|
class="delete-popconfirm"
|
||||||
|
title="确认要删除吗?"
|
||||||
|
confirm-button-text="删除"
|
||||||
|
@confirm="handleDelete(scope.row)"
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
slot="reference"
|
||||||
|
v-permisaction="['admin:lineSymbolPrice:remove']"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
>删除
|
||||||
|
</el-button>
|
||||||
|
</el-popconfirm>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageIndex"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 添加或修改对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="500px">
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
|
||||||
|
<el-form-item label="交易对" prop="symbol">
|
||||||
|
<el-input v-model="form.symbol" placeholder="交易对" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-radio-group v-model="form.status">
|
||||||
|
<el-radio :label="1">启用</el-radio>
|
||||||
|
<el-radio :label="2">禁用</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
<!-- <el-select v-model="form.status" placeholder="请选择">
|
||||||
|
<el-option v-for="dict in statusOptions" :key="dict.value" :label="dict.label"
|
||||||
|
:value="dict.value" />
|
||||||
|
</el-select> -->
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</el-card>
|
||||||
|
</template>
|
||||||
|
</BasicLayout>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { addLineSymbolPrice, delLineSymbolPrice, getLineSymbolPrice, listLineSymbolPrice, updateLineSymbolPrice } from '@/api/admin/line-symbol-price'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'LineSymbolPrice',
|
||||||
|
components: {
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 弹出层标题
|
||||||
|
title: '',
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
isEdit: false,
|
||||||
|
// 类型数据字典
|
||||||
|
typeOptions: [],
|
||||||
|
lineSymbolPriceList: [],
|
||||||
|
statusOptions: [{
|
||||||
|
label: '启用',
|
||||||
|
value: 1
|
||||||
|
}, {
|
||||||
|
label: '禁用',
|
||||||
|
value: 2
|
||||||
|
}],
|
||||||
|
// 关系表类型
|
||||||
|
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageIndex: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
symbol: undefined,
|
||||||
|
status: undefined,
|
||||||
|
idOrder: 'desc'
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {
|
||||||
|
},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
symbol: [{ required: true, message: '交易对不能为空', trigger: 'blur' }],
|
||||||
|
status: [{ required: true, message: '状态不能为空', trigger: 'blur' }]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询参数列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true
|
||||||
|
listLineSymbolPrice(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||||
|
this.lineSymbolPriceList = response.data.list
|
||||||
|
this.total = response.data.count
|
||||||
|
this.loading = false
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false
|
||||||
|
this.reset()
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
|
||||||
|
id: undefined,
|
||||||
|
symbol: undefined,
|
||||||
|
status: 1
|
||||||
|
}
|
||||||
|
this.resetForm('form')
|
||||||
|
},
|
||||||
|
getImgList: function() {
|
||||||
|
this.form[this.fileIndex] = this.$refs['fileChoose'].resultList[0].fullUrl
|
||||||
|
},
|
||||||
|
fileClose: function() {
|
||||||
|
this.fileOpen = false
|
||||||
|
},
|
||||||
|
// 关系
|
||||||
|
// 文件
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageIndex = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.dateRange = []
|
||||||
|
this.resetForm('queryForm')
|
||||||
|
this.handleQuery()
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset()
|
||||||
|
this.open = true
|
||||||
|
this.title = '添加缓存价格交易对'
|
||||||
|
this.isEdit = false
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length !== 1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset()
|
||||||
|
const id =
|
||||||
|
row.id || this.ids
|
||||||
|
getLineSymbolPrice(id).then(response => {
|
||||||
|
this.form = response.data
|
||||||
|
this.open = true
|
||||||
|
this.title = '修改缓存价格交易对'
|
||||||
|
this.isEdit = true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm: function() {
|
||||||
|
this.$refs['form'].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id !== undefined) {
|
||||||
|
updateLineSymbolPrice(this.form).then(response => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.msgSuccess(response.msg)
|
||||||
|
this.open = false
|
||||||
|
this.getList()
|
||||||
|
} else {
|
||||||
|
this.msgError(response.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
addLineSymbolPrice(this.form).then(response => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.msgSuccess(response.msg)
|
||||||
|
this.open = false
|
||||||
|
this.getList()
|
||||||
|
} else {
|
||||||
|
this.msgError(response.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
var Ids = (row.id && [row.id]) || this.ids
|
||||||
|
|
||||||
|
this.$confirm('是否确认删除编号为"' + Ids + '"的数据项?', '警告', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(function() {
|
||||||
|
return delLineSymbolPrice({ 'ids': Ids })
|
||||||
|
}).then((response) => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.msgSuccess(response.msg)
|
||||||
|
this.open = false
|
||||||
|
this.getList()
|
||||||
|
} else {
|
||||||
|
this.msgError(response.msg)
|
||||||
|
}
|
||||||
|
}).catch(function() {
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@ -19,6 +19,11 @@
|
|||||||
align="center"
|
align="center"
|
||||||
prop="reducePremium"
|
prop="reducePremium"
|
||||||
/>
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="减仓策略提前触发百分比"
|
||||||
|
align="center"
|
||||||
|
prop="reduceEarlyTriggerPercent"
|
||||||
|
/>
|
||||||
<!-- <el-table-column
|
<!-- <el-table-column
|
||||||
label="主账号加仓溢价百分比"
|
label="主账号加仓溢价百分比"
|
||||||
align="center"
|
align="center"
|
||||||
@ -143,6 +148,9 @@
|
|||||||
<el-form-item label="限价减仓溢价" prop="reducePremium">
|
<el-form-item label="限价减仓溢价" prop="reducePremium">
|
||||||
<el-input v-model="form.reducePremium" placeholder="限价减仓溢价" />
|
<el-input v-model="form.reducePremium" placeholder="限价减仓溢价" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="减仓策略提前触发百分比" prop="reduceEarlyTriggerPercent">
|
||||||
|
<el-input v-model="form.reduceEarlyTriggerPercent" placeholder="减仓策略提前触发百分比" />
|
||||||
|
</el-form-item>
|
||||||
<!-- <el-form-item label="主账号加仓溢价百分比" prop="scaleOrderTypeARate">
|
<!-- <el-form-item label="主账号加仓溢价百分比" prop="scaleOrderTypeARate">
|
||||||
<el-input v-model="form.scaleOrderTypeARate" placeholder="主账号限价加仓买入百分比" />
|
<el-input v-model="form.scaleOrderTypeARate" placeholder="主账号限价加仓买入百分比" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -221,7 +229,8 @@ export default {
|
|||||||
rules: {
|
rules: {
|
||||||
stopLossPremium: [{ required: true, message: '限价止损溢价不能为空', trigger: 'blur' }],
|
stopLossPremium: [{ required: true, message: '限价止损溢价不能为空', trigger: 'blur' }],
|
||||||
addPositionPremium: [{ required: true, message: '限价加仓溢价不能为空', trigger: 'blur' }],
|
addPositionPremium: [{ required: true, message: '限价加仓溢价不能为空', trigger: 'blur' }],
|
||||||
reducePremium: [{ required: true, message: '限价减仓溢价不能为空', trigger: 'blur' }]
|
reducePremium: [{ required: true, message: '限价减仓溢价不能为空', trigger: 'blur' }],
|
||||||
|
reduceEarlyTriggerPercent: [{ required: true, message: '减仓策略提前触发百分比不能为空', trigger: 'blur' }]
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,13 +21,25 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</el-col> -->
|
</el-col> -->
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-permisaction="['admin:lineUser:edit']" type="success" icon="el-icon-edit" size="mini"
|
<el-button
|
||||||
:disabled="single" @click="handleUpdate">修改
|
v-permisaction="['admin:lineUser:edit']"
|
||||||
|
type="success"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
>修改
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-permisaction="['admin:lineUser:remove']" type="danger" icon="el-icon-delete" size="mini"
|
<el-button
|
||||||
:disabled="multiple" @click="handleDelete">删除
|
v-permisaction="['admin:lineUser:remove']"
|
||||||
|
type="danger"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
>删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -58,29 +70,57 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-popconfirm v-if="scope.row.open_status===1" class="delete-popconfirm" title="确认要新资产吗?" confirm-button-text="更新"
|
<el-popconfirm
|
||||||
@confirm="handleReload(scope.row)">
|
v-if="scope.row.open_status===1"
|
||||||
|
class="delete-popconfirm"
|
||||||
|
title="确认要新资产吗?"
|
||||||
|
confirm-button-text="更新"
|
||||||
|
@confirm="handleReload(scope.row)"
|
||||||
|
>
|
||||||
<el-button slot="reference" size="mini" type="text" icon="el-icon-edit">更新资产
|
<el-button slot="reference" size="mini" type="text" icon="el-icon-edit">更新资产
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-popconfirm>
|
</el-popconfirm>
|
||||||
<el-popconfirm class="delete-popconfirm" title="确认要修改吗?" confirm-button-text="修改"
|
<el-popconfirm
|
||||||
@confirm="handleUpdate(scope.row)">
|
class="delete-popconfirm"
|
||||||
<el-button slot="reference" v-permisaction="['admin:lineUser:edit']" size="mini" type="text"
|
title="确认要修改吗?"
|
||||||
icon="el-icon-edit">修改
|
confirm-button-text="修改"
|
||||||
|
@confirm="handleUpdate(scope.row)"
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
slot="reference"
|
||||||
|
v-permisaction="['admin:lineUser:edit']"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
>修改
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-popconfirm>
|
</el-popconfirm>
|
||||||
<el-popconfirm class="delete-popconfirm" title="确认要删除吗?" confirm-button-text="删除"
|
<el-popconfirm
|
||||||
@confirm="handleDelete(scope.row)">
|
class="delete-popconfirm"
|
||||||
<el-button slot="reference" v-permisaction="['admin:lineUser:remove']" size="mini" type="text"
|
title="确认要删除吗?"
|
||||||
icon="el-icon-delete">删除
|
confirm-button-text="删除"
|
||||||
|
@confirm="handleDelete(scope.row)"
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
slot="reference"
|
||||||
|
v-permisaction="['admin:lineUser:remove']"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
>删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-popconfirm>
|
</el-popconfirm>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageIndex"
|
<pagination
|
||||||
:limit.sync="queryParams.pageSize" @pagination="getList" />
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageIndex"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改对话框 -->
|
<!-- 添加或修改对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px">
|
<el-dialog :title="title" :visible.sync="open" width="500px">
|
||||||
@ -266,7 +306,7 @@ export default {
|
|||||||
queryParams: {
|
queryParams: {
|
||||||
pageIndex: 1,
|
pageIndex: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
idOrder: "desc"
|
idOrder: 'desc'
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {
|
form: {
|
||||||
@ -326,10 +366,10 @@ export default {
|
|||||||
}
|
}
|
||||||
this.resetForm('form')
|
this.resetForm('form')
|
||||||
},
|
},
|
||||||
getImgList: function () {
|
getImgList: function() {
|
||||||
this.form[this.fileIndex] = this.$refs['fileChoose'].resultList[0].fullUrl
|
this.form[this.fileIndex] = this.$refs['fileChoose'].resultList[0].fullUrl
|
||||||
},
|
},
|
||||||
fileClose: function () {
|
fileClose: function() {
|
||||||
this.fileOpen = false
|
this.fileOpen = false
|
||||||
},
|
},
|
||||||
// 关系
|
// 关系
|
||||||
@ -371,7 +411,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm: function () {
|
submitForm: function() {
|
||||||
this.$refs['form'].validate(valid => {
|
this.$refs['form'].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.id !== undefined) {
|
if (this.form.id !== undefined) {
|
||||||
@ -406,7 +446,7 @@ export default {
|
|||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(function () {
|
}).then(function() {
|
||||||
return delLineUser({ 'ids': Ids })
|
return delLineUser({ 'ids': Ids })
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
@ -416,7 +456,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.msgError(response.msg)
|
this.msgError(response.msg)
|
||||||
}
|
}
|
||||||
}).catch(function () {
|
}).catch(function() {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -4,8 +4,12 @@
|
|||||||
<template #wrapper>
|
<template #wrapper>
|
||||||
<el-card class="box-card">
|
<el-card class="box-card">
|
||||||
<el-form ref="queryForm" :model="queryParams" :inline="true" label-width="68px">
|
<el-form ref="queryForm" :model="queryParams" :inline="true" label-width="68px">
|
||||||
<el-form-item label="变更来源 (member_change_source)" prop="changeSource"><el-select v-model="queryParams.changeSource"
|
<el-form-item label="变更来源 (member_change_source)" prop="changeSource"><el-select
|
||||||
placeholder="用户余额变更记录变更来源 (member_change_source)" clearable size="small">
|
v-model="queryParams.changeSource"
|
||||||
|
placeholder="用户余额变更记录变更来源 (member_change_source)"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in changeSourceOptions"
|
v-for="dict in changeSourceOptions"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
@ -14,8 +18,13 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="变更类别 1-收入 2-支出" prop="changeType"><el-input v-model="queryParams.changeType" placeholder="请输入变更类别 1-收入 2-支出" clearable
|
<el-form-item label="变更类别 1-收入 2-支出" prop="changeType"><el-input
|
||||||
size="small" @keyup.enter.native="handleQuery"/>
|
v-model="queryParams.changeType"
|
||||||
|
placeholder="请输入变更类别 1-收入 2-支出"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
@ -60,16 +69,37 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="memberBalanceLogList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="memberBalanceLogList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center"/><el-table-column label="变更来源 (member_change_source)" align="center" prop="changeSource"
|
<el-table-column type="selection" width="55" align="center" /><el-table-column
|
||||||
:formatter="changeSourceFormat" width="100">
|
label="变更来源 (member_change_source)"
|
||||||
|
align="center"
|
||||||
|
prop="changeSource"
|
||||||
|
:formatter="changeSourceFormat"
|
||||||
|
width="100"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ changeSourceFormat(scope.row) }}
|
{{ changeSourceFormat(scope.row) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column><el-table-column label="变更类别 1-收入 2-支出" align="center" prop="changeType"
|
</el-table-column><el-table-column
|
||||||
:show-overflow-tooltip="true"/><el-table-column label="变更金额" align="center" prop="amount"
|
label="变更类别 1-收入 2-支出"
|
||||||
:show-overflow-tooltip="true"/><el-table-column label="变更前余额" align="center" prop="balanceBefore"
|
align="center"
|
||||||
:show-overflow-tooltip="true"/><el-table-column label="变更后余额" align="center" prop="balanceAfter"
|
prop="changeType"
|
||||||
:show-overflow-tooltip="true"/>
|
:show-overflow-tooltip="true"
|
||||||
|
/><el-table-column
|
||||||
|
label="变更金额"
|
||||||
|
align="center"
|
||||||
|
prop="amount"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/><el-table-column
|
||||||
|
label="变更前余额"
|
||||||
|
align="center"
|
||||||
|
prop="balanceBefore"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/><el-table-column
|
||||||
|
label="变更后余额"
|
||||||
|
align="center"
|
||||||
|
prop="balanceAfter"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-popconfirm
|
<el-popconfirm
|
||||||
@ -119,7 +149,9 @@
|
|||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
|
||||||
<el-form-item label="用户id" prop="userId">
|
<el-form-item label="用户id" prop="userId">
|
||||||
<el-input v-model="form.userId" placeholder="用户id"
|
<el-input
|
||||||
|
v-model="form.userId"
|
||||||
|
placeholder="用户id"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="变更来源 (member_change_source)" prop="changeSource">
|
<el-form-item label="变更来源 (member_change_source)" prop="changeSource">
|
||||||
@ -132,19 +164,27 @@
|
|||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="变更类别 1-收入 2-支出" prop="changeType">
|
<el-form-item label="变更类别 1-收入 2-支出" prop="changeType">
|
||||||
<el-input v-model="form.changeType" placeholder="变更类别 1-收入 2-支出"
|
<el-input
|
||||||
|
v-model="form.changeType"
|
||||||
|
placeholder="变更类别 1-收入 2-支出"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="变更金额" prop="amount">
|
<el-form-item label="变更金额" prop="amount">
|
||||||
<el-input v-model="form.amount" placeholder="变更金额"
|
<el-input
|
||||||
|
v-model="form.amount"
|
||||||
|
placeholder="变更金额"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="变更前余额" prop="balanceBefore">
|
<el-form-item label="变更前余额" prop="balanceBefore">
|
||||||
<el-input v-model="form.balanceBefore" placeholder="变更前余额"
|
<el-input
|
||||||
|
v-model="form.balanceBefore"
|
||||||
|
placeholder="变更前余额"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="变更后余额" prop="balanceAfter">
|
<el-form-item label="变更后余额" prop="balanceAfter">
|
||||||
<el-input v-model="form.balanceAfter" placeholder="变更后余额"
|
<el-input
|
||||||
|
v-model="form.balanceAfter"
|
||||||
|
placeholder="变更后余额"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
@ -152,8 +192,8 @@
|
|||||||
v-model="form.remark"
|
v-model="form.remark"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
:rows="2"
|
:rows="2"
|
||||||
placeholder="请输入内容">
|
placeholder="请输入内容"
|
||||||
</el-input>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
@ -167,9 +207,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {addMemberBalanceLog, delMemberBalanceLog, getMemberBalanceLog, listMemberBalanceLog, updateMemberBalanceLog} from '@/api/admin/member-balance-log'
|
import { addMemberBalanceLog, delMemberBalanceLog, getMemberBalanceLog, listMemberBalanceLog, updateMemberBalanceLog } from '@/api/admin/member-balance-log'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'MemberBalanceLog',
|
name: 'MemberBalanceLog',
|
||||||
components: {
|
components: {
|
||||||
},
|
},
|
||||||
@ -200,16 +240,16 @@
|
|||||||
queryParams: {
|
queryParams: {
|
||||||
pageIndex: 1,
|
pageIndex: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
changeSource:undefined,
|
changeSource: undefined,
|
||||||
changeType:undefined,
|
changeType: undefined
|
||||||
|
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {
|
form: {
|
||||||
},
|
},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {changeSource: [ {required: true, message: '变更来源 (member_change_source)不能为空', trigger: 'blur'} ],
|
rules: { changeSource: [{ required: true, message: '变更来源 (member_change_source)不能为空', trigger: 'blur' }],
|
||||||
changeType: [ {required: true, message: '变更类别 1-收入 2-支出不能为空', trigger: 'blur'} ],
|
changeType: [{ required: true, message: '变更类别 1-收入 2-支出不能为空', trigger: 'blur' }]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -246,7 +286,7 @@
|
|||||||
amount: undefined,
|
amount: undefined,
|
||||||
balanceBefore: undefined,
|
balanceBefore: undefined,
|
||||||
balanceAfter: undefined,
|
balanceAfter: undefined,
|
||||||
remark: undefined,
|
remark: undefined
|
||||||
}
|
}
|
||||||
this.resetForm('form')
|
this.resetForm('form')
|
||||||
},
|
},
|
||||||
@ -298,7 +338,7 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm: function () {
|
submitForm: function() {
|
||||||
this.$refs['form'].validate(valid => {
|
this.$refs['form'].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.id !== undefined) {
|
if (this.form.id !== undefined) {
|
||||||
@ -333,8 +373,8 @@
|
|||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(function () {
|
}).then(function() {
|
||||||
return delMemberBalanceLog( { 'ids': Ids })
|
return delMemberBalanceLog({ 'ids': Ids })
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.msgSuccess(response.msg)
|
this.msgSuccess(response.msg)
|
||||||
@ -343,9 +383,9 @@
|
|||||||
} else {
|
} else {
|
||||||
this.msgError(response.msg)
|
this.msgError(response.msg)
|
||||||
}
|
}
|
||||||
}).catch(function () {
|
}).catch(function() {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -47,7 +47,7 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="memberBalanceList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="memberBalanceList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center"/>
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-popconfirm
|
<el-popconfirm
|
||||||
@ -97,15 +97,21 @@
|
|||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
|
||||||
<el-form-item label="总余额" prop="totalAmont">
|
<el-form-item label="总余额" prop="totalAmont">
|
||||||
<el-input v-model="form.totalAmont" placeholder="总余额"
|
<el-input
|
||||||
|
v-model="form.totalAmont"
|
||||||
|
placeholder="总余额"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="可用余额" prop="freeAmount">
|
<el-form-item label="可用余额" prop="freeAmount">
|
||||||
<el-input v-model="form.freeAmount" placeholder="可用余额"
|
<el-input
|
||||||
|
v-model="form.freeAmount"
|
||||||
|
placeholder="可用余额"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="冻结金额" prop="frozenAmount">
|
<el-form-item label="冻结金额" prop="frozenAmount">
|
||||||
<el-input v-model="form.frozenAmount" placeholder="冻结金额"
|
<el-input
|
||||||
|
v-model="form.frozenAmount"
|
||||||
|
placeholder="冻结金额"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
@ -120,9 +126,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {addMemberBalance, delMemberBalance, getMemberBalance, listMemberBalance, updateMemberBalance} from '@/api/admin/member-balance'
|
import { addMemberBalance, delMemberBalance, getMemberBalance, listMemberBalance, updateMemberBalance } from '@/api/admin/member-balance'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'MemberBalance',
|
name: 'MemberBalance',
|
||||||
components: {
|
components: {
|
||||||
},
|
},
|
||||||
@ -152,7 +158,7 @@
|
|||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageIndex: 1,
|
pageIndex: 1,
|
||||||
pageSize: 10,
|
pageSize: 10
|
||||||
|
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
@ -188,7 +194,7 @@
|
|||||||
id: undefined,
|
id: undefined,
|
||||||
totalAmont: undefined,
|
totalAmont: undefined,
|
||||||
freeAmount: undefined,
|
freeAmount: undefined,
|
||||||
frozenAmount: undefined,
|
frozenAmount: undefined
|
||||||
}
|
}
|
||||||
this.resetForm('form')
|
this.resetForm('form')
|
||||||
},
|
},
|
||||||
@ -237,7 +243,7 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm: function () {
|
submitForm: function() {
|
||||||
this.$refs['form'].validate(valid => {
|
this.$refs['form'].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.id !== undefined) {
|
if (this.form.id !== undefined) {
|
||||||
@ -272,8 +278,8 @@
|
|||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(function () {
|
}).then(function() {
|
||||||
return delMemberBalance( { 'ids': Ids })
|
return delMemberBalance({ 'ids': Ids })
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.msgSuccess(response.msg)
|
this.msgSuccess(response.msg)
|
||||||
@ -282,9 +288,9 @@
|
|||||||
} else {
|
} else {
|
||||||
this.msgError(response.msg)
|
this.msgError(response.msg)
|
||||||
}
|
}
|
||||||
}).catch(function () {
|
}).catch(function() {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -33,8 +33,14 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</el-col> -->
|
</el-col> -->
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-permisaction="['admin:memberRenwaLog:remove']" type="danger" icon="el-icon-delete"
|
<el-button
|
||||||
size="mini" :disabled="multiple" @click="handleDelete">删除
|
v-permisaction="['admin:memberRenwaLog:remove']"
|
||||||
|
type="danger"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
>删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -43,17 +49,38 @@
|
|||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
|
||||||
<el-table-column label="昵称" align="center" prop="nickName" :show-overflow-tooltip="true" />
|
<el-table-column label="昵称" align="center" prop="nickName" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="续期套餐名称" align="center" prop="renwalName"
|
<el-table-column
|
||||||
:show-overflow-tooltip="true" /><el-table-column label="续期时长(天数)" align="center"
|
label="续期套餐名称"
|
||||||
prop="renwalDuration" :show-overflow-tooltip="true" /><el-table-column label="订单状态"
|
align="center"
|
||||||
align="center" prop="status" :formatter="statusFormat" width="100">
|
prop="renwalName"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/><el-table-column
|
||||||
|
label="续期时长(天数)"
|
||||||
|
align="center"
|
||||||
|
prop="renwalDuration"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/><el-table-column
|
||||||
|
label="订单状态"
|
||||||
|
align="center"
|
||||||
|
prop="status"
|
||||||
|
:formatter="statusFormat"
|
||||||
|
width="100"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ statusFormat(scope.row.status) }}
|
{{ statusFormat(scope.row.status) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column><el-table-column label="应付金额" align="center" prop="payableAmount"
|
</el-table-column><el-table-column
|
||||||
:show-overflow-tooltip="true" />
|
label="应付金额"
|
||||||
<el-table-column label="实付金额" align="center" prop="actualPaymentAmount"
|
align="center"
|
||||||
:show-overflow-tooltip="true" />
|
prop="payableAmount"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="实付金额"
|
||||||
|
align="center"
|
||||||
|
prop="actualPaymentAmount"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
<el-table-column label="付款地址" align="center" prop="fromAddress" :show-overflow-tooltip="true" />
|
<el-table-column label="付款地址" align="center" prop="fromAddress" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="代币" align="center" prop="coin" :show-overflow-tooltip="true" />
|
<el-table-column label="代币" align="center" prop="coin" :show-overflow-tooltip="true" />
|
||||||
|
|
||||||
@ -75,18 +102,33 @@
|
|||||||
type="text" icon="el-icon-edit">修改
|
type="text" icon="el-icon-edit">修改
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-popconfirm> -->
|
</el-popconfirm> -->
|
||||||
<el-popconfirm v-if="scope.row.status == 'expired'" class="delete-popconfirm" title="确认要删除吗?"
|
<el-popconfirm
|
||||||
confirm-button-text="删除" @confirm="handleDelete(scope.row)">
|
v-if="scope.row.status == 'expired'"
|
||||||
<el-button slot="reference" v-permisaction="['admin:memberRenwaLog:remove']" size="mini"
|
class="delete-popconfirm"
|
||||||
type="text" icon="el-icon-delete">删除
|
title="确认要删除吗?"
|
||||||
|
confirm-button-text="删除"
|
||||||
|
@confirm="handleDelete(scope.row)"
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
slot="reference"
|
||||||
|
v-permisaction="['admin:memberRenwaLog:remove']"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
>删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-popconfirm>
|
</el-popconfirm>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageIndex"
|
<pagination
|
||||||
:limit.sync="queryParams.pageSize" @pagination="getList" />
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageIndex"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改对话框 -->
|
<!-- 添加或修改对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px">
|
<el-dialog :title="title" :visible.sync="open" width="500px">
|
||||||
@ -118,8 +160,7 @@
|
|||||||
<el-input v-model="form.coin" placeholder="代币" />
|
<el-input v-model="form.coin" placeholder="代币" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="支付时间" prop="paymentTime">
|
<el-form-item label="支付时间" prop="paymentTime">
|
||||||
<el-date-picker v-model="form.paymentTime" type="datetime" placeholder="选择日期">
|
<el-date-picker v-model="form.paymentTime" type="datetime" placeholder="选择日期" />
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
@ -166,7 +207,7 @@ export default {
|
|||||||
queryParams: {
|
queryParams: {
|
||||||
pageIndex: 1,
|
pageIndex: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
idOrder: "desc"
|
idOrder: 'desc'
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {
|
form: {
|
||||||
@ -210,14 +251,14 @@ export default {
|
|||||||
actualPaymentAmount: undefined,
|
actualPaymentAmount: undefined,
|
||||||
fromAddress: undefined,
|
fromAddress: undefined,
|
||||||
coin: undefined,
|
coin: undefined,
|
||||||
paymentTime: undefined,
|
paymentTime: undefined
|
||||||
}
|
}
|
||||||
this.resetForm('form')
|
this.resetForm('form')
|
||||||
},
|
},
|
||||||
getImgList: function () {
|
getImgList: function() {
|
||||||
this.form[this.fileIndex] = this.$refs['fileChoose'].resultList[0].fullUrl
|
this.form[this.fileIndex] = this.$refs['fileChoose'].resultList[0].fullUrl
|
||||||
},
|
},
|
||||||
fileClose: function () {
|
fileClose: function() {
|
||||||
this.fileOpen = false
|
this.fileOpen = false
|
||||||
},
|
},
|
||||||
statusFormat(status) {
|
statusFormat(status) {
|
||||||
@ -262,7 +303,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm: function () {
|
submitForm: function() {
|
||||||
this.$refs['form'].validate(valid => {
|
this.$refs['form'].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.id !== undefined) {
|
if (this.form.id !== undefined) {
|
||||||
@ -297,7 +338,7 @@ export default {
|
|||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(function () {
|
}).then(function() {
|
||||||
return delMemberRenwaLog({ 'ids': Ids })
|
return delMemberRenwaLog({ 'ids': Ids })
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
@ -307,7 +348,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.msgError(response.msg)
|
this.msgError(response.msg)
|
||||||
}
|
}
|
||||||
}).catch(function () {
|
}).catch(function() {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,13 +3,26 @@
|
|||||||
<template #wrapper>
|
<template #wrapper>
|
||||||
<el-card class="box-card">
|
<el-card class="box-card">
|
||||||
<el-form ref="queryForm" :model="queryParams" :inline="true" label-width="68px">
|
<el-form ref="queryForm" :model="queryParams" :inline="true" label-width="68px">
|
||||||
<el-form-item label="套餐名称" prop="packageName"><el-input v-model="queryParams.packageName"
|
<el-form-item label="套餐名称" prop="packageName"><el-input
|
||||||
placeholder="请输入套餐名称" clearable size="small" @keyup.enter.native="handleQuery" />
|
v-model="queryParams.packageName"
|
||||||
|
placeholder="请输入套餐名称"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="套餐状态" prop="status"><el-select v-model="queryParams.status"
|
<el-form-item label="套餐状态" prop="status"><el-select
|
||||||
placeholder="会员套餐管理套餐状态" clearable size="small">
|
v-model="queryParams.status"
|
||||||
<el-option v-for="dict in statusOptions" :key="dict.value" :label="dict.label"
|
placeholder="会员套餐管理套餐状态"
|
||||||
:value="dict.value" />
|
clearable
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in statusOptions"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
@ -21,18 +34,35 @@
|
|||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-permisaction="['admin:memberRenwalConfig:add']" type="primary" icon="el-icon-plus"
|
<el-button
|
||||||
size="mini" @click="handleAdd">新增
|
v-permisaction="['admin:memberRenwalConfig:add']"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
>新增
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-permisaction="['admin:memberRenwalConfig:edit']" type="success" icon="el-icon-edit"
|
<el-button
|
||||||
size="mini" :disabled="single" @click="handleUpdate">修改
|
v-permisaction="['admin:memberRenwalConfig:edit']"
|
||||||
|
type="success"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
>修改
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-permisaction="['admin:memberRenwalConfig:remove']" type="danger"
|
<el-button
|
||||||
icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete">删除
|
v-permisaction="['admin:memberRenwalConfig:remove']"
|
||||||
|
type="danger"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
>删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -41,20 +71,24 @@
|
|||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="套餐名称" align="center" prop="packageName" :show-overflow-tooltip="true" />
|
<el-table-column label="套餐名称" align="center" prop="packageName" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="续期时间(天)" align="center" prop="durationDay" :show-overflow-tooltip="true" />
|
<el-table-column label="续期时间(天)" align="center" prop="durationDay" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="原始单价(U)" align="center" prop="originalPrice"
|
<el-table-column
|
||||||
:show-overflow-tooltip="true" />
|
label="原始单价(U)"
|
||||||
|
align="center"
|
||||||
|
prop="originalPrice"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
<el-table-column label="折扣价格(U)" align="center" prop="discountPrice" :show-overflow-tooltip="true">
|
<el-table-column label="折扣价格(U)" align="center" prop="discountPrice" :show-overflow-tooltip="true">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.discountPrice > 0 ? scope.row.discountPrice : '' }}
|
{{ scope.row.discountPrice > 0 ? scope.row.discountPrice : '' }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="排序" align="center" prop="sort"></el-table-column>
|
<el-table-column label="排序" align="center" prop="sort" />
|
||||||
<el-table-column label="是否可见" align="center" prop="isDefault">
|
<el-table-column label="是否可见" align="center" prop="isDefault">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ defaultFormat(scope.row.isVisible) }}
|
{{ defaultFormat(scope.row.isVisible) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="是否默认套餐" align="center" :defaultFormat="statusFormat" prop="isDefault">\
|
<el-table-column label="是否默认套餐" align="center" :default-format="statusFormat" prop="isDefault">\
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ defaultFormat(scope.row.isDefault) }}
|
{{ defaultFormat(scope.row.isDefault) }}
|
||||||
</template>
|
</template>
|
||||||
@ -66,24 +100,47 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-popconfirm class="delete-popconfirm" title="确认要修改吗?" confirm-button-text="修改"
|
<el-popconfirm
|
||||||
@confirm="handleUpdate(scope.row)">
|
class="delete-popconfirm"
|
||||||
<el-button slot="reference" v-permisaction="['admin:memberRenwalConfig:edit']"
|
title="确认要修改吗?"
|
||||||
size="mini" type="text" icon="el-icon-edit">修改
|
confirm-button-text="修改"
|
||||||
|
@confirm="handleUpdate(scope.row)"
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
slot="reference"
|
||||||
|
v-permisaction="['admin:memberRenwalConfig:edit']"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
>修改
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-popconfirm>
|
</el-popconfirm>
|
||||||
<el-popconfirm class="delete-popconfirm" title="确认要删除吗?" confirm-button-text="删除"
|
<el-popconfirm
|
||||||
@confirm="handleDelete(scope.row)">
|
class="delete-popconfirm"
|
||||||
<el-button slot="reference" v-permisaction="['admin:memberRenwalConfig:remove']"
|
title="确认要删除吗?"
|
||||||
size="mini" type="text" icon="el-icon-delete">删除
|
confirm-button-text="删除"
|
||||||
|
@confirm="handleDelete(scope.row)"
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
slot="reference"
|
||||||
|
v-permisaction="['admin:memberRenwalConfig:remove']"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
>删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-popconfirm>
|
</el-popconfirm>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageIndex"
|
<pagination
|
||||||
:limit.sync="queryParams.pageSize" @pagination="getList" />
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageIndex"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改对话框 -->
|
<!-- 添加或修改对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px">
|
<el-dialog :title="title" :visible.sync="open" width="500px">
|
||||||
@ -109,15 +166,21 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="是否可见 " prop="isVisible">
|
<el-form-item label="是否可见 " prop="isVisible">
|
||||||
<el-radio-group v-model="form.isVisible">
|
<el-radio-group v-model="form.isVisible">
|
||||||
<el-radio v-for="dict in defaultOptions" :key="'default' + dict.value"
|
<el-radio
|
||||||
:label="dict.value">{{ dict.label
|
v-for="dict in defaultOptions"
|
||||||
|
:key="'default' + dict.value"
|
||||||
|
:label="dict.value"
|
||||||
|
>{{ dict.label
|
||||||
}}</el-radio>
|
}}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="是否默认套餐 " prop="isDefault">
|
<el-form-item label="是否默认套餐 " prop="isDefault">
|
||||||
<el-radio-group v-model="form.isDefault">
|
<el-radio-group v-model="form.isDefault">
|
||||||
<el-radio v-for="dict in defaultOptions" :key="'default' + dict.value"
|
<el-radio
|
||||||
:label="dict.value">{{ dict.label
|
v-for="dict in defaultOptions"
|
||||||
|
:key="'default' + dict.value"
|
||||||
|
:label="dict.value"
|
||||||
|
>{{ dict.label
|
||||||
}}</el-radio>
|
}}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -182,7 +245,7 @@ export default {
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
packageName: undefined,
|
packageName: undefined,
|
||||||
status: undefined,
|
status: undefined,
|
||||||
sortOrder: "asc",
|
sortOrder: 'asc'
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {
|
form: {
|
||||||
@ -190,10 +253,10 @@ export default {
|
|||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
packageName: [{ required: true, message: '套餐名称不能为空', trigger: 'blur' }],
|
packageName: [{ required: true, message: '套餐名称不能为空', trigger: 'blur' }],
|
||||||
packageNameEn:[{required:true,message:'套餐英文名称不能为空',trigger:'blur'}],
|
packageNameEn: [{ required: true, message: '套餐英文名称不能为空', trigger: 'blur' }],
|
||||||
status: [{ required: true, message: '套餐状态不能为空', trigger: 'blur' }],
|
status: [{ required: true, message: '套餐状态不能为空', trigger: 'blur' }],
|
||||||
durationDay: [{ required: true, message: '套餐时长不能为空', trigger: 'blur' }],
|
durationDay: [{ required: true, message: '套餐时长不能为空', trigger: 'blur' }],
|
||||||
originalPrice: [{ required: true, message: '原价不能为空', trigger: 'blur' }],
|
originalPrice: [{ required: true, message: '原价不能为空', trigger: 'blur' }]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -231,27 +294,27 @@ export default {
|
|||||||
isDefault: 1,
|
isDefault: 1,
|
||||||
isVisible: 1,
|
isVisible: 1,
|
||||||
sort: 0,
|
sort: 0,
|
||||||
status: 'enable',
|
status: 'enable'
|
||||||
}
|
}
|
||||||
this.resetForm('form')
|
this.resetForm('form')
|
||||||
},
|
},
|
||||||
getImgList: function () {
|
getImgList: function() {
|
||||||
this.form[this.fileIndex] = this.$refs['fileChoose'].resultList[0].fullUrl
|
this.form[this.fileIndex] = this.$refs['fileChoose'].resultList[0].fullUrl
|
||||||
},
|
},
|
||||||
fileClose: function () {
|
fileClose: function() {
|
||||||
this.fileOpen = false
|
this.fileOpen = false
|
||||||
},
|
},
|
||||||
statusFormat(row) {
|
statusFormat(row) {
|
||||||
return this.selectDictLabel(this.statusOptions, row.status)
|
return this.selectDictLabel(this.statusOptions, row.status)
|
||||||
},
|
},
|
||||||
defaultFormat(val) {
|
defaultFormat(val) {
|
||||||
var label = ""
|
var label = ''
|
||||||
|
|
||||||
this.defaultOptions.forEach(element => {
|
this.defaultOptions.forEach(element => {
|
||||||
if (element.value === val) {
|
if (element.value === val) {
|
||||||
label = element.label
|
label = element.label
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
|
||||||
return label
|
return label
|
||||||
},
|
},
|
||||||
@ -294,7 +357,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm: function () {
|
submitForm: function() {
|
||||||
this.$refs['form'].validate(valid => {
|
this.$refs['form'].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.form.originalPrice = Number(this.form.originalPrice)
|
this.form.originalPrice = Number(this.form.originalPrice)
|
||||||
@ -333,7 +396,7 @@ export default {
|
|||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(function () {
|
}).then(function() {
|
||||||
return delMemberRenwalConfig({ 'ids': Ids })
|
return delMemberRenwalConfig({ 'ids': Ids })
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
@ -343,7 +406,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.msgError(response.msg)
|
this.msgError(response.msg)
|
||||||
}
|
}
|
||||||
}).catch(function () {
|
}).catch(function() {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="500px" :close-on-click-modal="false"
|
<el-dialog
|
||||||
@closed="closeDialog">
|
:title="title"
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
width="500px"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
@closed="closeDialog"
|
||||||
|
>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
|
||||||
<el-form-item label="网络名称" prop="networkName">
|
<el-form-item label="网络名称" prop="networkName">
|
||||||
{{ form.networkName }}
|
{{ form.networkName }}
|
||||||
@ -21,16 +26,22 @@
|
|||||||
<el-form-item label="手续费" prop="fee">
|
<el-form-item label="手续费" prop="fee">
|
||||||
{{ form.fee }}
|
{{ form.fee }}
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="form.status === 'pending' || form.status === 'approved'" label="审核状态"
|
<el-form-item
|
||||||
prop="approveStatus">
|
v-if="form.status === 'pending' || form.status === 'approved'"
|
||||||
|
label="审核状态"
|
||||||
|
prop="approveStatus"
|
||||||
|
>
|
||||||
<el-radio-group v-model="form.approveStatus">
|
<el-radio-group v-model="form.approveStatus">
|
||||||
<template v-if="form.status === 'pending'">
|
<template v-if="form.status === 'pending'">
|
||||||
<el-radio v-for="(item, index) in options" :key="'option_' + index" :label="item.value">{{
|
<el-radio v-for="(item, index) in options" :key="'option_' + index" :label="item.value">{{
|
||||||
item.label }}</el-radio>
|
item.label }}</el-radio>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="form.status === 'approved'">
|
<template v-else-if="form.status === 'approved'">
|
||||||
<el-radio v-for="(item, index) in confirmOptions" :key="'confirm_option_' + index"
|
<el-radio
|
||||||
:label="item.value">{{
|
v-for="(item, index) in confirmOptions"
|
||||||
|
:key="'confirm_option_' + index"
|
||||||
|
:label="item.value"
|
||||||
|
>{{
|
||||||
item.label }}</el-radio>
|
item.label }}</el-radio>
|
||||||
</template>
|
</template>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
@ -53,7 +64,7 @@
|
|||||||
import { approve, confirm } from '@/api/admin/member-withdrawal-log'
|
import { approve, confirm } from '@/api/admin/member-withdrawal-log'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'approve',
|
name: 'Approve',
|
||||||
props: {
|
props: {
|
||||||
open: {
|
open: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@ -61,21 +72,13 @@ export default {
|
|||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "提现审核"
|
default: '提现审核'
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => { }
|
default: () => { }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
|
||||||
open(val) {
|
|
||||||
this.dialogVisible = val
|
|
||||||
},
|
|
||||||
data(val) {
|
|
||||||
this.form = { approveStatus: 1, ...val }
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialogVisible: this.open,
|
dialogVisible: this.open,
|
||||||
@ -96,20 +99,28 @@ export default {
|
|||||||
}],
|
}],
|
||||||
confirmOptions: [
|
confirmOptions: [
|
||||||
{
|
{
|
||||||
label: "已转账",
|
label: '已转账',
|
||||||
value: 1
|
value: 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "转账失败",
|
label: '转账失败',
|
||||||
value: 2
|
value: 2
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
open(val) {
|
||||||
|
this.dialogVisible = val
|
||||||
|
},
|
||||||
|
data(val) {
|
||||||
|
this.form = { approveStatus: 1, ...val }
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
//审核
|
// 审核
|
||||||
if (this.form.status === 'pending') {
|
if (this.form.status === 'pending') {
|
||||||
approve({ id: this.form.id, approval: this.form.approveStatus, remark: this.form.remark }).then(res => {
|
approve({ id: this.form.id, approval: this.form.approveStatus, remark: this.form.remark }).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
@ -120,9 +131,9 @@ export default {
|
|||||||
.finally(f => {
|
.finally(f => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
} else if (this.form.status === 'approved') { //确认提现
|
} else if (this.form.status === 'approved') { // 确认提现
|
||||||
confirm({ id: this.form.id, confirmVal: this.form.approveStatus, remark: this.form.remark ,hash:this.form.hash}).then(res => {
|
confirm({ id: this.form.id, confirmVal: this.form.approveStatus, remark: this.form.remark, hash: this.form.hash }).then(res => {
|
||||||
console.log("res", res)
|
console.log('res', res)
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.msgSuccess(res.msg)
|
this.msgSuccess(res.msg)
|
||||||
this.cancel()
|
this.cancel()
|
||||||
|
|||||||
@ -3,13 +3,26 @@
|
|||||||
<template #wrapper>
|
<template #wrapper>
|
||||||
<el-card class="box-card">
|
<el-card class="box-card">
|
||||||
<el-form ref="queryForm" :model="queryParams" :inline="true" label-width="68px">
|
<el-form ref="queryForm" :model="queryParams" :inline="true" label-width="68px">
|
||||||
<el-form-item label="网络名称" prop="networkName"><el-input v-model="queryParams.networkName"
|
<el-form-item label="网络名称" prop="networkName"><el-input
|
||||||
placeholder="请输入网络名称" clearable size="small" @keyup.enter.native="handleQuery" />
|
v-model="queryParams.networkName"
|
||||||
|
placeholder="请输入网络名称"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="提现状态" prop="status"><el-select v-model="queryParams.status" placeholder="提现状态"
|
<el-form-item label="提现状态" prop="status"><el-select
|
||||||
clearable size="small">
|
v-model="queryParams.status"
|
||||||
<el-option v-for="dict in statusOptions" :key="dict.value" :label="dict.label"
|
placeholder="提现状态"
|
||||||
:value="dict.value" />
|
clearable
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in statusOptions"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
@ -42,8 +55,14 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</el-col> -->
|
</el-col> -->
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-permisaction="['admin:memberWithdrawalLog:remove']" type="danger"
|
<el-button
|
||||||
icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete">删除
|
v-permisaction="['admin:memberWithdrawalLog:remove']"
|
||||||
|
type="danger"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
>删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -54,9 +73,17 @@
|
|||||||
<el-table-column label="用户名" align="center" prop="userName" :show-overflow-tooltip="true" />
|
<el-table-column label="用户名" align="center" prop="userName" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="提现金额(U)" align="center" prop="amount" :show-overflow-tooltip="true" />
|
<el-table-column label="提现金额(U)" align="center" prop="amount" :show-overflow-tooltip="true" />
|
||||||
|
|
||||||
<el-table-column label="手续费" align="center" prop="fee"
|
<el-table-column
|
||||||
:show-overflow-tooltip="true" /><el-table-column label="备注" align="center" prop="remark"
|
label="手续费"
|
||||||
:show-overflow-tooltip="true" />
|
align="center"
|
||||||
|
prop="fee"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/><el-table-column
|
||||||
|
label="备注"
|
||||||
|
align="center"
|
||||||
|
prop="remark"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
|
||||||
<el-table-column label="提现状态" align="center" prop="status" :formatter="statusFormat" width="100">
|
<el-table-column label="提现状态" align="center" prop="status" :formatter="statusFormat" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@ -81,26 +108,48 @@
|
|||||||
size="mini" type="text" icon="el-icon-edit">修改
|
size="mini" type="text" icon="el-icon-edit">修改
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-popconfirm> -->
|
</el-popconfirm> -->
|
||||||
<el-button v-permisaction="['admin:memberWithdrawalLog:approve']"
|
<el-button
|
||||||
v-if="scope.row.status == 'pending'" @click="handleApprove(scope.row, '提现审核')"
|
v-if="scope.row.status == 'pending'"
|
||||||
size="mini" type="text">审核
|
v-permisaction="['admin:memberWithdrawalLog:approve']"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
@click="handleApprove(scope.row, '提现审核')"
|
||||||
|
>审核
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-permisaction="['admin:memberWithdrawalLog:confirm']"
|
<el-button
|
||||||
v-if="scope.row.status == 'approved'" @click="handleApprove(scope.row, '确认到账')"
|
v-if="scope.row.status == 'approved'"
|
||||||
size="mini" type="text">确认到账
|
v-permisaction="['admin:memberWithdrawalLog:confirm']"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
@click="handleApprove(scope.row, '确认到账')"
|
||||||
|
>确认到账
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-popconfirm class="delete-popconfirm" title="确认要删除吗?" confirm-button-text="删除"
|
<el-popconfirm
|
||||||
@confirm="handleDelete(scope.row)">
|
class="delete-popconfirm"
|
||||||
<el-button slot="reference" v-permisaction="['admin:memberWithdrawalLog:remove']"
|
title="确认要删除吗?"
|
||||||
size="mini" type="text" icon="el-icon-delete">删除
|
confirm-button-text="删除"
|
||||||
|
@confirm="handleDelete(scope.row)"
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
slot="reference"
|
||||||
|
v-permisaction="['admin:memberWithdrawalLog:remove']"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
>删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-popconfirm>
|
</el-popconfirm>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageIndex"
|
<pagination
|
||||||
:limit.sync="queryParams.pageSize" @pagination="getList" />
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageIndex"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改对话框 -->
|
<!-- 添加或修改对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px">
|
<el-dialog :title="title" :visible.sync="open" width="500px">
|
||||||
@ -122,8 +171,7 @@
|
|||||||
<el-input v-model="form.status" placeholder="提现状态(member_withdrawal_status)" />
|
<el-input v-model="form.status" placeholder="提现状态(member_withdrawal_status)" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="确认时间" prop="confirmTime">
|
<el-form-item label="确认时间" prop="confirmTime">
|
||||||
<el-date-picker v-model="form.confirmTime" type="datetime" placeholder="选择日期">
|
<el-date-picker v-model="form.confirmTime" type="datetime" placeholder="选择日期" />
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="手续费比例" prop="fee">
|
<el-form-item label="手续费比例" prop="fee">
|
||||||
<el-input v-model="form.fee" placeholder="手续费比例" />
|
<el-input v-model="form.fee" placeholder="手续费比例" />
|
||||||
@ -138,7 +186,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</el-card>
|
</el-card>
|
||||||
<approve :open.sync="showApprove" :title="showApproveTitle" :data="approveData" @update:open="handleClose"></approve>
|
<approve :open.sync="showApprove" :title="showApproveTitle" :data="approveData" @update:open="handleClose" />
|
||||||
</template>
|
</template>
|
||||||
</BasicLayout>
|
</BasicLayout>
|
||||||
</template>
|
</template>
|
||||||
@ -180,10 +228,10 @@ export default {
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
networkName: undefined,
|
networkName: undefined,
|
||||||
status: undefined,
|
status: undefined,
|
||||||
idOrder: "desc"
|
idOrder: 'desc'
|
||||||
},
|
},
|
||||||
showApprove: false,
|
showApprove: false,
|
||||||
showApproveTitle: "",
|
showApproveTitle: '',
|
||||||
approveData: {},
|
approveData: {},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {
|
form: {
|
||||||
@ -191,7 +239,7 @@ export default {
|
|||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
networkName: [{ required: true, message: '网络名称不能为空', trigger: 'blur' }],
|
networkName: [{ required: true, message: '网络名称不能为空', trigger: 'blur' }],
|
||||||
status: [{ required: true, message: '提现状态(member_withdrawal_status)不能为空', trigger: 'blur' }],
|
status: [{ required: true, message: '提现状态(member_withdrawal_status)不能为空', trigger: 'blur' }]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -229,14 +277,14 @@ export default {
|
|||||||
status: undefined,
|
status: undefined,
|
||||||
confirmTime: undefined,
|
confirmTime: undefined,
|
||||||
fee: undefined,
|
fee: undefined,
|
||||||
remark: undefined,
|
remark: undefined
|
||||||
}
|
}
|
||||||
this.resetForm('form')
|
this.resetForm('form')
|
||||||
},
|
},
|
||||||
getImgList: function () {
|
getImgList: function() {
|
||||||
this.form[this.fileIndex] = this.$refs['fileChoose'].resultList[0].fullUrl
|
this.form[this.fileIndex] = this.$refs['fileChoose'].resultList[0].fullUrl
|
||||||
},
|
},
|
||||||
fileClose: function () {
|
fileClose: function() {
|
||||||
this.fileOpen = false
|
this.fileOpen = false
|
||||||
},
|
},
|
||||||
statusFormat(status) {
|
statusFormat(status) {
|
||||||
@ -245,7 +293,7 @@ export default {
|
|||||||
handleApprove(row, title) {
|
handleApprove(row, title) {
|
||||||
this.showApprove = true
|
this.showApprove = true
|
||||||
this.showApproveTitle = title
|
this.showApproveTitle = title
|
||||||
this.approveData = {statusName:this.statusFormat(row.status),...row}
|
this.approveData = { statusName: this.statusFormat(row.status), ...row }
|
||||||
},
|
},
|
||||||
// 关系
|
// 关系
|
||||||
// 文件
|
// 文件
|
||||||
@ -285,11 +333,11 @@ export default {
|
|||||||
this.isEdit = true
|
this.isEdit = true
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleClose(){
|
handleClose() {
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm: function () {
|
submitForm: function() {
|
||||||
this.$refs['form'].validate(valid => {
|
this.$refs['form'].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.id !== undefined) {
|
if (this.form.id !== undefined) {
|
||||||
@ -324,7 +372,7 @@ export default {
|
|||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(function () {
|
}).then(function() {
|
||||||
return delMemberWithdrawalLog({ 'ids': Ids })
|
return delMemberWithdrawalLog({ 'ids': Ids })
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
@ -334,7 +382,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.msgError(response.msg)
|
this.msgError(response.msg)
|
||||||
}
|
}
|
||||||
}).catch(function () {
|
}).catch(function() {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -315,7 +315,8 @@ export default {
|
|||||||
paths: undefined,
|
paths: undefined,
|
||||||
action: undefined,
|
action: undefined,
|
||||||
parentId: undefined,
|
parentId: undefined,
|
||||||
sort: undefined
|
sort: undefined,
|
||||||
|
type: 'BUS'
|
||||||
}
|
}
|
||||||
this.resetForm('form')
|
this.resetForm('form')
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user