Skip to content

Commit bb0ad0a

Browse files
feat: tool
1 parent 77295d2 commit bb0ad0a

File tree

30 files changed

+230
-1017
lines changed

30 files changed

+230
-1017
lines changed

ui/src/components/codemirror-editor/index.vue

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,34 @@
3939
</template>
4040

4141
<script setup lang="ts">
42-
import {ref, computed, watch} from 'vue'
43-
import {Codemirror} from 'vue-codemirror'
44-
import {python} from '@codemirror/lang-python'
45-
import {oneDark} from '@codemirror/theme-one-dark'
46-
import {linter, type Diagnostic} from '@codemirror/lint'
47-
import ToolApi from '@/api/system-shared/tool'
42+
import { ref, computed, watch } from 'vue'
43+
import { useRoute } from 'vue-router'
44+
import { Codemirror } from 'vue-codemirror'
45+
import { python } from '@codemirror/lang-python'
46+
import { oneDark } from '@codemirror/theme-one-dark'
47+
import { linter, type Diagnostic } from '@codemirror/lint'
48+
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
4849
49-
defineOptions({name: 'CodemirrorEditor'})
50+
defineOptions({ name: 'CodemirrorEditor' })
5051
5152
const props = defineProps<{
5253
title: string
5354
modelValue: any
5455
}>()
5556
const emit = defineEmits(['update:modelValue', 'submitDialog'])
57+
58+
const route = useRoute()
59+
60+
const type = computed(() => {
61+
if (route.path.includes('shared')) {
62+
return 'systemShare'
63+
} else if (route.path.includes('resource-management')) {
64+
return 'systemManage'
65+
} else {
66+
return 'workspace'
67+
}
68+
})
69+
5670
const data = computed({
5771
set: (value) => {
5872
emit('update:modelValue', value)
@@ -74,23 +88,25 @@ function getRangeFromLineAndColumn(state: any, line: number, column: number, end
7488
7589
const regexpLinter = linter(async (view) => {
7690
const diagnostics: Diagnostic[] = []
77-
await ToolApi.postPylint(view.state.doc.toString()).then((ok) => {
78-
ok.data.forEach((element: any) => {
79-
const range = getRangeFromLineAndColumn(
80-
view.state,
81-
element.line,
82-
element.column,
83-
element.endColumn,
84-
)
85-
86-
diagnostics.push({
87-
from: range.form,
88-
to: range.to,
89-
severity: element.type,
90-
message: element.message,
91+
await loadSharedApi({ type: 'tool', systemType: type.value })
92+
.postPylint(view.state.doc.toString())
93+
.then((ok: any) => {
94+
ok.data.forEach((element: any) => {
95+
const range = getRangeFromLineAndColumn(
96+
view.state,
97+
element.line,
98+
element.column,
99+
element.endColumn,
100+
)
101+
102+
diagnostics.push({
103+
from: range.form,
104+
to: range.to,
105+
severity: element.type,
106+
message: element.message,
107+
})
91108
})
92109
})
93-
})
94110
return diagnostics
95111
})
96112
const extensions = [python(), regexpLinter, oneDark]

ui/src/components/folder-tree/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<div class="flex-between w-full" @mouseenter.stop="handleMouseEnter(data)">
3434
<div class="flex align-center">
3535
<AppIcon iconName="app-folder" style="font-size: 16px"></AppIcon>
36-
<span class="ml-8">{{ node.label }}</span>
36+
<span class="ml-8 ellipsis" style="max-width:110px" :label="node.label">{{ node.label }}</span>
3737
</div>
3838

3939
<div
@@ -109,7 +109,7 @@ const props = defineProps({
109109
},
110110
shareTitle: {
111111
type: String,
112-
default: 'views.system.shared.shared_knowledge',
112+
default: '',
113113
},
114114
canOperation: {
115115
type: Boolean,

ui/src/components/layout-container/ContentContainer.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
1111
<slot name="search"> </slot>
1212
</div>
1313
</div>
14-
<el-scrollbar>
15-
<div class="content-container__main p-16">
14+
15+
<div class="content-container__main">
16+
<el-scrollbar class="p-16" style="padding-right: 0;">
1617
<slot></slot>
17-
</div>
18-
</el-scrollbar>
18+
</el-scrollbar>
19+
</div>
1920
</div>
2021
</template>
2122

ui/src/layout/layout-header/UserHeader.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/>
2222
</div>
2323
<TopMenu></TopMenu>
24-
<TopAbout></TopAbout>
24+
<TopAbout class="mt-4 mr-12"></TopAbout>
2525
</div>
2626
<Avatar></Avatar>
2727
</div>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export default {
115115
shared_resources: '共享资源',
116116
shared_tool: '共享工具',
117117
shared_model: '共享模型',
118-
shared_knowledge: '共享知识',
118+
shared_knowledge: '共享知识库',
119119
authorized_workspace: '授权工作区',
120120
},
121121
resource_management: {

ui/src/router/modules/document-shared-system.ts

Lines changed: 0 additions & 62 deletions
This file was deleted.

ui/src/router/modules/knowledge-shared-system.ts

Lines changed: 0 additions & 26 deletions
This file was deleted.

ui/src/router/modules/paragraph-shared-system.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

ui/src/router/modules/system.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ const systemRouter = {
157157
parentPath: '/system',
158158
parentName: 'system',
159159
},
160-
component: () => import('@/views/shared/model-shared/index.vue'),
160+
component: () => import('@/views/system-shared/ModelSharedIndex.vue'),
161161
},
162162
],
163163
},

ui/src/stores/modules-shared-system/common.ts

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)