Commit f5005800 by 怪兽?别跑

Merge branch 'v3-dev-jiangpengkai' into vue3-master

2 parents 24e77ee8 5fb4c553
import request from '@/utils/request' import request from '@/utils/request'
const service = window.lwConfig.services.system + window.lwConfig.services.wecom + '/strategic/journey' const service =
window.lwConfig.services.system + window.lwConfig.services.wecom + '/strategic/journey'
// import { get, post } from '@/plugins/axios' // import { get, post } from '@/plugins/axios'
...@@ -19,8 +20,8 @@ export function getCrowdPackDetail(id) { ...@@ -19,8 +20,8 @@ export function getCrowdPackDetail(id) {
// 计划列表查询接口 // 计划列表查询接口
// name 任务名称 String 支持模糊查询 // name 任务名称 String 支持模糊查询
// startDate 开始日期 String YYYY-MM-DD // startDate 开始日期 String yyyy-MM-dd
// endDate 结束日期 String YYYY-MM-DD // endDate 结束日期 String yyyy-MM-dd
// status 状态 number 0:待完善,1:未开始,2:待运行,3:运行中,4:已暂停,5:已停止,6:正常结束,7:异常结束 // status 状态 number 0:待完善,1:未开始,2:待运行,3:运行中,4:已暂停,5:已停止,6:正常结束,7:异常结束
// pageNum 页码 number // pageNum 页码 number
// pageSize 页大小 number // pageSize 页大小 number
......
...@@ -84,3 +84,10 @@ export function crowdAnalyse(data) { ...@@ -84,3 +84,10 @@ export function crowdAnalyse(data) {
params: data, params: data,
}) })
} }
export function deleteCategory(ids) {
return request({
url: base + '/strategic/crowd/categoryDel/' + ids,
method: 'delete',
})
}
<script> <script>
import { getList, getAnalysis, remove } from '@/api/intelligentShortLink' import { getList, getAnalysis, remove } from '@/api/intelligentShortLink'
import { touchTypeDict } from './components/mixin' import * as api from '@/api/enterpriseId'
export default { import { touchTypeDict } from './components/mixin'
name: '', export default {
components: {}, name: '',
data() { components: {},
return { data() {
loading: false, return {
cardData: [], loading: false,
total: 0, cardData: [],
query: { total: 0,
pageSize: 10, query: {
pageNum: 1, pageSize: 10,
}, pageNum: 1
touchTypeDict, },
// dictStatus: Object.freeze({ touchTypeDict,
// 1: '启用', // dictStatus: Object.freeze({
// 2: '关闭', // 1: '启用',
// }), // 2: '关闭',
// }),
list: [], list: [],
ids: [], ids: [],
} needMoreInfo: false,
}, dialogVisible: false
computed: {}, }
watch: {},
created() {
this.getList()
this.getAnalysis()
this.$store.setBusininessDesc(` <div>生成智能短链,一键跳转公众号、小程序、企业微信</div> `)
},
mounted() {
this.clipboard = new this.ClipboardJS('.copy-btn')
},
unmounted() {
this.clipboard.destroy()
},
methods: {
getAnalysis() {
this.loading = true
getAnalysis()
.then(({ data }) => {
this.cardData = [
{
title: '访问总数(pv)',
tips: '短链页面访问的总次数',
value: data.pvTotalCount,
},
{
title: '访问总人数(uv)',
tips: '短链页面访问的独立IP数',
value: data.uvTotalCount,
},
{
title: '小程序打开数',
tips: '小程序成功打开的总次数',
value: data.openTotalCount,
},
{
title: '今日访问总数(pv)',
tips: '今日短链页面访问的总次数',
value: data.pvTodayCount,
title1: '较昨日',
value1: data.pvDiff,
},
{
title: '今日访问总人数(uv)',
tips: '今日短链页面访问的独立IP数',
value: data.uvTodayCount,
title1: '较昨日',
value1: data.uvDiff,
},
{
title: '今日小程序打开数',
tips: '今日小程序成功打开的总次数',
value: data.openTodayCount,
title1: '较昨日',
value1: data.openDiff,
},
]
})
.catch((e) => {
console.log(e)
})
.finally(() => {
this.loading = false
})
}, },
getList(page) { computed: {},
page && (this.query.pageNum = page) watch: {},
this.loading = true created() {
getList(this.query) this.setState()
.then(({ rows, total }) => { this.getList()
this.list = rows this.getAnalysis()
this.total = +total this.$store.setBusininessDesc(` <div>生成智能短链,一键跳转公众号、小程序、企业微信</div> `)
})
.catch(() => {})
.finally(() => {
this.loading = false
})
}, },
resetForm() { mounted() {
this.$refs['queryForm'].resetFields() this.clipboard = new this.ClipboardJS('.copy-btn')
this.getList(1)
}, },
goRoute(row = {}, detail) { unmounted() {
let { id } = row this.clipboard.destroy()
this.$router.push({
path: './' + (detail || 'addEdit'),
query: { id },
})
}, },
remove(id) { methods: {
const ids = id || this.ids + '' cancelFn() {
this.$confirm('是否确认删除吗?', '警告', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }) this.needMoreInfo = false
.then(function () { this.dialogVisible = false
return remove(ids) this.goRoute()
},
gotoSetting() {
this.$router.push({
path: '/enterpriseManage/enterpriseWechat'
}) })
.then(() => { },
this.getList() setState() {
this.msgSuccess('删除成功') api.getDetail().then((res) => {
if (!res.data.wxAppletOriginalId || !res.data.miniAppId || !res.data.miniSecret) {
this.needMoreInfo = true
}
}) })
}, },
}, getAnalysis() {
} this.loading = true
getAnalysis()
.then(({ data }) => {
this.cardData = [
{
title: '访问总数(pv)',
tips: '短链页面访问的总次数',
value: data.pvTotalCount
},
{
title: '访问总人数(uv)',
tips: '短链页面访问的独立IP数',
value: data.uvTotalCount
},
{
title: '小程序打开数',
tips: '小程序成功打开的总次数',
value: data.openTotalCount
},
{
title: '今日访问总数(pv)',
tips: '今日短链页面访问的总次数',
value: data.pvTodayCount,
title1: '较昨日',
value1: data.pvDiff
},
{
title: '今日访问总人数(uv)',
tips: '今日短链页面访问的独立IP数',
value: data.uvTodayCount,
title1: '较昨日',
value1: data.uvDiff
},
{
title: '今日小程序打开数',
tips: '今日小程序成功打开的总次数',
value: data.openTodayCount,
title1: '较昨日',
value1: data.openDiff
}
]
})
.catch((e) => {
console.log(e)
})
.finally(() => {
this.loading = false
})
},
getList(page) {
page && (this.query.pageNum = page)
this.loading = true
getList(this.query)
.then(({ rows, total }) => {
this.list = rows
this.total = +total
})
.catch(() => {})
.finally(() => {
this.loading = false
})
},
resetForm() {
this.$refs['queryForm'].resetFields()
this.getList(1)
},
goRoute(row = {}, detail) {
if (this.needMoreInfo) {
this.dialogVisible = true
return
}
let { id } = row
this.$router.push({
path: './' + (detail || 'addEdit'),
query: { id }
})
},
remove(id) {
const ids = id || this.ids + ''
this.$confirm('是否确认删除吗?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(function () {
return remove(ids)
})
.then(() => {
this.getList()
this.msgSuccess('删除成功')
})
}
}
}
</script> </script>
<template> <template>
...@@ -140,7 +169,8 @@ export default { ...@@ -140,7 +169,8 @@ export default {
v-for="(item, index) in touchTypeDict" v-for="(item, index) in touchTypeDict"
:key="index" :key="index"
:label="item.allName" :label="item.allName"
:value="+index"></el-option> :value="+index"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item label="" prop="status"> <!-- <el-form-item label="" prop="status">
...@@ -172,7 +202,8 @@ export default { ...@@ -172,7 +202,8 @@ export default {
<el-icon-copy-document <el-icon-copy-document
class="el-icon-copy-document copy-btn cp ml20" class="el-icon-copy-document copy-btn cp ml20"
title="复制" title="复制"
:data-clipboard-text="row.shortLink"></el-icon-copy-document> :data-clipboard-text="row.shortLink"
></el-icon-copy-document>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="状态" align="center" prop="status"> <!-- <el-table-column label="状态" align="center" prop="status">
...@@ -188,14 +219,39 @@ export default { ...@@ -188,14 +219,39 @@ export default {
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination :total="total" v-model:page="query.pageNum" v-model:limit="query.pageSize" @pagination="getList()" /> <pagination :total="total" v-model:page="query.pageNum" v-model:limit="query.pageSize" @pagination="getList()" />
<template v-if="!list.length">
<div class="tips">
智能短链需要先配置短链小程序,否则无法正常使用,<a class="link" @click="gotoSetting">去配置</a>
</div>
</template>
</div> </div>
<el-dialog title="提示" :close-on-click-modal="false" :show-close="false" v-model="dialogVisible" width="auto">
<div style="text-align: center;">
智能短链需要先配置短链小程序,否则无法正常使用。
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="cancelFn">继续新建</el-button>
<el-button type="primary" @click="gotoSetting">去配置</el-button>
</span>
</template>
</el-dialog>
</div> </div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-icon-copy-document { .tips {
&:hover { margin-top: 30px;
text-align: center;
color: #999999;
}
.link {
color: var(--color); color: var(--color);
border-bottom: 1px solid var(--color);
}
.el-icon-copy-document {
&:hover {
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!