Improve experience for Chatdoc (#4)
This commit is contained in:
1 parent
13e6918fa9
commit
0de86f2e09
68 files changed
+821
-117
No files matched your search
@@ -187,7 +187,8 @@ export default defineComponent({
|
||||
this.messages[this.messages.length - 1].state = IChatdocMessageState.FINISHED;
|
||||
await this.$store.dispatch('chatdoc/setConversation', {
|
||||
id: conversationId,
|
||||
messages: this.messages
|
||||
messages: this.messages,
|
||||
repositoryId: this.repositoryId
|
||||
});
|
||||
this.answering = false;
|
||||
if (!this.conversationId) {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<upload-document />
|
||||
</div>
|
||||
<div class="documents">
|
||||
<el-table :data="documents" border>
|
||||
<el-table v-loading="loading" :data="documents" border>
|
||||
<el-table-column prop="id" label="ID" />
|
||||
<el-table-column prop="file_name" :label="$t('chatdoc.field.fileName')" />
|
||||
<el-table-column :label="$t('chatdoc.field.fileExtension')">
|
||||
@@ -49,7 +49,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column>
|
||||
<template #default="scope">
|
||||
<el-button type="danger" @click="onDelete(scope.row.id)">
|
||||
<el-button type="danger" size="small" @click="onDelete(scope.row.id)">
|
||||
{{ $t('common.button.delete') }}
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -64,7 +64,7 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import Layout from '@/layouts/Chatdoc.vue';
|
||||
import { IApplication, IChatdocRepository } from '@/models';
|
||||
import { IChatdocRepository } from '@/models';
|
||||
import { ElButton, ElTag, ElTable, ElTableColumn, ElMessage } from 'element-plus';
|
||||
import UploadDocument from '@/components/chatdoc/UploadDocument.vue';
|
||||
import { Status } from '@/models';
|
||||
|
||||
@@ -63,13 +63,7 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import {
|
||||
applicationOperator,
|
||||
IApplication,
|
||||
IApplicationDetailResponse,
|
||||
IOrderDetailResponse,
|
||||
orderOperator
|
||||
} from '@/operators';
|
||||
import { IApplication, IApplicationDetailResponse, IOrderDetailResponse } from '@/models';
|
||||
import {
|
||||
ElRow,
|
||||
ElCol,
|
||||
@@ -85,6 +79,7 @@ import {
|
||||
} from 'element-plus';
|
||||
import { ROUTE_CONSOLE_ORDER_DETAIL } from '@/router';
|
||||
import Price from '@/components/common/Price.vue';
|
||||
import { applicationOperator, orderOperator } from '@/operators';
|
||||
|
||||
interface IData {
|
||||
application: IApplication | undefined;
|
||||
|
||||
@@ -69,9 +69,9 @@ import { defineComponent } from 'vue';
|
||||
import { applicationOperator } from '@/operators';
|
||||
import Pagination from '@/components/common/Pagination.vue';
|
||||
import CopyToClipboard from '@/components/common/CopyToClipboard.vue';
|
||||
import { ElTable, ElRow, ElCol, ElTableColumn } from 'element-plus';
|
||||
import { ElTable, ElRow, ElCol, ElTableColumn, ElCard } from 'element-plus';
|
||||
import { ROUTE_CONSOLE_APPLICATION_BUY } from '@/router/constants';
|
||||
import { IApplication, IApplicationListResponse, IService } from '@/models';
|
||||
import { IApplication, IApplicationListResponse, ICredentialType, IService } from '@/models';
|
||||
|
||||
interface IData {
|
||||
applications: IApplication[];
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<h2 class="title">{{ $t('common.title.distribution') }}</h2>
|
||||
<p class="message mb-4">
|
||||
{{ $t('distribution.message.distributionDescription') }}
|
||||
</p>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="15">
|
||||
@@ -19,9 +16,9 @@
|
||||
</div>
|
||||
<div class="text-left">
|
||||
<p class="description">{{ $t('distribution.title.price') }}</p>
|
||||
<p class="value">¥{{ distributionStatus?.price?.toFixed(2) }}</p>
|
||||
<p class="value">${{ distributionStatus?.price?.toFixed(2) }}</p>
|
||||
</div>
|
||||
<el-button type="primary" class="btn" @click="goHistory"
|
||||
<el-button type="primary" size="small" class="btn" @click="goHistory"
|
||||
>{{ $t('distribution.button.detail') }}
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -36,10 +33,12 @@
|
||||
</div>
|
||||
<div class="text-left">
|
||||
<p class="description">{{ $t('distribution.title.reward') }}</p>
|
||||
<p class="value">¥{{ distributionStatus?.reward?.toFixed(2) }}</p>
|
||||
<p class="value">${{ distributionStatus?.reward?.toFixed(2) }}</p>
|
||||
</div>
|
||||
<el-tooltip effect="dark" :content="$t('distribution.message.howToWithdrawal')" placement="top">
|
||||
<el-button type="primary" class="btn">{{ $t('distribution.button.withdrawal') }} </el-button>
|
||||
<el-tooltip effect="dark" :content="$t('distribution.message.developingWithDrawal')" placement="top">
|
||||
<el-button type="primary" size="small" class="btn"
|
||||
>{{ $t('distribution.button.withdrawal') }}
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</el-card>
|
||||
@@ -69,7 +68,7 @@
|
||||
<p class="description">{{ $t('distribution.title.inviteesCount') }}</p>
|
||||
<p class="value">{{ inviteesCount }}</p>
|
||||
</div>
|
||||
<el-button type="primary" class="btn" @click="goInvitees"
|
||||
<el-button type="primary" size="small" class="btn" @click="goInvitees"
|
||||
>{{ $t('distribution.button.detail') }}
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -77,6 +76,60 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="15">
|
||||
<el-col :md="12" :xs="24">
|
||||
<el-card shadow="hover" class="level-info mb-4">
|
||||
<el-skeleton v-if="loading" />
|
||||
<div v-else>
|
||||
<h4 class="title">
|
||||
{{ $t('distribution.title.levelInfo') }}
|
||||
</h4>
|
||||
<div class="clear-both overflow-hidden">
|
||||
<div class="float-left description">
|
||||
<p>{{ $t('distribution.title.currentLevel') }}: L{{ distributionStatus?.level?.level }}</p>
|
||||
<p>
|
||||
{{ $t('distribution.title.currentPercentage') }}:
|
||||
{{ distributionLevelMap[distributionStatus?.level?.level!]?.percentage }}%
|
||||
</p>
|
||||
</div>
|
||||
<div class="float-right description">
|
||||
<p>{{ $t('distribution.title.nextLevel') }}: L{{ distributionStatus?.level?.level! + 1 }}</p>
|
||||
<p>
|
||||
{{ $t('distribution.title.nextPercentage') }}:
|
||||
{{ distributionLevelMap[distributionStatus?.level?.level! + 1]?.percentage }}%
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<el-progress
|
||||
:text-inside="true"
|
||||
:stroke-width="20"
|
||||
:percentage="getPercentageForNextLevel()"
|
||||
class="mb-2"
|
||||
>
|
||||
</el-progress>
|
||||
<p class="description">
|
||||
{{ $t('distribution.message.deltaPriceForNextLevel') }}: ${{ getDeltaForNextLevel() }}
|
||||
</p>
|
||||
<el-divider />
|
||||
<el-table v-if="distributionLevels" :data="distributionLevels" stripe>
|
||||
<el-table-column :label="$t('distribution.field.level')">
|
||||
<template #default="scope">
|
||||
<span class="level">L{{ scope.row?.level }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('distribution.field.threshold')">
|
||||
<template #default="scope">
|
||||
<span class="level">${{ scope.row?.threshold }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('distribution.field.percentage')">
|
||||
<template #default="scope">
|
||||
<span class="level">{{ scope.row?.percentage }}%</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :md="12" :xs="24">
|
||||
<el-card shadow="hover" class="distribution-info mb-4">
|
||||
<el-skeleton v-if="loading" />
|
||||
@@ -84,7 +137,7 @@
|
||||
<h4 class="title">
|
||||
{{ $t('distribution.title.distributionLink') }}
|
||||
</h4>
|
||||
<el-divider class="mt-4 mb-4" />
|
||||
<el-divider />
|
||||
<div class="link-wrapper">
|
||||
<font-awesome-icon v-if="false" icon="fa-solid fa-link" class="icon" />
|
||||
<a :href="distributionLink" class="link">
|
||||
@@ -92,14 +145,9 @@
|
||||
</a>
|
||||
<copy-to-clipboard :content="distributionLink" />
|
||||
</div>
|
||||
<div class="qr-wrapper">
|
||||
<qr-code
|
||||
v-if="distributionLink"
|
||||
:value="distributionLink"
|
||||
:size="150"
|
||||
class="block mb-2 ml-auto mr-auto"
|
||||
/>
|
||||
<p>
|
||||
<div class="qr-wrapper ml-auto mr-auto">
|
||||
<qr-code v-if="distributionLink" :value="distributionLink" :size="150" class="mb-2 ml-auto mr-auto" />
|
||||
<p class="mt-0">
|
||||
{{ $t('distribution.message.distributionQrDescription') }}
|
||||
</p>
|
||||
</div>
|
||||
@@ -118,65 +166,6 @@
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :md="12" :xs="24">
|
||||
<el-card shadow="hover" class="level-info mb-4">
|
||||
<el-skeleton v-if="loading" />
|
||||
<div v-else>
|
||||
<h4 class="title">
|
||||
{{ $t('distribution.title.levelInfo') }}
|
||||
</h4>
|
||||
<el-divider class="mt-4 mb-4" />
|
||||
<div class="clear-both overflow-hidden">
|
||||
<div class="float-left description">
|
||||
<p class="mt-0">
|
||||
{{ $t('distribution.title.currentLevel') }}: L{{ distributionStatus?.level?.level }}
|
||||
</p>
|
||||
<p class="mt-0">
|
||||
{{ $t('distribution.title.currentPercentage') }}:
|
||||
{{ distributionLevelMap[distributionStatus?.level?.level!]?.percentage }}%
|
||||
</p>
|
||||
</div>
|
||||
<div class="float-right description">
|
||||
<p class="mt-0">
|
||||
{{ $t('distribution.title.nextLevel') }}: L{{ distributionStatus?.level?.level! + 1 }}
|
||||
</p>
|
||||
<p class="mt-0">
|
||||
{{ $t('distribution.title.nextPercentage') }}:
|
||||
{{ distributionLevelMap[distributionStatus?.level?.level! + 1]?.percentage }}%
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<el-progress
|
||||
:text-inside="true"
|
||||
:stroke-width="20"
|
||||
:percentage="getPercentageForNextLevel()"
|
||||
class="mb-2"
|
||||
>
|
||||
</el-progress>
|
||||
<p class="description">
|
||||
{{ $t('distribution.message.deltaPriceForNextLevel') }}: ¥{{ getDeltaForNextLevel() }}
|
||||
</p>
|
||||
<el-divider />
|
||||
<el-table v-if="distributionLevels" :data="distributionLevels" stripe>
|
||||
<el-table-column :label="$t('distribution.field.level')">
|
||||
<template #default="scope">
|
||||
<span class="level">L{{ scope.row?.level }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('distribution.field.threshold')">
|
||||
<template #default="scope">
|
||||
<span class="level">¥{{ scope.row?.threshold }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('distribution.field.percentage')">
|
||||
<template #default="scope">
|
||||
<span class="level">{{ scope.row?.percentage }}%</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
Reference in new issue
Block a user