af-mobile-client-vue3 1.4.54 → 1.4.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/build/vite/optimize.ts +36 -36
  2. package/package.json +1 -1
  3. package/public/favicon.svg +4 -4
  4. package/scripts/verifyCommit.js +19 -19
  5. package/src/components/common/MateChat/apiService.ts +134 -103
  6. package/src/components/common/MateChat/components/MateChatContent.vue +281 -0
  7. package/src/components/common/MateChat/components/MateChatHeader.vue +298 -253
  8. package/src/components/common/MateChat/components/PasswordDialog.vue +97 -0
  9. package/src/components/common/MateChat/composables/useChatHistoryCache.ts +117 -0
  10. package/src/components/common/MateChat/composables/useChatMessagesCache.ts +72 -0
  11. package/src/components/common/MateChat/composables/useMateChat.ts +372 -0
  12. package/src/components/common/MateChat/composables/usePasswordManager.ts +38 -0
  13. package/src/components/common/MateChat/index.vue +443 -0
  14. package/src/components/common/MateChat/types.ts +241 -0
  15. package/src/components/data/UserDetail/types.ts +1 -1
  16. package/src/components/data/XFormGroup/doc/DeviceForm.vue +1 -1
  17. package/src/components/data/XFormGroup/doc/UserForm.vue +1 -1
  18. package/src/components/data/XReportGrid/XAddReport/index.ts +1 -1
  19. package/src/components/data/XReportGrid/XReportDemo.vue +33 -33
  20. package/src/components/data/XReportGrid/XReportDrawer/index.ts +1 -1
  21. package/src/components/data/XReportGrid/print.js +184 -184
  22. package/src/components/data/XTag/index.vue +10 -10
  23. package/src/components/layout/TabBarLayout/index.vue +40 -40
  24. package/src/hooks/useCommon.ts +9 -9
  25. package/src/plugins/AppData.ts +38 -38
  26. package/src/router/invoiceRoutes.ts +33 -33
  27. package/src/services/api/common.ts +109 -109
  28. package/src/services/api/manage.ts +8 -8
  29. package/src/services/api/search.ts +16 -16
  30. package/src/services/restTools.ts +56 -56
  31. package/src/utils/authority-utils.ts +84 -84
  32. package/src/utils/crypto.ts +39 -39
  33. package/src/utils/runEvalFunction.ts +13 -13
  34. package/src/utils/timeUtil.ts +27 -27
  35. package/src/views/component/EvaluateRecordView/index.vue +40 -40
  36. package/src/views/component/MateChat/MateChatView.vue +10 -51
  37. package/src/views/component/XCellDetailView/index.vue +217 -217
  38. package/src/views/component/XReportFormIframeView/index.vue +47 -47
  39. package/src/views/component/XReportFormView/index.vue +13 -13
  40. package/src/views/component/XSignatureView/index.vue +50 -50
  41. package/src/views/component/notice.vue +46 -46
  42. package/src/views/component/topNav.vue +36 -36
  43. package/src/views/invoiceShow/index.vue +61 -61
  44. package/src/views/user/login/index.vue +22 -22
  45. package/vite.config.ts +2 -1
  46. package/src/components/common/MateChat/MateChat.vue +0 -248
  47. package/src/components/common/MateChat/useMateChat.ts +0 -212
