You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
92 lines
2.6 KiB
92 lines
2.6 KiB
define([
|
|
'text!./index.html',
|
|
"kefu-assets/api/kefu",
|
|
'css!./index.css'
|
|
], function (template, kefuApi) {
|
|
|
|
return {
|
|
name: "base-header",
|
|
template,
|
|
props: {
|
|
kefuInfo: {
|
|
type: Object,
|
|
default: function () {
|
|
return {}
|
|
}
|
|
},
|
|
online: {
|
|
type: Boolean,
|
|
default: true
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
menuList: [
|
|
{
|
|
key: 0,
|
|
title: '客户信息',
|
|
},
|
|
{
|
|
key: 1,
|
|
title: '交易订单',
|
|
},
|
|
// {
|
|
// key: 2,
|
|
// title: '商品信息',
|
|
// },
|
|
],
|
|
curIndex: 0,
|
|
isOnline: false
|
|
}
|
|
},
|
|
mounted() {
|
|
document.addEventListener('click', () => {
|
|
this.isOnline = false
|
|
})
|
|
},
|
|
methods: {
|
|
selectTab(item) {
|
|
this.curIndex = item.key;
|
|
this.bus.$emit('selectRightMenu', this.curIndex)
|
|
},
|
|
setOnline() {
|
|
this.isOnline = !this.isOnline
|
|
},
|
|
changeOnline(type) {
|
|
this.$emit('set-online', type);
|
|
this.isOnline = false;
|
|
},
|
|
// 退出登录
|
|
outLogin() {
|
|
this.$Modal.confirm({
|
|
title: '退出登录确认',
|
|
content: '您确定退出登录当前账户吗?',
|
|
onOk: () => {
|
|
kefuApi.logout()
|
|
.then(res => {
|
|
this.$Message.success(res.msg);
|
|
setTimeout(() => {
|
|
window.location.href = "/kefu/dashboard/login";
|
|
}, 500);
|
|
})
|
|
.catch(err => {
|
|
this.$Message.error(err.msg);
|
|
});
|
|
},
|
|
onCancel: () => {
|
|
|
|
}
|
|
});
|
|
|
|
},
|
|
// 搜索
|
|
bindSearch(e) {
|
|
this.$emit('search', e.target.value);
|
|
},
|
|
// inputChange
|
|
inputChange(e) {
|
|
this.bus.$emit('change', e.target.value)
|
|
}
|
|
}
|
|
};
|
|
}); |