Browse Source

小区管理导入

prod^2
jiangyy 4 years ago
parent
commit
bf99e5c362
  1. 51
      src/views/modules/base/community/buildTable.vue
  2. 6
      src/views/modules/base/community/community.vue
  3. 147
      src/views/modules/base/community/communityTable.vue
  4. 38
      src/views/modules/base/community/roomTable.vue
  5. 2
      src/views/modules/visual/communityGovern/distributionAnalyze.vue
  6. 1
      src/views/modules/visual/communityGovern/processAnalyze.vue
  7. 6
      src/views/modules/visual/components/screen-map/index.vue

51
src/views/modules/base/community/buildTable.vue

@ -215,7 +215,7 @@ export default {
if (fromTree) { if (fromTree) {
this.agencyObj = treeObj this.agencyObj = treeObj
} }
console.log(this.agencyObj)
const url = "/gov/org/building/buildinglist" const url = "/gov/org/building/buildinglist"
let params = { let params = {
pageSize: this.pageSize, pageSize: this.pageSize,
@ -380,11 +380,11 @@ export default {
let url = "/gov/org/neighborhood/exporttemplate" let url = "/gov/org/neighborhood/exporttemplate"
if (type === 'building') { if (type === 'building') {
title = '楼宇导入模板' title = '楼宇导入模板'
url = '' url = '/gov/org/neighborhood/exporttemplate'
} else if (type === 'room') { } else if (type === 'room') {
title = '房导入模板' title = '房导入模板'
url = '' url = '/gov/org/house/exporttemplate'
} }
@ -440,35 +440,46 @@ export default {
let params = {} let params = {}
let fileFormData = new FormData(); let fileFormData = new FormData();
fileFormData.append('file', this.files);//filenamefiletest.zip fileFormData.append('file', this.files);//filenamefiletest.zip
fileFormData.append('orgId', this.agencyObj.id);//filenamefiletest.zip
fileFormData.append('orgType', this.agencyObj.level);//filenamefiletest.zip
params.file = fileFormData // params.file = fileFormData
params.orgId = this.agencyObj.id // params.orgId = this.agencyObj.id
params.orgType = this.agencyObj.level // params.orgType = this.agencyObj.level
if (type === 'building') { if (type === 'building') {
this.$refs['upload_building'].clearFiles() this.$refs['upload_building'].clearFiles()
url = '/gov/org/building/buildingimport' url = 'http://192.168.51.26:8080/api/gov/org/building/buildingimport'
} else if (type === 'room') { } else if (type === 'room') {
this.$refs['upload_room'].clearFiles() this.$refs['upload_room'].clearFiles()
url = '/gov/org/ichouse/houseimport' // url = 'http://192.168.51.26:8080/api/gov/org/house/houseimport'
url = '/gov/org/house/houseimport'
} }
const { data, code, msg } = await requestPost(url, fileFormData)
if (code === 0) {
this.$message({
type: "success",
message: "导入成功"
});
this.$emit('refreshTree')
this.loadTable()
} else {
this.$message.error(msg)
}
window.app.ajax.post2(url, fileFormData,
(data, rspMsg) => {
if (data.code === 0 || data.code > 8000) {
// this.$message({
// type: "success",
// message: ""
// });
this.$message.success(rspMsg)
this.$emit('refreshTree')
this.loadTable()
} else {
this.$message.error(rspMsg)
}
},
(rspMsg, data) => {
this.$message.error(rspMsg)
}, { headers: { 'Content-Type': 'multipart/form-data' } })
}, },

6
src/views/modules/base/community/community.vue

@ -27,7 +27,7 @@
<div :style="{height:rowHeight}" <div :style="{height:rowHeight}"
class="div_table"> class="div_table">
<build-table v-if="selTreeObj.level==='neighbourHood'" <build-table v-if="selTreeObj.level==='neighborHood'"
ref="ref_neighTable" ref="ref_neighTable"
@toNextLevel="toNextLevel" @toNextLevel="toNextLevel"
@refreshTree="refreshTree"></build-table> @refreshTree="refreshTree"></build-table>
@ -151,7 +151,7 @@ export default {
if (obj.level === 'building') {// if (obj.level === 'building') {//
this.$refs['ref_buildingTable'].loadTable(true, this.selTreeObj) this.$refs['ref_buildingTable'].loadTable(true, this.selTreeObj)
} else if (obj.level === 'neighbourHood') {// } else if (obj.level === 'neighborHood') {//
this.$refs['ref_neighTable'].loadTable(true, this.selTreeObj) this.$refs['ref_neighTable'].loadTable(true, this.selTreeObj)
} else { } else {
@ -200,7 +200,7 @@ export default {
obj.communityId = communityNode.data.id obj.communityId = communityNode.data.id
obj.communityName = communityNode.data.label obj.communityName = communityNode.data.label
} else if (obj.level === 'neighbourHood') {// } else if (obj.level === 'neighborHood') {//
let gridNode = this.$refs.ref_tree.getNode(obj.pid) let gridNode = this.$refs.ref_tree.getNode(obj.pid)
let agencyNode = this.$refs.ref_tree.getNode(gridNode.data.pid) let agencyNode = this.$refs.ref_tree.getNode(gridNode.data.pid)

147
src/views/modules/base/community/communityTable.vue

@ -39,58 +39,61 @@
type="green" type="green"
size="small" size="small"
@click="handleAdd">新增小区</el-button> @click="handleAdd">新增小区</el-button>
<el-button style="" <div class="btn_upload"
type="blue" v-if="agencyObj.level==='community'||agencyObj.level==='grid'">
size="small" <el-button style=""
@click="handleExportModule('community')">下载小区模板</el-button> type="blue"
<el-upload ref="upload_community"
style=""
:multiple='false'
:show-file-list='false'
:before-upload="((file)=>{beforeUpload(file, 'community')})"
action=""
accept=".xls,.xlsx"
:http-request="(()=>{uploadFile( 'community')})">
<el-button style="margin-left:10px"
size="small" size="small"
type="red">导入小区数据</el-button> @click="handleExportModule('community')">下载小区模板</el-button>
</el-upload>
<el-upload ref="upload_community"
<el-button style=";margin-left:10px" style=""
type="blue" :multiple='false'
size="small" :show-file-list='false'
@click="handleExportModule('building')">下载楼宇模板</el-button> :before-upload="((file)=>{beforeUpload(file, 'community')})"
action=""
<el-upload style="" accept=".xls,.xlsx"
ref="upload_building" :http-request="(()=>{uploadFile( 'community')})">
:multiple='false' <el-button style="margin-left:10px"
:show-file-list='false' size="small"
:before-upload="((file)=>{beforeUpload(file, 'building')})" type="red">导入小区数据</el-button>
action="" </el-upload>
accept=".xls,.xlsx"
:http-request="(()=>{uploadFile( 'building')})"> <el-button style=";margin-left:10px"
<el-button style="margin-left:10px" type="blue"
size="small" size="small"
type="red">导入楼宇数据</el-button> @click="handleExportModule('building')">下载楼宇模板</el-button>
</el-upload>
<el-button style=";margin-left:10px" <el-upload style=""
type="blue" ref="upload_building"
size="small" :multiple='false'
@click="handleExportModule('room')">下载房屋模板</el-button> :show-file-list='false'
:before-upload="((file)=>{beforeUpload(file, 'building')})"
<el-upload style="" action=""
ref="upload_room" accept=".xls,.xlsx"
:multiple='false' :http-request="(()=>{uploadFile( 'building')})">
:show-file-list='false' <el-button style="margin-left:10px"
:before-upload="((file)=>{beforeUpload(file, 'room')})" size="small"
action="" type="red">导入楼宇数据</el-button>
accept=".xls,.xlsx" </el-upload>
:http-request="(()=>{uploadFile( 'room')})"> <el-button style=";margin-left:10px"
<el-button style="margin-left:10px" type="blue"
size="small" size="small"
type="red">导入房屋数据</el-button> @click="handleExportModule('room')">下载房屋模板</el-button>
</el-upload>
<el-upload style=""
ref="upload_room"
:multiple='false'
:show-file-list='false'
:before-upload="((file)=>{beforeUpload(file, 'room')})"
action=""
accept=".xls,.xlsx"
:http-request="(()=>{uploadFile( 'room')})">
<el-button style="margin-left:10px"
size="small"
type="red">导入房屋数据</el-button>
</el-upload>
</div>
</div> </div>
@ -237,7 +240,7 @@ export default {
if (fromTree) { if (fromTree) {
this.agencyObj = treeObj this.agencyObj = treeObj
} }
// console.log(this.agencyObj) console.log(this.agencyObj)
const url = "/gov/org/neighborhood/neighborhoodlist" const url = "/gov/org/neighborhood/neighborhoodlist"
let params = { let params = {
@ -461,13 +464,13 @@ export default {
// //
let url = '' let url = ''
let params = {}
let fileFormData = new FormData(); let fileFormData = new FormData();
fileFormData.append('file', this.files);//filenamefiletest.zip fileFormData.append('file', this.files);//filenamefiletest.zip
fileFormData.append('orgId', this.agencyObj.id);//filenamefiletest.zip
fileFormData.append('orgType', this.agencyObj.level === 'grid' ? 'grid' : 'agency');//filenamefiletest.zip
params.file = fileFormData
params.orgId = this.agencyObj.id
params.orgType = this.agencyObj.level === 'grid' ? 'grid' : 'agency'
if (type === 'community') { if (type === 'community') {
@ -482,24 +485,29 @@ export default {
} else if (type === 'room') { } else if (type === 'room') {
this.$refs['upload_room'].clearFiles() this.$refs['upload_room'].clearFiles()
url = '/gov/org/ichouse/houseimport' url = '/gov/org/house/houseimport'
} }
window.app.ajax.post2(url, fileFormData,
(data, rspMsg) => {
if (data.code === 0 || data.code > 8000) {
// this.$message({
// type: "success",
// message: ""
// });
this.$message.success(rspMsg)
this.$emit('refreshTree')
this.loadTable()
} else {
this.$message.error(rspMsg)
}
},
(rspMsg, data) => {
this.$message.error(rspMsg)
}, { headers: { 'Content-Type': 'multipart/form-data' } })
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.$message({
type: "success",
message: "导入成功"
});
this.$emit('refreshTree')
this.loadTable()
} else {
// debugger
// this.$message.error(msg)
}
}, },
@ -587,6 +595,11 @@ export default {
.div_btn { .div_btn {
display: flex; display: flex;
margin-top: 20px; margin-top: 20px;
.btn_upload {
margin-left: 10px;
display: flex;
}
} }
.el-row { .el-row {

38
src/views/modules/base/community/roomTable.vue

@ -417,27 +417,33 @@ export default {
// //
this.$refs['upload'].clearFiles() this.$refs['upload'].clearFiles()
var url = '/gov/org/ichouse/houseimport' var url = '/gov/org/house/houseimport'
let params = {}
let fileFormData = new FormData(); let fileFormData = new FormData();
fileFormData.append('file', this.files);//filenamefiletest.zip fileFormData.append('file', this.files);//filenamefiletest.zip
fileFormData.append('orgId', this.agencyObj.id);//filenamefiletest.zip
fileFormData.append('orgType', this.agencyObj.level);//filenamefiletest.zip
params.file = fileFormData
params.orgId = this.agencyObj.id
params.orgType = this.agencyObj.level
const { data, code, msg } = await requestPost(url, fileFormData) window.app.ajax.post2(url, fileFormData,
if (code === 0) { (data, rspMsg) => {
this.$message({
type: "success", if (data.code === 0 || data.code > 8000) {
message: "导入成功" // this.$message({
}); // type: "success",
this.$emit('refreshTree') // message: ""
this.loadTable() // });
} else { this.$message.success(rspMsg)
this.$message.error(msg) this.$emit('refreshTree')
} this.loadTable()
} else {
this.$message.error(rspMsg)
}
},
(rspMsg, data) => {
this.$message.error(rspMsg)
}, { headers: { 'Content-Type': 'multipart/form-data' } })
}, },

2
src/views/modules/visual/communityGovern/distributionAnalyze.vue

@ -475,6 +475,7 @@ export default {
}, },
// 线 // 线
async getLineChart () { async getLineChart () {
if (!this.showNoData) { if (!this.showNoData) {
this.$refs.lineChart.clear() this.$refs.lineChart.clear()
this.$refs.lineChart.showLoading() this.$refs.lineChart.showLoading()
@ -527,6 +528,7 @@ export default {
//线 //线
loadCategoryData () { loadCategoryData () {
this.xaxis = [] this.xaxis = []
this.series = [] this.series = []
this.legend = [] this.legend = []

1
src/views/modules/visual/communityGovern/processAnalyze.vue

@ -424,6 +424,7 @@ export default {
}, },
loadMap () { loadMap () {
if (this.isfirstInit) { if (this.isfirstInit) {
//mapInfo, polygonArray, polIconUrlArray, iconArrays, iconUrlArray //mapInfo, polygonArray, polIconUrlArray, iconArrays, iconUrlArray
// this.$refs.map.loadMap(this.agencyInfo, null, null, this.projectList, this.iconUrlArray, this.iconTextStyle, 3000) // this.$refs.map.loadMap(this.agencyInfo, null, null, this.projectList, this.iconUrlArray, this.iconTextStyle, 3000)

6
src/views/modules/visual/components/screen-map/index.vue

@ -227,6 +227,7 @@ const vueGis = {
// //
async refreshMap (polygonArray, iconArrays) { async refreshMap (polygonArray, iconArrays) {
this.polygonArray = polygonArray this.polygonArray = polygonArray
this.iconArrays = iconArrays this.iconArrays = iconArrays
@ -354,9 +355,10 @@ const vueGis = {
if (this.iconArrays && this.iconArrays.length > 0) { if (this.iconArrays && this.iconArrays.length > 0) {
let iconFeatures = []; let iconFeatures = [];
let iconArraysNew = []
this.iconArrays.forEach((oneIcon, index) => { this.iconArrays.forEach((oneIcon, index) => {
// //
let iconItem = new Feature({ let iconItem = new Feature({
geometry: new Point([oneIcon.longitude, oneIcon.latitude]), geometry: new Point([oneIcon.longitude, oneIcon.latitude]),
id: oneIcon.id, id: oneIcon.id,
@ -377,6 +379,7 @@ const vueGis = {
}); });
iconItem.setStyle(iconStyle); iconItem.setStyle(iconStyle);
if (this.distanceMax) { if (this.distanceMax) {
if (this.computedDistance(oneIcon.longitude, oneIcon.latitude, this.distanceMax)) { if (this.computedDistance(oneIcon.longitude, oneIcon.latitude, this.distanceMax)) {
iconFeatures.push(iconItem); iconFeatures.push(iconItem);
@ -414,7 +417,6 @@ const vueGis = {
// console.log(distance) // console.log(distance)
return (distance < max || distance === max) return (distance < max || distance === max)
// debugger // debugger
// return // return
// var wgs84Sphere = new ol.Sphere(6378137); // var wgs84Sphere = new ol.Sphere(6378137);

Loading…
Cancel
Save