张涛 1 gadu atpakaļ
vecāks
revīzija
1e135076d3

+ 1 - 1
dist/assets/Agent-19744942.js → dist/assets/Agent-fbcd5c50.js

@@ -1 +1 @@
-import{a4 as t}from"./index-b2bdb8bc.js";function s(a){return t.get("/api/v1/canvas/list",{params:a})}function e(){return t.get("/api/v1/llm/distinct",{})}function n(a){return t.get("/api/v1/conversation/app_usage")}function o(a){return t.post("/api/v1/conversation/app_usage/rm",a)}export{n as a,e as b,o as d,s as q};
+import{a4 as t}from"./index-ea4ae601.js";function s(a){return t.get("/api/v1/canvas/list",{params:a})}function e(){return t.get("/api/v1/llm/distinct",{})}function n(a){return t.get("/api/v1/conversation/app_usage")}function o(a){return t.post("/api/v1/conversation/app_usage/rm",a)}export{n as a,e as b,o as d,s as q};

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/Knowledge-1973cbca.js


+ 1 - 1
dist/assets/Login-257b6501.js → dist/assets/Login-ca308015.js

@@ -1 +1 @@
-import{_ as g}from"./login-bd96354f.js";import{_ as f,m as v,x as i,C as w,D as k,E as n,v as p,B as V,r as a}from"./index-b2bdb8bc.js";const _=v({components:{},props:[],setup(){const{ajax:o,helper:e}=V("$global"),t=a(""),r=a("");return{login:async()=>{const l=await o.user.login(t.value,r.value);l&&(e.write("userName",l.nickname||l.username),e.write("token",l.access_token),e.goLink("/"))},username:t,password:r,goRegister:()=>{e.goLink("register")}}}});function y(o,e,t,r,u,d){const l=i("a-input"),m=i("a-input-password");return w(),k("main",null,[n("section",null,[e[6]||(e[6]=n("header",null,[n("img",{src:g}),n("p",null,"欢迎使用")],-1)),e[7]||(e[7]=n("p",null,"账号登录",-1)),n("section",null,[e[4]||(e[4]=n("p",null,"账号",-1)),n("div",null,[p(l,{placeholder:"请输入手机号",style:{width:"250px",height:"40px"},modelValue:o.username,"onUpdate:modelValue":e[0]||(e[0]=s=>o.username=s)},null,8,["modelValue"])])]),n("section",null,[e[5]||(e[5]=n("p",null,"密码",-1)),n("div",null,[p(m,{placeholder:"请输入手机号",style:{width:"250px",height:"40px"},modelValue:o.password,"onUpdate:modelValue":e[1]||(e[1]=s=>o.password=s)},null,8,["modelValue"])])]),n("section",null,[n("p",{style:{cursor:"pointer"},onClick:e[2]||(e[2]=(...s)=>o.goRegister&&o.goRegister(...s))},"去注册")]),n("div",{onClick:e[3]||(e[3]=(...s)=>o.login&&o.login(...s))},"登录")])])}const $=f(_,[["render",y],["__scopeId","data-v-c8b3e868"]]);export{$ as default};
+import{_ as g}from"./login-bd96354f.js";import{_ as f,m as v,x as i,C as w,D as k,E as n,v as p,B as V,r as a}from"./index-ea4ae601.js";const _=v({components:{},props:[],setup(){const{ajax:o,helper:e}=V("$global"),t=a(""),r=a("");return{login:async()=>{const l=await o.user.login(t.value,r.value);l&&(e.write("userName",l.nickname||l.username),e.write("token",l.access_token),e.goLink("/"))},username:t,password:r,goRegister:()=>{e.goLink("register")}}}});function y(o,e,t,r,u,d){const l=i("a-input"),m=i("a-input-password");return w(),k("main",null,[n("section",null,[e[6]||(e[6]=n("header",null,[n("img",{src:g}),n("p",null,"欢迎使用")],-1)),e[7]||(e[7]=n("p",null,"账号登录",-1)),n("section",null,[e[4]||(e[4]=n("p",null,"账号",-1)),n("div",null,[p(l,{placeholder:"请输入手机号",style:{width:"250px",height:"40px"},modelValue:o.username,"onUpdate:modelValue":e[0]||(e[0]=s=>o.username=s)},null,8,["modelValue"])])]),n("section",null,[e[5]||(e[5]=n("p",null,"密码",-1)),n("div",null,[p(m,{placeholder:"请输入手机号",style:{width:"250px",height:"40px"},modelValue:o.password,"onUpdate:modelValue":e[1]||(e[1]=s=>o.password=s)},null,8,["modelValue"])])]),n("section",null,[n("p",{style:{cursor:"pointer"},onClick:e[2]||(e[2]=(...s)=>o.goRegister&&o.goRegister(...s))},"去注册")]),n("div",{onClick:e[3]||(e[3]=(...s)=>o.login&&o.login(...s))},"登录")])])}const $=f(_,[["render",y],["__scopeId","data-v-c8b3e868"]]);export{$ as default};

+ 1 - 1
dist/assets/Register-4c9c4573.js → dist/assets/Register-b2d48078.js

@@ -1 +1 @@
-import{_ as g}from"./login-bd96354f.js";import{_ as f,m as v,x as p,C as w,D as _,E as s,v as a,B as V,r as u}from"./index-b2bdb8bc.js";const y=v({components:{},props:[],setup(){const{ajax:n,helper:e}=V("$global"),l=u(""),t=u("");return{register:async()=>{const r=await n.user.register(l.value,t.value);r&&(e.write("userName",String(r.username)),e.goLink("/login"))},username:l,password:t}}});function b(n,e,l,t,i,r){const d=p("a-input"),m=p("a-input-password");return w(),_("main",null,[s("section",null,[e[5]||(e[5]=s("header",null,[s("img",{src:g}),s("p",null,"欢迎使用")],-1)),e[6]||(e[6]=s("p",null,"账号注册",-1)),s("section",null,[e[3]||(e[3]=s("p",null,"账号",-1)),s("div",null,[a(d,{placeholder:"请输入账号",style:{width:"250px",height:"40px"},modelValue:n.username,"onUpdate:modelValue":e[0]||(e[0]=o=>n.username=o)},null,8,["modelValue"])])]),s("section",null,[e[4]||(e[4]=s("p",null,"密码",-1)),s("div",null,[a(m,{type:"password",placeholder:"请输入密码",style:{width:"250px",height:"40px"},modelValue:n.password,"onUpdate:modelValue":e[1]||(e[1]=o=>n.password=o)},null,8,["modelValue"])])]),s("div",{onClick:e[2]||(e[2]=(...o)=>n.register&&n.register(...o))},"注册")])])}const k=f(y,[["render",b],["__scopeId","data-v-b8d3c93b"]]);export{k as default};
+import{_ as g}from"./login-bd96354f.js";import{_ as f,m as v,x as p,C as w,D as _,E as s,v as a,B as V,r as u}from"./index-ea4ae601.js";const y=v({components:{},props:[],setup(){const{ajax:n,helper:e}=V("$global"),l=u(""),t=u("");return{register:async()=>{const r=await n.user.register(l.value,t.value);r&&(e.write("userName",String(r.username)),e.goLink("/login"))},username:l,password:t}}});function b(n,e,l,t,i,r){const d=p("a-input"),m=p("a-input-password");return w(),_("main",null,[s("section",null,[e[5]||(e[5]=s("header",null,[s("img",{src:g}),s("p",null,"欢迎使用")],-1)),e[6]||(e[6]=s("p",null,"账号注册",-1)),s("section",null,[e[3]||(e[3]=s("p",null,"账号",-1)),s("div",null,[a(d,{placeholder:"请输入账号",style:{width:"250px",height:"40px"},modelValue:n.username,"onUpdate:modelValue":e[0]||(e[0]=o=>n.username=o)},null,8,["modelValue"])])]),s("section",null,[e[4]||(e[4]=s("p",null,"密码",-1)),s("div",null,[a(m,{type:"password",placeholder:"请输入密码",style:{width:"250px",height:"40px"},modelValue:n.password,"onUpdate:modelValue":e[1]||(e[1]=o=>n.password=o)},null,8,["modelValue"])])]),s("div",{onClick:e[2]||(e[2]=(...o)=>n.register&&n.register(...o))},"注册")])])}const k=f(y,[["render",b],["__scopeId","data-v-b8d3c93b"]]);export{k as default};

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/authheader.vue_vue_type_script_setup_true_lang-329bdddc.js


