Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="ai-chat__operate p-16-24">
<slot name="operateBefore" />
<div class="operate-textarea flex chat-width">
<div class="operate-textarea flex">
<el-input
ref="quickInputRef"
v-model="inputValue"
Expand Down Expand Up @@ -62,7 +62,7 @@
</div>
</div>
<div
class="chat-width text-center"
class="text-center"
v-if="applicationDetails.disclaimer"
style="margin-top: 8px"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ const prologue = computed(() => {
const temp = props.available
? props.application?.prologue
: '抱歉,当前正在维护,无法提供服务,请稍后再试!'
return temp.replace(/-\s.+/g, toQuickQuestion)
return temp?.replace(/-\s.+/g, toQuickQuestion)
})
</script>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>
2 changes: 1 addition & 1 deletion ui/src/components/ai-chat/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
ref="userFormRef"
></UserForm>
<el-scrollbar ref="scrollDiv" @scroll="handleScrollTop">
<div ref="dialogScrollbar" class="ai-chat__content p-24 chat-width">
<div ref="dialogScrollbar" class="ai-chat__content p-24">
<PrologueContent
:type="type"
:application="applicationDetails"
Expand Down
7 changes: 0 additions & 7 deletions ui/src/router/modules/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ const applicationRouter = {
name: 'application',
component: () => import('@/views/application/index.vue')
},
{
path: '/application/create',
name: 'CreateApplication',
meta: { activeMenu: '/application' },
component: () => import('@/views/application/CreateAndSetting.vue'),
hidden: true
},
{
path: '/application/:id/:type',
name: 'ApplicationDetail',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

该代码没有错误或明显问题,但是可以进行一些简化和格式化:

const applicationRouter = {
  name: 'application',
  // ...其他部分...
};

// 隐式路由设置中可省略`name`: '...'

无需修改,保持简洁。

Expand Down
2 changes: 1 addition & 1 deletion ui/src/router/modules/dataset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const datasetRouter = {
component: () => import('@/views/dataset/index.vue')
},
{
path: '/dataset/:type', // create 或者 upload
path: '/dataset/:type', // upload
name: 'UploadDocumentDataset',
meta: { activeMenu: '/dataset' },
component: () => import('@/views/dataset/UploadDocumentDataset.vue'),
Expand Down
25 changes: 17 additions & 8 deletions ui/src/views/application/ApplicationSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,13 @@
<AppAvatar v-else class="mr-8 avatar-blue" shape="square" :size="32">
<img src="@/assets/icon_document.svg" style="width: 58%" alt="" />
</AppAvatar>
<auto-tooltip
:content="relatedObject(datasetList, item, 'id')?.name"
style="width: 80%"

<span
class="ellipsis cursor"
:title="relatedObject(datasetList, item, 'id')?.name"
>
{{ relatedObject(datasetList, item, 'id')?.name }}</span
>
{{ relatedObject(datasetList, item, 'id')?.name }}
</auto-tooltip>
</div>
<el-button text @click="removeDataset(item)">
<el-icon>
Expand Down Expand Up @@ -326,7 +327,11 @@
<AppIcon iconName="app-warning" class="app-warning-icon"></AppIcon>
</el-tooltip> -->
</div>
<el-switch size="small" v-model="applicationForm.stt_model_enable" @change="sttModelEnableChange"/>
<el-switch
size="small"
v-model="applicationForm.stt_model_enable"
@change="sttModelEnableChange"
/>
</div>
</template>
<el-select
Expand Down Expand Up @@ -406,7 +411,11 @@
<el-icon class="mr-4"><Setting /></el-icon>
设置
</el-button>
<el-switch size="small" v-model="applicationForm.tts_model_enable" @change="ttsModelEnableChange"/>
<el-switch
size="small"
v-model="applicationForm.tts_model_enable"
@change="ttsModelEnableChange"
/>
</div>
</div>
</template>
Expand Down Expand Up @@ -527,7 +536,7 @@
</h4>
</div>
<div class="scrollbar-height">
<AiChat :data="applicationForm"></AiChat>
<AiChat :applicationDetails="applicationForm"></AiChat>
</div>
</div>
</el-col>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

该问题没有明显的编码错误或显而易见的问题。但是,我可以提出一些建议以提高其可读性和性能:

<div class="container" style="padding: 3rem;">
   <!-- Add a container for the data grid and related info -->
</div>

...

<!-- Apply margin styles to align content with containers -->

以上代码已经比较整齐、格式化良好。如果要继续进行优化,请告诉我具体需求,例如调整布局样式或增强某些功能。

此代码在项目中可能看起来非常整洁和结构清晰,但在不同的开发者手中可能会显得杂乱无章,并且不适合编写多个组件。为了保持项目的整体性并避免过大的变化,推荐在重构时考虑对现有结构的一致性更改。

如果您想进一步改进它的外观,可以使用CSS样式来设置更丰富的颜色、字体等视觉元素。当然,这些修改也应与项目整体风格相符。
在这个例子中,我并未发现任何显性的潜在缺陷或改进建议,因为整个页面已按照标准HTML/CSS架构实现,所有标签都符合现代web开发的最佳实践要求。

Expand Down
Loading
Loading