Skip to content

Commit 27262c9

Browse files
fix: icon optimize
1 parent f46205b commit 27262c9

File tree

11 files changed

+74
-73
lines changed

11 files changed

+74
-73
lines changed

ui/src/components/app-icon/index.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,26 @@ export const iconMap: any = {
326326
])
327327
},
328328
},
329+
'app-key': {
330+
iconReader: () => {
331+
return h('i', [
332+
h(
333+
'svg',
334+
{
335+
viewBox: '0 0 1024 1024',
336+
version: '1.1',
337+
xmlns: 'http://www.w3.org/2000/svg',
338+
},
339+
[
340+
h('path', {
341+
d: 'M512 512a85.333333 85.333333 0 0 1 42.666667 159.232V746.666667a21.333333 21.333333 0 0 1-21.333334 21.333333h-42.666666a21.333333 21.333333 0 0 1-21.333334-21.333333v-75.434667A85.333333 85.333333 0 0 1 512 512z" p-id="16092"></path><path d="M512 85.333333c129.578667 0 234.666667 104.96 234.666667 234.666667V341.333333H896c23.552 0 42.666667 19.2 42.666667 42.666667v512c0 23.466667-19.114667 42.666667-42.666667 42.666667H128c-23.594667 0-42.666667-19.2-42.666667-42.666667V384c0-23.466667 19.072-42.666667 42.666667-42.666667h149.333333v-21.333333C277.333333 190.293333 382.421333 85.333333 512 85.333333zM170.666667 853.333333h682.666666V426.666667H170.666667v426.666666z m341.333333-682.666666a149.290667 149.290667 0 0 0-149.333333 149.333333V341.333333h298.666666v-21.333333C661.333333 237.44 594.474667 170.666667 512 170.666667z',
342+
fill: 'currentColor',
343+
}),
344+
],
345+
),
346+
])
347+
},
348+
},
329349
// 动态加载的图标
330350
...dynamicIcons,
331351
}

ui/src/views/application-overview/index.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,7 @@
8282
</el-button>
8383
<!-- 访问限制 -->
8484
<el-button @click="openLimitDialog" v-if="permissionPrecise.overview_access(id)">
85-
<el-icon class="mr-4">
86-
<Lock />
87-
</el-icon>
85+
<AppIcon iconName="app-key" class="mr-4"></AppIcon>
8886
{{ $t('views.applicationOverview.appInfo.accessControl') }}
8987
</el-button>
9088
<!-- 显示设置 -->

ui/src/views/chat/embed/component/ChatHistoryDrawer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
style="padding-top: 8px; padding-bottom: 8px"
6464
@click="openResetPassword"
6565
>
66-
<el-icon><Lock /></el-icon>
66+
<AppIcon iconName="app-key"></AppIcon>
6767
{{ $t('views.login.resetPassword') }}
6868
</el-dropdown-item>
6969
<el-dropdown-item

ui/src/views/chat/mobile/component/UserCenterDrawer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
@click="resetPassword"
2323
>
2424
<div class="flex align-center">
25-
<el-icon class="mr-12"><Lock /></el-icon>
25+
<AppIcon iconName="app-key" class="mr-12"></AppIcon>
2626
<h4 class="lighter">{{ $t('views.login.resetPassword') }}</h4>
2727
</div>
2828
<el-icon size="16">

ui/src/views/chat/pc/index.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@
7474
style="padding-top: 8px; padding-bottom: 8px"
7575
@click="openResetPassword"
7676
>
77-
<el-icon>
78-
<Lock />
79-
</el-icon>
77+
<AppIcon iconName="app-key" class="mr-4"></AppIcon>
8078
{{ $t('views.login.resetPassword') }}
8179
</el-dropdown-item>
8280
<el-dropdown-item

ui/src/views/knowledge/component/KnowledgeListContainer.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,10 @@
246246
</el-dropdown-item>
247247
<el-dropdown-item
248248
v-if="isSystemShare"
249-
icon="Lock"
250249
@click.stop="openAuthorizedWorkspaceDialog(item)"
251-
>{{ $t('views.shared.authorized_workspace') }}</el-dropdown-item
250+
>
251+
<AppIcon iconName="app-key"></AppIcon>
252+
{{ $t('views.shared.authorized_workspace') }}</el-dropdown-item
252253
>
253254

254255
<el-dropdown-item

ui/src/views/model/component/ModelCard.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,10 @@
8181
</el-dropdown-item>
8282
<el-dropdown-item
8383
v-if="isSystemShare"
84-
icon="Lock"
8584
@click.stop="openAuthorizedWorkspaceDialog(model)"
86-
>{{ $t('views.shared.authorized_workspace') }}
85+
>
86+
<AppIcon iconName="app-key"></AppIcon>
87+
{{ $t('views.shared.authorized_workspace') }}
8788
</el-dropdown-item>
8889

8990
<el-dropdown-item

