diff --git a/.env.development b/.env.development index 2ad1156bb..b3e49ab5f 100644 --- a/.env.development +++ b/.env.development @@ -1,6 +1,6 @@ NODE_ENV=development -VUE_APP_API_SERVER = https://epmet-test.elinkservice.cn/api -# VUE_APP_API_SERVER = http://192.168.1.140/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.51.36:8080/api # VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn/api VUE_APP_NODE_ENV=dev diff --git a/.env.production.sit b/.env.production.sit index de86de77c..b0c600ea6 100644 --- a/.env.production.sit +++ b/.env.production.sit @@ -1,5 +1,5 @@ NODE_ENV=production -VUE_APP_API_SERVER = https://epmet-test.elinkservice.cn/api -# VUE_APP_API_SERVER = http://192.168.1.140/api +# VUE_APP_API_SERVER = https://epmet-test.elinkservice.cn/api +VUE_APP_API_SERVER = http://192.168.1.140/api VUE_APP_NODE_ENV=prod:sit VUE_APP_PUBLIC_PATH=epmet-oper \ No newline at end of file diff --git a/public/index.html b/public/index.html index dfbf84526..397b7f46a 100644 --- a/public/index.html +++ b/public/index.html @@ -6,6 +6,8 @@ + + + + diff --git a/src/views/modules/visual/basicinfo/cpts/incident-info.vue b/src/views/modules/visual/basicinfo/cpts/incident-info.vue index 56846b415..e95e2fe2f 100644 --- a/src/views/modules/visual/basicinfo/cpts/incident-info.vue +++ b/src/views/modules/visual/basicinfo/cpts/incident-info.vue @@ -15,7 +15,12 @@
事件内容
{{ info.eventContent }}
- +
提交时间: @@ -63,6 +68,26 @@
+
+
+ + 加载中 +
+
+ +
+
-
-
-
- 项目标题: - {{ projectInfo.projectTitle }} -
-
- 项目方案: - {{ projectInfo.projectTitle }} -
-
- 内部备注: - {{ projectInfo.internalRemark || "--" }} -
-
- 当前处理部门: - {{ projectInfo.departmentNameList.join("、") }} -
-
- 分类: -
-
- {{ item.name }} -
+
+
+
+
+ 项目标题: + {{ projectInfo.projectTitle }}
-
-
- 标签: -
-
- {{ item.name }} -
+
+ 项目方案: + {{ projectInfo.projectTitle }} +
+
+ 内部备注: + {{ projectInfo.internalRemark || "--" }} +
+
+ 当前处理部门: + {{ projectInfo.departmentNameList.join("、") }} +
+
+ 分类: + +
+ {{ item.name }} +
+
+
+
+ 标签: + +
+ {{ item.name }} +
+
-
-
-
处理进展
-
-
-
-
{{ item.processName }}
-
- {{ item.processTime }} +
+
处理进展
+
+
+
+
{{ item.processName }}
+
+ {{ item.processTime }} +
-
-
-
处理部门:
-
{{ item.departmentName }}
-
+
+
处理部门:
+
{{ item.departmentName }}
+
-
-
说 明:
-
- {{ item.publicReply }} +
+
说 明:
+
+ {{ item.publicReply }} +
-
-
-
内部备注:
-
- {{ item.internalRemark }} +
+
内部备注:
+
+ {{ + item.internalRemark + }} +
-
-
+
+ +
@@ -173,10 +208,115 @@ diff --git a/src/views/modules/visual/basicinfo/cpts/topic-info.vue b/src/views/modules/visual/basicinfo/cpts/topic-info.vue index 31ed33e1e..ed1861d73 100644 --- a/src/views/modules/visual/basicinfo/cpts/topic-info.vue +++ b/src/views/modules/visual/basicinfo/cpts/topic-info.vue @@ -4,62 +4,36 @@
- 更多信息 + 话题详情
-
-
-
- 所属网格: - {{ gridName }} -
-
- 所属小区: - {{ xiaoquName }} -
-
- 所属楼宇: - {{ louName }}-{{ danyuanName }} -
-
- 所属家庭: - {{ homeName }} -
-
- {{ field.label }}: - - {{ - info[field.columnName] == null - ? "--" - : getOptionLabel( - field.options, - info[field.columnName], - field.itemType - ) - }} - - {{ - info[field.columnName] == null ? "--" : info[field.columnName] - }} -
+
+
话题内容
+
{{ info.topicContent }}
+
+ +
+
+ 发布时间: + {{ info.releaseTime }} +
+
+ 话题地址: + {{ info.releaseAddress }} +
+
+ 所属网格: + {{ info.gridName }}
- -
@@ -89,81 +63,201 @@
-
-
-
-
- {{ field.label }}: - {{ - infoItem[field.columnName] == null - ? "--" - : getOptionLabel( - field.options, - infoItem[field.columnName], - field.itemType - ) - }} - - {{ - infoItem[field.columnName] == null - ? "--" - : infoItem[field.columnName] - }} +
+
+
+ + 加载中 +
+
+ +
+
+
+ +
+ +
+
+
+
+ 议题标题: + {{ issueInfo.issueTitle }} +
+
+ 议题建议: + {{ issueInfo.issueSuggestion }} +
+
+ 所属网格: + {{ issueInfo.belongsGridName || "--" }} +
+
+ 议题发起人: + {{ issueInfo.issueInitiator }} +
+
+ 议题来源: + {{ issueInfo.topicInfo.groupName }} +
+
+ 转议题时间: + {{ issueInfo.shiftIssueTime }} +
+
+ +
+
+
+
+ {{ issueTrend.realityVoteCount }}/{{ + issueTrend.shouldVoteCount + }} +
+
已表决/应表决
+
+
+
{{ issueTrend.supportAmount }}
+
支持
+
+
+
{{ issueTrend.oppositionAmount }}
+
反对
+
+
+ +
+
+ +
-
-
- {{ field.label }}: - {{ - !allInfo[group.tableName] || - allInfo[group.tableName][0][field.columnName] == null - ? "--" - : getOptionLabel( - field.options, - allInfo[group.tableName][0][field.columnName], - field.itemType - ) - }} - - {{ - !allInfo[group.tableName] || - allInfo[group.tableName][0][field.columnName] == null - ? "--" - : allInfo[group.tableName][0][field.columnName] - }} + +
+
+
+
+ 项目标题: + {{ projectInfo.projectTitle }} +
+
+ 项目方案: + {{ projectInfo.projectTitle }} +
+
+ 内部备注: + {{ projectInfo.internalRemark || "--" }} +
+
+ 当前处理部门: + {{ projectInfo.departmentNameList.join("、") }} +
+
+ 分类: + +
+ {{ item.name }} +
+
+
+
+ 标签: + +
+ {{ item.name }} +
+
+
+
+ +
+
处理进展
+
+
+
+
{{ item.processName }}
+
+ {{ item.processTime }} +
+
+ +
+
处理部门:
+
{{ item.departmentName }}
+
+ +
+
说 明:
+
+ {{ item.publicReply }} +
+
+ +
+
内部备注:
+
+ {{ + item.internalRemark + }} +
+
+ +
+
+
+
+
+
@@ -174,16 +268,153 @@ - + diff --git a/src/views/modules/visual/basicinfo/people.vue b/src/views/modules/visual/basicinfo/people.vue index 42241b4c0..03656ab71 100644 --- a/src/views/modules/visual/basicinfo/people.vue +++ b/src/views/modules/visual/basicinfo/people.vue @@ -448,17 +448,18 @@ />
diff --git a/src/views/modules/visual/communityGovern/cpt/issue-info.vue b/src/views/modules/visual/communityGovern/cpt/issue-info.vue new file mode 100644 index 000000000..61df95682 --- /dev/null +++ b/src/views/modules/visual/communityGovern/cpt/issue-info.vue @@ -0,0 +1,229 @@ + + + + + diff --git a/src/views/modules/visual/communityGovern/distributionAnalyze.vue b/src/views/modules/visual/communityGovern/distributionAnalyze.vue index 965bd177b..097df0a05 100644 --- a/src/views/modules/visual/communityGovern/distributionAnalyze.vue +++ b/src/views/modules/visual/communityGovern/distributionAnalyze.vue @@ -15,8 +15,8 @@ :key="iscascaderShow" :options="casOptions" :props="optionProps" - @change="handleChangeAgency" - clearable> + :show-all-levels="false" + @change="handleChangeAgency">
+
@@ -73,7 +84,8 @@ import screenEchartsFrame from "@/views/modules/visual/components/screen-echarts import screenMap from "@/views/modules/visual/components/screen-map"; import { lineOption } from './distributionLineOption.js' import * as echarts from 'echarts' - +import nextTick from 'dai-js/tools/nextTick' +import ScreenLoading from "@/views/modules/visual/components/screen-loading"; export default { name: "HomeMap", @@ -104,57 +116,57 @@ export default { legend: [], lineData: [820, 932, 901, 934, 1290, 1330, 1320], lineList: [ - { - time: '4:00', - categoryList: [ - { - categoryCode: '001', - count: 100, - color: '#1B51FF', - name: '分类1' - }, - { - categoryCode: '002', - count: 200, - color: '#00E5ED', - name: '分类2' - } - ] - }, - { - time: '5:00', - categoryList: [ - { - categoryCode: '001', - count: 20, - color: '#1B51FF', - name: '分类1' - }, - { - categoryCode: '002', - count: 400, - color: '#00E5ED', - name: '分类2' - } - ] - }, - { - time: '6:00', - categoryList: [ - { - categoryCode: '001', - count: 50, - color: '#1B51FF', - name: '分类1' - }, - { - categoryCode: '002', - count: 10, - color: '#00E5ED', - name: '分类2' - } - ] - } + // { + // time: '4:00', + // categoryList: [ + // { + // categoryCode: '001', + // count: 100, + // color: '#1B51FF', + // name: '分类1' + // }, + // { + // categoryCode: '002', + // count: 200, + // color: '#00E5ED', + // name: '分类2' + // } + // ] + // }, + // { + // time: '5:00', + // categoryList: [ + // { + // categoryCode: '001', + // count: 20, + // color: '#1B51FF', + // name: '分类1' + // }, + // { + // categoryCode: '002', + // count: 400, + // color: '#00E5ED', + // name: '分类2' + // } + // ] + // }, + // { + // time: '6:00', + // categoryList: [ + // { + // categoryCode: '001', + // count: 50, + // color: '#1B51FF', + // name: '分类1' + // }, + // { + // categoryCode: '002', + // count: 10, + // color: '#00E5ED', + // name: '分类2' + // } + // ] + // } ], timeRange: [], @@ -194,8 +206,10 @@ export default { this.userId = this.uid; this.initData() await this.getAgencylist()//获取组织级别 + await nextTick(500) await this.loadOrgData() - this.getApiData(); + await this.getApiData(); + }, methods: { @@ -241,31 +255,46 @@ export default { await this.loadMapData(); }, - async getAgencylist () { - const url = '/gov/org/customeragency/agencylist' - // const url = 'http://yapi.elinkservice.cn/mock/102/gov/org/agency/agencylist' + // 获取当前登录人员信息及组织信息 + getAgencylist () { + 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' - customerId: '0c41b272ee9ee95ac6f184ad548a30eb' - } - const { data, code, msg } = await requestPost(url, params) - if (code === 0) { - ++this.iscascaderShow - this.casOptions = [] - this.agencyIdArray.length = [] + //组织级联数据 + ++this.iscascaderShow + this.casOptions = [] + this.agencyIdArray.length = [] - if (data) { - this.casOptions.push(data) + if (data.subAgencyList) { + 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) { - this.dateId = value this.getApiData() }, @@ -283,16 +312,16 @@ export default { if (code === 0) { - this.agencyInfo = data - if (!data.latitude) { - this.agencyInfo.latitude = 36.072227 - } - if (!data.longitude) { - this.agencyInfo.longitude = 120.389455 - } - if (!data.level) { - this.agencyInfo.level = 'street' - } + // this.agencyInfo = data + // if (!data.latitude) { + // this.agencyInfo.latitude = 36.072227 + // } + // if (!data.longitude) { + // this.agencyInfo.longitude = 120.389455 + // } + // if (!data.level) { + // this.agencyInfo.level = 'street' + // } this.subAgencyArray = [] if (data.children && data.children.length > 0) { this.subAgencyArray = data.children @@ -307,12 +336,10 @@ export default { }, async loadMapData () { - this.$refs.lineChart.clear() - const _that = this // this.$refs.lineChart.showLoading() - // const url ="/gov/project/project/projectdistributionanalysisright"; - const url = "http://yapi.elinkservice.cn/mock/245/gov/project/project/projectdistributionanalysisright"; + const url = "/gov/project/project/projectdistributionanalysisright"; + // const url = "http://yapi.elinkservice.cn/mock/245/gov/project/project/projectdistributionanalysisright"; let params = { orgId: this.orgId, startDate: this.timeRange.length > 0 && this.timeRange[0] || '', @@ -349,7 +376,7 @@ export default { ) } if (data.list && data.list.length > 0) { - // this.mapList = data.list + this.mapList = data.list } else { @@ -357,7 +384,7 @@ export default { } this.mapList.forEach(item => { - // debugger + for (let i = 0; i < this.subAgencyArray.length; i++) { let agencyItem = this.subAgencyArray[i] if (item.orgId === agencyItem.id) { @@ -409,10 +436,7 @@ export default { } }, - lineInitOk (dom) { - - this.lineInitState = true }, @@ -428,11 +452,10 @@ export default { // 获取折线图 async getLineChart () { this.$refs.lineChart.clear() - const _that = this - // this.$refs.lineChart.showLoading() - // const url ="/gov/project/project/projectdistributionanalysisleft"; - const url = "http://yapi.elinkservice.cn/mock/245/gov/project/project/projectdistributionanalysisleft"; + this.$refs.lineChart.showLoading() + const url = "/gov/project/project/projectdistributionanalysisleft"; + // const url = "http://yapi.elinkservice.cn/mock/245/gov/project/project/projectdistributionanalysisleft"; let params = { orgId: this.orgId, startDate: this.timeRange.length > 0 && this.timeRange[0] || '', @@ -440,24 +463,27 @@ export default { }; const { data, code, msg } = await requestPost(url, params); - + this.$refs.lineChart.hideLoading() if (code === 0) { // 获取pieChart配置 this.lineOption = lineOption() if (data && data.length > 0) { - + this.lineList = data 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 { @@ -548,7 +574,8 @@ export default { cptCard, cptTb, screenEchartsFrame, - screenMap + screenMap, + ScreenLoading }, watch: { diff --git a/src/views/modules/visual/communityGovern/processAnalyze.vue b/src/views/modules/visual/communityGovern/processAnalyze.vue index a151cf589..ec2ca8c87 100644 --- a/src/views/modules/visual/communityGovern/processAnalyze.vue +++ b/src/views/modules/visual/communityGovern/processAnalyze.vue @@ -12,17 +12,17 @@ :key="iscascaderShow" :options="casOptions" :props="optionProps" - @change="handleChangeAgency" - clearable> + :show-all-levels="false" + @change="handleChangeAgency">
- + value-format="yyyy-MM-dd">
@@ -41,7 +41,8 @@ {{monthIncr}}
-
+
@@ -60,12 +61,26 @@
+ +
+ 加载中 +
+
近12月新增项目数
- + +
+ 加载中 +
@@ -105,18 +120,22 @@ import cptCard from "@/views/modules/visual/cpts/card"; import cptTb from "@/views/modules/visual/cpts/tb"; import screenEchartsFrame from "@/views/modules/visual/components/screen-echarts-frame"; import screenMap from "@/views/modules/visual/components/screen-map"; +import ScreenLoading from "@/views/modules/visual/components/screen-loading"; +import ScreenNodata from "@/views/modules/visual/components/screen-nodata"; import { pieOption } from './processPieOption.js' import { lineOption } from './processLineOption.js' +import nextTick from 'dai-js/tools/nextTick' export default { name: "HomeMap", data () { return { - showNoData: false, - timer: null, - isfirstInit: true, + dataLoading: true, + pieNoData: false, + lineNoData: false, + isfirstInit: true,//记录地图是否第一次加载 projectTotal: 0, dateIncr: 0, @@ -126,7 +145,9 @@ export default { lineOption: {}, lineInitState: false, lineColorArray: [], - lineData: [820, 932, 901, 934, 1290, 1330, 1320], + lineData: [], + lineXaxis: [], + lineSeriesData: [], pieChartS: null, pieChart: '', @@ -135,9 +156,8 @@ export default { pieTotal: 0, colorArray: [], pieData: [ - { value: 1048, name: '未结案', color: '#FAC126', selected: true }, - { value: 735, name: '已结案', color: '#3DDA83' }, - + // { value: 1048, name: '未结案', color: '#FAC126', selected: true }, + // { value: 735, name: '已结案', color: '#3DDA83' }, ], legendArray: [ @@ -156,6 +176,7 @@ export default { ], dateId: '', + dateIdShow: '', agencyId: '', status: 'pending',//状态:待处理 pending,结案closed agencyInfo: {}, @@ -180,26 +201,7 @@ export default { title: "南宁第二网格", } ], - projectList2: [ - { - agencyId: '', - projectId: '', - origin: '', - status: 'pending', - title: '山东路山东路', - latitude: 36.062227, - longitude: 120.379455, - }, - { - agencyId: '', - projectId: '', - origin: '', - status: 'closed', - latitude: 36.082227, - longitude: 120.379455, - title: "山东路", - } - ], + iconUrlArray: [], iconTextStyle: {}, @@ -220,97 +222,99 @@ export default { }, // mixins: [animate] beforeDestroy () { - this.timer && clearInterval(this.timer) + + }, + async created () { + }, async mounted () { - this.userId = this.uid; + this.dataLoading = true + //初始化时间、各组件 this.initData() - await this.getWorkUserInfo() await this.getAgencylist()//获取组织级别 - this.getApiData(); + //获取服务器数据 + await this.getProjectTotal() + await this.getLineChart() + await this.loadProjectlist() + this.dataLoading = false + + this.assignData() + }, methods: { - initData () { - var time = (new Date).getTime() - 24 * 60 * 60 * 1000; - this.dateId = new Date(time); // 获取的是前一天日期 - - }, async getApiData () { await this.getProjectTotal() + await this.getLineChart() await this.loadProjectlist() - await this.getLine() }, - handleChangeDate (value) { - this.dateId = value - this.getApiData() + assignData () { + this.getPie() + this.getLine() }, - // 获取当前管理员信息 - getWorkUserInfo () { - const url = '/epmetuser/customerstaff/staffbasicinfo' - let params = {} - window.app.ajax.post( - url, - params, - (data, rspMsg) => { - this.agencyInfo = data - if (!data.latitude) { - this.agencyInfo.latitude = 36.072227 - } - if (!data.longitude) { - this.agencyInfo.longitude = 120.389455 - } - if (!data.level) { - this.agencyInfo.level = 'street' - } - - }, - (rspMsg, data) => { - this.$message.error(rspMsg) - } - ) - + handleChangeDate (value) { + this.dateIdShow = value + this.getApiData() }, + // 获取当前登录人员信息及组织信息 async getAgencylist () { - const url = '/gov/org/customeragency/agencylist' - // const url = 'http://yapi.elinkservice.cn/mock/102/gov/org/agency/agencylist' + const url = "/gov/org/customeragency/agencygridtree"; - const params = { - // customerId: '613cc61a6b8ce4c70d21bd413dac72cc' - customerId: '0c41b272ee9ee95ac6f184ad548a30eb' - } - const { data, code, msg } = await requestPost(url, params) + let params = {}; + + const { data, code, msg } = await requestPost(url, params); if (code === 0) { + 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' + } + + //组织级联数据 ++this.iscascaderShow this.casOptions = [] this.agencyIdArray.length = [] if (data) { this.casOptions.push(data) + this.agencyIdArray.push(this.agencyId) } } else { - this.$message.error(msg) + this.$message.error(msg); } + }, //加载项目 async getProjectTotal () { - // const url = "/data/aggregator/project/projecttotal"; - const url = "http://yapi.elinkservice.cn/mock/245/data/aggregator/project/projecttotal"; + if (this.$refs.pieChart) { + this.$refs.pieChart.showLoading() + this.$refs.pieChart.clear() + } + + const url = "/data/aggregator/project/projecttotal"; + // const url = "http://yapi.elinkservice.cn/mock/245/data/aggregator/project/projecttotal"; let params = { - agencyId: '', + agencyId: this.agencyId, dateId: this.dateId, }; const { data, code, msg } = await requestPost(url, params); - - + if (this.$refs.pieChart) { + this.$refs.pieChart.hideLoading() + } if (code === 0) { this.projectTotal = data.projectTotal this.dateIncr = data.dateIncr @@ -329,9 +333,6 @@ export default { } ] - this.getPie() - - } else { this.$message.error(msg); } @@ -339,10 +340,10 @@ export default { //加载项目 async loadProjectlist () { - // const url = "/data/aggregator/project/projectstatuslist"; - const url = "http://yapi.elinkservice.cn/mock/245/data/aggregator/project/projectstatuslist"; + const url = "/data/aggregator/project/projectstatuslist"; + // const url = "http://yapi.elinkservice.cn/mock/245/data/aggregator/project/projectstatuslist"; let params = { - agencyId: '', + agencyId: this.agencyId, dateId: this.dateId, status: this.status }; @@ -352,13 +353,13 @@ export default { if (code === 0) { - // this.projectList = [...data] - if (this.status === 'closed') { - this.projectList = this.projectList1 - } else { - this.projectList = this.projectList2 + this.projectList = [...data] + // if (this.status === 'closed') { + // this.projectList = this.projectList1 + // } else { + // this.projectList = this.projectList2 - } + // } this.projectList.forEach(item => { item.values_ = { name: item.title @@ -407,14 +408,11 @@ 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) + this.$refs.map.loadMap(this.agencyInfo, null, null, this.projectList, this.iconUrlArray, this.iconTextStyle, 3000) } else { this.$refs.map.refreshMap(null, this.projectList) - - } }, @@ -424,10 +422,8 @@ export default { }, pieInitOk (dom) { - this.pieChartS = dom this.pieInitState = true - }, lineInitOk () { @@ -436,7 +432,7 @@ export default { }, getLine () { if (this.lineInitState) { - this.getLineChart() + this.assignLineChart() } else { setTimeout(() => { this.getLine() @@ -445,12 +441,14 @@ export default { }, // 获取折线图 async getLineChart () { - this.$refs.lineChart.clear() - + if (this.$refs.lineChart) { + this.$refs.lineChart.clear() + this.$refs.lineChart.showLoading() + } const _that = this // this.$refs.pieChart.showLoading() - // const url ="/data/aggregator/project/projectmonthincr"; - const url = "http://yapi.elinkservice.cn/mock/245/data/aggregator/project/projectmonthincr"; + const url = "/data/aggregator/project/projectmonthincr"; + // const url = "http://yapi.elinkservice.cn/mock/245/data/aggregator/project/projectmonthincr"; let params = { agencyId: this.agencyId, dateId: this.dateId, @@ -460,28 +458,24 @@ export default { if (code === 0) { // 获取pieChart配置 - this.lineOption = lineOption() - let xaxis = [] - let totalIndexData = [] + + this.lineXaxis = [] + this.lineSeriesData = [] if (data && data.length > 0) { + this.lineNoData = false data.forEach(item => { - xaxis.push(item.type) - totalIndexData.push(item.value) + this.lineXaxis.push(item.type) + this.lineSeriesData.push(item.value) }); - // this.lineData = data + this.lineData = data } else { - + this.lineNoData = true } - this.$refs.lineChart.setOption(this.lineOption, true) - this.$refs.lineChart.setOption({ - xAxis: { data: xaxis }, - series: [ - { data: totalIndexData }, - - ] - }, true) + if (this.$refs.lineChart) { + this.$refs.lineChart.hideLoading() + } } else { this.$message.error(msg); @@ -490,9 +484,21 @@ export default { }, + assignLineChart () { + this.lineOption = lineOption() + this.$refs.lineChart.setOption(this.lineOption, true) + this.$refs.lineChart.setOption({ + xAxis: { data: this.lineXaxis }, + series: [ + { data: this.lineSeriesData }, + + ] + }, true) + }, + getPie () { if (this.pieInitState) { - this.getPieChart() + this.assignPieChart() } else { setTimeout(() => { this.getPie() @@ -500,11 +506,10 @@ export default { } }, // 获取饼状图 - async getPieChart () { - this.$refs.pieChart.clear() + async assignPieChart () { + this.pieTotal = 0 const _that = this - // this.$refs.pieChart.showLoading() // 获取pieChart配置 this.pieOption = pieOption(this.pieChartS) @@ -573,7 +578,15 @@ export default { console.log(this.agencyIdArray) }, - + //初始化时间 + initData () { + var time = (new Date).getTime() - 24 * 60 * 60 * 1000; + 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; + }, toUserInfo (uid) { this.$router.push({ path: `/main-shuju/visual-basicinfo-people/${uid}` }); @@ -594,9 +607,16 @@ export default { cptTb, screenEchartsFrame, screenMap, + ScreenLoading, + ScreenNodata }, watch: { + dateIdShow () { + + let dataArray = this.dateIdShow.split('-') + this.dateId = dataArray.join('') + }, uid (id) { this.userId = id; }, diff --git a/src/views/modules/visual/communityGovern/processLineOption.js b/src/views/modules/visual/communityGovern/processLineOption.js index ef7dec010..04b4f9503 100644 --- a/src/views/modules/visual/communityGovern/processLineOption.js +++ b/src/views/modules/visual/communityGovern/processLineOption.js @@ -2,7 +2,15 @@ import * as echarts from 'echarts' export function lineOption () { return { - + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'cross', + label: { + backgroundColor: '#6a7985' + } + } + }, xAxis: { type: 'category', // boundaryGap: false, @@ -54,6 +62,7 @@ export function lineOption () { { name: '项目数', type: 'line', + smooth: true, barWidth: 15, areaStyle: {}, itemStyle: { diff --git a/src/views/modules/visual/communityGovern/resibuzz.vue b/src/views/modules/visual/communityGovern/resibuzz.vue index f042af0b4..84e9e9c08 100644 --- a/src/views/modules/visual/communityGovern/resibuzz.vue +++ b/src/views/modules/visual/communityGovern/resibuzz.vue @@ -12,8 +12,8 @@ :key="iscascaderShow" :options="casOptions" :props="optionProps" - @change="handleChangeAgency" - clearable> + :show-all-levels="false" + @change="handleChangeAgency">
- - + +
+ 加载中 +
@@ -43,23 +49,28 @@ - -
- - -
-
+ :list="demand.list" + @operate="toIssueInfo"> +
+
+ + +
+ + + @@ -69,16 +80,20 @@ import { requestPost } from "@/js/dai/request"; import cptCard from "@/views/modules/visual/cpts/card"; import cptTb from "@/views/modules/visual/cpts/tb"; import screenEchartsFrame from "@/views/modules/visual/components/screen-echarts-frame"; - +import ScreenLoading from "@/views/modules/visual/components/screen-loading"; +import ScreenNodata from "@/views/modules/visual/components/screen-nodata"; import { pieOption } from './resiPieOption.js' +import nextTick from 'dai-js/tools/nextTick' +import issueInfo from "./cpt/issue-info"; export default { name: "HomeMap", data () { return { - showNoData: false, - timer: null, + dataLoading: true, + pieNoData: false, + pieChartS: null, pieChart: '', pieOption: {}, @@ -86,18 +101,18 @@ export default { pieTotal: 0, colorArray: [], pieData: [ - { count: 1048, categoryName: '城市管理', color: '#1B51FF', selected: true }, - { count: 735, categoryName: '为民服务', color: '#00E5ED' }, - { count: 580, categoryName: '安全监管', color: '#7800FF' }, - { count: 484, categoryName: '民政', color: '#16D783' }, - { count: 300, categoryName: '环境保护', color: '#FF7800' }, - { count: 1048, categoryName: '建设管理', color: '#FFBA00' }, - { count: 735, categoryName: '街道吹哨部门报到', color: '#FFD685' }, - { count: 1580, categoryName: '社会治安综合', color: '#2A00FF' }, - { count: 484, categoryName: '公安交通管理', color: '#C600FF' }, - { count: 300, categoryName: '卫生计生监管执法', color: '#FF2A00' }, - { count: 484, categoryName: '民生', color: '#3DDA83' }, - { count: 300, categoryName: '街道安全', color: '#FAC126' } + // { count: 1048, categoryName: '城市管理', color: '#1B51FF', selected: true }, + // { count: 735, categoryName: '为民服务', color: '#00E5ED' }, + // { count: 580, categoryName: '安全监管', color: '#7800FF' }, + // { count: 484, categoryName: '民政', color: '#16D783' }, + // { count: 300, categoryName: '环境保护', color: '#FF7800' }, + // { count: 1048, categoryName: '建设管理', color: '#FFBA00' }, + // { count: 735, categoryName: '街道吹哨部门报到', color: '#FFD685' }, + // { count: 1580, categoryName: '社会治安综合', color: '#2A00FF' }, + // { count: 484, categoryName: '公安交通管理', color: '#C600FF' }, + // { count: 300, categoryName: '卫生计生监管执法', color: '#FF2A00' }, + // { count: 484, categoryName: '民生', color: '#3DDA83' }, + // { count: 300, categoryName: '街道安全', color: '#FAC126' } ], //voting 已转项目:shift_project 已关闭:closed,全部:all stateArray: [ @@ -121,6 +136,8 @@ export default { status: 'all', orgId: '', + orgTypeSel: '', + tableList: [], demand: { loading: true, colList: [ @@ -174,8 +191,9 @@ export default { pageSize: 10, pageNo: 1, total: 0, - }, + showIssue: true, + issueId: 'cf48b7dc70ef4c319fd9c71890d9dbbb', casOptions: [], agencyIdArray: [], @@ -184,7 +202,7 @@ export default { optionProps: { multiple: false, - value: 'agencyId', + value: 'orgLevel', label: 'agencyName', children: 'subAgencyList', checkStrictly: true @@ -194,127 +212,116 @@ export default { }, // mixins: [animate] beforeDestroy () { - this.timer && clearInterval(this.timer) + }, async mounted () { - this.userId = this.uid; - this.getApiData(); + this.dataLoading = true + await this.getAgencylist()//获取组织级别 + await this.getApiData() + + this.dataLoading = false + + this.getPie() }, methods: { async getApiData () { - await this.getAgencylist()//获取组织级别 - await this.getPie() + await this.getPieChart() await this.getTable(); }, + // 获取当前登录人员信息及组织信息 async getAgencylist () { - const url = '/gov/org/customeragency/agencylist' - // const url = 'http://yapi.elinkservice.cn/mock/102/gov/org/agency/agencylist' + const url = "/gov/org/customeragency/agencygridtree"; + let params = {}; - const params = { - // customerId: '613cc61a6b8ce4c70d21bd413dac72cc' - customerId: '0c41b272ee9ee95ac6f184ad548a30eb' - } - const { data, code, msg } = await requestPost(url, params) + const { data, code, msg } = await requestPost(url, params); if (code === 0) { + 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' + } + + //组织级联数据 ++this.iscascaderShow this.casOptions = [] this.agencyIdArray.length = [] if (data) { this.casOptions.push(data) + this.agencyIdArray.push(this.agencyInfo.orgLevel) } } else { - this.$message.error(msg) + this.$message.error(msg); } - }, - pieInitOk (dom) { - console.log('pie准备好了', dom) - this.pieChartS = dom - this.pieInitState = true - - }, - getPie () { - if (this.pieInitState) { - this.getPieChart() - } else { - setTimeout(() => { - this.getPie() - }, 500) - } }, // 获取饼状图 async getPieChart () { - this.$refs.pieChart.clear() - this.pieTotal = 0 - const _that = this - // this.$refs.pieChart.showLoading() - // const url ="/gov/issue/issue/resibuzz-leftpiechart"; - const url = "http://yapi.elinkservice.cn/mock/245/gov/issue/issue/resibuzz-leftpiechart"; + if (this.$refs.pieChart) { + this.$refs.pieChart.clear() + this.$refs.pieChart.showLoading() + } + + const url = "/gov/issue/issue/resibuzz-leftpiechart"; + // const url = "http://yapi.elinkservice.cn/mock/245/gov/issue/issue/resibuzz-leftpiechart"; let params = { orgId: this.orgId, + orgType: this.orgType, + }; const { data, code, msg } = await requestPost(url, params); - // 获取pieChart配置 - - if (code === 0) { - // 获取pieChart配置 - this.pieOption = pieOption(this.pieChartS) if (data && data.length > 0) { - // this.pieData = data - } else { - this.pieData = [{ count: 0, categoryName: '无分类', color: '#00E5ED' }] - } - - let maxValue = this.pieData[0].count - let maxIndex = 0 - this.pieData[0].selected = true - - this.pieData.forEach((item, index) => { - item.name = item.categoryName - item.value = item.count - this.colorArray.push(item.color) - this.pieTotal = this.pieTotal + item.value - - if (item.value > maxValue) { - maxValue = item.value - maxIndex = index - item.selected = true - } else if (index !== 0) { - item.selected = false - } - - }); + this.pieData = data + } else { + this.pieData = [] - this.pieOption.title.text = this.pieTotal - this.pieOption.series[1].itemStyle = { - color: function (params) { - return _that.colorArray[params.dataIndex] - } } - this.clickPie(maxIndex) - let fun = function (params) { - _that.clickPie(params.dataIndex) + if (this.$refs.pieChart) { + this.$refs.pieChart.hideLoading() } - this.$refs.pieChart.handleClick(fun) + } else { this.$message.error(msg); } + }, + + pieInitOk (dom) { + console.log('pie准备好了', dom) + this.pieChartS = dom + this.pieInitState = true }, + getPie () { + if (this.pieInitState) { + this.assignPieChart() + } else { + setTimeout(() => { + this.getPie() + }, 500) + } + }, clickPie (seriesIndex) { this.pieData.forEach((element, index) => { @@ -349,29 +356,87 @@ export default { } }); this.pieOption.series[1].data = this.pieData - // this.$refs.pieChart.hideLoading() + this.$refs.pieChart.setOption(this.pieOption) }, + assignPieChart () { + + this.pieTotal = 0 + + if (this.pieData.length > 0) { + this.pieNoData = false + const _that = this + let maxIndex = 0 + let maxValue = this.pieData[0].count + + this.pieData[0].selected = true + + this.pieData.forEach((item, index) => { + item.name = item.categoryName + item.value = item.count + this.colorArray.push(item.color) + this.pieTotal = this.pieTotal + item.value + + if (item.value > maxValue) { + maxValue = item.value + maxIndex = index + item.selected = true + } else if (index !== 0) { + item.selected = false + } + + }); + // 获取pieChart配置 + this.pieOption = pieOption(this.pieChartS) + this.pieOption.title.text = this.pieTotal + this.pieOption.series[1].itemStyle = { + color: function (params) { + return _that.colorArray[params.dataIndex] + } + } + this.clickPie(maxIndex) + + let fun = function (params) { + _that.clickPie(params.dataIndex) + } + this.$refs.pieChart.handleClick(fun) + } else { + this.pieNoData = true + } + + }, + handleChangeState (index) { this.getTable() }, - handleChangeAgency (value) { - console.log(value) - this.agencyName = this.$refs["myCascader"].getCheckedNodes()[0].label - this.orgId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '' - console.log(this.agencyIdArray) + async handleChangeAgency (value) { + let orgArray = [] + let key = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '' + if (key) { + orgArray = key.split('-') + this.orgId = orgArray[0] + this.orgType = orgArray[1] === 'grid' ? 'grid' : 'agency' + } else { + this.orgId = '' + this.orgType = '' + } + + await this.getApiData() + this.assignPieChart() + }, //加载组织数据 async getTable () { - // const url = "/gov/issue/issue/resibuzz"; - const url = "http://yapi.elinkservice.cn/mock/245/gov/issue/issue/resibuzz"; + const url = "/gov/issue/issue/resibuzz"; + // const url = "http://yapi.elinkservice.cn/mock/245/gov/issue/issue/resibuzz"; let params = { status: this.status, orgId: this.orgId, + orgType: this.orgType, pageNo: this.demand.pageNo, pageSize: this.demand.pageSize, }; @@ -381,18 +446,19 @@ export default { if (code === 0) { this.demand.total = data.total; + this.tableList = data.list this.demand.list = data.list.map((item) => { return [ { type: "index" }, - item.issueTitle, - item.suggestion, - item.categoryName, - item.status, - item.createdTime, - item.issueOriginator, - item.voteAccount, - item.supportCount, - item.oppositionCount, + item.issueTitle ? item.issueTitle : '', + item.suggestion ? item.suggestion : '', + item.categoryName.join(','), + item.status ? item.status : '', + item.createdTime ? item.createdTime : '', + item.issueOriginator ? item.issueOriginator : '', + item.voteAccount ? item.voteAccount : '', + item.supportCount ? item.supportCount : '', + item.oppositionCount ? item.oppositionCount : '', { type: "operate", list: ["查看"] }, ]; }); @@ -405,8 +471,12 @@ export default { this.demand.pageNo = val; this.getTable(); }, - toUserInfo (uid) { - this.$router.push({ path: `/main-shuju/visual-basicinfo-people/${uid}` }); + + async toIssueInfo (index) { + const { tableList } = this; + this.issueId = tableList[index].issueId + this.showIssue = true + }, }, props: { @@ -423,6 +493,9 @@ export default { cptCard, cptTb, screenEchartsFrame, + ScreenLoading, + ScreenNodata, + issueInfo }, watch: { diff --git a/src/views/modules/visual/communityGovern/typeAnalyze.vue b/src/views/modules/visual/communityGovern/typeAnalyze.vue index 8e77ebdb0..d6a9d6299 100644 --- a/src/views/modules/visual/communityGovern/typeAnalyze.vue +++ b/src/views/modules/visual/communityGovern/typeAnalyze.vue @@ -12,18 +12,18 @@ :key="iscascaderShow" :options="casOptions" :props="optionProps" - @change="handleChangeAgency" - clearable> + :show-all-levels="false" + @change="handleChangeAgency">
- + value-format="yyyy-MM-dd">
@@ -45,15 +45,16 @@ :header="demand.header" :list="demand.list"> -
- - -
+
+ +
+ +
@@ -71,7 +72,7 @@ import cptTb from "@/views/modules/visual/cpts/tb"; import screenEchartsFrame from "@/views/modules/visual/components/screen-echarts-frame"; import { pieOption } from './typePieOption.js' - +import nextTick from 'dai-js/tools/nextTick' export default { name: "HomeMap", @@ -100,6 +101,7 @@ export default { { total: 300, categoryName: '街道安全', color: '#FAC126' } ], + dateIdShow: '', agencyId: '', dateId: '', categoryCode: '', @@ -160,6 +162,7 @@ export default { multiple: false, value: 'agencyId', label: 'agencyName', + orgType: 'orgType', children: 'subAgencyList', checkStrictly: true }, @@ -175,48 +178,60 @@ export default { this.userId = this.uid; this.initData() await this.getAgencylist()//获取组织级别 - this.getApiData(); + await nextTick(500) + await this.getPie() }, methods: { initData () { var time = (new Date).getTime() - 24 * 60 * 60 * 1000; - this.dateId = new Date(time); // 获取的是前一天日期 - - }, - async getApiData () { + 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; - await this.getPie() - await this.getTable(); }, + // 获取当前登录人员信息及组织信息 async getAgencylist () { - const url = '/gov/org/customeragency/agencylist' - // const url = 'http://yapi.elinkservice.cn/mock/102/gov/org/agency/agencylist' + const url = "/gov/org/customeragency/agencygridtree"; - const params = { - // customerId: '613cc61a6b8ce4c70d21bd413dac72cc' - customerId: '0c41b272ee9ee95ac6f184ad548a30eb' - } - const { data, code, msg } = await requestPost(url, params) + let params = {}; + + const { data, code, msg } = await requestPost(url, params); if (code === 0) { + 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' + } + + //组织级联数据 ++this.iscascaderShow this.casOptions = [] this.agencyIdArray.length = [] if (data) { this.casOptions.push(data) + this.agencyIdArray.push(this.agencyId) } } else { - this.$message.error(msg) + this.$message.error(msg); } + }, handleChangeDate (value) { - - this.dateId = value - this.getApiData() + this.dateIdShow = value + this.getPie() }, @@ -241,8 +256,8 @@ export default { this.pieTotal = 0 const _that = this // this.$refs.pieChart.showLoading() - // const url ="/data/aggregator/project/projectcategorylist"; - const url = "http://yapi.elinkservice.cn/mock/245/data/aggregator/project/projectcategorylist"; + const url = "/data/aggregator/project/projectcategorylist"; + // const url = "http://yapi.elinkservice.cn/mock/245/data/aggregator/project/projectcategorylist"; let params = { agencyId: this.agencyId, dateId: this.dateId, @@ -255,7 +270,7 @@ export default { // 获取pieChart配置 this.pieOption = pieOption(this.pieChartS) if (data && data.length > 0) { - // this.pieData = data + this.pieData = data } else { this.pieData = [{ total: 0, categoryName: '无分类', color: '#00E5ED' }] @@ -274,14 +289,13 @@ export default { maxValue = item.value maxIndex = index item.selected = true + this.categoryCode = item.categoryCode } else if (index !== 0) { item.selected = false } }); - - this.pieOption.title.text = this.pieTotal this.pieOption.series[1].itemStyle = { color: function (params) { @@ -293,8 +307,6 @@ export default { let fun = function (params) { _that.clickPie(params.dataIndex) - _that.categoryCode = _that.pieData[params.dataIndex].categoryCode - _that.getTable() } this.$refs.pieChart.handleClick(fun) this.clickPie(maxIndex) @@ -304,7 +316,7 @@ export default { }, - clickPie (seriesIndex) { + async clickPie (seriesIndex) { this.pieData.forEach((element, index) => { if (index === seriesIndex) { element.label = { @@ -340,20 +352,22 @@ export default { // this.$refs.pieChart.hideLoading() this.$refs.pieChart.setOption(this.pieOption) + this.categoryCode = this.pieData[seriesIndex].categoryCode + this.getTable() }, handleChangeAgency (value) { this.agencyName = this.$refs["myCascader"].getCheckedNodes()[0].label this.agencyId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '' - this.getApiData() + this.getPie() console.log(this.agencyIdArray) }, //加载组织数据 async getTable () { - // const url = "/data/aggregator/project/categoryprojectlist"; - const url = "http://yapi.elinkservice.cn/mock/245/data/aggregator/project/categoryprojectlist"; + const url = "/data/aggregator/project/categoryprojectlist"; + // const url = "http://yapi.elinkservice.cn/mock/245/data/aggregator/project/categoryprojectlist"; let params = { dateId: this.dateId, agencyId: this.agencyId, @@ -375,13 +389,13 @@ export default { item.statusShow = item.status === 'pending' ? '待处理' : '已结案' return [ { type: "index" }, - item.projectCode, + item.projectCode ? item.projectCode : '', item.categoryNames.join(','), - item.originShow, - item.gridName, - item.statusShow, - item.title, - item.time, + item.originShow ? item.originShow : '', + item.gridName ? item.gridName : '', + item.statusShow ? item.statusShow : '', + item.title ? item.title : '', + item.time ? item.time : '', { type: "operate", list: ["查看"] }, ]; }); @@ -415,11 +429,15 @@ export default { }, watch: { + dateIdShow () { + let dataArray = this.dateIdShow.split('-') + this.dateId = dataArray.join('') + }, uid (id) { this.userId = id; }, userId () { - this.getApiData(); + this.getPie() window.scrollTo(0, 0); }, }, diff --git a/src/views/modules/visual/components/screen-map/index.vue b/src/views/modules/visual/components/screen-map/index.vue index c2648b0ad..3e593ed55 100644 --- a/src/views/modules/visual/components/screen-map/index.vue +++ b/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 { Circle as CircleStyle, Icon, Fill, Stroke, Style, Text } from 'ol/style.js'; import { altKeyOnly, click, pointerMove } from 'ol/events/condition'; +import { getDistance } from 'ol/sphere'; import { mapGetters } from "vuex"; import { Loading } from 'element-ui'; //引入Loading服务 @@ -48,10 +49,6 @@ let iconSource; // icon let select;//选中标注 -//url图标 - - - let polygonColorArray = [ 'rgba(210, 2, 2, 0.24)', 'rgba(43, 231, 253, 0.25)', @@ -59,8 +56,7 @@ let polygonColorArray = [ ]; -//变电站标注样式 - +//多边形标注样式 var polygonStyleFunction = (function () { return function (feature) { return new Style({ @@ -134,6 +130,7 @@ const vueGis = { //icon图标样式 iconUrlArray: [], iconTextColor: '#ffffff', + distanceMax: null,//显示的坐标距离中心点的范围 } }, @@ -143,13 +140,14 @@ const vueGis = { }, methods: { //加载地图:地图基本信息,多边形区域信息,多边形icon - loadMap (mapInfo, polygonArray, polIconUrlArray, iconArrays, iconUrlArray, iconTextStyle) { + loadMap (mapInfo, polygonArray, polIconUrlArray, iconArrays, iconUrlArray, iconTextStyle, distanceMax) { this.mapInfo = mapInfo this.polygonArray = polygonArray this.polIconUrlArray = polIconUrlArray this.iconArrays = iconArrays this.iconUrlArray = iconUrlArray this.iconTextStyle = iconTextStyle + this.distanceMax = distanceMax //初始化地图 this.initMap() @@ -302,11 +300,12 @@ const vueGis = { //加载icon图标 loadIcon () { iconSource.clear()//清空多边形标注 + if (this.iconArrays && this.iconArrays.length > 0) { let iconFeatures = []; + let iconArraysNew = [] this.iconArrays.forEach((oneIcon, index) => { - let urlNum = this.getRndBetween(1, 3) //添加标注 let iconItem = new Feature({ geometry: new Point([oneIcon.longitude, oneIcon.latitude]), @@ -328,7 +327,16 @@ const vueGis = { }); 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 +357,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 () { this.setMapLocation() diff --git a/src/views/modules/visual/components/screen-nodata/index.vue b/src/views/modules/visual/components/screen-nodata/index.vue new file mode 100644 index 000000000..9c34b2535 --- /dev/null +++ b/src/views/modules/visual/components/screen-nodata/index.vue @@ -0,0 +1,34 @@ + + + + + diff --git a/src/views/modules/visual/cpts/line-chart.vue b/src/views/modules/visual/cpts/line-chart.vue new file mode 100644 index 000000000..84d14f2b2 --- /dev/null +++ b/src/views/modules/visual/cpts/line-chart.vue @@ -0,0 +1,222 @@ + + + + + diff --git a/src/views/modules/visual/measure/volunteer.vue b/src/views/modules/visual/measure/volunteer.vue index fe191e932..c4447dce2 100644 --- a/src/views/modules/visual/measure/volunteer.vue +++ b/src/views/modules/visual/measure/volunteer.vue @@ -71,35 +71,24 @@
-
-
-
-
调解员
-
-
-
-
调解员
-
-
-
-
能人达人
-
-
-
-
治安巡逻
-
-
-
-
代办员
-
-
-
+
+ +
+ + +
{{item.optionLabel}}
+
+ +
@@ -148,44 +137,20 @@ export default { //地图相关数据 isfirstInit: true,//记录是否是首次加载地图 agencyInfo: {},//登陆者的组织信息:主要为了获取地图中心点和level - unitMapList: [], - unitMapList1: [ - { - type: '党建楼宇', - name: '建联单位1', - latitude: 36.062227, - longitude: 120.389455, - }, - { - type: '党建楼宇', - name: '建联单位2', - latitude: 36.082227, - longitude: 120.389455, - }, - { - 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, - } + distributionsList: [], + + legendArray: [], + + iconUrlArray: [ + require('../../../../assets/img/shuju/volunteer1.png'),//文化队伍 + require('../../../../assets/img/shuju/volunteer2.png'),//楼委会 + require('../../../../assets/img/shuju/volunteer3.png'),//能人达人 + require('../../../../assets/img/shuju/volunteer4.png'),//老友俱乐部 + require('../../../../assets/img/shuju/volunteer5.png'),//代办员 + require('../../../../assets/img/shuju/volunteer6.png'),//调解员 + require('../../../../assets/img/shuju/volunteer7.png'),//采集员 + require('../../../../assets/img/shuju/volunteer8.png'),//治安巡逻 + require('../../../../assets/img/shuju/volunteer9.png'),//其他 ], vPersonal: [], vCount: [], @@ -400,49 +365,58 @@ export default { }, + + //获取联建单位分布图 async getMapUnitList () { - // const url = "/heart/icpartyunit/distribution" - const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/distribution" + const url = "/epmetuser/volunteer/distribution" + // const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/distribution" let params = { - agencyId: this.$store.state.user.agencyId + customerId: this.$store.state.user.customerId } const { data, code, msg } = await requestPost(url, params) if (code === 0) { - // this.unitMapList = data - 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 = data.legends + 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'),//未处理 - require('../../../../assets/img/shuju/measure/jgzs@2x.png'),//已处理 - require('../../../../assets/img/shuju/measure/lxdj@2x.png'),//已处理 - require('../../../../assets/img/shuju/measure/xq@2x.png'),//已处理 - require('../../../../assets/img/shuju/measure/qita.png')//已处理 - ] + }); + this.legendArray.push({ + optionValue: 'other', + optionLabel: '其他', + url: this.iconUrlArray[8] + }) + + 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 this.loadMap() - this.isfirstInit = false } else { @@ -456,7 +430,7 @@ export default { loadMap () { if (this.isfirstInit) { //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 { this.$refs.map.refreshMap(null, this.unitMapList) @@ -485,6 +459,7 @@ export default { .card-wr:last-child { margin-left: 20px; } + padding: 25px 21px 15px 24px; } .card-title { display: flex; @@ -492,10 +467,10 @@ export default { cursor: pointer; .title-icon { display: block; - width: 46px; - height: 34px; + width: 36px; + height: 29px; box-sizing: border-box; - margin-right: 6px; + margin-right: 3px; } .title-label { font-size: 16px; @@ -591,17 +566,20 @@ export default { } .map-tips { - width: 100%; + width: 700px; display: flex; + justify-content: start; flex-wrap: wrap; padding-top: 10px; padding-bottom: 20px; .map-tips-item { display: flex; + align-items: center; - margin-top: 20px; + margin-top: 10px; margin-right: 40px; + .map-tips-icon { width: 20px; height: 10px; @@ -619,10 +597,13 @@ export default { .card-wr-map { height: calc(100vh - 140px); + text-align: center; .card-map { + margin-top: 10px; width: 100%; height: calc(100vh - 285px); + // height: calc(100vh - 295px); .map { width: 100%;