update icons and console links
This commit is contained in:
1 parent
ae252f371f
commit
64fc0a63cf
3 files changed
+66
-28
No files matched your search
@@ -7,24 +7,25 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<div class="links">
|
<div class="links">
|
||||||
<router-link
|
<a
|
||||||
v-for="(link, linkIndex) in links"
|
v-for="(link, linkIndex) in links"
|
||||||
:key="linkIndex"
|
:key="linkIndex"
|
||||||
:to="{
|
|
||||||
name: link.name
|
|
||||||
}"
|
|
||||||
:class="{ link: true, active: $route.name === link.name }"
|
:class="{ link: true, active: $route.name === link.name }"
|
||||||
|
@click="onNavigate(link)"
|
||||||
>
|
>
|
||||||
<span class="icon">
|
<span class="icon">
|
||||||
<el-icon class="icon">
|
<font-awesome-icon :icon="link.icon" class="text-sm" />
|
||||||
<clock v-if="link.icon === 'clock'" />
|
|
||||||
<user v-if="link.icon === 'user'" />
|
|
||||||
<postcard v-if="link.icon === 'postcard'" />
|
|
||||||
</el-icon>
|
|
||||||
</span>
|
</span>
|
||||||
<span class="text">{{ link.text }}</span>
|
<span class="text">{{ link.text }}</span>
|
||||||
<span class="suffix"></span>
|
<span class="outer">
|
||||||
</router-link>
|
<font-awesome-icon
|
||||||
|
v-if="!link.name && link.href"
|
||||||
|
icon="fa-solid fa-up-right-from-square"
|
||||||
|
class="text-sm ml-2"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
<span class="suffix"> </span>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -32,14 +33,16 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { Clock, User, Postcard } from '@element-plus/icons-vue';
|
|
||||||
import { ROUTE_CONSOLE_APPLICATION_LIST, ROUTE_CONSOLE_ORDER_LIST, ROUTE_INDEX } from '@/router';
|
import { ROUTE_CONSOLE_APPLICATION_LIST, ROUTE_CONSOLE_ORDER_LIST, ROUTE_INDEX } from '@/router';
|
||||||
import { ElRow, ElCol, ElIcon } from 'element-plus';
|
import { ElRow, ElCol } from 'element-plus';
|
||||||
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||||
|
import { getAuthBaseUrl, getEnv } from '@/utils';
|
||||||
|
|
||||||
interface ILink {
|
interface ILink {
|
||||||
key: string;
|
key: string;
|
||||||
text: string;
|
text: string;
|
||||||
name: string;
|
name?: string;
|
||||||
|
href?: string;
|
||||||
icon: string;
|
icon: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,27 +53,36 @@ interface IData {
|
|||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'Navigator',
|
name: 'Navigator',
|
||||||
components: {
|
components: {
|
||||||
Clock,
|
|
||||||
Postcard,
|
|
||||||
User,
|
|
||||||
ElRow,
|
ElRow,
|
||||||
ElCol,
|
ElCol,
|
||||||
ElIcon
|
FontAwesomeIcon
|
||||||
},
|
},
|
||||||
data(): IData {
|
data(): IData {
|
||||||
return {
|
return {
|
||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
key: 'profile',
|
key: 'profile',
|
||||||
text: this.$t('console.menu.orderList'),
|
text: this.$t('console.menu.userProfile'),
|
||||||
name: ROUTE_CONSOLE_ORDER_LIST,
|
href: `${getAuthBaseUrl()}/user/profile`,
|
||||||
icon: 'user'
|
icon: 'fa-regular fa-user'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'verify',
|
key: 'verify',
|
||||||
|
text: this.$t('console.menu.idVerify'),
|
||||||
|
href: `${getAuthBaseUrl()}/user/verify`,
|
||||||
|
icon: 'fa-regular fa-id-card'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'application-list',
|
||||||
text: this.$t('console.menu.applicationList'),
|
text: this.$t('console.menu.applicationList'),
|
||||||
name: ROUTE_CONSOLE_APPLICATION_LIST,
|
name: ROUTE_CONSOLE_APPLICATION_LIST,
|
||||||
icon: 'postcard'
|
icon: 'fa-solid fa-cube'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'order-list',
|
||||||
|
text: this.$t('console.menu.orderList'),
|
||||||
|
name: ROUTE_CONSOLE_ORDER_LIST,
|
||||||
|
icon: 'fa-solid fa-store'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
@@ -86,6 +98,15 @@ export default defineComponent({
|
|||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: ROUTE_INDEX
|
name: ROUTE_INDEX
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
onNavigate(link: ILink) {
|
||||||
|
if (link.name) {
|
||||||
|
this.$router.push({
|
||||||
|
name: link.name
|
||||||
|
});
|
||||||
|
} else if (link.href) {
|
||||||
|
window.location.href = link.href;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
export default {
|
export default {
|
||||||
orderList: '订单列表',
|
orderList: '订单列表',
|
||||||
applicationList: '申请列表'
|
applicationList: '申请列表',
|
||||||
|
userProfile: '个人信息',
|
||||||
|
idVerify: '实名认证'
|
||||||
};
|
};
|
||||||
@@ -1,7 +1,22 @@
|
|||||||
import { library } from '@fortawesome/fontawesome-svg-core';
|
import { library } from '@fortawesome/fontawesome-svg-core';
|
||||||
import { faCopy } from '@fortawesome/free-regular-svg-icons';
|
import {
|
||||||
import { faRotateRight, faCheck } from '@fortawesome/free-solid-svg-icons';
|
faCopy as faRegularCopy,
|
||||||
|
faUser as faRegularUser,
|
||||||
|
faIdCard as faRegularIdCard
|
||||||
|
} from '@fortawesome/free-regular-svg-icons';
|
||||||
|
import {
|
||||||
|
faRotateRight as faSolidRotateRight,
|
||||||
|
faCheck as faSolidCheck,
|
||||||
|
faCube as faSolidCube,
|
||||||
|
faStore as faSolidStore,
|
||||||
|
faUpRightFromSquare as faSolidUpRightFromSquare
|
||||||
|
} from '@fortawesome/free-solid-svg-icons';
|
||||||
|
|
||||||
library.add(faCopy);
|
library.add(faRegularCopy);
|
||||||
library.add(faRotateRight);
|
library.add(faSolidRotateRight);
|
||||||
library.add(faCheck);
|
library.add(faSolidCheck);
|
||||||
|
library.add(faRegularUser);
|
||||||
|
library.add(faRegularIdCard);
|
||||||
|
library.add(faSolidCube);
|
||||||
|
library.add(faSolidStore);
|
||||||
|
library.add(faSolidUpRightFromSquare);
|
||||||
Reference in new issue
Block a user