|
|
@@ -52,7 +52,17 @@
|
|
|
<div class="custom-group">
|
|
|
<lay-space>
|
|
|
<lay-button v-if="apiList?.includes('/robot/update')" :border="'green'" size="xs" @click="handleBatchUpdate(selectedKeys)">批量设置</lay-button>
|
|
|
- <lay-button :border="'green'" size="xs" @click="handleCopyParams(selectedKeys)">复制参数</lay-button>
|
|
|
+ <lay-button v-if="apiList?.includes('/robot/update')" :border="'green'" size="xs" @click="handleCopyParams(selectedKeys)">复制参数</lay-button>
|
|
|
+ </lay-space>
|
|
|
+ </div>
|
|
|
+ <div class="custom-group">
|
|
|
+ <lay-space>
|
|
|
+ <lay-tooltip position="bottom" content="把所有机器人杠杆调整成0.1,这样停机可以防止遗留仓位。">
|
|
|
+ <lay-button :border="'red'" size="xs" @click="handleSurviveRobot()"> 保命 </lay-button>
|
|
|
+ </lay-tooltip>
|
|
|
+ <lay-tooltip position="bottom" content="还原杠杆,可能会有的机器人没有开机成功,要检查下。">
|
|
|
+ <lay-button :border="'red'" size="xs" @click="handleRestoreRobot()"> 还原 </lay-button>
|
|
|
+ </lay-tooltip>
|
|
|
</lay-space>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -134,7 +144,7 @@ import Transfers from "./components/Transfers.vue";
|
|
|
import Copy from "./components/Copy.vue";
|
|
|
import TableButton from "@/components/TableButton.vue";
|
|
|
import { timeConverts } from "@/utils/index";
|
|
|
-import { get_robot_list, delete_robot, set_robot_status, set_robot_reset_capital, update_robot_batch } from "@/api";
|
|
|
+import { get_robot_list, delete_robot, set_robot_status, set_robot_reset_capital, update_robot_batch, survive_robot, restore_robot } from "@/api";
|
|
|
|
|
|
const ROBOT_STATUS: any = reactive({
|
|
|
STOPPED: "已停止",
|
|
|
@@ -178,7 +188,7 @@ interface TablePage {
|
|
|
limit: number;
|
|
|
total: number;
|
|
|
}
|
|
|
-const tablePage: TablePage = reactive({ current: 1, limit: 20, total: 0 });
|
|
|
+const tablePage: TablePage = reactive({ current: 1, limit: 20, total: 0, limits: [20, 50, 100, 200, 500] });
|
|
|
const columns = ref([
|
|
|
{ title: "选项", width: "44px", type: "checkbox" },
|
|
|
{ title: "ID", width: "60px", key: "id" },
|
|
|
@@ -295,7 +305,6 @@ const handleCopyParams = async (ids: any) => {
|
|
|
robotConfigs: [...configs, ...botConfigs],
|
|
|
};
|
|
|
});
|
|
|
- pageConfig.loading = true;
|
|
|
update_robot_batch(params, (data: any) => {
|
|
|
pageConfig.loading = false;
|
|
|
if (data.code == 200) {
|
|
|
@@ -305,6 +314,38 @@ const handleCopyParams = async (ids: any) => {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+// 保命方法
|
|
|
+const handleSurviveRobot = async () => {
|
|
|
+ let result = await proxy.$waitingConfirm("是否确认要执行保命操作?");
|
|
|
+ if (!result) return;
|
|
|
+
|
|
|
+ const params = {};
|
|
|
+ pageConfig.loading = true;
|
|
|
+ survive_robot(params, (data: any) => {
|
|
|
+ pageConfig.loading = false;
|
|
|
+ if (data.code == 200) {
|
|
|
+ proxy.$message(`执行成功!`);
|
|
|
+ getPageInfo();
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+// 还原方法
|
|
|
+const handleRestoreRobot = async () => {
|
|
|
+ let result = await proxy.$waitingConfirm("是否确认要执行还原操作?");
|
|
|
+ if (!result) return;
|
|
|
+
|
|
|
+ const params = {};
|
|
|
+ pageConfig.loading = true;
|
|
|
+ restore_robot(params, (data: any) => {
|
|
|
+ pageConfig.loading = false;
|
|
|
+ if (data.code == 200) {
|
|
|
+ proxy.$message(`执行成功!`);
|
|
|
+ getPageInfo();
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
const handleResetCapital = async (ids: any) => {
|
|
|
if (ids.length == 0) return proxy.$message(`请先选择要复位本金机器!`, 7);
|
|
|
let result = await proxy.$waitingConfirm("是否确认要复位机器本金?");
|