refactor: clean up formatting and whitespace in chat-log.ts and EditMarkDialog.vue

This commit is contained in:
wxg0103 2025-07-12 09:50:20 +08:00
parent 4c9d024b67
commit a0e2403e77
2 changed files with 41 additions and 38 deletions

View File

@ -14,6 +14,7 @@ import type { pageRequest } from '@/api/type/common'
import type {ApplicationFormType} from '@/api/type/application' import type {ApplicationFormType} from '@/api/type/application'
import {type Ref} from 'vue' import {type Ref} from 'vue'
import useStore from '@/stores' import useStore from '@/stores'
const prefix: any = {_value: '/workspace/'} const prefix: any = {_value: '/workspace/'}
Object.defineProperty(prefix, 'value', { Object.defineProperty(prefix, 'value', {
get: function () { get: function () {
@ -81,25 +82,21 @@ const getChatRecordLog: (
/** /**
* *
* @param * @param
* application_id, chart_id, chart_record_id, knowledge_id, document_id * application_id, chart_id, chart_record_id
*/ */
const getMarkChatRecord: ( const getMarkChatRecord: (
application_id: String, application_id: string,
chart_id: String, chart_id: string,
chart_record_id: String, chart_record_id: string,
knowledge_id: String,
document_id: String,
loading?: Ref<boolean>, loading?: Ref<boolean>,
) => Promise<Result<any>> = ( ) => Promise<Result<any>> = (
application_id, application_id,
chart_id, chart_id,
chart_record_id, chart_record_id,
knowledge_id,
document_id,
loading, loading,
) => { ) => {
return get( return get(
`${prefix.value}/${application_id}/chat/${chart_id}/chat_record/${chart_record_id}/knowledge/${knowledge_id}/document/${document_id}/improve`, `${prefix.value}/${application_id}/chat/${chart_id}/chat_record/${chart_record_id}/improve`,
undefined, undefined,
loading, loading,
) )

View File

@ -12,10 +12,14 @@
<h4 :id="titleId" :class="titleClass">{{ $t('views.chatLog.editMark') }}</h4> <h4 :id="titleId" :class="titleClass">{{ $t('views.chatLog.editMark') }}</h4>
<div class="text-right"> <div class="text-right">
<el-button text @click="isEdit = true" v-if="!isEdit"> <el-button text @click="isEdit = true" v-if="!isEdit">
<el-icon><EditPen /></el-icon> <el-icon>
<EditPen/>
</el-icon>
</el-button> </el-button>
<el-button text style="margin-left: 4px" @click="deleteMark"> <el-button text style="margin-left: 4px" @click="deleteMark">
<el-icon><Delete /></el-icon> <el-icon>
<Delete/>
</el-icon>
</el-button> </el-button>
<el-divider direction="vertical"/> <el-divider direction="vertical"/>
</div> </div>
@ -116,8 +120,9 @@ function deleteMark() {
} }
function getMark(data: any) { function getMark(data: any) {
console.log(data)
chatLogApi chatLogApi
.getMarkChatRecord(id as string, data.chat_id, data.id, data.knowledge, data.document, loading) .getMarkChatRecord(id as string, data.chat_id, data.id, loading)
.then((res: any) => { .then((res: any) => {
if (res.data.length > 0) { if (res.data.length > 0) {
form.value = res.data[0] form.value = res.data[0]
@ -158,6 +163,7 @@ defineExpose({ open })
.el-dialog__header.show-close { .el-dialog__header.show-close {
padding-right: 15px; padding-right: 15px;
} }
.el-dialog__headerbtn { .el-dialog__headerbtn {
top: 13px; top: 13px;
} }