+ 0 - 1
dist/assets/authheader.vue_vue_type_script_setup_true_lang-9519a097.js

@@ -1 +0,0 @@
-import{a4 as t,m as r,x as a,C as u,H as o}from"./index-b2bdb8bc.js";function m(e){return t.get("/base/system/role/list",{params:e})}function l(e){return t.delete("/base/system/role/"+e)}function p(e){return t.put("/base/system/role",{role:e})}function d(e){return t.post("/base/system/role",{role:e})}function f(e,s){return t.put("/base/system/role/changeStatus",{roleId:e,status:s})}function y(e){return t.get("/api/role/list",{params:e})}function b(e,s){return t.put("/base/system/user/changeStatus",{userId:e,status:s})}function g(e){return t.put("/base/system/user/profile/updatePwd",{userId:e})}function R(e){return t.put("/base/system/user",{user:e})}function _(e){return t.post("/base/system/user",{user:e})}function U(e){return t.delete("/base/system/user/"+e)}function h(e){return t.post("/base/system/dept/list",{deptName:e})}function L(e){return t.post("/base/system/dept",{organization:e})}function B(e){return t.delete("/base/system/dept/"+e)}function D(e){return t.put("/base/system/dept",{organization:e})}function O(e){return t.get("/base/system/dept/"+e)}function k(e){return t.get("/base/system/menu/treeselect")}function z(e){return t.post("/base/system/menu",{resource:e})}function A(e){return t.delete("/base/system/menu/"+e)}function w(e){return t.put("/base/system/menu",{resource:e})}function x(e){return t.get("/base/system/menu/"+e)}function C(e){return t.get("/base/system/knowledge/list?role="+e)}function I(e){return t.get("/base/system/dialog/list?role="+e)}function E(e){return t.post("/api/group/group_list",{params:e})}const G=r({__name:"authheader",props:{items:{type:Array,default(){return[]}}},setup(e){return(s,i)=>{const n=a("Breadcrumb");return u(),o(n,{items:e.items},null,8,["items"])}}});export{I as D,E as G,C as K,h as O,A as R,b as U,G as _,x as a,w as b,k as c,z as d,m as e,R as f,g,U as h,y as i,_ as j,B as k,O as l,D as m,L as n,p as o,f as p,l as q,d as r};

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/default-layout-f06c3426.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/index-14a88bc0.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/index-35fc4015.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/index-89732426.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/index-9afb58de.js


+ 1 - 1
dist/assets/index-b3667d75.js → dist/assets/index-9d223c0d.js

@@ -1 +1 @@
-import{m as s,r as n,U as r,ae as o,x as _,C as c,D as i,v as l,E as t,_ as d}from"./index-b2bdb8bc.js";const u={class:"container"},m={class:"iframe-box"},f=["src"],p={name:"Agent"},v=s({...p,setup(h){const e=n("");return r(()=>{e.value=`${o.RAGFlowUrl?o.RAGFlowUrl:window.location.origin}/flow?${localStorage.Authorization}`}),(x,g)=>{const a=_("Breadcrumb");return c(),i("div",u,[l(a,{items:["Agent","配置"]}),t("div",m,[t("iframe",{src:e.value,height:"100%",width:"100%",frameborder:"0"},null,8,f)])])}}});const B=d(v,[["__scopeId","data-v-82ea0634"]]);export{B as default};
+import{m as s,r as n,U as r,ae as o,x as _,C as c,D as i,v as l,E as t,_ as d}from"./index-ea4ae601.js";const u={class:"container"},m={class:"iframe-box"},f=["src"],p={name:"Agent"},v=s({...p,setup(h){const e=n("");return r(()=>{e.value=`${o.RAGFlowUrl?o.RAGFlowUrl:window.location.origin}/flow?${localStorage.Authorization}`}),(x,g)=>{const a=_("Breadcrumb");return c(),i("div",u,[l(a,{items:["Agent","配置"]}),t("div",m,[t("iframe",{src:e.value,height:"100%",width:"100%",frameborder:"0"},null,8,f)])])}}});const B=d(v,[["__scopeId","data-v-82ea0634"]]);export{B as default};

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/index-aba92c41.js


+ 1 - 1
dist/assets/index-e90575c9.js → dist/assets/index-cc11df6e.js

