|
|
@ -195,7 +195,12 @@ |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="发布部门" prop="imgUrl" style="width: 180%"> |
|
|
|
<el-select v-model="temp.pushDep" placeholder="请选择"> |
|
|
|
<el-select |
|
|
|
:value="temp.pushDep===4 ? '': temp.pushDep" |
|
|
|
clearable |
|
|
|
placeholder="请选择" |
|
|
|
@change="changePushDep" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="item in options" |
|
|
|
:key="item.value" |
|
|
@ -203,13 +208,6 @@ |
|
|
|
:value="item.value" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
<!-- <el-cascader |
|
|
|
v-if="options.length > 0" |
|
|
|
v-model="cascader" |
|
|
|
:options="options" |
|
|
|
:props="{ value: 'id', label: 'areaName', children: 'next' }" |
|
|
|
@change="handleChange" |
|
|
|
/> --> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="原文内容" prop="content" style="width: 180%"> |
|
|
@ -240,7 +238,7 @@ |
|
|
|
|
|
|
|
<el-form-item label="政策标签" prop="intro" style="width: 180%"> |
|
|
|
<!-- <el-button @click="addLabel">添加标签</el-button> --> |
|
|
|
<el-select v-model="temp.projectLabels" multiple-limit="5" multiple placeholder="请选择标签"> |
|
|
|
<el-select v-model="temp.projectLabels" :multiple-limit="5" multiple placeholder="请选择标签"> |
|
|
|
<el-option |
|
|
|
v-for="item in projectLabels" |
|
|
|
:key="item.name" |
|
|
@ -321,7 +319,7 @@ |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="发布部门" prop="imgUrl" style="width: 180%"> |
|
|
|
<el-select v-model="value" placeholder="请选择"> |
|
|
|
<el-select v-model="addPolicy.pushDep" clearable placeholder="请选择"> |
|
|
|
<el-option |
|
|
|
v-for="item in options" |
|
|
|
:key="item.value" |
|
|
@ -329,13 +327,7 @@ |
|
|
|
:value="item.value" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
<!-- <el-cascader |
|
|
|
v-if="options.length > 0" |
|
|
|
v-model="cascader1" |
|
|
|
:options="options" |
|
|
|
:props="{ value: 'id', label: 'areaName', children: 'next' }" |
|
|
|
@change="handleChange1" |
|
|
|
/> --> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="原文内容" prop="content" style="width: 180%"> |
|
|
@ -376,7 +368,7 @@ |
|
|
|
import { mapGetters } from 'vuex' |
|
|
|
import * as api from '@/api/policy' |
|
|
|
import Pagination from '@/components/Pagination' // secondary package based on el-pagination |
|
|
|
|
|
|
|
import { Message } from 'element-ui' |
|
|
|
export default { |
|
|
|
name: 'Policy', |
|
|
|
components: { Pagination }, |
|
|
@ -421,23 +413,33 @@ export default { |
|
|
|
pushDep: '' |
|
|
|
}, |
|
|
|
options: [{ |
|
|
|
value: '0', |
|
|
|
value: 0, |
|
|
|
label: '部委政策' |
|
|
|
}, { |
|
|
|
value: '1', |
|
|
|
value: 1, |
|
|
|
label: '省政策' |
|
|
|
}, { |
|
|
|
value: '2', |
|
|
|
value: 2, |
|
|
|
label: '市政策' |
|
|
|
}, { |
|
|
|
value: '3', |
|
|
|
value: 3, |
|
|
|
label: '区政策' |
|
|
|
}], |
|
|
|
contentDetail: '', |
|
|
|
projectLabels: [], |
|
|
|
value: '', |
|
|
|
value1: '', |
|
|
|
publishTime: '' |
|
|
|
publishTime: '', |
|
|
|
warning: { |
|
|
|
title: '政策标题', |
|
|
|
publishTime: '发布时间', |
|
|
|
titleUrl: '原文链接', |
|
|
|
imgUrl: '图片路径', |
|
|
|
content: '原文内容', |
|
|
|
pushDep: '发布部门', |
|
|
|
intro: '政策简介' |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
@ -453,6 +455,10 @@ export default { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
|
|
|
|
changePushDep(e) { |
|
|
|
this.temp.pushDep = e |
|
|
|
}, |
|
|
|
|
|
|
|
// 原先的发布部门 |
|
|
|
// handleChange(value) { |
|
|
|
// this.temp.pushDep = value[value.length - 1] |
|
|
@ -551,12 +557,15 @@ export default { |
|
|
|
// i -= 1 |
|
|
|
// } |
|
|
|
// } |
|
|
|
// console.log(that.temp.publishTime) |
|
|
|
const time1 = document.getElementById('TimeUpdate').value |
|
|
|
var str = time1.replace(/-/g, '/') |
|
|
|
that.temp.publishTime = str |
|
|
|
console.log(time1) |
|
|
|
console.log(this.$moment(that.temp.publishTime).format('YYYY-MM-DD')) |
|
|
|
|
|
|
|
console.log(that.temp.publishTime) |
|
|
|
that.temp.publishTime = that.temp.publishTime.replaceAll('/', '-') |
|
|
|
// that.temp.pushDep = that.value |
|
|
|
// that.temp.publishTime = this.$moment(that.temp.publishTime).format('YYYY-MM-DD') |
|
|
|
|
|
|
|
// that.temp.projectLabels = this.value1 |
|
|
|
console.log('commit=========>', that.temp) |
|
|
|
await api.PolicyUpdate(that.temp).then(res => { |
|
|
|
this.getList() |
|
|
@ -565,12 +574,18 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
async handleModifyStatus(detail, num) { |
|
|
|
console.log(detail) |
|
|
|
this.listLoading = true |
|
|
|
detail.auditStatus = num |
|
|
|
await api.PolicyUpdate(detail).then(res => { |
|
|
|
this.cascader = '' |
|
|
|
this.listLoading = false |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
console.log(err) |
|
|
|
this.listLoading = false |
|
|
|
detail.auditStatus = 0 |
|
|
|
}) |
|
|
|
}, |
|
|
|
async handleDelete(id) { |
|
|
|
await api.PolicyDelete(id).then(res => { |
|
|
@ -582,26 +597,34 @@ export default { |
|
|
|
for (const key in that.addPolicy) { |
|
|
|
that.addPolicy[key] = '' |
|
|
|
} |
|
|
|
that.addPolicy.publishTime = new Date() |
|
|
|
// that.addPolicy.publishTime = new Date() |
|
|
|
that.dialogFormVisible1 = true |
|
|
|
}, |
|
|
|
async CommitAdd() { |
|
|
|
const that = this |
|
|
|
that.addPolicy.pushDep = this.value |
|
|
|
|
|
|
|
// that.addPolicy.pushDep = this.value |
|
|
|
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) { |
|
|
|
console.log(key) |
|
|
|
if (that.addPolicy[key] === '') { |
|
|
|
alert(key + '不能为空') |
|
|
|
Message({ |
|
|
|
message: that.warning[key] + ' 不能为空', |
|
|
|
type: 'error', |
|
|
|
duration: 3 * 1000 |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
console.log('CommitAdd', that.addPolicy) |
|
|
|
api.PolicyAdd(that.addPolicy).then(res => { |
|
|
|
this.value = '' |
|
|
|
that.dialogFormVisible1 = false |
|
|
|
this.getList() |
|
|
|
}) |
|
|
|
} |
|
|
|
// addLabel() { |
|
|
|