| | |
| | | <TableLayout :permissions="['business:activity:query']"> |
| | | <!-- 搜索表单 --> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> |
| | | <el-form-item label="资讯标题" prop="name"> |
| | | <el-input v-model="searchForm.name" placeholder="请输入资讯标题" @keypress.enter.native="search"></el-input> |
| | | <el-form-item label="标题" prop="name"> |
| | | <el-input v-model="searchForm.name" placeholder="请输入标题" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="发布人" prop="realName"> |
| | | <el-input v-model="searchForm.realName" placeholder="请输入发布人" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="用户类型" prop="userType"> |
| | | <el-form-item label="所属分类" prop="labelId"> |
| | | <el-select |
| | | v-model="searchForm.userType" |
| | | placeholder="请选择用户类型" |
| | | v-model="searchForm.labelId" |
| | | placeholder="请选择所属分类" |
| | | style="width: 150px" |
| | | clearable |
| | | @change="search" |
| | | > |
| | | <!-- 0系统管理员 1机构管理员 2创作中心管理员 --> |
| | | <el-option |
| | | v-for="item in userType" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | :label="item.label" |
| | | v-for="item in labels" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="所属品牌" prop="brandId"> |
| | | <el-select |
| | | v-model="searchForm.brandId" |
| | | style="width: 150px" |
| | | placeholder="请选择所属品牌" |
| | | clearable |
| | | @change="search" |
| | | > |
| | | <el-option |
| | | v-for="item in brands" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" width="55" ></el-table-column> |
| | | <el-table-column prop="imgurlfull" label="资讯主图" align="center" min-width="100px"> |
| | | <el-table-column prop="imgurlfull" label="主图" align="center" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <el-image :scr="row.imgurlfull" :preview-src-list="[row.imgurlfull]"></el-image> |
| | | <el-image style="width: 50px;height: 50px;" v-if="row.imgurl && row.imgurl!=''" :src="row.imgurlfull" :preview-src-list="[row.imgurlfull]"></el-image> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="name" label="资讯标题" align="center" min-width="100px"> |
| | | <el-table-column prop="name" label="标题" align="center" min-width="100px"></el-table-column> |
| | | <el-table-column prop="lablesName" label="所属分类" align="center" min-width="100px"></el-table-column> |
| | | <el-table-column prop="brandName" label="所属品牌" align="center" min-width="100px"></el-table-column> |
| | | <el-table-column prop="content" label="数据值" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="shopDetail(row)">{{ row.name }}</el-button> |
| | | <div v-if="row.content"> |
| | | <el-button v-if="row.contentType == 1" title="点击跳转外链查看" type="text" @click="openUrl(row)" >点击跳转</el-button> |
| | | <el-button v-else title="点击查看详情" type="text" @click="showCode(row)" >点击查看</el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="lablesName" label="资讯分类" align="center" min-width="100px"></el-table-column> |
| | | <el-table-column prop="realName" label="发布用户" align="center" min-width="100px"></el-table-column> |
| | | <el-table-column prop="name" label="用户类型" align="center" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | {{ userTypeToStr(row.userType) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="looknum" label="浏览数" align="center" min-width="100px"></el-table-column> |
| | | <el-table-column prop="looknum" label="浏览量" align="center" min-width="100px"></el-table-column> |
| | | <el-table-column prop="zanCount" label="点赞数" align="center" min-width="100px"></el-table-column> |
| | | <el-table-column prop="commentCount" label="评论数" align="center" min-width="100px"></el-table-column> |
| | | <el-table-column prop="collectCount" label="收藏数" align="center" min-width="100px"></el-table-column> |
| | | <el-table-column prop="createDate" label="发布时间" align="center" min-width="140px"></el-table-column> |
| | | <el-table-column prop="realName" label="发布人" align="center" min-width="140px"></el-table-column> |
| | | <el-table-column prop="editDate" label="发布时间" align="center" min-width="140px"></el-table-column> |
| | | <el-table-column prop="status" label="状态" min-width="80px" align="center"> |
| | | <template slot-scope="{row}"> |
| | | <el-switch |
| | | v-model="row.status" |
| | | :active-value="1" |
| | | :inactive-value="0" |
| | | active-color="#13ce66" |
| | | fixed="right" |
| | | inactive-color="#ff4949" |
| | | @change="statusChange(row)" |
| | | ></el-switch> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | v-if="containPermissions(['business:activity:update', 'business:activity:delete'])" |
| | | label="操作" |
| | |
| | | </template> |
| | | <!-- 新建/修改 --> |
| | | <OperaInformationWindow ref="operaInformationWindow" @success="handlePageChange"/> |
| | | <el-dialog |
| | | class="center-title" |
| | | :title="'内容详情【'+curTitle+'】'" |
| | | width="70%" |
| | | height="70%" |
| | | text="字典值" |
| | | :visible.sync="visible1" |
| | | append-to-body |
| | | > |
| | | <div class="agree-list" v-html="agreement"> |
| | | </div> |
| | | <template v-slot:footer> |
| | | <el-button @click="visible1=false">返回</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import OperaInformationWindow from '@/components/business/OperaInformationWindow' |
| | | import { findAll as labelList } from '@/api/business/labels' |
| | | export default { |
| | | name: 'Information', |
| | | extends: BaseTable, |
| | |
| | | searchForm: { |
| | | name: '', |
| | | realName: '', |
| | | userType: '', |
| | | type: 3 //类型0商家活动 1平台活动 2探店 3资讯 |
| | | brandId: null, |
| | | labelId: null, |
| | | contentType: '', |
| | | type: 3 // 类型0商家活动 1平台活动 2探店 3资讯 |
| | | }, |
| | | // 0系统管理员 1机构管理员 2创作中心管理员 |
| | | userType: [ |
| | | { label: '平台', id: 0 }, |
| | | { label: '机构', id: 1 }, |
| | | { label: '创作者', id: 2 } |
| | | ] |
| | | agreement: null, |
| | | curTitle:'', |
| | | visible1: false, |
| | | labels: [], |
| | | brands: [] |
| | | } |
| | | }, |
| | | created () { |
| | | provide () { |
| | | return { |
| | | labels: () => this.labels, |
| | | brands: () => this.brands |
| | | } |
| | | }, |
| | | created: function () { |
| | | this.config({ |
| | | module: '资讯信息表', |
| | | api: '/business/activity', |
| | |
| | | 'field.main': 'id' |
| | | }) |
| | | this.search() |
| | | labelList({ |
| | | type: 0 // 商品分类 |
| | | }).then(res => { |
| | | this.labels = res |
| | | }) |
| | | labelList({ |
| | | type: 1 // 商品品牌 |
| | | }) |
| | | .then(res => { |
| | | this.brands = res |
| | | }) |
| | | }, |
| | | methods: { |
| | | userTypeToStr(type) { |
| | | const temp = this.userType.find(item => item.id = type) |
| | | return temp ? temp.label : '-' |
| | | showCode(row){ |
| | | this.curTitle =row.name |
| | | this.agreement=row.content |
| | | this.visible1=true |
| | | }, |
| | | shopDetail(row) { |
| | | |
| | | openUrl(row){ |
| | | window.open(row.content) |
| | | }, |
| | | statusChange (row) { |
| | | this.api.updateStatusById({ id: row.id, status: row.status }) |
| | | .then(() => { |
| | | this.$message.success('操作成功') |
| | | }) |
| | | .catch(e => { |
| | | this.$message.error('操作成功') |
| | | }) |
| | | .then(() => { |
| | | this.handlePageChange() |
| | | }) |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .agree-list{ |
| | | height: 550px; |
| | | //max-height: 50%; |
| | | overflow: auto; |
| | | } |
| | | .no-scroll { |
| | | overflow: hidden !important; |
| | | } |
| | | /deep/ .window__body { |
| | | .table-content { |
| | | padding: 0; |
| | | .table-wrap { |
| | | padding-top: 0; |
| | | } |
| | | } |
| | | |
| | | } |
| | | </style> |