|
@@ -928,7 +928,16 @@ export default {
|
|
type: "warning"
|
|
type: "warning"
|
|
})
|
|
})
|
|
.then(async e => {
|
|
.then(async e => {
|
|
- this.copyAgentOrWorkflow(item);
|
|
|
|
|
|
+ let _status = await this.copyAgentOrWorkflow(item);
|
|
|
|
+ if(_status==1){
|
|
|
|
+ this.$message.success("复制成功,已添加至我的工作流列表。");
|
|
|
|
+ }else if(_status==2){
|
|
|
|
+ this.$message.success("复制成功,已添加至我的智能体列表。");
|
|
|
|
+ }else if(_status==3){
|
|
|
|
+ this.$message.error("复制失败,该应用无内容")
|
|
|
|
+ }else if(_status==0){
|
|
|
|
+ this.$message.error("复制失败")
|
|
|
|
+ }
|
|
// console.log(item);
|
|
// console.log(item);
|
|
// let url = item.url;
|
|
// let url = item.url;
|
|
// let id =
|
|
// let id =
|
|
@@ -965,34 +974,34 @@ export default {
|
|
// console.log('immersivePublishDataId',immersivePublishDataId);
|
|
// console.log('immersivePublishDataId',immersivePublishDataId);
|
|
// console.log('cardPublishDataId',cardPublishDataId)
|
|
// console.log('cardPublishDataId',cardPublishDataId)
|
|
// })
|
|
// })
|
|
- let params = [
|
|
|
|
- {
|
|
|
|
- name: `${item.name}_copy`, //app名称
|
|
|
|
- userid: this.userId, //创建的用户ID
|
|
|
|
- label: item.label, //app标签
|
|
|
|
- detail: item.detail, //app简介
|
|
|
|
- url: item.url, //app链接
|
|
|
|
- type: item.type, //app类型
|
|
|
|
- juri: "1", //app权限 1:我的 2:组织 3:所有人
|
|
|
|
- stand: "cn", //语言
|
|
|
|
- json: JSON.stringify(item.json) //其他信息
|
|
|
|
- }
|
|
|
|
- ];
|
|
|
|
- this.ajax
|
|
|
|
- .post(this.$store.state.api + "insert_appStore", params)
|
|
|
|
- .then(res => {
|
|
|
|
- if (res.data) {
|
|
|
|
- this.$message.success("复制成功,已添加至我的列表。");
|
|
|
|
- this.getData();
|
|
|
|
- this.insertSave(item, 3);
|
|
|
|
- } else {
|
|
|
|
- this.$message.error("复制失败");
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- .catch(err => {
|
|
|
|
- console.log(err);
|
|
|
|
- this.$message.error("复制失败");
|
|
|
|
- });
|
|
|
|
|
|
+ // let params = [
|
|
|
|
+ // {
|
|
|
|
+ // name: `${item.name}_copy`, //app名称
|
|
|
|
+ // userid: this.userId, //创建的用户ID
|
|
|
|
+ // label: item.label, //app标签
|
|
|
|
+ // detail: item.detail, //app简介
|
|
|
|
+ // url: item.url, //app链接
|
|
|
|
+ // type: item.type, //app类型
|
|
|
|
+ // juri: "1", //app权限 1:我的 2:组织 3:所有人
|
|
|
|
+ // stand: "cn", //语言
|
|
|
|
+ // json: JSON.stringify(item.json) //其他信息
|
|
|
|
+ // }
|
|
|
|
+ // ];
|
|
|
|
+ // this.ajax
|
|
|
|
+ // .post(this.$store.state.api + "insert_appStore", params)
|
|
|
|
+ // .then(res => {
|
|
|
|
+ // if (res.data) {
|
|
|
|
+ // this.$message.success("复制成功,已添加至我的列表。");
|
|
|
|
+ // this.getData();
|
|
|
|
+ // this.insertSave(item, 3);
|
|
|
|
+ // } else {
|
|
|
|
+ // this.$message.error("复制失败");
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ // .catch(err => {
|
|
|
|
+ // console.log(err);
|
|
|
|
+ // this.$message.error("复制失败");
|
|
|
|
+ // });
|
|
})
|
|
})
|
|
.catch(_ => {
|
|
.catch(_ => {
|
|
console.log("取消复制");
|
|
console.log("取消复制");
|
|
@@ -1006,7 +1015,7 @@ export default {
|
|
item.url.split("/")[item.url.split("/").length - 1];
|
|
item.url.split("/")[item.url.split("/").length - 1];
|
|
if (!id){
|
|
if (!id){
|
|
console.log("该链接无对应id")
|
|
console.log("该链接无对应id")
|
|
- return resolve();
|
|
|
|
|
|
+ return resolve(3);
|
|
// return this.$message.error("复制失败,未找到对应id")
|
|
// return this.$message.error("复制失败,未找到对应id")
|
|
};
|
|
};
|
|
console.log(item)
|
|
console.log(item)
|
|
@@ -1016,6 +1025,7 @@ export default {
|
|
.get(`https://appapi.cocorobo.cn/api/agents/muti_agent/${id}`)
|
|
.get(`https://appapi.cocorobo.cn/api/agents/muti_agent/${id}`)
|
|
.then(async res => {
|
|
.then(async res => {
|
|
let _data = res.data;
|
|
let _data = res.data;
|
|
|
|
+ console.log(_data)
|
|
let _idList = [];
|
|
let _idList = [];
|
|
if (_data["dialoguePublishDataId"])
|
|
if (_data["dialoguePublishDataId"])
|
|
_idList.push(_data["dialoguePublishDataId"]);
|
|
_idList.push(_data["dialoguePublishDataId"]);
|
|
@@ -1024,7 +1034,7 @@ export default {
|
|
if (_data["cardPublishDataId"])
|
|
if (_data["cardPublishDataId"])
|
|
_idList.push(_data["cardPublishDataId"]);
|
|
_idList.push(_data["cardPublishDataId"]);
|
|
if (_idList.length <= 0) {
|
|
if (_idList.length <= 0) {
|
|
- resolve(0);
|
|
|
|
|
|
+ resolve(3);
|
|
return console.log("该应用无id");
|
|
return console.log("该应用无id");
|
|
}
|
|
}
|
|
// /api/agents/copy_mutiAgent
|
|
// /api/agents/copy_mutiAgent
|
|
@@ -1047,7 +1057,7 @@ export default {
|
|
userId: this.userId,
|
|
userId: this.userId,
|
|
username: this.userName?this.userName:await this.getUserName(this.userId),
|
|
username: this.userName?this.userName:await this.getUserName(this.userId),
|
|
}).then(_=>{
|
|
}).then(_=>{
|
|
- resolve(1);
|
|
|
|
|
|
+ resolve(2);
|
|
}).catch(e=>{
|
|
}).catch(e=>{
|
|
console.log(e)
|
|
console.log(e)
|
|
resolve(0)
|
|
resolve(0)
|