feat(ai-web): 增加feedback

This commit is contained in:
2025-06-15 23:42:26 +08:00
parent e2d69bc6e8
commit 138ee140e1
9 changed files with 301 additions and 24 deletions

View File

@@ -0,0 +1,108 @@
import React from 'react'
import {amisRender, commonInfo, crudCommonOptions} from '../../../util/amis.tsx'
const Feedback: React.FC = () => {
return (
<div className="feedback">
{amisRender(
{
type: 'page',
title: '报障清单',
body: [
{
type: 'crud',
api: `${commonInfo.baseAiUrl}/feedback/list`,
...crudCommonOptions(),
headerToolbar: [
'reload',
{
type: 'action',
label: '',
icon: 'fa fa-plus',
tooltip: '新增',
tooltipPlacement: 'top',
actionType: 'dialog',
dialog: {
title: '新增报账单',
size: 'md',
body: {
debug: commonInfo.debug,
type: 'form',
api: {
url: `${commonInfo.baseAiUrl}/feedback/add`,
dataType: 'form',
},
body: [
{
type: 'editor',
required: true,
label: '故障描述',
name: 'source',
language: 'plaintext',
options: {
lineNumbers: 'off',
wordWrap: 'bounded',
},
},
{
type: 'input-image',
name: 'pictures',
label: '相关截图',
autoUpload: false,
multiple: true,
// 5MB 5242880
// 100MB 104857600
// 500MB 524288000
// 1GB 1073741824
maxSize: 5242880,
receiver: `${commonInfo.baseAiUrl}/upload`
},
],
},
},
},
],
columns: [
{
name: 'id',
label: '编号',
},
{
name: 'status',
label: '状态',
width: 80,
},
{
type: 'operation',
label: '操作',
width: 150,
buttons: [
{
type: 'action',
label: '删除',
className: 'text-danger hover:text-red-600',
level: 'link',
size: 'sm',
actionType: 'ajax',
api: {
method: 'get',
url: `${commonInfo.baseAiUrl}/feedback/delete`,
data: {
id: '${id}',
},
},
confirmText: '确认删除',
confirmTitle: '删除',
},
],
},
],
},
],
},
)}
</div>
)
}
export default Feedback

View File

@@ -1,20 +1,19 @@
import {
CheckSquareOutlined,
CloudOutlined,
ClusterOutlined,
CompressOutlined,
DatabaseOutlined,
InfoCircleOutlined,
OpenAIOutlined,
QuestionOutlined,
SunOutlined,
SyncOutlined,
TableOutlined,
ToolOutlined,
CheckSquareOutlined,
CloudOutlined,
ClusterOutlined,
CompressOutlined,
DatabaseOutlined,
InfoCircleOutlined,
OpenAIOutlined,
QuestionOutlined,
SunOutlined,
SyncOutlined,
TableOutlined,
ToolOutlined,
} from '@ant-design/icons'
import {Navigate, type RouteObject} from 'react-router'
import Conversation from './pages/ai/Conversation.tsx'
import Inspection from './pages/ai/Inspection.tsx'
import DataDetail from './pages/ai/knowledge/DataDetail.tsx'
import DataImport from './pages/ai/knowledge/DataImport.tsx'
import DataSegment from './pages/ai/knowledge/DataSegment.tsx'
@@ -31,6 +30,7 @@ import Yarn from './pages/overview/Yarn.tsx'
import YarnCluster from './pages/overview/YarnCluster.tsx'
import {commonInfo} from './util/amis.tsx'
import Test from './pages/Test.tsx'
import Feedback from './pages/ai/feedback/Feedback.tsx'
export const routes: RouteObject[] = [
{
@@ -84,14 +84,14 @@ export const routes: RouteObject[] = [
index: true,
element: <Navigate to="/ai/conversation" replace/>,
},
{
path: 'inspection',
Component: Inspection,
},
{
path: 'conversation',
Component: Conversation,
},
{
path: 'feedback',
Component: Feedback,
},
{
path: 'knowledge',
Component: Knowledge,
@@ -201,8 +201,8 @@ export const menus = {
icon: <QuestionOutlined/>,
},
{
path: '/ai/inspection',
name: '智能巡检',
path: '/ai/feedback',
name: '智慧报账',
icon: <CheckSquareOutlined/>,
},
{

View File

@@ -10,8 +10,8 @@ import {isEqual} from 'licia'
export const commonInfo = {
debug: isEqual(import.meta.env.MODE, 'development'),
baseUrl: 'http://132.126.207.130:35690/hudi_services/service_web',
baseAiUrl: 'http://132.126.207.130:35690/hudi_services/service_ai_web',
// baseAiUrl: 'http://localhost:8080',
// baseAiUrl: 'http://132.126.207.130:35690/hudi_services/service_ai_web',
baseAiUrl: 'http://localhost:8080',
authorizationHeaders: {
'Authorization': 'Basic QXhoRWJzY3dzSkRiWU1IMjpjWXhnM2I0UHRXb1ZENVNqRmF5V3h0blNWc2p6UnNnNA==',
'Content-Type': 'application/json',