Browse Source

🦄 refactor: 权限字段名的更改(金豆充值消耗)

zhangyong/milestone-20250913-现金管理二期^2
zhangrenyuan 3 weeks ago
parent
commit
239ebeb4ce
  1. 20
      src/views/consume/bean/beanConsume.vue
  2. 30
      src/views/recharge/bean/beanRecharge.vue

20
src/views/consume/bean/beanConsume.vue

@ -3,8 +3,8 @@
<el-button-group class="custom-button-group">
<el-button
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'addBeanConsume' }"
@click="navigateTo('addBeanConsume')"
:class="{ 'active-btn': activeTab === 'add_gold_bean_consumption' }"
@click="navigateTo('add_gold_bean_consumption')"
v-if="hasAdd"
style="width: 6.5vw;"
>
@ -72,26 +72,26 @@ const navigateTo = (name) => {
const initPermissions = () => {
if (!menuTree.value || !menuTree.value.length) return;
hasAdd.value = hasMenuPermission(menuTree.value, permissionMapping.addBeanConsume);
hasLive.value = hasMenuPermission(menuTree.value, permissionMapping.beanZBDetail);
hasFan.value = hasMenuPermission(menuTree.value, permissionMapping.beanTFDetail);
hasArticleVideo.value = hasMenuPermission(menuTree.value, permissionMapping.beanSPWZDetail);
hasAdd.value = hasMenuPermission(menuTree.value, permissionMapping.add_gold_bean_consumption);
hasLive.value = hasMenuPermission(menuTree.value, permissionMapping.gold_bean_live_details);
hasFan.value = hasMenuPermission(menuTree.value, permissionMapping.gold_bean_fan_details);
hasArticleVideo.value = hasMenuPermission(menuTree.value, permissionMapping.gold_bean_video_details);
};
//
const getDefaultAuditRoute = () => {
initPermissions();
if (hasAdd.value) return 'addBeanConsume';
if (hasAdd.value) return 'add_gold_bean_consumption';
if (hasLive.value) return 'liveStream';
if (hasFan.value) return 'dieHardFan';
if (hasArticleVideo.value) return 'articleVideo';
return 'addBeanConsume';
return 'add_gold_bean_consumption';
};
//
watch(() => route.name, (newName) => {
initPermissions()
if (newName=== 'addBeanConsume' || newName === 'liveStream' || newName === 'dieHardFan' || newName === 'articleVideo') {
if (newName=== 'add_gold_bean_consumption' || newName === 'liveStream' || newName === 'dieHardFan' || newName === 'articleVideo') {
activeTab.value = newName;
} else if (newName === 'beanConsume') {
// 访 /beanConsume
@ -108,7 +108,7 @@ onMounted(() => {
navigateTo(defaultRoute);
} else {
//
if (route.name=== 'addBeanConsume' || route.name === 'liveStream' || route.name === 'dieHardFan' || route.name === 'articleVideo') {
if (route.name=== 'add_gold_bean_consumption' || route.name === 'liveStream' || route.name === 'dieHardFan' || route.name === 'articleVideo') {
activeTab.value = route.name;
}
}

30
src/views/recharge/bean/beanRecharge.vue

@ -3,24 +3,24 @@
<el-button-group>
<el-button
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"
style="width: 6.5vw">
新增充值
</el-button>
<el-button
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"
style="width: 6.5vw;">
系统充值
</el-button>
<el-button
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"
style="width: 6.5vw;">
线上充值
@ -58,24 +58,24 @@ const navigateTo = (name) => {
const initPermissions = () => {
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 = () => {
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) => {
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;
} else if (newName === 'beanRecharge') {
// 访 /beanConsume
@ -92,7 +92,7 @@ onMounted(() => {
navigateTo(defaultRoute);
} 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;
}
}

Loading…
Cancel
Save