ui/src/views/problem/index.vue

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -279,23 +279,12 @@ function deleteMulDocument() {
279279
}
280280
281281
function deleteProblem(row: any) {
282-
MsgConfirm(
283-
`${t('views.problem.delete.confirmTitle')} ${row.content} ?`,
284-
`${t('views.problem.delete.confirmMessage1')} ${row.paragraph_count} ${t('views.problem.delete.confirmMessage2')}`,
285-
{
286-
confirmButtonText: t('common.confirm'),
287-
confirmButtonClass: 'danger',
288-
},
289-
)
282+
loadSharedApi({ type: 'problem', systemType: apiType.value })
283+
.delProblems(id, row.id, loading)
290284
.then(() => {
291-
loadSharedApi({ type: 'problem', systemType: apiType.value })
292-
.delProblems(id, row.id, loading)
293-
.then(() => {
294-
MsgSuccess(t('common.deleteSuccess'))
295-
getList()
296-
})
285+
MsgSuccess(t('common.deleteSuccess'))
286+
getList()
297287
})
298-
.catch(() => {})
299288
}
300289
301290
function editName(val: string, problemId: string) {

ui/src/views/system-chat-user/chat-user/index.vue

Lines changed: 36 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,10 @@
6767
style="width: 120px"
6868
@change="search_type_change"
6969
>
70-
<el-option :label="$t('views.login.loginForm.username.label')" value="username"/>
71-
<el-option :label="$t('views.userManage.userForm.nick_name.label')" value="nick_name"/>
72-
<el-option :label="$t('common.status.label')" value="is_active"/>
73-
<el-option
74-
:label="$t('views.userManage.source.label')"
75-
value="source"
76-
/>
70+
<el-option :label="$t('views.login.loginForm.username.label')" value="username" />
71+
<el-option :label="$t('views.userManage.userForm.nick_name.label')" value="nick_name" />
72+
<el-option :label="$t('common.status.label')" value="is_active" />
73+
<el-option :label="$t('views.userManage.source.label')" value="source" />
7774
</el-select>
7875
<el-input
7976
v-if="search_type === 'username'"
@@ -96,8 +93,8 @@
9693
clearable
9794
style="width: 220px"
9895
>
99-
<el-option :label="$t('common.status.enabled')" :value="true"/>
100-
<el-option :label="$t('common.status.disabled')" :value="false"/>
96+
<el-option :label="$t('common.status.enabled')" :value="true" />
97+
<el-option :label="$t('common.status.disabled')" :value="false" />
10198
</el-select>
10299
<el-select
103100
v-else-if="search_type === 'source'"
@@ -107,14 +104,14 @@
107104
clearable
108105
:placeholder="$t('common.inputPlaceholder')"
109106
>
110-
<el-option :label="$t('views.userManage.source.local')" value="LOCAL"/>
111-
<el-option label="CAS" value="CAS"/>
112-
<el-option label="LDAP" value="LDAP"/>
113-
<el-option label="OIDC" value="OIDC"/>
114-
<el-option label="OAuth2" value="OAuth2"/>
115-
<el-option :label="$t('views.userManage.source.wecom')" value="wecom"/>
116-
<el-option :label="$t('views.userManage.source.lark')" value="lark"/>
117-
<el-option :label="$t('views.userManage.source.dingtalk')" value="dingtalk"/>
107+
<el-option :label="$t('views.userManage.source.local')" value="LOCAL" />
108+
<el-option label="CAS" value="CAS" />
109+
<el-option label="LDAP" value="LDAP" />
110+
<el-option label="OIDC" value="OIDC" />
111+
<el-option label="OAuth2" value="OAuth2" />
112+
<el-option :label="$t('views.userManage.source.wecom')" value="wecom" />
113+
<el-option :label="$t('views.userManage.source.lark')" value="lark" />
114+
<el-option :label="$t('views.userManage.source.dingtalk')" value="dingtalk" />
118115
</el-select>
119116
</div>
120117
</div>
@@ -129,7 +126,7 @@
129126
@sort-change="handleSortChange"
130127
:maxTableHeight="270"
131128
>
132-
<el-table-column type="selection" width="55"/>
129+
<el-table-column type="selection" width="55" />
133130
<el-table-column
134131
prop="nick_name"
135132
:label="$t('views.userManage.userForm.nick_name.label')"
@@ -146,7 +143,7 @@
146143
<template #default="{ row }">
147144
<div v-if="row.is_active" class="flex align-center">
148145
<el-icon class="color-success mr-8" style="font-size: 16px">
149-
<SuccessFilled/>
146+
<SuccessFilled />
150147
</el-icon>
151148
<span class="color-secondary">
152149
{{ $t('common.status.enabled') }}
@@ -186,7 +183,7 @@
186183
min-width="150"
187184
>
188185
<template #default="{ row }">
189-
<TagGroup :tags="row.user_group_names"/>
186+
<TagGroup :tags="row.user_group_names" />
190187
</template>
191188
</el-table-column>
192189
<el-table-column prop="source" :label="$t('views.userManage.source.label')">
@@ -233,7 +230,7 @@
233230
"
234231
/>
235232
</span>
236-
<el-divider direction="vertical"/>
233+
<el-divider direction="vertical" />
237234
<span class="mr-8">
238235
<el-button
239236
type="primary"
@@ -274,9 +271,7 @@
274271
)
275272
"
276273
>
277-
<el-icon>
278-
<Lock/>
279-
</el-icon>
274+
<AppIcon iconName="app-key"></AppIcon>
280275
</el-button>
281276
</span>
282277
<span>
@@ -316,34 +311,34 @@
316311
ref="UserDrawerRef"
317312
@refresh="refresh"
318313
/>
319-
<UserPwdDialog ref="UserPwdDialogRef" @refresh="refresh"/>
314+
<UserPwdDialog ref="UserPwdDialogRef" @refresh="refresh" />
320315
<SetUserGroupsDialog
321316
:optionLoading="optionLoading"
322317
:chatGroupList="chatGroupList"
323318
ref="setUserGroupsRef"
324319
@refresh="refresh"
325320
/>
326-
<SyncUsersDialog ref="syncUsersDialogRef" @refresh="refresh"/>
321+
<SyncUsersDialog ref="syncUsersDialogRef" @refresh="refresh" />
327322
</div>
328323
</template>
329324

