feat: document

This commit is contained in:
wangdan-fit2cloud 2025-06-05 16:30:39 +08:00
parent a4b6570110
commit 636f96178c
6 changed files with 111 additions and 25 deletions

View File

@ -1,2 +1,28 @@
import { h } from 'vue' import { h } from 'vue'
export default {} export default {
'app-go': {
iconReader: () => {
return h('i', [
h(
'svg',
{
style: { height: '100%', width: '100%' },
viewBox: '0 0 16 16',
version: '1.1',
xmlns: 'http://www.w3.org/2000/svg',
},
[
h('path', {
d: 'M2.66671 4.66665V13.3333H13.3334V8.66665H14.6667V14C14.6667 14.3682 14.3682 14.6666 14 14.6666H2.00004C1.63185 14.6666 1.33337 14.3682 1.33337 14V3.99998C1.33337 3.63179 1.63185 3.33331 2.00004 3.33331H7.33337V4.66665H2.66671Z',
fill: 'currentColor',
}),
h('path', {
d: 'M14.6665 1.99998V6.66665H13.3332V3.60931L9.34987 7.59265C9.28736 7.65514 9.20259 7.69024 9.11421 7.69024C9.02582 7.69024 8.94105 7.65514 8.87854 7.59265L8.40721 7.12131C8.34472 7.0588 8.30961 6.97403 8.30961 6.88565C8.30961 6.79726 8.34472 6.71249 8.40721 6.64998L12.3905 2.66665H9.33321V1.33331H13.9999C14.1767 1.33331 14.3463 1.40355 14.4713 1.52858C14.5963 1.6536 14.6665 1.82317 14.6665 1.99998Z',
fill: 'currentColor',
}),
],
),
])
},
},
}

View File

@ -12,23 +12,34 @@
<template #dropdown> <template #dropdown>
<el-dropdown-menu class="avatar-dropdown"> <el-dropdown-menu class="avatar-dropdown">
<div class="userInfo"> <div class="userInfo flex align-center">
<p class="bold mb-4" style="font-size: 14px">{{ user.userInfo?.username }}</p> <div class="mr-12 flex align-center">
<p> <el-avatar :size="30">
<el-text type="info"> <img src="@/assets/user-icon.svg" style="width: 54%" alt="" />
{{ user.userInfo?.email }} </el-avatar>
</el-text> </div>
</p> <div style="width: 90%">
<p class="bold mb-4" style="font-size: 14px">{{ user.userInfo?.username }}</p>
<template
v-for="item in user.userInfo?.role"
v-if="user.userInfo?.role && user.userInfo.role.length > 0"
>
<el-tag size="small" class="default-tag">{{ user.userInfo?.role[0] }}</el-tag>
<el-tag size="small" class="default-tag ml-4" v-if="user.userInfo?.role?.length > 1"
>+{{ user.userInfo?.role?.length - 1 }}</el-tag
>
</template>
</div>
</div> </div>
<el-dropdown-item class="border-t p-8" @click="openResetPassword"> <el-dropdown-item class="border-t p-8" @click="openResetPassword">
{{ $t('views.login.resetPassword') }} {{ $t('views.login.resetPassword') }}
</el-dropdown-item> </el-dropdown-item>
<div v-hasPermission="new ComplexPermission([], ['x-pack'], 'OR')"> <div v-hasPermission="new ComplexPermission([], ['x-pack'], 'OR')">
<el-dropdown-item class="border-t p-8" @click="openAPIKeyDialog"> <el-dropdown-item class="p-8" @click="openAPIKeyDialog">
{{ $t('layout.apiKey') }} {{ $t('layout.apiKey') }}
</el-dropdown-item> </el-dropdown-item>
</div> </div>
<el-dropdown-item class="border-t" style="padding: 0" @click.stop> <el-dropdown-item style="padding: 0" @click.stop>
<el-dropdown class="w-full" trigger="hover" placement="left-start"> <el-dropdown class="w-full" trigger="hover" placement="left-start">
<div class="flex-between w-full" style="line-height: 22px; padding: 12px 11px"> <div class="flex-between w-full" style="line-height: 22px; padding: 12px 11px">
<span> {{ $t('layout.language') }}</span> <span> {{ $t('layout.language') }}</span>
@ -59,10 +70,17 @@
</template> </template>
</el-dropdown> </el-dropdown>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item class="border-t" @click="openAbout"> <el-dropdown-item @click="openAbout">
{{ $t('layout.about.title') }} {{ $t('layout.about.title') }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item @click="router.push({ path: `/system/user` })">
<div class="flex-between w-full">
{{ $t('views.system.title') }}
<AppIcon iconName="app-go"></AppIcon>
</div>
</el-dropdown-item>
<el-dropdown-item class="border-t" @click="logout"> <el-dropdown-item class="border-t" @click="logout">
{{ $t('layout.logout') }} {{ $t('layout.logout') }}
</el-dropdown-item> </el-dropdown-item>

View File

@ -2,7 +2,7 @@ export default {
github: '项目地址', github: '项目地址',
wiki: '用户手册', wiki: '用户手册',
forum: '论坛求助', forum: '论坛求助',
logout: '退出', logout: '退出登录',
apiKey: 'API Key 管理', apiKey: 'API Key 管理',
apiServiceAddress: 'API 服务地址', apiServiceAddress: 'API 服务地址',
language: '语言', language: '语言',

View File

@ -2,7 +2,7 @@ export default {
github: '項目地址', github: '項目地址',
wiki: '使用者手冊', wiki: '使用者手冊',
forum: '論壇求助', forum: '論壇求助',
logout: '退出', logout: '出',
apiKey: 'API Key 管理', apiKey: 'API Key 管理',
apiServiceAddress: 'API 服務地址', apiServiceAddress: 'API 服務地址',

View File

@ -410,6 +410,46 @@ h5 {
} }
} }
/* tag */
.default-tag {
background: var(--el-color-primary-light-8);
color: var(--el-color-primary);
border: none;
}
.danger-tag {
background: var(--tag-danger-bg);
color: #d03f3b;
border: none;
}
.success-tag {
background: var(--tag-success-bg);
color: var(--el-color-success);
border: none;
}
.warning-tag {
background: var(--tag-warning-bg);
color: var(--el-color-warning);
border: none;
}
.info-tag {
background: var(--app-text-color-light-1);
color: var(--app-text-color-secondary);
border: none;
}
.purple-tag {
background: #f2ebfe;
color: #7f3bf5;
border-color: #e0d7f0;
}
.blue-tag {
background: #ebf1ff;
color: #3370ff;
border-color: #d6e2ff;
}
/* /*
内容部分 自适应高度 内容部分 自适应高度
*/ */

