diff --git a/src/api/modules/marketing.js b/src/api/modules/marketing.js
index f9a8c08..13a50d5 100644
--- a/src/api/modules/marketing.js
+++ b/src/api/modules/marketing.js
@@ -146,4 +146,12 @@ export const marketing = {
data,
});
},
+ //概况
+ overview: (data) => {
+ return $http.request({
+ url: `/merchant-api/memberUnitUser/overview`,
+ method: "get",
+ params: data,
+ });
+ },
};
diff --git a/src/api/modules/mer_admin.js b/src/api/modules/mer_admin.js
index 4fe0cbc..82abafa 100644
--- a/src/api/modules/mer_admin.js
+++ b/src/api/modules/mer_admin.js
@@ -48,6 +48,10 @@ export const mer_admin = {
getProductPage: (data) => {
return $http.post(`/merchant-api/product/page`, data);
},
+ //商品概况
+ getProductOverview: (data) => {
+ return $http.post(`/merchant-api/product/overview`, data);
+ },
//商户商品分类
getProductCategory: (data) => {
return $http.request({
diff --git a/src/router/full-routers.js b/src/router/full-routers.js
index d580fd2..7760a68 100644
--- a/src/router/full-routers.js
+++ b/src/router/full-routers.js
@@ -30,20 +30,46 @@ export default {
menuId: getUUID(),
parentId: 0,
parentName: null,
- name: "商品",
- url: "local-course/resources",
+ name: "运营管理",
+ url: "operation-management",
perms: "",
type: 0,
- elIcon: "el-icon-menu",
+ elIcon: "el-icon-s-help",
orderNum: 0,
open: null,
list: [
+ {
+ menuId: getUUID(),
+ parentId: 0,
+ parentName: null,
+ name: "店铺列表",
+ url: "operation-management/shop-list/index",
+ perms: "",
+ type: 1,
+ elIcon: "el-icon-shopping-cart-full",
+ orderNum: 0,
+ open: null,
+ list: [],
+ },
+ {
+ menuId: getUUID(),
+ parentId: 0,
+ parentName: null,
+ name: "分销商列表",
+ url: "operation-management/distributor/index",
+ perms: "",
+ type: 1,
+ elIcon: "el-icon-shopping-cart-full",
+ orderNum: 0,
+ open: null,
+ list: [],
+ },
{
menuId: getUUID(),
parentId: 0,
parentName: null,
name: "商品管理",
- url: "product/commodity/index",
+ url: "operation-management/commodity/index",
perms: "",
type: 1,
elIcon: "el-icon-menu",
@@ -56,7 +82,7 @@ export default {
parentId: 0,
parentName: null,
name: "订单管理",
- url: "product/order/index",
+ url: "operation-management/order/index",
perms: "",
type: 1,
elIcon: "el-icon-menu",
@@ -69,7 +95,7 @@ export default {
parentId: 0,
parentName: null,
name: "轮播图管理",
- url: "product/banner/index",
+ url: "operation-management/banner/index",
perms: "",
type: 1,
elIcon: "el-icon-menu",
@@ -82,7 +108,7 @@ export default {
parentId: 0,
parentName: null,
name: "公告管理",
- url: "product/notice/index",
+ url: "operation-management/notice/index",
perms: "",
type: 1,
elIcon: "el-icon-menu",
@@ -90,123 +116,15 @@ export default {
open: null,
list: [],
},
- ],
- },
- {
- menuId: getUUID(),
- parentId: 0,
- parentName: null,
- name: "运费管理",
- url: "",
- perms: "",
- type: 0,
- elIcon: "el-icon-money",
- orderNum: 0,
- open: null,
- list: [
{
menuId: getUUID(),
parentId: 0,
parentName: null,
- name: "运费模板",
- url: "logistics-fare/logistics-template/index",
+ name: "角色管理",
+ url: "operation-management/role/index",
perms: "",
type: 1,
- elIcon: "el-icon-postcard",
- orderNum: 0,
- open: null,
- list: [],
- },
- ],
- },
- {
- menuId: getUUID(),
- parentId: 0,
- parentName: null,
- name: "银行卡管理",
- url: "bank-card/index",
- perms: "",
- type: 0,
- elIcon: "el-icon-picture-outline",
- orderNum: 0,
- open: null,
- list: [],
- hideInMenu: true,
- },
- {
- menuId: getUUID(),
- parentId: 0,
- parentName: null,
- name: "品牌管理",
- url: "",
- perms: "",
- type: 0,
- elIcon: "el-icon-money",
- orderNum: 0,
- open: null,
- list: [
- {
- menuId: getUUID(),
- parentId: 0,
- parentName: null,
- name: "品牌管理",
- url: "brand/config/index",
- perms: "",
- type: 1,
- elIcon: "el-icon-postcard",
- orderNum: 0,
- open: null,
- list: [],
- },
- ],
- },
- {
- menuId: getUUID(),
- parentId: 0,
- parentName: null,
- name: "优惠卷管理",
- url: "coupon/index",
- perms: "",
- type: 0,
- elIcon: "el-icon-document-remove",
- orderNum: 0,
- open: null,
- list: [],
- },
- {
- menuId: getUUID(),
- parentId: 0,
- parentName: null,
- name: "预售管理",
- url: "",
- perms: "",
- type: 0,
- elIcon: "el-icon-data-analysis",
- orderNum: 0,
- open: null,
- list: [
- {
- menuId: getUUID(),
- parentId: 0,
- parentName: null,
- name: "预售商品",
- url: "presale/products/index",
- perms: "",
- type: 1,
- elIcon: "el-icon-postcard",
- orderNum: 0,
- open: null,
- list: [],
- },
- {
- menuId: getUUID(),
- parentId: 0,
- parentName: null,
- name: "预售订单",
- url: "presale/order/index",
- perms: "",
- type: 1,
- elIcon: "el-icon-postcard",
+ elIcon: "el-icon-user",
orderNum: 0,
open: null,
list: [],
@@ -218,7 +136,7 @@ export default {
parentId: 0,
parentName: null,
name: "数据中心",
- url: "",
+ url: "datacenter",
perms: "",
type: 0,
elIcon: "el-icon-tickets",
@@ -270,8 +188,102 @@ export default {
menuId: getUUID(),
parentId: 0,
parentName: null,
- name: "营销管理",
- url: "",
+ name: "银行卡管理",
+ url: "bank-card/index",
+ perms: "",
+ type: 0,
+ elIcon: "el-icon-picture-outline",
+ orderNum: 0,
+ open: null,
+ list: [],
+ hideInMenu: true,
+ },
+ {
+ menuId: getUUID(),
+ parentId: 0,
+ parentName: null,
+ name: "品牌管理",
+ url: "brand",
+ perms: "",
+ type: 0,
+ elIcon: "el-icon-money",
+ orderNum: 0,
+ open: null,
+ list: [
+ {
+ menuId: getUUID(),
+ parentId: 0,
+ parentName: null,
+ name: "品牌管理",
+ url: "brand/config/index",
+ perms: "",
+ type: 1,
+ elIcon: "el-icon-postcard",
+ orderNum: 0,
+ open: null,
+ list: [],
+ },
+ ],
+ },
+ {
+ menuId: getUUID(),
+ parentId: 0,
+ parentName: null,
+ name: "优惠卷营销工具管理",
+ url: "coupon/index",
+ perms: "",
+ type: 0,
+ elIcon: "el-icon-document-remove",
+ orderNum: 0,
+ open: null,
+ list: [],
+ },
+ {
+ menuId: getUUID(),
+ parentId: 0,
+ parentName: null,
+ name: "预售营销工具管理",
+ url: "presale",
+ perms: "",
+ type: 0,
+ elIcon: "el-icon-data-analysis",
+ orderNum: 0,
+ open: null,
+ list: [
+ {
+ menuId: getUUID(),
+ parentId: 0,
+ parentName: null,
+ name: "预售商品",
+ url: "presale/products/index",
+ perms: "",
+ type: 1,
+ elIcon: "el-icon-postcard",
+ orderNum: 0,
+ open: null,
+ list: [],
+ },
+ {
+ menuId: getUUID(),
+ parentId: 0,
+ parentName: null,
+ name: "预售订单",
+ url: "presale/order/index",
+ perms: "",
+ type: 1,
+ elIcon: "el-icon-postcard",
+ orderNum: 0,
+ open: null,
+ list: [],
+ },
+ ],
+ },
+ {
+ menuId: getUUID(),
+ parentId: 0,
+ parentName: null,
+ name: "会员营销工具管理",
+ url: "marketing",
perms: "",
type: 0,
elIcon: "el-icon-tickets",
@@ -350,7 +362,7 @@ export default {
parentId: 0,
parentName: null,
name: "代理商",
- url: "",
+ url: "agent",
perms: "",
type: 0,
elIcon: "el-icon-tickets",
@@ -409,32 +421,6 @@ export default {
open: null,
list: [],
},
- {
- menuId: getUUID(),
- parentId: 0,
- parentName: null,
- name: "店铺列表",
- url: "agent/shop-list/index",
- perms: "",
- type: 1,
- elIcon: "el-icon-shopping-cart-full",
- orderNum: 0,
- open: null,
- list: [],
- },
- {
- menuId: getUUID(),
- parentId: 0,
- parentName: null,
- name: "分销商列表",
- url: "agent/distributor/index",
- perms: "",
- type: 1,
- elIcon: "el-icon-shopping-cart-full",
- orderNum: 0,
- open: null,
- list: [],
- },
{
menuId: getUUID(),
parentId: 0,
@@ -449,6 +435,7 @@ export default {
list: [],
},
],
+ hideInMenu: true,
},
{
menuId: getUUID(),
@@ -456,7 +443,7 @@ export default {
parentName: null,
name: "钱包管理",
url: "local-course/resources",
- perms: "",
+ perms: "wallet",
type: 0,
elIcon: "el-icon-menu",
orderNum: 0,
@@ -477,6 +464,33 @@ export default {
},
],
},
+ {
+ menuId: getUUID(),
+ parentId: 0,
+ parentName: null,
+ name: "运费管理",
+ url: "ogistics-fare",
+ perms: "",
+ type: 0,
+ elIcon: "el-icon-money",
+ orderNum: 0,
+ open: null,
+ list: [
+ {
+ menuId: getUUID(),
+ parentId: 0,
+ parentName: null,
+ name: "运费模板",
+ url: "logistics-fare/logistics-template/index",
+ perms: "",
+ type: 1,
+ elIcon: "el-icon-postcard",
+ orderNum: 0,
+ open: null,
+ list: [],
+ },
+ ],
+ },
],
code: 0,
permissions: [],
diff --git a/src/router/index.js b/src/router/index.js
index 96c877a..d3f8feb 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -8,7 +8,7 @@ import Vue from "vue";
import Router from "vue-router";
import http from "@/utils/httpRequest";
import { isURL } from "@/utils/validate";
-import { clearLoginInfo } from "@/utils";
+import { clearLoginInfo, getMenu } from "@/utils";
import FULL_ROUTERS from "./full-routers";
import $api from "@/api/index.js";
import store from "@/store";
@@ -103,21 +103,24 @@ router.beforeEach((to, from, next) => {
$api
.getUserInfo()
.then(({ data }) => {
+ let permissionsData = getMenu(data.data.role);
const filterTreeData = (data, permissions) => {
- return data; //临时性返回所有菜单方便调试
- // return data.reduce((filtered, node) => {
- // // 如果节点的权限在权限数组中
- // if (permissions.includes(node.url)) {
- // // 递归过滤子节点
- // const list = filterTreeData(node.list || [], permissions);
- // // 创建一个新的节点,包含过滤后的子节点
- // filtered.push({
- // ...node,
- // list,
- // });
- // }
- // return filtered;
- // }, []);
+ console.log(data);
+
+ // return data; //临时性返回所有菜单方便调试
+ return data.reduce((filtered, node) => {
+ // 如果节点的权限在权限数组中
+ if (permissions.includes(node.url)) {
+ // 递归过滤子节点
+ const list = filterTreeData(node.list || [], permissions);
+ // 创建一个新的节点,包含过滤后的子节点
+ filtered.push({
+ ...node,
+ list,
+ });
+ }
+ return filtered;
+ }, []);
};
console.log(data, "用户信息");
sessionStorage.setItem("role", JSON.stringify(data.data.role));
@@ -160,10 +163,13 @@ router.beforeEach((to, from, next) => {
JSON.stringify(data.data.permissions || "[]")
);
//添加全量菜单,根据权限进行过滤
- let _menu = filterTreeData(
- FULL_ROUTERS.menuList,
- data.data.permissions
- );
+ // let _menu = filterTreeData(
+ // FULL_ROUTERS.menuList,
+ // data.data.permissions
+ // );
+ console.log(permissionsData);
+
+ let _menu = filterTreeData(FULL_ROUTERS.menuList, permissionsData);
fnAddDynamicMenuRoutes(_menu);
sessionStorage.setItem("menuList", JSON.stringify(_menu));
router.options.isAddDynamicMenuRoutes = true;
diff --git a/src/utils/index.js b/src/utils/index.js
index 31edfcf..81eeef1 100644
--- a/src/utils/index.js
+++ b/src/utils/index.js
@@ -136,6 +136,69 @@ function doHandleMonth(month) {
}
return m;
}
+/**
+ * 权限
+ * @param {*} min
+ * @param {*} max
+ */
+export function getMenu(role) {
+ if (role == "ROLE_MERCHANT" || role == "ROLE_MANAGER") {
+ return [
+ "operation-management",
+ "operation-management/commodity/index",
+ "operation-management/order/index",
+ "operation-management/banner/index",
+ "operation-management/notice/index",
+ "operation-management/role/index",
+ "datacenter",
+ "datacenter/customer-analysis/index",
+ "datacenter/product-analysis/index",
+ "datacenter/order-analysis/index",
+ "coupon/index",
+ "presale",
+ "presale/products/index",
+ "presale/order/index",
+ "marketing",
+ "marketing/level/index",
+ "marketing/user/index",
+ "marketing/points-setting/index",
+ "marketing/points-mall/index",
+ "marketing/points-order/index",
+ "local-course/resources",
+ "wallet/index",
+ "ogistics-fare",
+ "logistics-fare/logistics-template/index",
+ ];
+ } else if (role == "ROLE_BRAND_MANAGER") {
+ return [
+ "operation-management",
+ "operation-management/shop-list/index",
+ "operation-management/order/index",
+ "operation-management/role/index",
+ "datacenter",
+ "datacenter/customer-analysis/index",
+ "datacenter/product-analysis/index",
+ "datacenter/order-analysis/index",
+ "brand",
+ "brand/config/index",
+ "local-course/resources",
+ "wallet/index",
+ ];
+ } else if (role == "ROLE_AGENT") {
+ return [
+ "operation-management",
+ "operation-management/shop-list/index",
+ "operation-management/order/index",
+ "operation-management/role/index",
+ "datacenter",
+ "datacenter/customer-analysis/index",
+ "datacenter/product-analysis/index",
+ "datacenter/order-analysis/index",
+ "local-course/resources",
+ "wallet/index",
+ ];
+ }
+}
export function isNumberStr(str) {
return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str);
diff --git a/src/views/common/home.vue b/src/views/common/home.vue
index 743996c..c89f998 100644
--- a/src/views/common/home.vue
+++ b/src/views/common/home.vue
@@ -119,7 +119,7 @@ export default {
JSON.parse(sessionStorage.getItem("password")) == "123456" &&
JSON.parse(sessionStorage.getItem("role")) === "ROLE_BRAND_MANAGER"
) {
- this.dialogVisible = false;
+ this.dialogVisible = true;
}
},
methods: {
@@ -128,8 +128,9 @@ export default {
console.log(valid);
if (valid) {
this.$api.mer_admin
- .simplePassword({
- password: this.form.password,
+ .changePassword({
+ oldPassword: JSON.parse(sessionStorage.getItem("password")),
+ newPassword: this.form.password,
})
.then((res) => {
this.$api.logout().then(({ data }) => {
diff --git a/src/views/modules/marketing/user/index.vue b/src/views/modules/marketing/user/index.vue
index 11c8910..13a91f5 100644
--- a/src/views/modules/marketing/user/index.vue
+++ b/src/views/modules/marketing/user/index.vue
@@ -86,6 +86,35 @@