Commit 23b0a527 by ext.wangyuman1

上传代码

1 parent 8a951649
...@@ -81,6 +81,11 @@ export const constantRoutes = [ ...@@ -81,6 +81,11 @@ export const constantRoutes = [
isNoLogin: true, isNoLogin: true,
}, },
}, },
{
path: '/preview',
component: (resolve) => require(['@/views/contentCenter/components/preview'], resolve),
hidden: true,
},
// { // {
// path: '', // path: '',
// component: Layout, // component: Layout,
......
...@@ -591,7 +591,7 @@ export default { ...@@ -591,7 +591,7 @@ export default {
:label="item.label" :label="item.label"
:value="item.value"></el-option> :value="item.value"></el-option>
</el-select> </el-select>
<el-button class="ml10" type="primary" @click="getList(1)">查询</el-button> <el-button style="margin-left:10px" type="primary" @click="getList(1)">查询</el-button>
<el-button @click="resetQuery">重置</el-button> <el-button @click="resetQuery">重置</el-button>
</div> </div>
<div class="mt20 g-card pad20"> <div class="mt20 g-card pad20">
...@@ -612,7 +612,7 @@ export default { ...@@ -612,7 +612,7 @@ export default {
<el-button size="mini" @click="groupDialogVisible = false">取消</el-button> <el-button size="mini" @click="groupDialogVisible = false">取消</el-button>
<el-button type="primary" size="mini" @click="moveGroup">确定</el-button> <el-button type="primary" size="mini" @click="moveGroup">确定</el-button>
</div> </div>
<el-button slot="reference" class="mr10" :disabled="selected.length === 0" type="primary"> <el-button slot="reference" style="margin-right:10px" :disabled="selected.length === 0" type="primary">
批量分组 批量分组
</el-button> </el-button>
</el-popover> </el-popover>
......
<template>
<div class="itemList">
<div class="content bfc-o">
<div class="title">{{ weMaterialVo.materialName }}</div>
<!-- 文章 -->
<div class="centerStyle" v-if="weMaterialVo.mediaType == 12">
<el-image
class="img-style"
fit="contain"
:src="weMaterialVo.coverUrl"
v-if="weMaterialVo.coverUrl"
/>
<svg-icon class="icon-style" iconClass="article" v-else></svg-icon>
<div class="contentStyle">{{ weMaterialVo.digest }}</div>
</div>
<!-- 视频 -->
<div class="centerStyle" v-if="weMaterialVo.mediaType == 2">
<el-image class="img-style" :src="weMaterialVo.coverUrl" />
<div class="contentStyle">{{ weMaterialVo.digest }}</div>
</div>
<!-- 海报 -->
<div class="centerStyle" v-if="weMaterialVo.mediaType == 5">
<el-image
class="img-style"
fit="contain"
:src="weMaterialVo.materialUrl"
v-if="weMaterialVo.materialUrl"
/>
<svg-icon class="icon-style" iconClass="pic" v-else></svg-icon>
<div class="contentStyle">{{ weMaterialVo.digest }}</div>
</div>
<!-- 文件 -->
<div v-if="weMaterialVo.mediaType === '3'" style="display: flex">
<svg-icon
class="icon-style"
:iconClass="weMaterialVo.materialUrl ? filType(weMaterialVo.materialUrl) : ''"
v-if="weMaterialVo.materialUrl"
></svg-icon>
<span class="contentStyle">{{ weMaterialVo.digest }}</span>
</div>
</div>
<div class="info">
<div class="flex fr">
<div
v-if="['2', '5', '9'].includes(weMaterialVo.mediaType)"
class="preview"
>
<a :href="weMaterialVo.materialUrl" target="_blank">预览</a>
</div>
<div v-if="weMaterialVo.mediaType === '12'" class="preview" @click="preview(weMaterialVo)">
预览
</div>
<a
target="_blank"
:href="dealUrl(weMaterialVo.materialUrl)"
class="preview"
v-if="weMaterialVo.mediaType == '3'"
>预览</a
>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {}
},
methods: {
// preview(obj) {
// if (obj.id !== '0' && obj.id !== '4') {
// this.$router.push({
// name: 'previewDetail',
// query: {
// obj: obj,
// },
// })
// }
// },
dealUrl(url) {
return window.lwConfig.PRIVIEW_URL + encodeURIComponent(this.base64Encode(url))
},
base64Encode(str) {
if (str === undefined || str === '' || str === null) {
return str
}
return btoa(
encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function toSolidBytes(match, p1) {
return String.fromCharCode('0x' + p1)
})
)
},
preview(row) {
let routeData = this.$router.resolve({
path: '/preview',
query: { obj: encodeURIComponent(JSON.stringify(row)) },
})
window.open(routeData.href, '_blank')
},
// 处理文件类型
filType(file) {
let filecontent = JSON.parse(JSON.stringify(file))
filecontent = filecontent.split('.')
let type = filecontent[filecontent.length - 1]
if (type === 'pdf') {
return 'pdf'
} else if (type === 'doc' || type === 'docx') {
return 'word'
} else if (type === 'ppt' || type === 'pptx' || type === 'pps' || type === 'pptsx') {
return 'ppt'
} else {
return ''
}
},
},
props: {
weMaterialVo: {
type: Object,
default: {},
},
},
}
</script>
<style lang="scss" scoped>
.preview {
width: 50px;
height: 20px;
font-size: 12px;
background-color: #fff;
border: 1px solid #0079de;
border-radius: 10px;
color: #0079de;
line-height: 20px;
text-align: center;
margin-right: 6px;
}
.title {
font-weight: 700;
font-size: 12px;
color: #333;
line-height: 18px;
width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-bottom: 6px;
}
.icon-style {
width: 40px;
height: 40px;
}
.itemList {
width: 60%;
margin: 10px;
background-color: #eaeaea;
padding: 10px;
border-radius: 4px;
}
.info {
height: 20px;
.fr {
cursor: pointer;
}
}
.centerStyle {
display: flex;
width: 100%;
justify-content: space-between;
.contentStyle {
font-size: 12px;
color: #aaaaaa;
width: calc(100% - 60px);
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
height: 28px;
margin-top: 20px;
}
.img-style {
width: 60px;
height: 60px;
}
}
</style>
<script> <script>
import { getFollowUpRecord, syncTrack } from '@/api/customer' import { getFollowUpRecord, syncTrack } from '@/api/customer'
import { dictTrackState } from '@/utils/dictionary' import { dictTrackState } from '@/utils/dictionary'
import { dateFormat } from '@/utils' import { dateFormat } from '@/utils'
import { getList } from '@/api/salesCenter/businessConver.js' import { getList } from '@/api/salesCenter/businessConver.js'
import MaterialCard from './MaterialCard.vue'
export default { export default {
name: '', name: '',
props: { props: {
// 当前跟进人id // 当前跟进人id
userId: { userId: {
type: String, type: String,
default: null default: null,
},
// 所有跟进人id(用于客户画像汇总的同步)
userIdAll: {
type: String,
default: null
},
// 1:客户动态;2:员工动态;3:互动动态;4:跟进动态
trajectoryType: {
type: String,
default: null
},
// 视图展示类型 1:表格展示,2:轨迹时间线展示
viewType: {
type: String,
default: ''
},
lastSyncTime: String
}, },
components: {}, // 所有跟进人id(用于客户画像汇总的同步)
data() { userIdAll: {
return { type: String,
stageList: [], default: null,
query: {
pageNum: 0,
pageSize: 10,
externalUserid: '', // 是 当前客户id
userId: null, // 当前跟进人id,
trajectoryType: null // 1:客户动态;2:员工动态;3:互动动态;4:跟进动态
},
loading: false,
total: 0,
list: [], // 列表
dictTrackState,
dateFormat,
goto: true
}
}, },
computed: {}, // 1:客户动态;2:员工动态;3:互动动态;4:跟进动态
watch: {}, trajectoryType: {
created() { type: String,
this.viewType && this.getList(1) default: null,
this.getStage()
}, },
mounted() {}, // 视图展示类型 1:表格展示,2:轨迹时间线展示
methods: { viewType: {
getStage() { type: String,
getList().then((res) => { default: '',
this.stageList = res.data },
}) lastSyncTime: String,
}, },
setValue(data) { components: { MaterialCard },
let str = '' data() {
this.stageList.forEach((dd) => { return {
if (dd.stageVal == data) { stageList: [],
str = dd.stageKey query: {
} pageNum: 0,
}) pageSize: 10,
return str externalUserid: '', // 是 当前客户id
userId: null, // 当前跟进人id,
trajectoryType: null, // 1:客户动态;2:员工动态;3:互动动态;4:跟进动态
}, },
/** 查询 */ loading: false,
getList(page) { total: 0,
Object.assign(this.query, { list: [], // 列表
externalUserid: this.$route.query.externalUserid, dictTrackState,
weUserId: this.userId, dateFormat,
trajectoryType: this.trajectoryType goto: true,
}) }
if (this.viewType) { },
page && (this.query.pageNum = page) computed: {},
} else { watch: {},
this.query.pageNum++ created() {
if (this.query.pageNum > 1 && this.goto) { this.viewType && this.getList(1)
return this.getStage()
} },
mounted() {},
methods: {
getStage() {
getList().then((res) => {
this.stageList = res.data
})
},
setValue(data) {
let str = ''
this.stageList.forEach((dd) => {
if (dd.stageVal == data) {
str = dd.stageKey
}
})
return str
},
/** 查询 */
getList(page) {
Object.assign(this.query, {
externalUserid: this.$route.query.externalUserid,
weUserId: this.userId,
trajectoryType: this.trajectoryType,
})
if (this.viewType) {
page && (this.query.pageNum = page)
} else {
this.query.pageNum++
if (this.query.pageNum > 1 && this.goto) {
return
} }
this.loading = true }
getFollowUpRecord(this.query) this.loading = true
.then(({ rows, total, lastSyncTime }) => { getFollowUpRecord(this.query)
if (this.viewType) { .then(({ rows, total, lastSyncTime }) => {
this.list = rows if (this.viewType) {
this.list = rows
} else {
if (rows.length === this.total) {
this.goto = false
} else { } else {
if (rows.length === this.total) { this.goto = true
this.goto = false }
} else { let list = []
this.goto = true let dayList = []
}
let list = []
let dayList = []
// 提取天 // 提取天
rows.forEach((ele) => { rows.forEach((ele) => {
let date = this.dateFormat(ele.createTime, 'yyyyMMdd') let date = this.dateFormat(ele.createTime, 'yyyyMMdd')
dayList.includes(date) || dayList.push(date) dayList.includes(date) || dayList.push(date)
}) })
dayList.sort((a, b) => b - a) dayList.sort((a, b) => b - a)
// 提取每天的时间点 // 提取每天的时间点
for (let i = 0; i < dayList.length; i++) { for (let i = 0; i < dayList.length; i++) {
let timeList = [] let timeList = []
for (let j = 0; j < rows.length; j++) { for (let j = 0; j < rows.length; j++) {
// console.log(rows[j].createTime); // console.log(rows[j].createTime);
if (dayList[i] == this.dateFormat(rows[j].createTime, 'yyyyMMdd')) { if (dayList[i] == this.dateFormat(rows[j].createTime, 'yyyyMMdd')) {
timeList.push(rows[j]) timeList.push(rows[j])
}
} }
list.push(timeList)
} }
list.push(timeList)
this.list = this.list.concat(list)
} }
this.total = +total
this.$emit('update:lastSyncTime', lastSyncTime) this.list = this.list.concat(list)
this.loading = false }
}) this.total = +total
.catch(() => { this.$emit('update:lastSyncTime', lastSyncTime)
this.loading = false this.loading = false
}) })
}, .catch(() => {
sync() { this.loading = false
this.loading = true })
syncTrack(this.userId || this.userIdAll) },
.then(() => { sync() {
this.getList(1) this.loading = true
this.msgSuccess('后台开始同步数据,请稍后关注进度') syncTrack(this.userId || this.userIdAll)
this.loading = false .then(() => {
}) this.getList(1)
.catch((fail) => { this.msgSuccess('后台开始同步数据,请稍后关注进度')
this.loading = false this.loading = false
console.error(fail) })
}) .catch((fail) => {
} this.loading = false
} console.error(fail)
} })
},
},
}
</script> </script>
<template> <template>
...@@ -179,7 +180,7 @@ ...@@ -179,7 +180,7 @@
</template> </template>
<div v-else class="timeline-time-wrap"> <div v-else class="timeline-time-wrap">
<ul class="infinite-list" v-infinite-scroll="getList" style="overflow: auto;"> <ul class="infinite-list" v-infinite-scroll="getList" style="overflow: auto">
<!-- --> <!-- -->
<template v-if="list.length"> <template v-if="list.length">
<li v-for="(unit, i) in list" class="infinite-list-item" :key="i"> <li v-for="(unit, i) in list" class="infinite-list-item" :key="i">
...@@ -195,6 +196,7 @@ ...@@ -195,6 +196,7 @@
> >
<p class="timeline-box-item-title">{{ item.title || '无标题' }}</p> <p class="timeline-box-item-title">{{ item.title || '无标题' }}</p>
<p>{{ item.content || '无内容' }}</p> <p>{{ item.content || '无内容' }}</p>
<MaterialCard v-if="item.weMaterialVo" :weMaterialVo="item.weMaterialVo" />
</el-timeline-item> </el-timeline-item>
</el-timeline> </el-timeline>
</li> </li>
...@@ -206,40 +208,40 @@ ...@@ -206,40 +208,40 @@
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
// .timeline-time-wrap { // .timeline-time-wrap {
// } // }
.infinite-list-item { .infinite-list-item {
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
&:last-child { &:last-child {
border: 0; border: 0;
}
}
.timeline-time {
font-size: 14px;
color: #999999;
line-height: 48px;
}
.el-timeline > .timeline-box-item:first-child ::v-deep .el-timeline-item__node {
border-radius: 0 !important;
} }
.timeline-box { }
padding-left: 70px; .timeline-time {
&-item { font-size: 14px;
::v-deep .el-timeline-item__timestamp { color: #999999;
position: absolute; line-height: 48px;
top: 4px; }
left: -45px; .el-timeline > .timeline-box-item:first-child ::v-deep .el-timeline-item__node {
margin: 0; border-radius: 0 !important;
} }
.timeline-box {
padding-left: 70px;
&-item {
::v-deep .el-timeline-item__timestamp {
position: absolute;
top: 4px;
left: -45px;
margin: 0;
}
&-title { &-title {
font-weight: 700; font-weight: 700;
line-height: 25px; line-height: 25px;
}
} }
} }
}
::v-deep .el-timeline-item__tail { ::v-deep .el-timeline-item__tail {
border-left-color: var(--color); border-left-color: var(--color);
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!