refine console applications

This commit is contained in:
AceDataCloud committed 2023-01-23 23:30:57 +08:00
1 parent db10fca5d6
commit 7a8750fd18
10 files changed
+156 -37

No files matched your search

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" data-v-2cb57da0="" version="1.0" viewBox="0 0 340.000000 250.000000" preserveAspectRatio="xMidYMid meet" color-interpolation-filters="sRGB" style="width: 356px;height: 197px;"> <g data-v-2cb57da0="" class="iconmbgsvg" transform="" style="&#10; transform: scale(2.3333) translate(-21px, 0px);&#10;"><g fill="#cfe2f3" hollow-target="textRect"><g mask="url(#ad7efdae-2c7e-4fea-9fed-3d684c16950b)" opacity="1" transform="matrix(1,0,0,1,0,0)"><g><rect fill="#cfe2f3" fill-opacity="0" stroke-width="2" x="0" y="0" width="150" height="105.60182479953254" class="image-rect"/> <svg x="0" y="0" width="150" height="105.60182479953254" filtersec="colorsb4534076794" class="image-svg-svg primary" style="overflow: visible;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 334.6099853515625 235.57000732421875"><path d="M103.19 175.1l13.62 10-69.51 50.47 26.62-81.9 13.65 10-9.7 29.84zM334.61 90H153.08l-11.67 16.08zM123.84 52V0L94.66 89.82l11.62 16.23z" fill="#cfe2f3"/><path d="M123.84 52V0l29.24 90-11.67 16.08zm28.42 87.45l17.56 54.05-120.36-87.45h56.82L94.66 89.82v.16H0l200.38 145.59-48.12-96.12" fill="#1891db"/></svg></svg> <!----></g></g> <g transform="translate(57.30999755859375,54.056854248046875)"><g data-gra="path-name" fill-rule="" class="tp-name" transform="matrix(1,0,0,1,0,0)" opacity="1"><g transform="scale(1)"><g><path d="M23.42 0.44L27.88-31.12 26.26-32.98 44.88-32.98 40.18 0.44 23.42 0.44ZM15.39-34.84L13.96-32.05 25.23-32.05 24.55-27.39 21.27-27.39 18.42-20.87 24.6-20.87 23.91-16.22 16.37-16.22 15.53-14.36 19.01-14.36 22.49 0.44 14.11 0.44 12.35-7.11 9.02 0.44 0.15 0.44 7.5-16.22 1.57-16.22 2.25-20.87 9.55-20.87 12.45-27.39 11.61-27.39 10.19-24.6 2.74-24.6 7.25-33.47 6.08-34.84 15.39-34.84ZM31.56-4.12L33.42-4.12 36.8-28.32 34.94-28.32 31.56-4.12ZM79.58 0.44L76.83-5.05 73.06 0.44 57.23 0.44 56.01-0.69 54.44 0.44 45.13 0.44 51.84-4.46 48.17-7.84 48.8-12.5 46.99-12.5 47.63-17.15 49.44-17.15 49.69-18.72 56.2-18.72 55.96-17.15 60.61-17.15 60.86-18.72 67.38-18.72 67.13-17.15 69.04-17.15 68.4-12.5 66.49-12.5 65.86-7.84 61.2-4.46 65.95-0.05 73.7-11.32 69.43-19.94 76.88-19.94 78.06-17.59 79.67-19.94 79.67-19.99 80.56-26.46 78.79-26.46 77.13-21.8 69.68-21.8 73.89-33.71 72.96-34.84 81.78-34.84 80.46-31.12 90.06-31.12 89.42-26.46 88-26.46 87.12-19.99 81.14-11.32 87.02 0.44 79.58 0.44ZM47.87-19.01L51.45-24.6 48.66-24.6 49.34-29.25 56.79-29.25 57.33-33.03 56.5-34.84 64.09-34.84 63.31-29.25 70.76-29.25 70.07-24.6 67.03-24.6 69.29-19.01 63.7-19.01 62.33-22.39 61.84-19.01 55.32-19.01 55.86-22.74 53.46-19.01 47.87-19.01ZM64.34-30.18L65.81-33.91 71.39-33.91 69.92-30.18 64.34-30.18ZM55.57-33.91L55.96-30.18 50.37-30.18 49.98-33.91 55.57-33.91ZM57.09-8.23L59.68-10.14 59.98-12.5 55.32-12.5 55.03-10.14 57.09-8.23ZM117.5-14.5L126.17-14.5 129.12 0.34 120.44 0.34 120.1-1.27 92.17 0 92.85-5.05 102.02-17.69 91.83-17.69 92.46-22.39 133.53-22.39 132.89-17.69 112.26-17.69 103.63-5.59 119.12-6.32 117.5-14.5ZM97.75-33.96L132.3-33.96 131.61-29.16 97.07-29.16 97.75-33.96Z" transform="translate(-0.15000000596046448, 34.84000015258789)" style="&#10; fill: #606060;&#10;"/></g> <!----> <!----> <!----> <!----> <!----> <!----> <!----></g></g> <g data-gra="path-slogan" fill-rule="" class="tp-slogan" fill="#1891db" transform="matrix(1,0,0,1,12.950004577636719,40.279998779296875)" opacity="1"><!----> <!----> <g transform="scale(1, 1)"><g transform="scale(1)"><path d="M1.59-0.95L6.45-0.95L6.45 0L0.26 0L0.26-0.86L5.07-6.96L0.60-6.96L0.60-7.86L6.45-7.86L6.45-6.96L1.59-0.95ZM9.55-4.64L13.68-4.64L13.68-7.86L14.75-7.86L14.75 0L13.68 0L13.68-3.65L9.55-3.65L9.55 0L8.48 0L8.48-7.86L9.55-7.86L9.55-4.64ZM17.55-7.86L18.63-7.86L18.63 0L17.55 0L17.55-7.86ZM27.19-5.59L27.19-5.59L26.20-5.59Q26.12-7.09 24.23-7.18L24.23-7.18Q22.46-7.13 22.46-5.80L22.46-5.80Q22.46-4.94 23.41-4.81L23.41-4.81L25.64-4.30Q27.41-3.87 27.41-2.15L27.41-2.15Q27.36 0.04 24.31 0.13L24.31 0.13Q22.64 0.13 21.95-0.56L21.95-0.56Q21.09-1.20 21.13-2.54L21.13-2.54L22.16-2.54Q22.21-0.73 24.31-0.69L24.31-0.69Q26.38-0.73 26.42-2.02L26.42-2.02Q26.59-3.09 24.70-3.44L24.70-3.44L23.07-3.78Q21.39-4.25 21.39-5.67L21.39-5.67Q21.52-7.99 24.14-8.08L24.14-8.08Q27.11-8.08 27.19-5.59ZM30.81-4.64L34.94-4.64L34.94-7.86L36.01-7.86L36.01 0L34.94 0L34.94-3.65L30.81-3.65L30.81 0L29.74 0L29.74-7.86L30.81-7.86L30.81-4.64ZM43.84-2.92L43.84-7.86L44.92-7.86L44.92-2.79Q44.79 0.04 41.70 0.13L41.70 0.13Q38.82 0.04 38.69-2.62L38.69-2.62L38.69-7.86L39.76-7.86L39.76-2.92Q39.80-0.77 41.74-0.73L41.74-0.73Q43.84-0.77 43.84-2.92L43.84-2.92ZM53.91-7.86L50.95-3.18L50.95 0L49.87 0L49.87-3.18L46.91-7.86L48.15-7.86L50.39-4.08L52.66-7.86L53.91-7.86ZM61.05-2.92L61.05-7.86L62.13-7.86L62.13-2.79Q62 0.04 58.91 0.13L58.91 0.13Q56.03 0.04 55.90-2.62L55.90-2.62L55.90-7.86L56.97-7.86L56.97-2.92Q57.02-0.77 58.95-0.73L58.95-0.73Q61.05-0.77 61.05-2.92L61.05-2.92ZM66.05-7.86L70.00-1.50L70.00-7.86L71.04-7.86L71.04 0L69.83 0L65.84-6.36L65.79-6.36L65.79 0L64.76 0L64.76-7.86LLine truncated

