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) {
return false
}
let postData = {
id: this.dataForm.id,
cancelReason: this.dataForm.cancelReason
}
// let postData = {
// id: this.dataForm.id,
// cancelReason: this.dataForm.cancelReason
// }
this.$http['post']('/property/activityinfo/cancel', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)

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

@ -238,383 +238,383 @@
</el-card>
</template>
<script>
import Cookies from 'js-cookie'
import MapSelect from './map-select'
import debounce from 'lodash/debounce'
import 'quill/dist/quill.snow.css'
import Quill from 'quill'
export default {
name: 'ActInfoAdd',
data () {
return {
visible: false,
dataForm: {
id: '',
title: '',
headPic: '',
signUpStartTime: '',
signUpEndTime: '',
actQuotaFlag: '1',
actStartTime: '',
actEndTime: '',
actAddress: '',
actLongitude: '',
actLatitude: '',
clockRadius: 200,
actQuota: '',
contacts: '',
tel: '',
requirement: '',
actContent: '',
actStatus: '',
publishTime: '',
sponsor: '',
deptId: '',
punishmentPoints: '',
reward: '',
isBanner: '1',
actUserDefaultState: '1',
bannerUrl: '',
cancelReason: '',
signUpNum: 0,
sectionCode: '',
categoryCode: '',
categoryName: ''
},
options: [],
issignUpEndTime: {
disabledDate (time) {
return time < Date.now() - 8.64e7 // 8.64e7=1000*60*60*24
}
},
isImgRequired: true,
mapSelectVisible: false,
signInIsAble: true,
isAble: false,
loading: false,
//
quillEditor: null,
quillEditorToolbarOptions: [
['bold', 'italic', 'underline', 'strike'],
['blockquote', 'code-block', 'image'],
[{ 'header': 1 }, { 'header': 2 }],
[{ 'list': 'ordered' }, { 'list': 'bullet' }],
[{ 'script': 'sub' }, { 'script': 'super' }],
[{ 'indent': '-1' }, { 'indent': '+1' }],
[{ 'direction': 'rtl' }],
[{ 'size': ['small', false, 'large', 'huge'] }],
[{ 'header': [1, 2, 3, 4, 5, 6, false] }],
[{ 'color': [] }, { 'background': [] }],
[{ 'font': [] }],
[{ 'align': [] }],
['clean']
],
uploadUrl: '',
pickerBeginDateBefore: {
disabledDate: (time) => {
let beginDateVal = this.dataForm.actStartTime
if (beginDateVal) {
return time.getTime() > new Date(beginDateVal).getTime()
}
}
},
pickerBeginDateAfter: {
disabledDate: (time) => {
let EndDateVal = this.dataForm.actEndTime
if (EndDateVal) {
return time.getTime() < new Date(EndDateVal).getTime()
}
}
}
}
},
created () {
this.visible = true
this.$nextTick(() => {
//
this.hideUpload = false
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
if (this.quillEditor) {
this.quillEditor.deleteText(0, this.quillEditor.getLength())
} else {
this.quillEditorHandle()
}
// end
})
},
mounted() {
this.getOptions()
},
computed: {
dataRule () {
return {
title: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
headPic: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
signUpStartTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
signUpEndTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actStartTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actEndTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actAddress: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actLongitude: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actLatitude: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
clockRadius: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actQuotaFlag: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actQuota: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
clockNum: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actShareNum: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actBrowseNum: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
contacts: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
tel: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
requirement: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actContent: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actStatus: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
publishTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
sponsor: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
deptId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
categoryCode: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
punishmentPoints: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
reward: [
{ 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' }
],
bannerUrl: [
{ required: this.isImgRequired, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
methods: {
getOptions () {
this.$http
.get(`/property/sectioncategory/list`, { params: { sectionCode: 'community_forum' } }).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.options = res.data
})
.catch(() => { })
},
changeHandler (value) {
if (value === 1) {
this.isImgRequired = true
} else {
this.isImgRequired = false
}
},
backToActList () {
this.$emit('refreshDataList')
this.$parent.selectComponent = 'ActInfoList'
this.$router.push({ path: '/activity-actinfo' })
},
init () {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
position (position) {
if (position.type === 1) {
this.dataForm.actAddress = position.address
this.dataForm.actLatitude = position.latitude
this.dataForm.actLongitude = position.longitude
}
},
//
quillEditorHandle () {
this.quillEditor = new Quill('#J_quillEditor', {
modules: {
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)
})
}
import Cookies from 'js-cookie'
import MapSelect from './map-select'
import debounce from 'lodash/debounce'
import 'quill/dist/quill.snow.css'
import Quill from 'quill'
export default {
name: 'ActInfoAdd',
data () {
return {
visible: false,
dataForm: {
id: '',
title: '',
headPic: '',
signUpStartTime: '',
signUpEndTime: '',
actQuotaFlag: '1',
actStartTime: '',
actEndTime: '',
actAddress: '',
actLongitude: '',
actLatitude: '',
clockRadius: 200,
actQuota: '',
contacts: '',
tel: '',
requirement: '',
actContent: '',
actStatus: '',
publishTime: '',
sponsor: '',
deptId: '',
punishmentPoints: '',
reward: '',
isBanner: '1',
actUserDefaultState: '1',
bannerUrl: '',
cancelReason: '',
signUpNum: 0,
sectionCode: '',
categoryCode: '',
categoryName: ''
},
options: [],
issignUpEndTime: {
disabledDate (time) {
return time < Date.now() - 8.64e7 // 8.64e7=1000*60*60*24
}
},
isImgRequired: true,
mapSelectVisible: false,
signInIsAble: true,
isAble: false,
loading: false,
//
quillEditor: null,
quillEditorToolbarOptions: [
['bold', 'italic', 'underline', 'strike'],
['blockquote', 'code-block', 'image'],
[{ 'header': 1 }, { 'header': 2 }],
[{ 'list': 'ordered' }, { 'list': 'bullet' }],
[{ 'script': 'sub' }, { 'script': 'super' }],
[{ 'indent': '-1' }, { 'indent': '+1' }],
[{ 'direction': 'rtl' }],
[{ 'size': ['small', false, 'large', 'huge'] }],
[{ 'header': [1, 2, 3, 4, 5, 6, false] }],
[{ 'color': [] }, { 'background': [] }],
[{ 'font': [] }],
[{ 'align': [] }],
['clean']
],
uploadUrl: '',
pickerBeginDateBefore: {
disabledDate: (time) => {
let beginDateVal = this.dataForm.actStartTime
if (beginDateVal) {
return time.getTime() > new Date(beginDateVal).getTime()
}
}
},
pickerBeginDateAfter: {
disabledDate: (time) => {
let EndDateVal = this.dataForm.actEndTime
if (EndDateVal) {
return time.getTime() < new Date(EndDateVal).getTime()
}
}
}
}
},
created () {
this.visible = true
this.$nextTick(() => {
//
this.hideUpload = false
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
if (this.quillEditor) {
this.quillEditor.deleteText(0, this.quillEditor.getLength())
} else {
this.quillEditorHandle()
}
// end
})
},
mounted () {
this.getOptions()
},
computed: {
dataRule () {
return {
title: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
headPic: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
signUpStartTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
signUpEndTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actStartTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actEndTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actAddress: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actLongitude: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actLatitude: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
clockRadius: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actQuotaFlag: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actQuota: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
clockNum: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actShareNum: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actBrowseNum: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
contacts: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
tel: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
requirement: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actContent: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actStatus: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
publishTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
sponsor: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
deptId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
categoryCode: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
punishmentPoints: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
reward: [
{ 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' }
],
bannerUrl: [
{ required: this.isImgRequired, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
methods: {
getOptions () {
this.$http
.get(`/property/sectioncategory/list`, { params: { sectionCode: 'community_forum' } }).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.options = res.data
})
.catch(() => { })
},
changeHandler (value) {
if (value === 1) {
this.isImgRequired = true
} else {
this.isImgRequired = false
}
},
backToActList () {
this.$emit('refreshDataList')
this.$parent.selectComponent = 'ActInfoList'
this.$router.push({ path: '/activity-actinfo' })
},
init () {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
position (position) {
if (position.type === 1) {
this.dataForm.actAddress = position.address
this.dataForm.actLatitude = position.latitude
this.dataForm.actLongitude = position.longitude
}
},
//
quillEditorHandle () {
this.quillEditor = new Quill('#J_quillEditor', {
modules: {
toolbar: this.quillEditorToolbarOptions
},
components: {
MapSelect
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: {
MapSelect
}
}
</script>
<style>
.avatar-uploader .el-upload {

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

@ -238,383 +238,383 @@
</el-card>
</template>
<script>
import Cookies from 'js-cookie'
import MapSelect from './map-select'
import debounce from 'lodash/debounce'
import 'quill/dist/quill.snow.css'
import Quill from 'quill'
export default {
name: 'ActInfoAdd',
data () {
return {
visible: false,
dataForm: {
id: '',
title: '',
headPic: '',
signUpStartTime: '',
signUpEndTime: '',
actQuotaFlag: '1',
actStartTime: '',
actEndTime: '',
actAddress: '',
actLongitude: '',
actLatitude: '',
clockRadius: 200,
actQuota: '',
contacts: '',
tel: '',
requirement: '',
actContent: '',
actStatus: '1',
publishTime: '',
sponsor: '',
deptId: '',
punishmentPoints: '',
reward: '',
isBanner: '1',
actUserDefaultState: '1',
bannerUrl: '',
cancelReason: '',
signUpNum: 0,
sectionCode: '',
categoryCode: '',
categoryName: ''
},
options: [],
issignUpEndTime: {
disabledDate (time) {
return time < Date.now() - 8.64e7 // 8.64e7=1000*60*60*24
}
},
isImgRequired: true,
mapSelectVisible: false,
signInIsAble: true,
isAble: false,
loading: false,
//
quillEditor: null,
quillEditorToolbarOptions: [
['bold', 'italic', 'underline', 'strike'],
['blockquote', 'code-block', 'image'],
[{ 'header': 1 }, { 'header': 2 }],
[{ 'list': 'ordered' }, { 'list': 'bullet' }],
[{ 'script': 'sub' }, { 'script': 'super' }],
[{ 'indent': '-1' }, { 'indent': '+1' }],
[{ 'direction': 'rtl' }],
[{ 'size': ['small', false, 'large', 'huge'] }],
[{ 'header': [1, 2, 3, 4, 5, 6, false] }],
[{ 'color': [] }, { 'background': [] }],
[{ 'font': [] }],
[{ 'align': [] }],
['clean']
],
uploadUrl: '',
pickerBeginDateBefore: {
disabledDate: (time) => {
let beginDateVal = this.dataForm.actStartTime
if (beginDateVal) {
return time.getTime() > new Date(beginDateVal).getTime()
}
}
},
pickerBeginDateAfter: {
disabledDate: (time) => {
let EndDateVal = this.dataForm.actEndTime
if (EndDateVal) {
return time.getTime() < new Date(EndDateVal).getTime()
}
}
}
}
},
created () {
this.visible = true
this.$nextTick(() => {
//
this.hideUpload = false
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
if (this.quillEditor) {
this.quillEditor.deleteText(0, this.quillEditor.getLength())
} else {
this.quillEditorHandle()
}
// end
})
},
mounted() {
this.getOptions()
},
computed: {
dataRule () {
return {
title: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
headPic: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
signUpStartTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
signUpEndTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actStartTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actEndTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actAddress: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actLongitude: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actLatitude: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
clockRadius: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actQuotaFlag: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actQuota: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
clockNum: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actShareNum: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actBrowseNum: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
contacts: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
tel: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
requirement: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actContent: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actStatus: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
publishTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
sponsor: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
deptId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
categoryCode: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
punishmentPoints: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
reward: [
{ 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' }
],
bannerUrl: [
{ required: this.isImgRequired, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
methods: {
getOptions () {
this.$http
.get(`/property/sectioncategory/list`, { params: { sectionCode: 'community_forum' } }).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.options = res.data
})
.catch(() => { })
},
changeHandler (value) {
if (value === 1) {
this.isImgRequired = true
} else {
this.isImgRequired = false
}
},
backToActList () {
this.$emit('refreshDataList')
this.$parent.selectComponent = 'ActInfoList'
this.$router.push({ path: '/activity-actinfo' })
},
init () {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
position (position) {
if (position.type === 1) {
this.dataForm.actAddress = position.address
this.dataForm.actLatitude = position.latitude
this.dataForm.actLongitude = position.longitude
}
},
//
quillEditorHandle () {
this.quillEditor = new Quill('#J_quillEditor', {
modules: {
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)
})
}
import Cookies from 'js-cookie'
import MapSelect from './map-select'
import debounce from 'lodash/debounce'
import 'quill/dist/quill.snow.css'
import Quill from 'quill'
export default {
name: 'ActInfoAdd',
data () {
return {
visible: false,
dataForm: {
id: '',
title: '',
headPic: '',
signUpStartTime: '',
signUpEndTime: '',
actQuotaFlag: '1',
actStartTime: '',
actEndTime: '',
actAddress: '',
actLongitude: '',
actLatitude: '',
clockRadius: 200,
actQuota: '',
contacts: '',
tel: '',
requirement: '',
actContent: '',
actStatus: '1',
publishTime: '',
sponsor: '',
deptId: '',
punishmentPoints: '',
reward: '',
isBanner: '1',
actUserDefaultState: '1',
bannerUrl: '',
cancelReason: '',
signUpNum: 0,
sectionCode: '',
categoryCode: '',
categoryName: ''
},
options: [],
issignUpEndTime: {
disabledDate (time) {
return time < Date.now() - 8.64e7 // 8.64e7=1000*60*60*24
}
},
isImgRequired: true,
mapSelectVisible: false,
signInIsAble: true,
isAble: false,
loading: false,
//
quillEditor: null,
quillEditorToolbarOptions: [
['bold', 'italic', 'underline', 'strike'],
['blockquote', 'code-block', 'image'],
[{ 'header': 1 }, { 'header': 2 }],
[{ 'list': 'ordered' }, { 'list': 'bullet' }],
[{ 'script': 'sub' }, { 'script': 'super' }],
[{ 'indent': '-1' }, { 'indent': '+1' }],
[{ 'direction': 'rtl' }],
[{ 'size': ['small', false, 'large', 'huge'] }],
[{ 'header': [1, 2, 3, 4, 5, 6, false] }],
[{ 'color': [] }, { 'background': [] }],
[{ 'font': [] }],
[{ 'align': [] }],
['clean']
],
uploadUrl: '',
pickerBeginDateBefore: {
disabledDate: (time) => {
let beginDateVal = this.dataForm.actStartTime
if (beginDateVal) {
return time.getTime() > new Date(beginDateVal).getTime()
}
}
},
pickerBeginDateAfter: {
disabledDate: (time) => {
let EndDateVal = this.dataForm.actEndTime
if (EndDateVal) {
return time.getTime() < new Date(EndDateVal).getTime()
}
}
}
}
},
created () {
this.visible = true
this.$nextTick(() => {
//
this.hideUpload = false
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
if (this.quillEditor) {
this.quillEditor.deleteText(0, this.quillEditor.getLength())
} else {
this.quillEditorHandle()
}
// end
})
},
mounted () {
this.getOptions()
},
computed: {
dataRule () {
return {
title: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
headPic: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
signUpStartTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
signUpEndTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actStartTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actEndTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actAddress: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actLongitude: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actLatitude: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
clockRadius: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actQuotaFlag: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actQuota: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
clockNum: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actShareNum: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actBrowseNum: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
contacts: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
tel: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
requirement: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actContent: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
actStatus: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
publishTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
sponsor: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
deptId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
categoryCode: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
punishmentPoints: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
reward: [
{ 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' }
],
bannerUrl: [
{ required: this.isImgRequired, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
methods: {
getOptions () {
this.$http
.get(`/property/sectioncategory/list`, { params: { sectionCode: 'community_forum' } }).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.options = res.data
})
.catch(() => { })
},
changeHandler (value) {
if (value === 1) {
this.isImgRequired = true
} else {
this.isImgRequired = false
}
},
backToActList () {
this.$emit('refreshDataList')
this.$parent.selectComponent = 'ActInfoList'
this.$router.push({ path: '/activity-actinfo' })
},
init () {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
position (position) {
if (position.type === 1) {
this.dataForm.actAddress = position.address
this.dataForm.actLatitude = position.latitude
this.dataForm.actLongitude = position.longitude
}
},
//
quillEditorHandle () {
this.quillEditor = new Quill('#J_quillEditor', {
modules: {
toolbar: this.quillEditorToolbarOptions
},
components: {
MapSelect
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: {
MapSelect
}
}
</script>
<style>
.avatar-uploader .el-upload {

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save