Browse Source

社区治理

feature
jiangyy 4 years ago
parent
commit
f25ebb1a6f
  1. 4
      .env.development
  2. 4
      .env.production.sit
  3. 4
      public/index.html
  4. BIN
      src/assets/img/shuju/volunteer1.png
  5. BIN
      src/assets/img/shuju/volunteer2.png
  6. BIN
      src/assets/img/shuju/volunteer3.png
  7. BIN
      src/assets/img/shuju/volunteer4.png
  8. BIN
      src/assets/img/shuju/volunteer5.png
  9. BIN
      src/assets/img/shuju/volunteer6.png
  10. BIN
      src/assets/img/shuju/volunteer7.png
  11. BIN
      src/assets/img/shuju/volunteer8.png
  12. BIN
      src/assets/img/shuju/volunteer9.png
  13. 18
      src/assets/scss/modules/visual/distributionAnalyze.scss
  14. 27
      src/assets/scss/modules/visual/resibuzz.scss
  15. 24
      src/assets/scss/modules/visual/typeAnalyze.scss
  16. 239
      src/views/modules/visual/communityGovern/distributionAnalyze.vue
  17. 119
      src/views/modules/visual/communityGovern/processAnalyze.vue
  18. 135
      src/views/modules/visual/communityGovern/resibuzz.vue
  19. 136
      src/views/modules/visual/communityGovern/typeAnalyze.vue
  20. 35
      src/views/modules/visual/components/screen-map/index.vue
  21. 147
      src/views/modules/visual/measure/volunteer.vue

4
.env.development

@ -1,6 +1,6 @@
NODE_ENV=development NODE_ENV=development
VUE_APP_API_SERVER = https://epmet-test.elinkservice.cn/api # VUE_APP_API_SERVER = https://epmet-test.elinkservice.cn/api
# VUE_APP_API_SERVER = http://192.168.1.140/api VUE_APP_API_SERVER = http://192.168.1.140/api
# VUE_APP_API_SERVER = http://192.168.51.36:8080/api # VUE_APP_API_SERVER = http://192.168.51.36:8080/api
# VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn/api # VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn/api
VUE_APP_NODE_ENV=dev VUE_APP_NODE_ENV=dev

4
.env.production.sit

@ -1,5 +1,5 @@
NODE_ENV=production NODE_ENV=production
VUE_APP_API_SERVER = https://epmet-test.elinkservice.cn/api # VUE_APP_API_SERVER = https://epmet-test.elinkservice.cn/api
# VUE_APP_API_SERVER = http://192.168.1.140/api VUE_APP_API_SERVER = http://192.168.1.140/api
VUE_APP_NODE_ENV=prod:sit VUE_APP_NODE_ENV=prod:sit
VUE_APP_PUBLIC_PATH=epmet-oper VUE_APP_PUBLIC_PATH=epmet-oper

4
public/index.html

@ -36,8 +36,8 @@
<!-- 开发环境 --> <!-- 开发环境 -->
<% if (process.env.VUE_APP_NODE_ENV==='dev' ) { %> <% if (process.env.VUE_APP_NODE_ENV==='dev' ) { %>
<script> <script>
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.140/api' window.SITE_CONFIG['apiURL'] = 'http://192.168.1.140/api'
window.SITE_CONFIG['apiURL'] = 'https://epmet-test.elinkservice.cn/api' // window.SITE_CONFIG['apiURL'] = 'https://epmet-test.elinkservice.cn/api'
// window.SITE_CONFIG['apiURL'] = 'http://118.190.150.119:41080/api' // window.SITE_CONFIG['apiURL'] = 'http://118.190.150.119:41080/api'
// window.SITE_CONFIG['apiURL'] = 'https://epmet-dev.elinkservice.cn/api' // window.SITE_CONFIG['apiURL'] = 'https://epmet-dev.elinkservice.cn/api'
</script> </script>

BIN
src/assets/img/shuju/volunteer1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
src/assets/img/shuju/volunteer2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
src/assets/img/shuju/volunteer3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
src/assets/img/shuju/volunteer4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
src/assets/img/shuju/volunteer5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
src/assets/img/shuju/volunteer6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
src/assets/img/shuju/volunteer7.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
src/assets/img/shuju/volunteer8.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
src/assets/img/shuju/volunteer9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

18
src/assets/scss/modules/visual/distributionAnalyze.scss

@ -77,6 +77,7 @@
.el-range-input { .el-range-input {
color: #fff; color: #fff;
background: #06186d; background: #06186d;
margin-left: 10px;
} }
.el-range-separator { .el-range-separator {
color: #fff; color: #fff;
@ -191,3 +192,20 @@
} }
} }
} }
.table-status {
position: relative;
height: 300px;
// 暂无数据
.no-data {
&-img {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
}
}
}

27
src/assets/scss/modules/visual/resibuzz.scss