After

Width:  |  Height:  |  Size: 11 KiB

+3 -2
View File
@@ -2,7 +2,7 @@
<el-pagination
class="mt-3 mb-3"
background
:hide-on-single-page="true"
:hide-on-single-page="false"
layout="prev, pager, next"
:current-page="currentPage"
:total="total"
@@ -24,7 +24,8 @@ export default defineComponent({
props: {
total: {
type: Number,
required: true
required: false,
default: undefined
},
currentPage: {
type: Number,
+16
View File
@@ -1,4 +1,9 @@
<template>
<el-row class="mb-10">
<el-col :span="24">
<img src="@/assets/images/logo2.svg" class="logo" @click="onHome" />
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="links">
@@ -77,12 +82,23 @@ export default defineComponent({
methods: {
onClick(link: string) {
window.location.href = link;
},
onHome() {
this.$router.push({
name: 'home'
});
}
}
});
</script>
<style lang="scss" scoped>
.logo {
width: 300px;
height: 60px;
cursor: pointer;
}
.avatar {
display: block;
margin: 30px auto 20px auto;
+1 -1
View File
@@ -1,4 +1,4 @@
export default {
document: '文档',
goDocument: '查看文档',
buyMore: '购买更多'
};
+4 -1
View File
@@ -1,4 +1,7 @@
export default {
remainingCount: '剩余次数',
apiKey: 'API Key'
usedCount: '已使用次数',
apiKey: 'API Key',
service: '服务',
operation: '操作'
};
+3 -1
View File
@@ -2,5 +2,7 @@ export default {
orderDescription: '知数云课程订单',
documentIntroduction: '文档介绍',
placeholderOfSelect: '请选择',
placeholderOfInput: '请填写'
placeholderOfInput: '请填写',
allApplications: '所有申请',
allOrders: '所有申请'
};
+6 -6
View File
@@ -1,7 +1,4 @@
<template>
<el-header class="header">
<top-header />
</el-header>
<el-container class="container">
<el-aside class="aside">
<navigator />
@@ -13,13 +10,11 @@
<script lang="ts">
import { defineComponent } from 'vue';
import Navigator from '@/components/console/Navigator.vue';
import TopHeader from '@/components/common/TopHeader.vue';
export default defineComponent({
name: 'LayoutConsole',
components: {
Navigator,
TopHeader
Navigator
},
data() {
return {};
@@ -33,6 +28,11 @@ export default defineComponent({
.container {
height: 100vh;
}
.header {
padding: 0;
}
$width: 300px;
.aside {
width: $width;
+2
View File
@@ -4,6 +4,8 @@ import { IApplication, IApplicationDetailResponse, IApplicationListResponse } fr
export interface IApplicationQuery {
user_id: string;
offset: number;
limit: number;
}
class ApplicationOperator {
+116 -16
View File
@@ -1,9 +1,62 @@
<template>
<el-row class="panel">
<el-col :span="24">
<el-row v-for="(application, applicationId) in applications" :key="applicationId">
<el-row>
<el-col :span="24">
<application-preview-card :application="application" />
<h2 class="title">{{ $t('common.title.allApplications') }}</h2>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-card shadow="hover">
<el-table :data="applications" stripe>
<el-table-column :label="$t('application.field.service')" width="200px">
<template #default="scope">
<font-awesome-icon v-if="scope.row?.service?.icon" :icon="scope.row?.service?.icon" />
<span style="margin-left: 10px">{{ scope.row.service?.title }}</span>
</template>
</el-table-column>
<el-table-column
prop="remaining_count"
:label="$t('application.field.remainingCount')"
width="100px"
class-name="text-center"
/>
<el-table-column
prop="used_count"
:label="$t('application.field.usedCount')"
width="100px"
class-name="text-center"
/>
<el-table-column :label="$t('application.field.apiKey')" class-name="api-key">
<template #default="scope">
<span class="key">{{ scope.row.api_key }}</span>
<span class="copy">
<font-awesome-icon icon="fa-regular fa-copy" />
</span>
</template>
</el-table-column>
<el-table-column>
<template #default="scope">
<div class="float-right">
<el-button @click="onGoDocument(scope.row.service)">
{{ $t('application.button.goDocument') }}
</el-button>
<el-button type="primary" @click="onBuyMore(scope.row.service)">
{{ $t('application.button.buyMore') }}
</el-button>
</div>
</template>
</el-table-column>
</el-table>
</el-card>
</el-col>
</el-row>
<el-row>
<el-col :span="10" :offset="14">
<div class="pagination m-v-lg">
<pagination :current-page="page" :page-size="limit" :total="total" @change="onPageChange"> </pagination>
</div>
</el-col>
</el-row>
</el-col>
@@ -11,23 +64,31 @@
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { applicationOperator, IApplication, IApplicationListResponse } from '@/operators';
import ApplicationPreviewCard from '@/components/application/PreviewCard.vue';
import { applicationOperator, IApplication, IApplicationListResponse, IService } from '@/operators';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
import Pagination from '@/components/common/Pagination.vue';
interface IData {
applications: IApplication[];
loading: boolean;
total: number | undefined;
limit: number;
page: number;
}
export default defineComponent({
name: 'ApplicationList',
components: {
ApplicationPreviewCard
FontAwesomeIcon,
Pagination
},
data(): IData {
return {
applications: [],
loading: false
loading: false,
total: undefined,
limit: 8,
page: parseInt(this.$route.query.page?.toString() || '1')
};
},
computed: {
@@ -37,22 +98,61 @@ export default defineComponent({
},
watch: {},
mounted() {
this.loading = true;
applicationOperator
.getAll({
user_id: this.$store.getters.user.id
})
.then(({ data: data }: { data: IApplicationListResponse }) => {
this.applications = data.items;
this.loading = false;
});
this.onFetchData();
},
methods: {}
methods: {
onBuyMore(service: IService) {},
onGoDocument(service: IService) {},
onPageChange(page: number) {
this.$router.push({
name: this.$route.name?.toString(),
query: {
page: page
}
});
this.onFetchData();
},
onFetchData() {
this.loading = true;
applicationOperator
.getAll({
limit: this.limit,
offset: (this.page - 1) * this.limit,
user_id: this.$store.getters.user.id
})
.then(({ data: data }: { data: IApplicationListResponse }) => {
this.applications = data.items;
this.loading = false;
this.total = data.count;
});
}
}
});
</script>
<style lang="scss" scoped>
.title {
font-size: 26px;
font-weight: bold;
margin-bottom: 20px;
color: #333;
}
.el-table {
min-height: calc(100vh - 270px);
margin-bottom: 50px;
}
.panel {
padding: 30px;
.api-key {
.copy {
cursor: pointer;
margin: 0 10px;
}
}
}
.pagination {
float: right;
}
</style>
+4 -10
View File
@@ -71,15 +71,7 @@
<el-row>
<el-col :span="10" :offset="14">
<div class="pagination m-v-lg">
<el-pagination
v-model:current-page="page"
background
:page-size="limit"
layout="total, prev, pager, next"
:total="total"
@current-change="onPageChange"
>
</el-pagination>
<pagination :current-page="page" :page-size="limit" :total="total" @change="onPageChange" />
</div>
</el-col>
</el-row>
@@ -91,6 +83,7 @@
import { serviceOperator, IService, IServiceListResponse } from '@/operators';
import { defineComponent } from 'vue';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
import Pagination from '@/components/common/Pagination.vue';
interface IData {
services: IService[];
@@ -102,7 +95,8 @@ interface IData {
export default defineComponent({
name: 'ServiceList',
components: {
FontAwesomeIcon
FontAwesomeIcon,
Pagination
},
data(): IData {
return {