jialh
2024-12-26 69be381a8f6fe8c0c58201b0f2f157e32b38618c
样式修改
2个文件已修改
38 ■■■■ 已修改文件
src/view/IntelligentAgent/allAgent.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/view/IntelligentAgent/chat.vue 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/view/IntelligentAgent/allAgent.vue
@@ -15,6 +15,9 @@
            </div>
            <div class="tabs">
                <Tabs :value="type" @on-click="handleTabChange">
                    <TabPane label="我的收藏" name="-1">
                        <!-- 其他分类的产品 -->
                    </TabPane>
                    <TabPane label="企业" name="0">
                    </TabPane>
                    <TabPane label="行业" name="1">
@@ -30,9 +33,7 @@
                    </TabPane>
                    <TabPane label="思维" name="5">
                    </TabPane>
                    <TabPane label="我的收藏" name="-1">
                        <!-- 其他分类的产品 -->
                    </TabPane>
                    <!-- 更多TabPane -->
                </Tabs>
            </div>
@@ -93,7 +94,7 @@
            total: 0,
            userId: Number(localStorage.getItem('userId')),
            searchQuery: '',
            type: 0,
            type: '-1',
            products: [
            ],
            addAI: false,
src/view/IntelligentAgent/chat.vue
@@ -40,8 +40,9 @@
      <div v-else>
        <div class="description" v-html="query.Description"></div>
      </div>
      <img
        src="http://122.51.217.202/files/tools/8a597533-f35e-49a1-9384-4fc2c52d8153.png?timestamp=1735208676&nonce=189303a6da47c362c847c562d32fde76&sign=Fps9KCv73N6DeW9DaZfo8fe1xeRqJve2szObZxpxL7o="
        alt="">
      <div class="chat-list">
        <div class="chat-list-item" v-for="(item, index) in historyList" :key="item.Id">
          <div class="chat-list-item-content"
@@ -231,13 +232,35 @@
            Message: this.newMessage,
            isAnswer: false,
            copyMessage: this.newMessage,
            id:res.data.Data.UserId
            id: res.data.Data.UserId
          });
          // console.log('res.data.Data===========',res.data.Data);
          this.newMessage = '';
          this.loading = false; // 结束加载
          this.total = res.data.Data.Count;
          this.loadingSub = false;
          // 判断是否包含 .png 字段
          if (res.data.Data.Data.includes(".png")) {
            // 使用正则表达式提取图片 URL
            const regex = /!\[.*?\]\((.*?\.png.*?)\)/;
            const match = res.data.Data.Data.match(regex);
            if (match && match[1]) {
              const imageUrl = match[1]; // 提取到的图片 URL
              const baseUrl = "http://122.51.217.202"; // 基础 URL
              const fullImageUrl = `${baseUrl}${imageUrl}`; // 拼接完整 URL
              // 生成 <img> 标签
              const imgTag = `<img src="${fullImageUrl}" alt="报告图片">`;
              // 替换原数据中的图片部分为汉字 + 图片标签
              res.data.Data.Data = res.data.Data.Data.replace(regex, `${imgTag}`);
              console.log(imgTag); // 输出结果
            } else {
              console.log("未找到有效的图片 URL");
            }
          } else {
            console.log("数据中不包含 .png 字段");
          }
          // this.typeWriterEffect('系统', this.formatMessage(res.data.choices[0].message.content), true, res.data.AssistantId, res.data.choices[0].message.content);
          this.typeWriterEffect('系统', this.formatMessage(res.data.Data.Data), true, res.data.Data.AssistantId, res.data.Data.Data);