1\持仓信息
This commit is contained in:
		
							
								
								
									
										69
									
								
								src/api/admin/line-reverse-position.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										69
									
								
								src/api/admin/line-reverse-position.js
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,69 @@ | |||||||
|  | import request from '@/utils/request' | ||||||
|  |  | ||||||
|  | // 查询LineReversePosition列表 | ||||||
|  | export function listLineReversePosition(query) { | ||||||
|  |   return request({ | ||||||
|  |     url: '/api/v1/line-reverse-position', | ||||||
|  |     method: 'get', | ||||||
|  |     params: query | ||||||
|  |   }) | ||||||
|  | } | ||||||
|  |  | ||||||
|  | // 查询LineReversePosition详细 | ||||||
|  | export function getLineReversePosition(id) { | ||||||
|  |   return request({ | ||||||
|  |     url: '/api/v1/line-reverse-position/' + id, | ||||||
|  |     method: 'get' | ||||||
|  |   }) | ||||||
|  | } | ||||||
|  |  | ||||||
|  | // 新增LineReversePosition | ||||||
|  | export function addLineReversePosition(data) { | ||||||
|  |   return request({ | ||||||
|  |     url: '/api/v1/line-reverse-position', | ||||||
|  |     method: 'post', | ||||||
|  |     data: data | ||||||
|  |   }) | ||||||
|  | } | ||||||
|  |  | ||||||
|  | // 修改LineReversePosition | ||||||
|  | export function updateLineReversePosition(data) { | ||||||
|  |   return request({ | ||||||
|  |     url: '/api/v1/line-reverse-position/' + data.id, | ||||||
|  |     method: 'put', | ||||||
|  |     data: data | ||||||
|  |   }) | ||||||
|  | } | ||||||
|  |  | ||||||
|  | // 删除LineReversePosition | ||||||
|  | export function delLineReversePosition(data) { | ||||||
|  |   return request({ | ||||||
|  |     url: '/api/v1/line-reverse-position', | ||||||
|  |     method: 'delete', | ||||||
|  |     data: data | ||||||
|  |   }) | ||||||
|  | } | ||||||
|  |  | ||||||
|  | // 平仓 | ||||||
|  | export function closePosition(data) { | ||||||
|  |   return request({ | ||||||
|  |     url: '/api/v1/line-reverse-position/close/' + data.id, | ||||||
|  |     method: 'PUT' | ||||||
|  |   }) | ||||||
|  | } | ||||||
|  |  | ||||||
|  | // 批量平仓 | ||||||
|  | export function batchClosePosition(data) { | ||||||
|  |   return request({ | ||||||
|  |     url: '/api/v1/line-reverse-position/close-batch', | ||||||
|  |     method: 'PUT', | ||||||
|  |     data: data | ||||||
|  |   }) | ||||||
|  | } | ||||||
|  | // 清除所有仓位 | ||||||
|  | export function cleanAllPosition() { | ||||||
|  |   return request({ | ||||||
|  |     url: '/api/v1/line-reverse-position/clean-all', | ||||||
|  |     method: 'DELETE' | ||||||
|  |   }) | ||||||
|  | } | ||||||
| @ -50,6 +50,7 @@ | |||||||
|             >平仓 |             >平仓 | ||||||
|             </el-button> |             </el-button> | ||||||
|           </el-col> |           </el-col> | ||||||
|  |  | ||||||
|           <!-- <el-col :span="1.5"> |           <!-- <el-col :span="1.5"> | ||||||
|             <el-button v-permisaction="['admin:lineReversePosition:add']" type="primary" icon="el-icon-plus" size="mini" |             <el-button v-permisaction="['admin:lineReversePosition:add']" type="primary" icon="el-icon-plus" size="mini" | ||||||
|               @click="handleAdd">新增 |               @click="handleAdd">新增 | ||||||
| @ -59,12 +60,35 @@ | |||||||
|             <el-button v-permisaction="['admin:lineReversePosition:edit']" type="success" icon="el-icon-edit" |             <el-button v-permisaction="['admin:lineReversePosition:edit']" type="success" icon="el-icon-edit" | ||||||
|               size="mini" :disabled="single" @click="handleUpdate">修改 |               size="mini" :disabled="single" @click="handleUpdate">修改 | ||||||
|             </el-button> |             </el-button> | ||||||
|  |           </el-col> --> | ||||||
|  |           <el-col :span="1.5"> | ||||||
|  |             <el-button | ||||||
|  |               v-permisaction="['admin:lineReversePosition:remove']" | ||||||
|  |               type="danger" | ||||||
|  |               icon="el-icon-delete" | ||||||
|  |               size="mini" | ||||||
|  |               :disabled="multiple" | ||||||
|  |               @click="handleDelete" | ||||||
|  |             >删除 | ||||||
|  |             </el-button> | ||||||
|           </el-col> |           </el-col> | ||||||
|           <el-col :span="1.5"> |           <el-col :span="1.5"> | ||||||
|             <el-button v-permisaction="['admin:lineReversePosition:remove']" type="danger" icon="el-icon-delete" |             <el-popconfirm | ||||||
|               size="mini" :disabled="multiple" @click="handleDelete">删除 |               class="delete-popconfirm" | ||||||
|             </el-button> |               title="确认要清除所有吗?" | ||||||
|           </el-col> --> |               confirm-button-text="清除" | ||||||
|  |               @confirm="handleCleanPosition()" | ||||||
|  |             > | ||||||
|  |               <el-button | ||||||
|  |                 slot="reference" | ||||||
|  |                 v-permisaction="['admin:lineReversePosition:cleanAll']" | ||||||
|  |                 type="danger" | ||||||
|  |                 icon="el-icon-delete" | ||||||
|  |                 size="mini" | ||||||
|  |               >清除所有 | ||||||
|  |               </el-button> | ||||||
|  |             </el-popconfirm> | ||||||
|  |           </el-col> | ||||||
|         </el-row> |         </el-row> | ||||||
|  |  | ||||||
|         <el-table v-loading="loading" :data="lineReversePositionList" @selection-change="handleSelectionChange"> |         <el-table v-loading="loading" :data="lineReversePositionList" @selection-change="handleSelectionChange"> | ||||||
| @ -126,7 +150,7 @@ | |||||||
|                 @confirm="handleClosePosition(scope.row)" |                 @confirm="handleClosePosition(scope.row)" | ||||||
|               > |               > | ||||||
|                 <el-button |                 <el-button | ||||||
|                   v-if="scope.row.reverseStatus ===1" |                   v-if="scope.row.reverseStatus === 1" | ||||||
|                   slot="reference" |                   slot="reference" | ||||||
|                   v-permisaction="['admin:lineReversePosition:closePosition']" |                   v-permisaction="['admin:lineReversePosition:closePosition']" | ||||||
|                   size="mini" |                   size="mini" | ||||||
| @ -168,7 +192,7 @@ | |||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script> | <script> | ||||||
| import { delLineReversePosition, listLineReversePosition, getLineReversePosition, closePosition } from '@/api/admin/line-reverse-position' | import { delLineReversePosition, listLineReversePosition, getLineReversePosition, closePosition, cleanAllPosition } from '@/api/admin/line-reverse-position' | ||||||
| import Detail from './detail.vue' | import Detail from './detail.vue' | ||||||
| import OrderList from './order-list.vue' | import OrderList from './order-list.vue' | ||||||
| import ClosePosition from './close-position.vue' | import ClosePosition from './close-position.vue' | ||||||
| @ -349,6 +373,24 @@ export default { | |||||||
|           this.loading = false |           this.loading = false | ||||||
|           this.getList() |           this.getList() | ||||||
|         }) |         }) | ||||||
|  |     }, | ||||||
|  |     // 清除所有仓位 | ||||||
|  |     handleCleanPosition() { | ||||||
|  |       cleanAllPosition().then(res => { | ||||||
|  |         this.loading = true | ||||||
|  |         if (res.code === 200) { | ||||||
|  |           this.msgSuccess(res.msg) | ||||||
|  |           this.getList() | ||||||
|  |         } else { | ||||||
|  |           this.msgError(res.msg) | ||||||
|  |         } | ||||||
|  |       }) | ||||||
|  |         .catch(err => { | ||||||
|  |           console.log('err', err) | ||||||
|  |         }) | ||||||
|  |         .finally(() => { | ||||||
|  |           this.loading = false | ||||||
|  |         }) | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user