|
@@ -682,29 +682,35 @@ export default {
|
|
|
_this.$message.error("上传失败");
|
|
|
} else {
|
|
|
console.log(data.Location);
|
|
|
-
|
|
|
- _this.ajax
|
|
|
- .put("https://gpt4.cocorobo.cn/upload_file_knowledge", {
|
|
|
- url: data.Location
|
|
|
- })
|
|
|
- .then(res => {
|
|
|
- let _data = res.data.FunctionResponse;
|
|
|
- if (_data.result && _data.result.id) {
|
|
|
- _this.fileId.push(_data.result.id);
|
|
|
- _this.fileList.push(data.Location);
|
|
|
- _this.$emit("pushFileData", {
|
|
|
- fileId: _data.result.id,
|
|
|
- name: name,
|
|
|
- url: data.Location
|
|
|
- });
|
|
|
- } else {
|
|
|
- console.error("获取fileId失败");
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(e => {
|
|
|
- console.log(e);
|
|
|
- console.error("获取fileId失败");
|
|
|
- });
|
|
|
+ console.log("提交")
|
|
|
+ _this.fileList.push(data.Location);
|
|
|
+ _this.$emit("pushFileData", {
|
|
|
+ fileId: "",
|
|
|
+ name: name,
|
|
|
+ url: data.Location
|
|
|
+ });
|
|
|
+ // _this.ajax
|
|
|
+ // .put("https://gpt4.cocorobo.cn/upload_file_knowledge", {
|
|
|
+ // url: data.Location
|
|
|
+ // })
|
|
|
+ // .then(res => {
|
|
|
+ // let _data = res.data.FunctionResponse;
|
|
|
+ // if (_data.result && _data.result.id) {
|
|
|
+ // _this.fileId.push(_data.result.id);
|
|
|
+ // _this.fileList.push(data.Location);
|
|
|
+ // _this.$emit("pushFileData", {
|
|
|
+ // fileId: _data.result.id,
|
|
|
+ // name: name,
|
|
|
+ // url: data.Location
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // console.error("获取fileId失败");
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // .catch(e => {
|
|
|
+ // console.log(e);
|
|
|
+ // console.error("获取fileId失败");
|
|
|
+ // });
|
|
|
// }
|
|
|
|
|
|
// console.log(data.Location)
|
|
@@ -1241,38 +1247,38 @@ export default {
|
|
|
},
|
|
|
textareaKeydown(_e) {
|
|
|
if (this.showRoleList && this.choseRoleList.length > 0) {
|
|
|
- console.log(_e.keyCode);
|
|
|
- switch (_e.keyCode) {
|
|
|
- case 38: //小键盘上
|
|
|
- _e.preventDefault();
|
|
|
- if (this.choseRoleItem == 0) return;
|
|
|
- this.choseRoleItem--;
|
|
|
- // 修改滚动条高度
|
|
|
- this.$refs.roleListRef.scrollTo({
|
|
|
- top:
|
|
|
- this.$refs[`roleItem${this.choseRoleItem}Ref`][0].offsetTop -
|
|
|
- 10,
|
|
|
- behavior: "smooth"
|
|
|
- });
|
|
|
- // this.$refs.roleListRef.scrollTop = this.choseRoleItem * 107;
|
|
|
- break;
|
|
|
- case 40: //小键盘下
|
|
|
- _e.preventDefault();
|
|
|
- if (this.choseRoleItem == this.choseRoleList.length - 1) return;
|
|
|
- this.choseRoleItem++;
|
|
|
- this.$refs.roleListRef.scrollTo({
|
|
|
- top:
|
|
|
- this.$refs[`roleItem${this.choseRoleItem}Ref`][0].offsetTop -
|
|
|
- 10,
|
|
|
- behavior: "smooth"
|
|
|
- });
|
|
|
- // this.$refs.roleListRef.scrollTop = this.choseRoleItem * 107;
|
|
|
- break;
|
|
|
- case 13: //回车
|
|
|
- _e.preventDefault();
|
|
|
- this.choseRole(this.choseRoleList[this.choseRoleItem]);
|
|
|
- break;
|
|
|
- }
|
|
|
+ // console.log(_e.keyCode);
|
|
|
+ // switch (_e.keyCode) {
|
|
|
+ // case 38: //小键盘上
|
|
|
+ // _e.preventDefault();
|
|
|
+ // if (this.choseRoleItem == 0) return;
|
|
|
+ // this.choseRoleItem--;
|
|
|
+ // // 修改滚动条高度
|
|
|
+ // this.$refs.roleListRef.scrollTo({
|
|
|
+ // top:
|
|
|
+ // this.$refs[`roleItem${this.choseRoleItem}Ref`][0].offsetTop -
|
|
|
+ // 10,
|
|
|
+ // behavior: "smooth"
|
|
|
+ // });
|
|
|
+ // // this.$refs.roleListRef.scrollTop = this.choseRoleItem * 107;
|
|
|
+ // break;
|
|
|
+ // case 40: //小键盘下
|
|
|
+ // _e.preventDefault();
|
|
|
+ // if (this.choseRoleItem == this.choseRoleList.length - 1) return;
|
|
|
+ // this.choseRoleItem++;
|
|
|
+ // this.$refs.roleListRef.scrollTo({
|
|
|
+ // top:
|
|
|
+ // this.$refs[`roleItem${this.choseRoleItem}Ref`][0].offsetTop -
|
|
|
+ // 10,
|
|
|
+ // behavior: "smooth"
|
|
|
+ // });
|
|
|
+ // // this.$refs.roleListRef.scrollTop = this.choseRoleItem * 107;
|
|
|
+ // break;
|
|
|
+ // case 13: //回车
|
|
|
+ // _e.preventDefault();
|
|
|
+ // this.choseRole(this.choseRoleList[this.choseRoleItem]);
|
|
|
+ // break;
|
|
|
+ // }
|
|
|
} else if (_e.key === "Enter") {
|
|
|
_e.preventDefault();
|
|
|
if (_e.shiftKey) {
|
|
@@ -1513,8 +1519,8 @@ export default {
|
|
|
// this.setJson(el)
|
|
|
// })
|
|
|
// }
|
|
|
- this.getRoleList();
|
|
|
- this.getPublicRoleList();
|
|
|
+ // this.getRoleList();
|
|
|
+ // this.getPublicRoleList();
|
|
|
}
|
|
|
};
|
|
|
</script>
|