|
|
@ -3,24 +3,24 @@ |
|
|
<el-button-group> |
|
|
<el-button-group> |
|
|
<el-button |
|
|
<el-button |
|
|
class="no-active-btn" |
|
|
class="no-active-btn" |
|
|
:class="{ 'active-btn': activeTab === 'addBeanRecharge' }" |
|
|
|
|
|
@click="navigateTo('addBeanRecharge')" |
|
|
|
|
|
|
|
|
:class="{ 'active-btn': activeTab === 'add_gold_bean_recharge' }" |
|
|
|
|
|
@click="navigateTo('add_gold_bean_recharge')" |
|
|
v-if="hasAdd" |
|
|
v-if="hasAdd" |
|
|
style="width: 6.5vw"> |
|
|
style="width: 6.5vw"> |
|
|
新增充值 |
|
|
新增充值 |
|
|
</el-button> |
|
|
</el-button> |
|
|
<el-button |
|
|
<el-button |
|
|
class="no-active-btn" |
|
|
class="no-active-btn" |
|
|
:class="{ 'active-btn': activeTab === 'beanSystemRecharge' }" |
|
|
|
|
|
@click="navigateTo('beanSystemRecharge')" |
|
|
|
|
|
|
|
|
:class="{ 'active-btn': activeTab === 'system_gold_bean_recharge' }" |
|
|
|
|
|
@click="navigateTo('system_gold_bean_recharge')" |
|
|
v-if="hasSystem" |
|
|
v-if="hasSystem" |
|
|
style="width: 6.5vw;"> |
|
|
style="width: 6.5vw;"> |
|
|
系统充值 |
|
|
系统充值 |
|
|
</el-button> |
|
|
</el-button> |
|
|
<el-button |
|
|
<el-button |
|
|
class="no-active-btn" |
|
|
class="no-active-btn" |
|
|
:class="{ 'active-btn': activeTab === 'beanOnlineRecharge' }" |
|
|
|
|
|
@click="navigateTo('beanOnlineRecharge')" |
|
|
|
|
|
|
|
|
:class="{ 'active-btn': activeTab === 'online_gold_bean_recharge' }" |
|
|
|
|
|
@click="navigateTo('online_gold_bean_recharge')" |
|
|
v-if="hasOnline" |
|
|
v-if="hasOnline" |
|
|
style="width: 6.5vw;"> |
|
|
style="width: 6.5vw;"> |
|
|
线上充值 |
|
|
线上充值 |
|
|
@ -58,24 +58,24 @@ const navigateTo = (name) => { |
|
|
const initPermissions = () => { |
|
|
const initPermissions = () => { |
|
|
if (!menuTree.value || !menuTree.value.length) return; |
|
|
if (!menuTree.value || !menuTree.value.length) return; |
|
|
|
|
|
|
|
|
hasAdd.value = hasMenuPermission(menuTree.value, permissionMapping.addBeanRecharge); |
|
|
|
|
|
hasSystem.value = hasMenuPermission(menuTree.value, permissionMapping.beanSystemRecharge); |
|
|
|
|
|
hasOnline.value = hasMenuPermission(menuTree.value, permissionMapping.beanOnlineRecharge); |
|
|
|
|
|
|
|
|
hasAdd.value = hasMenuPermission(menuTree.value, permissionMapping.add_gold_bean_recharge); |
|
|
|
|
|
hasSystem.value = hasMenuPermission(menuTree.value, permissionMapping.system_gold_bean_recharge); |
|
|
|
|
|
hasOnline.value = hasMenuPermission(menuTree.value, permissionMapping.online_gold_bean_recharge); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
// 默认跳转逻辑 |
|
|
// 默认跳转逻辑 |
|
|
const getDefaultAuditRoute = () => { |
|
|
const getDefaultAuditRoute = () => { |
|
|
initPermissions(); |
|
|
initPermissions(); |
|
|
if (hasAdd.value) return 'addBeanRecharge'; |
|
|
|
|
|
if (hasSystem.value) return 'beanSystemRecharge'; |
|
|
|
|
|
if (hasOnline.value) return 'beanOnlineRecharge'; |
|
|
|
|
|
return 'addBeanRecharge'; |
|
|
|
|
|
|
|
|
if (hasAdd.value) return 'add_gold_bean_recharge'; |
|
|
|
|
|
if (hasSystem.value) return 'system_gold_bean_recharge'; |
|
|
|
|
|
if (hasOnline.value) return 'online_gold_bean_recharge'; |
|
|
|
|
|
return 'add_gold_bean_recharge'; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
// 监听路由变化更新标签状态 |
|
|
// 监听路由变化更新标签状态 |
|
|
watch(() => route.name, (newName) => { |
|
|
watch(() => route.name, (newName) => { |
|
|
initPermissions() |
|
|
initPermissions() |
|
|
if (newName === 'addBeanRecharge' || newName === 'beanSystemRecharge' || newName === 'beanOnlineRecharge') { |
|
|
|
|
|
|
|
|
if (newName === 'add_gold_bean_recharge' || newName === 'system_gold_bean_recharge' || newName === 'online_gold_bean_recharge') { |
|
|
activeTab.value = newName; |
|
|
activeTab.value = newName; |
|
|
} else if (newName === 'beanRecharge') { |
|
|
} else if (newName === 'beanRecharge') { |
|
|
// 每次访问 /beanConsume 都进行默认跳转 |
|
|
// 每次访问 /beanConsume 都进行默认跳转 |
|
|
@ -92,7 +92,7 @@ onMounted(() => { |
|
|
navigateTo(defaultRoute); |
|
|
navigateTo(defaultRoute); |
|
|
} else { |
|
|
} else { |
|
|
// 非父路由初始化当前标签状态 |
|
|
// 非父路由初始化当前标签状态 |
|
|
if (route.name === 'addBeanRecharge' || route.name === 'beanSystemRecharge' || route.name === 'beanOnlineRecharge') { |
|
|
|
|
|
|
|
|
if (route.name === 'add_gold_bean_recharge' || route.name === 'system_gold_bean_recharge' || route.name === 'online_gold_bean_recharge') { |
|
|
activeTab.value = route.name; |
|
|
activeTab.value = route.name; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|