From bf99e5c3629aae3bb3169677b560b32216e6dfc9 Mon Sep 17 00:00:00 2001 From: jiangyy Date: Tue, 15 Feb 2022 16:48:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=B0=8F=E5=8C=BA=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/base/community/buildTable.vue | 51 +++--- .../modules/base/community/community.vue | 6 +- .../modules/base/community/communityTable.vue | 147 ++++++++++-------- .../modules/base/community/roomTable.vue | 38 +++-- .../communityGovern/distributionAnalyze.vue | 2 + .../visual/communityGovern/processAnalyze.vue | 1 + .../visual/components/screen-map/index.vue | 6 +- 7 files changed, 143 insertions(+), 108 deletions(-) diff --git a/src/views/modules/base/community/buildTable.vue b/src/views/modules/base/community/buildTable.vue index 3a04cd3d..70d61677 100644 --- a/src/views/modules/base/community/buildTable.vue +++ b/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);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名 + fileFormData.append('orgId', this.agencyObj.id);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名 + fileFormData.append('orgType', this.agencyObj.level);//filename是键,file是值,就是要传的文件,test.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' } }) }, diff --git a/src/views/modules/base/community/community.vue b/src/views/modules/base/community/community.vue index 41005ba1..14254aa9 100644 --- a/src/views/modules/base/community/community.vue +++ b/src/views/modules/base/community/community.vue @@ -27,7 +27,7 @@
- @@ -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) diff --git a/src/views/modules/base/community/communityTable.vue b/src/views/modules/base/community/communityTable.vue index 118bf401..3293431a 100644 --- a/src/views/modules/base/community/communityTable.vue +++ b/src/views/modules/base/community/communityTable.vue @@ -39,58 +39,61 @@ type="green" size="small" @click="handleAdd">新增小区 - 下载小区模板 - - - + 导入小区数据 - - - 下载楼宇模板 - - - 下载小区模板 + + + 导入小区数据 + + + 导入楼宇数据 - - 下载房屋模板 - - - 下载楼宇模板 + + + 导入楼宇数据 + + 导入房屋数据 - + @click="handleExportModule('room')">下载房屋模板 + + + 导入房屋数据 + +
@@ -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);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名 + fileFormData.append('orgId', this.agencyObj.id);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名 + fileFormData.append('orgType', this.agencyObj.level === 'grid' ? 'grid' : 'agency');//filename是键,file是值,就是要传的文件,test.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 { diff --git a/src/views/modules/base/community/roomTable.vue b/src/views/modules/base/community/roomTable.vue index 44e0be77..41054abf 100644 --- a/src/views/modules/base/community/roomTable.vue +++ b/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);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名 + fileFormData.append('orgId', this.agencyObj.id);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名 + fileFormData.append('orgType', this.agencyObj.level);//filename是键,file是值,就是要传的文件,test.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' } }) }, diff --git a/src/views/modules/visual/communityGovern/distributionAnalyze.vue b/src/views/modules/visual/communityGovern/distributionAnalyze.vue index b2ef7685..206f3ca0 100644 --- a/src/views/modules/visual/communityGovern/distributionAnalyze.vue +++ b/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 = [] diff --git a/src/views/modules/visual/communityGovern/processAnalyze.vue b/src/views/modules/visual/communityGovern/processAnalyze.vue index c3ebd7a4..ebcb149d 100644 --- a/src/views/modules/visual/communityGovern/processAnalyze.vue +++ b/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) diff --git a/src/views/modules/visual/components/screen-map/index.vue b/src/views/modules/visual/components/screen-map/index.vue index df996b48..2786fdde 100644 --- a/src/views/modules/visual/components/screen-map/index.vue +++ b/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); From c0a5adc125195151eda439b1dc1f27715e420550 Mon Sep 17 00:00:00 2001 From: jiangyy Date: Wed, 16 Feb 2022 10:12:37 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=B0=8F=E5=8C=BA=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/base/community/buildTable.vue | 15 +++++++-------- .../modules/base/community/communityTable.vue | 12 +++++++----- src/views/modules/base/community/roomTable.vue | 6 +++--- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/views/modules/base/community/buildTable.vue b/src/views/modules/base/community/buildTable.vue index 70d61677..1c85aae0 100644 --- a/src/views/modules/base/community/buildTable.vue +++ b/src/views/modules/base/community/buildTable.vue @@ -377,10 +377,10 @@ export default { handleExportModule (type) { let title = '' - let url = "/gov/org/neighborhood/exporttemplate" + let url = "" if (type === 'building') { title = '楼宇导入模板' - url = '/gov/org/neighborhood/exporttemplate' + url = '/gov/org/building/exporttemplate' } else if (type === 'room') { title = '房屋导入模板' @@ -449,7 +449,8 @@ export default { if (type === 'building') { this.$refs['upload_building'].clearFiles() - url = 'http://192.168.51.26:8080/api/gov/org/building/buildingimport' + // url = 'http://192.168.51.26:8080/api/gov/org/building/buildingimport' + url = '/gov/org/building/buildingimport' } else if (type === 'room') { @@ -458,12 +459,10 @@ export default { url = '/gov/org/house/houseimport' } - - - + this.startLoading() window.app.ajax.post2(url, fileFormData, (data, rspMsg) => { - + this.endLoading() if (data.code === 0 || data.code > 8000) { // this.$message({ // type: "success", @@ -477,7 +476,7 @@ export default { } }, (rspMsg, data) => { - + this.endLoading() this.$message.error(rspMsg) }, { headers: { 'Content-Type': 'multipart/form-data' } }) diff --git a/src/views/modules/base/community/communityTable.vue b/src/views/modules/base/community/communityTable.vue index 3293431a..e475a5c0 100644 --- a/src/views/modules/base/community/communityTable.vue +++ b/src/views/modules/base/community/communityTable.vue @@ -402,18 +402,18 @@ export default { handleExportModule (type) { let title = '' - let url = "/gov/org/neighborhood/exporttemplate" + let url = "" if (type === 'community') { title = '小区导入模板' - url = '' + url = '/gov/org/neighborhood/exporttemplate' } else if (type === 'building') { title = '楼宇导入模板' - url = '' + url = '/gov/org/building/exporttemplate' } else if (type === 'room') { title = '房间导入模板' - url = '' + url = '/gov/org/house/exporttemplate' } let params = {} @@ -488,8 +488,10 @@ export default { url = '/gov/org/house/houseimport' } + this.startLoading() window.app.ajax.post2(url, fileFormData, (data, rspMsg) => { + this.endLoading() if (data.code === 0 || data.code > 8000) { // this.$message({ // type: "success", @@ -503,7 +505,7 @@ export default { } }, (rspMsg, data) => { - + this.endLoading() this.$message.error(rspMsg) }, { headers: { 'Content-Type': 'multipart/form-data' } }) diff --git a/src/views/modules/base/community/roomTable.vue b/src/views/modules/base/community/roomTable.vue index 41054abf..7addb7cf 100644 --- a/src/views/modules/base/community/roomTable.vue +++ b/src/views/modules/base/community/roomTable.vue @@ -424,10 +424,10 @@ export default { fileFormData.append('orgId', this.agencyObj.id);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名 fileFormData.append('orgType', this.agencyObj.level);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名 - + this.startLoading() window.app.ajax.post2(url, fileFormData, (data, rspMsg) => { - + this.endLoading() if (data.code === 0 || data.code > 8000) { // this.$message({ // type: "success", @@ -441,7 +441,7 @@ export default { } }, (rspMsg, data) => { - + this.endLoading() this.$message.error(rspMsg) }, { headers: { 'Content-Type': 'multipart/form-data' } })