330325
<script lang="ts" setup>
331-
import {onMounted, ref, reactive} from 'vue'
326+
import { onMounted, ref, reactive } from 'vue'
332327
import UserDrawer from './component/UserDrawer.vue'
333328
import UserPwdDialog from './component/UserPwdDialog.vue'
334329
import SetUserGroupsDialog from './component/SetUserGroupsDialog.vue'
335330
import SyncUsersDialog from './component/SyncUsersDialog.vue'
336331
import userManageApi from '@/api/system/chat-user'
337-
import {datetimeFormat} from '@/utils/time'
338-
import {MsgSuccess, MsgConfirm} from '@/utils/message'
339-
import {t} from '@/locales'
340-
import type {ChatUserItem} from '@/api/type/systemChatUser'
332+
import { datetimeFormat } from '@/utils/time'
333+
import { MsgSuccess, MsgConfirm } from '@/utils/message'
334+
import { t } from '@/locales'
335+
import type { ChatUserItem } from '@/api/type/systemChatUser'
341336
import SystemGroupApi from '@/api/system/user-group'
342-
import type {ListItem} from '@/api/type/common'
343-
import {PermissionConst, RoleConst} from '@/utils/permission/data'
344-
import {ComplexPermission} from '@/utils/permission/type'
345-
import {hasPermission} from '@/utils/permission'
346-
import {loadPermissionApi} from '@/utils/dynamics-api/permission-api.ts'
337+
import type { ListItem } from '@/api/type/common'
338+
import { PermissionConst, RoleConst } from '@/utils/permission/data'
339+
import { ComplexPermission } from '@/utils/permission/type'
340+
import { hasPermission } from '@/utils/permission'
341+
import { loadPermissionApi } from '@/utils/dynamics-api/permission-api.ts'
347342
348343
const search_type = ref('username')
349344
const search_form = ref<{
@@ -358,7 +353,7 @@ const search_form = ref<{
358353
is_active: null,
359354
})
360355
const search_type_change = () => {
361-
search_form.value = {username: '', nick_name: '', source: '', is_active: null}
356+
search_form.value = { username: '', nick_name: '', source: '', is_active: null }
362357
}
363358
364359
const loading = ref(false)
@@ -393,7 +388,7 @@ function getList() {
393388
394389
const orderBy = ref<string>('')
395390
396-
function handleSortChange({prop, order}: { prop: string; order: string }) {
391+
function handleSortChange({ prop, order }: { prop: string; order: string }) {
397392
orderBy.value = order === 'ascending' ? prop : `-${prop}`
398393
getList()
399394
}
@@ -448,8 +443,7 @@ function deleteUserManage(row: ChatUserItem) {
448443
getList()
449444
})
450445
})
451-
.catch(() => {
452-
})
446+
.catch(() => {})
453447
}
454448
455449
const UserPwdDialogRef = ref()
@@ -480,7 +474,7 @@ async function getChatGroupList() {
480474
}
481475
482476
function handleBatchDelete() {
483-
MsgConfirm(t('views.chatUser.batchDeleteUser', {count: multipleSelection.value.length}), '', {
477+
MsgConfirm(t('views.chatUser.batchDeleteUser', { count: multipleSelection.value.length }), '', {
484478
confirmButtonText: t('common.confirm'),
485479
confirmButtonClass: 'danger',
486480
})
@@ -495,8 +489,7 @@ function handleBatchDelete() {
495489
await getList()
496490
})
497491
})
498-
.catch(() => {
499-
})
492+
.catch(() => {})
500493
}
501494
502495
const setUserGroupsRef = ref<InstanceType<typeof SetUserGroupsDialog>>()

ui/src/views/system/user-manage/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@
227227
:title="$t('views.userManage.setting.updatePwd')"
228228
v-if="hasPermission([RoleConst.ADMIN, PermissionConst.USER_EDIT], 'OR')"
229229
>
230-
<el-icon><Lock /></el-icon>
230+
<AppIcon iconName="app-key"></AppIcon>
231231
</el-button>
232232
</span>
233233
</el-tooltip>

0 commit comments

Comments
 (0)