Commit c1f0e6f1 by 无尘

feat: 增加路由

parent 08c441c2
/*
* @Descripttion: 指标管理 接口路径
* @version: 1.0.0
* @Author: 无尘
* @Date: 2020-11-09 10:15:36
* @LastEditors: 无尘
* @LastEditTime: 2020-11-09 10:17:03
*/
import getFetch from './get-fetch.js';
let api = {
// 指标管理
getTargetList: '/', // 获取指标列表
};
api = getFetch(api, '/hb-app-customer-web');
export default api;
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2020-07-16 16:37:05 * @Date: 2020-07-16 16:37:05
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2020-10-20 16:34:49 * @LastEditTime: 2020-11-09 10:23:38
*/ */
import _import from './_import.js'; import _import from './_import.js';
...@@ -216,6 +216,23 @@ export const routes = [ ...@@ -216,6 +216,23 @@ export const routes = [
component: _import('apps/customer-app', 'customer-assign') component: _import('apps/customer-app', 'customer-assign')
} }
] ]
},
{
path: '/target-manage',
name: '指标管理',
component: _import('apps/target-manage', 'index'),
children: [
{
path: '/target-list',
name: '指标列表',
component: _import('apps/target-manage', 'target-list')
},
{
path: '/target-set',
name: '下发设置',
component: _import('apps/target-manage', 'target-set')
},
]
} }
] ]
}, },
......
<!--
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2019-03-20 14:36:37
* @LastEditors: 无尘
* @LastEditTime: 2020-11-09 10:10:59
-->
<template>
<div class="my-customer-wrap common-set-wrap">
<nav-crumb :navpath="navpath" @selectBrandId="selectBrandId"> </nav-crumb>
<div class="right-content">
<div class="right-box" style="min-height: calc(100vh - 112px);">
<div class="apps-content flex" style="min-height: calc(100vh - 112px);">
<div class="apps-content-left w-157" style="min-height: calc(100vh - 112px);">
<common-detail-left :tab-list-data="tabListData" :active-sel-tab="activeSelTab" @setSelectTab="setSelectTab"> </common-detail-left>
</div>
<div class="apps-content-right">
<transition name="fade" mode="out-in">
<router-view :brand-id="activeBrand" :active-group-id="activeGroup" :tab-type="activeTab" @showTab="showTab"> </router-view>
</transition>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import navCrumb from '@/components/nav/nav-app.vue';
import commonDetailLeft from '@/components/app/app-detail-left.vue';
// import errMsg from '@/common/js/error';
// import showMsg from '@/common/js/showmsg';
export default {
name: 'Reviewed',
components: {
navCrumb,
commonDetailLeft
},
props: {
appMenuData: {
type: [ Array, Object ],
default() {
return [];
}
}
},
data() {
return {
wxEnterpriseId: localStorage.getItem('haoBanUser') ? JSON.parse(localStorage.getItem('haoBanUser')).wxEnterpriseId : '',
activeSelTab: '1',
activeTab: '1',
// 面包屑参数
navpath: [
{
name: '首页',
path: '/app-list'
},
{
name: '指标管理',
path: ''
}
],
tabListData: [
/* {
tabId: '1',
menuName: '指标列表',
iconUrl: 'iconweidu',
menuUrl: '/target-list',
children: []
},
{
tabId: '2',
menuName: '指标任务',
iconUrl: 'iconrenqun',
menuUrl: '/target-task',
children: []
},
{
tabId: '3',
menuName: '下发设置',
iconUrl: 'iconziliaocopy',
menuUrl: '/target-set',
children: []
}*/
],
activeBrand: '', // 商户(品牌) id
activeGroup: '', // 商户(品牌) groupId
};
},
mounted() {
const that = this;
that.tabListData = JSON.parse(JSON.stringify(that.appMenuData));
document.documentElement.style.backgroundColor = '#f0f2f5';
},
destroyed() {
document.documentElement.style.backgroundColor = '#fff';
},
methods: {
/**
* @description: 返回 的 brandId
* @param {String} id
* @param {String} groupId
* @author: 无尘
*/
selectBrandId(id, groupId) {
const that = this;
that.activeBrand = id;
that.activeGroup = groupId;
},
/**
* @description: 路由跳转
* @param {String} path
* @author: 无尘
*/
changeRoute(path) {
this.$router.push(path);
},
/**
* @description: 选择后返回menuUrl,做各路由判断
* @param {Object} item
* @author: 无尘
*/
setSelectTab(item) {
const that = this;
that.activeTab = item.menuUrl;
if (item.target == 1) {
if (item.menuUrl.indexOf('http') != -1) {
window.open(item.menuUrl);
}else {
window.open(`/haoban-4${item.menuUrl}`);
}
}else {
that.$router.push(`${item.menuUrl}?applicationId=${that.$route.query.applicationId}`);
}
},
/**
* @description: 各路由返回 menuUrl
* @param {String} menuUrl
* @author: 无尘
*/
showTab(menuUrl) {
const that = this;
that.activeTab = menuUrl;
that.activeSelTab = menuUrl;
}
},
watch: {
activeBrand: function(newData, oldData) {
const that = this;
that.activeBrand = newData;
},
appMenuData: function(newData, oldData) {
const that = this;
that.tabListData = JSON.parse(JSON.stringify(newData));
// that.setCurrent();
}
}
};
</script>
<style type="text/less" lang="less" scoped>
.line-h-18 {
line-height: 18px;
}
.my-customer-wrap {
height: 100%;
// 拖拽排序公共样式
.move-row-cell {
.icontuozhuaiopen {
display: none;
}
&.show-icon {
.icontuozhuaiopen {
display: inline-block;
vertical-align: middle;
}
}
&:hover {
.icontuozhuaiopen {
display: inline-block;
vertical-align: middle;
}
}
}
}
.right-content {
/*width: 100%;*/
padding: 0 20px 20px 20px;
min-height: calc(100% - 160px);
.right-box {
background: #fff;
min-height: 500px;
padding: 0px;
.apps-content {
.apps-content-left {
min-width: 205px;
height: 100%;
background: #fff;
overflow-x: hidden;
overflow-y: auto;
}
.apps-content-right {
width: calc(100% - 205px);
padding-left: 10px;
background: #f0f2f5;
.common-app-right {
height: 100%;
padding: 20px;
box-sizing: border-box;
background: #fff;
&.no-padding {
padding: 0;
}
.font-22 {
font-size: 22px;
}
}
}
}
}
}
</style>
<!--
* @Descripttion: 指标设置
* @version: 1.0.0
* @Author: 无尘
* @Date: 2020-11-09 10:05:27
* @LastEditors: 无尘
* @LastEditTime: 2020-11-09 10:26:18
-->
<!-- -->
<template>
<div>
</div>
</template>
<script>
export default {
name: 'QuotaSet',
components: {},
data() {
return {
};
},
// 生命周期 - 挂载完成(访问DOM元素)
// mounted() {
// },
// methods
methods: {
},
watch: {}
};
</script>
<style lang='less' scoped>
</style>
<!--
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2020-08-27 11:36:51
* @LastEditors: 无尘
* @LastEditTime: 2020-11-09 10:21:49
-->
<template>
<div class="common-app-right">
<div>
</div>
</div>
</template>
<script>
import fetch from '@/api/target-manage-app.js';
const { getTargetList } = fetch;
// import showMsg from '@/common/js/showmsg.js';
export default {
name: 'TargetList',
components: {},
props: {
brandId: {
type: String,
default: ''
}
},
data() {
return {
wxEnterpriseId: localStorage.getItem('haoBanUser') ? JSON.parse(localStorage.getItem('haoBanUser')).wxEnterpriseId : '',
tableData: []
};
},
// 生命周期 - 挂载完成(访问DOM元素)
mounted() {
const that = this;
that.$emit('showTab', '/target-list');
if (!!that.brandId) {
that.getData();
}
},
// methods
methods: {
/**
* @description: 获取会员卡数据
* @author: 无尘
*/
getData() {
const that = this;
const para = {
wxEnterpriseId: that.wxEnterpriseId,
enterpriseId: that.brandId
};
getTargetList(para, { headers: { sign: that.brandId } })
.then(res => {
that.tableData = res.result || [];
})
.catch(function(error) {
});
},
},
watch: {
brandId(val) {
const that = this;
if (val) {
that.getData();
}
}
}
};
</script>
<style lang='less' scoped>
.font-22 {
font-size: 22px;
}
.common-bottom-border {
cursor: pointer;
padding-bottom: 2px;
border-bottom: 1px dashed #2f54eb;
&.table-title {
font-size: 14px;
line-height: 20px;
font-weight: 600;
color: #303133;
}
}
</style>
<!--
* @Descripttion: 下发设置
* @version: 1.0.0
* @Author: 无尘
* @Date: 2020-11-09 10:05:27
* @LastEditors: 无尘
* @LastEditTime: 2020-11-09 10:22:49
-->
<!-- -->
<template>
<div>
</div>
</template>
<script>
export default {
name: 'TargetSet',
components: {},
data() {
return {
};
},
// 生命周期 - 挂载完成(访问DOM元素)
// mounted() {
// },
// methods
methods: {
},
watch: {}
};
</script>
<style lang='less' scoped>
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment