提交 5366e586 authored 作者: lidongxu's avatar lidongxu

feat(sycm_store): 生意参谋-竞店分析完成

同上
上级 f12e2966
...@@ -8,6 +8,13 @@ export function getCmmListAPI(params) { ...@@ -8,6 +8,13 @@ export function getCmmListAPI(params) {
}) })
} }
// 竞店列表
export function getStoreListAPI() {
return request({
url: '/bi/oppo/sycm/store/all'
})
}
// 生意参谋-各大竞店 // 生意参谋-各大竞店
export function getSycmStoreListAPI(params) { export function getSycmStoreListAPI(params) {
return request({ return request({
...@@ -22,4 +29,4 @@ export function getSycmListAPI(params) { ...@@ -22,4 +29,4 @@ export function getSycmListAPI(params) {
url: '/bi/oppo/sycm/list', url: '/bi/oppo/sycm/list',
params params
}) })
} }
\ No newline at end of file
...@@ -15,8 +15,7 @@ ...@@ -15,8 +15,7 @@
<!-- 工具抽屉 --> <!-- 工具抽屉 -->
<el-drawer title="工具箱" <el-drawer title="工具箱"
v-model="drawer" v-model="drawer"
size="300px" size="300px">
@click.native="drawer = false">
<slot></slot> <slot></slot>
</el-drawer> </el-drawer>
</div> </div>
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
</template> </template>
</el-dropdown> </el-dropdown>
</el-tooltip> </el-tooltip>
<!-- 自定义功能 -->
<slot></slot>
</el-row> </el-row>
<el-dialog :title="title" v-model="open" append-to-body> <el-dialog :title="title" v-model="open" append-to-body>
<el-transfer <el-transfer
......
...@@ -151,7 +151,6 @@ const setOptions = () => { ...@@ -151,7 +151,6 @@ const setOptions = () => {
// tooltip += item.marker + item.seriesName + ': ' + toFixed2(item.value) + (this.myThousand ? '' : '') + '<br>'; // tooltip += item.marker + item.seriesName + ': ' + toFixed2(item.value) + (this.myThousand ? '' : '') + '<br>';
// } // }
// }); // });
// console.log(tooltip)
// return tooltip; // return tooltip;
// } // }
}, },
......
...@@ -240,7 +240,6 @@ init() ...@@ -240,7 +240,6 @@ init()
// 筛选条件改变了 // 筛选条件改变了
const queryChangeFn = async (arg) => { const queryChangeFn = async (arg) => {
if (arg === 'date' && !queryParams.date) return
if (arg === 'date' && queryParams.date) { if (arg === 'date' && queryParams.date) {
await getList() await getList()
} }
...@@ -262,12 +261,14 @@ const reset = async () => { ...@@ -262,12 +261,14 @@ const reset = async () => {
<style scoped <style scoped
lang="scss"> lang="scss">
.tabs-container { .tabs-container {
min-height: 100%; min-height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.chart_wrap { .chart_wrap {
padding: 20px 0;
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
......
...@@ -24,7 +24,7 @@ const list = ref([ ...@@ -24,7 +24,7 @@ const list = ref([
{ name: '生意参谋-竞店', component: shallowRef(sycmStore) }, { name: '生意参谋-竞店', component: shallowRef(sycmStore) },
{ name: '生意参谋-竞品', component: shallowRef(sycmPrd) } { name: '生意参谋-竞品', component: shallowRef(sycmPrd) }
]) ])
const activeName = ref(list.value[0].name) const activeName = ref(list.value[1].name)
</script> </script>
<style scoped <style scoped
......
...@@ -35,6 +35,8 @@ const echartsRef = ref(null) ...@@ -35,6 +35,8 @@ const echartsRef = ref(null)
const chart = shallowRef(null) const chart = shallowRef(null)
let myThousand = false // 是否显示万单位 let myThousand = false // 是否显示万单位
const emits = defineEmits(['changeType'])
const setOptions = () => { const setOptions = () => {
chart.value.setOption({ chart.value.setOption({
tooltip: { tooltip: {
...@@ -52,11 +54,9 @@ const setOptions = () => { ...@@ -52,11 +54,9 @@ const setOptions = () => {
var color = item.color; var color = item.color;
// 拼接提示内容 // 拼接提示内容
if (item.seriesName.split('-')[1].includes('速')) { if (item.seriesName.split('-')[1].includes('速')) {
tooltip += '<span style="display:inline-block;margin-right:5px;width:12px;height:6px;background-color:' + color + ';"></span>' + item.seriesName + ': ' + formatNumberWithUnit(item.value, '%', false, false) + '<br>'; tooltip += '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + color + ';"></span>' + item.seriesName + ': ' + formatNumberWithUnit(item.value, '%', false, false) + '<br>';
} else if (item.seriesName.split('-')[1] === '观看人次') {
tooltip += '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + color + ';"></span>' + item.seriesName + ': ' + formatNumberWithUnit(item.value, '人', myThousand) + '<br>';
} else { } else {
tooltip += '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + color + ';"></span>' + item.seriesName + ':' + item.value + '<br>'; tooltip += '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + color + ';"></span>' + item.seriesName + ':' + formatNumberWithUnit(item.value, '人', false, true) + '<br>';
} }
}); });
return tooltip; return tooltip;
...@@ -71,6 +71,14 @@ const setOptions = () => { ...@@ -71,6 +71,14 @@ const setOptions = () => {
magicType: { magicType: {
type: ['stack', 'tiled'] // 切换图表类型 type: ['stack', 'tiled'] // 切换图表类型
}, },
myTool1: {
show: true,
title: '切换表格',
icon: 'path://M5,5 L5,15 L15,15 L15,5 Z M20,5 L20,15 L30,15 L30,5 Z M5,20 L5,30 L15,30 L15,20 Z M20,20 L20,30 L30,30 L30,20 Z',
onclick: () => {
emits('changeType', 'table')
}
}
} }
}, },
grid: { grid: {
......
<template> <template>
<div class="toolbar">
<right-toolbar :search="false" @queryTable="queryTable">
<el-tooltip class="item" effect="dark" content="切换图表" placement="top">
<el-button circle icon="Histogram" @click="changeType()" />
</el-tooltip>
<el-tooltip class="item" effect="dark" content="日期合并/分散" placement="top">
<el-button circle icon="Calendar" @click="dateMergeFn()" />
</el-tooltip>
</right-toolbar>
</div>
<el-table :data="data" <el-table :data="data"
style="width: 100%"> style="width: 100%">
<el-table-column prop="platformStore" <el-table-column prop="platformStore"
label="店铺" /> label="店铺" />
<el-table-column prop="date" <el-table-column prop="date"
label="日期" /> label="日期" v-if="!dateMerge"/>
<el-table-column prop="zfmjPeakTotal" <el-table-column v-for="str in column"
label="支付买家数" /> :prop="columnKey[str]"
<el-table-column prop="jyzsPeakTotal" :label="str"
label="交易增速" /> :formatter="formatterFn" />
<el-table-column prop="uvPeakTotal"
label="独立访客范围" />
<el-table-column prop="llzsPeakTotal"
label="流量增速" />
</el-table> </el-table>
</template> </template>
<script lang="ts" <script lang="ts"
setup> setup>
const props = defineProps({
const columnKey = {
'支付买家数': 'zfmj',
'交易增速': 'jyzs',
'独立访客范围': 'uv',
'流量增速': 'llzs'
}
defineProps({
column: { column: {
type: Object, type: Object,
default: () => { default: () => {
...@@ -30,8 +43,39 @@ ...@@ -30,8 +43,39 @@
default: () => { default: () => {
return [] return []
}, },
},
dateMerge: { // 是否把日期数据合并
type: Boolean
} }
}) })
console.log(props)
const formatterFn = (row, column, cellValue) => {
</script> if (column.property === 'jyzs' || column.property === 'llzs') {
\ No newline at end of file return cellValue + '%'
} else {
return cellValue
}
}
const emits = defineEmits(['changeType', 'queryTable', 'dateMergeFn'])
const queryTable = () => {
emits('queryTable')
}
const changeType = () => {
emits('changeType', 'charts')
}
const dateMergeFn = () => {
emits('dateMergeFn')
}
</script>
<style scoped
style="sass">
.toolbar {
float: right;
}
</style>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论