Browse Source

格式化代码

feature/yujt_analysis_pc
yujt 6 years ago
parent
commit
45691019cb
  1. 8
      src/views/modules/activity/actinfo-cancel.vue
  2. 748
      src/views/modules/activity/activityinfo-add-or-update.vue
  3. 748
      src/views/modules/activity/activityinfo-add.vue
  4. 6
      src/views/modules/activity/activityinfo.vue
  5. 13
      src/views/modules/activity/activityparticipant.vue
  6. 4
      src/views/modules/activity/address-check.vue
  7. 4
      src/views/modules/activity/map-select.vue
  8. 48
      src/views/modules/section/sectioncategory-add-or-update.vue

8
src/views/modules/activity/actinfo-cancel.vue

@ -52,10 +52,10 @@ export default {
if (!valid) { if (!valid) {
return false return false
} }
let postData = { // let postData = {
id: this.dataForm.id, // id: this.dataForm.id,
cancelReason: this.dataForm.cancelReason // cancelReason: this.dataForm.cancelReason
} // }
this.$http['post']('/property/activityinfo/cancel', this.dataForm).then(({ data: res }) => { this.$http['post']('/property/activityinfo/cancel', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)

748
src/views/modules/activity/activityinfo-add-or-update.vue

@ -238,383 +238,383 @@
</el-card> </el-card>
</template> </template>
<script> <script>
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
import MapSelect from './map-select' import MapSelect from './map-select'
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
import 'quill/dist/quill.snow.css' import 'quill/dist/quill.snow.css'
import Quill from 'quill' import Quill from 'quill'
export default { export default {
name: 'ActInfoAdd', name: 'ActInfoAdd',
data () { data () {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: '', id: '',
title: '', title: '',
headPic: '', headPic: '',
signUpStartTime: '', signUpStartTime: '',
signUpEndTime: '', signUpEndTime: '',
actQuotaFlag: '1', actQuotaFlag: '1',
actStartTime: '', actStartTime: '',
actEndTime: '', actEndTime: '',
actAddress: '', actAddress: '',
actLongitude: '', actLongitude: '',
actLatitude: '', actLatitude: '',
clockRadius: 200, clockRadius: 200,
actQuota: '', actQuota: '',
contacts: '', contacts: '',
tel: '', tel: '',
requirement: '', requirement: '',
actContent: '', actContent: '',
actStatus: '', actStatus: '',
publishTime: '', publishTime: '',
sponsor: '', sponsor: '',
deptId: '', deptId: '',
punishmentPoints: '', punishmentPoints: '',
reward: '', reward: '',
isBanner: '1', isBanner: '1',
actUserDefaultState: '1', actUserDefaultState: '1',
bannerUrl: '', bannerUrl: '',
cancelReason: '', cancelReason: '',
signUpNum: 0, signUpNum: 0,
sectionCode: '', sectionCode: '',
categoryCode: '', categoryCode: '',
categoryName: '' categoryName: ''
}, },
options: [], options: [],
issignUpEndTime: { issignUpEndTime: {
disabledDate (time) { disabledDate (time) {
return time < Date.now() - 8.64e7 // 8.64e7=1000*60*60*24 return time < Date.now() - 8.64e7 // 8.64e7=1000*60*60*24
} }
}, },
isImgRequired: true, isImgRequired: true,
mapSelectVisible: false, mapSelectVisible: false,
signInIsAble: true, signInIsAble: true,
isAble: false, isAble: false,
loading: false, loading: false,
// //
quillEditor: null, quillEditor: null,
quillEditorToolbarOptions: [ quillEditorToolbarOptions: [
['bold', 'italic', 'underline', 'strike'], ['bold', 'italic', 'underline', 'strike'],
['blockquote', 'code-block', 'image'], ['blockquote', 'code-block', 'image'],
[{ 'header': 1 }, { 'header': 2 }], [{ 'header': 1 }, { 'header': 2 }],
[{ 'list': 'ordered' }, { 'list': 'bullet' }], [{ 'list': 'ordered' }, { 'list': 'bullet' }],
[{ 'script': 'sub' }, { 'script': 'super' }], [{ 'script': 'sub' }, { 'script': 'super' }],
[{ 'indent': '-1' }, { 'indent': '+1' }], [{ 'indent': '-1' }, { 'indent': '+1' }],
[{ 'direction': 'rtl' }], [{ 'direction': 'rtl' }],
[{ 'size': ['small', false, 'large', 'huge'] }], [{ 'size': ['small', false, 'large', 'huge'] }],
[{ 'header': [1, 2, 3, 4, 5, 6, false] }], [{ 'header': [1, 2, 3, 4, 5, 6, false] }],
[{ 'color': [] }, { 'background': [] }], [{ 'color': [] }, { 'background': [] }],
[{ 'font': [] }], [{ 'font': [] }],
[{ 'align': [] }], [{ 'align': [] }],
['clean'] ['clean']
], ],
uploadUrl: '', uploadUrl: '',
pickerBeginDateBefore: { pickerBeginDateBefore: {
disabledDate: (time) => { disabledDate: (time) => {
let beginDateVal = this.dataForm.actStartTime let beginDateVal = this.dataForm.actStartTime
if (beginDateVal) { if (beginDateVal) {
return time.getTime() > new Date(beginDateVal).getTime() return time.getTime() > new Date(beginDateVal).getTime()
} }
} }
}, },
pickerBeginDateAfter: { pickerBeginDateAfter: {
disabledDate: (time) => { disabledDate: (time) => {
let EndDateVal = this.dataForm.actEndTime let EndDateVal = this.dataForm.actEndTime
if (EndDateVal) { if (EndDateVal) {
return time.getTime() < new Date(EndDateVal).getTime() return time.getTime() < new Date(EndDateVal).getTime()
} }
} }
} }
} }
}, },
created () { created () {
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
// //
this.hideUpload = false this.hideUpload = false
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}` this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
if (this.quillEditor) { if (this.quillEditor) {
this.quillEditor.deleteText(0, this.quillEditor.getLength()) this.quillEditor.deleteText(0, this.quillEditor.getLength())
} else { } else {
this.quillEditorHandle() this.quillEditorHandle()
} }
// end // end
}) })
}, },
mounted() { mounted () {
this.getOptions() this.getOptions()
}, },
computed: { computed: {
dataRule () { dataRule () {
return { return {
title: [ title: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
headPic: [ headPic: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
signUpStartTime: [ signUpStartTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
signUpEndTime: [ signUpEndTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
actStartTime: [ actStartTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
actEndTime: [ actEndTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
actAddress: [ actAddress: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
actLongitude: [ actLongitude: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
actLatitude: [ actLatitude: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
clockRadius: [ clockRadius: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
actQuotaFlag: [ actQuotaFlag: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
actQuota: [ actQuota: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
clockNum: [ clockNum: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
actShareNum: [ actShareNum: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
actBrowseNum: [ actBrowseNum: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
contacts: [ contacts: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
tel: [ tel: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
requirement: [ requirement: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
actContent: [ actContent: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
actStatus: [ actStatus: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
publishTime: [ publishTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
sponsor: [ sponsor: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
deptId: [ deptId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
categoryCode: [ categoryCode: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
punishmentPoints: [ punishmentPoints: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
reward: [ reward: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
revision: [ revision: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
createdBy: [ createdBy: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
createdTime: [ createdTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
updatedBy: [ updatedBy: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
updatedTime: [ updatedTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
bannerUrl: [ bannerUrl: [
{ required: this.isImgRequired, message: this.$t('validate.required'), trigger: 'blur' } { required: this.isImgRequired, message: this.$t('validate.required'), trigger: 'blur' }
] ]
} }
} }
}, },
methods: { methods: {
getOptions () { getOptions () {
this.$http this.$http
.get(`/property/sectioncategory/list`, { params: { sectionCode: 'community_forum' } }).then(({ data: res }) => { .get(`/property/sectioncategory/list`, { params: { sectionCode: 'community_forum' } }).then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
this.options = res.data this.options = res.data
}) })
.catch(() => { }) .catch(() => { })
}, },
changeHandler (value) { changeHandler (value) {
if (value === 1) { if (value === 1) {
this.isImgRequired = true this.isImgRequired = true
} else { } else {
this.isImgRequired = false this.isImgRequired = false
} }
}, },
backToActList () { backToActList () {
this.$emit('refreshDataList') this.$emit('refreshDataList')
this.$parent.selectComponent = 'ActInfoList' this.$parent.selectComponent = 'ActInfoList'
this.$router.push({ path: '/activity-actinfo' }) this.$router.push({ path: '/activity-actinfo' })
}, },
init () { init () {
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
if (this.dataForm.id) { if (this.dataForm.id) {
this.getInfo() this.getInfo()
} }
}) })
}, },
position (position) { position (position) {
if (position.type === 1) { if (position.type === 1) {
this.dataForm.actAddress = position.address this.dataForm.actAddress = position.address
this.dataForm.actLatitude = position.latitude this.dataForm.actLatitude = position.latitude
this.dataForm.actLongitude = position.longitude this.dataForm.actLongitude = position.longitude
} }
}, },
// //
quillEditorHandle () { quillEditorHandle () {
this.quillEditor = new Quill('#J_quillEditor', { this.quillEditor = new Quill('#J_quillEditor', {
modules: { modules: {
toolbar: this.quillEditorToolbarOptions toolbar: this.quillEditorToolbarOptions
},
theme: 'snow'
})
this.quillEditor.container.style.height = `${300}px`
// // (使element upload)
this.quillEditor.getModule('toolbar').addHandler('image', () => {
this.$refs.uploadBtn.$el.click()
})
//
this.quillEditor.on('text-change', () => {
this.dataForm.actContent = this.quillEditor.root.innerHTML
if ((this.dataForm.actContent).length > 10000) {
return this.$message.error('您输入的的内容已超过字数')
}
})
},
// ()
uploadBeforeUploadHandle (file) {
if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif') {
this.$message.error(this.$t('upload.tip', { 'format': 'jpg、png、gif' }))
return false
}
},
// ()
uploadSuccessHandle (res, file, fileList) {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.quillEditor.insertEmbed(this.quillEditor.getSelection().index, 'image', res.data.url)
},
setRegistTime () {
this.dataForm.newsReleaseStartTime = this.time[0]
this.dataForm.newsReleaseEndTime = this.time[1]
},
// ends
//
getInfo () {
this.$http.get(`/property/activityinfo/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
}).catch(() => { })
},
//
dataFormSubmitHandle: debounce(function () {
if (new Date() >= new Date(this.dataForm.signUpEndTime)) {
return this.$message.error('报名截止时间必须大于当前时间')
}
if (this.dataForm.actStartTime >= this.dataForm.actEndTime) {
return this.$message.error('活动结束时间必须大于活动开始时间')
}
if (this.dataForm.actStartTime <= this.dataForm.signUpEndTime) {
return this.$message.error('活动开始时间必须大于报名截止时间')
}
if ((this.dataForm.actContent).length > 10000) {
return this.$message.error('您输入的的内容已超过字数')
}
if (this.dataForm.isActQuota === 0) {
this.dataForm.actQuota = 0
}
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
var signUpEndTime = new Date(Date.parse(this.dataForm.signUpEndTime))
var actStarTime = new Date(Date.parse(this.dataForm.actStartTime))
var actEndTime = new Date(Date.parse(this.dataForm.actEndTime))
if (signUpEndTime > actStarTime) {
return this.$message.error('活动开始时间必须大于报名截止时间.')
}
if (actEndTime < actStarTime) {
return this.$message.error('活动结束时间必须大于活动开始时间.')
}
this.isAble = true
this.$http[!this.dataForm.id ? 'post' : 'put']('/property/activityinfo/', this.dataForm).then(({ data: res }) => {
this.isAble = false
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
this.$parent.selectComponent = 'ActInfoList'
this.$router.push({
path: '/activity-actinfo'
})
}).catch(() => { })
})
}, 1000, { 'leading': true, 'trailing': false }),
handleAvatarActSuccess (res, file) {
this.loading = false
this.dataForm.headPic = res.data.url
},
handleAvatarBannerSuccess (res, file) {
this.loading = false
this.dataForm.bannerUrl = res.data.url
},
beforeAvatarUpload (file) {
this.loading = true
},
handelError () {
this.loading = false
},
mapSelectHandle (type) {
this.mapSelectVisible = true
this.$nextTick(() => {
this.$refs.mapSelect.init(type, this.dataForm.clockRadius)
})
}
}, },
components: { theme: 'snow'
MapSelect })
this.quillEditor.container.style.height = `${300}px`
// // (使element upload)
this.quillEditor.getModule('toolbar').addHandler('image', () => {
this.$refs.uploadBtn.$el.click()
})
//
this.quillEditor.on('text-change', () => {
this.dataForm.actContent = this.quillEditor.root.innerHTML
if ((this.dataForm.actContent).length > 10000) {
return this.$message.error('您输入的的内容已超过字数')
}
})
},
// ()
uploadBeforeUploadHandle (file) {
if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif') {
this.$message.error(this.$t('upload.tip', { 'format': 'jpg、png、gif' }))
return false
}
},
// ()
uploadSuccessHandle (res, file, fileList) {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.quillEditor.insertEmbed(this.quillEditor.getSelection().index, 'image', res.data.url)
},
setRegistTime () {
this.dataForm.newsReleaseStartTime = this.time[0]
this.dataForm.newsReleaseEndTime = this.time[1]
},
// ends
//
getInfo () {
this.$http.get(`/property/activityinfo/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
}).catch(() => { })
},
//
dataFormSubmitHandle: debounce(function () {
if (new Date() >= new Date(this.dataForm.signUpEndTime)) {
return this.$message.error('报名截止时间必须大于当前时间')
}
if (this.dataForm.actStartTime >= this.dataForm.actEndTime) {
return this.$message.error('活动结束时间必须大于活动开始时间')
}
if (this.dataForm.actStartTime <= this.dataForm.signUpEndTime) {
return this.$message.error('活动开始时间必须大于报名截止时间')
}
if ((this.dataForm.actContent).length > 10000) {
return this.$message.error('您输入的的内容已超过字数')
}
if (this.dataForm.isActQuota === 0) {
this.dataForm.actQuota = 0
}
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
} }
var signUpEndTime = new Date(Date.parse(this.dataForm.signUpEndTime))
var actStarTime = new Date(Date.parse(this.dataForm.actStartTime))
var actEndTime = new Date(Date.parse(this.dataForm.actEndTime))
if (signUpEndTime > actStarTime) {
return this.$message.error('活动开始时间必须大于报名截止时间.')
}
if (actEndTime < actStarTime) {
return this.$message.error('活动结束时间必须大于活动开始时间.')
}
this.isAble = true
this.$http[!this.dataForm.id ? 'post' : 'put']('/property/activityinfo/', this.dataForm).then(({ data: res }) => {
this.isAble = false
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
this.$parent.selectComponent = 'ActInfoList'
this.$router.push({
path: '/activity-actinfo'
})
}).catch(() => { })
})
}, 1000, { 'leading': true, 'trailing': false }),
handleAvatarActSuccess (res, file) {
this.loading = false
this.dataForm.headPic = res.data.url
},
handleAvatarBannerSuccess (res, file) {
this.loading = false
this.dataForm.bannerUrl = res.data.url
},
beforeAvatarUpload (file) {
this.loading = true
},
handelError () {
this.loading = false
},
mapSelectHandle (type) {
this.mapSelectVisible = true
this.$nextTick(() => {
this.$refs.mapSelect.init(type, this.dataForm.clockRadius)
})
} }
},
components: {
MapSelect
}
}
</script> </script>
<style> <style>
.avatar-uploader .el-upload { .avatar-uploader .el-upload {

748
src/views/modules/activity/activityinfo-add.vue

@ -238,383 +238,383 @@
</el-card> </el-card>
</template> </template>
<script> <script>
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
import MapSelect from './map-select' import MapSelect from './map-select'
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
import 'quill/dist/quill.snow.css' import 'quill/dist/quill.snow.css'
import Quill from 'quill' import Quill from 'quill'
export default { export default {
name: 'ActInfoAdd', name: 'ActInfoAdd',
data () { data () {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: '', id: '',
title: '', title: '',
headPic: '', headPic: '',
signUpStartTime: '', signUpStartTime: '',
signUpEndTime: '', signUpEndTime: '',
actQuotaFlag: '1', actQuotaFlag: '1',
actStartTime: '', actStartTime: '',
actEndTime: '', actEndTime: '',
actAddress: '', actAddress: '',
actLongitude: '', actLongitude: '',
actLatitude: '', actLatitude: '',
clockRadius: 200, clockRadius: 200,
actQuota: '', actQuota: '',
contacts: '', contacts: '',
tel: '', tel: '',
requirement: '', requirement: '',
actContent: '', actContent: '',
actStatus: '1', actStatus: '1',
publishTime: '', publishTime: '',
sponsor: '', sponsor: '',
deptId: '', deptId: '',
punishmentPoints: '', punishmentPoints: '',
reward: '', reward: '',
isBanner: '1', isBanner: '1',
actUserDefaultState: '1', actUserDefaultState: '1',
bannerUrl: '', bannerUrl: '',
cancelReason: '', cancelReason: '',
signUpNum: 0, signUpNum: 0,
sectionCode: '', sectionCode: '',
categoryCode: '', categoryCode: '',
categoryName: '' categoryName: ''
}, },
options: [], options: [],
issignUpEndTime: { issignUpEndTime: {
disabledDate (time) { disabledDate (time) {
return time < Date.now() - 8.64e7 // 8.64e7=1000*60*60*24 return time < Date.now() - 8.64e7 // 8.64e7=1000*60*60*24
} }
}, },
isImgRequired: true, isImgRequired: true,
mapSelectVisible: false, mapSelectVisible: false,
signInIsAble: true, signInIsAble: true,
isAble: false, isAble: false,
loading: false, loading: false,
// //
quillEditor: null, quillEditor: null,
quillEditorToolbarOptions: [ quillEditorToolbarOptions: [
['bold', 'italic', 'underline', 'strike'], ['bold', 'italic', 'underline', 'strike'],
['blockquote', 'code-block', 'image'], ['blockquote', 'code-block', 'image'],
[{ 'header': 1 }, { 'header': 2 }], [{ 'header': 1 }, { 'header': 2 }],
[{ 'list': 'ordered' }, { 'list': 'bullet' }], [{ 'list': 'ordered' }, { 'list': 'bullet' }],
[{ 'script': 'sub' }, { 'script': 'super' }], [{ 'script': 'sub' }, { 'script': 'super' }],
[{ 'indent': '-1' }, { 'indent': '+1' }], [{ 'indent': '-1' }, { 'indent': '+1' }],
[{ 'direction': 'rtl' }], [{ 'direction': 'rtl' }],
[{ 'size': ['small', false, 'large', 'huge'] }], [{ 'size': ['small', false, 'large', 'huge'] }],
[{ 'header': [1, 2, 3, 4, 5, 6, false] }], [{ 'header': [1, 2, 3, 4, 5, 6, false] }],
[{ 'color': [] }, { 'background': [] }], [{ 'color': [] }, { 'background': [] }],
[{ 'font': [] }], [{ 'font': [] }],
[{ 'align': [] }], [{ 'align': [] }],
['clean'] ['clean']
], ],
uploadUrl: '', uploadUrl: '',
pickerBeginDateBefore: { pickerBeginDateBefore: {
disabledDate: (time) => { disabledDate: (time) => {
let beginDateVal = this.dataForm.actStartTime let beginDateVal = this.dataForm.actStartTime
if (beginDateVal) { if (beginDateVal) {
return time.getTime() > new Date(beginDateVal).getTime() return time.getTime() > new Date(beginDateVal).getTime()
} }
} }
}, },
pickerBeginDateAfter: { pickerBeginDateAfter: {
disabledDate: (time) => { disabledDate: (time) => {
let EndDateVal = this.dataForm.actEndTime let EndDateVal = this.dataForm.actEndTime
if (EndDateVal) { if (EndDateVal) {
return time.getTime() < new Date(EndDateVal).getTime() return time.getTime() < new Date(EndDateVal).getTime()
} }
} }
} }
} }
}, },
created () { created () {
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
// //
this.hideUpload = false this.hideUpload = false
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}` this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
if (this.quillEditor) { if (this.quillEditor) {
this.quillEditor.deleteText(0, this.quillEditor.getLength()) this.quillEditor.deleteText(0, this.quillEditor.getLength())
} else { } else {
this.quillEditorHandle() this.quillEditorHandle()
} }
// end // end
}) })
}, },
mounted() { mounted () {
this.getOptions() this.getOptions()
}, },
computed: { computed: {
dataRule () { dataRule () {
return { return {
title: [ title: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
headPic: [ headPic: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
signUpStartTime: [ signUpStartTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
signUpEndTime: [ signUpEndTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
actStartTime: [ actStartTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
actEndTime: [ actEndTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
actAddress: [ actAddress: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
actLongitude: [ actLongitude: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
actLatitude: [ actLatitude: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
clockRadius: [ clockRadius: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
actQuotaFlag: [ actQuotaFlag: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
actQuota: [ actQuota: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
clockNum: [ clockNum: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
actShareNum: [ actShareNum: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
actBrowseNum: [ actBrowseNum: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
contacts: [ contacts: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
tel: [ tel: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
requirement: [ requirement: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
actContent: [ actContent: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
actStatus: [ actStatus: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
publishTime: [ publishTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
sponsor: [ sponsor: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
deptId: [ deptId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
categoryCode: [ categoryCode: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
punishmentPoints: [ punishmentPoints: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
reward: [ reward: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
revision: [ revision: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
createdBy: [ createdBy: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
createdTime: [ createdTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
updatedBy: [ updatedBy: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
updatedTime: [ updatedTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
], ],
bannerUrl: [ bannerUrl: [
{ required: this.isImgRequired, message: this.$t('validate.required'), trigger: 'blur' } { required: this.isImgRequired, message: this.$t('validate.required'), trigger: 'blur' }
] ]
} }
} }
}, },
methods: { methods: {
getOptions () { getOptions () {
this.$http this.$http
.get(`/property/sectioncategory/list`, { params: { sectionCode: 'community_forum' } }).then(({ data: res }) => { .get(`/property/sectioncategory/list`, { params: { sectionCode: 'community_forum' } }).then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
this.options = res.data this.options = res.data
}) })
.catch(() => { }) .catch(() => { })
}, },
changeHandler (value) { changeHandler (value) {
if (value === 1) { if (value === 1) {
this.isImgRequired = true this.isImgRequired = true
} else { } else {
this.isImgRequired = false this.isImgRequired = false
} }
}, },
backToActList () { backToActList () {
this.$emit('refreshDataList') this.$emit('refreshDataList')
this.$parent.selectComponent = 'ActInfoList' this.$parent.selectComponent = 'ActInfoList'
this.$router.push({ path: '/activity-actinfo' }) this.$router.push({ path: '/activity-actinfo' })
}, },
init () { init () {
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
if (this.dataForm.id) { if (this.dataForm.id) {
this.getInfo() this.getInfo()
} }
}) })
}, },
position (position) { position (position) {
if (position.type === 1) { if (position.type === 1) {
this.dataForm.actAddress = position.address this.dataForm.actAddress = position.address
this.dataForm.actLatitude = position.latitude this.dataForm.actLatitude = position.latitude
this.dataForm.actLongitude = position.longitude this.dataForm.actLongitude = position.longitude
} }
}, },
// //
quillEditorHandle () { quillEditorHandle () {
this.quillEditor = new Quill('#J_quillEditor', { this.quillEditor = new Quill('#J_quillEditor', {
modules: { modules: {
toolbar: this.quillEditorToolbarOptions toolbar: this.quillEditorToolbarOptions
},
theme: 'snow'
})
this.quillEditor.container.style.height = `${300}px`
// // (使element upload)
this.quillEditor.getModule('toolbar').addHandler('image', () => {
this.$refs.uploadBtn.$el.click()
})
//
this.quillEditor.on('text-change', () => {
this.dataForm.actContent = this.quillEditor.root.innerHTML
if ((this.dataForm.actContent).length > 10000) {
return this.$message.error('您输入的的内容已超过字数')
}
})
},
// ()
uploadBeforeUploadHandle (file) {
if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif') {
this.$message.error(this.$t('upload.tip', { 'format': 'jpg、png、gif' }))
return false
}
},
// ()
uploadSuccessHandle (res, file, fileList) {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.quillEditor.insertEmbed(this.quillEditor.getSelection().index, 'image', res.data.url)
},
setRegistTime () {
this.dataForm.newsReleaseStartTime = this.time[0]
this.dataForm.newsReleaseEndTime = this.time[1]
},
// ends
//
getInfo () {
this.$http.get(`/property/activityinfo/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
}).catch(() => { })
},
//
dataFormSubmitHandle: debounce(function () {
if (new Date() >= new Date(this.dataForm.signUpEndTime)) {
return this.$message.error('报名截止时间必须大于当前时间')
}
if (this.dataForm.actStartTime >= this.dataForm.actEndTime) {
return this.$message.error('活动结束时间必须大于活动开始时间')
}
if (this.dataForm.actStartTime <= this.dataForm.signUpEndTime) {
return this.$message.error('活动开始时间必须大于报名截止时间')
}
if ((this.dataForm.actContent).length > 10000) {
return this.$message.error('您输入的的内容已超过字数')
}
if (this.dataForm.isActQuota === 0) {
this.dataForm.actQuota = 0
}
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
var signUpEndTime = new Date(Date.parse(this.dataForm.signUpEndTime))
var actStarTime = new Date(Date.parse(this.dataForm.actStartTime))
var actEndTime = new Date(Date.parse(this.dataForm.actEndTime))
if (signUpEndTime > actStarTime) {
return this.$message.error('活动开始时间必须大于报名截止时间.')
}
if (actEndTime < actStarTime) {
return this.$message.error('活动结束时间必须大于活动开始时间.')
}
this.isAble = true
this.$http[!this.dataForm.id ? 'post' : 'put']('/property/activityinfo/', this.dataForm).then(({ data: res }) => {
this.isAble = false
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
this.$parent.selectComponent = 'ActInfoList'
this.$router.push({
path: '/activity-actinfo'
})
}).catch(() => { })
})
}, 1000, { 'leading': true, 'trailing': false }),
handleAvatarActSuccess (res, file) {
this.loading = false
this.dataForm.headPic = res.data.url
},
handleAvatarBannerSuccess (res, file) {
this.loading = false
this.dataForm.bannerUrl = res.data.url
},
beforeAvatarUpload (file) {
this.loading = true
},
handelError () {
this.loading = false
},
mapSelectHandle (type) {
this.mapSelectVisible = true
this.$nextTick(() => {
this.$refs.mapSelect.init(type, this.dataForm.clockRadius)
})
}
}, },
components: { theme: 'snow'
MapSelect })
this.quillEditor.container.style.height = `${300}px`
// // (使element upload)
this.quillEditor.getModule('toolbar').addHandler('image', () => {
this.$refs.uploadBtn.$el.click()
})
//
this.quillEditor.on('text-change', () => {
this.dataForm.actContent = this.quillEditor.root.innerHTML
if ((this.dataForm.actContent).length > 10000) {
return this.$message.error('您输入的的内容已超过字数')
}
})
},
// ()
uploadBeforeUploadHandle (file) {
if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif') {
this.$message.error(this.$t('upload.tip', { 'format': 'jpg、png、gif' }))
return false
}
},
// ()
uploadSuccessHandle (res, file, fileList) {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.quillEditor.insertEmbed(this.quillEditor.getSelection().index, 'image', res.data.url)
},
setRegistTime () {
this.dataForm.newsReleaseStartTime = this.time[0]
this.dataForm.newsReleaseEndTime = this.time[1]
},
// ends
//
getInfo () {
this.$http.get(`/property/activityinfo/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
}).catch(() => { })
},
//
dataFormSubmitHandle: debounce(function () {
if (new Date() >= new Date(this.dataForm.signUpEndTime)) {
return this.$message.error('报名截止时间必须大于当前时间')
}
if (this.dataForm.actStartTime >= this.dataForm.actEndTime) {
return this.$message.error('活动结束时间必须大于活动开始时间')
}
if (this.dataForm.actStartTime <= this.dataForm.signUpEndTime) {
return this.$message.error('活动开始时间必须大于报名截止时间')
}
if ((this.dataForm.actContent).length > 10000) {
return this.$message.error('您输入的的内容已超过字数')
}
if (this.dataForm.isActQuota === 0) {
this.dataForm.actQuota = 0
}
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
} }
var signUpEndTime = new Date(Date.parse(this.dataForm.signUpEndTime))
var actStarTime = new Date(Date.parse(this.dataForm.actStartTime))
var actEndTime = new Date(Date.parse(this.dataForm.actEndTime))
if (signUpEndTime > actStarTime) {
return this.$message.error('活动开始时间必须大于报名截止时间.')
}
if (actEndTime < actStarTime) {
return this.$message.error('活动结束时间必须大于活动开始时间.')
}
this.isAble = true
this.$http[!this.dataForm.id ? 'post' : 'put']('/property/activityinfo/', this.dataForm).then(({ data: res }) => {
this.isAble = false
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
this.$parent.selectComponent = 'ActInfoList'
this.$router.push({
path: '/activity-actinfo'
})
}).catch(() => { })
})
}, 1000, { 'leading': true, 'trailing': false }),
handleAvatarActSuccess (res, file) {
this.loading = false
this.dataForm.headPic = res.data.url
},
handleAvatarBannerSuccess (res, file) {
this.loading = false
this.dataForm.bannerUrl = res.data.url
},
beforeAvatarUpload (file) {
this.loading = true
},
handelError () {
this.loading = false
},
mapSelectHandle (type) {
this.mapSelectVisible = true
this.$nextTick(() => {
this.$refs.mapSelect.init(type, this.dataForm.clockRadius)
})
} }
},
components: {
MapSelect
}
}
</script> </script>
<style> <style>
.avatar-uploader .el-upload { .avatar-uploader .el-upload {

6
src/views/modules/activity/activityinfo.vue

@ -148,14 +148,14 @@ export default {
AddOrUpdate, AddOrUpdate,
ActinfoCancel ActinfoCancel
}, },
mounted() { mounted () {
this.getDataList(); this.getDataList()
}, },
methods: { methods: {
addAction () { addAction () {
this.$parent.selectComponent = 'ActInfoAdd' this.$parent.selectComponent = 'ActInfoAdd'
this.$router.push( this.$router.push(
{ path: '/activity-actinfo'} { path: '/activity-actinfo' }
) )
}, },
detailAction (id) { detailAction (id) {

13
src/views/modules/activity/activityparticipant.vue

@ -111,13 +111,12 @@ export default {
}, },
methods: { methods: {
init () { init () {
this.visible = true; this.visible = true
this.dataForm.realName = ''; this.dataForm.realName = ''
this.dataForm.mobile = ''; this.dataForm.mobile = ''
this.dataForm.identityNo = ''; this.dataForm.identityNo = ''
this.getDataList(); this.getDataList()
}, }
} }
} }
</script> </script>

4
src/views/modules/activity/address-check.vue

@ -30,8 +30,8 @@ export default {
visible: false, visible: false,
dataForm: { dataForm: {
address: '', address: '',
longitude: 0,// longitude: 0, //
latitude: 0,// latitude: 0, //
city: '' city: ''
} }
} }

4
src/views/modules/activity/map-select.vue

@ -80,7 +80,7 @@ export default {
this.dataForm.latitude = position.lat this.dataForm.latitude = position.lat
this.dataForm.longitude = position.lng this.dataForm.longitude = position.lng
this.dataForm.city = position.city this.dataForm.city = position.city
this.getAddress(position.lat,position.lng) this.getAddress(position.lat, position.lng)
this.setMap() this.setMap()
}, },
showErr () { showErr () {
@ -123,7 +123,7 @@ export default {
position: myLatlng, position: myLatlng,
map: map map: map
}) })
qq.maps.event.addListener(marker,'click',function (event) { qq.maps.event.addListener(marker, 'click', function (event) {
that.addressCheckHandle() that.addressCheckHandle()
}) })
markerList.push(marker) markerList.push(marker)

48
src/views/modules/section/sectioncategory-add-or-update.vue

@ -52,15 +52,9 @@ export default {
frontStyle: '', frontStyle: '',
sort: '', sort: '',
extend: '', extend: '',
remark: '', remark: ''
delFlag: '',
revision: '',
createdBy: '',
createdTime: '',
updatedBy: '',
updatedTime: '',
}, },
options:[] options: []
} }
}, },
computed: { computed: {
@ -86,32 +80,14 @@ export default {
], ],
remark: [ remark: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
delFlag: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
revision: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
createdBy: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
createdTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
updatedBy: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
updatedTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
] ]
} }
} }
}, },
methods: { methods: {
init () { init () {
this.visible = true; this.visible = true
this.getOptions(); this.getOptions()
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
if (this.dataForm.id) { if (this.dataForm.id) {
@ -131,14 +107,14 @@ export default {
} }
}).catch(() => {}) }).catch(() => {})
}, },
getOptions () { getOptions () {
this.$http.get(`/sys/dict/listSimple/function_setcion`).then(({ data: res }) => { this.$http.get(`/sys/dict/listSimple/function_setcion`).then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
this.options = res.data this.options = res.data
}).catch(() => {}) }).catch(() => {})
}, },
// //
dataFormSubmitHandle: debounce(function () { dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {

Loading…
Cancel
Save