@gindow/element-go 1.0.0
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.
- package/README.md +260 -0
- package/dist/element-go.cjs +1 -0
- package/dist/element-go.d.ts +1 -0
- package/dist/element-go.mjs +2994 -0
- package/dist/resolver.cjs +1 -0
- package/dist/resolver.d.ts +1 -0
- package/dist/resolver.mjs +16 -0
- package/dist/styles/index.css +2 -0
- package/package.json +133 -0
- package/src/assets/avatar.png +0 -0
- package/src/assets/icon.png +0 -0
- package/src/components/ExAssetPreview.vue +55 -0
- package/src/components/ExButton.vue +47 -0
- package/src/components/ExEmpty.vue +26 -0
- package/src/components/ExForm.vue +95 -0
- package/src/components/ExFormField.vue +49 -0
- package/src/components/ExFormSearch.vue +50 -0
- package/src/components/ExFormViewer.vue +51 -0
- package/src/components/ExIcon.vue +33 -0
- package/src/components/ExInputPercentage.vue +36 -0
- package/src/components/ExLayout/account.vue +33 -0
- package/src/components/ExLayout/aside.vue +58 -0
- package/src/components/ExLayout/lang.vue +27 -0
- package/src/components/ExLayout.vue +91 -0
- package/src/components/ExLoading.vue +18 -0
- package/src/components/ExMenu.vue +80 -0
- package/src/components/ExPage.vue +66 -0
- package/src/components/ExPageHeader.vue +34 -0
- package/src/components/ExPagination.vue +34 -0
- package/src/components/ExSelect.vue +28 -0
- package/src/components/ExTable.vue +237 -0
- package/src/components/ExTableColumn.vue +160 -0
- package/src/components/ExUpload.vue +91 -0
- package/src/components/ExUploadAsset.vue +299 -0
- package/src/components/vIcon.vue +23 -0
- package/src/env.d.ts +7 -0
- package/src/hooks/useBreak.ts +23 -0
- package/src/hooks/useChat.ts +135 -0
- package/src/hooks/useIcon.ts +8 -0
- package/src/hooks/useMessage.ts +22 -0
- package/src/hooks/useNanoid.ts +9 -0
- package/src/hooks/useUpload.ts +60 -0
- package/src/index.ts +94 -0
- package/src/libs/auto-imports.d.ts +94 -0
- package/src/libs/components.d.ts +171 -0
- package/src/locale/en-US.ts +49 -0
- package/src/locale/index.ts +73 -0
- package/src/locale/zh-CN.ts +49 -0
- package/src/resolver.ts +26 -0
- package/src/styles/arco.css +179 -0
- package/src/styles/index.css +53 -0
- package/src/types/index.ts +77 -0
- package/src/utils/datetime.ts +42 -0
- package/src/utils/download.ts +11 -0
- package/src/utils/formatter.ts +42 -0
- package/src/utils/get.ts +10 -0
- package/src/utils/index.ts +8 -0
- package/src/utils/params.ts +18 -0
- package/src/utils/platform.ts +38 -0
- package/src/utils/request.ts +144 -0
- package/src/utils/validate.ts +23 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
export interface IChatMessage {
|
|
2
|
+
question: string
|
|
3
|
+
answer: string
|
|
4
|
+
conversation_id: string
|
|
5
|
+
message_id: string
|
|
6
|
+
created_at: number
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface IMessageEvent {
|
|
10
|
+
event: 'message' | 'agent_message' | 'agent_thought' | 'message_file' | 'message_end' | 'tts_message' | 'tts_message_end' | 'message_replace' | 'error' | 'ping'
|
|
11
|
+
task_id: string
|
|
12
|
+
id: string
|
|
13
|
+
conversation_id: string
|
|
14
|
+
message_id: string
|
|
15
|
+
created_at: number
|
|
16
|
+
answer?: string
|
|
17
|
+
metadata?: Record<string, any>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface IUsageEvent {
|
|
21
|
+
event: 'message_end'
|
|
22
|
+
task_id: string
|
|
23
|
+
id: string
|
|
24
|
+
conversation_id: string
|
|
25
|
+
message_id: string
|
|
26
|
+
created_at: number
|
|
27
|
+
usage: {
|
|
28
|
+
prompt_tokens: number
|
|
29
|
+
prompt_unit_price: number
|
|
30
|
+
prompt_price_unit: number
|
|
31
|
+
prompt_price: number
|
|
32
|
+
completion_tokens: number
|
|
33
|
+
completion_unit_price: number
|
|
34
|
+
completion_price_unit: number
|
|
35
|
+
completion_price: number
|
|
36
|
+
total_tokens: number
|
|
37
|
+
total_price: number
|
|
38
|
+
currency: string
|
|
39
|
+
latency: number
|
|
40
|
+
}
|
|
41
|
+
metadata?: Record<string, any>
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface IErrorEvent {
|
|
45
|
+
event: 'error'
|
|
46
|
+
task_id: string
|
|
47
|
+
id: string
|
|
48
|
+
code: string
|
|
49
|
+
message: string
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface ISendMessageParams {
|
|
53
|
+
query: string
|
|
54
|
+
inputs?: Record<string, any>
|
|
55
|
+
response_mode?: 'streaming' | 'blocking'
|
|
56
|
+
conversation_id?: string
|
|
57
|
+
user: string
|
|
58
|
+
files?: Array<{
|
|
59
|
+
type: string
|
|
60
|
+
transfer_method: 'remote_url' | 'local_file'
|
|
61
|
+
url?: string
|
|
62
|
+
upload_file_id?: string
|
|
63
|
+
}>
|
|
64
|
+
auto_generate_name?: boolean
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export const useChat = (baseURL: string, apiKey: string) => {
|
|
68
|
+
|
|
69
|
+
const sendMessage = async (
|
|
70
|
+
params: ISendMessageParams,
|
|
71
|
+
callbacks: {
|
|
72
|
+
onMessage?: (text: string) => void
|
|
73
|
+
onEnd?: (conversationId: string, messageId: string) => void
|
|
74
|
+
onError?: (error: { code: string; message: string }) => void
|
|
75
|
+
onFinish?: () => void
|
|
76
|
+
},
|
|
77
|
+
) => {
|
|
78
|
+
const { onMessage, onEnd, onError, onFinish } = callbacks
|
|
79
|
+
|
|
80
|
+
try {
|
|
81
|
+
const { ok, status, statusText, body } = await fetch(`${baseURL}/chat-messages`, {
|
|
82
|
+
method: 'POST',
|
|
83
|
+
headers: {
|
|
84
|
+
'Authorization': `Bearer ${apiKey}`,
|
|
85
|
+
'Content-Type': 'application/json',
|
|
86
|
+
},
|
|
87
|
+
body: JSON.stringify({
|
|
88
|
+
...params,
|
|
89
|
+
response_mode: 'streaming',
|
|
90
|
+
}),
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
if (!ok) return onError?.({ code: String(status), message: statusText })
|
|
94
|
+
|
|
95
|
+
const reader = body?.getReader()
|
|
96
|
+
if (!reader) return onError?.({ code: 'reader_error', message: 'Failed to get response reader' })
|
|
97
|
+
|
|
98
|
+
const decoder = new TextDecoder()
|
|
99
|
+
let buffer = ''
|
|
100
|
+
|
|
101
|
+
while (true) {
|
|
102
|
+
const { done, value } = await reader.read()
|
|
103
|
+
if (done) break
|
|
104
|
+
|
|
105
|
+
buffer += decoder.decode(value, { stream: true })
|
|
106
|
+
const lines = buffer.split('\n')
|
|
107
|
+
buffer = lines.pop() || ''
|
|
108
|
+
|
|
109
|
+
for (const line of lines) {
|
|
110
|
+
if (line.startsWith('data:')) {
|
|
111
|
+
try {
|
|
112
|
+
const jsonStr = line.slice(5).trim()
|
|
113
|
+
if (!jsonStr) continue
|
|
114
|
+
|
|
115
|
+
const data = JSON.parse(jsonStr) as IMessageEvent | IUsageEvent | IErrorEvent
|
|
116
|
+
|
|
117
|
+
if (data.event === 'agent_message') onMessage?.((data as IMessageEvent).answer || '')
|
|
118
|
+
else if (data.event === 'message_end') onEnd?.(data.conversation_id, data.message_id)
|
|
119
|
+
else if (data.event === 'error') {
|
|
120
|
+
const { code, message } = data as IErrorEvent
|
|
121
|
+
onError?.({ code, message })
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
onFinish?.()
|
|
125
|
+
} catch (e) {}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
} catch (error) {
|
|
130
|
+
onError?.({ code: 'network_error', message: String(error) })
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return { sendMessage }
|
|
135
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { VNode } from 'vue'
|
|
2
|
+
import { ElMessage, ElMessageBox, ElNotification } from 'element-plus'
|
|
3
|
+
import type { MessageOptions, ElMessageBoxOptions, NotificationOptions } from 'element-plus'
|
|
4
|
+
import { useLocale } from '../locale'
|
|
5
|
+
import 'element-plus/theme-chalk/el-message.css'
|
|
6
|
+
import 'element-plus/theme-chalk/el-message-box.css'
|
|
7
|
+
import 'element-plus/theme-chalk/el-notification.css'
|
|
8
|
+
|
|
9
|
+
export const useMessage = () => {
|
|
10
|
+
const { t } = useLocale()
|
|
11
|
+
|
|
12
|
+
const message = (msg: string, options: Partial<MessageOptions> = {}) => ElMessage({ message: msg, ...options })
|
|
13
|
+
const success = (msg: string, options: Partial<MessageOptions> = {}) => ElMessage({ message: msg, type: 'success', ...options })
|
|
14
|
+
const error = (msg: string, options: Partial<MessageOptions> = {}) => ElMessage({ message: msg, type: 'error', ...options })
|
|
15
|
+
const warning = (msg: string, options: Partial<MessageOptions> = {}) => ElMessage({ message: msg, type: 'warning', ...options })
|
|
16
|
+
const dialog = (msg: string, title?: string, options: Partial<ElMessageBoxOptions> = {}) => ElMessageBox.alert(msg, title ?? t('dialog.tip'), options)
|
|
17
|
+
const confirm = (msg: string, title?: string, options: Partial<ElMessageBoxOptions> = {}) => ElMessageBox.confirm(msg, title ?? t('dialog.confirm'), options)
|
|
18
|
+
const prompt = (msg: string | VNode, title?: string, options: Partial<ElMessageBoxOptions> = {}) => ElMessageBox.prompt(msg, title ?? t('dialog.prompt'), { type: 'warning', inputValidator: (value: string) => value ? true : t('dialog.required'), ...options })
|
|
19
|
+
const notify = (msg: string, options: Partial<NotificationOptions> = {}) => ElNotification({ message: msg, ...options })
|
|
20
|
+
|
|
21
|
+
return { message, success, error, warning, dialog, confirm, prompt, notify }
|
|
22
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import fileTypeChecker from 'file-type-checker'
|
|
2
|
+
import heic2any from 'heic2any'
|
|
3
|
+
import Compressor from 'compressorjs'
|
|
4
|
+
|
|
5
|
+
export const useUpload = () => {
|
|
6
|
+
|
|
7
|
+
const HEIC = (file: File): Promise<File> => {
|
|
8
|
+
return new Promise(async resolve => {
|
|
9
|
+
const blob = (await heic2any({ blob: file, toType: 'image/jpeg', quality: 0.9 }) as Blob)
|
|
10
|
+
const newFile = new File([blob], file.name, { type: blob.type, lastModified: Date.now() })
|
|
11
|
+
return resolve(newFile)
|
|
12
|
+
})
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const compressor = (file: File): Promise<File> => {
|
|
16
|
+
return new Promise(resolve => {
|
|
17
|
+
new Compressor(file, { quality: 0.9, success: (file: File) => resolve(file) })
|
|
18
|
+
})
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const handler = (
|
|
22
|
+
file: File,
|
|
23
|
+
para: { compressor: boolean } = { compressor: true }
|
|
24
|
+
): Promise<File> => {
|
|
25
|
+
return new Promise( resolve => {
|
|
26
|
+
const reader = new FileReader()
|
|
27
|
+
reader.readAsArrayBuffer(file)
|
|
28
|
+
reader.onload = () => {
|
|
29
|
+
const isHeic = fileTypeChecker.validateFileType(reader.result as ArrayBuffer, ['heic'])
|
|
30
|
+
const isCompressor = fileTypeChecker.validateFileType(reader.result as ArrayBuffer, ['jpeg', 'png', 'gif', 'bmp'])
|
|
31
|
+
if (isHeic) resolve(HEIC(file))
|
|
32
|
+
else if (isCompressor && para.compressor) resolve(compressor(file))
|
|
33
|
+
else resolve(file)
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const getDimension = async (blob: Blob): Promise<{ width: number; height: number }> => {
|
|
39
|
+
return new Promise((resolve, reject) => {
|
|
40
|
+
const img = new Image()
|
|
41
|
+
img.src = URL.createObjectURL(blob)
|
|
42
|
+
img.onload = () => resolve({ width: img.naturalWidth, height: img.naturalHeight })
|
|
43
|
+
img.onerror = (err) => reject(err)
|
|
44
|
+
})
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
const getFileType = (file: File): Promise<{ mimeType: string }> => {
|
|
49
|
+
return new Promise(resolve => {
|
|
50
|
+
const reader = new FileReader()
|
|
51
|
+
reader.readAsArrayBuffer(file)
|
|
52
|
+
reader.onload = () => {
|
|
53
|
+
const detectedFile = fileTypeChecker.detectFile(reader.result as ArrayBuffer)
|
|
54
|
+
resolve({ mimeType: detectedFile?.mimeType! })
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return { handler, getDimension, getFileType }
|
|
60
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { App, Plugin } from 'vue'
|
|
2
|
+
import { provider, setLocale, getLocale, useLocale } from './locale'
|
|
3
|
+
import ExAssetPreview from './components/ExAssetPreview.vue'
|
|
4
|
+
import ExButton from './components/ExButton.vue'
|
|
5
|
+
import ExEmpty from './components/ExEmpty.vue'
|
|
6
|
+
import ExForm from './components/ExForm.vue'
|
|
7
|
+
import ExFormField from './components/ExFormField.vue'
|
|
8
|
+
import ExFormSearch from './components/ExFormSearch.vue'
|
|
9
|
+
import ExFormViewer from './components/ExFormViewer.vue'
|
|
10
|
+
import ExIcon from './components/ExIcon.vue'
|
|
11
|
+
import ExInputPercentage from './components/ExInputPercentage.vue'
|
|
12
|
+
import ExLayout from './components/ExLayout.vue'
|
|
13
|
+
import ExLoading from './components/ExLoading.vue'
|
|
14
|
+
import ExMenu from './components/ExMenu.vue'
|
|
15
|
+
import ExPage from './components/ExPage.vue'
|
|
16
|
+
import ExPageHeader from './components/ExPageHeader.vue'
|
|
17
|
+
import ExPagination from './components/ExPagination.vue'
|
|
18
|
+
import ExSelect from './components/ExSelect.vue'
|
|
19
|
+
import ExTable from './components/ExTable.vue'
|
|
20
|
+
import ExTableColumn from './components/ExTableColumn.vue'
|
|
21
|
+
import ExUpload from './components/ExUpload.vue'
|
|
22
|
+
import ExUploadAsset from './components/ExUploadAsset.vue'
|
|
23
|
+
import './styles/index.css'
|
|
24
|
+
|
|
25
|
+
export * from './types'
|
|
26
|
+
export { useMessage } from './hooks/useMessage'
|
|
27
|
+
export { useNanoid } from './hooks/useNanoid'
|
|
28
|
+
export { useIcon } from './hooks/useIcon'
|
|
29
|
+
|
|
30
|
+
const components = [
|
|
31
|
+
ExAssetPreview,
|
|
32
|
+
ExButton,
|
|
33
|
+
ExEmpty,
|
|
34
|
+
ExForm,
|
|
35
|
+
ExFormField,
|
|
36
|
+
ExFormSearch,
|
|
37
|
+
ExFormViewer,
|
|
38
|
+
ExIcon,
|
|
39
|
+
ExInputPercentage,
|
|
40
|
+
ExLayout,
|
|
41
|
+
ExLoading,
|
|
42
|
+
ExMenu,
|
|
43
|
+
ExPage,
|
|
44
|
+
ExPageHeader,
|
|
45
|
+
ExPagination,
|
|
46
|
+
ExSelect,
|
|
47
|
+
ExTable,
|
|
48
|
+
ExTableColumn,
|
|
49
|
+
ExUpload,
|
|
50
|
+
ExUploadAsset,
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
components.forEach((c) => {
|
|
54
|
+
;(c as unknown as Plugin).install = (app: App) => {
|
|
55
|
+
const name = (c as { name?: string }).name ?? (c as { __name?: string }).__name
|
|
56
|
+
if (name) app.component(name, c)
|
|
57
|
+
}
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
const ElementGo: Plugin = {
|
|
61
|
+
install(app, options?: { locale?: string; messages?: Record<string, any> }) {
|
|
62
|
+
provider(options)
|
|
63
|
+
components.forEach((c) => app.use(c as unknown as Plugin))
|
|
64
|
+
},
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export default ElementGo
|
|
68
|
+
|
|
69
|
+
export {
|
|
70
|
+
ExAssetPreview,
|
|
71
|
+
ExButton,
|
|
72
|
+
ExEmpty,
|
|
73
|
+
ExForm,
|
|
74
|
+
ExFormField,
|
|
75
|
+
ExFormSearch,
|
|
76
|
+
ExFormViewer,
|
|
77
|
+
ExIcon,
|
|
78
|
+
ExInputPercentage,
|
|
79
|
+
ExLayout,
|
|
80
|
+
ExLoading,
|
|
81
|
+
ExMenu,
|
|
82
|
+
ExPage,
|
|
83
|
+
ExPageHeader,
|
|
84
|
+
ExPagination,
|
|
85
|
+
ExSelect,
|
|
86
|
+
ExTable,
|
|
87
|
+
ExTableColumn,
|
|
88
|
+
ExUpload,
|
|
89
|
+
ExUploadAsset,
|
|
90
|
+
provider,
|
|
91
|
+
setLocale,
|
|
92
|
+
getLocale,
|
|
93
|
+
useLocale,
|
|
94
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* prettier-ignore */
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
// noinspection JSUnusedGlobalSymbols
|
|
5
|
+
// Generated by unplugin-auto-import
|
|
6
|
+
// biome-ignore lint: disable
|
|
7
|
+
export {}
|
|
8
|
+
declare global {
|
|
9
|
+
const EffectScope: typeof import('vue').EffectScope
|
|
10
|
+
const computed: typeof import('vue').computed
|
|
11
|
+
const createApp: typeof import('vue').createApp
|
|
12
|
+
const customRef: typeof import('vue').customRef
|
|
13
|
+
const defineAsyncComponent: typeof import('vue').defineAsyncComponent
|
|
14
|
+
const defineComponent: typeof import('vue').defineComponent
|
|
15
|
+
const effectScope: typeof import('vue').effectScope
|
|
16
|
+
const getCurrentInstance: typeof import('vue').getCurrentInstance
|
|
17
|
+
const getCurrentScope: typeof import('vue').getCurrentScope
|
|
18
|
+
const getCurrentWatcher: typeof import('vue').getCurrentWatcher
|
|
19
|
+
const h: typeof import('vue').h
|
|
20
|
+
const inject: typeof import('vue').inject
|
|
21
|
+
const isProxy: typeof import('vue').isProxy
|
|
22
|
+
const isReactive: typeof import('vue').isReactive
|
|
23
|
+
const isReadonly: typeof import('vue').isReadonly
|
|
24
|
+
const isRef: typeof import('vue').isRef
|
|
25
|
+
const isShallow: typeof import('vue').isShallow
|
|
26
|
+
const markRaw: typeof import('vue').markRaw
|
|
27
|
+
const nextTick: typeof import('vue').nextTick
|
|
28
|
+
const onActivated: typeof import('vue').onActivated
|
|
29
|
+
const onBeforeMount: typeof import('vue').onBeforeMount
|
|
30
|
+
const onBeforeRouteLeave: typeof import('vue-router').onBeforeRouteLeave
|
|
31
|
+
const onBeforeRouteUpdate: typeof import('vue-router').onBeforeRouteUpdate
|
|
32
|
+
const onBeforeUnmount: typeof import('vue').onBeforeUnmount
|
|
33
|
+
const onBeforeUpdate: typeof import('vue').onBeforeUpdate
|
|
34
|
+
const onDeactivated: typeof import('vue').onDeactivated
|
|
35
|
+
const onErrorCaptured: typeof import('vue').onErrorCaptured
|
|
36
|
+
const onMounted: typeof import('vue').onMounted
|
|
37
|
+
const onRenderTracked: typeof import('vue').onRenderTracked
|
|
38
|
+
const onRenderTriggered: typeof import('vue').onRenderTriggered
|
|
39
|
+
const onScopeDispose: typeof import('vue').onScopeDispose
|
|
40
|
+
const onServerPrefetch: typeof import('vue').onServerPrefetch
|
|
41
|
+
const onUnmounted: typeof import('vue').onUnmounted
|
|
42
|
+
const onUpdated: typeof import('vue').onUpdated
|
|
43
|
+
const onWatcherCleanup: typeof import('vue').onWatcherCleanup
|
|
44
|
+
const provide: typeof import('vue').provide
|
|
45
|
+
const reactive: typeof import('vue').reactive
|
|
46
|
+
const readonly: typeof import('vue').readonly
|
|
47
|
+
const ref: typeof import('vue').ref
|
|
48
|
+
const resolveComponent: typeof import('vue').resolveComponent
|
|
49
|
+
const shallowReactive: typeof import('vue').shallowReactive
|
|
50
|
+
const shallowReadonly: typeof import('vue').shallowReadonly
|
|
51
|
+
const shallowRef: typeof import('vue').shallowRef
|
|
52
|
+
const toRaw: typeof import('vue').toRaw
|
|
53
|
+
const toRef: typeof import('vue').toRef
|
|
54
|
+
const toRefs: typeof import('vue').toRefs
|
|
55
|
+
const toValue: typeof import('vue').toValue
|
|
56
|
+
const triggerRef: typeof import('vue').triggerRef
|
|
57
|
+
const unref: typeof import('vue').unref
|
|
58
|
+
const useAttrs: typeof import('vue').useAttrs
|
|
59
|
+
const useBreak: typeof import('../hooks/useBreak').useBreak
|
|
60
|
+
const useChat: typeof import('../hooks/useChat').useChat
|
|
61
|
+
const useClipboard: typeof import('@vueuse/core').useClipboard
|
|
62
|
+
const useCssModule: typeof import('vue').useCssModule
|
|
63
|
+
const useCssVars: typeof import('vue').useCssVars
|
|
64
|
+
const useDark: typeof import('@vueuse/core').useDark
|
|
65
|
+
const useI18n: typeof import('vue-i18n').useI18n
|
|
66
|
+
const useIcon: typeof import('../hooks/useIcon').useIcon
|
|
67
|
+
const useId: typeof import('vue').useId
|
|
68
|
+
const useLink: typeof import('vue-router').useLink
|
|
69
|
+
const useMessage: typeof import('../hooks/useMessage').useMessage
|
|
70
|
+
const useModel: typeof import('vue').useModel
|
|
71
|
+
const useNanoid: typeof import('../hooks/useNanoid').useNanoid
|
|
72
|
+
const useRoute: typeof import('vue-router').useRoute
|
|
73
|
+
const useRouter: typeof import('vue-router').useRouter
|
|
74
|
+
const useSlots: typeof import('vue').useSlots
|
|
75
|
+
const useTemplateRef: typeof import('vue').useTemplateRef
|
|
76
|
+
const useThrottleFn: typeof import('@vueuse/core').useThrottleFn
|
|
77
|
+
const useToggle: typeof import('@vueuse/core').useToggle
|
|
78
|
+
const useUpload: typeof import('../hooks/useUpload').useUpload
|
|
79
|
+
const watch: typeof import('vue').watch
|
|
80
|
+
const watchDeep: typeof import('@vueuse/core').watchDeep
|
|
81
|
+
const watchEffect: typeof import('vue').watchEffect
|
|
82
|
+
const watchOnce: typeof import('@vueuse/core').watchOnce
|
|
83
|
+
const watchPostEffect: typeof import('vue').watchPostEffect
|
|
84
|
+
const watchSyncEffect: typeof import('vue').watchSyncEffect
|
|
85
|
+
}
|
|
86
|
+
// for type re-export
|
|
87
|
+
declare global {
|
|
88
|
+
// @ts-ignore
|
|
89
|
+
export type { Component, Slot, Slots, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, ShallowRef, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
|
|
90
|
+
import('vue')
|
|
91
|
+
// @ts-ignore
|
|
92
|
+
export type { IChatMessage, IMessageEvent, IUsageEvent, IErrorEvent, ISendMessageParams } from '../hooks/useChat'
|
|
93
|
+
import('../hooks/useChat')
|
|
94
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
// biome-ignore lint: disable
|
|
4
|
+
// oxlint-disable
|
|
5
|
+
// ------
|
|
6
|
+
// Generated by unplugin-vue-components
|
|
7
|
+
// Read more: https://github.com/vuejs/core/pull/3399
|
|
8
|
+
import { GlobalComponents } from 'vue'
|
|
9
|
+
|
|
10
|
+
export {}
|
|
11
|
+
|
|
12
|
+
/* prettier-ignore */
|
|
13
|
+
declare module 'vue' {
|
|
14
|
+
export interface GlobalComponents {
|
|
15
|
+
Account: typeof import('./../components/ExLayout/account.vue')['default']
|
|
16
|
+
Aside: typeof import('./../components/ExLayout/aside.vue')['default']
|
|
17
|
+
ElAside: typeof import('element-plus/es')['ElAside']
|
|
18
|
+
ElAvatar: typeof import('element-plus/es')['ElAvatar']
|
|
19
|
+
ElButton: typeof import('element-plus/es')['ElButton']
|
|
20
|
+
ElCascader: typeof import('element-plus/es')['ElCascader']
|
|
21
|
+
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
|
|
22
|
+
ElCol: typeof import('element-plus/es')['ElCol']
|
|
23
|
+
ElContainer: typeof import('element-plus/es')['ElContainer']
|
|
24
|
+
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
|
|
25
|
+
ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
|
|
26
|
+
ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem']
|
|
27
|
+
ElDialog: typeof import('element-plus/es')['ElDialog']
|
|
28
|
+
ElDivider: typeof import('element-plus/es')['ElDivider']
|
|
29
|
+
ElDrawer: typeof import('element-plus/es')['ElDrawer']
|
|
30
|
+
ElDropdown: typeof import('element-plus/es')['ElDropdown']
|
|
31
|
+
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
|
|
32
|
+
ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
|
|
33
|
+
ElEmpty: typeof import('element-plus/es')['ElEmpty']
|
|
34
|
+
ElForm: typeof import('element-plus/es')['ElForm']
|
|
35
|
+
ElFormItem: typeof import('element-plus/es')['ElFormItem']
|
|
36
|
+
ElHeader: typeof import('element-plus/es')['ElHeader']
|
|
37
|
+
ElIcon: typeof import('element-plus/es')['ElIcon']
|
|
38
|
+
ElImage: typeof import('element-plus/es')['ElImage']
|
|
39
|
+
ElImageViewer: typeof import('element-plus/es')['ElImageViewer']
|
|
40
|
+
ElInput: typeof import('element-plus/es')['ElInput']
|
|
41
|
+
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
|
|
42
|
+
ElLink: typeof import('element-plus/es')['ElLink']
|
|
43
|
+
ElMain: typeof import('element-plus/es')['ElMain']
|
|
44
|
+
ElMenu: typeof import('element-plus/es')['ElMenu']
|
|
45
|
+
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
|
|
46
|
+
ElMenuItemGroup: typeof import('element-plus/es')['ElMenuItemGroup']
|
|
47
|
+
ElOption: typeof import('element-plus/es')['ElOption']
|
|
48
|
+
ElOptionGroup: typeof import('element-plus/es')['ElOptionGroup']
|
|
49
|
+
ElPagination: typeof import('element-plus/es')['ElPagination']
|
|
50
|
+
ElProgress: typeof import('element-plus/es')['ElProgress']
|
|
51
|
+
ElRadio: typeof import('element-plus/es')['ElRadio']
|
|
52
|
+
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
|
|
53
|
+
ElRow: typeof import('element-plus/es')['ElRow']
|
|
54
|
+
ElSelect: typeof import('element-plus/es')['ElSelect']
|
|
55
|
+
ElSpace: typeof import('element-plus/es')['ElSpace']
|
|
56
|
+
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
|
|
57
|
+
ElSwitch: typeof import('element-plus/es')['ElSwitch']
|
|
58
|
+
ElTable: typeof import('element-plus/es')['ElTable']
|
|
59
|
+
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
|
|
60
|
+
ElTag: typeof import('element-plus/es')['ElTag']
|
|
61
|
+
ElText: typeof import('element-plus/es')['ElText']
|
|
62
|
+
ElTooltip: typeof import('element-plus/es')['ElTooltip']
|
|
63
|
+
ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
|
|
64
|
+
ElUpload: typeof import('element-plus/es')['ElUpload']
|
|
65
|
+
ExAssetPreview: typeof import('./../components/ExAssetPreview.vue')['default']
|
|
66
|
+
ExButton: typeof import('./../components/ExButton.vue')['default']
|
|
67
|
+
ExEmpty: typeof import('./../components/ExEmpty.vue')['default']
|
|
68
|
+
ExForm: typeof import('./../components/ExForm.vue')['default']
|
|
69
|
+
ExFormField: typeof import('./../components/ExFormField.vue')['default']
|
|
70
|
+
ExFormSearch: typeof import('./../components/ExFormSearch.vue')['default']
|
|
71
|
+
ExFormViewer: typeof import('./../components/ExFormViewer.vue')['default']
|
|
72
|
+
ExIcon: typeof import('./../components/ExIcon.vue')['default']
|
|
73
|
+
ExInputPercentage: typeof import('./../components/ExInputPercentage.vue')['default']
|
|
74
|
+
ExLayout: typeof import('./../components/ExLayout.vue')['default']
|
|
75
|
+
ExLoading: typeof import('./../components/ExLoading.vue')['default']
|
|
76
|
+
ExMenu: typeof import('./../components/ExMenu.vue')['default']
|
|
77
|
+
ExPage: typeof import('./../components/ExPage.vue')['default']
|
|
78
|
+
ExPageHeader: typeof import('./../components/ExPageHeader.vue')['default']
|
|
79
|
+
ExPagination: typeof import('./../components/ExPagination.vue')['default']
|
|
80
|
+
ExSelect: typeof import('./../components/ExSelect.vue')['default']
|
|
81
|
+
ExTable: typeof import('./../components/ExTable.vue')['default']
|
|
82
|
+
ExTableColumn: typeof import('./../components/ExTableColumn.vue')['default']
|
|
83
|
+
ExUpload: typeof import('./../components/ExUpload.vue')['default']
|
|
84
|
+
ExUploadAsset: typeof import('./../components/ExUploadAsset.vue')['default']
|
|
85
|
+
Lang: typeof import('./../components/ExLayout/lang.vue')['default']
|
|
86
|
+
RouterLink: typeof import('vue-router')['RouterLink']
|
|
87
|
+
RouterView: typeof import('vue-router')['RouterView']
|
|
88
|
+
VIcon: typeof import('./../components/vIcon.vue')['default']
|
|
89
|
+
}
|
|
90
|
+
export interface GlobalDirectives {
|
|
91
|
+
vLoading: typeof import('element-plus/es')['ElLoadingDirective']
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// For TSX support
|
|
96
|
+
declare global {
|
|
97
|
+
const Account: typeof import('./../components/ExLayout/account.vue')['default']
|
|
98
|
+
const Aside: typeof import('./../components/ExLayout/aside.vue')['default']
|
|
99
|
+
const ElAside: typeof import('element-plus/es')['ElAside']
|
|
100
|
+
const ElAvatar: typeof import('element-plus/es')['ElAvatar']
|
|
101
|
+
const ElButton: typeof import('element-plus/es')['ElButton']
|
|
102
|
+
const ElCascader: typeof import('element-plus/es')['ElCascader']
|
|
103
|
+
const ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
|
|
104
|
+
const ElCol: typeof import('element-plus/es')['ElCol']
|
|
105
|
+
const ElContainer: typeof import('element-plus/es')['ElContainer']
|
|
106
|
+
const ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
|
|
107
|
+
const ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
|
|
108
|
+
const ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem']
|
|
109
|
+
const ElDialog: typeof import('element-plus/es')['ElDialog']
|
|
110
|
+
const ElDivider: typeof import('element-plus/es')['ElDivider']
|
|
111
|
+
const ElDrawer: typeof import('element-plus/es')['ElDrawer']
|
|
112
|
+
const ElDropdown: typeof import('element-plus/es')['ElDropdown']
|
|
113
|
+
const ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
|
|
114
|
+
const ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
|
|
115
|
+
const ElEmpty: typeof import('element-plus/es')['ElEmpty']
|
|
116
|
+
const ElForm: typeof import('element-plus/es')['ElForm']
|
|
117
|
+
const ElFormItem: typeof import('element-plus/es')['ElFormItem']
|
|
118
|
+
const ElHeader: typeof import('element-plus/es')['ElHeader']
|
|
119
|
+
const ElIcon: typeof import('element-plus/es')['ElIcon']
|
|
120
|
+
const ElImage: typeof import('element-plus/es')['ElImage']
|
|
121
|
+
const ElImageViewer: typeof import('element-plus/es')['ElImageViewer']
|
|
122
|
+
const ElInput: typeof import('element-plus/es')['ElInput']
|
|
123
|
+
const ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
|
|
124
|
+
const ElLink: typeof import('element-plus/es')['ElLink']
|
|
125
|
+
const ElMain: typeof import('element-plus/es')['ElMain']
|
|
126
|
+
const ElMenu: typeof import('element-plus/es')['ElMenu']
|
|
127
|
+
const ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
|
|
128
|
+
const ElMenuItemGroup: typeof import('element-plus/es')['ElMenuItemGroup']
|
|
129
|
+
const ElOption: typeof import('element-plus/es')['ElOption']
|
|
130
|
+
const ElOptionGroup: typeof import('element-plus/es')['ElOptionGroup']
|
|
131
|
+
const ElPagination: typeof import('element-plus/es')['ElPagination']
|
|
132
|
+
const ElProgress: typeof import('element-plus/es')['ElProgress']
|
|
133
|
+
const ElRadio: typeof import('element-plus/es')['ElRadio']
|
|
134
|
+
const ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
|
|
135
|
+
const ElRow: typeof import('element-plus/es')['ElRow']
|
|
136
|
+
const ElSelect: typeof import('element-plus/es')['ElSelect']
|
|
137
|
+
const ElSpace: typeof import('element-plus/es')['ElSpace']
|
|
138
|
+
const ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
|
|
139
|
+
const ElSwitch: typeof import('element-plus/es')['ElSwitch']
|
|
140
|
+
const ElTable: typeof import('element-plus/es')['ElTable']
|
|
141
|
+
const ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
|
|
142
|
+
const ElTag: typeof import('element-plus/es')['ElTag']
|
|
143
|
+
const ElText: typeof import('element-plus/es')['ElText']
|
|
144
|
+
const ElTooltip: typeof import('element-plus/es')['ElTooltip']
|
|
145
|
+
const ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
|
|
146
|
+
const ElUpload: typeof import('element-plus/es')['ElUpload']
|
|
147
|
+
const ExAssetPreview: typeof import('./../components/ExAssetPreview.vue')['default']
|
|
148
|
+
const ExButton: typeof import('./../components/ExButton.vue')['default']
|
|
149
|
+
const ExEmpty: typeof import('./../components/ExEmpty.vue')['default']
|
|
150
|
+
const ExForm: typeof import('./../components/ExForm.vue')['default']
|
|
151
|
+
const ExFormField: typeof import('./../components/ExFormField.vue')['default']
|
|
152
|
+
const ExFormSearch: typeof import('./../components/ExFormSearch.vue')['default']
|
|
153
|
+
const ExFormViewer: typeof import('./../components/ExFormViewer.vue')['default']
|
|
154
|
+
const ExIcon: typeof import('./../components/ExIcon.vue')['default']
|
|
155
|
+
const ExInputPercentage: typeof import('./../components/ExInputPercentage.vue')['default']
|
|
156
|
+
const ExLayout: typeof import('./../components/ExLayout.vue')['default']
|
|
157
|
+
const ExLoading: typeof import('./../components/ExLoading.vue')['default']
|
|
158
|
+
const ExMenu: typeof import('./../components/ExMenu.vue')['default']
|
|
159
|
+
const ExPage: typeof import('./../components/ExPage.vue')['default']
|
|
160
|
+
const ExPageHeader: typeof import('./../components/ExPageHeader.vue')['default']
|
|
161
|
+
const ExPagination: typeof import('./../components/ExPagination.vue')['default']
|
|
162
|
+
const ExSelect: typeof import('./../components/ExSelect.vue')['default']
|
|
163
|
+
const ExTable: typeof import('./../components/ExTable.vue')['default']
|
|
164
|
+
const ExTableColumn: typeof import('./../components/ExTableColumn.vue')['default']
|
|
165
|
+
const ExUpload: typeof import('./../components/ExUpload.vue')['default']
|
|
166
|
+
const ExUploadAsset: typeof import('./../components/ExUploadAsset.vue')['default']
|
|
167
|
+
const Lang: typeof import('./../components/ExLayout/lang.vue')['default']
|
|
168
|
+
const RouterLink: typeof import('vue-router')['RouterLink']
|
|
169
|
+
const RouterView: typeof import('vue-router')['RouterView']
|
|
170
|
+
const VIcon: typeof import('./../components/vIcon.vue')['default']
|
|
171
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
core: {
|
|
3
|
+
back: 'Back',
|
|
4
|
+
save: 'Save',
|
|
5
|
+
cancel: 'Cancel',
|
|
6
|
+
reset: 'Reset',
|
|
7
|
+
search: 'Search',
|
|
8
|
+
keywords: 'Keywords',
|
|
9
|
+
upload: 'Upload',
|
|
10
|
+
confirm: 'Confirm',
|
|
11
|
+
phoneNumber: 'Phone',
|
|
12
|
+
createdAt: 'Created at',
|
|
13
|
+
noPermission: 'No Permission',
|
|
14
|
+
create: 'Create',
|
|
15
|
+
edit: 'Edit',
|
|
16
|
+
delete: 'Delete',
|
|
17
|
+
sort: 'Sort',
|
|
18
|
+
logout: 'Logout',
|
|
19
|
+
profile: 'Profile',
|
|
20
|
+
password: 'Password',
|
|
21
|
+
datetime: {
|
|
22
|
+
to: 'to',
|
|
23
|
+
start: 'Start date',
|
|
24
|
+
end: 'End date',
|
|
25
|
+
yesterday: 'Yesterday',
|
|
26
|
+
today: 'Today',
|
|
27
|
+
thisWeek: 'This week',
|
|
28
|
+
thisMonth: 'This month',
|
|
29
|
+
thisYear: 'This year',
|
|
30
|
+
},
|
|
31
|
+
message: {
|
|
32
|
+
successful: 'Successful',
|
|
33
|
+
downloadFailed: 'Download failed',
|
|
34
|
+
tooLarge: 'File size exceeds the limit',
|
|
35
|
+
fileExceed: 'A maximum of {limit} files can be uploaded',
|
|
36
|
+
confirm: 'Confirm',
|
|
37
|
+
delConfirm: 'Are you sure to delete this record?',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
empty: {
|
|
41
|
+
noData: 'No data',
|
|
42
|
+
},
|
|
43
|
+
dialog: {
|
|
44
|
+
tip: 'Tip',
|
|
45
|
+
confirm: 'Confirm',
|
|
46
|
+
prompt: 'Enter',
|
|
47
|
+
required: 'Required',
|
|
48
|
+
},
|
|
49
|
+
}
|