fix: optimize style

This commit is contained in:
wangdan-fit2cloud 2025-12-09 17:34:02 +08:00
parent 720cfc7f1e
commit d4d88ac2be
12 changed files with 76 additions and 74 deletions

View File

@ -94,6 +94,16 @@ function initChart() {
},
},
},
dataZoom: [
{
type: 'inside',
show: props.option.dataZoom,
},
{
type: 'slider',
show: props.option.dataZoom,
},
],
series: series,
}
@ -117,6 +127,7 @@ watch(
)
onMounted(() => {
console.log(props.option.dataZoom)
nextTick(() => {
initChart()
window.addEventListener('resize', changeChartSize)

View File

@ -3,6 +3,7 @@
<div
:class="`layout-container__left border-r ${isCollapse ? 'hidden' : ''}`"
:style="{ width: isCollapse ? 0 : `${leftWidth}px` }"
v-if="showLeft"
>
<div class="layout-container__left_content">
<slot name="left"></slot>
@ -48,6 +49,10 @@ const props = defineProps({
type: Number,
default: 400,
},
showLeft: {
type: Boolean,
default: true,
},
})
const isCollapse = ref(false)

View File

@ -2,7 +2,7 @@
<div
v-show="show"
class="workflow-dropdown-menu border border-r-6 white-bg"
:style="{ width: activeName === 'base' ? '400px' : '640px' }"
:style="{ width: activeName === 'base' || route.path.includes('shared') ? '400px' : '640px' }"
>
<el-tabs v-model="activeName" class="workflow-dropdown-tabs" @tab-change="handleClick">
<div
@ -73,7 +73,7 @@
</el-tab-pane>
<!-- 工具 -->
<el-tab-pane :label="$t('views.tool.title')" name="CUSTOM_TOOL">
<LayoutContainer>
<LayoutContainer :showLeft="!route.path.includes('shared')">
<template #left>
<folder-tree
:source="SourceTypeEnum.TOOL"

View File

@ -2,7 +2,7 @@
<div
v-show="show"
class="workflow-dropdown-menu border border-r-6 white-bg"
:style="{ width: activeName === 'base' ? '400px' : '640px' }"
:style="{ width: activeName === 'base' || route.path.includes('shared') ? '400px' : '640px' }"
>
<el-tabs v-model="activeName" class="workflow-dropdown-tabs" @tab-change="handleClick">
<div
@ -73,7 +73,7 @@
</el-tab-pane>
<!-- 数据源 -->
<el-tab-pane :label="$t('views.tool.dataSource.title')" name="DATA_SOURCE_TOOL">
<LayoutContainer>
<LayoutContainer :showLeft="!route.path.includes('shared')">
<template #left>
<folder-tree
:source="SourceTypeEnum.TOOL"
@ -97,7 +97,7 @@
</el-tab-pane>
<!-- 工具 -->
<el-tab-pane :label="$t('views.tool.title')" name="CUSTOM_TOOL">
<LayoutContainer>
<LayoutContainer :showLeft="!route.path.includes('shared')">
<template #left>
<folder-tree
:source="SourceTypeEnum.TOOL"

View File

@ -43,10 +43,7 @@ import { hasPermission } from '@/utils/permission'
const router = useRouter()
const goHome = () => {
const newUrl = router.resolve({
path: `/`,
}).href
window.open(newUrl)
router.push('/')
}
</script>
<style lang="scss" scoped>

View File

@ -538,6 +538,6 @@ You are a master of problem optimization, adept at accurately inferring user int
SystemPromptPlaceholder: 'System Prompt, can reference variables in the system, such as',
UserPromptPlaceholder: 'User Prompt, can reference variables in the system, such as',
ExecutionRecord: 'Execution Record',
initiator: 'Initiator',
initiator: 'Iniiator',
debug: {},
}

View File

@ -109,7 +109,6 @@ const props = defineProps({
},
})
const statisticsType = computed(() => [
{
id: 'customerCharts',
@ -199,7 +198,12 @@ const statisticsType = computed(() => [
},
])
const topOptions = [{ label: 'TOP 10', value: 10 }, { label: 'TOP 20', value: 20}, { label: 'TOP 50', value: 50}, { label: 'TOP 100', value: 100}]
const topOptions = [
{ label: 'TOP 10', value: 10 },
{ label: 'TOP 20', value: 20 },
{ label: 'TOP 50', value: 50 },
{ label: 'TOP 100', value: 100 },
]
const tokenUsageCount = ref(10)
const topQuestionsCount = ref(10)
const tokenUsageOption = computed(() => {
@ -211,6 +215,7 @@ const tokenUsageOption = computed(() => {
data: getAttrsArray(props.tokenUsage?.slice(0, tokenUsageCount.value), 'token_usage'),
},
],
dataZoom: props.tokenUsage.length > 0,
}
})
const topQuestionsOption = computed(() => {
@ -219,9 +224,13 @@ const topQuestionsOption = computed(() => {
xData: getAttrsArray(props.topQuestions?.slice(0, topQuestionsCount.value), 'username'),
yData: [
{
data: getAttrsArray(props.topQuestions?.slice(0, topQuestionsCount.value), 'chat_record_count'),
data: getAttrsArray(
props.topQuestions?.slice(0, topQuestionsCount.value),
'chat_record_count',
),
},
],
dataZoom: props.topQuestions.length > 0,
}
})
</script>

View File

@ -76,7 +76,7 @@ const route = useRoute()
const key = ref<number>(0)
const {
params: { folderId },
query: { id } ,
query: { id },
/*
id为knowledgeID
folderId 可以区分 resource-management shared还是 workspace
@ -153,10 +153,7 @@ const continueImporting = () => {
})
}
const goDocument = () => {
const newUrl = router.resolve({
path: `/knowledge/${id}/${folderId}/4/document`,
}).href
window.open(newUrl)
router.push({ path: `/knowledge/${id}/${folderId}/4/document` })
}
const back = () => {

View File

@ -58,7 +58,7 @@
<p>
{{
props.currentContent?.run_time != undefined
? props.currentContent?.run_time + 's'
? props.currentContent?.run_time?.toFixed(2) + 's'
: '-'
}}
</p>

View File

@ -72,7 +72,7 @@
</el-table-column>
<el-table-column prop="run_time" :label="$t('chat.KnowledgeSource.consumeTime')">
<template #default="{ row }">
{{ row.run_time != undefined ? row.run_time + 's' : '-' }}
{{ row.run_time != undefined ? row.run_time?.toFixed(2) + 's' : '-' }}
</template>
</el-table-column>
<el-table-column
@ -128,7 +128,7 @@ const apiType = computed(() => {
})
const paginationConfig = reactive({
current_page: 1,
page_size: 10,
page_size: 50,
total: 0,
})
const query = ref<any>({
@ -168,16 +168,13 @@ const changePage = () => {
const getList = (clear?: boolean) => {
if (clear) {
paginationConfig.current_page = 1
data.value = []
}
return loadSharedApi({ type: 'knowledge', systemType: apiType.value })
.getWorkflowActionPage(active_knowledge_id.value, paginationConfig, query.value, loading)
.then((ok: any) => {
paginationConfig.total = ok.data?.total
if (clear) {
data.value = ok.data.records
} else {
data.value = data.value.concat(ok.data.records)
}
data.value = data.value.concat(ok.data.records)
})
}

View File

@ -14,7 +14,7 @@
>{{ $t('workflow.info.saveTime') }}{{ datetimeFormat(saveTime) }}
</el-text>
</div>
<div v-if="showHistory && disablePublic">
<div v-if="showHistory && disablePublic && !route.path.includes('share/')">
<el-button type="primary" class="mr-8" @click="refreshVersion()">
{{ $t('workflow.setting.restoreVersion') }}
</el-button>
@ -25,7 +25,7 @@
</el-icon>
</el-button>
</div>
<div v-else>
<div v-else-if="!route.path.includes('share/')">
<el-button @click="showPopover = !showPopover">
<AppIcon iconName="app-add-outlined" class="mr-4" />
{{ $t('workflow.setting.addComponent') }}

View File

@ -19,9 +19,7 @@
:model="form_data"
require-asterisk-position="right"
>
<el-form-item
:label="$t('workflow.nodes.baseNode.FileUploadSetting.maxFiles')"
>
<el-form-item :label="$t('workflow.nodes.baseNode.FileUploadSetting.maxFiles')">
<el-slider
v-model="form_data.maxFiles"
show-input
@ -30,9 +28,7 @@
:max="100"
/>
</el-form-item>
<el-form-item
:label="$t('workflow.nodes.baseNode.FileUploadSetting.fileLimit')"
>
<el-form-item :label="$t('workflow.nodes.baseNode.FileUploadSetting.fileLimit')">
<el-slider
v-model="form_data.fileLimit"
show-input
@ -42,9 +38,7 @@
/>
</el-form-item>
<el-form-item
:label="
$t('workflow.nodes.baseNode.FileUploadSetting.fileUploadType.label')
"
:label="$t('workflow.nodes.baseNode.FileUploadSetting.fileUploadType.label')"
>
<el-card
shadow="hover"
@ -55,12 +49,12 @@
>
<div class="flex-between">
<div class="flex align-center">
<img class="mr-12" src="@/assets/workflow/icon_file-doc.svg" alt=""/>
<img class="mr-12" src="@/assets/workflow/icon_file-doc.svg" alt="" />
<div>
<p class="line-height-22 mt-4">
{{ $t('common.fileUpload.document') }}
<el-text class="color-secondary"
>{{
>{{
$t(
'workflow.nodes.baseNode.FileUploadSetting.fileUploadType.documentText',
)
@ -85,15 +79,13 @@
>
<div class="flex-between">
<div class="flex align-center">
<img class="mr-12" src="@/assets/workflow/icon_file-image.svg" alt=""/>
<img class="mr-12" src="@/assets/workflow/icon_file-image.svg" alt="" />
<div>
<p class="line-height-22 mt-4">
{{ $t('common.fileUpload.image') }}
<el-text class="color-secondary"
>{{
$t(
'workflow.nodes.baseNode.FileUploadSetting.fileUploadType.imageText',
)
>{{
$t('workflow.nodes.baseNode.FileUploadSetting.fileUploadType.imageText')
}}
</el-text>
</p>
@ -116,15 +108,13 @@
>
<div class="flex-between">
<div class="flex align-center">
<img class="mr-12" src="@/assets/workflow/icon_file-audio.svg" alt=""/>
<img class="mr-12" src="@/assets/workflow/icon_file-audio.svg" alt="" />
<div>
<p class="line-height-22 mt-4">
{{ $t('common.fileUpload.audio') }}
<el-text class="color-secondary"
>{{
$t(
'workflow.nodes.baseNode.FileUploadSetting.fileUploadType.audioText',
)
>{{
$t('workflow.nodes.baseNode.FileUploadSetting.fileUploadType.audioText')
}}
</el-text>
</p>
@ -156,10 +146,8 @@
<p class="line-height-22 mt-4">
{{ $t('common.fileUpload.video') }}
<el-text class="color-secondary"
>{{
$t(
'workflow.nodes.baseNode.FileUploadSetting.fileUploadType.videoText',
)
>{{
$t('workflow.nodes.baseNode.FileUploadSetting.fileUploadType.videoText')
}}
</el-text>
</p>
@ -181,15 +169,13 @@
>
<div class="flex-between">
<div class="flex align-center">
<img class="mr-12" :width="32" src="@/assets/fileType/unknown-icon.svg" alt=""/>
<img class="mr-12" :width="32" src="@/assets/fileType/unknown-icon.svg" alt="" />
<div>
<p class="line-height-22 mt-4">
{{ $t('common.fileUpload.other') }}
<el-text class="color-secondary"
>{{
$t(
'workflow.nodes.baseNode.FileUploadSetting.fileUploadType.otherText',
)
>{{
$t('workflow.nodes.baseNode.FileUploadSetting.fileUploadType.otherText')
}}
</el-text>
</p>
@ -231,19 +217,19 @@
</div>
</el-card>
<el-form-item
:label="
$t('workflow.nodes.baseNode.FileUploadSetting.fileUploadType.uploadMethod')
">
:label="$t('workflow.nodes.baseNode.FileUploadSetting.fileUploadType.uploadMethod')"
>
<template #label>
<span>
{{ $t('workflow.nodes.baseNode.FileUploadSetting.fileUploadType.uploadMethod')
}}<span class="color-danger">*</span>
</span>
</template>
<div class="flex align-center">
<el-checkbox
v-model="form_data.local_upload"
class="mr-16"
>
<el-checkbox v-model="form_data.local_upload" class="mr-16">
{{ $t('common.fileUpload.localUpload') }}
</el-checkbox>
<el-checkbox
v-model="form_data.url_upload"
>
<el-checkbox v-model="form_data.url_upload">
{{ $t('common.fileUpload.urlUpload') }}
</el-checkbox>
</div>
@ -264,11 +250,11 @@
</template>
<script setup lang="ts">
import {nextTick, ref} from 'vue'
import type {InputInstance} from 'element-plus'
import {cloneDeep} from 'lodash'
import {MsgWarning} from '@/utils/message'
import {t} from '@/locales'
import { nextTick, ref } from 'vue'
import type { InputInstance } from 'element-plus'
import { cloneDeep } from 'lodash'
import { MsgWarning } from '@/utils/message'
import { t } from '@/locales'
const emit = defineEmits(['refresh'])
const props = defineProps<{ nodeModel: any }>()
@ -301,7 +287,7 @@ const form_data = ref({
function open(data: any) {
dialogVisible.value = true
nextTick(() => {
form_data.value = {...form_data.value, ...data}
form_data.value = { ...form_data.value, ...data }
})
}