@@ -0,0 +1,443 @@
1
+ <script setup lang="ts">
2
+ import type { MateChatConfig, MateChatConfigs } from '@af-mobile-client-vue3/components/common/MateChat/types'
3
+ import MateChatContent from '@af-mobile-client-vue3/components/common/MateChat/components/MateChatContent.vue'
4
+ import PasswordDialog from '@af-mobile-client-vue3/components/common/MateChat/components/PasswordDialog.vue'
5
+ import { usePasswordManager } from '@af-mobile-client-vue3/components/common/MateChat/composables/usePasswordManager'
6
+ import { getConfigByNameAsync } from '@af-mobile-client-vue3/services/api/common'
7
+ // MateChat ai 对话相关
8
+ import { showFailToast, Button as VanButton, Icon as VanIcon, Loading as VanLoading } from 'vant'
9
+ import { computed, defineProps, onMounted, ref } from 'vue'
10
+
11
+ interface MateChatProps {
12
+ /**
13
+ * 配置名称,用于从配置中心获取配置
14
+ */
15
+ configName: string
16
+ /**
17
+ * 服务名
18
+ */
19
+ serviceName?: string
20
+ }
21
+
22
+ const props = defineProps<MateChatProps>()
23
+
24
+ // 使用密码管理 composable
25
+ const { getStoredPassword, savePassword, clearPassword } = usePasswordManager()
26
+
27
+ // 配置加载状态
28
+ const isLoading = ref(true)
29
+ const configError = ref<string | null>(null)
30
+ const showPasswordDialog = ref(false)
31
+ const passwordDialogRef = ref<InstanceType<typeof PasswordDialog> | null>(null)
32
+
33
+ // 临时变量:强制保持 loading 状态(用于调整 loading 样式)
34
+ // 设置为 true 时,组件将始终保持 loading 状态
35
+ const forceLoading = ref(false)
36
+
37
+ // 计算最终的 loading 状态
38
+ // 当有错误时也应该保持 loading 状态(显示错误信息),而不是显示对话页面
39
+ const finalLoading = computed(() => forceLoading.value || isLoading.value || !!configError.value)
40
+
41
+ // 当前使用的配置
42
+ const currentConfig = ref<MateChatConfig | null>(null)
43
+
44
+ const defaultBackgroundGradient = 'background: linear-gradient(to bottom, #d0c9ff 0%, #e6d6f0 8%, #f1dbea 12%, #c8dcfb 40%, #abc6f6 60%, #87aefe 90%)'
45
+ // 琉璃配色
46
+ // background: linear-gradient(to bottom, #a8f0ed 0%, #a8e6cf 8%, #c5b3ff 12%, #e0b3ff 40%, #fff4b8 60%, #ffb8d1 90%);
47
+ // 紫罗兰配色
48
+ // background: linear-gradient(to bottom, #d0c9ff 0%, #e6d6f0 8%, #f1dbea 12%, #c8dcfb 40%, #abc6f6 60%, #87aefe 90%);
49
+ // 蓝白配色
50
+ // 'linear-gradient(to bottom, #1c57e0 0%, #3b82f6 20%, #60a5fa 40%, #93c5fd 60%, #dbeafe 80%, #ffffff 100%)'
51
+ // 计算背景渐变样式
52
+ const backgroundStyle = computed(() => {
53
+ const gradient = currentConfig.value?.backgroundGradient || defaultBackgroundGradient
54
+ return {
55
+ background: gradient,
56
+ }
57
+ })
58
+
59
+ // 存储原始配置数据
60
+ const rawConfigs = ref<MateChatConfigs | MateChatConfig | null>(null)
61
+
62
+ /**
63
+ * 检查配置对象中是否有密码保护的配置
64
+ */
65
+ function hasPasswordProtectedConfig(configs: MateChatConfigs | MateChatConfig | null): boolean {
66
+ if (!configs) {
67
+ return false
68
+ }
69
+ if (Array.isArray(configs)) {
70
+ return configs.some(config => !!config.password)
71
+ }
72
+ if (typeof configs === 'object' && configs !== null) {
73
+ // 如果是配置对象集合
74
+ return Object.values(configs).some((config) => {
75
+ if (typeof config === 'object' && config !== null && 'password' in config) {
76
+ return !!config.password
77
+ }
78
+ return false
79
+ })
80
+ }
81
+ // 单个配置对象
82
+ return !!(configs as MateChatConfig).password
83
+ }
84
+
85
+ /**
86
+ * 根据密码匹配配置
87
+ */
88
+ function findConfigByPassword(
89
+ configs: MateChatConfigs | MateChatConfig | null,
90
+ password: string,
91
+ ): MateChatConfig | null {
92
+ if (!configs) {
93
+ return null
94
+ }
95
+ if (typeof configs === 'object' && configs !== null) {
96
+ // 如果是配置对象集合(MateChatConfigs)
97
+ if (props.configName in configs) {
98
+ const targetConfig = (configs as MateChatConfigs)[props.configName]
99
+ if (targetConfig && targetConfig.password === password) {
100
+ return targetConfig
101
+ }
102
+ }
103
+ // 遍历所有配置查找匹配的密码
104
+ for (const config of Object.values(configs)) {
105
+ if (typeof config === 'object' && config !== null && 'password' in config) {
106
+ if (config.password === password) {
107
+ return config as MateChatConfig
108
+ }
109
+ }
110
+ }
111
+ }
112
+ // 单个配置对象
113
+ const singleConfig = configs as MateChatConfig
114
+ if (singleConfig && singleConfig.password === password) {
115
+ return singleConfig
116
+ }
117
+ return null
118
+ }
119
+
120
+ /**
121
+ * 获取配置(无密码保护时)
122
+ */
123
+ function getConfigWithoutPassword(
124
+ configs: MateChatConfigs | MateChatConfig | null,
125
+ ): MateChatConfig | null {
126
+ if (!configs) {
127
+ return null
128
+ }
129
+ if (typeof configs === 'object' && configs !== null) {
130
+ // 如果是配置对象集合,根据 configName 获取
131
+ if (props.configName in configs) {
132
+ return (configs as MateChatConfigs)[props.configName]
133
+ }
134
+ // 如果没有找到,返回第一个配置
135
+ const firstConfig = Object.values(configs)[0]
136
+ if (firstConfig && typeof firstConfig === 'object' && 'appId' in firstConfig) {
137
+ return firstConfig as MateChatConfig
138
+ }
139
+ }
140
+ // 单个配置对象,直接返回
141
+ return configs as MateChatConfig
142
+ }
143
+
144
+ /**
145
+ * 处理密码确认
146
+ */
147
+ function handlePasswordConfirm(password: string) {
148
+ if (!rawConfigs.value) {
149
+ showFailToast('配置数据异常')
150
+ return
151
+ }
152
+
153
+ const matchedConfig = findConfigByPassword(rawConfigs.value, password)
154
+ if (matchedConfig) {
155
+ // 验证配置的有效性
156
+ if (!validateConfig(matchedConfig)) {
157
+ configError.value = '配置不完整,请联系管理员检查配置'
158
+ showPasswordDialog.value = false
159
+ isLoading.value = false
160
+ return
161
+ }
162
+ // 验证成功,保存密码
163
+ savePassword(password)
164
+ currentConfig.value = matchedConfig
165
+ showPasswordDialog.value = false
166
+ isLoading.value = false
167
+ }
168
+ else {
169
+ // 验证失败,清除保存的密码
170
+ clearPassword()
171
+ // 清空输入框并显示错误,保持对话框打开
172
+ passwordDialogRef.value?.clearPassword()
173
+ passwordDialogRef.value?.setError('密码错误,请重新输入')
174
+ }
175
+ }
176
+
177
+ /**
178
+ * 处理密码取消
179
+ */
180
+ function handlePasswordCancel() {
181
+ // 取消时保持 loading 状态,不加载配置
182
+ showPasswordDialog.value = false
183
+ }
184
+
185
+ /**
186
+ * 验证配置的有效性
187
+ * @param config 配置对象
188
+ * @returns 如果配置有效返回 true,否则返回 false
189
+ */
190
+ function validateConfig(config: MateChatConfig | null): boolean {
191
+ if (!config) {
192
+ return false
193
+ }
194
+
195
+ // 检查必需的字段
196
+ if (!config.appId || typeof config.appId !== 'string' || config.appId.trim() === '') {
197
+ return false
198
+ }
199
+
200
+ if (!config.appKey || typeof config.appKey !== 'string' || config.appKey.trim() === '') {
201
+ return false
202
+ }
203
+
204
+ return true
205
+ }
206
+
207
+ /**
208
+ * 获取友好的错误提示信息
209
+ */
210
+ function getFriendlyErrorMessage(error: string | null): string {
211
+ if (!error) {
212
+ return '加载配置失败,请稍后再试'
213
+ }
214
+
215
+ // 根据错误信息返回更友好的提示
216
+ if (error.includes('未找到') || error.includes('资源')) {
217
+ return '未找到相关配置,请联系管理员'
218
+ }
219
+
220
+ if (error.includes('网络') || error.includes('请求')) {
221
+ return '网络连接异常,请检查网络后重试'
222
+ }
223
+
224
+ if (error.includes('超时')) {
225
+ return '请求超时,请稍后重试'
226
+ }
227
+
228
+ // 默认返回原始错误信息,但可以稍作优化
229
+ return error.length > 50 ? `${error.substring(0, 50)}...` : error
230
+ }
231
+
232
+ /**
233
+ * 处理重试
234
+ */
235
+ function handleRetry() {
236
+ loadConfig()
237
+ }
238
+
239
+ /**
240
+ * 加载配置
241
+ */
242
+ async function loadConfig() {
243
+ try {
244
+ isLoading.value = true
245
+ configError.value = null
246
+
247
+ const configs = await getConfigByNameAsync(props.configName, props.serviceName)
248
+
249
+ // 检查配置是否为空或无效
250
+ if (!configs) {
251
+ configError.value = '未找到有效配置'
252
+ isLoading.value = false
253
+ return
254
+ }
255
+
256
+ rawConfigs.value = configs
257
+
258
+ // 检查是否有密码保护的配置
259
+ if (hasPasswordProtectedConfig(configs)) {
260
+ // 尝试从 localStorage 读取保存的密码
261
+ const storedPassword = getStoredPassword()
262
+ if (storedPassword) {
263
+ // 自动验证保存的密码
264
+ const matchedConfig = findConfigByPassword(configs, storedPassword)
265
+ if (matchedConfig) {
266
+ // 验证配置的有效性
267
+ if (validateConfig(matchedConfig)) {
268
+ // 验证成功,直接加载配置
269
+ currentConfig.value = matchedConfig
270
+ isLoading.value = false
271
+ return
272
+ }
273
+ else {
274
+ // 配置无效,清除密码并显示对话框
275
+ clearPassword()
276
+ showPasswordDialog.value = true
277
+ return
278
+ }
279
+ }
280
+ else {
281
+ // 密码不匹配,清除保存的密码并显示对话框
282
+ clearPassword()
283
+ showPasswordDialog.value = true
284
+ return
285
+ }
286
+ }
287
+ // 没有保存的密码,显示密码输入对话框
288
+ showPasswordDialog.value = true
289
+ // 保持 loading 状态,等待密码验证
290
+ return
291
+ }
292
+
293
+ // 没有密码保护,直接加载配置
294
+ const config = getConfigWithoutPassword(configs)
295
+ if (config) {
296
+ // 验证配置的有效性
297
+ if (!validateConfig(config)) {
298
+ configError.value = '配置不完整,请联系管理员检查配置'
299
+ isLoading.value = false
300
+ return
301
+ }
302
+ currentConfig.value = config
303
+ isLoading.value = false
304
+ }
305
+ else {
306
+ configError.value = '未找到有效配置'
307
+ isLoading.value = false
308
+ }
309
+ }
310
+ catch (error: any) {
311
+ console.error('加载配置失败:', error)
312
+ configError.value = error?.message || '加载配置失败,请稍后再试'
313
+ isLoading.value = false
314
+ }
315
+ }
316
+
317
+ onMounted(() => {
318
+ loadConfig()
319
+ })
320
+ </script>
321
+
322
+ <template>
323
+ <div id="mate-chat-view" :style="backgroundStyle">
324
+ <!-- 密码输入对话框 -->
325
+ <PasswordDialog
326
+ ref="passwordDialogRef"
327
+ :visible="showPasswordDialog"
328
+ @confirm="handlePasswordConfirm"
329
+ @cancel="handlePasswordCancel"
330
+ />
331
+ <!-- Loading 状态 -->
332
+ <div v-if="finalLoading" class="loading-container">
333
+ <div v-if="configError" class="error-container">
334
+ <VanIcon name="warning-o" size="48" class="error-icon" />
335
+ <div class="error-title">
336
+ 抱歉,加载失败
337
+ </div>
338
+ <div class="error-message">
339
+ {{ getFriendlyErrorMessage(configError) }}
340
+ </div>
341
+ <VanButton
342
+ type="primary"
343
+ size="small"
344
+ class="retry-button"
345
+ @click="handleRetry"
346
+ >
347
+ 重试
348
+ </VanButton>
349
+ </div>
350
+ <VanLoading v-else vertical>
351
+ <template #icon>
352
+ <VanIcon name="star-o" size="30" />
353
+ </template>
354
+ 加载中...
355
+ </VanLoading>
356
+ </div>
357
+ <!-- 对话内容 -->
358
+ <MateChatContent
359
+ v-else-if="currentConfig"
360
+ :config="currentConfig"
361
+ />
362
+ </div>
363
+ </template>
364
+
365
+ <style scoped lang="less">
366
+ #mate-chat-view {
367
+ /* 外层渐变背景容器 */
368
+ width: 100%;
369
+ min-height: 100%;
370
+ /* 背景色通过 :style 绑定从配置中获取 */
371
+ padding: 20px;
372
+ display: flex;
373
+ justify-content: center;
374
+ align-items: flex-start;
375
+ box-sizing: border-box;
376
+
377
+ /* 移动端适配 */
378
+ @media (max-width: 768px) {
379
+ padding: 8px;
380
+ }
381
+
382
+ .loading-container {
383
+ width: 100%;
384
+ max-width: 1200px;
385
+ height: calc(100vh - 40px);
386
+ background: #ffffff;
387
+ border-radius: 24px;
388
+ box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
389
+ display: flex;
390
+ align-items: center;
391
+ justify-content: center;
392
+ min-height: 400px;
393
+ padding: 20px;
394
+ box-sizing: border-box;
395
+
396
+ /* 移动端适配 */
397
+ @media (max-width: 768px) {
398
+ height: calc(100% - 18px);
399
+ border-radius: 16px;
400
+ padding: 8px;
401
+ }
402
+
403
+ .loading-message {
404
+ font-size: 14px;
405
+ color: #71757f;
406
+ text-align: center;
407
+ }
408
+
409
+ .error-container {
410
+ display: flex;
411
+ flex-direction: column;
412
+ align-items: center;
413
+ justify-content: center;
414
+ padding: 24px;
415
+ text-align: center;
416
+
417
+ .error-icon {
418
+ color: #ff9800;
419
+ margin-bottom: 16px;
420
+ }
421
+
422
+ .error-title {
423
+ font-size: 16px;
424
+ font-weight: 500;
425
+ color: #323233;
426
+ margin-bottom: 8px;
427
+ }
428
+
429
+ .error-message {
430
+ font-size: 14px;
431
+ color: #969799;
432
+ line-height: 1.5;
433
+ margin-bottom: 24px;
434
+ max-width: 280px;
435
+ }
436
+
437
+ .retry-button {
438
+ min-width: 100px;
439
+ }
440
+ }
441
+ }
442
+ }
443
+ </style>
@@ -0,0 +1,241 @@
1
+ /**
2
+ * MateChat 提示项接口
3
+ */
4
+ export interface MateChatPromptItem {
5
+ value: string
6
+ label: string
7
+ iconConfig?: {
8
+ name: string
9
+ color?: string
10
+ }
11
+ desc?: string
12
+ }
13
+
14
+ /**
15
+ * MateChat 配置接口
16
+ */
17
+ export interface MateChatConfig {
18
+ /**
19
+ * 可选密码,如果存在则需要密码验证
20
+ */
21
+ password?: string
22
+ /**
23
+ * FastGPT 应用 ID
24
+ */
25
+ appId: string
26
+ /**
27
+ * FastGPT API Key
28
+ */
29
+ appKey: string
30
+ /**
31
+ * 介绍文案
32
+ */
33
+ description: string[]
34
+ /**
35
+ * 首屏推荐问题列表
36
+ */
37
+ introPrompt: MateChatPromptItem[]
38
+ /**
39
+ * 底部快捷问题列表
40
+ */
41
+ simplePrompt: MateChatPromptItem[]
42
+ /**
43
+ * 客服名称
44
+ */
45
+ serviceName: string
46
+ /**
47
+ * 是否使用流式对话
48
+ */
49
+ useStream: boolean
50
+ /**
51
+ * 背景渐变颜色(CSS linear-gradient 字符串)
52
+ * 如果不提供,使用默认蓝白渐变
53
+ */
54
+ backgroundGradient?: string
55
+ }
56
+
57
+ /**
58
+ * 配置中心返回的多个配置对象
59
+ * key 为配置名称,value 为 MateChatConfig
60
+ */
61
+ export type MateChatConfigs = Record<string, MateChatConfig>
62
+
63
+ // ==================== API 相关类型定义 ====================
64
+
65
+ /**
66
+ * 聊天消息接口
67
+ */
68
+ export interface ChatMessage {
69
+ role: 'user' | 'assistant' | 'system'
70
+ content: string
71
+ }
72
+
73
+ /**
74
+ * 聊天请求参数接口
75
+ */
76
+ export interface ChatCompletionsRequest {
77
+ chatId: string
78
+ stream: boolean
79
+ detail: boolean
80
+ messages: ChatMessage[]
81
+ customUid?: string
82
+ }
83
+
84
+ /**
85
+ * 聊天响应使用情况接口
86
+ */
87
+ export interface ChatUsage {
88
+ prompt_tokens: number
89
+ completion_tokens: number
90
+ total_tokens: number
91
+ }
92
+
93
+ /**
94
+ * 聊天响应选择项接口
95
+ */
96
+ export interface ChatChoice {
97
+ message: {
98
+ role: 'assistant'
99
+ content: string
100
+ }
101
+ finish_reason: string
102
+ index: number
103
+ }
104
+
105
+ /**
106
+ * 聊天响应接口
107
+ */
108
+ export interface ChatCompletionsResponse {
109
+ id: string
110
+ model: string
111
+ usage: ChatUsage
112
+ choices: ChatChoice[]
113
+ }
114
+
115
+ /**
116
+ * 业务层聊天结果
117
+ */
118
+ export interface ChatBizResult {
119
+ /**
120
+ * normal: 普通回复
121
+ * transfer: 转人工
122
+ */
123
+ type: 'normal' | 'transfer'
124
+ /**
125
+ * 大模型原始返回内容
126
+ */
127
+ content: string
128
+ }
129
+
130
+ /**
131
+ * 流式对话回调
132
+ */
133
+ export interface ChatStreamCallbacks {
134
+ /**
135
+ * 每次收到 FastGPT SSE 的增量内容时触发
136
+ */
137
+ onMessage?: (chunk: string) => void
138
+ /**
139
+ * 流结束时触发(包括收到 [DONE] 或正常读取结束)
140
+ */
141
+ onComplete?: () => void
142
+ /**
143
+ * 请求或解析发生异常时触发
144
+ */
145
+ onError?: (error: unknown) => void
146
+ }
147
+
148
+ /**
149
+ * 历史会话项接口
150
+ */
151
+ export interface ChatHistoryItem {
152
+ chatId: string
153
+ updateTime: string
154
+ appId: string
155
+ customTitle: string
156
+ title: string
157
+ top: boolean
158
+ [key: string]: any
159
+ }
160
+
161
+ /**
162
+ * 历史会话查询请求参数接口
163
+ */
164
+ export interface GetHistoriesRequest {
165
+ appId: string
166
+ outLinkUid: string
167
+ offset: number
168
+ pageSize: number
169
+ source: string
170
+ }
171
+
172
+ /**
173
+ * 历史会话查询响应接口
174
+ */
175
+ export interface GetHistoriesResponse {
176
+ code: number
177
+ statusText: string
178
+ message: string
179
+ data: {
180
+ list: ChatHistoryItem[]
181
+ total: number
182
+ }
183
+ }
184
+
185
+ /**
186
+ * 历史会话记录项接口
187
+ */
188
+ export interface ChatRecordItem {
189
+ _id: string
190
+ dataId: string
191
+ hideInUI: boolean
192
+ obj: 'Human' | 'AI'
193
+ value: Array<{
194
+ type: string
195
+ text: {
196
+ content: string
197
+ }
198
+ }>
199
+ customFeedbacks: any[]
200
+ time: string
201
+ durationSeconds?: number
202
+ llmModuleAccount?: number
203
+ totalQuoteList?: any[]
204
+ historyPreviewLength?: number
205
+ [key: string]: any
206
+ }
207
+
208
+ /**
209
+ * 获取历史会话记录请求参数接口
210
+ */
211
+ export interface GetPaginationRecordsRequest {
212
+ appId: string
213
+ chatId: string
214
+ offset: number
215
+ pageSize: number
216
+ loadCustomFeedbacks: boolean
217
+ }
218
+
219
+ /**
220
+ * 获取历史会话记录响应接口
221
+ */
222
+ export interface GetPaginationRecordsResponse {
223
+ code: number
224
+ statusText: string
225
+ message: string
226
+ data: {
227
+ list: ChatRecordItem[]
228
+ total: number
229
+ }
230
+ }
231
+
232
+ // ==================== MateChat 组件内部类型 ====================
233
+
234
+ /**
235
+ * MateChat 组件内部使用的消息结构
236
+ */
237
+ export interface MateChatMessage {
238
+ from: 'user' | 'model' | 'service'
239
+ content: string
240
+ loading?: boolean
241
+ }
@@ -23,4 +23,4 @@ export interface ConfigItem {
23
23
  format?: (value: string | number) => string
24
24
  template?: string
25
25
  condition?: (data: any) => boolean
26
- }
26
+ }
@@ -119,4 +119,4 @@ onUnmounted(() => {
119
119
  color: #ff976a;
120
120
  }
121
121
  }
122
- </style>
122
+ </style>
@@ -99,4 +99,4 @@ onUnmounted(() => {
99
99
  .user-form {
100
100
  padding: 16px;
101
101
  }
102
- </style>
102
+ </style>
@@ -7,4 +7,4 @@ export default {
7
7
  install(app: App) {
8
8
  app.component('XAddReport', XAddReport)
9
9
  },
10
- }
10
+ }