Commit a7b3e6dd by xinla

短链

1 parent b7c1c7c8
...@@ -68,6 +68,7 @@ export default { ...@@ -68,6 +68,7 @@ export default {
submit() { submit() {
this.$refs['form'].validate((validate) => { this.$refs['form'].validate((validate) => {
if (validate) { if (validate) {
this.form.type = this.form.touchType
this.loading = true this.loading = true
;(this.form.id ? update : add)(this.form) ;(this.form.id ? update : add)(this.form)
.then((res) => { .then((res) => {
......
<script> <script>
import { touchTypeDict } from './components/mixin' import { touchTypeDict } from './mixin'
export default { export default {
name: '', name: '',
components: {}, components: {},
......
// 短链移动端样式预览 // 短链移动端样式预览
<script> <script>
import { touchTypeDict } from './components/mixin' import { touchTypeDict } from './mixin'
export default { export default {
name: '', name: '',
components: {}, components: {},
props: { props: {
data: { data: {
type: Object, type: Object,
default: {},
}, },
}, },
data() { data() {
...@@ -24,9 +25,8 @@ export default { ...@@ -24,9 +25,8 @@ export default {
<template> <template>
<div> <div>
<div class="title">预览</div> <div class="g-title">预览</div>
<PhoneTemplate v-if="touchTypeDict[data.touchType]" :title="touchTypeDict[data.touchType].previewMobileTitle">
<PhoneTemplate :title="touchTypeDict[data.touchType].previewMobileTitle">
<template v-if="data.touchType == 0"> <template v-if="data.touchType == 0">
<div class="mask" style="position: absolute"> <div class="mask" style="position: absolute">
<div class="cc ac g-card g-pad20" style="width: 70%">公众号文章示例</div> <div class="cc ac g-card g-pad20" style="width: 70%">公众号文章示例</div>
......
...@@ -5,19 +5,17 @@ export default { ...@@ -5,19 +5,17 @@ export default {
components: { components: {
TimeSearchTitle: () => import('@/components/common/TimeSearchTitle'), TimeSearchTitle: () => import('@/components/common/TimeSearchTitle'),
PhonePreview: () => import('./components/PhonePreview.vue'), PhonePreview: () => import('./components/PhonePreview.vue'),
ChartLine: () => import('@/components/ChartLine'),
}, },
data() { data() {
return { return {
loading: false, loading: false,
form: {}, data: {},
data: [],
xData: [], xData: [],
series: [], series: [],
} }
}, },
computed: { computed: {},
ChartLine: () => import('@/components/ChartLine'),
},
watch: {}, watch: {},
created() { created() {
let id = this.$route.query.id let id = this.$route.query.id
...@@ -96,9 +94,9 @@ export default { ...@@ -96,9 +94,9 @@ export default {
getLineAnalysis(query).then(({ data }) => { getLineAnalysis(query).then(({ data }) => {
this.series = [] this.series = []
this.xData = data.map((e) => e.xtime) this.xData = data.map((e) => e.xtime)
this.series.push(data.map((e) => e.addCnt)) this.series.push(data.map((e) => e.pvTodayCount))
this.series.push(data.map((e) => e.lostCnt)) this.series.push(data.map((e) => e.uvTodayCount))
this.series.push(data.map((e) => e.netCnt)) this.series.push(data.map((e) => e.openTodayCount))
}) })
}, },
}, },
...@@ -108,27 +106,27 @@ export default { ...@@ -108,27 +106,27 @@ export default {
<template> <template>
<div> <div>
<div class="fxbw"> <div class="fxbw">
<div style="width: 40%"> <div style="width: 58%">
<div class="g-title">短链内容</div>
<div class="g-card g-pad20"> <div class="g-card g-pad20">
<div class="title">短链内容</div>
<Add :form="data" /> <Add :form="data" />
</div> </div>
<div class="g-title">数据趋势</div>
<div class="g-card g-pad20">
<CardGroupIndex :data="cardData"></CardGroupIndex>
<div>
<TimeSearchTitle @search="getLineAnalysis"></TimeSearchTitle>
</div>
<ChartLine
:xData="xData"
:legend="['访问总数(pv)', '访问总人数(uv)', '小程序打开数']"
:series="series"></ChartLine>
</div>
</div> </div>
<div class="g-card g-pad20" style="width: 40%; margin-top: 0"> <div class="g-card g-pad20" style="width: 40%; margin-top: 0">
<PhonePreview :data="data" /> <PhonePreview :data="data" />
</div> </div>
</div> </div>
<div class="g-card g-pad20">
<div class="title">数据趋势</div>
<CardGroupIndex :data="cardData"></CardGroupIndex>
<div>
<TimeSearchTitle @search="getLineAnalysis"></TimeSearchTitle>
</div>
<ChartLine
:xData="xData"
:legend="['访问总数(pv)', '访问总人数(uv)', '小程序打开数']"
:series="series"></ChartLine>
</div>
</div> </div>
</template> </template>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!