Skip to content

Commit c3fe0f6

Browse files
perf: tag management style
1 parent ebd6387 commit c3fe0f6

File tree

10 files changed

+82
-55
lines changed

10 files changed

+82
-55
lines changed

ui/src/locales/lang/en-US/views/document.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export default {
22
uploadDocument: 'Upload Document',
33
importDocument: 'Import Document',
44
syncDocument: 'Sync Document',
5-
items: 'Items',
5+
items: '',
66
migrateDocument: 'Migrate to',
77
setting: {
88
migration: 'Move',
@@ -109,7 +109,6 @@ export default {
109109
unrelate: 'Unlink',
110110
relatedDoc: 'Linked documents',
111111
unrelatedDoc: 'Unlinked documents',
112-
tagLinkTitle: 'Tag: Tag Value',
113112
setting: 'Tag Settings',
114113
create: 'Create Tag',
115114
createValue: 'Create Tag Value',

ui/src/locales/lang/zh-CN/views/document.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ export default {
104104
unrelate: '取消关联',
105105
relatedDoc: '已关联文档',
106106
unrelatedDoc: '未关联文档',
107-
tagLinkTitle: '标签: 标签值',
108107
addValue: '添加标签值',
109108
setting: '标签设置',
110109
create: '创建标签',

ui/src/locales/lang/zh-Hant/views/document.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ export default {
105105
unrelate: '取消關聯',
106106
relatedDoc: '已關聯文檔',
107107
unrelatedDoc: '未關聯文檔',
108-
tagLinkTitle: '標籤: 標籤值',
109108
addTag: '添加標籤',
110109
setting: '標籤設置',
111110
create: '創建標籤',

ui/src/styles/app.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,10 @@ h5 {
286286
justify-content: center;
287287
}
288288

289+
.justify-end {
290+
justify-content: end;
291+
}
292+
289293
.text-left {
290294
text-align: left;
291295
}

ui/src/styles/element-plus.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
--el-table-header-bg-color: var(--app-layout-bg-color);
202202
--el-table-text-color: var(--app-text-color);
203203
--el-table-border-color: #dee0e3;
204-
// --el-table-row-hover-bg-color: rgba(var(--el-text-color-primary-rgb), 0.1);
204+
--el-table-row-hover-bg-color: #eff0f1;
205205
font-weight: 400;
206206
thead {
207207
color: var(--app-text-color-secondary);

ui/src/views/document/index.vue

Lines changed: 33 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@
132132
style="width: 120px"
133133
@change="search_type_change"
134134
>
135-
<el-option :label="$t('dynamicsForm.tag.label')" value="tag" />
136135
<el-option :label="$t('common.name')" value="name" />
137136
</el-select>
138137
<el-input
@@ -143,14 +142,6 @@
143142
style="width: 220px"
144143
clearable
145144
/>
146-
<el-input
147-
v-if="search_type === 'tag'"
148-
v-model="search_form.tag"
149-
@change="refresh"
150-
:placeholder="$t('views.document.tag.requiredMessage3')"
151-
style="width: 220px"
152-
clearable
153-
/>
154145
</div>
155146

156147
<el-tooltip
@@ -209,7 +200,7 @@
209200
<el-table-column
210201
prop="status"
211202
:label="$t('views.document.fileStatus.label')"
212-
width="110"
203+
width="120"
213204
>
214205
<template #default="{ row }">
215206
<StatusValue :status="row.status" :status-meta="row.status_meta"></StatusValue>
@@ -219,7 +210,7 @@
219210
prop="char_length"
220211
:label="$t('views.document.table.char_length')"
221212
align="right"
222-
min-width="90"
213+
min-width="120"
223214
sortable
224215
>
225216
<template #default="{ row }">
@@ -230,7 +221,7 @@
230221
prop="paragraph_count"
231222
:label="$t('views.document.table.paragraph')"
232223
align="right"
233-
min-width="90"
224+
min-width="120"
234225
sortable
235226
/>
236227

@@ -293,7 +284,8 @@
293284
<el-table-column width="130" prop="tag">
294285
<template #header>
295286
<div>
296-
<span>{{ $t('views.document.tag.label') }}</span>
287+
<span>{{ $t('dynamicsForm.tag.label') }}</span>
288+
297289
<el-dropdown trigger="click" @visible-change="handleTagVisibleChange">
298290
<el-button
299291
style="margin-top: 1px"
@@ -325,38 +317,42 @@
325317
<template #default="{ row }">
326318
<el-popover
327319
trigger="hover"
328-
placement="bottom"
320+
placement="bottom-start"
329321
:disabled="!row.tag_count"
330-
:width="160"
322+
:popper-style="{ width: 'auto', maxWidth: '300px' }"
331323
>
332-
<div v-for="tag in row.tags" :key="tag.id" flex class="pt-4">
333-
<span class="mr-8 color-input-placeholder">{{ tag.key }}</span
334-
>{{ tag.value }}
324+
<div
325+
v-for="tag in row.tags"
326+
:key="tag.id"
327+
class="flex align-center lighter color-text-primary mt-4 mb-4"
328+
>
329+
<span class="color-secondary ellipsis-1" style="width: 40%" :title="tag.key">{{
330+
tag.key
331+
}}</span>
332+
<span class="ml-4 ellipsis-1" :title="tag.value"> {{ tag.value }}</span>
335333
</div>
336334

337335
<template #reference>
338-
<el-space :size="4">
339-
<el-tag v-if="row.tag_count" type="info" effect="plain" class="never">
340-
<div class="flex align-center color-text-primary">
341-
<AppIcon iconName="app-tag"></AppIcon>
342-
<span class="ml-4">{{ row.tag_count }}</span>
343-
</div>
344-
</el-tag>
345-
<el-button
346-
class="button-new-tag"
347-
size="small"
348-
:disabled="!permissionPrecise.doc_tag(id)"
349-
@click.stop="openAddTagDialog(row.id)"
350-
>
351-
<AppIcon iconName="app-add-outlined" class="mr-4"></AppIcon>
352-
{{ $t('views.document.tag.key') }}
353-
</el-button>
354-
</el-space>
336+
<el-tag v-if="row.tag_count" type="info" effect="plain" class="never mr-4">
337+
<div class="flex align-center color-text-primary">
338+
<AppIcon iconName="app-tag"></AppIcon>
339+
<span class="ml-4">{{ row.tag_count }}</span>
340+
</div>
341+
</el-tag>
355342
</template>
356343
</el-popover>
344+
<el-button
345+
class="button-new-tag"
346+
size="small"
347+
:disabled="!permissionPrecise.doc_tag(id)"
348+
@click.stop="openAddTagDialog(row.id)"
349+
>
350+
<AppIcon iconName="app-add-outlined" class="mr-4"></AppIcon>
351+
{{ $t('views.document.tag.key') }}
352+
</el-button>
357353
</template>
358354
</el-table-column>
359-
<el-table-column width="140">
355+
<el-table-column width="165">
360356
<template #header>
361357
<div>
362358
<span>{{ $t('views.document.form.hit_handling_method.label') }}</span>
@@ -1293,7 +1289,7 @@ function editName(val: string, id: string) {
12931289
}
12941290
12951291
function cellMouseEnter(row: any, column: any) {
1296-
if (column.property === 'name') {
1292+
if (column && column.property === 'name') {
12971293
currentMouseId.value = row.id
12981294
}
12991295
}

ui/src/views/document/tag/TagDrawer.vue

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,14 @@
3939
@cell-mouse-leave="cellMouseLeave"
4040
>
4141
<el-table-column type="selection" width="55" />
42-
<el-table-column :label="$t('views.document.tag.key')">
42+
<el-table-column
43+
prop="key"
44+
:label="
45+
multipleSelection.length === 0
46+
? $t('views.document.tag.key')
47+
: `${$t('common.selected')} ${multipleSelection.length} ${$t('views.document.items')}`
48+
"
49+
>
4350
<template #default="{ row }">
4451
<div class="flex-between">
4552
{{ row.key }}
@@ -123,7 +130,7 @@
123130
</template>
124131
</el-table-column>
125132
</el-table>
126-
<div class="app-table__pagination mt-16">
133+
<div class="mt-16 flex justify-end">
127134
<el-pagination
128135
v-model:current-page="pageNum"
129136
v-model:page-size="pageSize"
@@ -190,10 +197,12 @@ const tags = ref<Array<any>>([])
190197
const currentMouseId = ref<number | null>(null)
191198
const pageNum = ref(1)
192199
const pageSize = ref(20)
193-
const tableMaxHeight = computed(() => `calc(100vh - 260px)`)
200+
const tableMaxHeight = computed(() => `calc(100vh - 200px)`)
194201
195-
function cellMouseEnter(row: any) {
196-
currentMouseId.value = row.id
202+
function cellMouseEnter(row: any, column: any) {
203+
if (column && column.property === 'key') {
204+
currentMouseId.value = row.id
205+
}
197206
}
198207
199208
function cellMouseLeave() {

ui/src/views/document/tag/TaglinkedDocumentDialog.vue

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
<template>
2-
<el-dialog v-model="dialogVisible" :before-close="close" append-to-body destroy-on-close>
2+
<el-dialog
3+
v-model="dialogVisible"
4+
width="1000"
5+
align-center
6+
:before-close="close"
7+
append-to-body
8+
destroy-on-close
9+
>
310
<template #header>
4-
<h4>{{ $t('views.document.tag.tagLinkTitle') }}</h4>
11+
<h4>{{ $t('views.document.tag.key') }}: {{ $t('views.document.tag.value') }}</h4>
512
</template>
613
<div>
714
<el-tabs v-model="activeTab" @tab-change="handleTabChange">
@@ -30,14 +37,27 @@
3037
@changePage="getList"
3138
:data="tableData"
3239
:row-key="(row: any) => row.id"
33-
class="mt-16 document-table"
40+
class="mt-16"
3441
@selection-change="handleSelectionChange"
42+
style="min-height: 400px"
3543
v-loading="loading"
3644
>
3745
<el-table-column type="selection" width="55" :reserve-selection="true" v-if="!isShared" />
38-
<el-table-column prop="name" :label="$t('views.document.table.name')" min-width="280">
46+
<el-table-column
47+
prop="name"
48+
:label="
49+
multipleSelection.length === 0
50+
? $t('views.document.table.name')
51+
: `${$t('common.selected')} ${multipleSelection.length} ${$t('views.document.items')}`
52+
"
53+
min-width="280"
54+
show-overflow-tooltip
55+
>
3956
<template #default="{ row }">
40-
<span>{{ row.name }}</span>
57+
<el-space :size="8">
58+
<img :src="getImgUrl(row && row?.name)" alt="" width="24" />
59+
<span class="ellipsis" style="max-width: 450px">{{ row.name }}</span>
60+
</el-space>
4161
</template>
4262
</el-table-column>
4363
<el-table-column width="130">
@@ -145,6 +165,7 @@ import { loadSharedApi } from '@/utils/dynamics-api/shared-api.ts'
145165
import { cloneDeep } from 'lodash'
146166
import type { ElTable } from 'element-plus'
147167
import { datetimeFormat } from '@/utils/time'
168+
import { getImgUrl } from '@/utils/common'
148169
import { MsgSuccess } from '@/utils/message'
149170
import { t } from '@/locales'
150171
import type { TabPaneName } from 'element-plus'
@@ -191,7 +212,7 @@ function handleSearch() {
191212
192213
const paginationConfig = ref({
193214
current_page: 1,
194-
page_size: 10,
215+
page_size: 20,
195216
total: 0,
196217
})
197218
const filterText = ref<string>('')

ui/src/views/problem/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ function editName(val: string, problemId: string) {
305305
}
306306
307307
function cellMouseEnter(row: any, column: any) {
308-
if (column.property === 'content') {
308+
if (column && column.property === 'content') {
309309
currentMouseId.value = row.id
310310
}
311311
}

ui/src/views/trigger/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
<el-table-column type="selection" width="55" :reserve-selection="true" />
115115
<el-table-column
116116
prop="name"
117-
:label="$t('common.name')"
117+
:label="multipleSelection.length === 0 ? $t('common.name') : `${$t('common.selected')} ${multipleSelection.length} ${$t('views.document.items') }`"
118118
show-overflow-tooltip
119119
width="220"
120120
>

0 commit comments

Comments
 (0)