SanHQin 4 bulan lalu
induk
melakukan
39693b4823

+ 1 - 1
dist/index.html

@@ -32,7 +32,7 @@
       width: 100%;
       background: #e6eaf0;
       font-family: '黑体';
-    }</style><link href=./static/css/app.0b27d3bd0de11410da58e4cdee7f3991.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.161e82026ac2ae03ab6f.js></script><script type=text/javascript src=./static/js/vendor.de15001ce66f032e9274.js></script><script type=text/javascript src=./static/js/app.1a329e26e55a28025d20.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.a3e275c269b3a34b3ca536e34892dea5.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.161e82026ac2ae03ab6f.js></script><script type=text/javascript src=./static/js/vendor.de15001ce66f032e9274.js></script><script type=text/javascript src=./static/js/app.c90f2e34859b29afbf28.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

File diff ditekan karena terlalu besar
+ 0 - 0
dist/static/css/app.a3e275c269b3a34b3ca536e34892dea5.css


File diff ditekan karena terlalu besar
+ 0 - 0
dist/static/css/app.a3e275c269b3a34b3ca536e34892dea5.css.map


File diff ditekan karena terlalu besar
+ 0 - 0
dist/static/js/app.c90f2e34859b29afbf28.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/static/js/app.c90f2e34859b29afbf28.js.map


File diff ditekan karena terlalu besar
+ 0 - 0
dist/static/js/manifest.161e82026ac2ae03ab6f.js.map


+ 1 - 0
src/assets/icon/test/test_history.svg

@@ -0,0 +1 @@
+<svg t="1736992320707" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="#A3A3A3" p-id="15612" width="200" height="200"><path d="M695.808 301.568c-180.736 0-328.192 146.944-328.192 328.192s146.944 328.192 328.192 328.192S1024 810.496 1024 629.76s-146.944-328.192-328.192-328.192z m0 577.536c-137.728 0-249.344-111.616-249.344-249.344 0-137.728 111.616-249.344 249.344-249.344s249.344 111.616 249.344 249.344-111.616 249.344-249.344 249.344z m-656.384-104.448c-21.504 0-39.424 17.408-39.424 39.424 0 21.504 17.408 39.424 39.424 39.424h304.128c-15.872-24.576-28.672-51.2-38.912-78.848h-265.216z m0-629.76H880.64c21.504 0 39.424-17.408 39.424-39.424 0-21.504-17.408-39.424-39.424-39.424h-841.216c-21.504 0-39.424 17.408-39.424 39.424 0 22.016 17.408 39.424 39.424 39.424z m0 472.576h239.616c1.024-27.136 4.096-53.248 9.728-78.848h-249.344c-21.504 0-39.424 17.408-39.424 39.424s17.408 39.424 39.424 39.424z m397.824-314.88h-397.824c-21.504 0-39.424 17.408-39.424 39.424s17.408 39.424 39.424 39.424h321.536c22.016-29.696 47.616-56.32 76.288-78.848z m374.272 288.768h-76.288V486.4c0-21.504-17.408-39.424-39.424-39.424-21.504 0-39.424 17.408-39.424 39.424v144.384c0 21.504 17.408 39.424 39.424 39.424h115.712c21.504 0 39.424-17.408 39.424-39.424s-17.92-39.424-39.424-39.424z" p-id="15613"></path></svg>

+ 1 - 0
src/assets/icon/test/test_history_active.svg

@@ -0,0 +1 @@
+<svg t="1736992320707" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="#fff" p-id="15612" width="200" height="200"><path d="M695.808 301.568c-180.736 0-328.192 146.944-328.192 328.192s146.944 328.192 328.192 328.192S1024 810.496 1024 629.76s-146.944-328.192-328.192-328.192z m0 577.536c-137.728 0-249.344-111.616-249.344-249.344 0-137.728 111.616-249.344 249.344-249.344s249.344 111.616 249.344 249.344-111.616 249.344-249.344 249.344z m-656.384-104.448c-21.504 0-39.424 17.408-39.424 39.424 0 21.504 17.408 39.424 39.424 39.424h304.128c-15.872-24.576-28.672-51.2-38.912-78.848h-265.216z m0-629.76H880.64c21.504 0 39.424-17.408 39.424-39.424 0-21.504-17.408-39.424-39.424-39.424h-841.216c-21.504 0-39.424 17.408-39.424 39.424 0 22.016 17.408 39.424 39.424 39.424z m0 472.576h239.616c1.024-27.136 4.096-53.248 9.728-78.848h-249.344c-21.504 0-39.424 17.408-39.424 39.424s17.408 39.424 39.424 39.424z m397.824-314.88h-397.824c-21.504 0-39.424 17.408-39.424 39.424s17.408 39.424 39.424 39.424h321.536c22.016-29.696 47.616-56.32 76.288-78.848z m374.272 288.768h-76.288V486.4c0-21.504-17.408-39.424-39.424-39.424-21.504 0-39.424 17.408-39.424 39.424v144.384c0 21.504 17.408 39.424 39.424 39.424h115.712c21.504 0 39.424-17.408 39.424-39.424s-17.92-39.424-39.424-39.424z" p-id="15613"></path></svg>

