|
@@ -4,6 +4,7 @@
|
|
|
<span class="card-title">机器人管理</span>
|
|
<span class="card-title">机器人管理</span>
|
|
|
</template>
|
|
</template>
|
|
|
<template v-slot:extra>
|
|
<template v-slot:extra>
|
|
|
|
|
+ <lay-button class="card-button" v-if="apiList?.includes('/userServer/save')" @click="handleTransfersRobot(selectedKeys)">移交机器人</lay-button>
|
|
|
<lay-button class="card-button" v-if="apiList?.includes('/userServer/save')" @click="handleCopyRobot(selectedKeys)">复制机器人</lay-button>
|
|
<lay-button class="card-button" v-if="apiList?.includes('/userServer/save')" @click="handleCopyRobot(selectedKeys)">复制机器人</lay-button>
|
|
|
<lay-button class="card-button" v-if="apiList?.includes('/userServer/save')" @click="handleUpdate(0)">添加</lay-button>
|
|
<lay-button class="card-button" v-if="apiList?.includes('/userServer/save')" @click="handleUpdate(0)">添加</lay-button>
|
|
|
</template>
|
|
</template>
|
|
@@ -94,11 +95,13 @@
|
|
|
</lay-card>
|
|
</lay-card>
|
|
|
<Update ref="updateRef" />
|
|
<Update ref="updateRef" />
|
|
|
<Copy ref="copyRef" />
|
|
<Copy ref="copyRef" />
|
|
|
|
|
+ <Transfers ref="transfersRef" />
|
|
|
</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, onBeforeUnmount } from "vue";
|
|
|
import Update from "./components/Update.vue";
|
|
import Update from "./components/Update.vue";
|
|
|
|
|
+import Transfers from "./components/Transfers.vue";
|
|
|
import Copy from "./components/Copy.vue";
|
|
import Copy from "./components/Copy.vue";
|
|
|
import TableButton from "@/components/TableButton.vue";
|
|
import TableButton from "@/components/TableButton.vue";
|
|
|
import { timeConverts } from "@/utils/index";
|
|
import { timeConverts } from "@/utils/index";
|
|
@@ -117,6 +120,7 @@ const ROBOT_STATUS: any = reactive({
|
|
|
const { proxy }: any = getCurrentInstance();
|
|
const { proxy }: any = getCurrentInstance();
|
|
|
const updateRef = ref();
|
|
const updateRef = ref();
|
|
|
const copyRef = ref();
|
|
const copyRef = ref();
|
|
|
|
|
+const transfersRef = ref();
|
|
|
|
|
|
|
|
const apiList = ref(window.sessionStorage.getItem("_4L_API_LIST"));
|
|
const apiList = ref(window.sessionStorage.getItem("_4L_API_LIST"));
|
|
|
|
|
|
|
@@ -199,6 +203,12 @@ const handleShowInfo = (info: any) => {
|
|
|
初始:<span class="primary-color">${info.startAmount || 0}</span> 现有:<span class="primary-color">${info.nowAmount || 0}</span>`;
|
|
初始:<span class="primary-color">${info.startAmount || 0}</span> 现有:<span class="primary-color">${info.nowAmount || 0}</span>`;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const handleTransfersRobot = async (ids: any) => {
|
|
|
|
|
+ if (ids.length == 0) return proxy.$message(`请先选择要移交机器!`, 7);
|
|
|
|
|
+ const result = await transfersRef.value.show(ids);
|
|
|
|
|
+ if (result) getPageInfo();
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
const handleCopyRobot = async (ids: any) => {
|
|
const handleCopyRobot = async (ids: any) => {
|
|
|
if (ids.length > 1 || ids.length == 0) return proxy.$message(`请勾选1个要复制的机器!`, 7);
|
|
if (ids.length > 1 || ids.length == 0) return proxy.$message(`请勾选1个要复制的机器!`, 7);
|
|
|
const result = await copyRef.value.show(ids[0]);
|
|
const result = await copyRef.value.show(ids[0]);
|