fix: Uploading attachments for conversation allows for direct conversation
This commit is contained in:
parent
ecd019aa14
commit
cbf7dd00cf
@ -80,6 +80,26 @@ const putAccessToken: (
|
|||||||
return put(`${prefix}/${application_id}/access_token`, data, undefined, loading)
|
return put(`${prefix}/${application_id}/access_token`, data, undefined, loading)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 替换社区版-修改AccessToken
|
||||||
|
* @param 参数 application_id
|
||||||
|
* data {
|
||||||
|
* "show_source": boolean,
|
||||||
|
* "show_history": boolean,
|
||||||
|
* "draggable": boolean,
|
||||||
|
* "show_guide": boolean,
|
||||||
|
* "avatar": file,
|
||||||
|
* "float_icon": file,
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
const putXpackAccessToken: (
|
||||||
|
application_id: string,
|
||||||
|
data: any,
|
||||||
|
loading?: Ref<boolean>,
|
||||||
|
) => Promise<Result<any>> = (application_id, data, loading) => {
|
||||||
|
return put(`${prefix}/${application_id}/setting`, data, undefined, loading)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统计
|
* 统计
|
||||||
* @param 参数 application_id, data
|
* @param 参数 application_id, data
|
||||||
@ -282,4 +302,5 @@ export default {
|
|||||||
postTextToSpeech,
|
postTextToSpeech,
|
||||||
speechToText,
|
speechToText,
|
||||||
getMcpTools,
|
getMcpTools,
|
||||||
|
putXpackAccessToken
|
||||||
}
|
}
|
||||||
|
|||||||
@ -454,6 +454,8 @@ const uploadFile = async (file: any, fileList: any) => {
|
|||||||
})
|
})
|
||||||
if (!inputValue.value && uploadImageList.value.length > 0) {
|
if (!inputValue.value && uploadImageList.value.length > 0) {
|
||||||
inputValue.value = t('chat.uploadFile.imageMessage')
|
inputValue.value = t('chat.uploadFile.imageMessage')
|
||||||
|
} else {
|
||||||
|
inputValue.value = t('chat.uploadFile.fileMessage')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 粘贴处理
|
// 粘贴处理
|
||||||
|
|||||||
@ -67,6 +67,7 @@ export default {
|
|||||||
limitMessage2: 'files',
|
limitMessage2: 'files',
|
||||||
sizeLimit: 'Each file must not exceed',
|
sizeLimit: 'Each file must not exceed',
|
||||||
imageMessage: 'Please process the image content',
|
imageMessage: 'Please process the image content',
|
||||||
|
fileMessage: 'Please process the file content',
|
||||||
errorMessage: 'Upload Failed',
|
errorMessage: 'Upload Failed',
|
||||||
},
|
},
|
||||||
executionDetails: {
|
executionDetails: {
|
||||||
|
|||||||
@ -69,6 +69,7 @@ export default {
|
|||||||
limitMessage2: '个文件',
|
limitMessage2: '个文件',
|
||||||
sizeLimit: '单个文件大小不能超过',
|
sizeLimit: '单个文件大小不能超过',
|
||||||
imageMessage: '请解析图片内容',
|
imageMessage: '请解析图片内容',
|
||||||
|
fileMessage: '请解析文件内容',
|
||||||
errorMessage: '上传失败',
|
errorMessage: '上传失败',
|
||||||
},
|
},
|
||||||
executionDetails: {
|
executionDetails: {
|
||||||
|
|||||||
@ -65,6 +65,7 @@ export default {
|
|||||||
limitMessage2: '個文件',
|
limitMessage2: '個文件',
|
||||||
sizeLimit: '單個文件大小不能超過',
|
sizeLimit: '單個文件大小不能超過',
|
||||||
imageMessage: '請解析圖片內容',
|
imageMessage: '請解析圖片內容',
|
||||||
|
fileMessage: '請解析文件內容',
|
||||||
errorMessage: '上傳失敗',
|
errorMessage: '上傳失敗',
|
||||||
},
|
},
|
||||||
executionDetails: {
|
executionDetails: {
|
||||||
|
|||||||
@ -47,41 +47,43 @@
|
|||||||
<div class="flex-between">
|
<div class="flex-between">
|
||||||
<div class="flex align-center">
|
<div class="flex align-center">
|
||||||
<h4 class="medium ellipsis" :title="current?.name">{{ current?.name || '-' }}</h4>
|
<h4 class="medium ellipsis" :title="current?.name">{{ current?.name || '-' }}</h4>
|
||||||
<el-divider direction="vertical" class="mr-8 ml-8"/>
|
<el-divider direction="vertical" class="mr-8 ml-8" />
|
||||||
|
|
||||||
<el-icon class="color-input-placeholder">
|
<el-icon class="color-input-placeholder">
|
||||||
<UserFilled/>
|
<UserFilled />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<span class="color-input-placeholder ml-4">
|
<span class="color-input-placeholder ml-4">
|
||||||
{{ paginationConfig.total }}
|
{{ paginationConfig.total }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<el-button
|
|
||||||
type="primary"
|
<div
|
||||||
:disabled="current?.is_auth"
|
class="flex align-center"
|
||||||
@click="handleSave"
|
|
||||||
v-if="
|
v-if="
|
||||||
route.path.includes('share/')
|
route.path.includes('share/')
|
||||||
? false
|
? false
|
||||||
: hasPermission(
|
: hasPermission(permissionObj[currentPermissionKey], 'OR')
|
||||||
permissionObj[
|
|
||||||
currentPermissionKey
|
|
||||||
],
|
|
||||||
'OR',
|
|
||||||
)
|
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
{{ t('common.save') }}
|
<div class="color-secondary mr-8">{{ $t('views.chatUser.autoAuthorization') }}</div>
|
||||||
</el-button>
|
<el-switch
|
||||||
|
size="small"
|
||||||
|
:model-value="current?.is_auth"
|
||||||
|
@click="changeAuth"
|
||||||
|
:loading="loading"
|
||||||
|
></el-switch>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex-between mb-16" style="margin-top: 18px">
|
<div class="flex-between mb-16" style="margin-top: 18px">
|
||||||
<div class="flex complex-search">
|
<div class="flex complex-search">
|
||||||
<el-select class="complex-search__left" v-model="searchType" style="width: 120px">
|
<el-select class="complex-search__left" v-model="searchType" style="width: 120px">
|
||||||
<el-option :label="$t('views.login.loginForm.username.label')" value="username"/>
|
<el-option :label="$t('views.login.loginForm.username.label')" value="username" />
|
||||||
<el-option :label="$t('views.userManage.userForm.nick_name.label')"
|
<el-option
|
||||||
value="nick_name"/>
|
:label="$t('views.userManage.userForm.nick_name.label')"
|
||||||
<el-option :label="$t('views.userManage.source.label')" value="source"/>
|
value="nick_name"
|
||||||
|
/>
|
||||||
|
<el-option :label="$t('views.userManage.source.label')" value="source" />
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-input
|
<el-input
|
||||||
v-if="searchType === 'username'"
|
v-if="searchType === 'username'"
|
||||||
@ -107,62 +109,28 @@
|
|||||||
style="width: 220px"
|
style="width: 220px"
|
||||||
clearable
|
clearable
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option :label="$t('views.userManage.source.local')" value="LOCAL" />
|
||||||
:label="$t('views.userManage.source.local')"
|
<el-option label="CAS" value="CAS" />
|
||||||
value="LOCAL"
|
<el-option label="LDAP" value="LDAP" />
|
||||||
/>
|
<el-option label="OIDC" value="OIDC" />
|
||||||
<el-option
|
<el-option label="OAuth2" value="OAuth2" />
|
||||||
label="CAS"
|
<el-option :label="$t('views.userManage.source.wecom')" value="wecom" />
|
||||||
value="CAS"
|
<el-option :label="$t('views.userManage.source.lark')" value="lark" />
|
||||||
/>
|
<el-option :label="$t('views.userManage.source.dingtalk')" value="dingtalk" />
|
||||||
<el-option
|
|
||||||
label="LDAP"
|
|
||||||
value="LDAP"
|
|
||||||
/>
|
|
||||||
<el-option
|
|
||||||
label="OIDC"
|
|
||||||
value="OIDC"
|
|
||||||
/>
|
|
||||||
<el-option
|
|
||||||
label="OAuth2"
|
|
||||||
value="OAuth2"
|
|
||||||
/>
|
|
||||||
<el-option
|
|
||||||
:label="$t('views.userManage.source.wecom')"
|
|
||||||
value="wecom"
|
|
||||||
/>
|
|
||||||
<el-option
|
|
||||||
:label="$t('views.userManage.source.lark')"
|
|
||||||
value="lark"
|
|
||||||
/>
|
|
||||||
<el-option
|
|
||||||
:label="$t('views.userManage.source.dingtalk')"
|
|
||||||
value="dingtalk"
|
|
||||||
/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div
|
<el-button
|
||||||
class="flex align-center"
|
type="primary"
|
||||||
|
:disabled="current?.is_auth"
|
||||||
|
@click="handleSave"
|
||||||
v-if="
|
v-if="
|
||||||
route.path.includes('share/')
|
route.path.includes('share/')
|
||||||
? false
|
? false
|
||||||
: hasPermission(
|
: hasPermission(permissionObj[currentPermissionKey], 'OR')
|
||||||
permissionObj[
|
|
||||||
currentPermissionKey
|
|
||||||
],
|
|
||||||
'OR',
|
|
||||||
)
|
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<div class="color-secondary mr-8">{{ $t('views.chatUser.autoAuthorization') }}</div>
|
{{ t('common.save') }}
|
||||||
<el-switch
|
</el-button>
|
||||||
size="small"
|
|
||||||
:model-value="current?.is_auth"
|
|
||||||
@click="changeAuth"
|
|
||||||
:loading="loading"
|
|
||||||
></el-switch>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<app-table
|
<app-table
|
||||||
@ -176,7 +144,7 @@
|
|||||||
prop="nick_name"
|
prop="nick_name"
|
||||||
:label="$t('views.userManage.userForm.nick_name.label')"
|
:label="$t('views.userManage.userForm.nick_name.label')"
|
||||||
/>
|
/>
|
||||||
<el-table-column prop="username" :label="$t('views.login.loginForm.username.label')"/>
|
<el-table-column prop="username" :label="$t('views.login.loginForm.username.label')" />
|
||||||
<el-table-column prop="source" :label="$t('views.userManage.source.label')">
|
<el-table-column prop="source" :label="$t('views.userManage.source.label')">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
{{
|
{{
|
||||||
@ -201,9 +169,8 @@
|
|||||||
:indeterminate="allIndeterminate"
|
:indeterminate="allIndeterminate"
|
||||||
:disabled="current?.is_auth"
|
:disabled="current?.is_auth"
|
||||||
@change="handleCheckAll"
|
@change="handleCheckAll"
|
||||||
>{{ $t('views.chatUser.authorization') }}
|
>{{ $t('views.chatUser.authorization') }}
|
||||||
</el-checkbox
|
</el-checkbox>
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
@ -222,22 +189,22 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import {onMounted, ref, watch, reactive, computed} from 'vue'
|
import { onMounted, ref, watch, reactive, computed } from 'vue'
|
||||||
|
|
||||||
import {t} from '@/locales'
|
import { t } from '@/locales'
|
||||||
import type {ChatUserGroupItem, ChatUserGroupUserItem} from '@/api/type/workspaceChatUser'
|
import type { ChatUserGroupItem, ChatUserGroupUserItem } from '@/api/type/workspaceChatUser'
|
||||||
import {useRoute} from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import {SourceTypeEnum} from '@/enums/common'
|
import { SourceTypeEnum } from '@/enums/common'
|
||||||
import {MsgSuccess} from '@/utils/message'
|
import { MsgSuccess } from '@/utils/message'
|
||||||
import {ComplexPermission} from '@/utils/permission/type'
|
import { ComplexPermission } from '@/utils/permission/type'
|
||||||
import {RoleConst, PermissionConst} from '@/utils/permission/data'
|
import { RoleConst, PermissionConst } from '@/utils/permission/data'
|
||||||
import {hasPermission} from '@/utils/permission/index'
|
import { hasPermission } from '@/utils/permission/index'
|
||||||
import {loadSharedApi} from '@/utils/dynamics-api/shared-api'
|
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
const {
|
const {
|
||||||
params: {id, folderId},
|
params: { id, folderId },
|
||||||
} = route as any
|
} = route as any
|
||||||
|
|
||||||
const permissionObj = ref<any>({
|
const permissionObj = ref<any>({
|
||||||
@ -342,7 +309,7 @@ function clickUserGroup(item: ChatUserGroupItem) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function changeAuth() {
|
async function changeAuth() {
|
||||||
const params = [{user_group_id: current.value?.id as string, is_auth: !current.value?.is_auth}]
|
const params = [{ user_group_id: current.value?.id as string, is_auth: !current.value?.is_auth }]
|
||||||
try {
|
try {
|
||||||
await loadSharedApi({
|
await loadSharedApi({
|
||||||
type: 'chatUser',
|
type: 'chatUser',
|
||||||
@ -383,22 +350,16 @@ const isShared = computed(() => {
|
|||||||
async function getList() {
|
async function getList() {
|
||||||
if (!current.value?.id) return
|
if (!current.value?.id) return
|
||||||
const params: any = {}
|
const params: any = {}
|
||||||
const searchValue = searchForm.value[searchType.value as keyof typeof searchForm.value];
|
const searchValue = searchForm.value[searchType.value as keyof typeof searchForm.value]
|
||||||
if (searchValue !== undefined && searchValue !== null && searchValue !== '') {
|
if (searchValue !== undefined && searchValue !== null && searchValue !== '') {
|
||||||
params[searchType.value] = searchValue;
|
params[searchType.value] = searchValue
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const res = await loadSharedApi({
|
const res = await loadSharedApi({
|
||||||
type: 'chatUser',
|
type: 'chatUser',
|
||||||
isShared: isShared.value,
|
isShared: isShared.value,
|
||||||
systemType: apiType.value,
|
systemType: apiType.value,
|
||||||
}).getUserGroupUserList(
|
}).getUserGroupUserList(resource, current.value?.id, paginationConfig, params, rightLoading)
|
||||||
resource,
|
|
||||||
current.value?.id,
|
|
||||||
paginationConfig,
|
|
||||||
params,
|
|
||||||
rightLoading,
|
|
||||||
)
|
|
||||||
// 更新缓存和回显状态
|
// 更新缓存和回显状态
|
||||||
res.data.records.forEach((item: any) => {
|
res.data.records.forEach((item: any) => {
|
||||||
if (checkedMap[item.id] === undefined) {
|
if (checkedMap[item.id] === undefined) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user