From e937ac642da198c927671bef9fd2e9e676b9d7cd Mon Sep 17 00:00:00 2001 From: han2015 <1019850453@qq.com> Date: Fri, 9 Jan 2026 16:55:09 +0800 Subject: [PATCH] =?UTF-8?q?chatbi:=20=E9=9B=86=E6=88=90api=201.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/date/chatbi.ts | 65 +++++ src/views/date/chatbi.vue | 156 +++++++++++ src/views/date/chatbi_setting_panel.vue | 145 ++++++++++ src/views/date/chatbit_ask_panel.vue | 352 ++++++++++++++++++++++++ src/views/date/device_panel.vue | 119 ++++++++ src/views/doc/spacePermission.vue | 2 +- 6 files changed, 838 insertions(+), 1 deletion(-) create mode 100644 src/api/date/chatbi.ts create mode 100644 src/views/date/chatbi.vue create mode 100644 src/views/date/chatbi_setting_panel.vue create mode 100644 src/views/date/chatbit_ask_panel.vue create mode 100644 src/views/date/device_panel.vue diff --git a/src/api/date/chatbi.ts b/src/api/date/chatbi.ts new file mode 100644 index 0000000..3d3774e --- /dev/null +++ b/src/api/date/chatbi.ts @@ -0,0 +1,65 @@ +import request from '@/utils/request'; +import axios from 'axios'; +/** + * 获取设备生命周期系统的设备档案树 + */ +export function getDevicesTree() { + return request({ + url: "/aibot/devices/tree", + method: "get", + }); +} + + +export function getDevicesMonitors(data:{deviceCode:string,rows:number,page:number}) { + return axios.post( import.meta.env.VITE_APP_BASE_API+"/aibot/devices/ep_monitors",data); +} + +// 获取ChatBI列表 +export function getChatBIList() { + return request({ + url: '/aibot/chatbi/list', + method: 'get', + }); +} + +// 创建ChatBI +export function newChatBI(data: any) { + return request({ + url: '/aibot/chatbi/new', + method: 'post', + data: data + }); +} + +// 编辑ChatBI +export function editChatBI(data: any) { + return request({ + url: '/aibot/chatbi/edit', + method: 'post', + data: data + }); +} + +// 删除ChatBI +export function delChatBI(data: any) { + return request({ + url: '/aibot/chatbi/del', + method: 'post', + data: data + }); +} + +export interface askChatBIRequest { + user_query:string; + db_type?:string; + db_config?:Object; +} +// 调用chatbi +export function askChatBI(data: askChatBIRequest, mode:string) { + return request({ + url: '/aibot/chatbi/api?mode='+mode, + method: 'post', + data: data + }); +} \ No newline at end of file diff --git a/src/views/date/chatbi.vue b/src/views/date/chatbi.vue new file mode 100644 index 0000000..2dd1a92 --- /dev/null +++ b/src/views/date/chatbi.vue @@ -0,0 +1,156 @@ + + + + + + + chatbi 设置 + chatbi 新建 + + + + + + + + + 时序型 + 关系型 + + + + + + + + + 问 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/views/date/chatbi_setting_panel.vue b/src/views/date/chatbi_setting_panel.vue new file mode 100644 index 0000000..ddc8db5 --- /dev/null +++ b/src/views/date/chatbi_setting_panel.vue @@ -0,0 +1,145 @@ + + + + + + + {{props.title}} + + + + + 关系型 + 时序型 + + + + 当前关联数据库: + {{ value }} + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/date/chatbit_ask_panel.vue b/src/views/date/chatbit_ask_panel.vue new file mode 100644 index 0000000..962f8cc --- /dev/null +++ b/src/views/date/chatbit_ask_panel.vue @@ -0,0 +1,352 @@ + + + + + + + + + {{ msg.content }} + + {{ msg.chart?.message }} + + + {{ drawChart('chart_'+index,msg.chart!) }} + + + + {{ msg.chart?.sql }} + + + + + + + + + + + + + 恒信高科ChatBI服务 + + + + 内容由 AI 生成,请仔细甄别 + + + + + + diff --git a/src/views/date/device_panel.vue b/src/views/date/device_panel.vue new file mode 100644 index 0000000..0a624eb --- /dev/null +++ b/src/views/date/device_panel.vue @@ -0,0 +1,119 @@ + + + + + + + + 请选择设备测点 + + + + + + + {{nodeName}}: 没有测点! + 当前节点:{{nodeName}} + + + + + + + + + + + + + + + + + + + diff --git a/src/views/doc/spacePermission.vue b/src/views/doc/spacePermission.vue index b26ce10..37b79bf 100644 --- a/src/views/doc/spacePermission.vue +++ b/src/views/doc/spacePermission.vue @@ -256,7 +256,7 @@ function addNode(key:string,node:Tree){ } function checkNode(key:string,node:Tree):boolean{ - for (const ch of node.child||[]) { + for (const ch of node.child??[]) { if(ch.id==key){ return true }