|
|
@@ -4,13 +4,12 @@ defineOptions({
|
|
|
name: 'modelList',
|
|
|
})
|
|
|
import { Plus } from '@element-plus/icons-vue'
|
|
|
-import { ElButton, ElDialog, ElEmpty, ElInput, ElOption, ElPagination, ElSelect, ElTable, ElTableColumn, ElTag } from 'element-plus'
|
|
|
+import { ElButton, ElDialog, ElEmpty, ElInput, ElMessage, ElOption, ElPagination, ElSelect, ElTable, ElTableColumn, ElTag } from 'element-plus'
|
|
|
// import SearchForm from './components/SearchForm.vue'
|
|
|
|
|
|
import type { TModel } from '@/types/model'
|
|
|
import { fetchModel } from '@/api/modules/model'
|
|
|
import { formatDateGeneral } from '@/utils'
|
|
|
-import { size } from 'zod'
|
|
|
|
|
|
const tableRef = ref()
|
|
|
const loading = ref(false)
|
|
|
@@ -38,10 +37,11 @@ const handleRecommend = (id: string) => {
|
|
|
|
|
|
async function fetchData() {
|
|
|
loading.value = true
|
|
|
- console.log(11133)
|
|
|
const res = await fetchModel()
|
|
|
+ console.log(res, 'res')
|
|
|
if(res.code === 0){
|
|
|
dataList.value = res.data.content
|
|
|
+ console.log(dataList.value, 'dataList')
|
|
|
pagination.value.total = res.data.total
|
|
|
}
|
|
|
loading.value = false
|
|
|
@@ -59,18 +59,11 @@ function handleSizeChange(size: number) {
|
|
|
fetchData()
|
|
|
}
|
|
|
|
|
|
-function handleSearch () {
|
|
|
- pagination.value.page = 1 // 搜索时重置到第一页
|
|
|
- fetchData()
|
|
|
+function handleView (row: TModel) {
|
|
|
+ console.log(row, 'view')
|
|
|
+ ElMessage.info('查看功能待开发')
|
|
|
}
|
|
|
|
|
|
-function handleReset () {
|
|
|
- searchParams.value = {
|
|
|
- name: '',
|
|
|
- }
|
|
|
- pagination.value.page = 1 // 重置时重置到第一页
|
|
|
- fetchData()
|
|
|
-}
|
|
|
|
|
|
|
|
|
onMounted(async () => {
|
|
|
@@ -85,26 +78,25 @@ onMounted(async () => {
|
|
|
<FaPageHeader title="大模型列表" />
|
|
|
<FaPageMain class="flex-1 overflow-auto" main-class="flex-1 flex flex-col overflow-auto">
|
|
|
<ElTable
|
|
|
+ v-loading="loading"
|
|
|
ref="tableRef" :data="dataList" stripe highlight-current-row border height="100%"
|
|
|
>
|
|
|
- <ElTableColumn label="ID" prop="id" min-width="240" />
|
|
|
- <ElTableColumn label="Agent ID" prop="agentId" min-width="220" />
|
|
|
- <ElTableColumn label="Role Name" prop="name" min-width="220" />
|
|
|
- <ElTableColumn label="Avatar" prop="photo">
|
|
|
- <template #default="{row}">
|
|
|
- <ElImage :src="row.photo" fit="cover" class="w-12 h-12 rounded" />
|
|
|
+ <ElTableColumn label="id" prop="id" min-width="240" />
|
|
|
+ <ElTableColumn label="Name" prop="name" min-width="220" />
|
|
|
+ <ElTableColumn label="service" prop="service" />
|
|
|
+ <ElTableColumn label="spaceId" prop="spaceId" />
|
|
|
+ <ElTableColumn label="userId" prop="userId" width="180" />
|
|
|
+ <ElTableColumn label="userId" prop="customEdit" width="180" />
|
|
|
+ <ElTableColumn label="createTime" prop="ctime" width="180">
|
|
|
+ <template #default="scope">
|
|
|
+ {{ formatDateGeneral(scope.row.ctime) }}
|
|
|
</template>
|
|
|
</ElTableColumn>
|
|
|
- <ElTableColumn label="callings" prop="callings" />
|
|
|
- <ElTableColumn label="Voice Name" prop="voiceName" min-width="240" />
|
|
|
- <ElTableColumn label="prompt" prop="prompt" min-width="340">
|
|
|
+ <ElTableColumn fixed="right" label="操作" min-width="200">
|
|
|
<template #default="{row}">
|
|
|
- <ElTag type="info" v-for="(tag, index) in row.prompt.split(/\,|\,/)" :key="index" class="mb-1 mr-1">
|
|
|
- <div :title="tag">{{ tag }}</div>
|
|
|
- </ElTag>
|
|
|
+ <ElButton link type="primary" size="small" @click="handleView(row)">查看</ElButton>
|
|
|
</template>
|
|
|
</ElTableColumn>
|
|
|
- <ElTableColumn label="Language" prop="language" width="180" />
|
|
|
</ElTable>
|
|
|
<div class="p-4">
|
|
|
<ElPagination
|