Commit a2480426 by zhangxw

Merge branch 'master' of http://192.168.3.233:8090/saas/scrm-micro-marketing int…

…o zhangxw_dev_v2.11.1
2 parents bb804e75 e528cc0f
......@@ -17,7 +17,6 @@
"lodash": "^4.17.21",
"node-sass": "^4.0.0",
"vue": "^2.6.10",
"vue-amap": "^0.5.10",
"vue-router": "^3.1.3",
"vuedraggable": "^2.24.3",
"vuex": "^3.1.2",
......
......@@ -45,10 +45,34 @@ const getBrowseListApi = params => {
sign: true
})
}
//众筹活动访客明细
const getVisitorListApi = params => {
params.method = 'scrm.api.shopmall.customer.visitor.records'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
// 众筹活动分享明细
const getSharedListApi = params => {
params.method = 'scrm.api.shopmall.customer.shared.records'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
// 分页浏览-导出
const exportBrowseApi = params => {
params.method = 'scrm.api.shopmall.customer.browse.records.export'
const exportBrowseApi = (params, TYPE = 1) => {
//TYPE 1 浏览 2 访客 3 分享
params.method = {
1: 'scrm.api.shopmall.customer.browse.records.export',
2: 'scrm.api.shopmall.customer.visitor.records.export',
3: 'scrm.api.shopmall.customer.shared.records.export'
}[TYPE]
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
......@@ -137,5 +161,45 @@ const getCrowdSharedApi = params => {
sign: true
})
}
/**直播间下拉列表 */
const getLiveListApi = params => {
params.method = 'scrm.api.shopmall.livebroadcast.dropdown.list'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
export default { getActivityPageApi, getCrowdfundListApi, exportCrowdfundApi, getBrowseListApi, exportBrowseApi, toggleStatusApi, deleteActivityApi, topActivityApi, getSharedApi, addOrUpdateActivityApi, getActivityDetailApi, getCrowdSharedApi }
/**数据看板员工排名 */
const getRankListApi = params => {
params.method = 'scrm.api.shopmall.activity.ranking.page'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
// 数据看板员工-导出
const exportRankListApi = params => {
params.method = 'scrm.api.shopmall.activity.ranking.export'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
/**数据看板 */
const getDataBoardApi = params => {
params.method = 'scrm.api.shopmall.activity.statdata'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
export default { getActivityPageApi, getCrowdfundListApi, exportCrowdfundApi, getBrowseListApi, exportBrowseApi, toggleStatusApi, deleteActivityApi, topActivityApi, getSharedApi, addOrUpdateActivityApi, getActivityDetailApi, getCrowdSharedApi, getLiveListApi, getRankListApi, exportRankListApi, getDataBoardApi, getVisitorListApi, getSharedListApi }
<template>
<div class="map-box" :style="{ height: mapHeight + 'px' }">
<div id="container" style="width: 100%; height: 100%"></div>
<div class="map-address">{{ address }}</div>
<div id="myPageTop" style="position: absolute; top: 10px; width: 50%; left: 25%">
<el-input placeholder="请输入关键字" v-model="input" class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="searchAddress"></el-button>
</el-input>
<div class="map-box" :style="{ height: mapHeight + 'px', width: mapWidth + 'xp' }">
<div id="container">
<el-select v-model="input" class="map-input" filterable remote reserve-keyword placeholder="请输入" :remote-method="remoteMethod" @change="handleChangeAdr" :loading="loading">
<el-option v-for="item in adrList" :key="item.id" :label="item.address" :value="item.id"></el-option>
</el-select>
</div>
<div class="map-address">
<img class="icon-map" src="./images/icon-map.png" />
{{ address }}
</div>
</div>
</template>
......@@ -16,43 +18,90 @@ export default {
props: {
mapHeight: {
type: Number,
default: 300
default: 460
},
mapWidth: {
type: Number,
default: 740
}
},
data() {
return {
input: '',
input: [],
address: '',
adrList: [],
lnglat: [],
geocoderAddress: {}
}
},
mounted() {
this.mapInit()
},
methods: {
// initMap() {
// console.log(document.getElementsByTagName('head'))
// var script = document.createElement('script')
// script.type = 'text/javascript'
// script.src = 'https://webapi.amap.com/loader.js'
// document.getElementsByTagName('head')[0].appendChild(script)
// },
mapInit() {
map = new AMap.Map('container', {
resizeEnable: true,
zoom: 20
/* eslint-disable */
AMapLoader.load({
/* eslint-enable */
key: '44cc16e43ad7ed3358df507bd0618181', // 申请好的Web端开发者Key,首次调用 load 时必填
version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
// 需要使用的的插件列表
plugins: ['AMap.ToolBar', 'AMap.Scale', 'AMap.Geocoder'],
AMapUI: {
// 是否加载 AMapUI,缺省不加载
version: '1.1', // AMapUI 版本
plugins: ['overlay/SimpleMarker'] // 需要加载的 AMapUI ui插件
},
Loca: {
// 是否加载 Loca, 缺省不加载
version: '2.0' // Loca 版本
}
})
AMap.plugin(['AMap.PlaceSearch'], function () {
//构造地点查询类
placeSearch = new AMap.PlaceSearch({
pageSize: 8, // 单页显示结果条数
pageIndex: 1, // 页码
citylimit: false, //是否强制限制在设置的城市内搜索
// panel: "panel", // 结果列表将在此容器中进行展示。
autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
renderStyle: 'default'
.then(AMap => {
map = new AMap.Map('container', {
zoom: 20,
autoFitView: true,
resizeEnable: true,
cursor: 'move'
})
if (this.lnglat.length) {
this.addMarker(this.lnglat)
}
map.addControl(new AMap.Scale())
map.addControl(new AMap.ToolBar())
this.geocoder = new AMap.Geocoder()
map.setDefaultCursor('pointer')
AMap.plugin(['AMap.PlaceSearch'], function () {
//构造地点查询类
placeSearch = new AMap.PlaceSearch({
pageSize: 8, // 单页显示结果条数
pageIndex: 1, // 页码
citylimit: false, //是否强制限制在设置的城市内搜索
// panel: "panel", // 结果列表将在此容器中进行展示。
autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
renderStyle: 'default'
})
})
map.on('click', this.getAddress)
})
.catch(e => {
console.error(e) //加载错误提示
})
})
// 添加列表点选监听事件
map.on('click', this.getAddress)
},
searchAddress() {
remoteMethod(query) {
if (query == '') {
return true
}
let _this = this
placeSearch.search(this.input, function (status, result) {
placeSearch.search(query, function (status, result) {
if (status === 'complete' && result.poiList.pois.length) {
let lnglat = result.poiList.pois[0].location
_this.getAddress(lnglat)
_this.adrList = result.poiList.pois
}
})
},
......@@ -63,63 +112,76 @@ export default {
} else {
position = lnglat
}
this.lnglat = position
marker = new AMap.Marker({
map: map,
icon: new AMap.Icon({
image: '//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png',
size: new AMap.Size(27, 34), //图标大小
imageSize: new AMap.Size(27, 34)
}),
// draggable: true,
position: position,
offset: new AMap.Pixel(-10, -10)
})
map.setCenter(position)
map.add(marker)
map.setFitView()
marker.setMap(map)
// this.map.setFitView()
},
getAddress(e) {
let self = this
let lnglat
let position
if (e.type == 'click') {
lnglat = e.lnglat
position = e.lnglat
} else {
let { lng, lat } = e
lnglat = [lng, lat]
position = [lng, lat]
}
if (marker) {
map.remove(marker)
marker.setMap(null)
marker = null
}
self.addMarker(lnglat)
self.addMarker(position)
AMap.plugin('AMap.Geocoder', () => {
const geocoder = new AMap.Geocoder()
geocoder.getAddress(lnglat, (status, result) => {
self.lnglat = lnglat
geocoder.getAddress(position, (status, result) => {
self.address = result.regeocode.formattedAddress
geocoder.getLocation(self.address, (status, result) => {
if (status === 'complete' && result.info === 'OK') {
this.geocoderAddress = result.geocodes[0]
self.geocoderAddress = result.geocodes[0]
}
})
})
})
},
selectAddress(e) {
//这里获得点选地点的经纬度
this.getAddress()
handleChangeAdr(val) {
if (val) {
var location = this.adrList.find(item => item.id == val)
this.getAddress(location.location)
this.input = ''
this.adrList = []
}
}
},
mounted() {
this.mapInit()
}
}
</script>
<style scoped lang="scss">
.map-box {
position: relative;
width: 100%;
}
#container {
position: absolute;
height: 100%;
display: flex;
#container {
position: relative;
width: calc(100% - 284px - 16px);
height: 100%;
}
.map-input {
position: absolute;
top: 32px;
width: 60%;
left: 25%;
z-index: 2;
}
}
#panel {
position: absolute;
......@@ -130,8 +192,18 @@ export default {
width: 280px;
}
.map-address {
position: absolute;
display: flex;
box-sizing: border-box;
width: 284px;
height: 100%;
background-color: #f9f9f9;
padding: 20px;
margin-left: 16px;
line-height: 20px;
bottom: -30px;
.icon-map {
width: 16px;
height: 16px;
margin-right: 6px;
}
}
</style>
\ No newline at end of file
</style>
......@@ -15,14 +15,6 @@ import '@/components'
// import 'glsx-components/dist/glsx-components.css'
import { start } from '@/setup'
import { setMinHeight } from '@/common/constant'
import VueAMap from 'vue-amap'
Vue.use(VueAMap)
// 初始化vue-amap
VueAMap.initAMapApiLoader({
key: 'bd290dc27d0945959280753215ddda71', // 这里写你申请的高德地图的key
plugin: ['AMap.PlaceSearch', 'AMap.Geocoder', 'AMap.Geolocation'],
v: '1.4.15'
})
Vue.config.productionTip = false
Vue.prototype.$apis = apis
Vue.prototype.size = 'small'
......
......@@ -350,6 +350,12 @@ const staticRoutes = Object.freeze([
path: '/seckillActivity/browseList',
component: resolve => require([`@/views/seckillActivity/browseList.vue`], resolve),
meta: {}
},
{
name: 'dataBoard',
path: '/seckillActivity/dataBoard',
component: resolve => require([`@/views/seckillActivity/dataBoard.vue`], resolve),
meta: {}
}
])
export default staticRoutes
......@@ -19,6 +19,10 @@ export default {
excludeMenus: {
type: Array,
default: () => ['code']
},
boxHeight:{
type: Number,
default: 240
}
},
mounted() {
......@@ -31,7 +35,7 @@ export default {
this.editor.config.uploadImgShowBase64 = true
this.editor.config.showMenuTooltips = true
this.editor.config.menuTooltipPosition = 'down'
this.editor.config.height = 400
this.editor.config.height = this.boxHeight
this.editor.config.width = 500
this.editor.config.excludeMenus = this.excludeMenus
this.editor.config.onchange = html => {
......@@ -112,7 +116,7 @@ export default {
<style lang="scss" scoped>
#div-demo {
margin: 16px 300px 0 0;
// margin: 16px 300px 0 0;
}
.el-form .editor {
margin-top: 20px;
......
<!-- 浏览明细 -->
<!-- 明细 -->
<template>
<div class="edit-share marketing edit-box">
<div class="container edit-container">
<p class="edit-title">{{ routeInfo.activityName }}</p>
<div class="p-20">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<GLCombiForm
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
></GLCombiForm>
<div class="flex m-b-10 w-100-percent">
<span class="table-title"></span>
<el-button :size="size" class="default-blue-btn" type="default" @click="handleExport">导出</el-button>
<div class="table-title">
已累计<template v-if="routeInfo.type != 2">{{decodeURI(routeInfo.name)}}</template>
<span>{{routeInfo.count || 0}}</span>
{{routeInfo.type == 2?'位访客':'次'}}
</div>
<el-button
:size="size"
class="default-blue-btn"
type="default"
@click="handleExport"
>导出</el-button>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="browserRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="customerName" class="flex-align" slot-scope="scope">
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.customerAvatar" />
<img class="img-36 pointer" slot="reference" :src="scope.scope.customerAvatar" />
</el-popover>
<GLTable
ref="browserRef"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="searchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"
>
<div
slot="customerName"
class="flex-align"
slot-scope="scope"
>
<template v-if="scope.scope.customerAvatar">
<el-popover
placement="top"
width="160"
trigger="hover"
popper-class="table-popover-block"
>
<img
class="table-popover-img"
:src="scope.scope.customerAvatar"
/>
<img
class="img-36 pointer"
slot="reference"
:src="scope.scope.customerAvatar"
/>
</el-popover>
</template>
<span class="m-l-10">{{ scope.scope.customerName }}</span>
</div>
<div slot="shareName" class="flex-align" slot-scope="scope">
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.shareAvatar" />
<img class="img-36 pointer" slot="reference" :src="scope.scope.shareAvatar" />
</el-popover>
<div
slot="shareName"
class="flex-align"
slot-scope="scope"
>
<template v-if="scope.scope.shareAvatar">
<el-popover
placement="top"
width="160"
trigger="hover"
popper-class="table-popover-block"
>
<img
class="table-popover-img"
:src="scope.scope.shareAvatar"
/>
<img
class="img-36 pointer"
slot="reference"
:src="scope.scope.shareAvatar"
/>
</el-popover>
</template>
<span class="m-l-10">{{ scope.scope.shareName }}</span>
<span class="m-l-10">{{ scope.scope.sharePhone }}</span>
</div>
<div
slot="isBuy"
slot-scope="scope"
>
<span :class="['table-circle', 'm-r-8', scope.scope.isBuy == 'Y' ?'back-green': 'back-grey']"></span>
<span>{{{
'Y':'已付款',
'N':'未付款'
}[scope.scope.isBuy] || '--'}}</span>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="default" @click="handleJump">返回</el-button>
<div
class="footer"
:style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"
>
<el-button
type="default"
@click="handleJump"
>返回</el-button>
</div>
</div>
</template>
......@@ -44,7 +122,7 @@ import url from '@/assets/empty.png'
import { exportFn } from '@/common/constant'
export default {
name: 'browseList',
data() {
data () {
return {
size: 'small',
url: url,
......@@ -72,15 +150,21 @@ export default {
name: 'mobile',
type: 'input',
maxlength: 11
},
{
label: '分享人',
name: 'shareName',
type: 'input',
maxlength: 50
}
],
// 表格
getListApi: this.$apis.seckillActivity.getBrowseListApi,
getListApi: null,
tableParams: {
listName: 'list',
tableColumns: [
{
label: '微信名称',
label: '微信昵称',
prop: 'customerName',
addHtml: 'customerName'
},
......@@ -89,66 +173,133 @@ export default {
prop: 'mobile'
},
{
label: '来源',
label: '分享人',
prop: 'shareName',
addHtml: 'shareName'
},
{
label: '浏览次数',
prop: 'browseCount'
addHtml: 'shareName',
width: 230
},
{
label: '浏览时间',
prop: 'lastBrowseDate',
width: '180'
}
]
}
}
},
created() {
this.routeInfo = this.$route.query
created () {
const lastTableColumns = [
{
label: '浏览时长',
prop: 'browserTime',
},
{
label: '进入页面时间',
prop: 'operationDate',
width: '180'
},
{
label: '离开页面时间',
prop: 'leaveDate',
width: '180'
},
{
label: '订单状态',
prop: 'isBuy',
addHtml: 'isBuy'
}
], {
query
} = this.$route,
name = {
1: '浏览',
2: '访客',
3: '分享',
}[query.type],
[url] = window.location.href.split('%24title')
query.name = name
this.routeInfo = query
this.getListApi = this.$apis.seckillActivity[{
1: 'getBrowseListApi',
2: 'getVisitorListApi',
3: 'getSharedListApi'
}[query.type]]
history.replaceState(null, null, `${url}&$title=${name}明细`)
// listName:
//1 浏览 2 访客 3 分享
if (query.type != 2) {
this.searchFormData.push({
label: '订单状态',
name: 'isBuy',
type: 'select',
width: '215px',
optionList: [
{
confId: '',
confName: '全部'
},
{
confId: 'Y',
confName: '已付款'
},
{
confId: 'N',
confName: '未付款'
}
],
optionId: 'confId',
optionLabel: 'confName',
})
if (query.type == 3) this.tableParams.tableColumns.push({
label: '分享时间',
prop: 'sharedTime',
})
this.tableParams.tableColumns = [...this.tableParams.tableColumns, ...lastTableColumns]
} else this.tableParams.tableColumns = [...this.tableParams.tableColumns, {
label: '浏览次数',
prop: 'browseCount',
}, {
label: '最后浏览时间',
prop: 'lastBrowseDate',
}]
},
mounted() {
mounted () {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
},
methods: {
beforeSearchFn() {
beforeSearchFn () {
return new Promise(resolve => {
this.searchForm.activityId = this.routeInfo.id
resolve()
})
},
handleExport() {
handleExport () {
var params = this.$common.utils.deepClone(this.searchForm)
let { type } = this.routeInfo
params.pageNum = 1
params.pageSize = 999999
this.$apis.seckillActivity.exportBrowseApi(params).then(res => {
this.$apis.seckillActivity.exportBrowseApi(params, type).then(res => {
exportFn(res)
})
},
handleJump(path, row = {}) {
handleJump (path, row = {}) {
this.$router.push({
path: '/seckillActivity/crowdFundList'
})
},
setTableFinishFun() {
setTableFinishFun () {
//接收到的数据为空
this.$refs.browserRef.data.length ? (this.$refs.browserRef.tableHeightValues = '') : this.$refs.browserRef.setTableHeightFun()
},
handleSearch() {
handleSearch () {
this.$refs.browserRef.refreshTable()
},
handleReset() {
handleReset () {
this.searchForm = {
activityId: this.routeInfo.id,
customerName: '',
......@@ -160,4 +311,18 @@ export default {
}
</script>
<style scoped></style>
<style scoped lang="scss">
.edit-container {
.table-title {
font-weight: 400;
font-size: 14px;
color: #333333;
line-height: 20px;
display: flex;
align-items: center;
span {
color: #5850ff;
}
}
}
</style>
......@@ -2,36 +2,103 @@
<template>
<div class="marketing">
<div class="m-b-20">
<GLButton :size="size" class="default-blue-btn el-icon-plus" type="default" @click="handleEdit('add')" fn="新增众筹" mode="el-button">新建众筹</GLButton>
<el-button :size="size" type="default" class="default-blue-btn" @click="handleJump">订单管理</el-button>
<GLButton
:size="size"
class="default-blue-btn el-icon-plus"
type="default"
@click="handleEdit('add')"
fn="新增众筹"
mode="el-button"
>新建众筹</GLButton>
<el-button
:size="size"
type="default"
class="default-blue-btn"
@click="handleJump"
>订单管理</el-button>
</div>
<div class="container">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<GLCombiForm
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
></GLCombiForm>
<div class="flex m-b-10 w-100-percent">
<span class="table-title"></span>
<el-button :size="size" class="default-blue-btn" type="default" @click="handleExport">导出</el-button>
<el-button
:size="size"
class="default-blue-btn"
type="default"
@click="handleExport"
>导出</el-button>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="activity" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="activityImg" class="table-image" slot-scope="scope">
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.activityImg" />
<img class="img-60 pointer" slot="reference" :src="scope.scope.activityImg" />
<GLTable
ref="activity"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"
>
<div
slot="activityImg"
class="table-image"
slot-scope="scope"
>
<el-popover
placement="top"
width="160"
trigger="hover"
popper-class="table-popover-block"
>
<img
class="table-popover-img"
:src="scope.scope.activityImg"
/>
<img
class="img-60 pointer"
slot="reference"
:src="scope.scope.activityImg"
/>
</el-popover>
</div>
<div slot="viewAmount" slot-scope="scope">
<p class="cursor-pointer" @click="handleDetail(scope.scope)">{{ scope.scope.viewAmount || 0 }}</p>
<div
slot="linkText"
slot-scope="scope"
>
<p
class="cursor-pointer"
@click="handleDetail(scope)"
>{{scope.scope[scope.prop] || 0}}</p>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
<div
class="table-btns"
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
<!-- 分享 -->
<share-dialog :isShareVisible="isShareVisible" :shareForm="shareForm" @handleShareClose="handleShareClose"></share-dialog>
<share-dialog
:isShareVisible="isShareVisible"
:shareForm="shareForm"
@handleShareClose="handleShareClose"
></share-dialog>
</div>
</template>
......@@ -42,7 +109,7 @@ import url from '@/assets/empty.png'
import { exportFn } from '@/common/constant'
export default {
name: 'crowdFundList',
data() {
data () {
return {
size: 'small',
url: url,
......@@ -69,7 +136,7 @@ export default {
maxlength: 20
},
{
label: '状态',
label: '活动状态',
name: 'activityStatus',
type: 'select',
width: '215px',
......@@ -162,6 +229,36 @@ export default {
listeners: {
click: this.handleShare
}
},
{
type: 'el-button',
name: '复制',
attrs: {
type: 'text'
},
listeners: {
click: row => {
this.handleEdit('copy', row)
}
}
},
{
type: 'GLButton',
name: '数据看板',
attrs: {
type: 'text',
fn: '数据看板'
},
listeners: {
click: row => {
this.$router.push({
path: '/seckillActivity/dataBoard',
query: {
activityId: row.id
}
})
}
}
}
],
// 表格
......@@ -183,7 +280,7 @@ export default {
{
label: '浏览量(次)',
prop: 'viewAmount',
addHtml: 'viewAmount',
addHtml: 'linkText',
width: 140
},
{
......@@ -208,12 +305,14 @@ export default {
}
},
{
label: '粉丝',
prop: 'fansAmount'
label: '访客',
prop: 'fansAmount',
addHtml: 'linkText'
},
{
label: '分享',
prop: 'shareAmount'
prop: 'shareAmount',
addHtml: 'linkText'
},
{
label: '销量',
......@@ -274,16 +373,16 @@ export default {
shareDialog
},
mounted() {
mounted () {
this.getOptionsList('searchFormData')
},
methods: {
getParams() {
getParams () {
var params = JSON.parse(JSON.stringify(this.searchForm))
return params
},
beforeSearchFn() {
beforeSearchFn () {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
// delete this.tableSearchForm.createDate
......@@ -291,13 +390,13 @@ export default {
})
},
handleJump(path, row = {}) {
handleJump (path, row = {}) {
this.$router.push({
path: '/orderManage/index'
})
},
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
secondConfirm (title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
......@@ -320,16 +419,16 @@ export default {
},
//开始
start(item) {
start (item) {
this.startOrEndConfirm('开始', item)
},
//结束
end(item) {
end (item) {
this.startOrEndConfirm('结束', item)
},
startOrEndConfirm(txt, row) {
startOrEndConfirm (txt, row) {
var title = txt
var params = {}
params.id = row.id
......@@ -342,24 +441,29 @@ export default {
},
//置顶
topping(row) {
topping (row) {
var params = {}
params.id = row.id
this.secondConfirm('删除', '确定置顶此活动?', 'seckillActivity', 'topActivityApi', params)
},
//删除
del(row) {
del (row) {
var params = {}
params.id = row.id
this.secondConfirm('删除', '确定删除此活动?', 'seckillActivity', 'deleteActivityApi', params)
},
// 1-新增;2-编辑
handleEdit(addOrEdit, row) {
handleEdit (addOrEdit, row) {
var txtObj = {
add: '新建',
edit: '编辑',
copy: '复制'
}[addOrEdit]
var params = {
addOrEdit: addOrEdit,
$title: encodeURI(addOrEdit == 'add' ? '新建众筹活动' : '编辑众筹活动')
$title: encodeURI(txtObj + '众筹活动')
}
if (addOrEdit != 'add') {
params.id = row.id
......@@ -370,37 +474,56 @@ export default {
query: params
})
},
test (option) {
console.log(JSON.parse(JSON.stringify(option)))
},
// 明细
handleDetail(row) {
handleDetail ({ prop, scope }) {
let data = {
viewAmount: {
type: 1,
count: scope.viewAmount
},
fansAmount: {
type: 2,
count: scope.fansAmount
},
shareAmount: {
type: 3,
count: scope.shareAmount
}
}[prop]
this.$router.push({
path: '/seckillActivity/browseList',
query: {
id: row.id,
activityName: row.activityName
id: scope.id,
activityName: scope.activityName,
type: data.type,
count: data.count,
}
})
},
handleExport() {
handleExport () {
var params = this.getParams()
this.$apis.seckillActivity.exportCrowdfundApi(params).then(res => {
exportFn(res)
})
},
handleShare(row) {
handleShare (row) {
this.$apis.seckillActivity.getCrowdSharedApi({ id: row.id }).then(res => {
this.shareForm = res
this.handleShareClose()
})
},
handleShareClose() {
handleShareClose () {
this.isShareVisible = !this.isShareVisible
},
getOptionsList(formName, hasAll = true, refreshSigle) {
getOptionsList (formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
......@@ -426,11 +549,11 @@ export default {
}
},
handleSearch() {
handleSearch () {
this.$refs.activity.refreshTable()
},
handleReset() {
handleReset () {
this.searchForm = {
activityName: '',
activityStatus: ''
......@@ -438,7 +561,7 @@ export default {
this.handleSearch()
},
setTableFinishFun() {
setTableFinishFun () {
//接收到的数据为空
this.$refs.activity.data.length ? (this.$refs.activity.tableHeightValues = '') : this.$refs.activity.setTableHeightFun()
}
......
<template>
<div class="marketing data-board">
<div class="data-board-box">
<p class="edit-title">数据看板</p>
<div class="p-20">
<GLCombiForm
ref="dataRef"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
></GLCombiForm>
<div class="data-view">
<template v-for="(item,index) in dataList">
<div
:key="index"
class="item"
>
<div class="name">
{{item.name}}
<el-popover
class="tips"
placement="top"
width="260"
trigger="hover"
:content="item.tips"
>
<img
slot="reference"
class="tips-icon"
src="@/components/glsx-combi-form/images/icon-tip.png"
/>
</el-popover>
</div>
<div class="value">{{dataBoard[item.key] || 0}}</div>
<template v-if="item.half">
<div class="half">
日环比:
<div :class="['icon',
{'up':dataBoard[item.half]>0},
{'down':dataBoard[item.half]<0}
]"></div>
<span class="num">{{Math.abs(dataBoard[item.half]).toFixed(2) || 0}}%</span>
</div>
</template>
</div>
</template>
</div>
</div>
</div>
<div class="data-board-box">
<p class="edit-title">员工排行榜</p>
<div class="p-20">
<GLCombiForm
ref="rankRef"
:rowNumber="1"
:formObj="searchRankForm"
:formData="searchFormRankData"
@handleOk="handleSearchRank"
></GLCombiForm>
<div class="flex m-b-10 w-100-percent">
<span class="table-title"></span>
<el-button
:size="size"
class="default-blue-btn"
type="default"
@click="handleExport"
>导出</el-button>
</div>
<GLTable
ref="dataTableRef"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"
:hasNum="false"
>
<div
slot="shareName"
class="flex-align"
slot-scope="scope"
>
<template v-if="scope.scope.shareAvatar">
<el-popover
placement="top"
width="160"
trigger="hover"
popper-class="table-popover-block"
>
<img
class="table-popover-img"
:src="scope.scope.shareAvatar"
/>
<img
class="img-36 pointer"
slot="reference"
:src="scope.scope.shareAvatar"
/>
</el-popover>
</template>
<span class="m-l-10">{{ scope.scope.shareName }}</span>
<span class="m-l-10">{{ scope.scope.sharePhone || '' }}</span>
</div>
</GLTable>
</div>
</div>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import { exportFn } from '@/common/constant'
import url from '@/assets/empty.png'
const dataList = [
{ name: '新增浏览量', key: 'browseCount', tips: '统计时间内,新增页面被浏览的次数(一人多次访问计为多次)', half: 'browseRingRatio' },
{ name: '新增访客数', key: 'fansCount', tips: '统计时间内访问页面的人数(一人多次访问计为一次)', half: 'fansRingRatio' },
{ name: '新增订单数', key: 'orderCount', tips: '统计时间内,新增订单数(只记录已付款的订单)', half: 'orderRingRatio' },
{ name: '累计浏览量', key: 'totalBrowseCount', tips: '页面被浏览的总次数(一人多次访问计为多次)' },
{ name: '累计访客数', key: 'totalFansCount', tips: '访问页面的总人数(一人多次访问计为一次)' },
{ name: '累计订单数', key: 'totalOrderCount', tips: '累计订单总数(只记录已付款的订单)' }
], optionList = [
{ confId: '1', confName: '转发次数' },
{ confId: '2', confName: '访客总数' },
{ confId: '3', confName: '浏览总数' },
{ confId: '4', confName: '成交单量' },
{ confId: '5', confName: '转化率' }
]
export default {
name: 'ScrmMicroMarketingDataBoard',
data () {
return {
url,
dataList,
searchForm: {
statDate: dayjs().format('YYYY-MM-DD')
},
searchFormData: [
{
label: '统计日期',
name: 'statDate',
type: 'datePicker',
dateType: 'date',
pickerOptions: 'beforeRangePickerOptions'
}
],
searchRankForm: {
statDimension: '1'
},
searchFormRankData: [
{
label: '统计维度',
name: 'statDimension',
type: 'select',
width: '215px',
optionList,
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'statusList'
}
],
getListApi: this.$apis.seckillActivity.getRankListApi,
tableSearchForm: {},
tableParams: {
listName: 'list',
tableColumns: [
{
label: '排名',
prop: 'rankNumber',
},
{
label: '员工',
prop: 'shareName',
addHtml: 'shareName',
width: 220
},
{
label: '转发次数',
prop: 'shareCount',
},
{
label: '访客总数',
prop: 'fansCount',
width: 140
},
{
label: '浏览总数',
prop: 'browseCount',
},
{
label: '成交单量',
prop: 'orderCount',
},
{
label: '转化率',
prop: 'conversionRate',
formatter: cellValue => {
return `${cellValue.conversionRate.toFixed(2)}%`
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
dataBoard: {}
}
},
created () {
this.getDataBoardApi()
},
mounted () {
let [dataResetBtn] = this.$refs.dataRef.$el.getElementsByClassName('el-button--default'),
[rankResetBtn] = this.$refs.rankRef.$el.getElementsByClassName('el-button--default')
if (dataResetBtn) dataResetBtn.style.display = 'none'
if (rankResetBtn) rankResetBtn.style.display = 'none'
},
methods: {
getDataBoardApi () {
let { activityId } = this.$route.query,
{ statDate } = this.searchForm
this.$apis.seckillActivity.getDataBoardApi({ activityId, statDimension: dayjs(statDate).format('YYYY-MM-DD') }).then(res => {
this.dataBoard = res || {}
})
},
getParams () {
let { activityId } = this.$route.query,
params = JSON.parse(JSON.stringify(this.searchRankForm))
params.activityId = activityId
return params
},
handleSearch () {
this.getDataBoardApi()
},
handleSearchRank () {
this.$refs.dataTableRef.refreshTable()
},
handleExport () {
let params = this.getParams()
this.$apis.seckillActivity.exportRankListApi(params).then(res => {
exportFn(res)
})
},
beforeSearchFn () {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
})
},
setTableFinishFun () {
//接收到的数据为空
this.$refs.dataTableRef.data.length ? (this.$refs.dataTableRef.tableHeightValues = '') : this.$refs.dataTableRef.setTableHeightFun()
}
},
};
</script>
<style lang="scss" scoped>
.data-board {
&-box {
background: #ffffff;
&:last-of-type {
margin-top: 16px;
}
.data-view {
max-width: 854px;
display: flex;
flex-wrap: wrap;
gap: 16px;
padding-bottom: 12px;
.item {
width: 274px;
height: 128px;
background: #f9fafc;
border-radius: 4px;
box-sizing: border-box;
padding: 10px;
.name {
font-size: 14px;
color: #333333;
display: flex;
align-items: center;
height: 21px;
.tips {
margin-left: 4px;
}
}
.value {
padding: 20px 0;
font-size: 26px;
color: #333333;
line-height: 26px;
font-weight: bold;
}
.half {
font-size: 14px;
color: #666666;
line-height: 21px;
display: flex;
align-items: center;
.icon {
width: 16px;
height: 16px;
background-image: url(../../assets/dataBoard/icon-half-default.png);
background-size: 16px 16px;
}
.up {
background-image: url(../../assets/dataBoard/icon-half-up.png);
}
.down {
background-image: url(../../assets/dataBoard/icon-half-down.png);
}
.num {
margin-left: 4px;
}
}
}
}
}
}
</style>
......@@ -9,7 +9,7 @@
<el-date-picker v-model="editForm.activityTime" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :picker-options="pickerOptions" :default-time="['00:00:00', '23:59:59']" :disabled="isDisabled" @change="e => handleTimeChange(e, scope.scope)"></el-date-picker>
</template>
<div slot="goodsHtml">
<el-button type="default" class="default-blue-btn el-icon-plus" v-if="apear != 'see'" @click="handleRelateProClose">选择商品</el-button>
<el-button type="default" class="default-blue-btn el-icon-plus" v-if="!isDisabled" :disabled="apear == 'see'" @click="handleRelateProClose">选择商品</el-button>
<div v-if="selectedProInfo.id && !specificationDetailList.length" style="margin-top: 10px">
<p>
<img class="img-60" :src="selectedProInfo.goodsImage" />
......@@ -371,18 +371,22 @@ export default {
},
getGoodInfo(id) {
this.$apis.proManage.getProInfoApi({ id: id }).then(res => {
this.selectedProInfo = this.$common.utils.deepClone(res)
if (this.selectedProInfo.specificationDetailList.length) {
this.changeFormAttr('editFormData', 'isHide', ['规格明细'], false)
this.specificationDetailList = this.selectedProInfo.specificationList
this.recoverySpec()
} else {
this.changeFormAttr('editFormData', 'isHide', ['规格明细'], true)
this.nameToValSpecsList = []
this.specificationDetailList = []
}
})
if (!id) {
this.isDisabled = false
} else {
this.$apis.proManage.getProInfoApi({ id: id }).then(res => {
this.selectedProInfo = this.$common.utils.deepClone(res)
if (this.selectedProInfo.specificationDetailList.length) {
this.changeFormAttr('editFormData', 'isHide', ['规格明细'], false)
this.specificationDetailList = this.selectedProInfo.specificationList
this.recoverySpec()
} else {
this.changeFormAttr('editFormData', 'isHide', ['规格明细'], true)
this.nameToValSpecsList = []
this.specificationDetailList = []
}
})
}
},
// 规格值解构
......
......@@ -6,7 +6,7 @@ const resolve = dir => path.join(__dirname, dir)
const CDN_DOMAIN = 'https://img02.glsx.com.cn/'
const cdn = {
css: [`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css`],
js: [`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`, `${CDN_DOMAIN}ajax/libs/moment/2.24.0/moment.js`]
js: [`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`, `${CDN_DOMAIN}ajax/libs/moment/2.24.0/moment.js`, 'https://webapi.amap.com/loader.js']
}
module.exports = {
outputDir: `../dist/${packageName}`,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!