feat:使用 router name 进行跳转
This commit is contained in:
@@ -197,7 +197,7 @@ async function handleSubmit(values: Recordable<any>) {
|
|||||||
await smsResetPassword({ mobile, code, password });
|
await smsResetPassword({ mobile, code, password });
|
||||||
message.success($t('authentication.resetPasswordSuccess'));
|
message.success($t('authentication.resetPasswordSuccess'));
|
||||||
// 重置成功后跳转到首页
|
// 重置成功后跳转到首页
|
||||||
router.push('/');
|
await router.push('/');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('重置密码失败:', error);
|
console.error('重置密码失败:', error);
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ async function handleSave() {
|
|||||||
|
|
||||||
// 保存成功,提示并跳转到列表页
|
// 保存成功,提示并跳转到列表页
|
||||||
message.success('保存成功');
|
message.success('保存成功');
|
||||||
tabs.closeCurrentTab();
|
await tabs.closeCurrentTab();
|
||||||
await router.push({ name: 'AiWorkflow' });
|
await router.push({ name: 'AiWorkflow' });
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.error('保存失败:', error);
|
console.error('保存失败:', error);
|
||||||
|
|||||||
@@ -320,7 +320,7 @@ async function handleSave() {
|
|||||||
|
|
||||||
// 返回列表页(排除更新的情况)
|
// 返回列表页(排除更新的情况)
|
||||||
if (actionType !== 'update') {
|
if (actionType !== 'update') {
|
||||||
router.push({ path: '/bpm/manager/model' });
|
await router.push({ path: '/bpm/manager/model' });
|
||||||
}
|
}
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.error('保存失败:', error);
|
console.error('保存失败:', error);
|
||||||
|
|||||||
@@ -19,54 +19,34 @@ const router = useRouter();
|
|||||||
interface DataItem {
|
interface DataItem {
|
||||||
name: string;
|
name: string;
|
||||||
value: number;
|
value: number;
|
||||||
routerPath: string;
|
routerName: string;
|
||||||
prefix?: string;
|
prefix?: string;
|
||||||
decimals?: number;
|
decimals?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 数据 */
|
/** 数据 */
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
orderUndelivered: {
|
orderUndelivered: { name: '待发货订单', value: 0, routerName: 'TradeOrder' },
|
||||||
name: '待发货订单',
|
|
||||||
value: 0,
|
|
||||||
routerPath: '/mall/trade/order',
|
|
||||||
},
|
|
||||||
orderAfterSaleApply: {
|
orderAfterSaleApply: {
|
||||||
name: '退款中订单',
|
name: '退款中订单',
|
||||||
value: 0,
|
value: 0,
|
||||||
routerPath: '/mall/trade/after-sale',
|
routerName: 'TradeAfterSale',
|
||||||
},
|
|
||||||
orderWaitePickUp: {
|
|
||||||
name: '待核销订单',
|
|
||||||
value: 0,
|
|
||||||
routerPath: '/mall/trade/delivery/pick-up-store/pick-up-order',
|
|
||||||
},
|
|
||||||
productAlertStock: {
|
|
||||||
name: '库存预警',
|
|
||||||
value: 0,
|
|
||||||
routerPath: '/mall/product/spu',
|
|
||||||
},
|
|
||||||
productForSale: {
|
|
||||||
name: '上架商品',
|
|
||||||
value: 0,
|
|
||||||
routerPath: '/mall/product/spu',
|
|
||||||
},
|
|
||||||
productInWarehouse: {
|
|
||||||
name: '仓库商品',
|
|
||||||
value: 0,
|
|
||||||
routerPath: '/mall/product/spu',
|
|
||||||
},
|
},
|
||||||
|
orderWaitePickUp: { name: '待核销订单', value: 0, routerName: 'TradeOrder' },
|
||||||
|
productAlertStock: { name: '库存预警', value: 0, routerName: 'ProductSpu' },
|
||||||
|
productForSale: { name: '上架商品', value: 0, routerName: 'ProductSpu' },
|
||||||
|
productInWarehouse: { name: '仓库商品', value: 0, routerName: 'ProductSpu' },
|
||||||
withdrawAuditing: {
|
withdrawAuditing: {
|
||||||
name: '提现待审核',
|
name: '提现待审核',
|
||||||
value: 0,
|
value: 0,
|
||||||
routerPath: '/mall/trade/brokerage/brokerage-withdraw',
|
routerName: 'TradeBrokerageWithdraw',
|
||||||
},
|
},
|
||||||
rechargePrice: {
|
rechargePrice: {
|
||||||
name: '账户充值',
|
name: '账户充值',
|
||||||
value: 0,
|
value: 0,
|
||||||
prefix: '¥',
|
prefix: '¥',
|
||||||
decimals: 2,
|
decimals: 2,
|
||||||
routerPath: '/pay/wallet/wallet-balance',
|
routerName: 'PayWalletRecharge',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -102,8 +82,8 @@ async function getWalletRechargeData() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 跳转到对应页面 */
|
/** 跳转到对应页面 */
|
||||||
function handleClick(routerPath: string) {
|
function handleClick(routerName: string) {
|
||||||
router.push({ path: routerPath });
|
router.push({ name: routerName });
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 激活时 */
|
/** 激活时 */
|
||||||
@@ -128,7 +108,7 @@ onMounted(() => {
|
|||||||
v-for="(item, key) in data"
|
v-for="(item, key) in data"
|
||||||
:key="key"
|
:key="key"
|
||||||
class="flex h-20 w-[20%] cursor-pointer flex-col items-center justify-center gap-2"
|
class="flex h-20 w-[20%] cursor-pointer flex-col items-center justify-center gap-2"
|
||||||
@click="handleClick(item.routerPath)"
|
@click="handleClick(item.routerName)"
|
||||||
>
|
>
|
||||||
<CountTo
|
<CountTo
|
||||||
:decimals="(item as DataItem).decimals ?? 0"
|
:decimals="(item as DataItem).decimals ?? 0"
|
||||||
|
|||||||
@@ -16,55 +16,55 @@ const menuList = [
|
|||||||
name: '用户管理',
|
name: '用户管理',
|
||||||
icon: 'ep:user-filled',
|
icon: 'ep:user-filled',
|
||||||
bgColor: 'bg-red-400',
|
bgColor: 'bg-red-400',
|
||||||
routerPath: '/member/user',
|
routerName: 'MemberUser',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '商品管理',
|
name: '商品管理',
|
||||||
icon: 'fluent-mdl2:product',
|
icon: 'fluent-mdl2:product',
|
||||||
bgColor: 'bg-orange-400',
|
bgColor: 'bg-orange-400',
|
||||||
routerPath: '/mall/product/spu',
|
routerName: 'ProductSpu',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '订单管理',
|
name: '订单管理',
|
||||||
icon: 'ep:list',
|
icon: 'ep:list',
|
||||||
bgColor: 'bg-yellow-500',
|
bgColor: 'bg-yellow-500',
|
||||||
routerPath: '/mall/trade/order',
|
routerName: 'TradeOrder',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '售后管理',
|
name: '售后管理',
|
||||||
icon: 'ri:refund-2-line',
|
icon: 'ri:refund-2-line',
|
||||||
bgColor: 'bg-green-600',
|
bgColor: 'bg-green-600',
|
||||||
routerPath: '/mall/trade/after-sale',
|
routerName: 'TradeAfterSale',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '分销管理',
|
name: '分销管理',
|
||||||
icon: 'fa-solid:project-diagram',
|
icon: 'fa-solid:project-diagram',
|
||||||
bgColor: 'bg-cyan-500',
|
bgColor: 'bg-cyan-500',
|
||||||
routerPath: '/mall/trade/brokerage/brokerage-user',
|
routerName: 'TradeBrokerageUser',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '优惠券',
|
name: '优惠券',
|
||||||
icon: 'ep:ticket',
|
icon: 'ep:ticket',
|
||||||
bgColor: 'bg-blue-500',
|
bgColor: 'bg-blue-500',
|
||||||
routerPath: '/mall/promotion/coupon/template',
|
routerName: 'PromotionCoupon',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '拼团活动',
|
name: '拼团活动',
|
||||||
icon: 'fa:group',
|
icon: 'fa:group',
|
||||||
bgColor: 'bg-purple-500',
|
bgColor: 'bg-purple-500',
|
||||||
routerPath: '/mall/promotion/combination/acitivity',
|
routerName: 'PromotionBargainActivity',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '佣金提现',
|
name: '佣金提现',
|
||||||
icon: 'vaadin:money-withdraw',
|
icon: 'vaadin:money-withdraw',
|
||||||
bgColor: 'bg-rose-500',
|
bgColor: 'bg-rose-500',
|
||||||
routerPath: '/mall/trade/brokerage/brokerage-withdraw',
|
routerName: 'TradeBrokerageWithdraw',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
/** 跳转到菜单对应页面 */
|
/** 跳转到菜单对应页面 */
|
||||||
function handleMenuClick(routerPath: string) {
|
function handleMenuClick(routerName: string) {
|
||||||
router.push({ path: routerPath });
|
router.push({ name: routerName });
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ function handleMenuClick(routerPath: string) {
|
|||||||
v-for="menu in menuList"
|
v-for="menu in menuList"
|
||||||
:key="menu.name"
|
:key="menu.name"
|
||||||
class="flex h-20 w-[20%] cursor-pointer flex-col items-center justify-center gap-2"
|
class="flex h-20 w-[20%] cursor-pointer flex-col items-center justify-center gap-2"
|
||||||
@click="handleMenuClick(menu.routerPath)"
|
@click="handleMenuClick(menu.routerName)"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
:class="menu.bgColor"
|
:class="menu.bgColor"
|
||||||
|
|||||||
@@ -19,54 +19,34 @@ const router = useRouter();
|
|||||||
interface DataItem {
|
interface DataItem {
|
||||||
name: string;
|
name: string;
|
||||||
value: number;
|
value: number;
|
||||||
routerPath: string;
|
routerName: string;
|
||||||
prefix?: string;
|
prefix?: string;
|
||||||
decimals?: number;
|
decimals?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 数据 */
|
/** 数据 */
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
orderUndelivered: {
|
orderUndelivered: { name: '待发货订单', value: 0, routerName: 'TradeOrder' },
|
||||||
name: '待发货订单',
|
|
||||||
value: 0,
|
|
||||||
routerPath: '/mall/trade/order',
|
|
||||||
},
|
|
||||||
orderAfterSaleApply: {
|
orderAfterSaleApply: {
|
||||||
name: '退款中订单',
|
name: '退款中订单',
|
||||||
value: 0,
|
value: 0,
|
||||||
routerPath: '/mall/trade/after-sale',
|
routerName: 'TradeAfterSale',
|
||||||
},
|
|
||||||
orderWaitePickUp: {
|
|
||||||
name: '待核销订单',
|
|
||||||
value: 0,
|
|
||||||
routerPath: '/mall/trade/delivery/pick-up-store/pick-up-order',
|
|
||||||
},
|
|
||||||
productAlertStock: {
|
|
||||||
name: '库存预警',
|
|
||||||
value: 0,
|
|
||||||
routerPath: '/mall/product/spu',
|
|
||||||
},
|
|
||||||
productForSale: {
|
|
||||||
name: '上架商品',
|
|
||||||
value: 0,
|
|
||||||
routerPath: '/mall/product/spu',
|
|
||||||
},
|
|
||||||
productInWarehouse: {
|
|
||||||
name: '仓库商品',
|
|
||||||
value: 0,
|
|
||||||
routerPath: '/mall/product/spu',
|
|
||||||
},
|
},
|
||||||
|
orderWaitePickUp: { name: '待核销订单', value: 0, routerName: 'TradeOrder' },
|
||||||
|
productAlertStock: { name: '库存预警', value: 0, routerName: 'ProductSpu' },
|
||||||
|
productForSale: { name: '上架商品', value: 0, routerName: 'ProductSpu' },
|
||||||
|
productInWarehouse: { name: '仓库商品', value: 0, routerName: 'ProductSpu' },
|
||||||
withdrawAuditing: {
|
withdrawAuditing: {
|
||||||
name: '提现待审核',
|
name: '提现待审核',
|
||||||
value: 0,
|
value: 0,
|
||||||
routerPath: '/mall/trade/brokerage/brokerage-withdraw',
|
routerName: 'TradeBrokerageWithdraw',
|
||||||
},
|
},
|
||||||
rechargePrice: {
|
rechargePrice: {
|
||||||
name: '账户充值',
|
name: '账户充值',
|
||||||
value: 0,
|
value: 0,
|
||||||
prefix: '¥',
|
prefix: '¥',
|
||||||
decimals: 2,
|
decimals: 2,
|
||||||
routerPath: '/pay/wallet/wallet-balance',
|
routerName: 'PayWalletRecharge',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -102,8 +82,8 @@ async function getWalletRechargeData() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 跳转到对应页面 */
|
/** 跳转到对应页面 */
|
||||||
function handleClick(routerPath: string) {
|
function handleClick(routerName: string) {
|
||||||
router.push({ path: routerPath });
|
router.push({ name: routerName });
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 激活时 */
|
/** 激活时 */
|
||||||
@@ -131,7 +111,7 @@ onMounted(() => {
|
|||||||
v-for="(item, key) in data"
|
v-for="(item, key) in data"
|
||||||
:key="key"
|
:key="key"
|
||||||
class="flex h-20 w-[20%] cursor-pointer flex-col items-center justify-center gap-2"
|
class="flex h-20 w-[20%] cursor-pointer flex-col items-center justify-center gap-2"
|
||||||
@click="handleClick(item.routerPath)"
|
@click="handleClick(item.routerName)"
|
||||||
>
|
>
|
||||||
<CountTo
|
<CountTo
|
||||||
:decimals="(item as DataItem).decimals ?? 0"
|
:decimals="(item as DataItem).decimals ?? 0"
|
||||||
|
|||||||
@@ -16,55 +16,55 @@ const menuList = [
|
|||||||
name: '用户管理',
|
name: '用户管理',
|
||||||
icon: 'ep:user-filled',
|
icon: 'ep:user-filled',
|
||||||
bgColor: 'bg-red-400',
|
bgColor: 'bg-red-400',
|
||||||
routerPath: '/member/user',
|
routerName: 'MemberUser',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '商品管理',
|
name: '商品管理',
|
||||||
icon: 'fluent-mdl2:product',
|
icon: 'fluent-mdl2:product',
|
||||||
bgColor: 'bg-orange-400',
|
bgColor: 'bg-orange-400',
|
||||||
routerPath: '/mall/product/spu',
|
routerName: 'ProductSpu',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '订单管理',
|
name: '订单管理',
|
||||||
icon: 'ep:list',
|
icon: 'ep:list',
|
||||||
bgColor: 'bg-yellow-500',
|
bgColor: 'bg-yellow-500',
|
||||||
routerPath: '/mall/trade/order',
|
routerName: 'TradeOrder',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '售后管理',
|
name: '售后管理',
|
||||||
icon: 'ri:refund-2-line',
|
icon: 'ri:refund-2-line',
|
||||||
bgColor: 'bg-green-600',
|
bgColor: 'bg-green-600',
|
||||||
routerPath: '/mall/trade/after-sale',
|
routerName: 'TradeAfterSale',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '分销管理',
|
name: '分销管理',
|
||||||
icon: 'fa-solid:project-diagram',
|
icon: 'fa-solid:project-diagram',
|
||||||
bgColor: 'bg-cyan-500',
|
bgColor: 'bg-cyan-500',
|
||||||
routerPath: '/mall/trade/brokerage/brokerage-user',
|
routerName: 'TradeBrokerageUser',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '优惠券',
|
name: '优惠券',
|
||||||
icon: 'ep:ticket',
|
icon: 'ep:ticket',
|
||||||
bgColor: 'bg-blue-500',
|
bgColor: 'bg-blue-500',
|
||||||
routerPath: '/mall/promotion/coupon/template',
|
routerName: 'PromotionCoupon',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '拼团活动',
|
name: '拼团活动',
|
||||||
icon: 'fa:group',
|
icon: 'fa:group',
|
||||||
bgColor: 'bg-purple-500',
|
bgColor: 'bg-purple-500',
|
||||||
routerPath: '/mall/promotion/combination/acitivity',
|
routerName: 'PromotionBargainActivity',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '佣金提现',
|
name: '佣金提现',
|
||||||
icon: 'vaadin:money-withdraw',
|
icon: 'vaadin:money-withdraw',
|
||||||
bgColor: 'bg-rose-500',
|
bgColor: 'bg-rose-500',
|
||||||
routerPath: '/mall/trade/brokerage/brokerage-withdraw',
|
routerName: 'TradeBrokerageWithdraw',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
/** 跳转到菜单对应页面 */
|
/** 跳转到菜单对应页面 */
|
||||||
function handleMenuClick(routerPath: string) {
|
function handleMenuClick(routerName: string) {
|
||||||
router.push({ path: routerPath });
|
router.push({ name: routerName });
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ function handleMenuClick(routerPath: string) {
|
|||||||
v-for="menu in menuList"
|
v-for="menu in menuList"
|
||||||
:key="menu.name"
|
:key="menu.name"
|
||||||
class="flex h-20 w-[20%] cursor-pointer flex-col items-center justify-center gap-2"
|
class="flex h-20 w-[20%] cursor-pointer flex-col items-center justify-center gap-2"
|
||||||
@click="handleMenuClick(menu.routerPath)"
|
@click="handleMenuClick(menu.routerName)"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
:class="menu.bgColor"
|
:class="menu.bgColor"
|
||||||
|
|||||||
Reference in New Issue
Block a user