add help entry and improve link exp

This commit is contained in:
AceDataCloud committed 2023-03-27 23:27:36 +08:00
1 parent 265fe7edf4
commit fcb056bb54
10 files changed
+97 -27

No files matched your search

+8
View File
@@ -47,6 +47,14 @@ body {
overflow: hidden;
}
}
.el-table__header {
width: 100% !important;
}
.el-table__body {
width: 100% !important;
}
}
.color-primary {
+24
View File
@@ -0,0 +1,24 @@
<template>
<div>
<el-tooltip effect="dark" :content="`${$t('common.message.helpWechat')}「sunbitty」`" placement="top-start">
<el-button type="primary" circle size="large">
<font-awesome-icon icon="fa-solid fa-question" />
</el-button>
</el-tooltip>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { ElTooltip, ElButton } from 'element-plus';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
export default defineComponent({
name: 'HelpEntry',
components: {
ElTooltip,
ElButton,
FontAwesomeIcon
}
});
</script>
+8 -12
View File
@@ -1,7 +1,12 @@
<template>
<el-form label-width="100px">
<el-form-item v-if="application?.api?.title" :label="$t('application.field.service')">
{{ application?.api?.title }}
<el-form-item :label="$t('application.field.service')">
<span v-if="application.type === applicationType.API">
{{ application?.api?.title }}
</span>
<span v-if="application.type === applicationType.PROXY">
{{ application?.proxy?.title }}
</span>
</el-form-item>
<el-form-item :label="$t('application.field.package')">
<el-radio-group v-if="application.type === applicationType.API" v-model="form.packageId">
@@ -56,16 +61,7 @@ import { IApplication, IApplicationType, IOrderDetailResponse, IPackage, orderOp
import { defineComponent } from 'vue';
import { ElMessage } from 'element-plus';
import { ROUTE_CONSOLE_ORDER_DETAIL } from '@/router';
import {
ElDialog,
ElForm,
ElFormItem,
ElButton,
ElInputNumber,
ElDivider,
ElRadioGroup,
ElRadioButton
} from 'element-plus';
import { ElForm, ElFormItem, ElButton, ElInputNumber, ElDivider, ElRadioGroup, ElRadioButton } from 'element-plus';
import Price from '@/components/common/Price.vue';
interface IData {
+2 -1
View File
@@ -4,5 +4,6 @@ export default {
alert: '警告',
info: '温馨提示',
free: '免费',
startPrice: '起'
startPrice: '起',
helpWechat: '客服微信'
};
+10 -1
View File
@@ -13,6 +13,7 @@
</el-col>
</el-row>
</el-main>
<help-entry class="help" />
<el-footer class="footer">
<bottom-footer />
</el-footer>
@@ -24,6 +25,7 @@ import TopHeader from '@/components/common/TopHeader.vue';
import BottomFooter from '@/components/common/BottomFooter.vue';
import DocumentList from '@/components/document/List.vue';
import { ElContainer, ElMain, ElFooter, ElHeader, ElRow, ElCol } from 'element-plus';
import HelpEntry from '@/components/common/HelpEntry.vue';
export default {
name: 'LayoutCourse',
@@ -36,7 +38,8 @@ export default {
ElFooter,
ElHeader,
ElRow,
ElCol
ElCol,
HelpEntry
}
};
</script>
@@ -67,4 +70,10 @@ export default {
}
}
}
.help {
position: fixed;
right: 40px;
bottom: 40px;
}
</style>
+10 -1
View File
@@ -4,6 +4,7 @@
<top-header />
</el-header>
<el-main class="main"> <router-view /> </el-main>
<help-entry class="help" />
<el-footer class="footer">
<bottom-footer />
</el-footer>
@@ -14,6 +15,7 @@
import TopHeader from '@/components/common/TopHeader.vue';
import BottomFooter from '@/components/common/BottomFooter.vue';
import { ElContainer, ElMain, ElFooter, ElHeader } from 'element-plus';
import HelpEntry from '@/components/common/HelpEntry.vue';
export default {
name: 'LayoutService',
@@ -23,7 +25,8 @@ export default {
ElContainer,
ElMain,
ElFooter,
ElHeader
ElHeader,
HelpEntry
}
};
</script>
@@ -37,4 +40,10 @@ export default {
padding: 0;
height: initial;
}
.help {
position: fixed;
right: 40px;
bottom: 40px;
}
</style>
+1
View File
@@ -17,6 +17,7 @@ export interface IProxy {
applied_count?: number;
free_amount?: number;
applied?: boolean;
application_id?: string;
tags?: string[];
document?: IDocument;
document_id?: string;
+2 -2
View File
@@ -13,7 +13,7 @@
<el-menu-item :index="applicationType.API">{{ $t('application.field.api') }}</el-menu-item>
<el-menu-item :index="applicationType.PROXY">{{ $t('application.field.proxy') }}</el-menu-item>
</el-menu>
<el-table v-loading="loading" :data="applications" stripe>
<el-table v-loading="loading" :data="applications" stripe table-layout="fixed">
<el-table-column prop="id" :label="$t('application.field.id')" width="350px" class-name="text-center">
<template #default="scope">
<span>{{ scope.row.id }}</span>
@@ -71,7 +71,7 @@
</div>
</template>
</el-table-column>
<el-table-column min-width="300px">
<el-table-column fixed="right" width="220px">
<template #default="scope">
<div class="float-right">
<el-button v-if="scope.row?.api?.document_id" @click="onGoDocument(scope?.row)">
+30 -10
View File
@@ -69,11 +69,11 @@
</el-button>
</div>
<div v-else>
<el-button disabled>
{{ $t('common.button.applied') }}
<el-button v-if="api?.document_id" @click="onGoDocument(api?.document_id!)">
{{ $t('application.button.goDocument') }}
</el-button>
<el-button v-if="api?.application_id" type="primary" @click="onBuyMore(api?.application_id!)">
{{ $t('common.button.buyMore') }}
{{ $t('application.button.buyMore') }}
</el-button>
</div>
</el-col>
@@ -92,12 +92,19 @@
<proxy-preview :proxy="proxy" />
</el-col>
<el-col :span="4" class="operations">
<el-button v-if="!proxy.applied" type="primary" @click="onConfirm(proxy, applicationType.PROXY)">
{{ $t('common.button.apply') }}
</el-button>
<el-button v-else disabled type="primary">
{{ $t('common.button.applied') }}
</el-button>
<div v-if="!proxy.applied">
<el-button type="primary" @click="onConfirm(proxy, applicationType.PROXY)">
{{ $t('common.button.apply') }}
</el-button>
</div>
<div v-else>
<el-button v-if="proxy?.document_id" @click="onGoDocument(proxy?.document_id!)">
{{ $t('application.button.goDocument') }}
</el-button>
<el-button v-if="proxy?.application_id" type="primary" @click="onBuyMore(proxy?.application_id!)">
{{ $t('application.button.buyMore') }}
</el-button>
</div>
</el-col>
</el-row>
<el-divider v-if="proxyIndex < apis.length - 1" />
@@ -133,7 +140,12 @@ import { apiOperator } from '@/operators/api/operator';
import { IApi, IApiListResponse } from '@/operators/api/models';
import { IApplicationType } from '@/operators/application/models';
import MarkdownRenderer from '@/components/common/MarkdownRenderer.vue';
import { ROUTE_AUTH_LOGIN, ROUTE_CONSOLE_APPLICATION_BUY, ROUTE_CONSOLE_APPLICATION_LIST } from '@/router';
import {
ROUTE_AUTH_LOGIN,
ROUTE_CONSOLE_APPLICATION_BUY,
ROUTE_CONSOLE_APPLICATION_LIST,
ROUTE_DOCUMENT_DETAIL
} from '@/router';
import { ElCol, ElRow, ElButton, ElCard, ElDivider, ElSkeleton, ElSkeletonItem } from 'element-plus';
import ApiPreview from '@/components/api/Preview.vue';
import ProxyPreview from '@/components/proxy/Preview.vue';
@@ -262,6 +274,14 @@ export default defineComponent({
this.confirm.object = obj;
this.confirm.type = type;
},
onGoDocument(documentId: string) {
this.$router.push({
name: ROUTE_DOCUMENT_DETAIL,
params: {
id: documentId
}
});
},
onApply(obj: IApi | IProxy, type: IApplicationType) {
applicationOperator
.create({
+2
View File
@@ -9,6 +9,7 @@ import {
faCheck as faSolidCheck,
faCube as faSolidCube,
faStore as faSolidStore,
faQuestion as faSolidQuestion,
faArrowsRotate as faSolidArrowsRotate,
faUpRightFromSquare as faSolidUpRightFromSquare
} from '@fortawesome/free-solid-svg-icons';
@@ -20,5 +21,6 @@ library.add(faRegularUser);
library.add(faRegularIdCard);
library.add(faSolidCube);
library.add(faSolidStore);
library.add(faSolidQuestion);
library.add(faSolidUpRightFromSquare);
library.add(faSolidArrowsRotate);