Skip to content

Commit c7214a6

Browse files
feat: workflow
1 parent 3e3c40d commit c7214a6

File tree

6 files changed

+205
-153
lines changed

6 files changed

+205
-153
lines changed

ui/src/router/modules/application-detail.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ const ApplicationDetailRouter = {
8686
path: 'chat-user',
8787
name: 'applicationChatUser',
8888
meta: {
89-
icon: 'app-document',
90-
iconActive: 'app-document-active',
89+
icon: 'app-user-chat',
90+
iconActive: 'app-user-chat',
9191
title: 'views.chatUser.title',
92-
active: 'chat-log',
92+
active: 'chat-user',
9393
parentPath: '/application/:id/:type',
9494
parentName: 'ApplicationDetail',
9595
resourceType: SourceTypeEnum.APPLICATION,

ui/src/router/modules/document.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ const DocumentRouter = {
7575
path: 'chat-user',
7676
name: 'KnowledgeChatUser',
7777
meta: {
78-
icon: 'app-document',
79-
iconActive: 'app-document-active',
78+
icon: 'app-user-chat',
79+
iconActive: 'app-user-chat',
8080
title: 'views.chatUser.title',
8181
active: 'chat-log',
8282
parentPath: '/knowledge/:id/:folderId',
@@ -98,14 +98,19 @@ const DocumentRouter = {
9898
if (to.params.folderId == 'shared') {
9999
return PermissionConst.SHARED_KNOWLEDGE_CHAT_USER_READ
100100
} else {
101-
return PermissionConst.KNOWLEDGE_CHAT_USER_READ.getKnowledgeWorkspaceResourcePermission(to ? to.params.id : '',)
101+
return PermissionConst.KNOWLEDGE_CHAT_USER_READ.getKnowledgeWorkspaceResourcePermission(
102+
to ? to.params.id : '',
103+
)
102104
}
103105
},
104106
() => {
105107
const to: any = get_next_route()
106108
if (to.params.folder_id == 'shared') {
107109
return RoleConst.ADMIN
108-
} else { return PermissionConst.KNOWLEDGE_CHAT_USER_READ.getWorkspacePermissionWorkspaceManageRole }
110+
} else {
111+
return PermissionConst.KNOWLEDGE_CHAT_USER_READ
112+
.getWorkspacePermissionWorkspaceManageRole
113+
}
109114
},
110115
],
111116
},

ui/src/styles/app.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,16 @@ h5 {
507507
border: none !important;
508508
}
509509

510+
/*
511+
图标旋转90度
512+
*/
513+
.rotate-90 {
514+
transform: rotateZ(90deg);
515+
}
516+
.rotate-180 {
517+
transform: rotateZ(180deg);
518+
}
519+
510520
/*
511521
内容部分 自适应高度
512522
*/

ui/src/views/application-workflow/component/DropdownMenu.vue

Lines changed: 49 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<template>
22
<div v-show="show" class="workflow-dropdown-menu border border-r-6">
33
<el-tabs v-model="activeName" class="workflow-dropdown-tabs">
4-
<div style="display: flex; width: 100%; justify-content: center;" class="mb-12">
5-
<el-input v-model="search_text" class="mr-12 ml-12"
6-
:placeholder="$t('views.applicationWorkflow.searchBar.placeholder')">
4+
<div style="display: flex; width: 100%; justify-content: center" class="mb-12">
5+
<el-input
6+
v-model="search_text"
7+
class="mr-12 ml-12"
8+
:placeholder="$t('views.applicationWorkflow.searchBar.placeholder')"
9+
>
710
<template #suffix>
811
<el-icon class="el-input__icon"><search /></el-icon>
912
</template>
@@ -14,23 +17,39 @@
1417
<el-scrollbar height="400">
1518
<div v-if="filter_menu_nodes.length > 0">
1619
<template v-for="(node, index) in filter_menu_nodes" :key="index">
17-
<el-text type="info" size="small" class="color-secondary ml-12">{{ node.label }}</el-text>
20+
<el-text type="info" size="small" class="color-secondary ml-12">{{
21+
node.label
22+
}}</el-text>
1823
<div class="flex-wrap mt-8">
1924
<template v-for="(item, index) in node.list" :key="index">
2025
<el-popover placement="right" :width="280">
2126
<template #reference>
22-
<div class="flex align-center border border-r-6 mb-12 p-8-12 cursor ml-12" style="width: 39%; " @click.stop="clickNodes(item)"
23-
@mousedown.stop="onmousedown(item)">
24-
<component :is="iconComponent(`${item.type}-icon`)" class="mr-8" :size="32" />
27+
<div
28+
class="flex align-center border border-r-6 mb-12 p-8-12 cursor ml-12"
29+
style="width: 39%"
30+
@click.stop="clickNodes(item)"
31+
@mousedown.stop="onmousedown(item)"
32+
>
33+
<component
34+
:is="iconComponent(`${item.type}-icon`)"
35+
class="mr-8"
36+
:size="32"
37+
/>
2538
<div class="lighter">{{ item.label }}</div>
2639
</div>
2740
</template>
2841
<template #default>
2942
<div class="flex align-center mb-8">
30-
<component :is="iconComponent(`${item.type}-icon`)" class="mr-8" :size="32" />
43+
<component
44+
:is="iconComponent(`${item.type}-icon`)"
45+
class="mr-8"
46+
:size="32"
47+
/>
3148
<div class="lighter color-text-primary">{{ item.label }}</div>
3249
</div>
33-
<el-text type="info" size="small" class="color-secondary lighter">{{ item.text }}</el-text>
50+
<el-text type="info" size="small" class="color-secondary lighter">{{
51+
item.text
52+
}}</el-text>
3453
</template>
3554
</el-popover>
3655
</template>
@@ -174,21 +193,21 @@ const filter_application_list = computed(() => {
174193
})
175194
176195
const filter_menu_nodes = computed(() => {
177-
if (!search_text.value) return menuNodes;
178-
const searchTerm = search_text.value.toLowerCase();
179-
196+
if (!search_text.value) return menuNodes
197+
const searchTerm = search_text.value.toLowerCase()
198+
180199
return menuNodes.reduce((result: any[], item) => {
181-
const filteredList = item.list.filter(listItem =>
182-
listItem.label.toLowerCase().includes(searchTerm)
183-
);
184-
200+
const filteredList = item.list.filter((listItem) =>
201+
listItem.label.toLowerCase().includes(searchTerm),
202+
)
203+
185204
if (filteredList.length) {
186-
result.push({ ...item, list: filteredList });
205+
result.push({ ...item, list: filteredList })
187206
}
188-
189-
return result;
190-
}, []);
191-
});
207+
208+
return result
209+
}, [])
210+
})
192211
function clickNodes(item: any, data?: any, type?: string) {
193212
if (data) {
194213
item['properties']['stepName'] = data.name
@@ -215,10 +234,10 @@ function clickNodes(item: any, data?: any, type?: string) {
215234
...(!fileUploadSetting
216235
? {}
217236
: {
218-
...(fileUploadSetting.document ? { document_list: [] } : {}),
219-
...(fileUploadSetting.image ? { image_list: [] } : {}),
220-
...(fileUploadSetting.audio ? { audio_list: [] } : {}),
221-
}),
237+
...(fileUploadSetting.document ? { document_list: [] } : {}),
238+
...(fileUploadSetting.image ? { image_list: [] } : {}),
239+
...(fileUploadSetting.audio ? { audio_list: [] } : {}),
240+
}),
222241
}
223242
} else {
224243
item['properties']['node_data'] = {
@@ -260,10 +279,10 @@ function onmousedown(item: any, data?: any, type?: string) {
260279
...(!fileUploadSetting
261280
? {}
262281
: {
263-
...(fileUploadSetting.document ? { document_list: [] } : {}),
264-
...(fileUploadSetting.image ? { image_list: [] } : {}),
265-
...(fileUploadSetting.audio ? { audio_list: [] } : {}),
266-
}),
282+
...(fileUploadSetting.document ? { document_list: [] } : {}),
283+
...(fileUploadSetting.image ? { image_list: [] } : {}),
284+
...(fileUploadSetting.audio ? { audio_list: [] } : {}),
285+
}),
267286
}
268287
} else {
269288
item['properties']['node_data'] = {
@@ -301,7 +320,7 @@ onMounted(() => {
301320
user-select: none; /* CSS3属性 */
302321
position: absolute;
303322
top: 49px;
304-
right: 122px;
323+
right: 16px;
305324
z-index: 99;
306325
width: 400px;
307326
box-shadow: 0px 4px 8px 0px var(--app-text-color-light-1);

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

Lines changed: 26 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
11
<template>
2-
<ContentContainer>
3-
<template #header>
4-
<div>
5-
<h2>{{ $t('views.chatUser.title') }}</h2>
6-
<div class="color-secondary">
7-
{{
8-
resource.resource_type === SourceTypeEnum.APPLICATION
9-
? $t('views.chatUser.applicationTitleTip')
10-
: $t('views.chatUser.knowledgeTitleTip')
11-
}}
12-
</div>
2+
<div class="group p-16-24">
3+
<div class="mb-16">
4+
<h2>{{ $t('views.chatUser.title') }}</h2>
5+
<div class="color-secondary">
6+
{{
7+
resource.resource_type === SourceTypeEnum.APPLICATION
8+
? $t('views.chatUser.applicationTitleTip')
9+
: $t('views.chatUser.knowledgeTitleTip')
10+
}}
1311
</div>
14-
</template>
15-
<el-card style="--el-card-padding: 0" class="user-card">
16-
<div class="flex h-full">
12+
</div>
13+
<el-card style="--el-card-padding: 0">
14+
<div class="flex">
1715
<div class="user-left border-r p-16">
18-
<div class="user-left_title">
16+
<div class="p-8 pb-0 mb-12">
1917
<h4 class="medium">{{ $t('views.chatUser.group.title') }}</h4>
2018
</div>
21-
<div class="p-8">
22-
<el-input
23-
v-model="filterText"
24-
:placeholder="$t('common.search')"
25-
prefix-icon="Search"
26-
clearable
27-
/>
28-
</div>
19+
20+
<el-input
21+
v-model="filterText"
22+
:placeholder="$t('common.search')"
23+
prefix-icon="Search"
24+
clearable
25+
class="mb-8"
26+
/>
27+
2928
<div class="list-height-left">
3029
<el-scrollbar v-loading="loading">
3130
<common-list :data="filterList" @click="clickUserGroup" :default-active="current?.id">
@@ -46,11 +45,8 @@
4645
<div class="flex align-center">
4746
<h4 class="medium">{{ current?.name }}</h4>
4847
<el-divider direction="vertical" class="mr-8 ml-8" />
49-
<AppIcon
50-
iconName="app-workspace"
51-
style="font-size: 16px"
52-
class="color-input-placeholder"
53-
></AppIcon>
48+
49+
<el-icon class="color-input-placeholder"><UserFilled /></el-icon>
5450
<span class="color-input-placeholder ml-4">
5551
{{ paginationConfig.total }}
5652
</span>
@@ -162,13 +158,12 @@
162158
</div>
163159
</div>
164160
</el-card>
165-
</ContentContainer>
161+
</div>
166162
</template>
167163

168164
<script lang="ts" setup>
169165
import { onMounted, ref, watch, reactive, computed } from 'vue'
170-
import ChatUserApi from '@/api/chat-user/chat-user'
171-
import SharedChatUserApi from '@/api/system-shared/chat-user'
166+
172167
import { t } from '@/locales'
173168
import type { ChatUserGroupItem, ChatUserGroupUserItem } from '@/api/type/workspaceChatUser'
174169
import { useRoute } from 'vue-router'
@@ -367,38 +362,13 @@ async function handleSave() {
367362
</script>
368363

369364
<style lang="scss" scoped>
370-
.content-container {
371-
height: 100%;
372-
display: flex;
373-
flex-direction: column;
374-
375-
:deep(.content-container__main) {
376-
flex: 1;
377-
overflow: hidden;
378-
}
379-
}
380-
381-
:deep(.user-card) {
382-
height: 100%;
383-
overflow: hidden;
384-
}
385-
386365
.user-left {
387366
box-sizing: border-box;
388367
width: var(--setting-left-width);
389368
min-width: var(--setting-left-width);
390369
391-
.user-left_title {
392-
padding: 8px;
393-
}
394-
395370
.list-height-left {
396371
height: calc(100vh - 271px);
397-
398-
:deep(.common-list li) {
399-
padding-right: 4px;
400-
padding-left: 8px;
401-
}
402372
}
403373
}
404374

0 commit comments

Comments
 (0)