|
22 | 22 | style="background: none" |
23 | 23 | class="mr-12" |
24 | 24 | > |
25 | | - <img :src="resetUrl(currentSource?.icon, resetUrl('./favicon.ico'))" alt="" /> |
| 25 | + <img :src="resetUrl(currentSource?.icon, resetUrl('./favicon.ico'))" alt=""/> |
26 | 26 | </el-avatar> |
27 | 27 | <ToolIcon |
28 | 28 | v-else-if="currentSourceType === 'TOOL'" |
|
45 | 45 | <div class="flex-between mb-16"> |
46 | 46 | <div class="flex-between complex-search"> |
47 | 47 | <el-select class="complex-search__left" v-model="searchType" style="width: 100px"> |
48 | | - <el-option :label="$t('common.name')" value="resource_name" /> |
49 | | - <el-option :label="$t('common.creator')" value="user_name" /> |
50 | | - <el-option :label="$t('common.type')" value="source_type" /> |
| 48 | + <el-option :label="$t('common.name')" value="resource_name"/> |
| 49 | + <el-option :label="$t('common.creator')" value="user_name"/> |
| 50 | + <el-option :label="$t('common.type')" value="source_type"/> |
51 | 51 | </el-select> |
52 | 52 | <el-input |
53 | 53 | v-if="searchType === 'resource_name'" |
|
78 | 78 | style="width: 220px" |
79 | 79 | :placeholder="$t('common.search')" |
80 | 80 | > |
81 | | - <el-option :label="$t('views.application.title')" value="APPLICATION" /> |
82 | | - <el-option :label="$t('views.knowledge.title')" value="KNOWLEDGE" /> |
| 81 | + <el-option :label="$t('views.application.title')" value="APPLICATION"/> |
| 82 | + <el-option :label="$t('views.knowledge.title')" value="KNOWLEDGE"/> |
| 83 | + <el-option :label="$t('views.tool.title')" value="TOOL"/> |
83 | 84 | </el-select> |
84 | 85 | </div> |
85 | 86 | </div> |
|
112 | 113 | style="background: none" |
113 | 114 | class="mr-8" |
114 | 115 | > |
115 | | - <img :src="resetUrl(row?.icon, resetUrl('./favicon.ico'))" alt="" /> |
| 116 | + <img :src="resetUrl(row?.icon, resetUrl('./favicon.ico'))" alt=""/> |
116 | 117 | </el-avatar> |
117 | 118 |
|
| 119 | + <el-avatar |
| 120 | + v-else-if="row.source_type === 'TOOL' && isAppIcon(row?.icon)" |
| 121 | + shape="square" |
| 122 | + :size="22" |
| 123 | + style="background: none" |
| 124 | + class="mr-8" |
| 125 | + > |
| 126 | + <img :src="resetUrl(row?.icon, resetUrl('./favicon.ico'))" alt=""/> |
| 127 | + </el-avatar> |
118 | 128 | <span>{{ row.name }}</span> |
119 | 129 | </div> |
120 | 130 | </el-button> |
|
132 | 142 | show-overflow-tooltip |
133 | 143 | :label="$t('common.type')" |
134 | 144 | > |
135 | | - <template #default="{ row }"> |
136 | | - {{ |
| 145 | + <template #default="{ row }">{{ |
137 | 146 | row.source_type === 'APPLICATION' |
138 | 147 | ? $t('views.application.title') |
139 | | - : $t('views.knowledge.title') |
| 148 | + : row.source_type === 'TOOL' |
| 149 | + ? $t('views.tool.title') |
| 150 | + : $t('views.knowledge.title') |
140 | 151 | }} |
141 | 152 | </template> |
142 | 153 | </el-table-column> |
|
164 | 175 | @click="workspaceVisible = !workspaceVisible" |
165 | 176 | > |
166 | 177 | <el-icon> |
167 | | - <Filter /> |
| 178 | + <Filter/> |
168 | 179 | </el-icon> |
169 | 180 | </el-button> |
170 | 181 | </template> |
|
190 | 201 | /> |
191 | 202 | </el-checkbox-group> |
192 | 203 | </el-scrollbar> |
193 | | - <el-empty v-else :description="$t('common.noData')" /> |
| 204 | + <el-empty v-else :description="$t('common.noData')"/> |
194 | 205 | </div> |
195 | 206 | </div> |
196 | 207 | </div> |
197 | 208 | <div class="text-right"> |
198 | 209 | <el-button size="small" @click="filterWorkspaceChange('clear')" |
199 | | - >{{ $t('common.clear') }} |
| 210 | + >{{ $t('common.clear') }} |
200 | 211 | </el-button> |
201 | 212 | <el-button type="primary" @click="filterWorkspaceChange" size="small" |
202 | | - >{{ $t('common.confirm') }} |
| 213 | + >{{ $t('common.confirm') }} |
203 | 214 | </el-button> |
204 | 215 | </div> |
205 | 216 | </el-popover> |
|
216 | 227 | </el-drawer> |
217 | 228 | </template> |
218 | 229 | <script setup lang="ts"> |
219 | | -import { ref, reactive, computed, onMounted, watch } from 'vue' |
220 | | -import { useRoute, useRouter } from 'vue-router' |
221 | | -import { loadSharedApi } from '@/utils/dynamics-api/shared-api' |
222 | | -import { isAppIcon, resetUrl } from '@/utils/common' |
| 230 | +import {ref, reactive, computed, onMounted, watch} from 'vue' |
| 231 | +import {useRoute, useRouter} from 'vue-router' |
| 232 | +import {loadSharedApi} from '@/utils/dynamics-api/shared-api' |
| 233 | +import {isAppIcon, resetUrl} from '@/utils/common' |
223 | 234 | import useStore from '@/stores' |
224 | | -import { t } from '@/locales' |
225 | | -import type { Provider } from '@/api/type/model' |
226 | | -import { loadPermissionApi } from '@/utils/dynamics-api/permission-api.ts' |
| 235 | +import {t} from '@/locales' |
| 236 | +import type {Provider} from '@/api/type/model' |
| 237 | +import {loadPermissionApi} from '@/utils/dynamics-api/permission-api.ts' |
227 | 238 | import permissionMap from '@/permission' |
228 | | -import { MsgError } from '@/utils/message' |
| 239 | +import {MsgError} from '@/utils/message' |
229 | 240 |
|
230 | 241 | const route = useRoute() |
231 | 242 | const router = useRouter() |
232 | | -const { model, user } = useStore() |
| 243 | +const {model, user} = useStore() |
233 | 244 | const searchType = ref<string>('resource_name') |
234 | 245 | const query = ref<any>({ |
235 | 246 | resource_name: '', |
@@ -275,7 +286,7 @@ const pageResourceMapping = () => { |
275 | 286 | if (workspaceArr.value.length > 0) { |
276 | 287 | params.workspace_ids = JSON.stringify(workspaceArr.value) |
277 | 288 | } |
278 | | - loadSharedApi({ type: 'resourceMapping', systemType: apiType.value }) |
| 289 | + loadSharedApi({type: 'resourceMapping', systemType: apiType.value}) |
279 | 290 | .getResourceMapping( |
280 | 291 | workspaceId, |
281 | 292 | currentSourceType.value, |
@@ -357,13 +368,13 @@ async function getWorkspaceList() { |
357 | 368 | const hasResourceWorkspacePermission = (row: any) => { |
358 | 369 | return permissionMap[row.source_type.toLowerCase() as 'application' | 'knowledge'][ |
359 | 370 | 'workspace' |
360 | | - ].jump_read(row.source_id) |
| 371 | + ].jump_read(row.source_id) |
361 | 372 | } |
362 | 373 |
|
363 | 374 | const hasResourceSystemManagePermission = (row: any) => { |
364 | 375 | return permissionMap[row.source_type.toLowerCase() as 'application' | 'knowledge'][ |
365 | 376 | 'systemManage' |
366 | | - ].jump_read() |
| 377 | + ].jump_read() |
367 | 378 | } |
368 | 379 | const hasResourceSharedPermission = () => { |
369 | 380 | return permissionMap['knowledge']['systemShare'].jump_read() |
@@ -449,7 +460,7 @@ watch( |
449 | 460 | v.label.toLowerCase().includes(filterText.value.toLowerCase()), |
450 | 461 | ) |
451 | 462 | }, |
452 | | - { immediate: true }, |
| 463 | + {immediate: true}, |
453 | 464 | ) |
454 | 465 |
|
455 | 466 | defineExpose({ |
|
0 commit comments