Commit 6d827318 by 姜鹏凯

关键词群问题修复

1 parent 5b3f7cf3
<script>
import { getList, remove } from '@/api/communityOperating/keywords'
import { getList, remove } from '@/api/communityOperating/keywords'
export default {
components: { SelectUser },
props: {},
data() {
return {
h5Link: 'https://platform.wshoto.com/H5/?corpId=ww8e09372aff8d9190',
query: {
pageNum: 1,
pageSize: 10,
taskName: '', // 活码名称
createBy: '', // 创建人
keywords: '', // 关键词
beginTime: '', // 创建开始时间
endTime: '', // 创建结束时间
},
queryCreateByName: '',
dateRange: [], // 添加日期
total: 0, // 关键词拉群数据总量
list: [], // 关键词拉群数据
multiSelect: [], // 多选数据
dialogVisible: false,
dialogHowToConfig: false,
disabled: false,
loading: false,
clipboard: null,
}
},
watch: {
// 日期选择器数据同步至查询参数
dateRange(dateRange) {
if (!dateRange || dateRange.length !== 2) {
this.query.beginTime = ''
this.query.endTime = ''
} else {
;[this.query.beginTime, this.query.endTime] = dateRange
export default {
props: {},
data() {
return {
h5Link: 'https://platform.wshoto.com/H5/?corpId=ww8e09372aff8d9190',
query: {
pageNum: 1,
pageSize: 10,
taskName: '', // 活码名称
createBy: '', // 创建人
keywords: '', // 关键词
beginTime: '', // 创建开始时间
endTime: '' // 创建结束时间
},
queryCreateByName: '',
dateRange: [], // 添加日期
total: 0, // 关键词拉群数据总量
list: [], // 关键词拉群数据
multiSelect: [], // 多选数据
dialogVisible: false,
dialogHowToConfig: false,
disabled: false,
loading: false,
clipboard: null
}
},
},
created() {
this.getList(1)
this.$store.dispatch(
'app/setBusininessDesc',
`
watch: {
// 日期选择器数据同步至查询参数
dateRange(dateRange) {
if (!dateRange || dateRange.length !== 2) {
this.query.beginTime = ''
this.query.endTime = ''
} else {
;[this.query.beginTime, this.query.endTime] = dateRange
}
}
},
created() {
this.getList(1)
this.$store.dispatch(
'app/setBusininessDesc',
`
<div>当企业开通聊天工具栏后,用户可点击聊天工具栏中的【关键字群发】,搜索或选择某个关键词下的引导语及群活码,进行一键发送,客户手动扫码进群。</div>
`,
)
},
mounted() {
this.clipboard = new this.ClipboardJS('.copy-btn')
},
destroyed() {
this.clipboard.destroy()
},
methods: {
// 获取关键词拉群数据
getList(page) {
page && (this.query.pageNum = page)
this.loading = true
getList(this.query)
.then(({ rows, total }) => {
this.list = rows
this.total = +total
this.loading = false
})
.catch(() => {
this.loading = false
})
`
)
},
// 新增/编辑关键词拉群
goRoute(id) {
this.$router.push({
path: 'keywordsAev',
query: { id: id },
})
mounted() {
this.clipboard = new this.ClipboardJS('.copy-btn')
},
// 重置查询参数
resetQuery() {
this.dateRange = []
this.$refs['queryForm'].resetFields()
this.$nextTick(() => {
this.getList(1)
})
destroyed() {
this.clipboard.destroy()
},
// 批量删除
handleBulkRemove() {
this.$confirm('确认删除当前数据?删除操作无法撤销,请谨慎操作。', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
const ids = this.multiSelect.map((t) => t.taskId)
methods: {
// 获取关键词拉群数据
getList(page) {
page && (this.query.pageNum = page)
this.loading = true
remove(ids + '').then((res) => {
if (res.code === 200) {
this.getList()
} else {
}
getList(this.query)
.then(({ rows, total }) => {
this.list = rows
this.total = +total
this.loading = false
})
.catch(() => {
this.loading = false
})
},
// 新增/编辑关键词拉群
goRoute(id) {
this.$router.push({
path: 'keywordsAev',
query: { id: id }
})
.catch(() => {})
},
// 删除
handleRemove(id) {
this.$confirm('确认删除当前数据?删除操作无法撤销,请谨慎操作。', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
remove(id + '').then((res) => {
if (res.code === 200) {
this.getList()
} else {
}
},
// 重置查询参数
resetQuery() {
this.dateRange = []
this.$refs['queryForm'].resetFields()
this.$nextTick(() => {
this.getList(1)
})
},
// 批量删除
handleBulkRemove() {
this.$confirm('确认删除当前数据?删除操作无法撤销,请谨慎操作。', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
const ids = this.multiSelect.map((t) => t.taskId)
remove(ids + '').then((res) => {
if (res.code === 200) {
this.getList()
} else {
}
})
})
.catch(() => {})
},
// 删除
handleRemove(id) {
this.$confirm('确认删除当前数据?删除操作无法撤销,请谨慎操作。', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.catch(() => {})
},
openHelpDialog() {
this.dialogHowToConfig = true
},
// 获取显示用keyword字符串
getDisplayKeywords(row) {
const keywordList = row.keywordList || []
const keywords = keywordList.map((k) => k.keyword)
.then(() => {
remove(id + '').then((res) => {
if (res.code === 200) {
this.getList()
} else {
}
})
})
.catch(() => {})
},
openHelpDialog() {
this.dialogHowToConfig = true
},
// 获取显示用keyword字符串
getDisplayKeywords(row) {
const keywordList = row.keywordList || []
const keywords = keywordList.map((k) => k.keyword)
return keywords.join(' ')
},
// 获取显示用实际群码字符串
getDisplayRealGroups(row) {
if (!row || !row.groupNameList) return ''
return row.groupNameList.join(' ')
},
// 处理多选
handleSelectionChange(val) {
this.multiSelect = val
},
},
}
return keywords.join(' ')
},
// 获取显示用实际群码字符串
getDisplayRealGroups(row) {
if (!row || !row.groupNameList) return ''
return row.groupNameList.join(' ')
},
// 处理多选
handleSelectionChange(val) {
this.multiSelect = val
}
}
}
</script>
<template>
......@@ -167,7 +166,8 @@ export default {
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right"></el-date-picker>
align="right"
></el-date-picker>
</el-form-item>
<el-form-item label="">
<el-button type="primary" @click="getList(1)">查询</el-button>
......@@ -193,7 +193,8 @@ export default {
<el-image
slot="reference"
:src="(row.groupCodeInfo && row.groupCodeInfo.codeUrl) || ''"
class="code-image--small"></el-image>
class="code-image--small"
></el-image>
<el-image :src="(row.groupCodeInfo && row.groupCodeInfo.codeUrl) || ''" class="code-image"></el-image>
</el-popover>
</template>
......@@ -243,15 +244,17 @@ export default {
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getList()" />
@pagination="getList()"
/>
</div>
<el-dialog
title="配置方法"
:visible.sync="dialogHowToConfig"
width="500px"
style="margin-bottom: 7vh"
:close-on-click-modal="false">
style="margin-bottom: 7vh;"
:close-on-click-modal="false"
>
<div class="help">
<div class="step">
<p>1、登录企业微信官方后台,进入应用管理,点击 LinkWeChat,再点击【配置到聊天工具栏】。</p>
......@@ -274,25 +277,25 @@ export default {
</template>
<style scoped lang="scss">
.help {
.step {
margin-bottom: 20px;
.help {
.step {
margin-bottom: 20px;
}
}
.code-image {
width: 200px;
height: 200px;
}
.code-image--small {
width: 50px;
height: 50px;
}
.overflow-ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.table-desc {
max-width: 120px;
}
}
.code-image {
width: 200px;
height: 200px;
}
.code-image--small {
width: 50px;
height: 50px;
}
.overflow-ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.table-desc {
max-width: 120px;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!