|
@ -47,7 +47,7 @@ |
|
|
<el-col :span="24"> |
|
|
<el-col :span="24"> |
|
|
<el-form-item label="开始征集 |
|
|
<el-form-item label="开始征集 |
|
|
" style="display: block" prop="peopleCount" label-width="150px"> |
|
|
" style="display: block" prop="peopleCount" label-width="150px"> |
|
|
<el-switch v-model="formData.status" :active-value="0" :inactive-value="1" |
|
|
<el-switch v-model="formData.status" :active-value="1" :inactive-value="0" |
|
|
@change="handleSwitchChange"></el-switch> |
|
|
@change="handleSwitchChange"></el-switch> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
@ -60,55 +60,55 @@ |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { mapGetters } from 'vuex' |
|
|
import { mapGetters } from 'vuex' |
|
|
import { requestPost } from '@/js/dai/request' |
|
|
import { requestPost,requestGet } from '@/js/dai/request' |
|
|
import Tinymce from '@c/tinymce2/index.vue' |
|
|
import Tinymce from '@c/tinymce2/index.vue' |
|
|
import daiMap from "@/utils/dai-map"; |
|
|
import daiMap from "@/utils/dai-map"; |
|
|
import util from '@js/util.js'; |
|
|
import util from '@js/util.js'; |
|
|
// import UploadImage from './upload-image.vue' |
|
|
// import UploadImage from './upload-image.vue' |
|
|
import UploadImage from '@/views/modules/plugins/rent/upload-image.vue' |
|
|
import UploadImage from '@/views/modules/plugins/rent/upload-image.vue' |
|
|
|
|
|
|
|
|
var map |
|
|
var map |
|
|
var search |
|
|
var search |
|
|
var markers |
|
|
var markers |
|
|
var infoWindowList |
|
|
var infoWindowList |
|
|
var geocoder // 新建一个正逆地址解析类 |
|
|
var geocoder // 新建一个正逆地址解析类 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
data() { |
|
|
data() { |
|
|
|
|
|
|
|
|
return { |
|
|
return { |
|
|
attachmentList: [],//活动照片 |
|
|
attachmentList: [],//活动照片 |
|
|
fileList:[], |
|
|
fileList: [], |
|
|
SpecialList: [ |
|
|
SpecialList: [ |
|
|
{ value: 0, label: "消息发布" }, |
|
|
{ value: 0, label: "消息发布" }, |
|
|
{ value: 1, label: "志愿风采" }, |
|
|
{ value: 1, label: "志愿风采" }, |
|
|
], |
|
|
], |
|
|
formData: |
|
|
formData: |
|
|
{ |
|
|
{ |
|
|
subjectTitle:'', |
|
|
subjectTitle: '', |
|
|
subjectContent:"", |
|
|
subjectContent: "", |
|
|
typeCode:"", |
|
|
typeCode: "", |
|
|
status:"0", |
|
|
status: 1, |
|
|
id:"", |
|
|
id: "", |
|
|
attachmentList:[] |
|
|
attachmentList: [] |
|
|
}, |
|
|
}, |
|
|
uploadUrl: `${window.SITE_CONFIG['apiURL']}/oss/file/uploadqrcodeV2`, |
|
|
uploadUrl: `${window.SITE_CONFIG['apiURL']}/oss/file/uploadqrcodeV2`, |
|
|
customerId: localStorage.getItem('customerId'), |
|
|
customerId: localStorage.getItem('customerId'), |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
components: { Tinymce, UploadImage }, |
|
|
components: { Tinymce, UploadImage }, |
|
|
mounted() { |
|
|
mounted() { |
|
|
|
|
|
|
|
|
this.getSpecialList() |
|
|
this.getSpecialList() |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
methods: { |
|
|
methods: { |
|
|
// 上传前的验证 |
|
|
// 上传前的验证 |
|
|
beforeImgUpload(file) { |
|
|
beforeImgUpload(file) { |
|
@ -131,26 +131,26 @@ |
|
|
type: 'warning', |
|
|
type: 'warning', |
|
|
message: '文件数量最多不超过一个' |
|
|
message: '文件数量最多不超过一个' |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
// 删除图片 |
|
|
// 删除图片 |
|
|
handleImgRemove(file) { |
|
|
handleImgRemove(file) { |
|
|
console.log('handleImgRemove', file); |
|
|
console.log('handleImgRemove', file); |
|
|
if (file.response) { |
|
|
if (file.response) { |
|
|
let index =this.formData.attachmentList.findIndex(item => item.url == file.response.data.url); |
|
|
let index = this.formData.attachmentList.findIndex(item => item.url == file.response.data.url); |
|
|
this.formData.attachmentList.splice(index, 1); |
|
|
this.formData.attachmentList.splice(index, 1); |
|
|
} else if (file.url) { |
|
|
} else if (file.url) { |
|
|
let index = this.formData.attachmentList.findIndex(item => item.url == file.url); |
|
|
let index = this.formData.attachmentList.findIndex(item => item.url == file.url); |
|
|
this.formData.attachmentList.splice(index, 1); |
|
|
this.formData.attachmentList.splice(index, 1); |
|
|
} |
|
|
} |
|
|
console.log(this.formData.attachmentList,"sdjflskdfjklds"); |
|
|
console.log(this.formData.attachmentList, "sdjflskdfjklds"); |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
// 上传成功 |
|
|
// 上传成功 |
|
|
handleImgSuccess(res, file, fileList) { |
|
|
handleImgSuccess(res, file, fileList) { |
|
|
console.log(res,file,fileList,"dsfkljsdklfj"); |
|
|
console.log(res, file, fileList, "dsfkljsdklfj"); |
|
|
|
|
|
|
|
|
if (res.code === 0 && res.msg === 'success') { |
|
|
if (res.code === 0 && res.msg === 'success') { |
|
|
// let format = file.name.split('.').pop(); |
|
|
// let format = file.name.split('.').pop(); |
|
|
// let srcType = file.raw.type; |
|
|
// let srcType = file.raw.type; |
|
@ -161,46 +161,65 @@ |
|
|
// type = 'video'; |
|
|
// type = 'video'; |
|
|
// } |
|
|
// } |
|
|
this.formData.attachmentList.push(res.data.url); |
|
|
this.formData.attachmentList.push(res.data.url); |
|
|
console.log( this.formData.attachmentList,":sdfkjslk"); |
|
|
console.log(this.formData.attachmentList, ":sdfkjslk"); |
|
|
if(this.formData.attachmentList.length>=3){ |
|
|
if (this.formData.attachmentList.length >= 3) { |
|
|
const element = document.querySelector('.el-upload--picture-card'); // 选择第一个匹配的元素 |
|
|
const element = document.querySelector('.el-upload--picture-card'); // 选择第一个匹配的元素 |
|
|
if (element) { |
|
|
if (element) { |
|
|
element.style.display = 'none'; |
|
|
element.style.display = 'none'; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
this.$message.error(res.msg); |
|
|
this.$message.error(res.msg); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
// 图片预览 |
|
|
// 图片预览 |
|
|
handleImgPreview(file) { |
|
|
handleImgPreview(file) { |
|
|
console.log(file); |
|
|
console.log(file); |
|
|
window.open(file.url || file.response.data.url); |
|
|
window.open(file.url || file.response.data.url); |
|
|
}, |
|
|
}, |
|
|
//获取征集领域字典 |
|
|
//获取征集领域字典 |
|
|
async getSpecialList() { |
|
|
async getSpecialList() { |
|
|
const url = "/sys/dict/data/dictlist"; |
|
|
const url = "/sys/dict/data/dictlist"; |
|
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, { |
|
|
const { data, code, msg } = await requestPost(url, { |
|
|
dictType: "solicitation_fields", |
|
|
dictType: "solicitation_fields", |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
if (code === 0) { |
|
|
if (code === 0) { |
|
|
this.SpecialList = data || []; |
|
|
this.SpecialList = data || []; |
|
|
} else { |
|
|
} else { |
|
|
this.$message.error(msg); |
|
|
this.$message.error(msg); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async initForm(type, activityId) { |
|
|
async initForm(type, activityId) { |
|
|
this.formType = type |
|
|
this.formType = type |
|
|
if (type === 'edit') { |
|
|
if (type === 'edit') { |
|
|
this.formData = activityId |
|
|
this.formData = activityId |
|
|
} |
|
|
this.getDetail(activityId) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
getDetail(activityId){ |
|
|
|
|
|
|
|
|
|
|
|
const url = '/governance/icEventSpecialSubject/getDetail' |
|
|
|
|
|
let params = { |
|
|
|
|
|
id: activityId.id |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
requestGet(url, params).then(res=>{ |
|
|
|
|
|
console.log(res,"sdkljklsdf"); |
|
|
|
|
|
this.formData=res.data |
|
|
|
|
|
this.formData.status=Number(this.formData.status) |
|
|
|
|
|
console.log(this.formData,"dsfgjsldg"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
//加载组织 |
|
|
//加载组织 |
|
|
async loadFormData() { |
|
|
async loadFormData() { |
|
@ -209,62 +228,48 @@ |
|
|
let params = { |
|
|
let params = { |
|
|
id: this.activityId |
|
|
id: this.activityId |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
|
|
|
|
|
|
if (code === 0) { |
|
|
if (code === 0) { |
|
|
this.formData = data |
|
|
this.formData = data |
|
|
let style_img = "style='width:50px;height:40px;' " |
|
|
let style_img = "style='width:50px;height:40px;' " |
|
|
|
|
|
|
|
|
if (this.formData.content) { |
|
|
if (this.formData.content) { |
|
|
// this.formData.content = this.formData.content.replace(/<img/g, "<img style='width:200px;height:240px;'") |
|
|
// this.formData.content = this.formData.content.replace(/<img/g, "<img style='width:200px;height:240px;'") |
|
|
// let array=this.formData.content.split('<img') |
|
|
// let array=this.formData.content.split('<img') |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
this.$message.error(msg) |
|
|
this.$message.error(msg) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async handleComfirm() { |
|
|
async handleComfirm() { |
|
|
if (!this.formData.subjectTitle) { |
|
|
if (!this.formData.subjectTitle) { |
|
|
this.$message.error('请输入专题标题'); |
|
|
this.$message.error('请输入专题标题'); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
if (!this.formData.subjectContent) { |
|
|
if (!this.formData.subjectContent) { |
|
|
this.$message.error('请输入专题内容'); |
|
|
this.$message.error('请输入专题内容'); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (!this.formData.typeCode) { |
|
|
if (!this.formData.typeCode) { |
|
|
this.$message.error('请输入领域编码'); |
|
|
this.$message.error('请输入领域编码'); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// if (!this.formData.status) { |
|
|
// if (!this.formData.status) { |
|
|
// this.$message.error('请选择状态'); |
|
|
// this.$message.error('请选择状态'); |
|
|
// return; |
|
|
// return; |
|
|
// } |
|
|
// } |
|
|
|
|
|
console.log(this.formData, "this.formData"); |
|
|
console.log(this.formData,"this.formData"); |
|
|
this.addSpecial() |
|
|
this.addSpecial() |
|
|
|
|
|
}, |
|
|
}, |
|
|
async addSpecial() { |
|
|
async addSpecial() { |
|
|
if(this.formType=="edit"){ |
|
|
if (this.formType == "edit") { |
|
|
let url = '/governance/icEventSpecialSubject/update' |
|
|
let url = '/governance/icEventSpecialSubject/update' |
|
|
const { data, code, msg } = await requestPost(url, this.formData) |
|
|
|
|
|
if (code === 0) { |
|
|
|
|
|
this.$message({ |
|
|
|
|
|
type: 'success', |
|
|
|
|
|
message: '操作成功' |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error(msg) |
|
|
|
|
|
} |
|
|
|
|
|
console.log("sdlkfjklsdf "); |
|
|
|
|
|
this.$emit('showAddClose') |
|
|
|
|
|
}else{ |
|
|
|
|
|
let url = '/governance/icEventSpecialSubject/save' |
|
|
|
|
|
const { data, code, msg } = await requestPost(url, this.formData) |
|
|
const { data, code, msg } = await requestPost(url, this.formData) |
|
|
if (code === 0) { |
|
|
if (code === 0) { |
|
|
this.$message({ |
|
|
this.$message({ |
|
@ -276,105 +281,122 @@ |
|
|
} |
|
|
} |
|
|
console.log("sdlkfjklsdf "); |
|
|
console.log("sdlkfjklsdf "); |
|
|
this.$emit('showAddClose') |
|
|
this.$emit('showAddClose') |
|
|
|
|
|
} else { |
|
|
|
|
|
let url = '/governance/icEventSpecialSubject/save' |
|
|
|
|
|
const { data, code, msg } = await requestPost(url, this.formData) |
|
|
|
|
|
if (code === 0) { |
|
|
|
|
|
this.$message({ |
|
|
|
|
|
type: 'success', |
|
|
|
|
|
message: '操作成功' |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error(msg) |
|
|
} |
|
|
} |
|
|
|
|
|
console.log("sdlkfjklsdf "); |
|
|
|
|
|
this.$emit('showAddClose') |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
handleCancle() { |
|
|
handleCancle() { |
|
|
this.$emit('showAddClose') |
|
|
this.$emit('showAddClose') |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
dataRule() { |
|
|
dataRule() { |
|
|
return { |
|
|
return { |
|
|
columnId: [ |
|
|
subjectTitle: [ |
|
|
{ required: true, message: '请选择所属栏目', trigger: 'blur' } |
|
|
{ required: true, message: '所属专题不能为空', trigger: 'blur' } |
|
|
], |
|
|
], |
|
|
content: [ |
|
|
typeCode: [ |
|
|
{ required: true, message: '活动详情不能为空', trigger: 'blur' } |
|
|
{ required: true, message: '征集领域不能为空', trigger: 'blur' } |
|
|
], |
|
|
], |
|
|
title: [ |
|
|
subjectContent: [ |
|
|
{ required: true, message: '文章标题不能为空', trigger: 'blur' } |
|
|
{ required: true, message: '征集内容不能为空', trigger: 'blur' } |
|
|
], |
|
|
], |
|
|
fileList: [ |
|
|
fileList: [ |
|
|
{ required: true, message: '请选择活动照片', trigger: 'blur' } |
|
|
{ required: true, message: '请选择活动照片', trigger: 'blur' } |
|
|
] |
|
|
] |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
props: { |
|
|
props: { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
destroyed () { |
|
|
destroyed() { |
|
|
map = null |
|
|
map = null |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
<style lang="scss" scoped> |
|
|
@import "@/assets/scss/modules/visual/communityManageForm.scss"; |
|
|
@import "@/assets/scss/modules/visual/communityManageForm.scss"; |
|
|
</style> |
|
|
</style> |
|
|
<style lang="scss" scoped> |
|
|
<style lang="scss" scoped> |
|
|
/deep/ .el-upload--picture-card { |
|
|
/deep/ .el-upload--picture-card { |
|
|
width: 60px; |
|
|
width: 60px; |
|
|
height: 60px; |
|
|
height: 60px; |
|
|
line-height: 70px; |
|
|
line-height: 70px; |
|
|
} |
|
|
} |
|
|
/deep/ .el-upload-list--picture-card .el-upload-list__item { |
|
|
|
|
|
|
|
|
/deep/ .el-upload-list--picture-card .el-upload-list__item { |
|
|
width: 60px; |
|
|
width: 60px; |
|
|
height: 60px; |
|
|
height: 60px; |
|
|
} |
|
|
} |
|
|
/deep/ .el-upload-dragger{ |
|
|
|
|
|
|
|
|
/deep/ .el-upload-dragger { |
|
|
width: 60px; |
|
|
width: 60px; |
|
|
height: 60px; |
|
|
height: 60px; |
|
|
} |
|
|
} |
|
|
.item_width_1 { |
|
|
|
|
|
|
|
|
.item_width_1 { |
|
|
width: 634px; |
|
|
width: 634px; |
|
|
|
|
|
|
|
|
/deep/.tox .tox-dialog { |
|
|
/deep/.tox .tox-dialog { |
|
|
z-index: 20000; |
|
|
z-index: 20000; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
.u-item-width-normal{ |
|
|
|
|
|
|
|
|
.u-item-width-normal { |
|
|
width: 222px; |
|
|
width: 222px; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.tinymce_view { |
|
|
.tinymce_view { |
|
|
::v-deep .tox .tox-dialog { |
|
|
::v-deep .tox .tox-dialog { |
|
|
z-index: 2000000000; |
|
|
z-index: 2000000000; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.div_map { |
|
|
.div_map { |
|
|
position: relative; |
|
|
position: relative; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.div_searchmap { |
|
|
.div_searchmap { |
|
|
z-index: 5000; |
|
|
z-index: 5000; |
|
|
position: absolute; |
|
|
position: absolute; |
|
|
top: 5px; |
|
|
top: 5px; |
|
|
left: 5px; |
|
|
left: 5px; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.tinymce_view { |
|
|
.tinymce_view { |
|
|
height: 400px; |
|
|
height: 400px; |
|
|
overflow: auto; |
|
|
overflow: auto; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.text_p { |
|
|
.text_p { |
|
|
margin: 0; |
|
|
margin: 0; |
|
|
padding: 0 10px; |
|
|
padding: 0 10px; |
|
|
border: 1px solid #d9d9d9; |
|
|
border: 1px solid #d9d9d9; |
|
|
border-radius: 5px; |
|
|
border-radius: 5px; |
|
|
|
|
|
|
|
|
>p { |
|
|
>p { |
|
|
margin: 0; |
|
|
margin: 0; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</style> |
|
|
</style> |