Commit 160fca2f by xinla

添加共用表单禁用详情数据展示样式,短链部分修改

1 parent 87576c4f
......@@ -221,3 +221,42 @@
border-radius: 0;
}
}
// 表单禁用详情数据展示
.form-detail {
.el-input.is-disabled .el-input__inner,
.el-textarea.is-disabled .el-textarea__inner {
background-color: transparent;
// border-color: transparent;
color: inherit;
cursor: default;
// &:hover {
// border-color: transparent;
// }
}
.el-radio__input.is-disabled {
.el-radio__inner {
background-color: #fff;
border-color: #dcdfe6;
cursor: default;
}
+ span.el-radio__label {
color: inherit;
cursor: default;
}
&.is-checked .el-radio__inner {
background-color: $blue;
border-color: $blue;
cursor: default;
&::after {
background-color: #fff;
}
}
}
// 必填红 * 隐藏
.el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label:before {
display: none;
}
}
......@@ -128,13 +128,11 @@ export default {
</el-form>
<div v-show="currentActive == 1" class="fxbw ais mt10" style="overflow: auto">
<div class="g-card g-pad20" style="width: 58%">
<div class="g-card g-pad20 mr10" style="flex: auto">
<Add ref="add" :form="form" />
</div>
<div style="width: 40%">
<PhonePreview :data="form" />
</div>
<PhonePreview :data="form" />
</div>
<div v-show="currentActive == 2" class="g-card g-pad20 ac">
......
......@@ -38,7 +38,11 @@ export default {
}),
}
},
computed: {},
computed: {
isDetail() {
return this.$route.path.endsWith('/detail')
},
},
watch: {},
created() {},
mounted() {},
......@@ -48,7 +52,14 @@ export default {
<template>
<div>
<el-form ref="form" :model="form" label-suffix=":" label-width="140px" :rules="rules">
<el-form
:class="isDetail && 'form-detail'"
:disabled="isDetail"
ref="form"
:model="form"
label-suffix=":"
label-width="140px"
:rules="rules">
<el-form-item label="短链类型">
<span>{{ touchTypeDict[form.type].allName }}</span>
</el-form-item>
......@@ -57,10 +68,17 @@ export default {
</el-form-item>
<!-- 公众号文章 -->
<el-form-item prop="longLink" label="公众号文章链接" v-if="form.type == 0">
<el-input clearable v-model="form.longLink" placeholder="请输入"></el-input>
<div class="tips">请在公众号后台文章发布列表页中获取并复制文章的永久链接</div>
</el-form-item>
<template v-if="form.type == 0">
<el-form-item prop="longLink" label="公众号文章链接">
<!-- <template v-if="isDetail">
{{ form.longLink }}
</template>
<template v-else>
</template> -->
<el-input clearable v-model="form.longLink" placeholder="请输入"></el-input>
<div v-if="!isDetail" class="tips">请在公众号后台文章发布列表页中获取并复制文章的永久链接</div>
</el-form-item>
</template>
<!-- 公众号二维码,个人二维码,群二维码,小程序二维码 -->
<template v-else-if="Object.keys(prefixFormLabel).includes(form.type + '')">
......
......@@ -24,9 +24,9 @@ export default {
</script>
<template>
<div>
<div class="g-card" style="margin-top: 0">
<div class="g-title">预览</div>
<div class="g-card g-pad20">
<div class="g-pad20">
<PhoneTemplate v-if="touchTypeDict[data.type]" :title="touchTypeDict[data.type].previewMobileTitle">
<template v-if="data.type == 0">
<div class="mask" style="position: absolute">
......
......@@ -13,6 +13,7 @@ export default {
return {
loading: false,
data: {},
cardData: [],
xData: [],
series: [],
}
......@@ -21,7 +22,7 @@ export default {
watch: {},
created() {
let id = this.$route.query.id
this.getList(id)
this.getDetail(id)
this.getAnalysis(id)
},
mounted() {},
......@@ -30,7 +31,7 @@ export default {
this.loading = true
getDetail(id)
.then(({ data }) => {
this.form = data
this.data = data
})
.catch(() => {})
.finally(() => {
......@@ -107,29 +108,28 @@ export default {
</script>
<template>
<div>
<div class="fxbw">
<div style="width: 58%">
<div class="g-title">短链内容</div>
<div class="g-card g-pad20">
<Add :form="data" />
</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 class="fxbw ais">
<div class="pr10" style="flex: auto; overflow: hidden">
<div class="g-title fxbw">
短链内容
<el-button type="primary" class="fr" @click="$router.push({ path: './addEdit', query: { id: data.id } })">
编辑
</el-button>
</div>
<div style="width: 40%">
<PhonePreview :data="data" />
<div class="g-card g-pad20">
<Add :form="data" />
</div>
<div class="g-title mt20 mb10">数据趋势</div>
<CardGroupIndex :data="cardData"></CardGroupIndex>
<div class="g-card g-pad20" style="margin-top: 0">
<TimeSearchTitle @search="getLineAnalysis"></TimeSearchTitle>
<ChartLine
:xData="xData"
:legend="['访问总数(pv)', '访问总人数(uv)', '小程序打开数']"
:series="series"></ChartLine>
</div>
</div>
<PhonePreview :data="data" />
</div>
</template>
......
<script>
import { getList, getAnalysis, remove } from '@/api/intelligentShortLink'
import { touchTypeDict } from './components/mixin'
export default {
name: '',
components: {
......@@ -14,19 +15,7 @@ export default {
pageSize: 10,
pageNum: 1,
},
dictTouchType: Object.freeze({
0: '跳入微信-公众号-文章',
1: '跳入微信-公众号-二维码',
2: '跳入微信-个人微信-个人二维码',
3: '跳入微信-个人微信-群二维码',
4: '跳入微信-企业微信-员工活码',
5: '跳入微信-企业微信-客群活码',
6: '跳入微信-企业微信-门店导购码',
8: '跳入微信-企业微信-门店群活码',
7: '跳入微信-小程序-个人小程序',
9: '跳入微信-小程序-企业小程序',
10: '跳入微信-小程序-小程序二维码',
}),
touchTypeDict,
dictStatus: Object.freeze({
1: '启用',
2: '关闭',
......@@ -145,64 +134,68 @@ export default {
<div>
<CardGroupIndex :data="cardData"></CardGroupIndex>
<div class="table-content">
<el-form ref="queryForm" :inline="true" :model="query" class="top-search">
<el-form-item label="" prop="shortLinkName">
<el-input clearable v-model="query.shortLinkName" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="" prop="touchType">
<el-select clearable v-model="query.touchType" placeholder="请选择">
<el-option v-for="(item, index) in dictTouchType" :key="index" :label="item" :value="index"></el-option>
</el-select>
</el-form-item>
<el-form-item label="" prop="status">
<el-select clearable v-model="query.status" placeholder="请选择">
<el-option v-for="(item, index) in dictStatus" :key="index" :label="item" :value="index"></el-option>
</el-select>
</el-form-item>
<el-form ref="queryForm" :inline="true" :model="query" class="top-search">
<el-form-item label="" prop="shortLinkName">
<el-input clearable v-model="query.shortLinkName" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="" prop="type">
<el-select clearable v-model="query.type" placeholder="请选择">
<el-option
v-for="(item, index) in touchTypeDict"
:key="index"
:label="item.allName"
:value="+index"></el-option>
</el-select>
</el-form-item>
<el-form-item label="" prop="status">
<el-select clearable v-model="query.status" placeholder="请选择">
<el-option v-for="(item, index) in dictStatus" :key="index" :label="item" :value="+index"></el-option>
</el-select>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" @click="getList(1)">查询</el-button>
<el-button type="success" @click="resetForm()">重置</el-button>
</el-form-item>
</el-form>
<el-form-item label="">
<el-button type="primary" @click="getList(1)">查询</el-button>
<el-button type="success" @click="resetForm()">重置</el-button>
</el-form-item>
<div class="mid-action">
<el-form-item class="fr">
<el-button type="primary" class="mr10" @click="goRoute()">新建短链</el-button>
<el-button :disabled="!ids.length" type="danger" @click="remove()">批量删除</el-button>
</div>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="list">
<el-table-column label="短链名称" align="center" min-width="100" prop="shortLinkName" show-overflow-tooltip />
<el-table-column label="类型" align="center" prop="touchType" min-width="100">
<template slot-scope="{ row }">{{ dictTouchType[row.touchType + ''] }}</template>
</el-table-column>
<el-table-column label="短链地址" align="center" prop="consultTotalCnt" min-width="100" show-overflow-tooltip>
<template slot-scope="{ row }">
<span>{{ row.shortLink }}</span>
<i class="el-icon-copy-document copy-btn ml20 cp" :data-clipboard-text="row.shortLink"></i>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status" min-width="100">
<template slot-scope="{ row }">{{ dictStatus[row.status + ''] }}</template>
</el-table-column>
<el-table-column
label="最后更新时间"
align="center"
prop="tdVisitCnt"
min-width="100"
show-overflow-tooltip></el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="{ row }">
<el-button type="text" @click="goRoute(row, 'detail')">详情|统计</el-button>
<el-button type="text" @click="goRoute(row)">编辑</el-button>
<el-button @click="remove(row.id)" type="text">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination :total="total" :page.sync="query.pageNum" :limit.sync="query.pageSize" @pagination="getList()" />
</div>
<el-table v-loading="loading" :data="list" @selection-change="(val) => (ids = val.map((e) => e.id))">
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column label="短链名称" align="center" prop="shortLinkName" show-overflow-tooltip />
<el-table-column label="类型" align="center" prop="type">
<template slot-scope="{ row }">{{ touchTypeDict[row.type + ''].allName }}</template>
</el-table-column>
<el-table-column label="短链地址" align="center" prop="consultTotalCnt" show-overflow-tooltip>
<template slot-scope="{ row }">
<span>{{ row.shortLink }}</span>
<i class="el-icon-copy-document copy-btn ml20 cp" title="复制" :data-clipboard-text="row.shortLink"></i>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="{ row }">{{ dictStatus[row.status + ''] }}</template>
</el-table-column>
<el-table-column label="最后更新时间" align="center" prop="updateTime" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="{ row }">
<el-button type="text" @click="goRoute(row, 'detail')">详情|统计</el-button>
<el-button type="text" @click="goRoute(row)">编辑</el-button>
<el-button @click="remove(row.id)" type="text">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination :total="total" :page.sync="query.pageNum" :limit.sync="query.pageSize" @pagination="getList()" />
</div>
</template>
<style lang="less" scoped></style>
<style lang="scss" scoped>
.el-icon-copy-document {
&:hover {
color: $blue;
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!