View File

@ -325,7 +325,7 @@
{{ datetimeFormat(row.update_time) }} {{ datetimeFormat(row.update_time) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('common.operation')" align="left" width="110" fixed="right"> <el-table-column :label="$t('common.operation')" align="left" width="160" fixed="right">
<template #default="{ row }"> <template #default="{ row }">
<span @click.stop> <span @click.stop>
<el-switch <el-switch
@ -336,14 +336,16 @@
/> />
</span> </span>
<el-divider direction="vertical" /> <el-divider direction="vertical" />
<div v-if="datasetDetail.type === 0"> <template v-if="datasetDetail.type === 0">
<span class="mr-4"> <span
class="mr-4"
v-if="
([State.STARTED, State.PENDING] as Array<string>).includes(
getTaskState(row.status, TaskType.EMBEDDING),
)
"
>
<el-button <el-button
v-if="
([State.STARTED, State.PENDING] as Array<string>).includes(
getTaskState(row.status, TaskType.EMBEDDING),
)
"
type="primary" type="primary"
text text
@click.stop="cancelTask(row, TaskType.EMBEDDING)" @click.stop="cancelTask(row, TaskType.EMBEDDING)"
@ -352,7 +354,7 @@
<AppIcon iconName="app-close" style="font-size: 16px"></AppIcon> <AppIcon iconName="app-close" style="font-size: 16px"></AppIcon>
</el-button> </el-button>
</span> </span>
<span class="mr-4"> <span class="mr-4" v-else>
<el-button <el-button
type="primary" type="primary"
text text
@ -413,8 +415,8 @@
</template> </template>
</el-dropdown> </el-dropdown>
</span> </span>
</div> </template>
<div v-if="datasetDetail.type === 1 || datasetDetail.type === 2"> <template v-if="datasetDetail.type === 1 || datasetDetail.type === 2">
<span class="mr-4"> <span class="mr-4">
<el-button <el-button
type="primary" type="primary"
@ -495,7 +497,7 @@
</template> </template>
</el-dropdown> </el-dropdown>
</span> </span>
</div> </template>
</template> </template>
</el-table-column> </el-table-column>
</app-table> </app-table>