|
|
|
@ -14,7 +14,7 @@ |
|
|
|
<el-input v-model="dataForm.url" |
|
|
|
maxlength="1000" |
|
|
|
show-word-limit |
|
|
|
placeholder="链接地址"></el-input> |
|
|
|
placeholder="链接地址(必须在微信公众平台添加安全业务域名)" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="标题" |
|
|
|
prop="title"> |
|
|
|
@ -23,6 +23,11 @@ |
|
|
|
show-word-limit |
|
|
|
placeholder="标题"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="所属版块" prop="sectionCode"> |
|
|
|
<el-select v-model="dataForm.sectionCode" clearable placeholder="所属版块"> |
|
|
|
<el-option v-for="item in sectionCodeList" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" :disabled="item.dictValue === 'healthy_living'" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="所属机构"> |
|
|
|
<el-cascader v-model="dataForm.allDeptIdsShow" |
|
|
|
:options="options" |
|
|
|
@ -86,26 +91,19 @@ export default { |
|
|
|
visible: false, |
|
|
|
dataForm: { |
|
|
|
id: '', |
|
|
|
sectionCode: '', |
|
|
|
url: '', |
|
|
|
title: '', |
|
|
|
imgUrl: '', |
|
|
|
bannerType: '', |
|
|
|
streetId: '', |
|
|
|
street: '', |
|
|
|
communityId: '', |
|
|
|
community: '', |
|
|
|
gridId: '', |
|
|
|
grid: '', |
|
|
|
position: '0', |
|
|
|
allDeptIdsShow: [] |
|
|
|
}, |
|
|
|
bannerOptions: [], |
|
|
|
streetList: [], |
|
|
|
communityList: [], |
|
|
|
gridList: [], |
|
|
|
options: [], |
|
|
|
uploadUrl: '', |
|
|
|
positionList: [], |
|
|
|
sectionCodeList: [], |
|
|
|
loading: false |
|
|
|
} |
|
|
|
}, |
|
|
|
@ -124,10 +122,7 @@ export default { |
|
|
|
bannerType: [ |
|
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|
|
|
], |
|
|
|
streetId: [ |
|
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|
|
|
], |
|
|
|
gridId: [ |
|
|
|
sectionCode: [ |
|
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|
|
|
], |
|
|
|
position: [ |
|
|
|
@ -147,7 +142,6 @@ export default { |
|
|
|
this.options = res.data.options |
|
|
|
}) |
|
|
|
.catch(() => { }) |
|
|
|
this.getDeptInfoList('street', localStorage.getItem('street') === null ? '1169154711480528897' : localStorage.getItem('street')) |
|
|
|
this.getListFromDict('bannerType') |
|
|
|
this.getListFromDict('bannerPosition') |
|
|
|
}, |
|
|
|
@ -156,13 +150,12 @@ export default { |
|
|
|
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}` |
|
|
|
this.visible = true |
|
|
|
this.$nextTick(() => { |
|
|
|
this.dataForm.communityId = this.dataForm.streetId = this.dataForm.gridId = null |
|
|
|
this.communityList = this.gridList = [] |
|
|
|
this.$refs['dataForm'].resetFields() |
|
|
|
if (this.dataForm.id) { |
|
|
|
this.getInfo() |
|
|
|
} |
|
|
|
}) |
|
|
|
this.getsectionCodeList() |
|
|
|
}, |
|
|
|
// 获取信息 |
|
|
|
getInfo () { |
|
|
|
@ -171,20 +164,18 @@ export default { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
this.dataForm = res.data |
|
|
|
if (this.dataForm.streetId) { |
|
|
|
if (this.dataForm.communityId === 0) { |
|
|
|
this.dataForm.communityId = this.dataForm.gridId = null |
|
|
|
} |
|
|
|
this.getDeptInfoList('community', this.dataForm.streetId) |
|
|
|
} |
|
|
|
if (this.dataForm.communityId) { |
|
|
|
if (this.dataForm.gridId === 0) { |
|
|
|
this.dataForm.gridId = null |
|
|
|
} |
|
|
|
this.getDeptInfoList('grid', this.dataForm.communityId) |
|
|
|
} |
|
|
|
}).catch(() => { }) |
|
|
|
}, |
|
|
|
getsectionCodeList () { |
|
|
|
this.$http.get(`/sys/dict/listSimple/function_section_article`) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
this.sectionCodeList = res.data |
|
|
|
}) |
|
|
|
.catch(() => {}) |
|
|
|
}, |
|
|
|
// 表单提交 |
|
|
|
dataFormSubmitHandle: debounce(function () { |
|
|
|
this.$refs['dataForm'].validate((valid) => { |
|
|
|
@ -229,46 +220,6 @@ export default { |
|
|
|
this.positionList = res.data |
|
|
|
} |
|
|
|
}).catch(() => { }) |
|
|
|
}, |
|
|
|
// 获取部门列表 |
|
|
|
getDeptInfoList (dataReceiver, faDeptId) { |
|
|
|
this.$http.get(`/sys/dept/sublist/` + faDeptId).then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
if (dataReceiver === 'street') { |
|
|
|
this.streetList = res.data |
|
|
|
} else if (dataReceiver === 'community') { |
|
|
|
this.communityList = res.data |
|
|
|
} else if (dataReceiver === 'grid') { |
|
|
|
this.gridList = res.data |
|
|
|
} |
|
|
|
}).catch(() => { }) |
|
|
|
}, |
|
|
|
changeStreet () { |
|
|
|
// 给街道变量赋值 |
|
|
|
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.communityList = this.gridList = [] |
|
|
|
// 获取街道下属社区 |
|
|
|
this.getDeptInfoList('community', this.dataForm.streetId) |
|
|
|
}, |
|
|
|
changeCommunity () { |
|
|
|
// 给社区变量赋值 |
|
|
|
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.gridList = [] |
|
|
|
// 获取社区下属网格 |
|
|
|
this.getDeptInfoList('grid', this.dataForm.communityId) |
|
|
|
}, |
|
|
|
changeGrid () { |
|
|
|
// 给网格变量赋值 |
|
|
|
let choosenItem = this.gridList.filter(item => item.id === this.dataForm.gridId)[0] |
|
|
|
this.dataForm.grid = choosenItem.name |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|