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, street: null,
communityId: null, communityId: null,
community: null, community: null,
gridId: null, deptId: null,
grid: null, dept: null,
newsCateroryId: '', newsCateroryId: '',
newsProperty: '', newsProperty: '',
newsTitle: '', newsTitle: '',
@ -155,7 +155,7 @@ export default {
this.getListCategory() this.getListCategory()
this.visible = true this.visible = true
this.$nextTick(() => { 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.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')}`
@ -212,13 +212,13 @@ export default {
this.quillEditor.root.innerHTML = res.data.newsContent this.quillEditor.root.innerHTML = res.data.newsContent
if (this.dataForm.streetId) { if (this.dataForm.streetId) {
if (this.dataForm.communityId === 0) { 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) this.getDeptInfoList('community', this.dataForm.streetId)
} }
if (this.dataForm.communityId) { if (this.dataForm.communityId) {
if (this.dataForm.gridId === 0) { if (this.dataForm.deptId === 0) {
this.dataForm.gridId = null this.dataForm.deptId = null
} }
this.getDeptInfoList('grid', this.dataForm.communityId) this.getDeptInfoList('grid', this.dataForm.communityId)
} }
@ -246,20 +246,20 @@ export default {
changeStreet (event) { changeStreet (event) {
let choosenItem = this.streetList.filter(item => item.id === this.dataForm.streetId)[0] let choosenItem = this.streetList.filter(item => item.id === this.dataForm.streetId)[0]
this.dataForm.street = choosenItem.name 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.communityList = this.gridList = []
this.getDeptInfoList('community', event) this.getDeptInfoList('community', event)
}, },
changeCommunity (event) { changeCommunity (event) {
let choosenItem = this.communityList.filter(item => item.id === this.dataForm.communityId)[0] let choosenItem = this.communityList.filter(item => item.id === this.dataForm.communityId)[0]
this.dataForm.community = choosenItem.name this.dataForm.community = choosenItem.name
this.dataForm.gridId = this.dataForm.grid = null this.dataForm.deptId = this.dataForm.dept = null
this.gridList = [] this.gridList = []
this.getDeptInfoList('grid', event) this.getDeptInfoList('grid', event)
}, },
changeGrid (event) { changeGrid (event) {
let choosenItem = this.gridList.filter(item => item.id === this.dataForm.gridId)[0] let choosenItem = this.gridList.filter(item => item.id === this.dataForm.deptId)[0]
this.dataForm.grid = choosenItem.name this.dataForm.dept = choosenItem.name
}, },
changeCaterory () { changeCaterory () {
// //

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

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

Loading…
Cancel
Save