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) {
this.agencyObj = treeObj
}
console.log(this.agencyObj)
const url = "/gov/org/building/buildinglist"
let params = {
pageSize: this.pageSize,
@ -380,11 +380,11 @@ export default {
let url = "/gov/org/neighborhood/exporttemplate"
if (type === 'building') {
title = '楼宇导入模板'
url = ''
url = '/gov/org/neighborhood/exporttemplate'
} else if (type === 'room') {
title = '房导入模板'
url = ''
title = '房导入模板'
url = '/gov/org/house/exporttemplate'
}
@ -440,35 +440,46 @@ export default {
let params = {}
let fileFormData = new FormData();
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
// params.file = fileFormData
// params.orgId = this.agencyObj.id
// params.orgType = this.agencyObj.level
if (type === 'building') {
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') {
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}"
class="div_table">
<build-table v-if="selTreeObj.level==='neighbourHood'"
<build-table v-if="selTreeObj.level==='neighborHood'"
ref="ref_neighTable"
@toNextLevel="toNextLevel"
@refreshTree="refreshTree"></build-table>
@ -151,7 +151,7 @@ export default {
if (obj.level === 'building') {//
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)
} else {
@ -200,7 +200,7 @@ export default {
obj.communityId = communityNode.data.id
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 agencyNode = this.$refs.ref_tree.getNode(gridNode.data.pid)

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

@ -39,58 +39,61 @@
type="green"
size="small"
@click="handleAdd">新增小区</el-button>
<el-button style=""
type="blue"
size="small"
@click="handleExportModule('community')">下载小区模板</el-button>
<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"
<div class="btn_upload"
v-if="agencyObj.level==='community'||agencyObj.level==='grid'">
<el-button style=""
type="blue"
size="small"
type="red">导入小区数据</el-button>
</el-upload>
<el-button style=";margin-left:10px"
type="blue"
size="small"
@click="handleExportModule('building')">下载楼宇模板</el-button>
<el-upload style=""
ref="upload_building"
:multiple='false'
:show-file-list='false'
:before-upload="((file)=>{beforeUpload(file, 'building')})"
action=""
accept=".xls,.xlsx"
:http-request="(()=>{uploadFile( 'building')})">
<el-button style="margin-left:10px"
@click="handleExportModule('community')">下载小区模板</el-button>
<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"
type="red">导入小区数据</el-button>
</el-upload>
<el-button style=";margin-left:10px"
type="blue"
size="small"
type="red">导入楼宇数据</el-button>
</el-upload>
<el-button style=";margin-left:10px"
type="blue"
size="small"
@click="handleExportModule('room')">下载房屋模板</el-button>
<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"
@click="handleExportModule('building')">下载楼宇模板</el-button>
<el-upload style=""
ref="upload_building"
:multiple='false'
:show-file-list='false'
:before-upload="((file)=>{beforeUpload(file, 'building')})"
action=""
accept=".xls,.xlsx"
:http-request="(()=>{uploadFile( 'building')})">
<el-button style="margin-left:10px"
size="small"
type="red">导入楼宇数据</el-button>
</el-upload>
<el-button style=";margin-left:10px"
type="blue"
size="small"
type="red">导入房屋数据</el-button>
</el-upload>
@click="handleExportModule('room')">下载房屋模板</el-button>
<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>
@ -237,7 +240,7 @@ export default {
if (fromTree) {
this.agencyObj = treeObj
}
// console.log(this.agencyObj)
console.log(this.agencyObj)
const url = "/gov/org/neighborhood/neighborhoodlist"
let params = {
@ -461,13 +464,13 @@ export default {
//
let url = ''
let params = {}
let fileFormData = new FormData();
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') {
@ -482,24 +485,29 @@ export default {
} else if (type === 'room') {
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 {
display: flex;
margin-top: 20px;
.btn_upload {
margin-left: 10px;
display: flex;
}
}
.el-row {

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

@ -417,27 +417,33 @@ export default {
//
this.$refs['upload'].clearFiles()
var url = '/gov/org/ichouse/houseimport'
var url = '/gov/org/house/houseimport'
let params = {}
let fileFormData = new FormData();
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)
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' } })
},

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

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

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

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

Loading…
Cancel
Save