ソースを参照

优化机器人界面

DESKTOP-NE65RNK\Citrus_limon 1 年間 前
コミット
1bd52d4eec

+ 1 - 0
.env.development

@@ -1,4 +1,5 @@
 VITE_APP_ENV = development
 
 VITE_API_BASE_URL = "http://cc.skyfffire.com/api"
+# VITE_API_BASE_URL = "http://tcc.skyfffire.com/api"
 # VITE_API_BASE_URL = "http://192.168.1.2:81"

+ 4 - 2
src/views/bot/manage/components/BatchUpdate.vue

@@ -44,7 +44,8 @@
               <lay-col md="12" sm="12" xs="24">
                 <lay-form-item :label="item.name" :prop="`robotConfigs.${item.code}`">
                   <lay-input v-if="item.valType == 0" v-model="modelParams.robotConfigs[item.code]" @input="handleStringInput(item.code, $event)" />
-                  <lay-input v-if="item.valType == 1" v-model="modelParams.robotConfigs[item.code]" @input="handleNmberInput(item.code, $event)" />
+                  <lay-input v-if="item.valType == 1 && item.code != 'colo'" v-model="modelParams.robotConfigs[item.code]" @input="handleNmberInput(item.code, $event)" />
+                  <lay-switch v-if="item.valType == 1 && item.code == 'colo'" onswitch-value="1" unswitch-value="0" v-model="modelParams.robotConfigs[item.code]" />
                   <lay-switch v-if="item.valType == 2" v-model="modelParams.robotConfigs[item.code]" />
                   <lay-select v-if="item.valType == 3" v-model="modelParams.robotConfigs[item.code]" :show-search="true">
                     <lay-select-option v-for="items in item.contentVal.split(',')" :value="items" :label="items" />
@@ -184,7 +185,8 @@ const handleParams = (value: any) => {
   let openIntervals = new Decimal(0);
   let closeIntervals = new Decimal(0);
   return botDetailList.value.map((item: any) => {
-    let configs = item.configList.map((item: any) => {
+    const configList = item.configList || [];
+    let configs = configList.map((item: any) => {
       delete item.deleted;
       delete item.id;
       delete item.robotId;

+ 2 - 1
src/views/bot/manage/components/Update.vue

@@ -44,7 +44,8 @@
               <lay-col md="12" sm="12" xs="24">
                 <lay-form-item :label="item.name" :prop="`robotConfigs.${item.code}`">
                   <lay-input v-if="item.valType == 0" v-model="modelParams.robotConfigs[item.code]" @input="handleStringInput(item.code, $event)" />
-                  <lay-input v-if="item.valType == 1" v-model="modelParams.robotConfigs[item.code]" @input="handleNmberInput(item.code, $event)" />
+                  <lay-input v-if="item.valType == 1 && item.code != 'colo'" v-model="modelParams.robotConfigs[item.code]" @input="handleNmberInput(item.code, $event)" />
+                  <lay-switch v-if="item.valType == 1 && item.code == 'colo'" onswitch-value="1" unswitch-value="0" v-model="modelParams.robotConfigs[item.code]" />
                   <lay-switch v-if="item.valType == 2" v-model="modelParams.robotConfigs[item.code]" />
                   <lay-select v-if="item.valType == 3" v-model="modelParams.robotConfigs[item.code]" :show-search="true">
                     <lay-select-option v-for="items in item.contentVal.split(',')" :value="items" :label="items" />

+ 15 - 23
src/views/bot/manage/index.vue

@@ -38,17 +38,7 @@
         </div>
       </div>
       <div>
-        <lay-table
-          :page="tablePage"
-          :columns="columns"
-          size="sm"
-          resize
-          id="id"
-          :data-source="dataSource"
-          v-model:selected-keys="selectedKeys"
-          :loading="pageConfig.loading"
-          @change="handleCurrentChange"
-        >
+        <lay-table :page="tablePage" :columns="columns" resize id="id" :data-source="dataSource" v-model:selected-keys="selectedKeys" :loading="pageConfig.loading" @change="handleCurrentChange">
           <template v-slot:name="{ row }">
             <span v-if="apiList?.includes('/robot/findById')" class="normal-color" @click="jumpDetail(row)">{{ row.name }}</span>
             <span v-else>{{ row.name }}</span>
@@ -80,8 +70,8 @@
             {{ `${row.serverIp}:${row.callPort}` }}
           </template>
           <template v-slot:configs="{ row }">
-            <lay-tooltip :content="row.configs">
-              <div class="ellipsis-2" @click="handleUpdate(row)">{{ `${row.configs}` }}</div>
+            <lay-tooltip :content="row.configs || ''">
+              <div class="ellipsis-2" @click="handleUpdate(row)">{{ `${row.configs || ""}` }}</div>
             </lay-tooltip>
           </template>
           <template v-slot:lastReportTime="{ row }">
@@ -255,19 +245,21 @@ const handleCopyParams = async (ids: any) => {
   const otherBot = dataSource.value.filter((item: any) => ids.includes(item.id) && item.id != ids[0]);
   const result = await proxy.$waitingConfirm(`是否确认要把机器"${firstBot.name}"参数复制给"${otherBot.map((item: any) => item.name).join(",")}"?`);
   if (!result) return;
-  const configs = firstBot.configList.filter((item: any) => {
-    delete item.deleted;
-    delete item.id;
-    delete item.robotId;
-    return ![4, 5].includes(item.valType);
-  });
-  const params = otherBot.map((item: any) => {
-    const botConfigs: any = item.configList.filter((item: any) => {
+  const configs =
+    firstBot.configList?.filter((item: any) => {
       delete item.deleted;
       delete item.id;
       delete item.robotId;
-      return [4, 5].includes(item.valType);
-    });
+      return ![4, 5].includes(item.valType);
+    }) || [];
+  const params = otherBot.map((item: any) => {
+    const botConfigs: any =
+      item.configList?.filter((item: any) => {
+        delete item.deleted;
+        delete item.id;
+        delete item.robotId;
+        return [4, 5].includes(item.valType);
+      }) || [];
     return {
       id: item.id,
       name: item.name,