|
@ -1,8 +1,9 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div class="app-container"> |
|
|
<div class="app-container"> |
|
|
|
|
|
<!-- 头部搜索添加 --> |
|
|
<div class="filter-container"> |
|
|
<div class="filter-container"> |
|
|
<el-select v-model="policyType" placeholder="政策类型" clearable style="width: 190px" class="filter-item"> |
|
|
<el-select v-model="policyType" placeholder="政策类型" clearable style="width: 190px" class="filter-item"> |
|
|
<el-option v-for="(item,index) in types" :key="index" :value="index" /> |
|
|
<el-option v-for="(item,index) in typeList" :key="index" :value="index" /> |
|
|
</el-select> |
|
|
</el-select> |
|
|
<el-select v-model="policyStatus" placeholder="审核状态" clearable class="filter-item" style="width: 190px;margin-left:10px" value="1"> |
|
|
<el-select v-model="policyStatus" placeholder="审核状态" clearable class="filter-item" style="width: 190px;margin-left:10px" value="1"> |
|
|
<el-option v-for="(item,index) in status" :key="index" :value="index" /> |
|
|
<el-option v-for="(item,index) in status" :key="index" :value="index" /> |
|
@ -10,38 +11,170 @@ |
|
|
<el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-search" @click="Search"> |
|
|
<el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-search" @click="Search"> |
|
|
搜索 |
|
|
搜索 |
|
|
</el-button> |
|
|
</el-button> |
|
|
<el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit"> |
|
|
<el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit" @click="policyAdd"> |
|
|
添加 |
|
|
添加 |
|
|
</el-button> |
|
|
</el-button> |
|
|
<el-checkbox class="filter-item" style="margin-left:15px;"> |
|
|
|
|
|
审核人 |
|
|
|
|
|
</el-checkbox> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<!-- <el-table :data="polictList" border fit highlight-current-row style="width: 100%;"> |
|
|
<!-- 政策信息列表 --> |
|
|
<el-table-column label="ID" prop="id" sortable="custom" align="center" width="80"> |
|
|
<el-table v-loading="listLoading" :data="polictList" border fit highlight-current-row style="width: 100%;"> |
|
|
|
|
|
<el-table-column label="ID" prop="id" align="center" width="80"> |
|
|
<template slot-scope="{row}"> |
|
|
<template slot-scope="{row}"> |
|
|
<span>{{ row.id }}</span> |
|
|
<span>{{ row.id }}</span> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column> |
|
|
<el-table-column label="标题" prop="title" align="center" width="480"> |
|
|
<template> |
|
|
<template slot-scope="{row}"> |
|
|
<span>ID</span> |
|
|
<span>{{ row.title }}</span> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column label="时间" prop="time" align="center" width="180"> |
|
|
|
|
|
<template slot-scope="{row}"> |
|
|
|
|
|
<span>{{ row.publishTime }}</span> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column label="部门" prop="depart" align="center" width="180"> |
|
|
|
|
|
<template slot-scope="{row}"> |
|
|
|
|
|
<span>{{ row.publishDepart }}</span> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column> |
|
|
<el-table-column label="原文链接" prop="url" align="center" width="180"> |
|
|
<template> |
|
|
<template slot-scope="{row}"> |
|
|
<span>ID</span> |
|
|
<!-- <span>{{ row.titleUrl }} --> |
|
|
|
|
|
<a :href="row.titleUrl" target="_blank">点击此处跳转</a> |
|
|
|
|
|
<!-- </span> --> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column> |
|
|
<el-table-column label="审核状态" prop="status" align="center" width="180"> |
|
|
<template> |
|
|
<template slot-scope="{row}"> |
|
|
<span>ID</span> |
|
|
<!-- <span>{{ row.auditStatus }}</span> --> |
|
|
|
|
|
<el-tag v-if="row.auditStatus === 0" style="background:#FFBB77;" type="published"> |
|
|
|
|
|
刚入库 |
|
|
|
|
|
</el-tag> |
|
|
|
|
|
<el-tag v-if="row.auditStatus === 1" type="published"> |
|
|
|
|
|
审核通过 |
|
|
|
|
|
</el-tag> |
|
|
|
|
|
<el-tag v-if="row.auditStatus === 2" style="background:#FF5151;color:white" type="draft"> |
|
|
|
|
|
审核不通过 |
|
|
|
|
|
</el-tag> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
</el-table> --> |
|
|
<el-table-column label="操作" align="center" width="230" class-name="small-padding fixed-width"> |
|
|
|
|
|
<template slot-scope="{row}"> |
|
|
|
|
|
<el-button type="primary" size="mini" @click="handleUpdate(row)"> |
|
|
|
|
|
修改 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
<el-button v-if="row.auditStatus === 2" size="mini" type="success" @click="handleModifyStatus(row,1)"> |
|
|
|
|
|
通过 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
<el-button v-if="row.auditStatus === 1" size="mini" @click="handleModifyStatus(row,2)"> |
|
|
|
|
|
未通过 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
<el-button v-if="row.auditStatus === 0" size="mini" type="success" @click="handleModifyStatus(row,1)"> |
|
|
|
|
|
通过 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
<el-button size="mini" type="danger" @click="handleDelete(row.id)"> |
|
|
|
|
|
删除 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
<!-- 显示当前页数,且显示所有页数,可以跳转 --> |
|
|
|
|
|
<pagination v-show="total>0" :total="total" :page.sync="data.pageNum" :limit.sync="data.pageSize" @pagination="getList" /> |
|
|
|
|
|
<!-- 修改政策界面 --> |
|
|
|
|
|
<el-dialog title="修改" :visible.sync="dialogFormVisible"> |
|
|
|
|
|
<el-form ref="dataForm" :model="temp" label-position="left" label-width="70px" style="width: 400px; margin-left:50px;"> |
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="政策标题" prop="title" style="width: 180%"> |
|
|
|
|
|
<el-input v-model="temp.title" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="原文链接" prop="titleUrl" style="width: 180%"> |
|
|
|
|
|
<el-input v-model="temp.titleUrl" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
<pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" /> |
|
|
<el-form-item label="图片路径" prop="imgUrl" style="width: 180%"> |
|
|
|
|
|
<el-input v-model="temp.imgUrl" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="原文内容" prop="content" style="width: 180%"> |
|
|
|
|
|
<!-- <el-button @click="show111 = !show111">原文/编辑</el-button> --> |
|
|
|
|
|
<!-- <textarea v-if="show111 === false" style="width: 100%;height: 300px" v-text="temp.content" /> --> |
|
|
|
|
|
<div v-if="show111 === false" contentEditable="true" style="border:1px solid #000;border-radius:10px 0 0 10px;padding: 20px;background: #F5F5F5;height: 260px;overflow-y: auto;" v-html="temp.content">'</div> |
|
|
|
|
|
<!-- <textarea id="content" name="content" /> --> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="政策简介" prop="intro" style="width: 180%"> |
|
|
|
|
|
<el-input v-model="temp.intro" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="政策标签" prop="intro" style="width: 180%"> |
|
|
|
|
|
<el-input /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="政策类型" prop="type"> |
|
|
|
|
|
<el-select v-model="policyType1" placeholder="政策类型" clearable style="width: 190px" class="filter-item"> |
|
|
|
|
|
<el-option v-for="(item,index) in typeList" :key="index" :value="index" /> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="审核状态" prop="status"> |
|
|
|
|
|
<el-select v-model="policyStatus1" placeholder="审核状态" clearable class="filter-item" style="width: 190px;" value="1"> |
|
|
|
|
|
<el-option v-for="(item,index) in status" :key="index" :value="index" /> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
</el-form> |
|
|
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
|
|
<el-button @click="dialogFormVisible = false"> |
|
|
|
|
|
取消 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
<el-button type="primary" @click="Commit"> |
|
|
|
|
|
提交 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-dialog> |
|
|
|
|
|
<!-- 添加政策界面 --> |
|
|
|
|
|
<el-dialog title="修改" :visible.sync="dialogFormVisible1"> |
|
|
|
|
|
<el-form ref="dataForm" :model="temp" label-position="left" label-width="70px" style="width: 400px; margin-left:50px;"> |
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="政策标题" prop="title" style="width: 180%"> |
|
|
|
|
|
<el-input v-model="addPolicy.title" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="发布时间" prop="time" style="width: 180%"> |
|
|
|
|
|
<!-- <el-input v-model="addPolicy.publishTime" placeholder="例如:2020/01/01" /> --> |
|
|
|
|
|
<el-date-picker id="Time" v-model="addPolicy.publishTime" type="date" placeholder="请选择时间" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="原文链接" prop="titleUrl" style="width: 180%"> |
|
|
|
|
|
<el-input v-model="addPolicy.titleUrl" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="图片路径" prop="imgUrl" style="width: 180%"> |
|
|
|
|
|
<el-input v-model="addPolicy.imgUrl" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="原文内容" prop="content" style="width: 180%"> |
|
|
|
|
|
<!-- <el-button @click="show111 = !show111">原文/编辑</el-button> --> |
|
|
|
|
|
<!-- <textarea v-if="show111 === false" style="width: 100%;height: 300px" v-text="temp.content" /> --> |
|
|
|
|
|
<div v-if="show111 === false" id="Content" contentEditable="true" style="border:1px solid #000;border-radius:10px 0 0 10px;padding: 20px;background: #F5F5F5;height: 260px;overflow-y: auto;" v-html="addPolicy.content">'</div> |
|
|
|
|
|
<!-- <textarea id="content" name="content" /> --> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="政策简介" prop="intro" style="width: 180%"> |
|
|
|
|
|
<el-input v-model="addPolicy.intro" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
</el-form> |
|
|
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
|
|
<el-button @click="dialogFormVisible1 = false"> |
|
|
|
|
|
取消 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
<el-button type="primary" @click="CommitAdd"> |
|
|
|
|
|
提交 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-dialog> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
@ -55,8 +188,8 @@ export default { |
|
|
components: { Pagination }, |
|
|
components: { Pagination }, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
tableKey: 0, |
|
|
|
|
|
list: null, |
|
|
list: null, |
|
|
|
|
|
show111: false, |
|
|
total: 0, |
|
|
total: 0, |
|
|
listLoading: true, |
|
|
listLoading: true, |
|
|
data: { |
|
|
data: { |
|
@ -65,19 +198,29 @@ export default { |
|
|
pageSize: 20, |
|
|
pageSize: 20, |
|
|
type: '' |
|
|
type: '' |
|
|
}, |
|
|
}, |
|
|
listQuery: { |
|
|
|
|
|
page: 1, |
|
|
|
|
|
limit: 20, |
|
|
|
|
|
importance: undefined, |
|
|
|
|
|
title: undefined, |
|
|
|
|
|
type: undefined, |
|
|
|
|
|
sort: '+id' |
|
|
|
|
|
}, |
|
|
|
|
|
polictList: [], |
|
|
polictList: [], |
|
|
types: { '申报通知': 0, '公告公示': 1, '政策动态': 2, '申报指南': 3 }, |
|
|
typeList: { '申报通知': 0, '公告公示': 1, '政策动态': 2, '申报指南': 3 }, |
|
|
policyType: undefined, |
|
|
policyType: undefined, |
|
|
|
|
|
policyType1: undefined, |
|
|
policyStatus: undefined, |
|
|
policyStatus: undefined, |
|
|
status: { '刚入库': 0, '审核通过': 1, '审核不通过': 2 } |
|
|
policyStatus1: undefined, |
|
|
|
|
|
status: { '刚入库': 0, '审核通过': 1, '审核不通过': 2 }, |
|
|
|
|
|
textMap: { |
|
|
|
|
|
update: 'Edit', |
|
|
|
|
|
create: 'Create' |
|
|
|
|
|
}, |
|
|
|
|
|
dialogStatus: '', |
|
|
|
|
|
dialogFormVisible: false, |
|
|
|
|
|
dialogFormVisible1: false, |
|
|
|
|
|
temp: {}, |
|
|
|
|
|
addPolicy: { |
|
|
|
|
|
title: '', |
|
|
|
|
|
publishTime: '', |
|
|
|
|
|
titleUrl: '', |
|
|
|
|
|
imgUrl: '', |
|
|
|
|
|
content: '', |
|
|
|
|
|
intro: '' |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
@ -85,36 +228,127 @@ export default { |
|
|
'name' |
|
|
'name' |
|
|
]) |
|
|
]) |
|
|
}, |
|
|
}, |
|
|
async mounted() { |
|
|
created() { |
|
|
const that = this |
|
|
|
|
|
await api.PolicyDetail(this.data).then((res) => { |
|
|
|
|
|
// console.log(res) |
|
|
|
|
|
that.polictList = res.list |
|
|
|
|
|
console.log(that.polictList) |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
// console.log(err) |
|
|
|
|
|
}) |
|
|
|
|
|
this.getList() |
|
|
this.getList() |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
async Search() { |
|
|
async Search() { |
|
|
const that = this |
|
|
const that = this |
|
|
if (that.types[`${that.policyType}`] === undefined) { |
|
|
that.listLoading = true |
|
|
console.log('无数据') |
|
|
if (that.typeList[`${that.policyType}`] === undefined && that.status[`${that.policyStatus}`] === undefined) { |
|
|
|
|
|
that.data.type = '' |
|
|
|
|
|
that.data.auditStatus = '' |
|
|
|
|
|
await api.PolicyDetail(this.data).then((res) => { |
|
|
|
|
|
that.polictList = res.list |
|
|
|
|
|
that.total = res.total - 0 |
|
|
|
|
|
that.listLoading = false |
|
|
|
|
|
}) |
|
|
|
|
|
} else if (that.typeList[`${that.policyType}`] === undefined) { |
|
|
|
|
|
that.data.type = '' |
|
|
|
|
|
that.data.auditStatus = that.status[`${that.policyStatus}`] |
|
|
|
|
|
await api.PolicyDetail(this.data).then((res) => { |
|
|
|
|
|
that.polictList = res.list |
|
|
|
|
|
that.total = res.total - 0 |
|
|
|
|
|
that.listLoading = false |
|
|
|
|
|
}) |
|
|
|
|
|
} else if (that.status[`${that.policyStatus}`] === undefined) { |
|
|
|
|
|
that.data.type = that.typeList[`${that.policyType}`] |
|
|
|
|
|
that.data.auditStatus = '' |
|
|
|
|
|
await api.PolicyDetail(this.data).then((res) => { |
|
|
|
|
|
that.polictList = res.list |
|
|
|
|
|
that.total = res.total - 0 |
|
|
|
|
|
that.listLoading = false |
|
|
|
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
that.data.pageNum = 1 |
|
|
that.data.pageNum = 1 |
|
|
that.data.type = that.types[`${that.policyType}`] |
|
|
that.data.type = that.typeList[`${that.policyType}`] |
|
|
that.data.auditStatus = that.status[`${that.policyStatus}`] |
|
|
that.data.auditStatus = that.status[`${that.policyStatus}`] |
|
|
|
|
|
|
|
|
await api.PolicyDetail(this.data).then((res) => { |
|
|
await api.PolicyDetail(this.data).then((res) => { |
|
|
console.log(res) |
|
|
that.polictList = res.list |
|
|
}).catch((err) => { |
|
|
that.total = res.total - 0 |
|
|
console.log(err) |
|
|
that.listLoading = false |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
getList() { |
|
|
async getList() { |
|
|
console.log('xxx') |
|
|
const that = this |
|
|
|
|
|
that.listLoading = true |
|
|
|
|
|
await api.PolicyDetail(that.data).then((res) => { |
|
|
|
|
|
that.polictList = res.list |
|
|
|
|
|
that.total = res.total - 0 |
|
|
|
|
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
that.listLoading = false |
|
|
|
|
|
}, 1000) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
handleUpdate(row) { |
|
|
|
|
|
const that = this |
|
|
|
|
|
that.temp = Object.assign({}, row) // copy obj |
|
|
|
|
|
that.temp.timestamp = new Date(that.temp.timestamp) |
|
|
|
|
|
that.dialogStatus = 'update' |
|
|
|
|
|
for (const key in that.typeList) { |
|
|
|
|
|
if (that.typeList[key] === that.temp.type) { |
|
|
|
|
|
that.policyType1 = key |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
for (const key in that.status) { |
|
|
|
|
|
if (that.status[key] === that.temp.auditStatus) { |
|
|
|
|
|
that.policyStatus1 = key |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
that.dialogFormVisible = true |
|
|
|
|
|
that.$nextTick(() => { |
|
|
|
|
|
that.$refs['dataForm'].clearValidate() |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
async Commit() { |
|
|
|
|
|
const that = this |
|
|
|
|
|
that.temp.type = that.typeList[`${that.policyType1}`] |
|
|
|
|
|
that.temp.auditStatus = that.status[`${that.policyStatus1}`] |
|
|
|
|
|
await api.PolicyUpdate(that.temp).then((res) => { |
|
|
|
|
|
this.getList() |
|
|
|
|
|
that.dialogFormVisible = false |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
async handleModifyStatus(detail, num) { |
|
|
|
|
|
this.listLoading = true |
|
|
|
|
|
detail.auditStatus = num |
|
|
|
|
|
await api.PolicyUpdate(detail).then((res) => { |
|
|
|
|
|
this.listLoading = false |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
async handleDelete(id) { |
|
|
|
|
|
await api.PolicyDelete(id).then((res) => { |
|
|
|
|
|
this.getList() |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
policyAdd() { |
|
|
|
|
|
const that = this |
|
|
|
|
|
for (const key in that.addPolicy) { |
|
|
|
|
|
that.addPolicy[key] = '' |
|
|
|
|
|
} |
|
|
|
|
|
that.addPolicy.publishTime = new Date() |
|
|
|
|
|
that.dialogFormVisible1 = true |
|
|
|
|
|
}, |
|
|
|
|
|
async CommitAdd() { |
|
|
|
|
|
const that = this |
|
|
|
|
|
var Content = document.getElementById('Content') |
|
|
|
|
|
var Time = document.getElementById('Time').value |
|
|
|
|
|
that.addPolicy.content = Content.innerHTML |
|
|
|
|
|
var str = Time.replace(/-/g, '/') |
|
|
|
|
|
that.addPolicy.publishTime = str |
|
|
|
|
|
|
|
|
|
|
|
for (const key in that.addPolicy) { |
|
|
|
|
|
if (that.addPolicy[key] === '') { |
|
|
|
|
|
alert(key + '不能为空') |
|
|
|
|
|
} else { |
|
|
|
|
|
api.PolicyAdd(that.addPolicy).then((res) => { |
|
|
|
|
|
that.dialogFormVisible1 = false |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|