Commit 88709a66 by xinla

2.0修改

1 parent af328321
<script>
export default {
name: 'ButtonSync',
props: {
customeBtn: {
type: Boolean,
default: false
},
lastSyncTime: {
type: [String, Number],
default: 0
}
},
components: {},
data() {
return {}
},
computed: {
disabled() {
return this.lastSyncTime ? (+new Date() - +new Date(this.lastSyncTime)) / 3600000 < 2 : true
}
},
watch: {},
created() {},
mounted() {},
methods: {
sync() {
// if (this.disabled) {
// this.msgError('由于企业微信开放平台的限制,两小时内不得重复同步操作')
// return
// }
this.$emit('click')
}
}
}
</script>
<template>
<el-tooltip
effect="light"
:disabled="!disabled"
class="item"
content="由于企业微信开放平台的限制,两小时内不得重复同步操作"
placement="top-start"
>
<el-tag v-if="disabled" type="info" size="default"><slot></slot></el-tag>
<el-button v-else v-preventReClick type="primary" @click="sync">
<slot></slot>
</el-button>
</el-tooltip>
</template>
<style lang="less" scoped></style>
......@@ -160,13 +160,6 @@ export default {
</div>
</el-dialog>
</template>
<style>
.el-tag.el-tag--info {
background-color: #f4f4f5;
border-color: #e9e9eb;
color: #909399;
}
</style>
<style lang="scss" scoped>
.user-list {
.el-row {
......
......@@ -9,7 +9,7 @@ import Element from 'element-ui'
import './styles/element-variables.scss'
Vue.use(Element, {
size: Cookies.get('size') || 'small', // set element-ui default size
size: Cookies.get('size') || 'small' // set element-ui default size
})
import '@/styles/common.scss' // common css
......@@ -33,13 +33,14 @@ import {
selectDictLabel,
selectDictLabels,
download,
handleTree,
handleTree
} from '@/utils/common'
import Pagination from '@/components/Pagination'
//自定义表格工具扩展
import RightToolbar from '@/components/RightToolbar'
import Upload from '@/components/Upload'
import ButtonSync from '@/components/ButtonSync'
// 全局方法挂载
Vue.prototype.getDicts = getDicts
......@@ -86,14 +87,15 @@ VueAMap.initAMapApiLoader({
'AMap.ToolBar',
'AMap.MapType',
'AMap.PolyEditor',
'AMap.CircleEditor',
'AMap.CircleEditor'
],
v: '1.4.4',
v: '1.4.4'
})
// 全局组件挂载
Vue.component('Pagination', Pagination)
Vue.component('RightToolbar', RightToolbar)
Vue.component('Upload', Upload)
Vue.component('ButtonSync', ButtonSync)
Vue.use(directive)
......@@ -112,5 +114,5 @@ new Vue({
el: '#app',
router,
store,
render: (h) => h(App),
render: (h) => h(App)
})
......@@ -8,7 +8,7 @@ $--color-primary: #0079de;
$--color-success: #06c160;
$--color-warning: #ffcf0e;
$--color-danger: #e74e59;
$--color-info: #fa7216;
// $--color-info: #fa7216;
// $--color-info: #1E1E1E;
$--button-font-weight: 400;
......
......@@ -58,11 +58,7 @@ export default {
}
},
watch: {},
computed: {
isSync() {
return (+new Date() - +new Date(this.lastSyncTime)) / 3600000 < 2
}
},
computed: {},
created() {
this.getList()
this.getListTag()
......@@ -206,10 +202,6 @@ export default {
// this.$refs.selectTag.$forceUpdate()
},
sync() {
if (this.isSync) {
this.msgError('由于企业微信开放平台的限制,两小时内不得重复同步操作')
return
}
const loading = this.$loading({
lock: true,
text: 'Loading',
......@@ -418,21 +410,7 @@ export default {
<!-- 共
<span class="num">{{ total }}</span> 位客户,实际客户
<span class="num">{{ total }}</span> 位。 -->
<el-tooltip
effect="light"
:disabled="!isSync"
class="item"
content="由于企业微信开放平台的限制,两小时内不得重复同步操作"
placement="top-start"
>
<el-button
v-hasPermi="['customerManage:customer:sync']"
v-preventReClick
type="primary"
@click="sync"
>同步客户</el-button
>
</el-tooltip>
<ButtonSync :lastSyncTime="lastSyncTime" @click="sync">同步客户</ButtonSync>
<!-- <el-button v-hasPermi="['customerManage:customer:checkRepeat']" type="primary">查看重复客户</el-button> -->
<span class="sub-text-color"> 最近同步:{{ lastSyncTime }} </span>
</div>
......
......@@ -30,7 +30,7 @@ export default {
}
},
computed: {
isSync() {
disabled() {
return (+new Date() - +new Date(this.lastSyncTime)) / 3600000 < 2
}
},
......@@ -82,10 +82,6 @@ export default {
this.active = type
},
sync() {
if (this.isSync) {
this.msgError('由于企业微信开放平台的限制,两小时内不得重复同步操作')
return
}
this.openTrack = ['0']
this.active = '0'
this.$refs['record'][0].$forceUpdate()
......@@ -189,22 +185,10 @@ export default {
<el-card>
<div slot="header">
<span class="card-title">客户轨迹</span>
<el-tooltip
effect="light"
:disabled="!isSync"
class="item"
content="由于企业微信开放平台的限制,两小时内不得重复同步操作"
placement="top-start"
<ButtonSync class="btn-sync" :lastSyncTime="lastSyncTime" @click="sync"
>同步</ButtonSync
>
<el-button
v-preventReClick
style="color: #13a2e8;padding: 0;"
class="fr cp"
type="text"
@click="sync"
>同步</el-button
>
</el-tooltip>
</div>
<div class="flex track-tab-wrap mb15">
<div
......@@ -266,4 +250,9 @@ export default {
}
}
}
.btn-sync {
position: relative;
float: right;
top: -11px;
}
</style>
......@@ -60,6 +60,11 @@ export default {
getDetail() {
getDetail(this.$route.query).then(({ data }) => {
data.companyTags && (data.companyTags = data.companyTags.split(','))
if (data.trackUsers && data.trackUsers.length > 1) {
data.trackUsers.unshift({
userName: '客户画像汇总'
})
}
this.customer = data
this.birthday = data.birthday
})
......@@ -137,9 +142,6 @@ export default {
</el-card>
<el-tabs value="0">
<el-tab-pane label="客户画像汇总">
<info-tab></info-tab>
</el-tab-pane>
<el-tab-pane v-for="(item, index) of customer.trackUsers" :key="index" :label="item.userName">
<info-tab :userId="item.trackUserId"></info-tab>
</el-tab-pane>
......
......@@ -41,11 +41,7 @@ export default {
makeLabelCustomerList: []
}
},
computed: {
isSync() {
return (+new Date() - +new Date(this.lastSyncTime)) / 3600000 < 2
}
},
computed: {},
created() {
this.getList()
},
......@@ -143,10 +139,6 @@ export default {
this.getList(1)
},
sync() {
if (this.isSync) {
this.msgError('由于企业微信开放平台的限制,两小时内不得重复同步操作')
return
}
const loading = this.$loading({
lock: true,
text: 'Loading',
......@@ -228,9 +220,8 @@ export default {
<div class="">
<!-- 己选
<span class="num">{{total}}</span> 个客户群-->
<el-button v-hasPermi="['customerManage:group:sync']" type="primary" @click="sync"
>同步客户群</el-button
>
<ButtonSync :lastSyncTime="lastSyncTime" @click="sync">同步客户群</ButtonSync>
<span class="sub-text-color">
最近同步:{{ lastSyncTime }}
<!-- <span class="num">{{total}}</span> 条信息 ,
......
......@@ -46,11 +46,7 @@ export default {
lastSyncTime: 0
}
},
computed: {
isSync() {
return (+new Date() - +new Date(this.lastSyncTime)) / 3600000 < 2
}
},
computed: {},
created() {
// this.query.groupTagType = this.type
this.getList()
......@@ -78,10 +74,6 @@ export default {
this.dialogVisible = true
},
syncTag() {
if (this.isSync) {
this.msgError('由于企业微信开放平台的限制,两小时内不得重复同步操作')
return
}
const loading = this.$loading({
lock: true,
text: 'Loading',
......@@ -125,20 +117,16 @@ export default {
<div class="">
<div class="mid-action">
<div>
<el-button v-hasPermi="['customerManage:tag:add']" type="primary" @click="edit()"
<el-button
v-hasPermi="['customerManage:tag:add']"
type="primary"
class="mr10"
@click="edit()"
>新建标签组</el-button
>
<el-tooltip
effect="light"
:disabled="!isSync"
class="item"
content="由于企业微信开放平台的限制,两小时内不得重复同步操作"
placement="top-start"
>
<el-button v-if="type == 1" v-preventReClick type="primary" plain @click="syncTag">
同步企微标签
</el-button>
</el-tooltip>
<ButtonSync v-if="type == 1" :lastSyncTime="lastSyncTime" @click="syncTag">
同步企微标签
</ButtonSync>
</div>
<div>
<el-button
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!