liudong
2024-08-12 a53981aea70d2247120954a96f9f462c6bad936b
src/views/dmx/IntelligentAgent/index.vue
@@ -16,7 +16,15 @@
          <a-row justify="space-between">
            <a-col :span="24">
              <a-spin :loading="loading" style="width: 100%">
                <a-scrollbar style="display: flex; flex-wrap: wrap;align-content: flex-start;overflow: auto;" :style="{height: documentHeight + 'px'}">
                <a-scrollbar
                  style="
                    display: flex;
                    flex-wrap: wrap;
                    align-content: flex-start;
                    overflow: auto;
                  "
                  :style="{ height: documentHeight + 'px' }"
                >
                  <div
                    class="card-wrap"
                    v-for="(item, index) of agentList"
@@ -41,36 +49,40 @@
                      </a-switch>
                      <div class="arco-card-body-content">
                        <div class="arco-card-body-content-top">
                        <span style="font-size: 18px; font-weight: 900">
                          {{ item.name }}
                        </span>
                          <span style="font-size: 18px; font-weight: 900">
                            {{ item.name }}
                          </span>
                        </div>
                        <div class="arco-card-body-content-down">
                          {{ item.prompt_config.prologue }}
                        </div>
                      </div>
                      <div style="position: absolute; bottom: 1.4rem; left: 1rem">
                      <div
                        style="position: absolute; bottom: 1.4rem; left: 1rem"
                      >
                        <icon-user />
                        <span style="font-size: 12px">
                        <!--                      {{ item.name }}-->
                      </span>
                      </div>
                      <div style="position: absolute; bottom: 1rem; right: 1rem">
                        <a-space>
                        <span v-show="!item.off">
                          <agent-config
                            ref="editAgentKuai"
                            typeAngint="edit"
                            :formData="item"
                            @queryList="queryList"
                          ></agent-config>
                          <!--                      {{ item.name }}-->
                        </span>
                      </div>
                      <div
                        style="position: absolute; bottom: 1rem; right: 1rem"
                      >
                        <a-space>
                          <span v-show="!item.off">
                            <agent-config
                              ref="editAgentKuai"
                              typeAngint="edit"
                              :formData="item"
                              @queryList="queryList"
                            ></agent-config>
                          </span>
                          <a-popconfirm
                            :content="'确定删除吗'"
                            type="warning"
                            @ok="deleteItem(item)"
                          >
                            <a-button type="text" >
                            <a-button type="text">
                              <template #icon>
                                <icon-delete />
                              </template>
@@ -81,40 +93,40 @@
                    </a-card>
                  </div>
                </a-scrollbar>
<!--                <div-->
<!--                  class="card-wrap"-->
<!--                  style="cursor: pointer"-->
<!--                  @click="handleAdd"-->
<!--                >-->
<!--                  <a-card :bordered="false" hoverable>-->
<!--                    <div style="margin-top: 30px; text-align: center">-->
<!--                      <a-avatar style="background: #3370ff">-->
<!--                        <icon-plus />-->
<!--                      </a-avatar>-->
<!--                    </div>-->
<!--                    <div class="arco-card-body-content">-->
<!--                      <div style="text-align: center; margin-top: 10px">-->
<!--                        新建智能体-->
<!--                      </div>-->
<!--                      <div-->
<!--                        style="-->
<!--                          text-align: center;-->
<!--                          margin-top: 10px;-->
<!--                          font-size: 12px;-->
<!--                          color: #999999;-->
<!--                        "-->
<!--                      >-->
<!--                        通过描述角色和任务来创建你的智能体<br />-->
<!--                        智能体可以调用多个工作流和工具-->
<!--                      </div>-->
<!--                    </div>-->
<!--                    <add-agent ref="addAgents"></add-agent>-->
<!--                    &lt;!&ndash;                    <div style="position: absolute; bottom: 1rem; right: 1rem;">&ndash;&gt;-->
<!--                    &lt;!&ndash;                      <a-space>&ndash;&gt;-->
<!--                    &lt;!&ndash;                      </a-space>&ndash;&gt;-->
<!--                    &lt;!&ndash;                    </div>&ndash;&gt;-->
<!--                  </a-card>-->
<!--                </div>-->
                <!--                <div-->
                <!--                  class="card-wrap"-->
                <!--                  style="cursor: pointer"-->
                <!--                  @click="handleAdd"-->
                <!--                >-->
                <!--                  <a-card :bordered="false" hoverable>-->
                <!--                    <div style="margin-top: 30px; text-align: center">-->
                <!--                      <a-avatar style="background: #3370ff">-->
                <!--                        <icon-plus />-->
                <!--                      </a-avatar>-->
                <!--                    </div>-->
                <!--                    <div class="arco-card-body-content">-->
                <!--                      <div style="text-align: center; margin-top: 10px">-->
                <!--                        新建智能体-->
                <!--                      </div>-->
                <!--                      <div-->
                <!--                        style="-->
                <!--                          text-align: center;-->
                <!--                          margin-top: 10px;-->
                <!--                          font-size: 12px;-->
                <!--                          color: #999999;-->
                <!--                        "-->
                <!--                      >-->
                <!--                        通过描述角色和任务来创建你的智能体<br />-->
                <!--                        智能体可以调用多个工作流和工具-->
                <!--                      </div>-->
                <!--                    </div>-->
                <!--                    <add-agent ref="addAgents"></add-agent>-->
                <!--                    &lt;!&ndash;                    <div style="position: absolute; bottom: 1rem; right: 1rem;">&ndash;&gt;-->
                <!--                    &lt;!&ndash;                      <a-space>&ndash;&gt;-->
                <!--                    &lt;!&ndash;                      </a-space>&ndash;&gt;-->
                <!--                    &lt;!&ndash;                    </div>&ndash;&gt;-->
                <!--                  </a-card>-->
                <!--                </div>-->
              </a-spin>
            </a-col>
          </a-row>
@@ -125,15 +137,23 @@
</template>
<script lang="ts" setup>
import { ref, reactive, nextTick, onBeforeMount, onMounted, onBeforeUnmount } from "vue";
  import {
    ref,
    reactive,
    nextTick,
    onBeforeMount,
    onMounted,
    onBeforeUnmount,
  } from 'vue';
  import { Message } from '@arco-design/web-vue';
  import { deletedialog, querydialogList } from '@/api/Agent';
  import useLoading from '@/hooks/loading';
  const { loading, setLoading } = useLoading(true);
  import EventBus from '@/utils/EventBus';
  import AgentConfig from "@/views/dmx/IntelligentAgent/components/agentConfig.vue";
  import logo from "../../../assets/images/model.png";
  let documentHeight = window.innerHeight - 320
  import AgentConfig from '@/views/dmx/IntelligentAgent/components/agentConfig.vue';
  import logo from '../../../assets/images/model.png';
  import { documentHeight } from '@/utils';
  // console.log(documentHeight,'高度');
  let count = 5;
  const activeKey = ref(1);
  const addAgents = ref();
@@ -213,14 +233,14 @@
  onBeforeMount(() => {
    queryList();
  });
  onMounted(()=>{
    EventBus.on('queryList',()=>{
  onMounted(() => {
    EventBus.on('queryList', () => {
      queryList();
    })
  })
  onBeforeUnmount(()=>{
    EventBus.off('queryList')
  })
    });
  });
  onBeforeUnmount(() => {
    EventBus.off('queryList');
  });
</script>
<script lang="ts">
@@ -339,7 +359,7 @@
      text-align: center;
    }
    .arco-card-body-content-down {
      text-align: center;
      // text-align: center;
      margin-top: 10px;
      font-size: 12px;
      color: #999999;