diff --git a/.env.development b/.env.development
index 45faa82..b6264c1 100644
--- a/.env.development
+++ b/.env.development
@@ -3,9 +3,10 @@
# VITE_API_BASE='http://18.143.76.3:10704/'
# VITE_API_BASE='http://192.168.9.52:10705/'
VITE_UPLOAD_URL=http://39.101.133.168:8828/hljw/api/aws/upload
+ VITE_API_BASE='http://192.168.9.28:8081/'
# VITE_API_BASE='http://192.168.9.28:8081/'
# sunjiabei
# VITE_API_BASE='http://192.168.9.28:8081/'
# VITE_API_BASE='http://192.168.5.92:8081/'
# zhangyong
- VITE_API_BASE='http://192.168.3.83:8081/'
+# VITE_API_BASE='http://192.168.3.83:8081/'
diff --git a/src/router/index.js b/src/router/index.js
index 3cc31aa..6a32f14 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -79,6 +79,44 @@ const routes = [
}
]
},
+ // 金豆消耗
+ {
+ path: '/beanConsume',
+ name: "beanConsume",
+ component: () => import("../views/consume/beanConsume.vue"),
+ meta: {permissionId: 6},
+ children: [
+ // 金豆新增消耗
+ {
+ path: 'add',
+ name: "addBeanConsume",
+ component: () => import("../views/consume/addBeanConsume.vue"),
+ meta: {permissionId: 23} // 对应"提交金豆消耗"id=?
+ },
+ // 直播
+ {
+ path: 'live',
+ name: "liveStream",
+ component: () => import("../views/consume/liveStream.vue"),
+ meta: {permissionId: 24} // 对应"直播"id=?
+ },
+ // 铁粉
+ {
+ path: 'fan',
+ name: "dieHardFan",
+ component: () => import("../views/consume/dieHardFan.vue"),
+ meta: {permissionId: 25} // 对应"铁粉"id=?
+ },
+ // 文章视频
+ {
+ path: 'article',
+ name: "articleVideo",
+ component: () => import("../views/consume/articleVideo.vue"),
+ meta: {permissionId: 26} // 对应"文章视频"id=?
+ }
+
+ ]
+ },
// 汇率管理
{
diff --git a/src/utils/menuTreePermission.js b/src/utils/menuTreePermission.js
new file mode 100644
index 0000000..f1a8a01
--- /dev/null
+++ b/src/utils/menuTreePermission.js
@@ -0,0 +1,69 @@
+// 菜单权限映射(按 menu_type 排序)
+export const permissionMapping = {
+ System_Management: 1, // 系统管理
+
+ // menu_type 2: 主功能菜单
+ Workbench: 2, // 工作台
+ Financial_Audit: 3, // 财务审核
+ Exchange_Rate_Management: 4, // 汇率管理
+ Recharge_Management: 5, // 充值管理
+ Consumption_Management: 6, // 消耗管理
+ Refund_Management: 7, // 退款管理
+ Customer_Account_Details: 8, // 客户账户明细
+ Permission_Management: 9, // 权限管理
+
+ // menu_type 3: 子功能菜单
+ Gold_Coin_Recharge: 34, // 金币充值
+ Gold_Coin_Consumption: 35, // 金币消耗
+ Gold_Coin_Refund: 37, // 金币退款
+ Gold_Coin_Audit: 40, // 金币审核
+
+ Golden_Bean_Recharge: 41, // 金豆充值
+ Golden_Bean_Consumption: 42, // 金豆消耗
+ Golden_Bean_Audit: 43, // 金豆审核
+
+ Gold_Coin_Customer_Account_Details: 44, // 金币客户账户明细
+ Golden_Bean_Customer_Account_Details: 45, // 金豆客户账户明细
+
+ // menu_type 4: 功能操作权限
+ Workbench_Display: 10, // 工作台展示
+ View_Recharge_Audit: 11, // 查看充值审核
+ Recharge_Approval: 12, // 充值审批
+ View_Refund_Audit: 13, // 查看退款审核
+ Refund_Approval: 14, // 退款审批
+ Exchange_Rate_View: 15, // 汇率查看
+ Exchange_Rate_Modification: 16, // 汇率修改
+ Submit_Gold_Coin_Recharge: 17, // 提交金币充值
+ View_Gold_Coin_Recharge_Details: 18, // 查看金币充值明细
+ Submit_Gold_Coin_Consumption: 19, // 提交金币消耗
+ View_Gold_Coin_Consumption_Details: 20, // 查看金币消耗明细
+ Submit_Gold_Coin_Refund: 21, // 提交金币退款
+ View_Gold_Coin_Refund_Details: 22, // 查看金币退款明细
+ View_Gold_Coin_Details: 23, // 查看金币明细
+ View_Gold_Coin_Balance: 24, // 查看金币余额
+ View_Permission: 25, // 查看权限
+ Add_User: 26, // 新增用户
+ Change_Status: 27, // 改变状态
+ Modify_Permission: 28, // 修改权限
+ Delete_User: 29, // 删除用户
+ View_Role: 30, // 查看角色
+ Edit_Role: 36, // 编辑角色
+
+ Recharge_Audit: 31, // 充值审核
+ Refund_Audit: 32, // 退款审核
+};
+
+// 递归查找菜单中是否存在目标id
+export const findMenuById = (menuList, targetId) => {
+ for (const menu of menuList) {
+ if (menu.id === targetId) {
+ return true; // 找到目标菜单
+ }
+ // 如果有子菜单,递归查找
+ if (menu.children && menu.children.length > 0) {
+ const found = findMenuById(menu.children, targetId);
+ if (found) return true;
+ }
+ }
+ return false;
+};
\ No newline at end of file
diff --git a/src/utils/menuUtils.js b/src/utils/menuUtils.js
index be86bfd..f56b73a 100644
--- a/src/utils/menuUtils.js
+++ b/src/utils/menuUtils.js
@@ -7,7 +7,7 @@ export function filterMenu(menuList) {
...menu,
children: menu.children ? filterMenu(menu.children) : []
}))
- .sort((a, b) => a.priority - b.priority); // 按 id 升序
+ .sort((a, b) => a.id - b.id); // 按 id 升序
}
// 辅助函数:查找第一个可访问的菜单项
@@ -21,6 +21,7 @@ export function findFirstAccessibleMenu(menuList) {
} else if (menu.menuType === 2) { // 目录
return menu
} else if (menu.menuType === 3) { // 菜单
+ console.log('菜单:', menu)
return menu
}
}
@@ -33,24 +34,30 @@ export const getRoutePath = (menu) => {
const routeMap = {
'工作台': '/workspace',
+ '财务审核': '/audit',
'金币审核': '/audit',
'金豆审核': '/beanAudit',
'汇率管理': '/rate',
+
+ '充值管理': '/coinRecharge',
'金币充值': '/coinRecharge',
'金豆充值': '/beanRecharge',
+ '消耗管理': '/coinConsume',
'金币消耗': '/coinConsume',
'金豆消耗': '/beanConsume',
+ '退款管理': '/coinRefund',
'金币退款': '/coinRefund',
// '金豆退款': '/beanRefund',
'权限管理': '/permissions',
+ '客户账户明细': '/usergold',
'金币客户账户明细': '/usergold',
'金豆客户账户明细': '/userbean',
};
diff --git a/src/views/audit/rechargeAudit.vue b/src/views/audit/rechargeAudit.vue
index 0ed38bb..538a8f7 100644
--- a/src/views/audit/rechargeAudit.vue
+++ b/src/views/audit/rechargeAudit.vue
@@ -35,10 +35,16 @@
充值时间:
- 今
- 昨
- 近7天
+ end-placeholder="结束时间" style="width: 400px" @change="handleDatePickerChange"/>
+ 今
+
+ 昨
+
+ 近7天
+
重置
查询
@@ -95,7 +101,9 @@
-
+
--
@@ -173,6 +181,8 @@ import {ElMessage} from 'element-plus'
import request from '@/util/http'
import moment from 'moment'
import API from '@/util/http'
+import {useAdminStore} from "@/store/index.js";
+import {storeToRefs} from "pinia";
// 精网号去空格
const trimJwCode = () => {
if (rechargeAudit.value.jwcode) {
@@ -200,7 +210,7 @@ const rechargeAudit = ref({
startTime: "", // 充值时间开始
endTime: "", // 充值时间结束
market: "", // 地区
- auditStatus : "0",
+ auditStatus: "0",
})
// 搜索对象
@@ -501,23 +511,33 @@ const handlePagination = (type, val) => {
getStats()
}
+const adminStore = useAdminStore();
+const {menuTree} = storeToRefs(adminStore);
+import {permissionMapping, findMenuById} from "@/utils/menuTreePermission.js"
+
+
// 处理通过操作
const handleApprove = async (row) => {
- try {
- const params = {
- orderCode: row.orderCode,
- auditId: adminData.value.id,
- action: 1,
- rejectReason: ''
+ if (findMenuById(menuTree.value, permissionMapping.Recharge_Approval)) {
+ try {
+ const params = {
+ orderCode: row.orderCode,
+ auditId: adminData.value.id,
+ action: 1,
+ rejectReason: ''
+ }
+ await request({url: '/audit/audit', data: params})
+ ElMessage.success('审核通过成功')
+ await getRecharge()
+ await getStats()
+ } catch (error) {
+ console.error('审核通过失败', error)
+ ElMessage.error('操作失败')
}
- await request({url: '/audit/audit', data: params})
- ElMessage.success('审核通过成功')
- await getRecharge()
- await getStats()
- } catch (error) {
- console.error('审核通过失败', error)
- ElMessage.error('操作失败')
+ }else {
+ ElMessage.error('无权限')
}
+
}
// 显示驳回对话框
diff --git a/src/views/consume/addBeanConsume.vue b/src/views/consume/addBeanConsume.vue
new file mode 100644
index 0000000..399ab7f
--- /dev/null
+++ b/src/views/consume/addBeanConsume.vue
@@ -0,0 +1,11 @@
+
+
+
+ addBeanConsume
+
+
+
\ No newline at end of file
diff --git a/src/views/consume/articleVideo.vue b/src/views/consume/articleVideo.vue
new file mode 100644
index 0000000..2d36320
--- /dev/null
+++ b/src/views/consume/articleVideo.vue
@@ -0,0 +1,11 @@
+
+
+
+ article videos
+
+
+
\ No newline at end of file
diff --git a/src/views/consume/beanConsume.vue b/src/views/consume/beanConsume.vue
index 96c0baf..6a028e7 100644
--- a/src/views/consume/beanConsume.vue
+++ b/src/views/consume/beanConsume.vue
@@ -1,11 +1,137 @@
-
+
+
+
\ No newline at end of file
diff --git a/src/views/consume/dieHardFan.vue b/src/views/consume/dieHardFan.vue
new file mode 100644
index 0000000..78d9704
--- /dev/null
+++ b/src/views/consume/dieHardFan.vue
@@ -0,0 +1,11 @@
+
+
+
+ die-hard fans
+
+
+
\ No newline at end of file
diff --git a/src/views/consume/liveStream.vue b/src/views/consume/liveStream.vue
new file mode 100644
index 0000000..48e128f
--- /dev/null
+++ b/src/views/consume/liveStream.vue
@@ -0,0 +1,11 @@
+
+
+
+ live stream
+
+
+
\ No newline at end of file
diff --git a/src/views/recharge/coinRechargeDetail.vue b/src/views/recharge/coinRechargeDetail.vue
index 2dce85f..b4da800 100644
--- a/src/views/recharge/coinRechargeDetail.vue
+++ b/src/views/recharge/coinRechargeDetail.vue
@@ -34,6 +34,25 @@ const handleDatePickerChange = () => {
const rechargeUser = ref({
adminId: adminData.value.id
})
+
+// 存储地区选择变化
+const selectedMarketPath = ref([])
+//处理地区选择变化
+const handleMarketChange = (value) => {
+ if(value && value.length > 0){
+ const lastValue = value[value.length - 1];
+ if (lastValue.endsWith('_all')) {
+ // 选中“全部”,取父节点名称
+ rechargeUser.value.market = lastValue.replace('_all', '');
+ } else {
+ // 取路径的最后一项作为选中的地区
+ rechargeUser.value.market = lastValue;
+ }
+ } else {
+ rechargeUser.value.market = ''
+ }
+}
+
// 搜索对象
const getObj = ref({
pageNum: 1,
@@ -116,25 +135,46 @@ const getActivity = async function () {
// 在这里可以处理错误逻辑,比如显示错误提示等
}
}
-// 获取地区
-// 获取地区
+
+// 获取地区,修改为级联下拉框
const getArea = async function () {
console.log('获取地区adminid', adminData.value)
try {
// 发送POST请求
const result = await API({
- url: '/general/adminMarkets',
+ url: '/market/selectMarket',
data: {account: adminData.value.account}
});
// 将响应结果存储到响应式数据中
console.log('请求成功', result)
+
+ // 递归转换树形结构为级联选择器需要的格式
+ const transformTree = (nodes) => {
+ return nodes.map(node => {
+ const children = node.children && node.children.length
+ ? transformTree(node.children)
+ : null;
+ // 如果有子节点,添加“全部”选项
+ if (children) {
+ children.unshift({
+ value: `${node.name}_all`, // 唯一标识
+ label: '全部',
+ children: null
+ });
+ }
+ return {
+ value: node.name, //使用地区名称作为值
+ label: node.name, //显示名称
+ children
+ };
+ });
+ }
// 存储地区信息
- market.value = result.data
- console.log('地区', market.value)
+ market.value = transformTree(result.data)
+ console.log('转换后的地区树', market.value)
} catch (error) {
console.log('请求失败', error)
- // 在这里可以处理错误逻辑,比如显示错误提示等
}
}
@@ -257,6 +297,7 @@ const reset = function () {
delete rechargeUser.value.activity
delete rechargeUser.value.payPlatform
delete rechargeUser.value.market
+ selectedMarketPath .value = [] // 重置地区选择路径
delete rechargeUser.value.startTime
delete rechargeUser.value.endTime
delete sortField.value
@@ -487,13 +528,26 @@ const getTagText = (state) => {
-
+
+
+
+ 所属地区:
+
+