Skip to content

Commit a0e2403

Browse files
committed
refactor: clean up formatting and whitespace in chat-log.ts and EditMarkDialog.vue
1 parent 4c9d024 commit a0e2403

File tree

2 files changed

+41
-38
lines changed

2 files changed

+41
-38
lines changed

ui/src/api/application/chat-log.ts

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Result } from '@/request/Result'
1+
import {Result} from '@/request/Result'
22
import {
33
get,
44
post,
@@ -10,14 +10,15 @@ import {
1010
download,
1111
exportFile,
1212
} from '@/request/index'
13-
import type { pageRequest } from '@/api/type/common'
14-
import type { ApplicationFormType } from '@/api/type/application'
15-
import { type Ref } from 'vue'
13+
import type {pageRequest} from '@/api/type/common'
14+
import type {ApplicationFormType} from '@/api/type/application'
15+
import {type Ref} from 'vue'
1616
import useStore from '@/stores'
17-
const prefix: any = { _value: '/workspace/' }
17+
18+
const prefix: any = {_value: '/workspace/'}
1819
Object.defineProperty(prefix, 'value', {
1920
get: function () {
20-
const { user } = useStore()
21+
const {user} = useStore()
2122
return this._value + user.getWorkspaceId() + '/application'
2223
},
2324
})
@@ -42,9 +43,9 @@ const postChatLogAddKnowledge: (
4243
* @param 参数
4344
* application_id
4445
* param {
45-
"start_time": "string",
46-
"end_time": "string",
47-
}
46+
"start_time": "string",
47+
"end_time": "string",
48+
}
4849
*/
4950
const getChatLog: (
5051
application_id: String,
@@ -73,33 +74,29 @@ const getChatRecordLog: (
7374
) => Promise<Result<any>> = (application_id, chart_id, page, loading, order_asc) => {
7475
return get(
7576
`${prefix.value}/${application_id}/chat/${chart_id}/chat_record/${page.current_page}/${page.page_size}`,
76-
{ order_asc: order_asc !== undefined ? order_asc : true },
77+
{order_asc: order_asc !== undefined ? order_asc : true},
7778
loading,
7879
)
7980
}
8081

8182
/**
8283
* 获取标注段落列表信息
8384
* @param 参数
84-
* application_id, chart_id, chart_record_id, knowledge_id, document_id
85+
* application_id, chart_id, chart_record_id
8586
*/
8687
const getMarkChatRecord: (
87-
application_id: String,
88-
chart_id: String,
89-
chart_record_id: String,
90-
knowledge_id: String,
91-
document_id: String,
88+
application_id: string,
89+
chart_id: string,
90+
chart_record_id: string,
9291
loading?: Ref<boolean>,
9392
) => Promise<Result<any>> = (
9493
application_id,
9594
chart_id,
9695
chart_record_id,
97-
knowledge_id,
98-
document_id,
9996
loading,
10097
) => {
10198
return get(
102-
`${prefix.value}/${application_id}/chat/${chart_id}/chat_record/${chart_record_id}/knowledge/${knowledge_id}/document/${document_id}/improve`,
99+
`${prefix.value}/${application_id}/chat/${chart_id}/chat_record/${chart_record_id}/improve`,
103100
undefined,
104101
loading,
105102
)
@@ -110,10 +107,10 @@ const getMarkChatRecord: (
110107
* @param 参数
111108
* application_id, chart_id, chart_record_id, knowledge_id, document_id
112109
* data {
113-
"title": "string",
114-
"content": "string",
115-
"problem_text": "string"
116-
}
110+
"title": "string",
111+
"content": "string",
112+
"problem_text": "string"
113+
}
117114
*/
118115
const putChatRecordLog: (
119116
application_id: String,
@@ -175,9 +172,9 @@ const delMarkChatRecord: (
175172
* @param 参数
176173
* application_id
177174
* param {
178-
"start_time": "string",
179-
"end_time": "string",
180-
}
175+
"start_time": "string",
176+
"end_time": "string",
177+
}
181178
*/
182179
const postExportChatLog: (
183180
application_id: string,

ui/src/views/chat-log/component/EditMarkDialog.vue

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@
1212
<h4 :id="titleId" :class="titleClass">{{ $t('views.chatLog.editMark') }}</h4>
1313
<div class="text-right">
1414
<el-button text @click="isEdit = true" v-if="!isEdit">
15-
<el-icon><EditPen /></el-icon>
15+
<el-icon>
16+
<EditPen/>
17+
</el-icon>
1618
</el-button>
1719
<el-button text style="margin-left: 4px" @click="deleteMark">
18-
<el-icon><Delete /></el-icon>
20+
<el-icon>
21+
<Delete/>
22+
</el-icon>
1923
</el-button>
20-
<el-divider direction="vertical" />
24+
<el-divider direction="vertical"/>
2125
</div>
2226
</div>
2327
</template>
@@ -60,17 +64,17 @@
6064
</el-dialog>
6165
</template>
6266
<script setup lang="ts">
63-
import { ref, watch, reactive } from 'vue'
64-
import { useRoute } from 'vue-router'
65-
import type { FormInstance, FormRules } from 'element-plus'
67+
import {ref, watch, reactive} from 'vue'
68+
import {useRoute} from 'vue-router'
69+
import type {FormInstance, FormRules} from 'element-plus'
6670
import chatLogApi from '@/api/application/chat-log'
6771
import paragraphApi from '@/api/knowledge/paragraph'
68-
import { t } from '@/locales'
69-
import { MsgSuccess, MsgConfirm } from '@/utils/message'
72+
import {t} from '@/locales'
73+
import {MsgSuccess, MsgConfirm} from '@/utils/message'
7074
7175
const route = useRoute()
7276
const {
73-
params: { id },
77+
params: {id},
7478
} = route as any
7579
7680
const emit = defineEmits(['refresh'])
@@ -86,7 +90,7 @@ const detail = ref<any>({})
8690
8791
const rules = reactive<FormRules>({
8892
content: [
89-
{ required: true, message: t('views.chatLog.form.content.placeholder'), trigger: 'blur' },
93+
{required: true, message: t('views.chatLog.form.content.placeholder'), trigger: 'blur'},
9094
],
9195
})
9296
@@ -116,8 +120,9 @@ function deleteMark() {
116120
}
117121
118122
function getMark(data: any) {
123+
console.log(data)
119124
chatLogApi
120-
.getMarkChatRecord(id as string, data.chat_id, data.id, data.knowledge, data.document, loading)
125+
.getMarkChatRecord(id as string, data.chat_id, data.id, loading)
121126
.then((res: any) => {
122127
if (res.data.length > 0) {
123128
form.value = res.data[0]
@@ -151,13 +156,14 @@ const submit = async (formEl: FormInstance) => {
151156
})
152157
}
153158
154-
defineExpose({ open })
159+
defineExpose({open})
155160
</script>
156161
<style lang="scss" scoped>
157162
.edit-mark-dialog {
158163
.el-dialog__header.show-close {
159164
padding-right: 15px;
160165
}
166+
161167
.el-dialog__headerbtn {
162168
top: 13px;
163169
}

0 commit comments

Comments
 (0)