Commit c3fe5707 by xinla

客户详情页面路由name

1 parent f5005800
......@@ -20,7 +20,8 @@ const common = {
PRIVACY: env.BASE_URL + 'static/PRIVACY.pdf', // 隐私协议pdf
IS_PUBLISH_DIALOG: false, // 是否显示发布弹窗
COOKIEEXPIRES: 0.5, // token在Cookie中存储的天数,默认0.5天
WORKWEIXINPAGENAME: 'EnterpriseWechat', // 企业微信设置页面路由name
WORK_WEIXIN_CONFIG_ROUTE_NAME: 'EnterpriseWechat', // 企业微信设置页面路由名称, 用于router 通过name判断与跳转,避免使用path不易于扩展
CUSTOMER_DETAIL_ROUTE_NAME: 'customerDetail', // 客户详情页面路由name,同上
DEFAULT_H5_PIC: env.DOMAIN + '/static/PIC.png',
DEFAULT_H5_ART: env.DOMAIN + '/static/ARTICAL.png', // 文章默认封面
DEFAULT_H5_TP: env.DOMAIN + '/static/TEXT_PIC.png', // 图文默认封面
......
......@@ -54,13 +54,13 @@ export default function permission(router) {
} else {
// 没有设置企业微信的
let isEnterpriseWechat = router.getRoutes().some((element) => {
return element.name === window.lwConfig.WORKWEIXINPAGENAME
return element.name === window.lwConfig.WORK_WEIXIN_CONFIG_ROUTE_NAME
})
// 若有设置企业微信的页面权限,默认跳转到设置企业微信页面
if (isEnterpriseWechat) {
Message.warning('初次使用,请配置企业微信的id,以使用其他功能')
next({
name: window.lwConfig.WORKWEIXINPAGENAME,
name: window.lwConfig.WORK_WEIXIN_CONFIG_ROUTE_NAME,
replace: true,
})
} else {
......
......@@ -113,14 +113,15 @@ export const loadView = (route) => {
res = modules[path]
// 为需要单独使用的路由命名,避免使用绝对路径跳转
// 组件路径: route name
let routeNames = {
'customerManage/customerDetail': 'customerDetail', // 客户详情
'customerManage/customerDetail': window.lwConfig.CUSTOMER_DETAIL_ROUTE_NAME, // 客户详情
'drainageCode/staff/list': 'staffCode', // 员工活码
'drainageCode/group/list': 'customerGroupCode', // 群活码
'drainageCode/store/list': 'storeCode', //门店活码
'drainageCode/identity/list': 'identityCode', //识客码
'drainageCode/pullNews/list': 'pullNewsCode', //拉新活码
'enterpriseWechat/list': window.lwConfig.WORKWEIXINPAGENAME, //企微配置
'enterpriseWechat/list': window.lwConfig.WORK_WEIXIN_CONFIG_ROUTE_NAME, //企微配置
}
routeNames[route.component] && (route.name = routeNames[route.component])
......
......@@ -194,7 +194,7 @@ export default {
goDetail(row) {
let { externalUserid, firstUserId: userId } = row
this.$router.push({
path: '/operateCenter/customerManage/customerDetail',
name: window.lwConfig.CUSTOMER_DETAIL_ROUTE_NAME,
query: { externalUserid, userId },
})
},
......
......@@ -249,7 +249,7 @@
show-overflow-tooltip />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button text @click="goDetail(scope.row.id)" v-if="scope.row.isCustomer">客户详情</el-button>
<el-button text @click="goDetail(scope.row)" v-if="scope.row.isCustomer">客户详情</el-button>
</template>
</el-table-column>
</el-table>
......@@ -584,6 +584,13 @@ export default {
this.loading = false
})
},
goDetail(row) {
let { externalUserid, firstUserId: userId } = row
this.$router.push({
name: window.lwConfig.CUSTOMER_DETAIL_ROUTE_NAME,
query: { externalUserid, userId },
})
},
},
mounted() {
this.dealLength()
......
......@@ -398,7 +398,7 @@ export default {
goRoute(row) {
let { externalUserid, firstUserId: userId } = row
this.$router.push({
path: 'customerDetail',
name: window.lwConfig.CUSTOMER_DETAIL_ROUTE_NAME,
query: { externalUserid, userId },
})
},
......
......@@ -75,7 +75,7 @@
v-hasPermi="['customerManage:dimission:edit']"
@click="
$router.push({
name: 'customerDetail',
name: window.lwConfig.CUSTOMER_DETAIL_ROUTE_NAME,
query: { externalUserid: row.externalUserid, userId: row.firstUserId, isDelete: true }
})
"
......
......@@ -276,7 +276,7 @@ export default {
<el-button
@click="
$router.push({
path: '/customerManage/customerManage/customer/customerDetail',
name: window.lwConfig.CUSTOMER_DETAIL_ROUTE_NAME,
query: {
externalUserid: row.externalUserid,
userId: row.firstUserId,
......
......@@ -26,7 +26,7 @@ export default {
callback: (action) => {
sessionStorage.setItem('currentActive', '4')
this.$router.push({
name: window.lwConfig.WORKWEIXINPAGENAME,
name: window.lwConfig.WORK_WEIXIN_CONFIG_ROUTE_NAME,
})
},
},
......@@ -41,7 +41,7 @@ export default {
callback: (action) => {
sessionStorage.setItem('currentActive', '3')
this.$router.push({
name: window.lwConfig.WORKWEIXINPAGENAME,
name: window.lwConfig.WORK_WEIXIN_CONFIG_ROUTE_NAME,
})
},
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!