@@ -1,4 +1,4 @@
-import{a3 as qk,a4 as Ks,m as Of,r as Zt,a5 as Ta,U as t1,b as _h,V as bg,C as zr,D as Fn,E as or,u as Ti,J as _s,K as lc,L as xa,R as r1,_ as zu,l as Iu,a6 as n1,f as wA,w as i1,x as vn,v as Qr,F as Fr,G as Ya,a7 as Ig,Q as qs,Z as mu,M as ys,n as XI,H as Ma,I as Ca,a8 as X5,N as wh,O as Bh,a9 as Wk,aa as Kk,ab as $5,ac as zk,ad as Vk}from"./index-b2bdb8bc.js";import{a as U5,d as Zk,q as Xk}from"./Agent-19744942.js";import{p as $k}from"./icon-chart-38e5438e.js";import{a as JI}from"./auth-54229761.js";import{a as xB,u as e9}from"./index-49952fb9.js";const SB="/assets/icon-user-007bea0f.jpg",Vp="/assets/icon-picture-144a065f.png";var t9=Object.defineProperty,r9=(D,U,K)=>U in D?t9(D,U,{enumerable:!0,configurable:!0,writable:!0,value:K}):D[U]=K,PI=(D,U,K)=>r9(D,typeof U!="symbol"?U+"":U,K);class j5 extends Error{constructor(U,K){super(U),PI(this,"type"),PI(this,"field"),PI(this,"value"),PI(this,"line"),this.name="ParseError",this.type=K.type,this.field=K.field,this.value=K.value,this.line=K.line}}function dB(D){}function n9(D){const{onEvent:U=dB,onError:K=dB,onRetry:ee=dB,onComment:ge}=D;let Ue="",ht=!0,ut,_t="",Jt="";function ar(sr){const Ir=ht?sr.replace(/^\xEF\xBB\xBF/,""):sr,[hn,Oe]=i9(`${Ue}${Ir}`);for(const Et of hn)Tt(Et);Ue=Oe,ht=!1}function Tt(sr){if(sr===""){yr();return}if(sr.startsWith(":")){ge&&ge(sr.slice(sr.startsWith(": ")?2:1));return}const Ir=sr.indexOf(":");if(Ir!==-1){const hn=sr.slice(0,Ir),Oe=sr[Ir+1]===" "?2:1,Et=sr.slice(Ir+Oe);Fe(hn,Et,sr);return}Fe(sr,"",sr)}function Fe(sr,Ir,hn){switch(sr){case"event":Jt=Ir;break;case"data":_t=`${_t}${Ir}
+import{a3 as qk,a4 as Ks,m as Of,r as Zt,a5 as Ta,U as t1,b as _h,V as bg,C as zr,D as Fn,E as or,u as Ti,J as _s,K as lc,L as xa,R as r1,_ as zu,l as Iu,a6 as n1,f as wA,w as i1,x as vn,v as Qr,F as Fr,G as Ya,a7 as Ig,Q as qs,Z as mu,M as ys,n as XI,H as Ma,I as Ca,a8 as X5,N as wh,O as Bh,a9 as Wk,aa as Kk,ab as $5,ac as zk,ad as Vk}from"./index-ea4ae601.js";import{a as U5,d as Zk,q as Xk}from"./Agent-fbcd5c50.js";import{p as $k}from"./icon-chart-38e5438e.js";import{a as JI}from"./auth-54229761.js";import{a as xB,u as e9}from"./index-14a88bc0.js";const SB="/assets/icon-user-007bea0f.jpg",Vp="/assets/icon-picture-144a065f.png";var t9=Object.defineProperty,r9=(D,U,K)=>U in D?t9(D,U,{enumerable:!0,configurable:!0,writable:!0,value:K}):D[U]=K,PI=(D,U,K)=>r9(D,typeof U!="symbol"?U+"":U,K);class j5 extends Error{constructor(U,K){super(U),PI(this,"type"),PI(this,"field"),PI(this,"value"),PI(this,"line"),this.name="ParseError",this.type=K.type,this.field=K.field,this.value=K.value,this.line=K.line}}function dB(D){}function n9(D){const{onEvent:U=dB,onError:K=dB,onRetry:ee=dB,onComment:ge}=D;let Ue="",ht=!0,ut,_t="",Jt="";function ar(sr){const Ir=ht?sr.replace(/^\xEF\xBB\xBF/,""):sr,[hn,Oe]=i9(`${Ue}${Ir}`);for(const Et of hn)Tt(Et);Ue=Oe,ht=!1}function Tt(sr){if(sr===""){yr();return}if(sr.startsWith(":")){ge&&ge(sr.slice(sr.startsWith(": ")?2:1));return}const Ir=sr.indexOf(":");if(Ir!==-1){const hn=sr.slice(0,Ir),Oe=sr[Ir+1]===" "?2:1,Et=sr.slice(Ir+Oe);Fe(hn,Et,sr);return}Fe(sr,"",sr)}function Fe(sr,Ir,hn){switch(sr){case"event":Jt=Ir;break;case"data":_t=`${_t}${Ir}
 `;break;case"id":ut=Ir.includes("\0")?void 0:Ir;break;case"retry":/^\d+$/.test(Ir)?ee(parseInt(Ir,10)):K(new j5(`Invalid \`retry\` value: "${Ir}"`,{type:"invalid-retry",value:Ir,line:hn}));break;default:K(new j5(`Unknown field "${sr.length>20?`${sr.slice(0,20)}…`:sr}"`,{type:"unknown-field",field:sr,value:Ir,line:hn}));break}}function yr(){_t.length>0&&U({id:ut,event:Jt||void 0,data:_t.endsWith(`
 `)?_t.slice(0,-1):_t}),ut=void 0,_t="",Jt=""}function Le(sr={}){Ue&&sr.consume&&Tt(Ue),ut=void 0,_t="",Jt="",Ue=""}return{feed:ar,reset:Le}}function i9(D){const U=[];let K="";const ee=D.length;for(let ge=0;ge<ee;ge++){const Ue=D[ge];Ue==="\r"&&D[ge+1]===`
 `?(U.push(K),K="",ge++):Ue==="\r"||Ue===`

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/index-dc4b8766.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/index-ea4ae601.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/index-f148477b.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/index-fad2f281.css


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/index-fe826074.js


+ 1 - 1
dist/assets/loading-301f346e.js → dist/assets/loading-0fc0ab79.js

@@ -1 +1 @@
-import{r as a}from"./index-b2bdb8bc.js";function l(e=!1){const o=a(e);return{loading:o,setLoading:t=>{o.value=t},toggle:()=>{o.value=!o.value}}}export{l as u};
+import{r as a}from"./index-ea4ae601.js";function l(e=!1){const o=a(e);return{loading:o,setLoading:t=>{o.value=t},toggle:()=>{o.value=!o.value}}}export{l as u};

+ 2 - 2
dist/index.html

@@ -5,8 +5,8 @@
         <link rel="icon" href="/logo.svg" />
         <meta name="viewport" content="width=device-width, initial-scale=1.0" />
         <title>大模型系统</title>
-      <script type="module" crossorigin src="/assets/index-b2bdb8bc.js"></script>
-      <link rel="stylesheet" href="/assets/index-d345ee6b.css">
+      <script type="module" crossorigin src="/assets/index-ea4ae601.js"></script>
+      <link rel="stylesheet" href="/assets/index-fad2f281.css">
     </head>
     <body>
         <div id="app"></div>

+ 3 - 2
src/api/authority.ts

@@ -1,5 +1,6 @@
-import axios from "axios";
+import axios from "./request";
 import { Pagination } from "@/types/global";
+import request from '../ajax/request';
 
 export interface User {
   userId: string;
@@ -107,7 +108,7 @@ export function Rolestatus(roleId, status) {
 }
 
 export function UserList(params: Pagination) {
-  return axios.get<Result<User[]>>("/api/role/list", { params });
+  return request.get<Result<User[]>>("/api/role/list", { params });
 }
 
 export function Userstatus(userID, status) {

+ 73 - 0
src/api/request.ts

@@ -0,0 +1,73 @@
+import axios from "axios";
+import router from "@/router";
+import ArcoVue from "@arco-design/web-vue";
+import helper from "@/utils/helper";
+const service = axios.create({
+  withCredentials: true, // 跨域发送 cookie
+  timeout: 300000, // 请求超时
+  headers: {
+    "Content-Type": "application/json"
+  }
+});
+service.interceptors.request.use(
+  (config) => {
+    helper.setLoading(true);
+    if (helper.read("token")) {
+      config.headers["Authorization"] = `Bearer ${helper.read("token")}`;
+    }
+    return config;
+  },
+  (error) => {
+    console.error(error);
+    // 请求出错
+    return Promise.reject(error);
+  }
+);
+
+/**
+ * 当响应 401, 跳转登录
+ * @param {*} response
+ */
+const handlerLogin = (response) => {
+  if (response?.status == 401) {
+    ArcoVue.Message["error"]({ content: `登录已过期,请重新登录`, duration: 2000 });
+    setTimeout(() => {
+      router.push("/login");
+    }, 2000);
+
+    helper.setLoading(false);
+    return true;
+  }
+  return false;
+};
+
+/**
+ * 响应 403状态, 发送权限拦截事件
+ * @param {*} response
+ */
+const handler403 = (response) => {
+  if (response?.status !== 403) { return response };
+};
+
+service.interceptors.response.use(
+  (response) => {
+    const { code, data, msg } = response.data;
+    helper.setLoading(false);
+    if (code === 200) {
+      return data;
+    } else {
+      ArcoVue.Message["error"]({ content: msg, duration: 1500 });
+      return false;
+    }
+  },
+  (error) => {
+    if (handlerLogin(error.response)) return
+
+    handler403(error.response);
+    helper.setLoading(false);
+    ArcoVue.Message["error"]({ content: `网络异常,请稍后重试`, duration: 1500 });
+    // return false;
+  }
+);
+
+export default service;

+ 2 - 2
src/components/DialogWrap.vue

@@ -65,7 +65,7 @@
                     <span>
                       <em v-for="(item, documentIndex) in document.list" :key="documentIndex">{{
                         item.title
-                        }}</em>
+                      }}</em>
                     </span>
                     <icon-caret-down size="12" v-if="documentKey === menuList[key].documentOpenIndex" />
                     <icon-caret-right size="12" v-else />
@@ -76,7 +76,7 @@
                       <a-typography-paragraph :ellipsis="{ rows: 3, css: true }" :style="{ flex: 1, margin: '0' }">
                         <span style="color: rgba(153, 153, 153, 1); font-size: 12px">{{
                           item.content
-                          }}</span>
+                        }}</span>
                       </a-typography-paragraph>
                     </p>
                   </div>

+ 460 - 437
src/components/DocumentCards.vue

@@ -1,498 +1,521 @@
 <template>
-    <main>
-        <section>
-            <div v-for="(item, key) in data" :key="key" :style="{ background: item.background }">
-                <img :src="getAssetURL(item.img)" />
-                <div :style="{ color: item.color }">
-                    {{ item.title }}
-                    <span>{{ item.content }}</span>
-                </div>
-            </div>
-        </section>
-        <footer v-if="hasUpload">
-            <a-popover :popup-visible="showUpload" position="tl" @popup-visible-change="() => {
-                showDeleteTooltip = false;
-            }
+  <main>
+    <section>
+      <div v-for="(item, key) in data" :key="key" :style="{ background: item.background }">
+        <img :src="getAssetURL(item.img)" />
+        <div :style="{ color: item.color }">
+          {{ item.title }}
+          <span>{{ item.content }}</span>
+        </div>
+      </div>
+    </section>
+    <footer v-if="hasUpload">
+      <a-popover :popup-visible="showUpload" position="tl" @popup-visible-change="() => {
+        showDeleteTooltip = false;
+      }
+        ">
+        <div :class="{ 'text-hide': showUpload }">
+          <div @click="() => {
+            showUpload = true;
+          }
+            ">
+            <img src="@/assets/document/3.svg" class="img-normal" v-if="!showUpload" />
+            <img src="@/assets/document/4.svg" class="img-hover" v-if="!showUpload" />
+            <img src="@/assets/document/5.svg" class="img-active" v-if="showUpload" />
+          </div>
+          <p>已选择 {{ fileList.length }} 个文档</p>
+        </div>
+        <template #content>
+          <div :class="{ 'upload-wrap': true, 'upload-wrap-narrow': uploadFile }">
+            <header>
+              <p>{{ uploadFile ? "上传文档" : "文档解析站" }}</p>
+              <div @click="() => {
+                showUpload = false;
+              }
                 ">
-                <div :class="{ 'text-hide': showUpload }">
-                    <div @click="() => {
-                        showUpload = true;
-                    }
-                        ">
-                        <img src="@/assets/document/3.svg" class="img-normal" v-if="!showUpload" />
-                        <img src="@/assets/document/4.svg" class="img-hover" v-if="!showUpload" />
-                        <img src="@/assets/document/5.svg" class="img-active" v-if="showUpload" />
+                <icon-close size="large" />
+              </div>
+            </header>
+            <div>
+
+              <section>
+                <a-upload draggable :multiple="!uploadFile" :limit="50" @before-upload="onBeforeUpload"
+                  @exceed-limit="onExceedLimit" @before-remove="onBeforeRemove" :custom-request="customRequest"
+                  :show-upload-button="{ showOnExceedLimit: true }" accept="*">
+                  <template #upload-button>
+                    <div class="upload-main">
+                      <p>拖拽文档到这里,或<span>点此上传</span></p>
+                      <span>
+                        支持上传{{ uploadFile ? ".txt,.pdf" : ".xlsx‌文档" }},大小不超过30M
+                      </span>
                     </div>
-                    <p>已选择 {{ fileList.length }} 个文档</p>
-                </div>
-                <template #content>
-                    <div :class="{ 'upload-wrap': true, 'upload-wrap-narrow': uploadFile }">
-                        <header>
-                            <p>{{ uploadFile ? "上传文档" : "文档解析站" }}</p>
-                            <div @click="() => {
-                                showUpload = false;
-                            }
-                                ">
-                                <icon-close size="large" />
-                            </div>
-                        </header>
-                        <div>
-
-                            <section>
-                                <a-upload draggable :multiple="!uploadFile" :limit="50" @before-upload="onBeforeUpload"
-                                    @exceed-limit="onExceedLimit" @before-remove="onBeforeRemove"
-                                    :custom-request="customRequest" :show-upload-button="{ showOnExceedLimit: true }"
-                                    accept="*">
-                                    <template #upload-button>
-                                        <div class="upload-main">
-                                            <p>拖拽文档到这里,或<span>点此上传</span></p>
-                                            <span>
-                                                支持上传{{ uploadFile ? ".txt,.pdf" : ".xlsx‌文档" }},大小不超过30M
-                                            </span>
-                                        </div>
-                                    </template>
-                                </a-upload>
-                            </section>
-                            <div v-if="!uploadFile && false">
-                                <p>
-                                    <span>已解析文件列表</span>
-                                    <span>共{{ tableData.length }}个</span>
-                                </p>
-                                <div>
-                                    <a-table :pagination="false" row-key="name" :columns="columns" :data="tableData"
-                                        :row-selection="rowSelection" v-model:selectedKeys="selectedKeys">
-                                        <template #methods="{ record }">
-                                            <a-tooltip content="下载">
-                                                <div class="method-button" @click="downloadDocument(record)">
-                                                    <icon-cloud-download />
-                                                </div>
-                                            </a-tooltip>
-                                            <a-popover :popup-visible="showDeleteTooltip && deleteId === record.key">
-                                                <a-tooltip content="删除">
-                                                    <div class="method-button" @click="handleDeleteButton(record.key)">
-                                                        <icon-delete />
-                                                    </div>
-                                                </a-tooltip>
-                                                <template #content>
-                                                    <div>
-                                                        <p>删除后无法恢复,您是否删除?</p>
-                                                        <div class="delete-buttons">
-                                                            <div>
-                                                                <a-button size="mini" type="primary"
-                                                                    style="margin-right: 10px"
-                                                                    @click="deleteDocument">确认</a-button>
-                                                                <a-button size="mini" type="outline" @click="() => {
-                                                                    showDeleteTooltip = false;
-                                                                }
-                                                                    ">取消</a-button>
-                                                            </div>
-                                                        </div>
-                                                    </div>
-                                                </template>
-                                            </a-popover>
-                                        </template>
-                                    </a-table>
-                                </div>
-                            </div>
+                  </template>
+                </a-upload>
+              </section>
+              <div v-if="!uploadFile && false">
+                <p>
+                  <span>已解析文件列表</span>
+                  <span>共{{ tableData.length }}个</span>
+                </p>
+                <div>
+                  <a-table :pagination="false" row-key="name" :columns="columns" :data="tableData"
+                    :row-selection="rowSelection" v-model:selectedKeys="selectedKeys">
+                    <template #methods="{ record }">
+                      <a-tooltip content="下载">
+                        <div class="method-button" @click="downloadDocument(record)">
+                          <icon-cloud-download />
                         </div>
-                    </div>
-                    <div class="bottom-buttons">
-                        <div>
-                            <a-button type="outline" style="margin-right: 10px"
-                                @click="selectFiles(false)">取消</a-button>
-                            <a-button :loading="buttonLoading" type="primary" @click="selectFiles(true, 'paper')">去{{
-                                uploadFile ? '提问'
-                                    : '合并'
-                            }}({{ fileList.length
-                                }})</a-button>
-                        </div>
-                    </div>
-                </template>
-            </a-popover>
-            <!-- <section v-if="hasSlider">
+                      </a-tooltip>
+                      <a-popover :popup-visible="showDeleteTooltip && deleteId === record.key">
+                        <a-tooltip content="删除">
+                          <div class="method-button" @click="handleDeleteButton(record.key)">
+                            <icon-delete />
+                          </div>
+                        </a-tooltip>
+                        <template #content>
+                          <div>
+                            <p>删除后无法恢复,您是否删除?</p>
+                            <div class="delete-buttons">
+                              <div>
+                                <a-button size="mini" type="primary" style="margin-right: 10px"
+                                  @click="deleteDocument">确认</a-button>
+                                <a-button size="mini" type="outline" @click="() => {
+                                  showDeleteTooltip = false;
+                                }
+                                  ">取消</a-button>
+                              </div>
+                            </div>
+                          </div>
+                        </template>
+                      </a-popover>
+                    </template>
+                  </a-table>
+                </div>
+              </div>
+            </div>
+          </div>
+          <div class="bottom-buttons">
+            <div>
+              <a-button type="outline" style="margin-right: 10px" @click="selectFiles(false)">取消</a-button>
+              <a-button :loading="buttonLoading" type="primary" @click="selectFiles(true, 'paper')">去{{
+                uploadFile ? '提问'
+                  : '合并'
+              }}({{ fileList.length
+                }})</a-button>
+            </div>
+          </div>
+        </template>
+      </a-popover>
+      <!-- <section v-if="hasSlider">
                 <p>出题随机性</p>
                 <a-slider :default-value="50" :style="{ width: '100px' }" />
             </section> -->
-        </footer>
-    </main>
+    </footer>
+  </main>
 </template>
 <script>
 import { defineComponent, ref, inject, reactive } from "vue";
 export default defineComponent({
-    props: ["data", "hasUpload", "hasSlider", "uploadFile", "isQuestion", "agentId"],
-    setup(props) {
-        const showUpload = ref(false);
-        const { helper, ajax } = inject("$global");
-        const maxSize = 30 * 1024 * 1024;
-        let fileList = ref([]);
-        let formData = new FormData();
-        const showDeleteTooltip = ref(false);
-        const deleteId = ref("");
-        const buttonLoading = ref(false);
-        const selectFiles = async (isSelect, type) => {
-            if (isSelect) {
-                if (props.uploadFile) {
-                    const data = await ajax.message.createDialog(props.agentId);
-                    fileList.value.forEach(file => {
-                        formData.append('file', file)
-                    });
-                    buttonLoading.value = true;
-                    const result = await ajax.file.uploadFile(props.agentId, data.chat_id, formData);
-                    showUpload.value = false;
-                    helper.dialogConfig = {
-                        isQuestion: props.isQuestion,
-                        selectedKeys: selectedKeys.value,
-                        type
-                    };
-                    buttonLoading.value = false;
-                    if (result) {
-                        helper.write('docId', result.doc_ids[0]);
-                    }
-                } else {
-                    fileList.value.forEach(file => {
-                        formData.append('files', file)
-                    });
-                    await ajax.file.uploadExcels(formData);
-                    helper.$bus.emit("open-dialog", '合并Excel');
-                }
-            }
-
-        };
-        const handleDeleteButton = (id) => {
-            showDeleteTooltip.value = true;
-            deleteId.value = id;
-        };
-        const onBeforeUpload = (file) => {
-            if (file.size > maxSize) {
-                helper.message("error", `上传文件大小不能超过10M`);
-                return false;
-            }
-            return true;
-        };
-        const onExceedLimit = () => {
-            helper.message("error", `最多上传50个文件`);
-        };
-        const customRequest = async (option) => {
-            const { onSuccess, fileItem } = option;
-            const { file } = fileItem;
-            fileList.value.push(file);
-            onSuccess();
-        };
-        const onBeforeRemove = (data) => {
-            fileList.value = fileList.value.filter((item) => item.id !== data.uid);
-            return true;
-        };
-        const selectedKeys = ref([]);
-
-        const rowSelection = reactive({
-            type: "checkbox",
-            showCheckedAll: true,
-            onlyCurrent: false
-        });
-
-        const columns = [
-            {
-                title: "文件名称",
-                dataIndex: "name"
-            },
-            {
-                title: "类型",
-                dataIndex: "type"
-            },
-            {
-                title: "大小",
-                dataIndex: "size"
-            },
-            {
-                title: "上传时间",
-                dataIndex: "time"
-            },
-            {
-                title: "操作",
-                slotName: "methods"
-            }
-        ];
-        const tableData = reactive([
-            {
-                key: "1",
-                name: "文件名称1",
-                type: "pdf",
-                size: "13M",
-                time: "2024.9.8"
-            },
-            {
-                key: "2",
-                name: "文件名称2",
-                type: "pdf",
-                size: "13M",
-                time: "2024.9.8"
-            },
-            {
-                key: "3",
-                name: "文件名称3",
-                type: "pdf",
-                size: "13M",
-                time: "2024.9.8"
+  props: ["data", "hasUpload", "hasSlider", "uploadFile", "isQuestion", "agentId"],
+  setup(props) {
+    const showUpload = ref(false);
+    const { helper, ajax } = inject("$global");
+
+    const maxSize = 30 * 1024 * 1024;
+    let fileList = ref([]);
+    let formData = new FormData();
+    let inputData = ref([]);
+    const showDeleteTooltip = ref(false);
+    const deleteId = ref("");
+    const buttonLoading = ref(false);
+    const selectFiles = async (isSelect, type) => {
+      if (isSelect) {
+        if (props.uploadFile) {
+          const data = await ajax.message.createDialog(props.agentId);
+          fileList.value.forEach(file => {
+            formData.append('file', file)
+          });
+          buttonLoading.value = true;
+          const result = await ajax.file.uploadFile(props.agentId, data.chat_id, formData);
+          showUpload.value = false;
+          helper.dialogConfig = {
+            isQuestion: props.isQuestion,
+            selectedKeys: selectedKeys.value,
+            type
+          };
+          buttonLoading.value = false;
+
+          // TODO 判断是毕生还是regflow
+          // 以下为毕生
+          inputData.push({
+            name: result.file_name,
+            file_path: result.file_path,
+            value: ""
+          });
+
+          const sendData = {
+            chatHistory: [],
+            name: "文档智能",
+            description: "文档智能",
+            inputs: {
+              report_name: inputData.map(item => item.name).join(', '),
+              id: "Report-PRcYL",
+              data: inputData
             }
-        ]);
-        const downloadDocument = (record) => { };
-        const deleteDocument = () => { };
-        return {
-            buttonLoading,
-            fileList,
-            selectedKeys,
-            getAssetURL: helper.getAssetURL,
-            showUpload,
-            onBeforeUpload,
-            onExceedLimit,
-            onBeforeRemove,
-            customRequest,
-            columns,
-            tableData,
-            rowSelection,
-            downloadDocument,
-            deleteDocument,
-            showDeleteTooltip,
-            deleteId,
-            handleDeleteButton,
-            selectFiles
-        };
-    }
+          };
+          setTimeout(() => {
+            helper.$bus.emit("send-message", sendData);
+          }, 500);
+
+          // if (result) {
+          //     helper.write('docId', result.doc_ids[0]);
+          // }
+
+        } else {
+          fileList.value.forEach(file => {
+            formData.append('files', file)
+          });
+          await ajax.file.uploadExcels(formData);
+          helper.$bus.emit("open-dialog", '合并Excel');
+        }
+      }
+
+    };
+    const handleDeleteButton = (id) => {
+      showDeleteTooltip.value = true;
+      deleteId.value = id;
+    };
+    const onBeforeUpload = (file) => {
+      if (file.size > maxSize) {
+        helper.message("error", `上传文件大小不能超过10M`);
+        return false;
+      }
+      return true;
+    };
+    const onExceedLimit = () => {
+      helper.message("error", `最多上传50个文件`);
+    };
+    const customRequest = async (option) => {
+      const { onSuccess, fileItem } = option;
+      const { file } = fileItem;
+      fileList.value.push(file);
+      onSuccess();
+    };
+    const onBeforeRemove = (data) => {
+      fileList.value = fileList.value.filter((item) => item.id !== data.uid);
+      return true;
+    };
+    const selectedKeys = ref([]);
+
+    const rowSelection = reactive({
+      type: "checkbox",
+      showCheckedAll: true,
+      onlyCurrent: false
+    });
+
+    const columns = [
+      {
+        title: "文件名称",
+        dataIndex: "name"
+      },
+      {
+        title: "类型",
+        dataIndex: "type"
+      },
+      {
+        title: "大小",
+        dataIndex: "size"
+      },
+      {
+        title: "上传时间",
+        dataIndex: "time"
+      },
+      {
+        title: "操作",
+        slotName: "methods"
+      }
+    ];
+    const tableData = reactive([
+      {
+        key: "1",
+        name: "文件名称1",
+        type: "pdf",
+        size: "13M",
+        time: "2024.9.8"
+      },
+      {
+        key: "2",
+        name: "文件名称2",
+        type: "pdf",
+        size: "13M",
+        time: "2024.9.8"
+      },
+      {
+        key: "3",
+        name: "文件名称3",
+        type: "pdf",
+        size: "13M",
+        time: "2024.9.8"
+      }
+    ]);
+    const downloadDocument = (record) => { };
+    const deleteDocument = () => { };
+    return {
+      buttonLoading,
+      fileList,
+      selectedKeys,
+      getAssetURL: helper.getAssetURL,
+      showUpload,
+      onBeforeUpload,
+      onExceedLimit,
+      onBeforeRemove,
+      customRequest,
+      columns,
+      tableData,
+      rowSelection,
+      downloadDocument,
+      deleteDocument,
+      showDeleteTooltip,
+      deleteId,
+      handleDeleteButton,
+      selectFiles
+    };
+  }
 });
 </script>
 <style lang="scss" scoped>
 .bottom-buttons {
-    display: flex;
-    justify-content: right;
+  display: flex;
+  justify-content: right;
 
-    >div {
-        display: flex;
-    }
+  >div {
+    display: flex;
+  }
 }
 
 .delete-buttons {
-    margin-top: 10px;
-    display: flex;
-    justify-content: center;
+  margin-top: 10px;
+  display: flex;
+  justify-content: center;
 }
 
 .method-button {
-    display: inline-block;
-    padding: 4px 8px;
-    border-radius: 5px;
-    cursor: pointer;
-
-    &:hover {
-        background: rgba(150, 171, 185, 0.2);
-    }
+  display: inline-block;
+  padding: 4px 8px;
+  border-radius: 5px;
+  cursor: pointer;
+
+  &:hover {
+    background: rgba(150, 171, 185, 0.2);
+  }
 }
 
 .upload-main {
-    width: 800px;
-    height: 109px;
-    background: url("@/assets/document/upload.svg");
-    margin: 0 auto;
-    padding: 24px 0px 24px 277px;
-    background-size: 100%;
-
-    >p {
-        color: #000;
-        font-weight: bold;
-        margin-bottom: 5px;
-        margin-top: 10px;
-
-        >span {
-            color: #00aea3;
-            text-decoration: underline;
-        }
-    }
+  width: 800px;
+  height: 109px;
+  background: url("@/assets/document/upload.svg");
+  margin: 0 auto;
+  padding: 24px 0px 24px 277px;
+  background-size: 100%;
+
+  >p {
+    color: #000;
+    font-weight: bold;
+    margin-bottom: 5px;
+    margin-top: 10px;
 
     >span {
-        font-size: 13px;
-        color: #7f7f7f;
+      color: #00aea3;
+      text-decoration: underline;
     }
+  }
+
+  >span {
+    font-size: 13px;
+    color: #7f7f7f;
+  }
 }
 
 main {
-    height: 100%;
-    display: flex;
-    flex-direction: column;
-    overflow: hidden;
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  overflow: hidden;
 
-    >section {
-        overflow-y: auto;
-        display: flex;
-        flex-wrap: wrap;
-        gap: 20px;
+  >section {
+    overflow-y: auto;
+    display: flex;
+    flex-wrap: wrap;
+    gap: 20px;
 
-        &.section-full {
-            flex: 1;
-        }
+    &.section-full {
+      flex: 1;
+    }
 
-        >div {
-            width: 382px;
-            height: 120px;
-            padding: 20px 24px;
-            border-radius: 8px;
-            display: flex;
-
-            >img {
-                width: 38px;
-                height: 38px;
-                margin-right: 12px;
-            }
+    >div {
+      width: 382px;
+      height: 120px;
+      padding: 20px 24px;
+      border-radius: 8px;
+      display: flex;
+
+      >img {
+        width: 38px;
+        height: 38px;
+        margin-right: 12px;
+      }
+
+      >div {
+        font-size: 18px;
+        font-weight: bold;
 
-            >div {
-                font-size: 18px;
-                font-weight: bold;
-
-                >span {
-                    font-size: 15px;
-                    font-weight: 400;
-                    color: #797d7f;
-                    margin-top: 8px;
-                    overflow: hidden;
-                    text-overflow: ellipsis;
-                    display: -webkit-box;
-                    -webkit-line-clamp: 2;
-                    -webkit-box-orient: vertical;
-                    line-height: 1.4;
-                }
-            }
+        >span {
+          font-size: 15px;
+          font-weight: 400;
+          color: #797d7f;
+          margin-top: 8px;
+          overflow: hidden;
+          text-overflow: ellipsis;
+          display: -webkit-box;
+          -webkit-line-clamp: 2;
+          -webkit-box-orient: vertical;
+          line-height: 1.4;
         }
+      }
     }
+  }
 
-    >footer {
-        display: flex;
-        justify-content: space-between;
-        align-items: center;
-        margin-top: auto;
-
-        >div {
-            display: inline-flex;
-            align-items: center;
-            gap: 8px;
-            height: 32px;
-            border-radius: 21px;
-            border: 1px solid #e3e3e3;
-            white-space: nowrap;
-            overflow: hidden;
-            transition-duration: 0.3s;
-            width: 250px;
-
-            &.text-hide {
-                width: 110px;
-                overflow: hidden;
-            }
+  >footer {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-top: auto;
 
-            &.text-narrow {
-                width: 100px;
-                overflow: hidden;
+    >div {
+      display: inline-flex;
+      align-items: center;
+      gap: 8px;
+      height: 32px;
+      border-radius: 21px;
+      border: 1px solid #e3e3e3;
+      white-space: nowrap;
+      overflow: hidden;
+      transition-duration: 0.3s;
+      width: 250px;
+
+      &.text-hide {
+        width: 110px;
+        overflow: hidden;
+      }
+
+      &.text-narrow {
+        width: 100px;
+        overflow: hidden;
+
+        >div>img {
+          width: 100px;
+        }
+      }
 
-                >div>img {
-                    width: 100px;
-                }
-            }
+      >p {
+        overflow: hidden;
+        white-space: nowrap;
+      }
 
-            >p {
-                overflow: hidden;
-                white-space: nowrap;
-            }
+      >div {
+        cursor: pointer;
+        width: 110px;
+        height: 32px;
 
-            >div {
-                cursor: pointer;
-                width: 110px;
-                height: 32px;
-
-                .img-normal {
-                    display: block;
-                }
-
-                .img-hover {
-                    display: none;
-                }
-
-                &:hover {
-                    .img-normal {
-                        display: none;
-                    }
-
-                    .img-hover {
-                        display: block;
-                    }
-                }
-
-                >img {
-                    width: 110px;
-                    height: 32px;
-                }
-            }
+        .img-normal {
+          display: block;
         }
 
-        >section {
-            display: flex;
-            align-items: center;
-            background: rgba(150, 171, 185, 0.2);
-            border-radius: 20px;
-            padding: 5px 10px;
+        .img-hover {
+          display: none;
+        }
 
-            >p {
-                margin-right: 5px;
-            }
+        &:hover {
+          .img-normal {
+            display: none;
+          }
+
+          .img-hover {
+            display: block;
+          }
+        }
+
+        >img {
+          width: 110px;
+          height: 32px;
         }
+      }
     }
+
+    >section {
+      display: flex;
+      align-items: center;
+      background: rgba(150, 171, 185, 0.2);
+      border-radius: 20px;
+      padding: 5px 10px;
+
+      >p {
+        margin-right: 5px;
+      }
+    }
+  }
 }
 
 .upload-wrap {
-    width: 800px;
-    height: 300px;
-    display: flex;
-    flex-direction: column;
-    padding-bottom: 30px;
+  width: 800px;
+  height: 300px;
+  display: flex;
+  flex-direction: column;
+  padding-bottom: 30px;
 
-    &.upload-wrap-narrow {
-        height: 200px;
-    }
+  &.upload-wrap-narrow {
+    height: auto;
+  }
 
-    >header {
-        display: flex;
-        align-items: center;
-        justify-content: space-between;
-        margin-bottom: 13px;
+  >header {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    margin-bottom: 13px;
 
-        >p {
-            font-size: 18px;
-            font-weight: bold;
-        }
+    >p {
+      font-size: 18px;
+      font-weight: bold;
+    }
 
-        >div {
-            width: 38px;
-            height: 38px;
-            border-radius: 6px;
-            cursor: pointer;
-            justify-content: center;
-            align-items: center;
-            display: flex;
-
-            &:hover {
-                background: rgba(0, 0, 0, 0.05);
-            }
-        }
+    >div {
+      width: 38px;
+      height: 38px;
+      border-radius: 6px;
+      cursor: pointer;
+      justify-content: center;
+      align-items: center;
+      display: flex;
+
+      &:hover {
+        background: rgba(0, 0, 0, 0.05);
+      }
     }
+  }
+
+  >div {
+    flex: 1;
+    overflow-y: auto;
 
     >div {
-        flex: 1;
-        overflow-y: auto;
-
-        >div {
-            >p {
-                margin: 20px 0;
-                color: #7f7f7f;
-                font-size: 13px;
-                display: flex;
-                justify-content: space-between;
-            }
-        }
+      >p {
+        margin: 20px 0;
+        color: #7f7f7f;
+        font-size: 13px;
+        display: flex;
+        justify-content: space-between;
+      }
     }
+  }
 }
 </style>

+ 15 - 15
src/utils/config.js

@@ -1,21 +1,21 @@
 export default {
-    defaultTitle: "上海电科院",
+    defaultTitle: "河南电力",
     defaultDesc: "大模型AI能力平台,为你的下一个创意助力",
     slider: [
-        {
-            title: "报告生成",
-            icon: "2",
-            img: "/src/assets/index/2.png",
-            desc: "基于您创建的报告格式和内容,快速生成定制报告,并支持一键下载",
-            dialog: "基于您创建的报告格式和内容,快速生成定制报告,并支持一键下载。"
-        },
-        {
-            title: "报表合并",
-            icon: "6",
-            img: "/src/assets/index/6.png",
-            desc: "基于您上传的报表进行合并,助您快速完成报表整合与分析",
-            dialog: "基于您上传的报表进行合并,助您快速完成报表整合与分析"
-        },
+        // {
+        //     title: "报告生成",
+        //     icon: "2",
+        //     img: "/src/assets/index/2.png",
+        //     desc: "基于您创建的报告格式和内容,快速生成定制报告,并支持一键下载",
+        //     dialog: "基于您创建的报告格式和内容,快速生成定制报告,并支持一键下载。"
+        // },
+        // {
+        //     title: "报表合并",
+        //     icon: "6",
+        //     img: "/src/assets/index/6.png",
+        //     desc: "基于您上传的报表进行合并,助您快速完成报表整合与分析",
+        //     dialog: "基于您上传的报表进行合并,助您快速完成报表整合与分析"
+        // },
         {
             title: "知识问答",
             icon: "5",

+ 19 - 1
src/views/Home.vue

@@ -64,6 +64,19 @@
                                         accept=".pdf,.doc,.docx,.txt,.md,.ppt.pptx" />
                                 </div>
                             </section>
+                            <a-textarea @keydown.enter="beginCombine" :max-length="maxLength" v-model="textValue"
+                                :show-word-limit="textValue.length > maxLength / 2" :auto-size="{ maxRows: 6 }"
+                                placeholder="输入您想了解的内容,Shift+Enter换行" :style="{
+                                    flex: 1,
+                                    borderRadius: '12px',
+                                    marginTop: '20px',
+                                    padding: '0px 30px 0 16px',
+                                    background: 'transparent',
+                                    border: '1px solid #e3e3e3',
+                                    minHeight: '120px',
+                                    paddingBottom: `${textValue.length > maxLength / 2 ? '20px' : ''}`
+                                }">
+                            </a-textarea>
                             <a-button :style="{ width: '500px' }" type="primary" @click="beginCombine">开始</a-button>
                         </footer>
                         <a-tooltip :content="closeOthers ? '收起' : '展开'">
@@ -132,6 +145,8 @@ export default defineComponent({
         const dialogId = ref("");
         const historyList = ref([]);
         const variables = ref([]);
+        const textValue = ref("");
+        const maxLength = ref(6000);
         let reportData = {};
         let agents = {}
         const openAll = () => {
@@ -221,6 +236,7 @@ export default defineComponent({
             initDialog.value = true;
             const sendData = {
                 chatHistory: [],
+                value: textValue.value,
                 name: "报告生成",
                 description: "报告生成",
                 inputs: {
@@ -304,7 +320,9 @@ export default defineComponent({
             goDocument,
             goBack,
             hideDialog,
-            agentIds
+            agentIds,
+            textValue,
+            maxLength
         };
     }
 });

+ 29 - 20
src/views/Index.vue

@@ -15,20 +15,11 @@
                 <div :class="{ prev: true, disabled: page === 0 }" @click="goPrev">
                     <icon-left />
                 </div>
-                <swiper
-                    class="the-swiper-wrap"
-                    :slides-per-group="number"
-                    :slides-per-view="number"
-                    :space-between="10"
-                    @swiper="onSwiper"
-                >
+                <swiper class="the-swiper-wrap" :slides-per-group="number" :slides-per-view="number" :space-between="10"
+                    @swiper="onSwiper">
                     <swiper-slide v-for="(item, key) in slider" :key="key" width="230">
-                        <div
-                            class="swiper-item"
-                            @mouseover="onMouseover(key)"
-                            @mouseleave="onMouseleave"
-                            @click="handleClick(key)"
-                        >
+                        <div class="swiper-item" @mouseover="onMouseover(key)" @mouseleave="onMouseleave"
+                            @click="handleClick(key)">
                             <div>
                                 <img :src="getAssetURL(item.img)" width="48" />
                                 <p>{{ item.title }}</p>
@@ -107,27 +98,33 @@ main {
     height: 100%;
     position: relative;
     overflow: hidden;
-    > section {
+
+    >section {
         padding-top: 67px;
         position: relative;
         z-index: 2;
         margin: 0 auto;
         width: 85%;
-        > header {
+
+        >header {
             text-align: center;
             color: #fff;
-            > p {
+
+            >p {
                 font-size: 40px;
             }
-            > div {
+
+            >div {
                 margin-top: 10px;
                 font-size: 20px;
             }
         }
+
         .swiper-main {
             position: relative;
             height: 90px;
             margin-top: 40px;
+
             .prev,
             .next {
                 position: absolute;
@@ -140,28 +137,35 @@ main {
                 background: #fff;
                 top: 25px;
                 cursor: pointer;
+
                 &:hover {
                     opacity: 0.8;
                 }
+
                 &.disabled {
                     cursor: not-allowed;
+
                     &:hover {
                         opacity: 1;
                     }
                 }
             }
+
             .prev {
                 left: -20px;
             }
+
             .next {
                 right: -20px;
             }
+
             .the-swiper-wrap {
                 position: absolute;
                 top: 0;
                 left: 30px;
                 right: 30px;
                 overflow: hidden;
+
                 .swiper-item {
                     width: 230px;
                     height: 90px;
@@ -171,16 +175,20 @@ main {
                     justify-content: center;
                     align-items: center;
                     cursor: pointer;
+
                     &:hover {
                         background: #00aea3;
-                        > div > p {
+
+                        >div>p {
                             color: #fff;
                         }
                     }
-                    > div {
+
+                    >div {
                         display: flex;
                         align-items: center;
-                        > p {
+
+                        >p {
                             font-weight: 600;
                             color: #000;
                             margin-left: 12px;
@@ -192,6 +200,7 @@ main {
         }
     }
 }
+
 .bg {
     position: absolute;
     top: 0;

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels