Merge branch 'main' of github.com:maxkb-dev/maxkb

This commit is contained in:
shaohuzhang1 2023-12-12 17:22:28 +08:00
commit 1f5b0d3616
5 changed files with 18 additions and 8 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -1,4 +1,10 @@
<template> <template>
<div>
<el-text type="info">
消耗: {{ data?.message_tokens + data?.answer_tokens }} tokens
<span class="ml-4">{{ datetimeFormat(data.create_time) }}</span>
</el-text>
</div>
<div> <div>
<el-tooltip effect="dark" content="修改内容" placement="top"> <el-tooltip effect="dark" content="修改内容" placement="top">
<el-button text @click="editContent(data)"> <el-button text @click="editContent(data)">
@ -26,6 +32,7 @@
import { reactive, ref, watch, onMounted } from 'vue' import { reactive, ref, watch, onMounted } from 'vue'
import { copyClick } from '@/utils/clipboard' import { copyClick } from '@/utils/clipboard'
import EditContentDialog from '@/views/log/component/EditContentDialog.vue' import EditContentDialog from '@/views/log/component/EditContentDialog.vue'
import { datetimeFormat } from '@/utils/time'
const props = defineProps({ const props = defineProps({
data: { data: {

View File

@ -68,9 +68,6 @@
></MarkdownRenderer> ></MarkdownRenderer>
</el-card> </el-card>
<div class="flex-between mt-8" v-if="log"> <div class="flex-between mt-8" v-if="log">
<el-text type="info">
消耗 {{ item?.message_tokens + item?.answer_tokens }} tokens
</el-text>
<LogOperationButton :data="item" :applicationId="appId" /> <LogOperationButton :data="item" :applicationId="appId" />
</div> </div>

View File

@ -5,7 +5,7 @@
<el-progress v-bind="$attrs" :percentage="row[value_field]"></el-progress <el-progress v-bind="$attrs" :percentage="row[value_field]"></el-progress
></template> ></template>
<div> <div>
<el-row v-for="item in view_card" <el-row v-for="(item, index) in view_card" :key="index"
><el-col :span="6">{{ item.title }}</el-col ><el-col :span="6">{{ item.title }}</el-col
><el-col :span="18"> <span class="value" :innerHTML="value_html(item)"> </span></el-col ><el-col :span="18"> <span class="value" :innerHTML="value_html(item)"> </span></el-col
></el-row> ></el-row>

View File

@ -26,8 +26,14 @@
</template> </template>
<div class="create-dataset__main flex" v-loading="loading"> <div class="create-dataset__main flex" v-loading="loading">
<div class="create-dataset__component main-calc-height"> <div class="create-dataset__component main-calc-height">
<template v-if="steps[active]?.component"> <!-- <template v-if="steps[active]?.component">
<component :is="steps[active].component" :ref="steps[active]?.ref" /> <component :is="steps[active].component" :ref="steps[active]?.ref" />
</template> -->
<template v-if="active === 0">
<StepFirst ref="StepFirstRef" />
</template>
<template v-else-if="active === 1">
<StepSecond ref="StepSecondRef" />
</template> </template>
<template v-else-if="active === 2"> <template v-else-if="active === 2">
<ResultSuccess :data="successInfo" /> <ResultSuccess :data="successInfo" />
@ -47,7 +53,7 @@
</LayoutContainer> </LayoutContainer>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed } from 'vue' import { ref, computed, nextTick } from 'vue'
import { useRouter, useRoute } from 'vue-router' import { useRouter, useRoute } from 'vue-router'
import StepFirst from './step/StepFirst.vue' import StepFirst from './step/StepFirst.vue'
import StepSecond from './step/StepSecond.vue' import StepSecond from './step/StepSecond.vue'
@ -89,7 +95,7 @@ const active = ref(0)
const successInfo = ref<any>(null) const successInfo = ref<any>(null)
async function next() { async function next() {
if (await StepFirstRef.value.onSubmit()) { if (await StepFirstRef.value?.onSubmit()) {
if (active.value++ > 2) active.value = 0 if (active.value++ > 2) active.value = 0
} }
} }
@ -104,7 +110,7 @@ function clearStore() {
function submit() { function submit() {
loading.value = true loading.value = true
const documents = [] as any[] const documents = [] as any[]
StepSecondRef.value.paragraphList.map((item: any) => { StepSecondRef.value?.paragraphList.map((item: any) => {
documents.push({ documents.push({
name: item.name, name: item.name,
paragraphs: item.content paragraphs: item.content