@ -66,35 +66,36 @@
flex-direction: row; flex-direction: row;
// flex-wrap: wrap; // flex-wrap: wrap;
// justify-content: center; // justify-content: center;
height: calc(100vh - 130px); height: calc(100vh - 180px);
.g-l { .g-l {
flex-shrink: 0; flex-shrink: 0;
width: 600px; width: 600px;
height: calc(100vh - 190px); height: calc(100vh - 180px);
} }
.g-r { .g-r {
text-align: center; text-align: center;
margin: 40px 19px 20px; margin: 40px 0 0 19px;
width: calc(100vw - 60px - 600px); width: calc(100vw - 60px - 600px);
height: calc(100vh - 140px - 20px); // height: calc(100vh - 170px - 20px);
} }
} }
.g-r { .g-r {
.tb { .m-tb {
position: relative; position: relative;
height: calc(100vh - 220px); height: 100%;
overflow-y: auto; .tb {
@include scrollBar; height: calc(100vh - 170px - 50px - 50px);
overflow-y: auto;
@include scrollBar;
}
.m-pagination { .m-pagination {
position: absolute;
box-sizing: border-box; box-sizing: border-box;
right: 0; position: absolute;
bottom: 0; right: 5px;
bottom: 5px;
width: 100%; width: 100%;
height: 40px; height: 40px;
display: flex; display: flex;

24
src/assets/scss/modules/visual/typeAnalyze.scss

@ -66,35 +66,37 @@
flex-direction: row; flex-direction: row;
// flex-wrap: wrap; // flex-wrap: wrap;
// justify-content: center; // justify-content: center;
height: calc(100vh - 130px); height: calc(100vh - 180px);
.g-l { .g-l {
flex-shrink: 0; flex-shrink: 0;
width: 600px; width: 600px;
height: calc(100vh - 190px); height: calc(100vh - 180px);
} }
.g-r { .g-r {
text-align: center; text-align: center;
margin: 40px 19px 20px; margin: 40px 0 0 19px;
width: calc(100vw - 60px - 600px); width: calc(100vw - 60px - 600px);
height: calc(100vh - 140px - 20px); // height: calc(100vh - 140px - 20px);
} }
} }
.g-r { .g-r {
.tb { .m-tb {
position: relative; position: relative;
height: calc(100vh - 220px); height: 100%;
overflow-y: auto; .tb {
@include scrollBar; height: calc(100vh - 170px - 50px - 50px);
overflow-y: auto;
@include scrollBar;
}
.m-pagination { .m-pagination {
position: absolute; position: absolute;
box-sizing: border-box; box-sizing: border-box;
right: 0; right: 5px;
bottom: 0; bottom: 5px;
width: 100%; width: 100%;
height: 40px; height: 40px;
display: flex; display: flex;

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

@ -15,8 +15,8 @@
:key="iscascaderShow" :key="iscascaderShow"
:options="casOptions" :options="casOptions"
:props="optionProps" :props="optionProps"
@change="handleChangeAgency" :show-all-levels="false"
clearable></el-cascader> @change="handleChangeAgency"></el-cascader>
</div> </div>
<div class="second-select"> <div class="second-select">
<el-date-picker v-model="timeRange" <el-date-picker v-model="timeRange"
@ -39,6 +39,17 @@
<screen-echarts-frame class="echart-line" <screen-echarts-frame class="echart-line"
@myChartMethod="lineInitOk" @myChartMethod="lineInitOk"
ref="lineChart"></screen-echarts-frame> ref="lineChart"></screen-echarts-frame>
<!-- <div class="table-status"
v-if="loading">
<screen-loading>加载中</screen-loading>
</div>
<div class="table-status"
v-if="lineList.length == 0 && !loading">
<div class="no-data">
<img src="../../../../assets/img/modules/visual/noData.png"
class="no-data-img" />
</div>
</div> -->
</div> </div>
<div class="g-r"> <div class="g-r">
@ -73,7 +84,8 @@ import screenEchartsFrame from "@/views/modules/visual/components/screen-echarts
import screenMap from "@/views/modules/visual/components/screen-map"; import screenMap from "@/views/modules/visual/components/screen-map";
import { lineOption } from './distributionLineOption.js' import { lineOption } from './distributionLineOption.js'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import nextTick from 'dai-js/tools/nextTick'
import ScreenLoading from "@/views/modules/visual/components/screen-loading";
export default { export default {
name: "HomeMap", name: "HomeMap",
@ -104,57 +116,57 @@ export default {
legend: [], legend: [],
lineData: [820, 932, 901, 934, 1290, 1330, 1320], lineData: [820, 932, 901, 934, 1290, 1330, 1320],
lineList: [ lineList: [
{ // {
time: '4:00', // time: '4:00',
categoryList: [ // categoryList: [
{ // {
categoryCode: '001', // categoryCode: '001',
count: 100, // count: 100,
color: '#1B51FF', // color: '#1B51FF',
name: '分类1' // name: '1'
}, // },
{ // {
categoryCode: '002', // categoryCode: '002',
count: 200, // count: 200,
color: '#00E5ED', // color: '#00E5ED',
name: '分类2' // name: '2'
} // }
] // ]
}, // },
{ // {
time: '5:00', // time: '5:00',
categoryList: [ // categoryList: [
{ // {
categoryCode: '001', // categoryCode: '001',
count: 20, // count: 20,
color: '#1B51FF', // color: '#1B51FF',
name: '分类1' // name: '1'
}, // },
{ // {
categoryCode: '002', // categoryCode: '002',
count: 400, // count: 400,
color: '#00E5ED', // color: '#00E5ED',
name: '分类2' // name: '2'
} // }
] // ]
}, // },
{ // {
time: '6:00', // time: '6:00',
categoryList: [ // categoryList: [
{ // {
categoryCode: '001', // categoryCode: '001',
count: 50, // count: 50,
color: '#1B51FF', // color: '#1B51FF',
name: '分类1' // name: '1'
}, // },
{ // {
categoryCode: '002', // categoryCode: '002',
count: 10, // count: 10,
color: '#00E5ED', // color: '#00E5ED',
name: '分类2' // name: '2'
} // }
] // ]
} // }
], ],
timeRange: [], timeRange: [],
@ -194,8 +206,10 @@ export default {
this.userId = this.uid; this.userId = this.uid;
this.initData() this.initData()
await this.getAgencylist()// await this.getAgencylist()//
await nextTick(500)
await this.loadOrgData() await this.loadOrgData()
this.getApiData(); await this.getApiData();
}, },
methods: { methods: {
@ -241,31 +255,46 @@ export default {
await this.loadMapData(); await this.loadMapData();
}, },
async getAgencylist () { //
const url = '/gov/org/customeragency/agencylist' getAgencylist () {
// const url = 'http://yapi.elinkservice.cn/mock/102/gov/org/agency/agencylist' const url = '/gov/org/customeragency/staffinagencylist'
let params = {}
window.app.ajax.post(
url,
params,
(data, rspMsg) => {
this.agencyInfo = data.agencyList
this.orgId = this.agencyInfo.agencyId
if (!this.agencyInfo.latitude) {
this.agencyInfo.latitude = 36.072227
}
if (!this.agencyInfo.longitude) {
this.agencyInfo.longitude = 120.389455
}
if (!this.agencyInfo.level) {
this.agencyInfo.level = 'street'
}
const params = { //
// customerId: '613cc61a6b8ce4c70d21bd413dac72cc' ++this.iscascaderShow
customerId: '0c41b272ee9ee95ac6f184ad548a30eb' this.casOptions = []
} this.agencyIdArray.length = []
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
++this.iscascaderShow
this.casOptions = []
this.agencyIdArray.length = []
if (data) { if (data.subAgencyList) {
this.casOptions.push(data) data.agencyList.subAgencyList = data.subAgencyList
this.casOptions.push(data.agencyList)
this.agencyIdArray.push(this.orgId)
}
},
(rspMsg, data) => {
this.$message.error(rspMsg)
} }
)
} else {
this.$message.error(msg)
}
}, },
handleChangeDate (value) { handleChangeDate (value) {
this.dateId = value this.dateId = value
this.getApiData() this.getApiData()
}, },
@ -283,16 +312,16 @@ export default {
if (code === 0) { if (code === 0) {
this.agencyInfo = data // this.agencyInfo = data
if (!data.latitude) { // if (!data.latitude) {
this.agencyInfo.latitude = 36.072227 // this.agencyInfo.latitude = 36.072227
} // }
if (!data.longitude) { // if (!data.longitude) {
this.agencyInfo.longitude = 120.389455 // this.agencyInfo.longitude = 120.389455
} // }
if (!data.level) { // if (!data.level) {
this.agencyInfo.level = 'street' // this.agencyInfo.level = 'street'
} // }
this.subAgencyArray = [] this.subAgencyArray = []
if (data.children && data.children.length > 0) { if (data.children && data.children.length > 0) {
this.subAgencyArray = data.children this.subAgencyArray = data.children
@ -307,12 +336,10 @@ export default {
}, },
async loadMapData () { async loadMapData () {
this.$refs.lineChart.clear()
const _that = this const _that = this
// this.$refs.lineChart.showLoading() // this.$refs.lineChart.showLoading()
// const url ="/gov/project/project/projectdistributionanalysisright"; const url = "/gov/project/project/projectdistributionanalysisright";
const url = "http://yapi.elinkservice.cn/mock/245/gov/project/project/projectdistributionanalysisright"; // const url = "http://yapi.elinkservice.cn/mock/245/gov/project/project/projectdistributionanalysisright";
let params = { let params = {
orgId: this.orgId, orgId: this.orgId,
startDate: this.timeRange.length > 0 && this.timeRange[0] || '', startDate: this.timeRange.length > 0 && this.timeRange[0] || '',
@ -349,7 +376,7 @@ export default {
) )
} }
if (data.list && data.list.length > 0) { if (data.list && data.list.length > 0) {
// this.mapList = data.list this.mapList = data.list
} else { } else {
@ -357,7 +384,7 @@ export default {
} }
this.mapList.forEach(item => { this.mapList.forEach(item => {
// debugger
for (let i = 0; i < this.subAgencyArray.length; i++) { for (let i = 0; i < this.subAgencyArray.length; i++) {
let agencyItem = this.subAgencyArray[i] let agencyItem = this.subAgencyArray[i]
if (item.orgId === agencyItem.id) { if (item.orgId === agencyItem.id) {
@ -409,10 +436,7 @@ export default {
} }
}, },
lineInitOk (dom) { lineInitOk (dom) {
this.lineInitState = true this.lineInitState = true
}, },
@ -428,11 +452,10 @@ export default {
// 线 // 线
async getLineChart () { async getLineChart () {
this.$refs.lineChart.clear() this.$refs.lineChart.clear()
const _that = this const _that = this
// this.$refs.lineChart.showLoading() this.$refs.lineChart.showLoading()
// const url ="/gov/project/project/projectdistributionanalysisleft"; const url = "/gov/project/project/projectdistributionanalysisleft";
const url = "http://yapi.elinkservice.cn/mock/245/gov/project/project/projectdistributionanalysisleft"; // const url = "http://yapi.elinkservice.cn/mock/245/gov/project/project/projectdistributionanalysisleft";
let params = { let params = {
orgId: this.orgId, orgId: this.orgId,
startDate: this.timeRange.length > 0 && this.timeRange[0] || '', startDate: this.timeRange.length > 0 && this.timeRange[0] || '',
@ -440,24 +463,27 @@ export default {
}; };
const { data, code, msg } = await requestPost(url, params); const { data, code, msg } = await requestPost(url, params);
this.$refs.lineChart.hideLoading()
if (code === 0) { if (code === 0) {
// pieChart // pieChart
this.lineOption = lineOption() this.lineOption = lineOption()
if (data && data.length > 0) { if (data && data.length > 0) {
this.lineList = data
this.loadCategoryData() this.loadCategoryData()
} else {
this.$refs.lineChart.setOption(this.lineOption, true)
this.$refs.lineChart.setOption({
xAxis: { data: this.xaxis },
legend: { data: this.legend },
series: this.series
}, true)
} else {
this.lineList = []
} }
this.$refs.lineChart.setOption(this.lineOption, true)
this.$refs.lineChart.setOption({
xAxis: { data: this.xaxis },
legend: { data: this.legend },
series: this.series
}, true)
} else { } else {
@ -548,7 +574,8 @@ export default {
cptCard, cptCard,
cptTb, cptTb,
screenEchartsFrame, screenEchartsFrame,
screenMap screenMap,
ScreenLoading
}, },
watch: { watch: {

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

@ -12,17 +12,17 @@
:key="iscascaderShow" :key="iscascaderShow"
:options="casOptions" :options="casOptions"
:props="optionProps" :props="optionProps"
@change="handleChangeAgency" :show-all-levels="false"
clearable></el-cascader> @change="handleChangeAgency"></el-cascader>
</div> </div>
<div class="second-select"> <div class="second-select">
<el-date-picker v-model="dateId" <el-date-picker v-model="dateIdShow"
type="date" type="date"
:clearable="false" :clearable="false"
@change="handleChangeDate" @change="handleChangeDate"
prefix-icon="el-icon-caret-bottom" prefix-icon="el-icon-caret-bottom"
placeholder="选择日期" placeholder="选择日期"
value-format="yyyyMMdd"> value-format="yyyy-MM-dd">
</el-date-picker> </el-date-picker>
</div> </div>
</div> </div>
@ -108,6 +108,7 @@ import screenMap from "@/views/modules/visual/components/screen-map";
import { pieOption } from './processPieOption.js' import { pieOption } from './processPieOption.js'
import { lineOption } from './processLineOption.js' import { lineOption } from './processLineOption.js'
import nextTick from 'dai-js/tools/nextTick'
export default { export default {
@ -156,6 +157,7 @@ export default {
], ],
dateId: '', dateId: '',
dateIdShow: '',
agencyId: '', agencyId: '',
status: 'pending',//: pendingclosed status: 'pending',//: pendingclosed
agencyInfo: {}, agencyInfo: {},
@ -225,16 +227,26 @@ export default {
async mounted () { async mounted () {
this.userId = this.uid; this.userId = this.uid;
this.initData() this.initData()
await this.getWorkUserInfo()
// this.agencyInfo = this.$store.state.user
// this.agencyId = this.agencyInfo.agencyId
// await this.getWorkUserInfo()
await this.getAgencylist()// await this.getAgencylist()//
this.getApiData(); await nextTick(500)
await this.getApiData();
}, },
methods: { methods: {
initData () { initData () {
var time = (new Date).getTime() - 24 * 60 * 60 * 1000; var time = (new Date).getTime() - 24 * 60 * 60 * 1000;
this.dateId = new Date(time); // var nowdate = new Date(time); //
var y = nowdate.getFullYear();
var m = nowdate.getMonth() + 1 < 10 ? "0" + (nowdate.getMonth() + 1) : nowdate.getMonth() + 1;
var d = nowdate.getDate() < 10 ? "0" + nowdate.getDate() : nowdate.getDate();
this.dateIdShow = y + '-' + m + '-' + d;
}, },
async getApiData () { async getApiData () {
@ -245,29 +257,41 @@ export default {
}, },
handleChangeDate (value) { handleChangeDate (value) {
this.dateId = value this.dateIdShow = value
this.getApiData() this.getApiData()
}, },
// //
getWorkUserInfo () { getAgencylist () {
const url = '/epmetuser/customerstaff/staffbasicinfo' const url = '/gov/org/customeragency/agencygridtree'
let params = {} let params = {}
window.app.ajax.post( window.app.ajax.post(
url, url,
params, params,
(data, rspMsg) => { (data, rspMsg) => {
this.agencyInfo = data this.agencyInfo = data
if (!data.latitude) { this.agencyId = this.agencyInfo.agencyId
if (!this.agencyInfo.latitude) {
this.agencyInfo.latitude = 36.072227 this.agencyInfo.latitude = 36.072227
} }
if (!data.longitude) { if (!this.agencyInfo.longitude) {
this.agencyInfo.longitude = 120.389455 this.agencyInfo.longitude = 120.389455
} }
if (!data.level) { if (!this.agencyInfo.level) {
this.agencyInfo.level = 'street' this.agencyInfo.level = 'street'
} }
//
++this.iscascaderShow
this.casOptions = []
this.agencyIdArray.length = []
if (data) {
this.casOptions.push(data)
this.agencyIdArray.push(this.agencyId)
}
}, },
(rspMsg, data) => { (rspMsg, data) => {
this.$message.error(rspMsg) this.$message.error(rspMsg)
@ -276,41 +300,19 @@ export default {
}, },
async getAgencylist () {
const url = '/gov/org/customeragency/agencylist'
// const url = 'http://yapi.elinkservice.cn/mock/102/gov/org/agency/agencylist'
const params = {
// customerId: '613cc61a6b8ce4c70d21bd413dac72cc'
customerId: '0c41b272ee9ee95ac6f184ad548a30eb'
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
++this.iscascaderShow
this.casOptions = []
this.agencyIdArray.length = []
if (data) {
this.casOptions.push(data)
}
} else {
this.$message.error(msg)
}
},
// //
async getProjectTotal () { async getProjectTotal () {
// const url = "/data/aggregator/project/projecttotal"; this.$refs.pieChart.showLoading()
const url = "http://yapi.elinkservice.cn/mock/245/data/aggregator/project/projecttotal"; const url = "/data/aggregator/project/projecttotal";
// const url = "http://yapi.elinkservice.cn/mock/245/data/aggregator/project/projecttotal";
let params = { let params = {
agencyId: '', agencyId: this.agencyId,
dateId: this.dateId, dateId: this.dateId,
}; };
const { data, code, msg } = await requestPost(url, params); const { data, code, msg } = await requestPost(url, params);
this.$refs.pieChart.hideLoading()
if (code === 0) { if (code === 0) {
this.projectTotal = data.projectTotal this.projectTotal = data.projectTotal
this.dateIncr = data.dateIncr this.dateIncr = data.dateIncr
@ -339,10 +341,10 @@ export default {
// //
async loadProjectlist () { async loadProjectlist () {
// const url = "/data/aggregator/project/projectstatuslist"; const url = "/data/aggregator/project/projectstatuslist";
const url = "http://yapi.elinkservice.cn/mock/245/data/aggregator/project/projectstatuslist"; // const url = "http://yapi.elinkservice.cn/mock/245/data/aggregator/project/projectstatuslist";
let params = { let params = {
agencyId: '', agencyId: this.agencyId,
dateId: this.dateId, dateId: this.dateId,
status: this.status status: this.status
}; };
@ -352,13 +354,13 @@ export default {
if (code === 0) { if (code === 0) {
// this.projectList = [...data] this.projectList = [...data]
if (this.status === 'closed') { // if (this.status === 'closed') {
this.projectList = this.projectList1 // this.projectList = this.projectList1
} else { // } else {
this.projectList = this.projectList2 // this.projectList = this.projectList2
} // }
this.projectList.forEach(item => { this.projectList.forEach(item => {
item.values_ = { item.values_ = {
name: item.title name: item.title
@ -410,7 +412,7 @@ export default {
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) this.$refs.map.loadMap(this.agencyInfo, null, null, this.projectList, this.iconUrlArray, this.iconTextStyle, 3000)
} else { } else {
this.$refs.map.refreshMap(null, this.projectList) this.$refs.map.refreshMap(null, this.projectList)
@ -446,18 +448,18 @@ export default {
// 线 // 线
async getLineChart () { async getLineChart () {
this.$refs.lineChart.clear() this.$refs.lineChart.clear()
this.$refs.lineChart.showLoading()
const _that = this const _that = this
// this.$refs.pieChart.showLoading() // this.$refs.pieChart.showLoading()
// const url ="/data/aggregator/project/projectmonthincr"; const url = "/data/aggregator/project/projectmonthincr";
const url = "http://yapi.elinkservice.cn/mock/245/data/aggregator/project/projectmonthincr"; // const url = "http://yapi.elinkservice.cn/mock/245/data/aggregator/project/projectmonthincr";
let params = { let params = {
agencyId: this.agencyId, agencyId: this.agencyId,
dateId: this.dateId, dateId: this.dateId,
}; };
const { data, code, msg } = await requestPost(url, params); const { data, code, msg } = await requestPost(url, params);
this.$refs.lineChart.hideLoading()
if (code === 0) { if (code === 0) {
// pieChart // pieChart
this.lineOption = lineOption() this.lineOption = lineOption()
@ -504,7 +506,7 @@ export default {
this.$refs.pieChart.clear() this.$refs.pieChart.clear()
this.pieTotal = 0 this.pieTotal = 0
const _that = this const _that = this
// this.$refs.pieChart.showLoading()
// pieChart // pieChart
this.pieOption = pieOption(this.pieChartS) this.pieOption = pieOption(this.pieChartS)
@ -597,6 +599,11 @@ export default {
}, },
watch: { watch: {
dateIdShow () {
let dataArray = this.dateIdShow.split('-')
this.dateId = dataArray.join('')
},
uid (id) { uid (id) {
this.userId = id; this.userId = id;
}, },

135
src/views/modules/visual/communityGovern/resibuzz.vue

@ -12,8 +12,8 @@
:key="iscascaderShow" :key="iscascaderShow"
:options="casOptions" :options="casOptions"
:props="optionProps" :props="optionProps"
@change="handleChangeAgency" :show-all-levels="false"
clearable></el-cascader> @change="handleChangeAgency"></el-cascader>
</div> </div>
<div class="second-select status-select"> <div class="second-select status-select">
<el-select v-model="status" <el-select v-model="status"
@ -45,17 +45,16 @@
:header="demand.header" :header="demand.header"
:list="demand.list"></cpt-tb> :list="demand.list"></cpt-tb>
<div class="m-pagination">
<el-pagination :current-page="demand.pageNo"
:page-size="demand.pageSize"
:total="demand.total"
background
layout="prev, pager, next"
@current-change="handlePageNoChange_demand">
</el-pagination>
</div>
</div> </div>
<div class="m-pagination">
<el-pagination :current-page="demand.pageNo"
:page-size="demand.pageSize"
:total="demand.total"
background
layout="prev, pager, next"
@current-change="handlePageNoChange_demand">
</el-pagination>
</div>
</div> </div>
</div> </div>
@ -71,6 +70,7 @@ import cptTb from "@/views/modules/visual/cpts/tb";
import screenEchartsFrame from "@/views/modules/visual/components/screen-echarts-frame"; import screenEchartsFrame from "@/views/modules/visual/components/screen-echarts-frame";
import { pieOption } from './resiPieOption.js' import { pieOption } from './resiPieOption.js'
import nextTick from 'dai-js/tools/nextTick'
export default { export default {
@ -121,6 +121,7 @@ export default {
status: 'all', status: 'all',
orgId: '', orgId: '',
orgTypeSel: '',
demand: { demand: {
loading: true, loading: true,
colList: [ colList: [
@ -184,7 +185,7 @@ export default {
optionProps: { optionProps: {
multiple: false, multiple: false,
value: 'agencyId', value: 'orgLevel',
label: 'agencyName', label: 'agencyName',
children: 'subAgencyList', children: 'subAgencyList',
checkStrictly: true checkStrictly: true
@ -199,41 +200,60 @@ export default {
async mounted () { async mounted () {
this.userId = this.uid; this.userId = this.uid;
await this.getAgencylist()//
await nextTick(500)
this.getApiData(); this.getApiData();
}, },
methods: { methods: {
async getApiData () { async getApiData () {
await this.getAgencylist()//
await this.getPie() await this.getPie()
await this.getTable(); await this.getTable();
}, },
async getAgencylist () { //
const url = '/gov/org/customeragency/agencylist' getAgencylist () {
// const url = 'http://yapi.elinkservice.cn/mock/102/gov/org/agency/agencylist' const url = '/gov/org/customeragency/agencygridtree'
let params = {}
window.app.ajax.post(
url,
params,
(data, rspMsg) => {
this.agencyInfo = data
this.orgId = this.agencyInfo.agencyId
this.orgType = this.agencyInfo.level === 'grid' ? 'grid' : 'agency'
if (!this.agencyInfo.latitude) {
this.agencyInfo.latitude = 36.072227
}
if (!this.agencyInfo.longitude) {
this.agencyInfo.longitude = 120.389455
}
if (!this.agencyInfo.level) {
this.agencyInfo.level = 'street'
}
const params = { //
// customerId: '613cc61a6b8ce4c70d21bd413dac72cc' ++this.iscascaderShow
customerId: '0c41b272ee9ee95ac6f184ad548a30eb' this.casOptions = []
} this.agencyIdArray.length = []
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
++this.iscascaderShow
this.casOptions = []
this.agencyIdArray.length = []
if (data) { if (data) {
this.casOptions.push(data) this.casOptions.push(data)
this.agencyIdArray.push(this.agencyInfo.orgLevel)
}
},
(rspMsg, data) => {
this.$message.error(rspMsg)
} }
)
} else {
this.$message.error(msg)
}
}, },
pieInitOk (dom) { pieInitOk (dom) {
console.log('pie准备好了', dom) console.log('pie准备好了', dom)
this.pieChartS = dom this.pieChartS = dom
@ -255,22 +275,21 @@ export default {
this.pieTotal = 0 this.pieTotal = 0
const _that = this const _that = this
// this.$refs.pieChart.showLoading() // this.$refs.pieChart.showLoading()
// const url ="/gov/issue/issue/resibuzz-leftpiechart"; const url = "/gov/issue/issue/resibuzz-leftpiechart";
const url = "http://yapi.elinkservice.cn/mock/245/gov/issue/issue/resibuzz-leftpiechart"; // const url = "http://yapi.elinkservice.cn/mock/245/gov/issue/issue/resibuzz-leftpiechart";
let params = { let params = {
orgId: this.orgId, orgId: this.orgId,
orgType: this.orgType,
}; };
const { data, code, msg } = await requestPost(url, params); const { data, code, msg } = await requestPost(url, params);
// pieChart
if (code === 0) { if (code === 0) {
// pieChart // pieChart
this.pieOption = pieOption(this.pieChartS) this.pieOption = pieOption(this.pieChartS)
if (data && data.length > 0) { if (data && data.length > 0) {
// this.pieData = data this.pieData = data
} else { } else {
this.pieData = [{ count: 0, categoryName: '无分类', color: '#00E5ED' }] this.pieData = [{ count: 0, categoryName: '无分类', color: '#00E5ED' }]
@ -359,19 +378,29 @@ export default {
}, },
handleChangeAgency (value) { handleChangeAgency (value) {
console.log(value) let orgArray = []
this.agencyName = this.$refs["myCascader"].getCheckedNodes()[0].label let key = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : ''
this.orgId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '' if (key) {
console.log(this.agencyIdArray) orgArray = key.split('-')
this.orgId = orgArray[0]
this.orgType = orgArray[1]
} else {
this.orgId = ''
this.orgType = ''
}
this.getApiData()
}, },
// //
async getTable () { async getTable () {
// const url = "/gov/issue/issue/resibuzz"; const url = "/gov/issue/issue/resibuzz";
const url = "http://yapi.elinkservice.cn/mock/245/gov/issue/issue/resibuzz"; // const url = "http://yapi.elinkservice.cn/mock/245/gov/issue/issue/resibuzz";
let params = { let params = {
status: this.status, status: this.status,
orgId: this.orgId, orgId: this.orgId,
orgType: this.orgType,
pageNo: this.demand.pageNo, pageNo: this.demand.pageNo,
pageSize: this.demand.pageSize, pageSize: this.demand.pageSize,
}; };
@ -384,15 +413,15 @@ export default {
this.demand.list = data.list.map((item) => { this.demand.list = data.list.map((item) => {
return [ return [
{ type: "index" }, { type: "index" },
item.issueTitle, item.issueTitle ? item.issueTitle : '',
item.suggestion, item.suggestion ? item.suggestion : '',
item.categoryName, item.categoryName.join(','),
item.status, item.status ? item.status : '',
item.createdTime, item.createdTime ? item.createdTime : '',
item.issueOriginator, item.issueOriginator ? item.issueOriginator : '',
item.voteAccount, item.voteAccount ? item.voteAccount : '',
item.supportCount, item.supportCount ? item.supportCount : '',
item.oppositionCount, item.oppositionCount ? item.oppositionCount : '',
{ type: "operate", list: ["查看"] }, { type: "operate", list: ["查看"] },
]; ];
}); });

136
src/views/modules/visual/communityGovern/typeAnalyze.vue

@ -12,18 +12,18 @@
:key="iscascaderShow" :key="iscascaderShow"
:options="casOptions" :options="casOptions"
:props="optionProps" :props="optionProps"
@change="handleChangeAgency" :show-all-levels="false"
clearable></el-cascader> @change="handleChangeAgency"></el-cascader>
</div> </div>
<div class="second-select "> <div class="second-select ">
<el-date-picker v-model="dateId" <el-date-picker v-model="dateIdShow"
type="date" type="date"
:clearable="false" :clearable="false"
@change="handleChangeDate" @change="handleChangeDate"
prefix-icon="el-icon-caret-bottom" prefix-icon="el-icon-caret-bottom"
placeholder="选择日期" placeholder="选择日期"
value-format="yyyyMMdd"> value-format="yyyy-MM-dd">
</el-date-picker> </el-date-picker>
</div> </div>
@ -45,15 +45,16 @@
:header="demand.header" :header="demand.header"
:list="demand.list"></cpt-tb> :list="demand.list"></cpt-tb>
<div class="m-pagination"> </div>
<el-pagination :current-page="demand.pageNo"
:page-size="demand.pageSize" <div class="m-pagination">
:total="demand.total" <el-pagination :current-page="demand.pageNo"
background :page-size="demand.pageSize"
layout="prev, pager, next" :total="demand.total"
@current-change="handlePageNoChange_demand"> background
</el-pagination> layout="prev, pager, next"
</div> @current-change="handlePageNoChange_demand">
</el-pagination>
</div> </div>
</div> </div>
@ -71,7 +72,7 @@ import cptTb from "@/views/modules/visual/cpts/tb";
import screenEchartsFrame from "@/views/modules/visual/components/screen-echarts-frame"; import screenEchartsFrame from "@/views/modules/visual/components/screen-echarts-frame";
import { pieOption } from './typePieOption.js' import { pieOption } from './typePieOption.js'
import nextTick from 'dai-js/tools/nextTick'
export default { export default {
name: "HomeMap", name: "HomeMap",
@ -100,6 +101,7 @@ export default {
{ total: 300, categoryName: '街道安全', color: '#FAC126' } { total: 300, categoryName: '街道安全', color: '#FAC126' }
], ],
dateIdShow: '',
agencyId: '', agencyId: '',
dateId: '', dateId: '',
categoryCode: '', categoryCode: '',
@ -160,6 +162,7 @@ export default {
multiple: false, multiple: false,
value: 'agencyId', value: 'agencyId',
label: 'agencyName', label: 'agencyName',
orgType: 'orgType',
children: 'subAgencyList', children: 'subAgencyList',
checkStrictly: true checkStrictly: true
}, },
@ -175,48 +178,62 @@ export default {
this.userId = this.uid; this.userId = this.uid;
this.initData() this.initData()
await this.getAgencylist()// await this.getAgencylist()//
this.getApiData(); await nextTick(500)
await this.getPie()
}, },
methods: { methods: {
initData () { initData () {
var time = (new Date).getTime() - 24 * 60 * 60 * 1000; var time = (new Date).getTime() - 24 * 60 * 60 * 1000;
this.dateId = new Date(time); // var nowdate = new Date(time); //
var y = nowdate.getFullYear();
var m = nowdate.getMonth() + 1 < 10 ? "0" + (nowdate.getMonth() + 1) : nowdate.getMonth() + 1;
var d = nowdate.getDate() < 10 ? "0" + nowdate.getDate() : nowdate.getDate();
this.dateIdShow = y + '-' + m + '-' + d;
}, },
async getApiData () {
await this.getPie() //
await this.getTable(); getAgencylist () {
}, const url = '/gov/org/customeragency/agencygridtree'
let params = {}
window.app.ajax.post(
url,
params,
(data, rspMsg) => {
this.agencyInfo = data
this.agencyId = this.agencyInfo.agencyId
if (!this.agencyInfo.latitude) {
this.agencyInfo.latitude = 36.072227
}
if (!this.agencyInfo.longitude) {
this.agencyInfo.longitude = 120.389455
}
if (!this.agencyInfo.level) {
this.agencyInfo.level = 'street'
}
async getAgencylist () { //
const url = '/gov/org/customeragency/agencylist' ++this.iscascaderShow
// const url = 'http://yapi.elinkservice.cn/mock/102/gov/org/agency/agencylist' this.casOptions = []
this.agencyIdArray.length = []
const params = { if (data) {
// customerId: '613cc61a6b8ce4c70d21bd413dac72cc' this.casOptions.push(data)
customerId: '0c41b272ee9ee95ac6f184ad548a30eb' this.agencyIdArray.push(this.agencyId)
} }
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
++this.iscascaderShow
this.casOptions = []
this.agencyIdArray.length = []
if (data) { },
this.casOptions.push(data) (rspMsg, data) => {
this.$message.error(rspMsg)
} }
)
} else {
this.$message.error(msg)
}
}, },
handleChangeDate (value) { handleChangeDate (value) {
this.dateIdShow = value
this.dateId = value this.getPie()
this.getApiData()
}, },
@ -241,8 +258,8 @@ export default {
this.pieTotal = 0 this.pieTotal = 0
const _that = this const _that = this
// this.$refs.pieChart.showLoading() // this.$refs.pieChart.showLoading()
// const url ="/data/aggregator/project/projectcategorylist"; const url = "/data/aggregator/project/projectcategorylist";
const url = "http://yapi.elinkservice.cn/mock/245/data/aggregator/project/projectcategorylist"; // const url = "http://yapi.elinkservice.cn/mock/245/data/aggregator/project/projectcategorylist";
let params = { let params = {
agencyId: this.agencyId, agencyId: this.agencyId,
dateId: this.dateId, dateId: this.dateId,
@ -255,7 +272,7 @@ export default {
// pieChart // pieChart
this.pieOption = pieOption(this.pieChartS) this.pieOption = pieOption(this.pieChartS)
if (data && data.length > 0) { if (data && data.length > 0) {
// this.pieData = data this.pieData = data
} else { } else {
this.pieData = [{ total: 0, categoryName: '无分类', color: '#00E5ED' }] this.pieData = [{ total: 0, categoryName: '无分类', color: '#00E5ED' }]
@ -274,14 +291,13 @@ export default {
maxValue = item.value maxValue = item.value
maxIndex = index maxIndex = index
item.selected = true item.selected = true
this.categoryCode = item.categoryCode
} else if (index !== 0) { } else if (index !== 0) {
item.selected = false item.selected = false
} }
}); });
this.pieOption.title.text = this.pieTotal this.pieOption.title.text = this.pieTotal
this.pieOption.series[1].itemStyle = { this.pieOption.series[1].itemStyle = {
color: function (params) { color: function (params) {
@ -293,8 +309,6 @@ export default {
let fun = function (params) { let fun = function (params) {
_that.clickPie(params.dataIndex) _that.clickPie(params.dataIndex)
_that.categoryCode = _that.pieData[params.dataIndex].categoryCode
_that.getTable()
} }
this.$refs.pieChart.handleClick(fun) this.$refs.pieChart.handleClick(fun)
this.clickPie(maxIndex) this.clickPie(maxIndex)
@ -304,7 +318,7 @@ export default {
}, },
clickPie (seriesIndex) { async clickPie (seriesIndex) {
this.pieData.forEach((element, index) => { this.pieData.forEach((element, index) => {
if (index === seriesIndex) { if (index === seriesIndex) {
element.label = { element.label = {
@ -340,20 +354,22 @@ export default {
// this.$refs.pieChart.hideLoading() // this.$refs.pieChart.hideLoading()
this.$refs.pieChart.setOption(this.pieOption) this.$refs.pieChart.setOption(this.pieOption)
this.categoryCode = this.pieData[seriesIndex].categoryCode
this.getTable()
}, },
handleChangeAgency (value) { handleChangeAgency (value) {
this.agencyName = this.$refs["myCascader"].getCheckedNodes()[0].label this.agencyName = this.$refs["myCascader"].getCheckedNodes()[0].label
this.agencyId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '' this.agencyId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : ''
this.getApiData() this.getPie()
console.log(this.agencyIdArray) console.log(this.agencyIdArray)
}, },
// //
async getTable () { async getTable () {
// const url = "/data/aggregator/project/categoryprojectlist"; const url = "/data/aggregator/project/categoryprojectlist";
const url = "http://yapi.elinkservice.cn/mock/245/data/aggregator/project/categoryprojectlist"; // const url = "http://yapi.elinkservice.cn/mock/245/data/aggregator/project/categoryprojectlist";
let params = { let params = {
dateId: this.dateId, dateId: this.dateId,
agencyId: this.agencyId, agencyId: this.agencyId,
@ -375,13 +391,13 @@ export default {
item.statusShow = item.status === 'pending' ? '待处理' : '已结案' item.statusShow = item.status === 'pending' ? '待处理' : '已结案'
return [ return [
{ type: "index" }, { type: "index" },
item.projectCode, item.projectCode ? item.projectCode : '',
item.categoryNames.join(','), item.categoryNames.join(','),
item.originShow, item.originShow ? item.originShow : '',
item.gridName, item.gridName ? item.gridName : '',
item.statusShow, item.statusShow ? item.statusShow : '',
item.title, item.title ? item.title : '',
item.time, item.time ? item.time : '',
{ type: "operate", list: ["查看"] }, { type: "operate", list: ["查看"] },
]; ];
}); });
@ -415,11 +431,15 @@ export default {
}, },
watch: { watch: {
dateIdShow () {
let dataArray = this.dateIdShow.split('-')
this.dateId = dataArray.join('')
},
uid (id) { uid (id) {
this.userId = id; this.userId = id;
}, },
userId () { userId () {
this.getApiData(); this.getPie()
window.scrollTo(0, 0); window.scrollTo(0, 0);
}, },
}, },

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

@ -24,6 +24,7 @@ import { defaults as defaultInteractions, Select, DoubleClickZoom } from 'ol/int
import { getCenter, boundingExtent } from 'ol/extent.js'; import { getCenter, boundingExtent } from 'ol/extent.js';
import { Circle as CircleStyle, Icon, Fill, Stroke, Style, Text } from 'ol/style.js'; import { Circle as CircleStyle, Icon, Fill, Stroke, Style, Text } from 'ol/style.js';
import { altKeyOnly, click, pointerMove } from 'ol/events/condition'; import { altKeyOnly, click, pointerMove } from 'ol/events/condition';
import { getDistance } from 'ol/sphere';
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import { Loading } from 'element-ui'; //Loading import { Loading } from 'element-ui'; //Loading
@ -134,6 +135,7 @@ const vueGis = {
//icon //icon
iconUrlArray: [], iconUrlArray: [],
iconTextColor: '#ffffff', iconTextColor: '#ffffff',
distanceMax: null,//
} }
}, },
@ -143,13 +145,14 @@ const vueGis = {
}, },
methods: { methods: {
//:icon //:icon
loadMap (mapInfo, polygonArray, polIconUrlArray, iconArrays, iconUrlArray, iconTextStyle) { loadMap (mapInfo, polygonArray, polIconUrlArray, iconArrays, iconUrlArray, iconTextStyle, distanceMax) {
this.mapInfo = mapInfo this.mapInfo = mapInfo
this.polygonArray = polygonArray this.polygonArray = polygonArray
this.polIconUrlArray = polIconUrlArray this.polIconUrlArray = polIconUrlArray
this.iconArrays = iconArrays this.iconArrays = iconArrays
this.iconUrlArray = iconUrlArray this.iconUrlArray = iconUrlArray
this.iconTextStyle = iconTextStyle this.iconTextStyle = iconTextStyle
this.distanceMax = distanceMax
// //
this.initMap() this.initMap()
@ -302,11 +305,12 @@ const vueGis = {
//icon //icon
loadIcon () { loadIcon () {
iconSource.clear()// iconSource.clear()//
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 urlNum = this.getRndBetween(1, 3)
// //
let iconItem = new Feature({ let iconItem = new Feature({
geometry: new Point([oneIcon.longitude, oneIcon.latitude]), geometry: new Point([oneIcon.longitude, oneIcon.latitude]),
@ -328,7 +332,16 @@ const vueGis = {
}); });
iconItem.setStyle(iconStyle); iconItem.setStyle(iconStyle);
iconFeatures.push(iconItem); if (this.distanceMax) {
if (this.computedDistance(oneIcon.longitude, oneIcon.latitude, this.distanceMax)) {
iconFeatures.push(iconItem);
}
} else {
iconFeatures.push(iconItem);
}
}); });
@ -349,6 +362,22 @@ const vueGis = {
}, },
//
computedDistance (lon, lat, max) {
let c1 = [2]; c1[0] = lon; c1[1] = lat;
let distance = getDistance(this.centerPoint, c1);
console.log(distance)
return (distance < max || distance === max)
// debugger
// return
// var wgs84Sphere = new ol.Sphere(6378137);
// wgs84Sphere.haversineDistance([120.21592590991689, 30.210793016606],[120.21670777384473, 30.211168525868086]);
},
// //
initMap () { initMap () {
this.setMapLocation() this.setMapLocation()

147
src/views/modules/visual/measure/volunteer.vue

@ -72,26 +72,16 @@
</div> </div>
<div class="map-tips"> <div class="map-tips">
<div class="map-tips-item">
<div class="map-tips-icon"></div> <div class="map-tips-item"
<div class="map-tips-label">调解员</div> v-for="item in legendArray"
</div> :key="item.optionValue">
<div class="map-tips-item">
<div class="map-tips-icon"></div> <img class="title-icon"
<div class="map-tips-label">调解员</div> :src="item.url" />
</div> <div class="map-tips-label">{{item.optionLabel}}</div>
<div class="map-tips-item">
<div class="map-tips-icon"></div>
<div class="map-tips-label">能人达人</div>
</div>
<div class="map-tips-item">
<div class="map-tips-icon"></div>
<div class="map-tips-label">治安巡逻</div>
</div>
<div class="map-tips-item">
<div class="map-tips-icon"></div>
<div class="map-tips-label">代办员</div>
</div> </div>
</div> </div>
<div class="card-map"> <div class="card-map">
@ -148,44 +138,20 @@ export default {
// //
isfirstInit: true,// isfirstInit: true,//
agencyInfo: {},//level agencyInfo: {},//level
unitMapList: [], distributionsList: [],
unitMapList1: [
{ legendArray: [],
type: '党建楼宇',
name: '建联单位1', iconUrlArray: [
latitude: 36.062227, require('../../../../assets/img/shuju/volunteer1.png'),//
longitude: 120.389455, require('../../../../assets/img/shuju/volunteer2.png'),//
}, require('../../../../assets/img/shuju/volunteer3.png'),//
{ require('../../../../assets/img/shuju/volunteer4.png'),//
type: '党建楼宇', require('../../../../assets/img/shuju/volunteer5.png'),//
name: '建联单位2', require('../../../../assets/img/shuju/volunteer6.png'),//
latitude: 36.082227, require('../../../../assets/img/shuju/volunteer7.png'),//
longitude: 120.389455, require('../../../../assets/img/shuju/volunteer8.png'),//
}, require('../../../../assets/img/shuju/volunteer9.png'),//
{
type: '机关直属部门',
name: '建联单位3',
latitude: 36.062227,
longitude: 120.379455,
},
{
type: '两新党建',
name: '建联单位4',
latitude: 36.082227,
longitude: 120.379455,
},
{
type: '辖区单位',
name: '建联单位5',
latitude: 36.092227,
longitude: 120.379455,
},
{
type: '其他',
name: '建联单位6',
latitude: 36.102227,
longitude: 120.379455,
}
], ],
}; };
}, },
@ -427,49 +393,58 @@ export default {
}, },
// //
async getMapUnitList () { async getMapUnitList () {
// const url = "/heart/icpartyunit/distribution" const url = "/epmetuser/volunteer/distribution"
const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/distribution" // const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/distribution"
let params = { let params = {
agencyId: this.$store.state.user.agencyId customerId: this.$store.state.user.customerId
} }
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)
if (code === 0) { if (code === 0) {
// this.unitMapList = data this.legendArray = data.legends
this.unitMapList = this.unitMapList1
this.unitMapList.forEach(item => {
if (item.type === '党建楼宇') {
item.urlIndex = 0
} else if (item.type === '两新党建') {
item.urlIndex = 1
} else if (item.type === '辖区单位') {
item.urlIndex = 2
} else if (item.type === '机关直属部门') {
item.urlIndex = 3
} else if (item.type === '其他') {
item.urlIndex = 4
}
});
this.legendArray.forEach((legendTtem, index) => {
if (index < this.iconUrlArray.length) {
legendTtem.url = this.iconUrlArray[index]
} else {//
legendTtem.url = this.iconUrlArray[0]
}
this.iconUrlArray = [ });
require('../../../../assets/img/shuju/measure/ly@2x.png'),// this.legendArray.push({
require('../../../../assets/img/shuju/measure/jgzs@2x.png'),// optionValue: 'other',
require('../../../../assets/img/shuju/measure/lxdj@2x.png'),// optionLabel: '其他',
require('../../../../assets/img/shuju/measure/xq@2x.png'),// url: this.iconUrlArray[8]
require('../../../../assets/img/shuju/measure/qita.png')// })
]
this.distributionsList = data.distributions
this.distributionsList.forEach(item => {
let typeShow = ''
if (item.volunteerCategories.length > 0) {
typeShow = item.volunteerCategories[0]
} else {
typeShow = 'other'
}
item.urlIndex = 0
for (let i = 0; i < this.legendArray.length; i++) {
if (typeShow === this.legendArray[i].optionValue) {
item.urlIndex = i
break;
}
}
});
console.log(this.distributionsList)
//false //false
this.loadMap() this.loadMap()
this.isfirstInit = false this.isfirstInit = false
} else { } else {
@ -483,7 +458,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.unitMapList, this.iconUrlArray, null) this.$refs.map.loadMap(this.agencyInfo, null, null, this.distributionsList, this.iconUrlArray, null)
} else { } else {
this.$refs.map.refreshMap(null, this.unitMapList) this.$refs.map.refreshMap(null, this.unitMapList)

Loading…
Cancel
Save