Merge branch 'build' of http://git.sinoecare.com/sinoecare/digital_village_v2/dvcp_v2_webapp into build
This commit is contained in:
@@ -3,31 +3,31 @@
|
|||||||
<template slot="content">
|
<template slot="content">
|
||||||
<ai-search-bar class="search-bar">
|
<ai-search-bar class="search-bar">
|
||||||
<template slot="left">
|
<template slot="left">
|
||||||
<!-- <ai-select-->
|
<!-- <ai-select-->
|
||||||
<!-- v-model="search.owner"-->
|
<!-- v-model="search.owner"-->
|
||||||
<!-- filterable-->
|
<!-- filterable-->
|
||||||
<!-- @change="search.current = 1, getList()"-->
|
<!-- @change="search.current = 1, getList()"-->
|
||||||
<!-- placeholder="群主"-->
|
<!-- placeholder="群主"-->
|
||||||
<!-- :selectList="userList">-->
|
<!-- :selectList="userList">-->
|
||||||
<!-- </ai-select>-->
|
<!-- </ai-select>-->
|
||||||
<ai-select
|
<ai-select
|
||||||
v-model="search.tagId"
|
v-model="search.tagId"
|
||||||
@change="search.current = 1, getList()"
|
@change="search.current = 1, getList()"
|
||||||
placeholder="选择标签"
|
placeholder="选择标签"
|
||||||
:selectList="subTags">
|
:selectList="subTags">
|
||||||
</ai-select>
|
</ai-select>
|
||||||
</template>
|
</template>
|
||||||
<template slot="right">
|
<template slot="right">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="search.name"
|
v-model="search.name"
|
||||||
class="search-input"
|
class="search-input"
|
||||||
size="small"
|
size="small"
|
||||||
v-throttle="() => {search.current = 1, getList()}"
|
v-throttle="() => {search.current = 1, getList()}"
|
||||||
placeholder="请输入群主/群名称"
|
placeholder="请输入群主/群名称"
|
||||||
clearable
|
clearable
|
||||||
@change="getList"
|
@change="getList"
|
||||||
@clear="search.current = 1, search.name = '', getList()"
|
@clear="search.current = 1, search.name = '', getList()"
|
||||||
suffix-icon="iconfont iconSearch">
|
suffix-icon="iconfont iconSearch">
|
||||||
</el-input>
|
</el-input>
|
||||||
</template>
|
</template>
|
||||||
</ai-search-bar>
|
</ai-search-bar>
|
||||||
@@ -45,15 +45,15 @@
|
|||||||
</template>
|
</template>
|
||||||
</ai-search-bar>
|
</ai-search-bar>
|
||||||
<ai-table
|
<ai-table
|
||||||
:tableData="tableData"
|
:tableData="tableData"
|
||||||
:col-configs="colConfigs"
|
:col-configs="colConfigs"
|
||||||
:total="total"
|
:total="total"
|
||||||
ref="aitableex"
|
ref="aitableex"
|
||||||
:current.sync="search.current"
|
:current.sync="search.current"
|
||||||
@selection-change="handleSelectionChange"
|
@selection-change="handleSelectionChange"
|
||||||
:size.sync="search.size"
|
:size.sync="search.size"
|
||||||
v-loading="isLoading"
|
v-loading="isLoading"
|
||||||
@getList="getList">
|
@getList="getList">
|
||||||
<el-table-column slot="avatar" label="" width="80" align="center">
|
<el-table-column slot="avatar" label="" width="80" align="center">
|
||||||
<template slot-scope="{ row }">
|
<template slot-scope="{ row }">
|
||||||
<div class="avatar" style="text-align: right;justify-content: end;">
|
<div class="avatar" style="text-align: right;justify-content: end;">
|
||||||
@@ -89,20 +89,20 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
</ai-table>
|
</ai-table>
|
||||||
<ai-dialog
|
<ai-dialog
|
||||||
:visible.sync="isShow"
|
:visible.sync="isShow"
|
||||||
width="800px"
|
width="800px"
|
||||||
title="批量打标签"
|
title="批量打标签"
|
||||||
@close="chooseTags = []"
|
@close="chooseTags = []"
|
||||||
@onConfirm="onConfirm">
|
@onConfirm="onConfirm">
|
||||||
<div class="tags">
|
<div class="tags">
|
||||||
<div class="tag-item" v-for="(item, index) in tags" :key="index">
|
<div class="tag-item" v-for="(item, index) in tags" :key="index">
|
||||||
<h2>{{ item.name }}</h2>
|
<h2>{{ item.name }}</h2>
|
||||||
<div class="tag-item__right">
|
<div class="tag-item__right">
|
||||||
<el-button
|
<el-button
|
||||||
:type="chooseTags.indexOf(item.id) === -1 ? '' : 'primary'"
|
:type="chooseTags.indexOf(item.id) === -1 ? '' : 'primary'"
|
||||||
v-for="(item, index) in item.tagList"
|
v-for="(item, index) in item.tagList"
|
||||||
@click="choose(item.id)"
|
@click="choose(item.id)"
|
||||||
:key="index">
|
:key="index">
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -114,288 +114,285 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {mapState} from 'vuex'
|
import {mapState} from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'List',
|
name: 'List',
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
instance: Function, dict: Object
|
instance: Function, dict: Object
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
search: {
|
search: {
|
||||||
current: 1,
|
current: 1,
|
||||||
size: 10,
|
size: 10,
|
||||||
name: '',
|
name: '',
|
||||||
// tagId: '',
|
// tagId: '',
|
||||||
owner: ''
|
owner: ''
|
||||||
},
|
|
||||||
isLoading: false,
|
|
||||||
isShow: false,
|
|
||||||
ids: [],
|
|
||||||
total: 10,
|
|
||||||
chooseTags: [],
|
|
||||||
tags: [],
|
|
||||||
colConfigs: [
|
|
||||||
{type: 'selection'},
|
|
||||||
// {slot: 'avatar'},
|
|
||||||
{slot: 'userinfo'},
|
|
||||||
{prop: 'ownerName', label: '群主', align: 'center'},
|
|
||||||
{slot: 'tags'},
|
|
||||||
{
|
|
||||||
prop: 'personCount', label: '群人数', align: 'center'
|
|
||||||
},
|
|
||||||
{prop: 'increase', label: '当日入群人数', align: 'center'},
|
|
||||||
{prop: 'decrease', label: '当日退群人数', align: 'center'},
|
|
||||||
{
|
|
||||||
prop: 'createTime', label: '创建时间', align: 'left'
|
|
||||||
},
|
|
||||||
{slot: 'options', label: '操作', align: 'center'}],
|
|
||||||
tableData: [],
|
|
||||||
subTags: [],
|
|
||||||
userList: []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
computed: {
|
|
||||||
...mapState(['user'])
|
|
||||||
},
|
|
||||||
|
|
||||||
mounted() {
|
|
||||||
this.getTags()
|
|
||||||
this.getSubTags()
|
|
||||||
// this.getWxUserList()
|
|
||||||
this.getList()
|
|
||||||
this.isLoading = true
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
getWxUserList () {
|
|
||||||
this.instance.post(`/app/wxcp/wxuser/listByDepartId`, {
|
|
||||||
}).then(res => {
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.userList = res.data.map(item => {
|
|
||||||
item.dictName = item.name
|
|
||||||
item.dictValue = item.id
|
|
||||||
|
|
||||||
return item
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
isLoading: false,
|
||||||
|
isShow: false,
|
||||||
|
ids: [],
|
||||||
|
total: 10,
|
||||||
|
chooseTags: [],
|
||||||
|
tags: [],
|
||||||
|
colConfigs: [
|
||||||
|
{type: 'selection'},
|
||||||
|
// {slot: 'avatar'},
|
||||||
|
{slot: 'userinfo'},
|
||||||
|
{prop: 'ownerName', label: '群主', align: 'center'},
|
||||||
|
{prop: 'departmentName', label: '部门', align: 'center'},
|
||||||
|
{prop: 'areaName', label: '地区', align: 'center'},
|
||||||
|
{slot: 'tags'},
|
||||||
|
{prop: 'personCount', label: '群人数', align: 'center'},
|
||||||
|
{prop: 'increase', label: '当日入群人数', align: 'center'},
|
||||||
|
{prop: 'decrease', label: '当日退群人数', align: 'center'},
|
||||||
|
{prop: 'createTime', label: '创建时间', align: 'left'},
|
||||||
|
{slot: 'options', label: '操作', align: 'center'}],
|
||||||
|
tableData: [],
|
||||||
|
subTags: [],
|
||||||
|
userList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
update() {
|
computed: {
|
||||||
this.instance.post(`/app/wxcp/wxgroup/sync`).then(res => {
|
...mapState(['user'])
|
||||||
if (res.code == 0) {
|
},
|
||||||
this.$message.success('更新成功')
|
|
||||||
this.getList()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
getSubTags() {
|
mounted() {
|
||||||
this.instance.post(`/app/wxcp/wxgroupchattag/listAllTag`).then(res => {
|
this.getTags()
|
||||||
if (res.code == 0) {
|
this.getSubTags()
|
||||||
this.subTags = res.data?.map(item => {
|
// this.getWxUserList()
|
||||||
return {
|
this.getList()
|
||||||
dictName: item.name,
|
this.isLoading = true
|
||||||
dictValue: item.id
|
},
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
getList() {
|
methods: {
|
||||||
this.instance.post(`/app/wxcp/wxgroup/list`, null, {
|
getWxUserList() {
|
||||||
params: {
|
this.instance.post(`/app/wxcp/wxuser/listByDepartId`, {}).then(res => {
|
||||||
...this.search
|
if (res.code == 0) {
|
||||||
}
|
this.userList = res.data.map(item => {
|
||||||
}).then(res => {
|
item.dictName = item.name
|
||||||
if (res.code == 0) {
|
item.dictValue = item.id
|
||||||
this.tableData = res.data.records
|
|
||||||
this.total = res.data.total
|
|
||||||
}
|
|
||||||
this.isLoading = false
|
|
||||||
}).catch(() => {
|
|
||||||
this.isLoading = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
choose(id) {
|
return item
|
||||||
const index = this.chooseTags.indexOf(id)
|
})
|
||||||
if (index === -1) {
|
|
||||||
this.chooseTags.push(id)
|
|
||||||
} else {
|
|
||||||
this.chooseTags.splice(index, 1)
|
|
||||||
}
|
}
|
||||||
},
|
})
|
||||||
|
},
|
||||||
|
|
||||||
onConfirm(type = 0) {
|
update() {
|
||||||
if (type == 0 && !this.chooseTags.length) {
|
this.instance.post(`/app/wxcp/wxgroup/sync`).then(res => {
|
||||||
return this.$message.error('请选择标签')
|
if (res.code == 0) {
|
||||||
|
this.$message.success('更新成功')
|
||||||
|
this.getList()
|
||||||
}
|
}
|
||||||
this.instance.post(`/app/wxcp/wxgroupchattag/markTagForWeb`, {
|
})
|
||||||
tagIds: this.chooseTags, groupIds: this.ids.map(v => v.id), type,
|
},
|
||||||
}).then(res => {
|
|
||||||
if (res.code == 0) {
|
|
||||||
type == 0 ? (this.isShow = false) : false
|
|
||||||
this.$message.success(type == 0 ? "添加成功" : "删除成功")
|
|
||||||
this.getList()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
getTags() {
|
getSubTags() {
|
||||||
this.instance.post(`/app/wxcp/wxgroupchattag/listAll?size=999`).then(res => {
|
this.instance.post(`/app/wxcp/wxgroupchattag/listAllTag`).then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.tags = res.data.records
|
this.subTags = res.data?.map(item => {
|
||||||
}
|
return {
|
||||||
})
|
dictName: item.name,
|
||||||
},
|
dictValue: item.id
|
||||||
|
|
||||||
onAdd() {
|
|
||||||
this.$emit('change', {
|
|
||||||
type: 'add'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
handleSelectionChange(e) {
|
|
||||||
this.ids = e
|
|
||||||
},
|
|
||||||
|
|
||||||
removeAll() {
|
|
||||||
this.remove(this.ids.map(v => v.id).join(','))
|
|
||||||
},
|
|
||||||
|
|
||||||
remove(id) {
|
|
||||||
this.$confirm('确定删除该数据?').then(() => {
|
|
||||||
this.instance.post(`/app/apppetition/delete?ids=${id}`).then(res => {
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.$message.success('删除成功!')
|
|
||||||
this.getList()
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
},
|
})
|
||||||
|
},
|
||||||
|
|
||||||
toDetail(id) {
|
getList() {
|
||||||
this.$emit('change', {
|
this.instance.post(`/app/wxcp/wxgroup/list`, null, {
|
||||||
type: 'detail', params: {
|
params: {
|
||||||
id: id
|
...this.search
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.tableData = res.data.records
|
||||||
|
this.total = res.data.total
|
||||||
|
}
|
||||||
|
this.isLoading = false
|
||||||
|
}).catch(() => {
|
||||||
|
this.isLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
choose(id) {
|
||||||
|
const index = this.chooseTags.indexOf(id)
|
||||||
|
if (index === -1) {
|
||||||
|
this.chooseTags.push(id)
|
||||||
|
} else {
|
||||||
|
this.chooseTags.splice(index, 1)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onConfirm(type = 0) {
|
||||||
|
if (type == 0 && !this.chooseTags.length) {
|
||||||
|
return this.$message.error('请选择标签')
|
||||||
|
}
|
||||||
|
this.instance.post(`/app/wxcp/wxgroupchattag/markTagForWeb`, {
|
||||||
|
tagIds: this.chooseTags, groupIds: this.ids.map(v => v.id), type,
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
type == 0 ? (this.isShow = false) : false
|
||||||
|
this.$message.success(type == 0 ? "添加成功" : "删除成功")
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getTags() {
|
||||||
|
this.instance.post(`/app/wxcp/wxgroupchattag/listAll?size=999`).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.tags = res.data.records
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
onAdd() {
|
||||||
|
this.$emit('change', {
|
||||||
|
type: 'add'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
handleSelectionChange(e) {
|
||||||
|
this.ids = e
|
||||||
|
},
|
||||||
|
|
||||||
|
removeAll() {
|
||||||
|
this.remove(this.ids.map(v => v.id).join(','))
|
||||||
|
},
|
||||||
|
|
||||||
|
remove(id) {
|
||||||
|
this.$confirm('确定删除该数据?').then(() => {
|
||||||
|
this.instance.post(`/app/apppetition/delete?ids=${id}`).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.$message.success('删除成功!')
|
||||||
|
this.getList()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
})
|
||||||
|
},
|
||||||
|
|
||||||
onAdd() {
|
toDetail(id) {
|
||||||
this.$emit('change', {
|
this.$emit('change', {
|
||||||
type: 'add'
|
type: 'detail', params: {
|
||||||
})
|
id: id
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
onAdd() {
|
||||||
|
this.$emit('change', {
|
||||||
|
type: 'add'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.table-tags {
|
.table-tags {
|
||||||
.el-tag {
|
.el-tag {
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
border: 1px solid #D0D4DC;
|
border: 1px solid #D0D4DC;
|
||||||
background: #F3F4F7;
|
background: #F3F4F7;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
color: #222222;
|
color: #222222;
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.ellipsis {
|
.ellipsis {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tags {
|
.tags {
|
||||||
.tag-item {
|
.tag-item {
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding-bottom: 30px;
|
|
||||||
padding-top: 30px;
|
|
||||||
border-bottom: 1px solid #EEEEEE;
|
|
||||||
|
|
||||||
&:first-child {
|
|
||||||
padding-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-tag {
|
|
||||||
margin-right: 8px;
|
|
||||||
color: #222222;
|
|
||||||
}
|
|
||||||
|
|
||||||
h2 {
|
|
||||||
width: 88px;
|
|
||||||
margin-right: 40px;
|
|
||||||
text-align: right;
|
|
||||||
color: #888888;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.avatar {
|
|
||||||
text-align: right;
|
|
||||||
|
|
||||||
img {
|
|
||||||
position: relative;
|
|
||||||
top: 4px;
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
border-radius: 2px;
|
|
||||||
border: 1px solid #CCCCCC;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.userinfo {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
line-height: 1;
|
padding-bottom: 30px;
|
||||||
|
padding-top: 30px;
|
||||||
|
border-bottom: 1px solid #EEEEEE;
|
||||||
|
|
||||||
.userinfo-right__top {
|
&:first-child {
|
||||||
display: flex;
|
padding-top: 0;
|
||||||
align-items: center;
|
|
||||||
cursor: pointer;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.userinfo-right__bottom {
|
.el-tag {
|
||||||
text-align: left;
|
margin-right: 8px;
|
||||||
|
color: #222222;
|
||||||
}
|
}
|
||||||
|
|
||||||
i {
|
h2 {
|
||||||
cursor: pointer;
|
width: 88px;
|
||||||
font-style: normal;
|
margin-right: 40px;
|
||||||
|
text-align: right;
|
||||||
color: #888888;
|
color: #888888;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
h3 {
|
|
||||||
margin-top: 0;
|
|
||||||
margin-bottom: 0;
|
|
||||||
margin-right: 8px;
|
|
||||||
color: #222222;
|
|
||||||
font-weight: normal;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
span {
|
|
||||||
color: #2EA222;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.avatar {
|
||||||
|
text-align: right;
|
||||||
|
|
||||||
|
img {
|
||||||
|
position: relative;
|
||||||
|
top: 4px;
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
border-radius: 2px;
|
||||||
|
border: 1px solid #CCCCCC;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.userinfo {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
line-height: 1;
|
||||||
|
|
||||||
|
.userinfo-right__top {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
cursor: pointer;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.userinfo-right__bottom {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
i {
|
||||||
|
cursor: pointer;
|
||||||
|
font-style: normal;
|
||||||
|
color: #888888;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
margin-right: 8px;
|
||||||
|
color: #222222;
|
||||||
|
font-weight: normal;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
span {
|
||||||
|
color: #2EA222;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
189
project/fengdu/app/AppPageSet/AppPageSet.vue
Normal file
189
project/fengdu/app/AppPageSet/AppPageSet.vue
Normal file
@@ -0,0 +1,189 @@
|
|||||||
|
<template>
|
||||||
|
<div class="AppPageSet">
|
||||||
|
<ai-list class="list">
|
||||||
|
<ai-title slot="title" title="引导页设置" isShowBottomBorder :instance="instance"></ai-title>
|
||||||
|
<template slot="content">
|
||||||
|
<ai-search-bar bottomBorder>
|
||||||
|
<template #left>
|
||||||
|
<el-button type="primary" @click="isShow = true">添加</el-button>
|
||||||
|
</template>
|
||||||
|
<template #right>
|
||||||
|
<span class="text">是否开启引导页</span> <el-switch v-model="isStart" @change="changeStatus"></el-switch>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<div class="content">
|
||||||
|
<ai-table
|
||||||
|
:tableData="tableData"
|
||||||
|
:col-configs="colConfigs"
|
||||||
|
:total="total"
|
||||||
|
style="margin-top: 16px;"
|
||||||
|
:current.sync="search.current"
|
||||||
|
:size.sync="search.size"
|
||||||
|
@getList="getList">
|
||||||
|
<el-table-column
|
||||||
|
slot="index"
|
||||||
|
type="index"
|
||||||
|
width="100px"
|
||||||
|
label="序号"
|
||||||
|
align="center">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column slot="urlList" label="缩略图" align="center">
|
||||||
|
<template slot-scope="{ row }">
|
||||||
|
<ai-uploader
|
||||||
|
:instance="instance"
|
||||||
|
disabled
|
||||||
|
v-model="row.urlList"
|
||||||
|
:limit="1">
|
||||||
|
</ai-uploader>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column slot="options" width="140px" fixed="right" label="操作" align="center">
|
||||||
|
<template slot-scope="{ row }">
|
||||||
|
<div class="table-options">
|
||||||
|
<el-button type="text" @click="edit(row)">编辑</el-button>
|
||||||
|
<el-button type="text" @click="remove(row.id)">删除</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</div>
|
||||||
|
<ai-dialog
|
||||||
|
:visible.sync="isShow"
|
||||||
|
width="890px"
|
||||||
|
:title="form.id ? '编辑引导页' : '添加引导页'"
|
||||||
|
@close="onClose"
|
||||||
|
@onConfirm="onConfirm">
|
||||||
|
<el-form ref="form" class="ai-form" :model="form" label-width="110px" label-position="right">
|
||||||
|
<el-form-item label="缩略图" style="width: 100%;" prop="urlList" :rules="[{required: true, message: '请上传缩略图', trigger: 'change'}]">
|
||||||
|
<ai-uploader
|
||||||
|
:instance="instance"
|
||||||
|
isShowTip
|
||||||
|
v-model="form.urlList"
|
||||||
|
:limit="1">
|
||||||
|
</ai-uploader>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="引导页名称" style="width: 100%" prop="title" :rules="[{required: true, message: '请输入引导页名称', trigger: 'blur'}]">
|
||||||
|
<el-input v-model="form.title" size="small" placeholder="请输入引导页名称"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ai-dialog>
|
||||||
|
</template>
|
||||||
|
</ai-list>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'AppPageSet',
|
||||||
|
label: '引导页设置',
|
||||||
|
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object
|
||||||
|
},
|
||||||
|
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
search: {
|
||||||
|
current: 1,
|
||||||
|
size: 10,
|
||||||
|
},
|
||||||
|
colConfigs: [
|
||||||
|
{ slot: 'index', label: '序号'},
|
||||||
|
{ slot: 'urlList' },
|
||||||
|
{ prop: 'title', label: '引导页名称' },
|
||||||
|
{ prop: 'createTime', label: '创建时间', width: '200' },
|
||||||
|
{ prop: 'createUserName', label: '创建人', width: '200' },
|
||||||
|
{ slot: 'option'}
|
||||||
|
],
|
||||||
|
tableData: [],
|
||||||
|
total: 0,
|
||||||
|
isStart: true,
|
||||||
|
isShow: false,
|
||||||
|
form: {
|
||||||
|
urlList: [],
|
||||||
|
picUrl: '',
|
||||||
|
title: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
created () {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
getList () {
|
||||||
|
this.instance.post(`/app/appwechatguidepage/list`, null, {
|
||||||
|
params: {
|
||||||
|
...this.search
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
res.data.records.map((item) => {
|
||||||
|
item.urlList = [{url: item.picUrl}]
|
||||||
|
})
|
||||||
|
this.tableData = res.data.records
|
||||||
|
this.total = res.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
remove (id) {
|
||||||
|
this.$confirm('确定删除该数据?').then(() => {
|
||||||
|
this.instance.post(`/app/appwechatguidepage/delete?ids=${id}`).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.$message.success('删除成功!')
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
edit (e) {
|
||||||
|
this.form = {...e}
|
||||||
|
this.form.urlList = [{
|
||||||
|
url: e.picUrl
|
||||||
|
}]
|
||||||
|
this.isShow = true
|
||||||
|
},
|
||||||
|
onClose () {
|
||||||
|
this.form.id = ''
|
||||||
|
this.form.urlList = []
|
||||||
|
this.form.title = ''
|
||||||
|
this.isShow = false
|
||||||
|
},
|
||||||
|
onConfirm () {
|
||||||
|
this.$refs.form.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.instance.post(`/app/appwechatguidepage/addOrUpdate`, {
|
||||||
|
...this.form,
|
||||||
|
picUrl: this.form.urlList[0].url
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.$message.success('提交成功!')
|
||||||
|
this.isShow = false
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeStatus(status) {
|
||||||
|
this.instance.post(`/app/appwechatguidepage/enable`).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.$message.success('操作成功!')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.AppPageSet {
|
||||||
|
.text {
|
||||||
|
color: #666;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user