mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
refactor: ui
This commit is contained in:
parent
5dc51836ef
commit
62233b34c4
|
|
@ -90,7 +90,7 @@ const platforms = reactive([
|
|||
exists: false,
|
||||
},
|
||||
{
|
||||
key: 'feishu',
|
||||
key: 'lark',
|
||||
logoSrc: new URL(`../../assets/logo/logo_lark.svg`, import.meta.url).href,
|
||||
name: t('views.application.applicationAccess.lark'),
|
||||
description: t('views.application.applicationAccess.larkTip'),
|
||||
|
|
@ -143,7 +143,7 @@ function changeStatus(type: string, value: boolean) {
|
|||
}
|
||||
|
||||
onMounted(() => {
|
||||
// getPlatformStatus()
|
||||
getPlatformStatus()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@
|
|||
>{{ $t('views.application.applicationAccess.wecomPlatform') }}</a
|
||||
>{{ $t('views.application.applicationAccess.wecomSetting.urlInfo') }}
|
||||
</el-text>
|
||||
<el-text type="info" v-if="configType === 'feishu'">
|
||||
<el-text type="info" v-if="configType === 'lark'">
|
||||
{{ $t('views.application.applicationAccess.copyUrl') }}
|
||||
<a class="primary" href="https://open.feishu.cn/app/" target="_blank">{{
|
||||
$t('views.application.applicationAccess.larkPlatform')
|
||||
|
|
@ -107,7 +107,7 @@ import { MsgError, MsgSuccess } from '@/utils/message'
|
|||
import { copyClick } from '@/utils/clipboard'
|
||||
import { t } from '@/locales'
|
||||
|
||||
type PlatformType = 'wechat' | 'dingtalk' | 'wecom' | 'feishu' | 'slack'
|
||||
type PlatformType = 'wechat' | 'dingtalk' | 'wecom' | 'lark' | 'slack'
|
||||
|
||||
const formRef = ref<FormInstance>()
|
||||
const visible = ref(false)
|
||||
|
|
@ -138,7 +138,7 @@ const form = reactive<any>({
|
|||
encoding_aes_key: '',
|
||||
callback_url: ''
|
||||
},
|
||||
feishu: { app_id: '', app_secret: '', verification_token: '', callback_url: '' },
|
||||
lark: { app_id: '', app_secret: '', verification_token: '', callback_url: '' },
|
||||
slack: { signing_secret: '', bot_user_token: '', callback_url: '' }
|
||||
})
|
||||
|
||||
|
|
@ -226,7 +226,7 @@ const rules = reactive<{ [propName: string]: any }>({
|
|||
}
|
||||
]
|
||||
},
|
||||
feishu: {
|
||||
lark: {
|
||||
app_id: [
|
||||
{
|
||||
required: true,
|
||||
|
|
@ -297,7 +297,7 @@ const configFields: { [propName: string]: { [propName: string]: any } } = {
|
|||
token: { label: 'Token', placeholder: '' },
|
||||
encoding_aes_key: { label: 'EncodingAESKey', placeholder: '' }
|
||||
},
|
||||
feishu: {
|
||||
lark: {
|
||||
app_id: { label: 'App ID', placeholder: '' },
|
||||
app_secret: { label: 'App Secret', placeholder: '' },
|
||||
verification_token: { label: 'Verification Token', placeholder: '' }
|
||||
|
|
@ -322,7 +322,7 @@ const drawerTitle = computed(
|
|||
wechat: t('views.application.applicationAccess.wechatSetting.title'),
|
||||
dingtalk: t('views.application.applicationAccess.dingtalkSetting.title'),
|
||||
wecom: t('views.application.applicationAccess.wecomSetting.title'),
|
||||
feishu: t('views.application.applicationAccess.larkSetting.title'),
|
||||
lark: t('views.application.applicationAccess.larkSetting.title'),
|
||||
slack: t('views.application.applicationAccess.slackSetting.title')
|
||||
}[configType.value])
|
||||
)
|
||||
|
|
@ -333,7 +333,7 @@ const infoTitle = computed(
|
|||
wechat: t('views.applicationOverview.appInfo.header'),
|
||||
dingtalk: t('views.applicationOverview.appInfo.header'),
|
||||
wecom: t('views.applicationOverview.appInfo.header'),
|
||||
feishu: t('views.applicationOverview.appInfo.header'),
|
||||
lark: t('views.applicationOverview.appInfo.header'),
|
||||
slack: t('views.applicationOverview.appInfo.header')
|
||||
}[configType.value])
|
||||
)
|
||||
|
|
|
|||
|
|
@ -303,6 +303,9 @@ function changeMode(val: string) {
|
|||
onBeforeMount(() => {
|
||||
if (chatUser.chat_profile?.login_value) {
|
||||
modeList.value = chatUser.chat_profile.login_value
|
||||
if (modeList.value.includes('LOCAL')) {
|
||||
modeList.value = ['LOCAL', ...modeList.value.filter((item) => item !== 'LOCAL')]
|
||||
}
|
||||
loginMode.value = modeList.value[0] || 'LOCAL'
|
||||
if (modeList.value.length == 1 && ['CAS', 'OIDC', 'OAuth2'].includes(modeList.value[0])) {
|
||||
redirectAuth(modeList.value[0])
|
||||
|
|
|
|||
|
|
@ -7,7 +7,9 @@
|
|||
<el-form-item :label="$t('views.chatUser.group.usernameOrName')" prop="user">
|
||||
<el-select v-model="form.user" multiple filterable
|
||||
:placeholder="$t('common.selectPlaceholder')"
|
||||
:loading="optionLoading">
|
||||
:loading="optionLoading"
|
||||
:filter-method="filterUser"
|
||||
>
|
||||
<el-option v-for="item in chatUserList" :key="item.id" :label="item.nick_name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
|
|
@ -58,6 +60,16 @@ async function getChatUserList() {
|
|||
}
|
||||
}
|
||||
|
||||
const filterUser = (query: string, item: ChatUserItem) => {
|
||||
if (!query) return true;
|
||||
const q = query.toLowerCase();
|
||||
return (
|
||||
item.nick_name?.toLowerCase().includes(q) ||
|
||||
item.username?.toLowerCase().includes(q) ||
|
||||
false
|
||||
);
|
||||
};
|
||||
|
||||
onBeforeMount(() => {
|
||||
getChatUserList()
|
||||
})
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
:placeholder="$t('common.search')"
|
||||
prefix-icon="Search"
|
||||
clearable
|
||||
filterable
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,15 @@
|
|||
<template>
|
||||
<div class="w-full">
|
||||
<div class="flex-between mb-16">
|
||||
<div class="flex align-center" v-if="hasPermission(EditionConst.IS_EE, 'OR')">
|
||||
<div class="flex align-center"
|
||||
v-if="hasPermission([EditionConst.IS_EE,EditionConst.IS_PE], 'OR')">
|
||||
<!-- 企业版: 选优先级-->
|
||||
<span class="lighter mr-16">{{ $t('views.resourceAuthorization.priority.label') }}</span>
|
||||
<el-radio-group v-model="radioRole">
|
||||
<el-radio :value="true" size="large">{{
|
||||
$t('views.resourceAuthorization.priority.role')
|
||||
}}</el-radio>
|
||||
$t('views.resourceAuthorization.priority.role')
|
||||
}}
|
||||
</el-radio>
|
||||
<el-radio :value="false" size="large">{{ $t('common.custom') }}</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
|
|
@ -16,7 +18,7 @@
|
|||
:placeholder="$t('common.search')"
|
||||
prefix-icon="Search"
|
||||
class="mt-4"
|
||||
:class="hasPermission(EditionConst.IS_EE, 'OR') ? 'w-240' : ''"
|
||||
:class="hasPermission([EditionConst.IS_EE,EditionConst.IS_PE], 'OR') ? 'w-240' : ''"
|
||||
clearable
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -46,7 +48,7 @@
|
|||
/>
|
||||
</el-avatar>
|
||||
<!-- 知识库 icon -->
|
||||
<KnowledgeIcon class="mr-12" :size="20" v-else-if="isKnowledge" :type="row.icon" />
|
||||
<KnowledgeIcon class="mr-12" :size="20" v-else-if="isKnowledge" :type="row.icon"/>
|
||||
<!-- 应用/工具 自定义 icon -->
|
||||
<el-avatar
|
||||
v-else-if="isAppIcon(row?.icon) && !isModel"
|
||||
|
|
@ -55,13 +57,13 @@
|
|||
shape="square"
|
||||
:size="20"
|
||||
>
|
||||
<img :src="row?.icon" alt="" />
|
||||
<img :src="row?.icon" alt=""/>
|
||||
</el-avatar>
|
||||
<!-- 应用 icon -->
|
||||
<LogoIcon v-else-if="isApplication" height="20px" class="mr-12" />
|
||||
<LogoIcon v-else-if="isApplication" height="20px" class="mr-12"/>
|
||||
<!-- 工具 icon -->
|
||||
<el-avatar v-else-if="isTool" class="avatar-green mr-12" shape="square" :size="20">
|
||||
<img src="@/assets/node/icon_tool.svg" style="width: 58%" alt="" />
|
||||
<img src="@/assets/node/icon_tool.svg" style="width: 58%" alt=""/>
|
||||
</el-avatar>
|
||||
<!-- 模型 icon -->
|
||||
<span
|
||||
|
|
@ -170,14 +172,15 @@
|
|||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, watch, computed } from 'vue'
|
||||
import type { Provider } from '@/api/type/model'
|
||||
import { AuthorizationEnum } from '@/enums/system'
|
||||
import { isAppIcon } from '@/utils/common'
|
||||
import { EditionConst } from '@/utils/permission/data'
|
||||
import { hasPermission } from '@/utils/permission/index'
|
||||
import {ref, onMounted, watch, computed} from 'vue'
|
||||
import type {Provider} from '@/api/type/model'
|
||||
import {AuthorizationEnum} from '@/enums/system'
|
||||
import {isAppIcon} from '@/utils/common'
|
||||
import {EditionConst} from '@/utils/permission/data'
|
||||
import {hasPermission} from '@/utils/permission/index'
|
||||
import useStore from '@/stores'
|
||||
const { model } = useStore()
|
||||
|
||||
const {model} = useStore()
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Array,
|
||||
|
|
@ -234,6 +237,7 @@ function checkedOperateChange(Name: string | number, row: any, e: boolean) {
|
|||
}
|
||||
|
||||
const provider_list = ref<Array<Provider>>([])
|
||||
|
||||
function getProvider() {
|
||||
model.asyncGetProvider().then((res: any) => {
|
||||
provider_list.value = res?.data
|
||||
|
|
|
|||
Loading…
Reference in New Issue