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