+ 4 - 4
src/common/axios.config.js

@@ -12,7 +12,7 @@ let cancel; // 用于存储取消请求的方法
 //POST传参序列化(添加请求拦截器)
 axios.interceptors.request.use((config) => {
     //在发送请求之前做某件事
-    let token = sessionStorage.getItem('access_token') || ""  //获取token 
+    let token = sessionStorage.getItem('access_token') || ""  //获取token
     if (token != "") {
         config.headers = {
             'access-token': token,
@@ -28,7 +28,7 @@ axios.interceptors.request.use((config) => {
     // }
     if (config.url === 'https://gpt.cocorobo.cn/search_image' || config.url === 'https://gpt.cocorobo.cn/chat' || config.url === 'https://gpt4.cocorobo.cn/create_free_assistants' || config.url === 'https://gpt4.cocorobo.cn/assistants_completion_response') {
         config.data = config.data//序列化post 参数
-    } else if (config.url.indexOf('https://gpt4.cocorobo.cn/') != -1 || config.url.indexOf('https://claude3.cocorobo.cn/') != -1 || config.url.indexOf('llm.cocorobo.cn/') != -1) {
+    } else if (config.url.indexOf('https://gpt4.cocorobo.cn/') != -1 || config.url.indexOf('https://claude3.cocorobo.cn/') != -1 || config.url.indexOf('llm.cocorobo.cn/') != -1 || config.url.indexOf('https://appapi.cocorobo.cn/')!=-1) {
         config.headers = {
             'Content-Type': 'application/json',
         }
@@ -63,7 +63,7 @@ axios.interceptors.request.use((config) => {
 axios.interceptors.response.use((res) => {
     //对响应数据做些事
     if (!res.data.success) {
-        let newToken = res.data.token    //成功后更新token 
+        let newToken = res.data.token    //成功后更新token
         localStorage.setItem('access_token', newToken)
 
     }
@@ -131,4 +131,4 @@ export default {
         cancel = CancelToken.source();
         return cancel;
     }
-}
+}

+ 165 - 15
src/components/pages/appStore/views/appManagement.vue

@@ -764,12 +764,12 @@ export default {
         // { index: 98,label:"已发布"},
         // { index: 99,label:"未发布"},
       ],
-      statusList:[
-        {value:'',label:'所有状态'},
-        {value:1,label:"测试"},
-        {value:2,label:"稳定"}
+      statusList: [
+        { value: "", label: "所有状态" },
+        { value: 1, label: "测试" },
+        { value: 2, label: "稳定" }
       ],
-      statusType:'',
+      statusType: "",
       labelSelect: [
         { value: "", label: "所有类型" },
         { value: "agent", label: "智能体" },
@@ -783,7 +783,8 @@ export default {
       recentUse: [],
       collect: [],
       editAppCard: null,
-      bannerObj: null
+      bannerObj: null,
+      userName: null
     };
   },
   computed: {
@@ -821,7 +822,7 @@ export default {
   },
   watch: {
     searchText: {
-      immediate:false,
+      immediate: false,
       handler() {
         if (this.searchText === "") {
           this.getData();
@@ -849,7 +850,7 @@ export default {
         type: this.showType, //应用的类型
         juri: this.selectJuri, //应用权限 1:我的  2:组织内  3:所有人
         stand: "cn", //cn站还是hk站
-        status:this.statusType
+        status: this.statusType
       };
 
       this.ajax
@@ -920,13 +921,50 @@ export default {
     //   this.insertSave(item, 0);
     // },
     //复制app
-    copyApp(item) {
+    async copyApp(item) {
       this.$confirm(`确定复制《${item.name}》这个应用至我的列表吗?`, "复制", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning"
       })
-        .then(() => {
+        .then(async e => {
+          this.copyAgentOrWorkflow(item);
+          // console.log(item);
+          // let url = item.url;
+          // let id =
+          //   this.queryURLParams(url, "id") ||
+          //   item.url.split("/")[item.url.split("/").length - 1];
+          // if (!id) return this.$message.error("复制失败,未找到对应id");
+          // if ((item.label = "workflow")) {
+          //   this.ajax
+          //     .get(`https://appapi.cocorobo.cn/api/agents/muti_agent/${id}`)
+          //     .then(res => {
+          //       let _data = res.data;
+          //       let _idList = [];
+          //       if (_data["dialoguePublishDataId"])
+          //         _idList.push(_data["dialoguePublishDataId"]);
+          //       if (_data["immersivePublishDataId"])
+          //         _idList.push(_data["immersivePublishDataId"]);
+          //       if (_data["cardPublishDataId"])
+          //         _idList.push(_data["cardPublishDataId"]);
+          //       if (_idList.length > 0) {
+          //       } else {
+          //         console.log("该应用无id");
+          //       }
+          //     });
+          // } else if ((item.label = "agent")) {
+          //   let _idList = [id];
+          // }
+          // this.ajax.get(`https://appapi.cocorobo.cn/api/agents/muti_agent/${id}`).then(res=>{
+          //   let _data = res.data;
+          //   console.log(_data)
+          //   let dialoguePublishDataId = _data['dialoguePublishDataId'];
+          //   let immersivePublishDataId = _data['immersivePublishDataId'];
+          //   let cardPublishDataId = _data['cardPublishDataId'];
+          //   console.log('dialoguePublishDataId',dialoguePublishDataId);
+          //   console.log('immersivePublishDataId',immersivePublishDataId);
+          //   console.log('cardPublishDataId',cardPublishDataId)
+          // })
           let params = [
             {
               name: `${item.name}_copy`, //app名称
@@ -960,6 +998,63 @@ export default {
           console.log("取消复制");
         });
     },
+    async copyAgentOrWorkflow(item) {
+      return new Promise(async resolve => {
+        let url = item.url;
+        let id =
+          this.queryURLParams(url, "id") ||
+          item.url.split("/")[item.url.split("/").length - 1];
+        if (!id){
+          console.log("该链接无对应id")
+          return resolve();
+          // return this.$message.error("复制失败,未找到对应id")
+        };
+        console.log(item)
+        if (item.label == "workflow") {//复制工作流
+          console.log("复制工作流")
+          this.ajax
+            .get(`https://appapi.cocorobo.cn/api/agents/muti_agent/${id}`)
+            .then(async res => {
+              let _data = res.data;
+              let _idList = [];
+              if (_data["dialoguePublishDataId"])
+                _idList.push(_data["dialoguePublishDataId"]);
+              if (_data["immersivePublishDataId"])
+                _idList.push(_data["immersivePublishDataId"]);
+              if (_data["cardPublishDataId"])
+                _idList.push(_data["cardPublishDataId"]);
+              if (_idList.length <= 0) {
+                resolve(0);
+                return console.log("该应用无id");
+              }
+              // /api/agents/copy_mutiAgent
+              this.ajax.post('https://appapi.cocorobo.cn/api/agents/copy_mutiAgent',{
+                ids: _idList,
+                userId: this.userId,
+                username: this.userName?this.userName:await this.getUserName(this.userId),
+              }).then(_=>{
+                resolve(1);
+              }).catch(e=>{
+                console.log(e)
+                resolve(0)
+              })
+            });
+        } else if (item.label == "agent") {//复制智能体
+          console.log("复制智能体")
+          let _idList = [id];
+          this.ajax.post('https://appapi.cocorobo.cn/api/agents/copy_agent',{
+            ids: _idList,
+            userId: this.userId,
+            username: this.userName?this.userName:await this.getUserName(this.userId),
+          }).then(_=>{
+            resolve(1);
+          }).catch(e=>{
+            console.log(e)
+            resolve(0)
+          })
+        }
+      });
+    },
     // 取消收藏
     cancelCollectApp(item) {
       this.editAppCard = null;
@@ -1216,11 +1311,15 @@ export default {
       });
     },
     delApp(item) {
-      this.$confirm(`确定要取消发布《${item.name}》这个应用吗!`, `确定取消发布应用`, {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      })
+      this.$confirm(
+        `确定要取消发布《${item.name}》这个应用吗!`,
+        `确定取消发布应用`,
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }
+      )
         .then(() => {
           let params = [
             {
@@ -1377,6 +1476,57 @@ export default {
             this.getCollect();
           });
       }
+    },
+    queryURLParams(url, paramName) {
+      // 正则表达式模式,用于匹配URL中的参数部分。正则表达式的含义是匹配不包含 ?、&、= 的字符作为参数名,之后是等号和不包含 & 的字符作为参数值
+      let pattern = /([^?&=]+)=([^&]+)/g;
+      let params = {};
+
+      // match用于存储正则匹配的结果
+      let match;
+      // while 循环和正则表达式 exec 方法来迭代匹配URL中的参数
+      while ((match = pattern.exec(url)) !== null) {
+        // 在字符串url中循环匹配pattern,并对每个匹配项进行解码操作,将解码后的键和值分别存储在key和value变量中
+        let key = decodeURIComponent(match[1]);
+        let value = decodeURIComponent(match[2]);
+
+        if (params[key]) {
+          if (Array.isArray(params[key])) {
+            params[key].push(value);
+          } else {
+            params[key] = [params[key], value];
+          }
+        } else {
+          // 参数名在 params 对象中不存在,将该参数名和对应的值添加到 params 对象中
+          params[key] = value;
+        }
+      }
+
+      if (!paramName) {
+        // 没有传入参数名称, 返回含有所有参数的对象params
+        return params;
+      } else {
+        if (params[paramName]) {
+          return params[paramName];
+        } else {
+          return "";
+        }
+      }
+    },
+    getUserName(uid) {
+      return new Promise(resolve => {
+        let params = { uid: uid };
+        this.ajax
+          .get(this.$store.state.api + "getUser", params)
+          .then(res => {
+            let data = res.data[0][0];
+            this.userName = data.username;
+            resolve(data.username);
+          })
+          .catch(err => {
+            console.error(err);
+          });
+      });
     }
   },
   mounted() {

+ 89 - 30
src/components/pages/test/smarter.vue

@@ -56,23 +56,35 @@
             </div>
         </div>
         <div class="cc_bottom">
-            <div class="cc_b_left">
-                <div class="menu_container">
-                    <div :class="['cc_b_l_menu', { active: activeMenu === 1 }]" @click="activeMenu = 1">
+            <div class="cc_b_left" :style="`width:${openLeft?'13%':'50px'}`">
+                <div class="menu_container" v-if="openLeft">
+                  <div  @click="activeMenu = 1" :class="{active: activeMenu === 1}">
+                    <span :class="['session_icon',{active: activeMenu === 1}]"></span>
+                    <div>当前会话</div>
+                  </div>
+                  <div @click="activeMenu = 2" :class="{active: activeMenu === 2}">
+                    <span :class="['history_icon',{active: activeMenu === 2}]"></span>
+                    <div>历史会话</div>
+                  </div>
+                    <!-- <div :class="['cc_b_l_menu', { active: activeMenu === 1 }]" @click="activeMenu = 1">
                         <span :class="['session_icon', { active: activeMenu === 1 }]"></span>
-                        <div style="margin-left: 10px;margin-top: 1px;font-size: 15px;">当前会话</div>
+                        <div v-if="openLeft" style="margin-left: 10px;margin-top: 1px;font-size: 15px;">当前会话</div>
                     </div>
                     <div :class="['cc_b_l_menu', { active: activeMenu === 2 }]" @click="activeMenu = 2">
                         <span :class="['history_icon', { active: activeMenu === 2 }]"></span>
-                        <div style="margin-left: 10px;margin-top: 1px;font-size: 15px;">历史会话</div>
-                    </div>
+                        <div v-if="openLeft" style="margin-left: 10px;margin-top: 1px;font-size: 15px;">历史会话</div>
+                    </div> -->
                     <!--<div :class="['cc_b_l_menu', { active: activeMenu === 3 }]" @click="activeMenu = 3">
                             <span :class="['mysql_icon', { active: activeMenu === 3 }]"></span>
                             <div style="margin-left: 10px;margin-top: 1px;font-size: 15px;">数据库管理</div>
                         </div> -->
                 </div>
+                <div class="menu_container" v-if="!openLeft">
+                  <span @click="activeMenu = 1"  :class="{active: activeMenu === 1}"><span :class="['session_icon',{active: activeMenu === 1}]"></span></span>
+                  <span @click="activeMenu = 2"  :class="{active: activeMenu === 2}"><span :class="['history_icon',{active: activeMenu === 2}]"></span></span>
+                </div>
                 <div class="fold_btn">
-                    <span class="more_icon"></span>
+                    <span class="more_icon" @click="openLeft=!openLeft"></span>
                 </div>
             </div>
             <div v-show="activeMenu == 1" style="width:100%;display: flex;">
@@ -261,8 +273,8 @@ export default {
                 value: '2',
                 label: '双皮奶'
             }],
-            value: '1'
-
+            value: '1',
+            openLeft:true,
         };
     },
     methods: {
@@ -843,11 +855,59 @@ export default {
     justify-content: space-between;
     height: 100%;
     width: 13%;
+    overflow: hidden;
+    border-radius: 5px;
 }
 
 .menu_container {
-    flex: 1;
-    /* 占据除折叠按钮外的所有空间 */
+  width: 100%;
+  flex: 1;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  /* 占据除折叠按钮外的所有空间 */
+}
+
+.menu_container>div{
+  display: flex;
+  align-items: center;
+  width: calc(100% - 20px - 20px);
+  height: 40px;
+  background-color: #fff;
+  margin: 20px 20px 0 20px;
+  border-radius: 8px;
+  box-sizing: border-box;
+  padding-left: 10px;
+  color: #828282;
+  cursor: pointer;
+}
+
+
+
+.menu_container>div>span{
+  width: 18px;
+  height: 18px;
+  margin-right: 10px;
+}
+
+.menu_container>span{
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  width: 100%;
+  height: 40px;
+  padding: 5px;
+  background-color: #fff;
+  box-sizing: border-box;
+  color: #828282;
+  cursor: pointer;
+  /* margin-top: 10px; */
+}
+
+.menu_container>span>span{
+  width: 18px;
+  height: 18px;
+  display: flex;
 }
 
 .cc_b_l_menu {
@@ -859,40 +919,31 @@ export default {
     display: flex;
 }
 
-.cc_b_l_menu.active {
-    background-color: #3681fc;
+.menu_container .active {
+    background-color: #3681fc !important;
     color: #fff;
-
 }
 
 .session_icon {
-    background: url('../../../assets/icon/test/test_session.png') no-repeat;
-    width: 18px;
-    height: 18px;
+    background: url('../../../assets/icon/test/test_session.png') no-repeat center;
     display: inline-block;
     background-size: contain;
 }
 
 .session_icon.active {
-    background: url('../../../assets/icon/test/test_session_active.png') no-repeat;
-    width: 18px;
-    height: 18px;
+    background: url('../../../assets/icon/test/test_session_active.png') no-repeat center;
     display: inline-block;
     background-size: contain;
 }
 
 .history_icon {
-    background: url('../../../assets/icon/test/test_history.png') no-repeat;
-    width: 18px;
-    height: 18px;
+    background: url('../../../assets/icon/test/test_history.svg') no-repeat center;
     display: inline-block;
     background-size: contain;
 }
 
 .history_icon.active {
-    background: url('../../../assets/icon/test/test_history_active.png') no-repeat;
-    width: 18px;
-    height: 18px;
+    background: url('../../../assets/icon/test/test_history_active.svg') no-repeat center;
     display: inline-block;
     background-size: contain;
 }
@@ -912,17 +963,25 @@ export default {
     background-size: contain;
 } */
 .fold_btn {
-    padding: 27px 20px;
+  width: 100%;
+  height: 60px;
+  border-top: 1px solid #E4E7ED;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  padding-left: 15px;
+    /* padding: 27px 20px;
     cursor: pointer;
     border-top: 1px solid #E4E7ED;
-    margin-top: auto;
+    margin-top: auto; */
     /* 确保折叠按钮在底部 */
 }
 
 .more_icon {
     background: url('../../../assets/icon/test/test_more.png') no-repeat;
-    width: 14px;
-    height: 14px;
+    background-size: 60%;
+    width: 16px;
+    height: 16px;
     display: inline-block;
     background-size: contain;
     cursor: pointer;

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini