zhangxiao
2024-08-26 a4ca216c5b215f323b3c439b2f445dad72bbfce1
src/views/dmx/IntelligentAgent/index.vue
@@ -10,7 +10,16 @@
              style="width: 240px"
              @change="queryList"
            />
            <agent-config typeAngint="add"></agent-config>
            <a-button
              type="primary"
              @click="handleClick"
              style="margin-left: 10px"
            >
              <template #icon>
                <icon-plus />
              </template>
              新建智能体
            </a-button>
          </div>
          <a-divider style="margin: 10px 0" />
          <a-row justify="space-between">
@@ -72,12 +81,15 @@
                      >
                        <a-space>
                          <span v-show="!item.off">
                            <agent-config
                              ref="editAgentKuai"
                              typeAngint="edit"
                              :formData="item"
                              @queryList="queryList"
                            ></agent-config>
                              <a-button
                                type="text"
                                size="small"
                                @click="editClick(item)"
                              >
                              <template #icon>
                                <icon-tool />
                              </template>
                            </a-button>
                          </span>
                          <a-popconfirm
                            :content="'确定删除吗'"
@@ -132,7 +144,7 @@
                      >
                        <icon-calendar-clock />
                        <span style="font-size: 12px;margin-left: 10px">
                        {{ parseTime(item.create_date) }}
                        {{ moment(item.create_date).format('YYYY-MM-DD HH:mm:ss') }}
                        </span>
                      </div>
<!--                      <div-->
@@ -195,6 +207,12 @@
        </a-card>
      </a-col>
    </a-row>
    <agent-config
      ref="editAgentKuai"
      :typeAngint="addType"
      :formData="itemObj"
      @queryList="queryList"
    ></agent-config>
  </div>
</template>
@@ -208,18 +226,19 @@
    onBeforeUnmount,
  } from 'vue';
  import { Message } from '@arco-design/web-vue';
  import { deletedialog, queryCanvasList, querydialogList } from "@/api/Agent";
  import { deletedialog, queryCanvasList, querydialogdetail, 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';
  import { documentHeight, parseTime } from "@/utils";
  import moment from "moment";
  // console.log(documentHeight,'高度');
  let count = 5;
  const activeKey = ref(1);
  const addAgents = ref();
  const editAgentKuai = ref();
  const editAgentKuai = ref(null);
  const imgSrc = ref(logo);
  const agentList = ref([]);
  const agentNewList = ref([]);
@@ -232,10 +251,25 @@
  const visible = ref(false);
  const formRef = ref(null);
  const form = reactive({
    // size: 'medium',
    // name: '',
  });
  let addType = ref('add');
  let itemObj = reactive({});
  const form = reactive({});
  const handleClick = () => {
    addType.value = 'add';
    editAgentKuai.value.handleClick();
  };
  const editClick = async(data) => {
    let res = await querydialogdetail({
      dialog_id: data.id
    })
    Object.assign(itemObj, res.data);
    addType.value = 'edit';
    editAgentKuai.value.editClick();
  };
  const queryList = async (params = {}) => {
    setLoading(true);