소스 검색

修改机器人仓位展示

DESKTOP-NE65RNK\Citrus_limon 1 년 전
부모
커밋
c70a66e639
2개의 변경된 파일10개의 추가작업 그리고 4개의 파일을 삭제
  1. 5 2
      src/views/bot/as/index.vue
  2. 5 2
      src/views/bot/manage/index.vue

+ 5 - 2
src/views/bot/as/index.vue

@@ -108,7 +108,7 @@
             <span :class="{ 'danger-color': timeConverts(row.lastReportTime).indexOf('秒') == -1 }">{{ row.lastReportTime ? timeConverts(row.lastReportTime) : "未通讯" }}</span>
           </template>
           <template v-slot:posNum="{ row }">
-            <span :class="{ 'danger-color': row.posNum > 0 }">{{ row.posNum > 0 ? row.posNum : 0 }}</span>
+            <span :class="{ 'danger-color': row.posNum != 0 }">{{row.posNum }}</span>
           </template>
           <template v-slot:updateTime="{ row }">
             <span>{{ timeConverts(row.updateTime) }}</span>
@@ -318,7 +318,10 @@ const handleCopyRobot = async (ids: any) => {
 // 批量修改
 const handleBatchUpdate = async (ids: any) => {
   if (ids.length == 0) return proxy.$message(`请先选择要设置机器!`, 7);
-  const botList = dataSource.value.filter((item: any) => ids.includes(item.id));
+  const botList: any = dataSource.value.filter((item: any) => ids.includes(item.id));
+  const strategyProgramId = botList[0].strategyProgramId;
+  const strategyProgramIdList = botList.filter((item: any) => item.strategyProgramId != strategyProgramId);
+  if (strategyProgramIdList.length > 0) return proxy.$message(`请先选择同一策略、策略版本机器!`, 7);
   const runningBotList = botList.filter((item: any) => ["RUNNING", "START_PENDING"].includes(item.status));
   if (runningBotList.length > 0) return proxy.$message(`请先停止正在运行的机器!`, 7);
   const result = await batchUpdateRef.value.show(botList);

+ 5 - 2
src/views/bot/manage/index.vue

@@ -108,7 +108,7 @@
             <span :class="{ 'danger-color': timeConverts(row.lastReportTime).indexOf('秒') == -1 }">{{ row.lastReportTime ? timeConverts(row.lastReportTime) : "未通讯" }}</span>
           </template>
           <template v-slot:posNum="{ row }">
-            <span :class="{ 'danger-color': row.posNum > 0 }">{{ row.posNum > 0 ? row.posNum : 0 }}</span>
+            <span :class="{ 'danger-color': row.posNum != 0 }">{{row.posNum }}</span>
           </template>
           <template v-slot:updateTime="{ row }">
             <span>{{ timeConverts(row.updateTime) }}</span>
@@ -319,7 +319,10 @@ const handleCopyRobot = async (ids: any) => {
 // 批量修改
 const handleBatchUpdate = async (ids: any) => {
   if (ids.length == 0) return proxy.$message(`请先选择要设置机器!`, 7);
-  const botList = dataSource.value.filter((item: any) => ids.includes(item.id));
+  const botList:any = dataSource.value.filter((item: any) => ids.includes(item.id));
+  const strategyProgramId = botList[0].strategyProgramId;
+  const strategyProgramIdList = botList.filter((item: any) => item.strategyProgramId != strategyProgramId);
+  if (strategyProgramIdList.length > 0) return proxy.$message(`请先选择同一策略、策略版本机器!`, 7);
   const runningBotList = botList.filter((item: any) => ["RUNNING", "START_PENDING"].includes(item.status));
   if (runningBotList.length > 0) return proxy.$message(`请先停止正在运行的机器!`, 7);
   const result = await batchUpdateRef.value.show(botList);