|
@@ -173,7 +173,7 @@
|
|
}).then(res => {
|
|
}).then(res => {
|
|
if (res.state) {
|
|
if (res.state) {
|
|
this.messageList = res.data.map(node => {
|
|
this.messageList = res.data.map(node => {
|
|
- node['userInput'] = this.returnUserInputs(node.inputs);
|
|
|
|
|
|
+ node['userInput'] = this.returnUserInputs(node);
|
|
node['AIInput'] = this.extractContentBetween(node.outputs, node.simpleUUID);
|
|
node['AIInput'] = this.extractContentBetween(node.outputs, node.simpleUUID);
|
|
return node;
|
|
return node;
|
|
});
|
|
});
|
|
@@ -195,7 +195,7 @@
|
|
if (data.status === 'succeeded' || data.status === 'error') {
|
|
if (data.status === 'succeeded' || data.status === 'error') {
|
|
this.clearTimer();
|
|
this.clearTimer();
|
|
this.loading = false;
|
|
this.loading = false;
|
|
- data['userInput'] = this.returnUserInputs(data.inputs);
|
|
|
|
|
|
+ data['userInput'] = this.returnUserInputs(data);
|
|
data['AIInput'] = this.extractContentBetween(data.outputs, data
|
|
data['AIInput'] = this.extractContentBetween(data.outputs, data
|
|
.simpleUUID);
|
|
.simpleUUID);
|
|
this.messageList[this.messageList.length - 1] = data;
|
|
this.messageList[this.messageList.length - 1] = data;
|
|
@@ -205,11 +205,12 @@
|
|
})
|
|
})
|
|
}, 20000)
|
|
}, 20000)
|
|
},
|
|
},
|
|
- returnUserInputs(obj) {
|
|
|
|
|
|
+ returnUserInputs(data) {
|
|
|
|
+ let obj = data.inputs;
|
|
if (!obj) return '';
|
|
if (!obj) return '';
|
|
let html = '';
|
|
let html = '';
|
|
let objs = JSON.parse(obj);
|
|
let objs = JSON.parse(obj);
|
|
- if (objs['company_name']) {
|
|
|
|
|
|
+ if (data.difyTypeId === 2) {
|
|
for (let key in objs) {
|
|
for (let key in objs) {
|
|
if (objs[key].indexOf('https://file-node.oss-cn-shanghai.aliyuncs.com/youji/') > -1) {
|
|
if (objs[key].indexOf('https://file-node.oss-cn-shanghai.aliyuncs.com/youji/') > -1) {
|
|
html += this.formData[key] + ':<img class="message-image" src="' + objs[key] +
|
|
html += this.formData[key] + ':<img class="message-image" src="' + objs[key] +
|
|
@@ -217,7 +218,13 @@
|
|
} else {
|
|
} else {
|
|
html += this.formData[key] + ':' + objs[key] + "<br />";
|
|
html += this.formData[key] + ':' + objs[key] + "<br />";
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ }
|
|
|
|
+ } else if (data.difyTypeId === 4) {
|
|
|
|
+ html += `<div>${objs.model_name}模块</div><div>商品列表:</div>`
|
|
|
|
+ let productList = JSON.parse(objs.json_data);
|
|
|
|
+ for (let i = 0; i < productList.length; i++) {
|
|
|
|
+ html += '<img class="message-image" src="' + productList[i].img +
|
|
|
|
+ '" alt="aa"/>';
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
html = objs.adjustments;
|
|
html = objs.adjustments;
|
|
@@ -260,6 +267,7 @@
|
|
},
|
|
},
|
|
successFunc(res) {
|
|
successFunc(res) {
|
|
if (res.state) {
|
|
if (res.state) {
|
|
|
|
+ this.visibles = false;
|
|
this.newMessage = '';
|
|
this.newMessage = '';
|
|
this.$message.success('操作成功');
|
|
this.$message.success('操作成功');
|
|
this.init();
|
|
this.init();
|
|
@@ -280,20 +288,20 @@
|
|
},
|
|
},
|
|
sureProduct() {
|
|
sureProduct() {
|
|
let form = this.$refs.selectProduct.form;
|
|
let form = this.$refs.selectProduct.form;
|
|
- let currentRow = this.$refs.selectProduct.currentRow;
|
|
|
|
|
|
+ let currentRow = this.$refs.selectProduct.currentRow.map(node => {
|
|
|
|
+ return {
|
|
|
|
+ id: node.id,
|
|
|
|
+ name: node.name,
|
|
|
|
+ subtitme: node.subtitle,
|
|
|
|
+ img: this.imageUrl(node.listDisplayImage),
|
|
|
|
+ unit: '次'
|
|
|
|
+ }
|
|
|
|
+ });
|
|
if (currentRow.length === 0) return this.$message.warning('请至少选择一个商品');
|
|
if (currentRow.length === 0) return this.$message.warning('请至少选择一个商品');
|
|
createAIData(4, {
|
|
createAIData(4, {
|
|
detailed_html: this.htmlCode,
|
|
detailed_html: this.htmlCode,
|
|
model_name: form.modelName,
|
|
model_name: form.modelName,
|
|
- json_data: currentRow.map(node => {
|
|
|
|
- return {
|
|
|
|
- id: node.id,
|
|
|
|
- name: node.name,
|
|
|
|
- subtitme: node.subtitle,
|
|
|
|
- img: this.imageUrl(node),
|
|
|
|
- unit: '次'
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ json_data: JSON.stringify(currentRow)
|
|
}).then(this.successFunc);
|
|
}).then(this.successFunc);
|
|
},
|
|
},
|
|
imageUrl(data) {
|
|
imageUrl(data) {
|