|
@@ -128,7 +128,6 @@
|
|
|
@click="handleStatus([row.id], 'RESTART')"
|
|
@click="handleStatus([row.id], 'RESTART')"
|
|
|
/>
|
|
/>
|
|
|
<TableButton v-if="apiList?.includes('/robot/delete') && ['STOPPED', 'STOP_PENDING', 'ERROR'].includes(row.status)" text="删除" @click="handleDelete(row)" />
|
|
<TableButton v-if="apiList?.includes('/robot/delete') && ['STOPPED', 'STOP_PENDING', 'ERROR'].includes(row.status)" text="删除" @click="handleDelete(row)" />
|
|
|
-
|
|
|
|
|
</lay-space>
|
|
</lay-space>
|
|
|
</template>
|
|
</template>
|
|
|
</lay-table>
|
|
</lay-table>
|
|
@@ -170,7 +169,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup name="BotManage">
|
|
<script lang="ts" setup name="BotManage">
|
|
|
-import { ref, reactive, getCurrentInstance, onBeforeUnmount } from "vue";
|
|
|
|
|
|
|
+import { ref, reactive, getCurrentInstance, onActivated, onDeactivated } from "vue";
|
|
|
import BatchUpdate from "./components/BatchUpdate.vue";
|
|
import BatchUpdate from "./components/BatchUpdate.vue";
|
|
|
import Update from "./components/Update.vue";
|
|
import Update from "./components/Update.vue";
|
|
|
import Transfers from "./components/Transfers.vue";
|
|
import Transfers from "./components/Transfers.vue";
|
|
@@ -253,16 +252,17 @@ let selectedKeys = ref([]);
|
|
|
let collectInfo = ref(`[0/0] 利润:<span class="primary-color">0(0%)</span> 初始:<span class="primary-color">0</span> 现有:<span class="primary-color">0</span>`);
|
|
let collectInfo = ref(`[0/0] 利润:<span class="primary-color">0(0%)</span> 初始:<span class="primary-color">0</span> 现有:<span class="primary-color">0</span>`);
|
|
|
let userList = ref();
|
|
let userList = ref();
|
|
|
let exchangeList = ref();
|
|
let exchangeList = ref();
|
|
|
|
|
+let refreshAsBotInterval = ref();
|
|
|
|
|
|
|
|
// 请求机器人列表
|
|
// 请求机器人列表
|
|
|
-const getPageInfo = (isSearch?: boolean) => {
|
|
|
|
|
|
|
+const getPageInfo = (isSearch?: boolean, isRefresh?: boolean) => {
|
|
|
if (isSearch) {
|
|
if (isSearch) {
|
|
|
pageParams.pageNum = 1;
|
|
pageParams.pageNum = 1;
|
|
|
selectedKeys.value = [];
|
|
selectedKeys.value = [];
|
|
|
}
|
|
}
|
|
|
- pageConfig.loading = true;
|
|
|
|
|
|
|
+ pageConfig.loading = true && !isRefresh;
|
|
|
get_as_robot_list(pageParams, (data: any) => {
|
|
get_as_robot_list(pageParams, (data: any) => {
|
|
|
- pageConfig.loading = false;
|
|
|
|
|
|
|
+ pageConfig.loading = false && !isRefresh;
|
|
|
if (data.code == 200) {
|
|
if (data.code == 200) {
|
|
|
dataSource.value = data.data.list;
|
|
dataSource.value = data.data.list;
|
|
|
tablePage.total = data.data.total;
|
|
tablePage.total = data.data.total;
|
|
@@ -290,16 +290,6 @@ const get_exchange_list = () => {
|
|
|
};
|
|
};
|
|
|
get_exchange_list();
|
|
get_exchange_list();
|
|
|
|
|
|
|
|
-let refreshInterval = setInterval(() => {
|
|
|
|
|
- get_as_robot_list(pageParams, (data: any) => {
|
|
|
|
|
- if (data.code == 200) {
|
|
|
|
|
- dataSource.value = data.data.list;
|
|
|
|
|
- tablePage.total = data.data.total;
|
|
|
|
|
- handleShowInfo(data.data);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-}, 2000);
|
|
|
|
|
-
|
|
|
|
|
const jumpDetail = (info: any) => {
|
|
const jumpDetail = (info: any) => {
|
|
|
window.open(`/bot/as/detail/${info.id}`);
|
|
window.open(`/bot/as/detail/${info.id}`);
|
|
|
};
|
|
};
|
|
@@ -459,9 +449,20 @@ const handleCurrentChange = (val: any) => {
|
|
|
getPageInfo();
|
|
getPageInfo();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-onBeforeUnmount(() => {
|
|
|
|
|
|
|
+let startInterval = () => {
|
|
|
|
|
+ refreshAsBotInterval.value = setInterval(() => {
|
|
|
|
|
+ getPageInfo(false, true);
|
|
|
|
|
+ }, 2000);
|
|
|
|
|
+};
|
|
|
|
|
+let closeInterval = () => {
|
|
|
|
|
+ clearInterval(refreshAsBotInterval.value);
|
|
|
|
|
+};
|
|
|
|
|
+onActivated(() => {
|
|
|
|
|
+ startInterval();
|
|
|
|
|
+});
|
|
|
|
|
+onDeactivated(() => {
|
|
|
document.title = "4L CAPITAL";
|
|
document.title = "4L CAPITAL";
|
|
|
- clearInterval(refreshInterval);
|
|
|
|
|
|
|
+ closeInterval();
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|