Browse Source

【grid修改】-王公峰-2020-09-24

migration
wanggongfeng 5 years ago
parent
commit
b28dd0f5ec
  1. 20
      src/views/modules/news/allnews-add-or-update.vue
  2. 4
      src/views/modules/news/allnotice.vue
  3. 22
      src/views/modules/news/notice-add-or-update.vue

20
src/views/modules/news/allnews-add-or-update.vue

@ -100,8 +100,8 @@ export default {
street: null,
communityId: null,
community: null,
gridId: null,
grid: null,
deptId: null,
dept: null,
newsCateroryId: '',
newsProperty: '',
newsTitle: '',
@ -155,7 +155,7 @@ export default {
this.getListCategory()
this.visible = true
this.$nextTick(() => {
this.dataForm.communityId = this.dataForm.streetId = this.dataForm.gridId = null
this.dataForm.communityId = this.dataForm.streetId = this.dataForm.deptId = null
//
this.hideUpload = false
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
@ -212,13 +212,13 @@ export default {
this.quillEditor.root.innerHTML = res.data.newsContent
if (this.dataForm.streetId) {
if (this.dataForm.communityId === 0) {
this.dataForm.communityId = this.dataForm.gridId = null
this.dataForm.communityId = this.dataForm.deptId = null
}
this.getDeptInfoList('community', this.dataForm.streetId)
}
if (this.dataForm.communityId) {
if (this.dataForm.gridId === 0) {
this.dataForm.gridId = null
if (this.dataForm.deptId === 0) {
this.dataForm.deptId = null
}
this.getDeptInfoList('grid', this.dataForm.communityId)
}
@ -246,20 +246,20 @@ export default {
changeStreet (event) {
let choosenItem = this.streetList.filter(item => item.id === this.dataForm.streetId)[0]
this.dataForm.street = choosenItem.name
this.dataForm.communityId = this.dataForm.gridId = this.dataForm.community = this.dataForm.grid = null
this.dataForm.communityId = this.dataForm.deptId = this.dataForm.community = this.dataForm.dept = null
this.communityList = this.gridList = []
this.getDeptInfoList('community', event)
},
changeCommunity (event) {
let choosenItem = this.communityList.filter(item => item.id === this.dataForm.communityId)[0]
this.dataForm.community = choosenItem.name
this.dataForm.gridId = this.dataForm.grid = null
this.dataForm.deptId = this.dataForm.dept = null
this.gridList = []
this.getDeptInfoList('grid', event)
},
changeGrid (event) {
let choosenItem = this.gridList.filter(item => item.id === this.dataForm.gridId)[0]
this.dataForm.grid = choosenItem.name
let choosenItem = this.gridList.filter(item => item.id === this.dataForm.deptId)[0]
this.dataForm.dept = choosenItem.name
},
changeCaterory () {
//

4
src/views/modules/news/allnotice.vue

@ -182,9 +182,9 @@ export default {
watch: {
'deptIdList': function (val) {
if (val.length !== 0) {
this.dataForm.gridId = val[val.length - 1]
this.dataForm.deptId = val[val.length - 1]
} else {
this.dataForm.gridId = ''
this.dataForm.deptId = ''
}
}
},

22
src/views/modules/news/notice-add-or-update.vue

@ -64,8 +64,8 @@ export default {
street: null,
communityId: null,
community: null,
gridId: null,
grid: null,
deptId: null,
dept: null,
noticeTitle: '',
noticeContent: '',
allDeptIdsShow: []
@ -164,7 +164,7 @@ export default {
init () {
this.visible = true
this.$nextTick(() => {
this.dataForm.communityId = this.dataForm.streetId = this.dataForm.gridId = null
this.dataForm.communityId = this.dataForm.streetId = this.dataForm.deptId = null
this.communityList = this.gridList = []
//
this.hideUpload = false
@ -193,13 +193,13 @@ export default {
this.quillEditor.root.innerHTML = res.data.noticeContent
if (this.dataForm.streetId) {
if (this.dataForm.communityId === 0) {
this.dataForm.communityId = this.dataForm.gridId = null
this.dataForm.communityId = this.dataForm.deptId = null
}
this.getDeptInfoList('community', this.dataForm.streetId)
}
if (this.dataForm.communityId) {
if (this.dataForm.gridId === 0) {
this.dataForm.gridId = null
if (this.dataForm.deptId === 0) {
this.dataForm.deptId = null
}
this.getDeptInfoList('grid', this.dataForm.communityId)
}
@ -265,7 +265,7 @@ export default {
let choosenItem = this.streetList.filter(item => item.id === this.dataForm.streetId)[0]
this.dataForm.street = choosenItem.name
//
this.dataForm.communityId = this.dataForm.gridId = this.dataForm.community = this.dataForm.grid = null
this.dataForm.communityId = this.dataForm.deptId = this.dataForm.community = this.dataForm.dept = null
this.communityList = this.gridList = []
//
this.getDeptInfoList('community', this.dataForm.streetId)
@ -275,7 +275,7 @@ export default {
let choosenItem = this.communityList.filter(item => item.id === this.dataForm.communityId)[0]
this.dataForm.community = choosenItem.name
//
this.dataForm.gridId = this.dataForm.grid = null
this.dataForm.deptId = this.dataForm.dept = null
this.gridList = []
//
this.getDeptInfoList('grid', this.dataForm.communityId)
@ -283,9 +283,9 @@ export default {
changeGrid (item) {
console.log(item)
//
// let choosenItem = this.gridList.filter(item => item.id === this.dataForm.gridId)[0]
// this.dataForm.grid = choosenItem.name
// this.dataForm = Object.assign(this.dataForm, { gridId: item })
// let choosenItem = this.gridList.filter(item => item.id === this.dataForm.deptId)[0]
// this.dataForm.dept = choosenItem.name
// this.dataForm = Object.assign(this.dataForm, { deptId: item })
console.log(this.dataForm)
}

Loading…
Cancel
Save