diff --git a/src/assets/img/shuju/measure/jgzs@2x.png b/src/assets/img/shuju/measure/jgzs@2x.png new file mode 100644 index 000000000..fd3e53c80 Binary files /dev/null and b/src/assets/img/shuju/measure/jgzs@2x.png differ diff --git a/src/assets/img/shuju/measure/lxdj@2x.png b/src/assets/img/shuju/measure/lxdj@2x.png new file mode 100644 index 000000000..2db1aea00 Binary files /dev/null and b/src/assets/img/shuju/measure/lxdj@2x.png differ diff --git a/src/assets/img/shuju/measure/ly@2x.png b/src/assets/img/shuju/measure/ly@2x.png new file mode 100644 index 000000000..76303b9c1 Binary files /dev/null and b/src/assets/img/shuju/measure/ly@2x.png differ diff --git a/src/assets/img/shuju/measure/qita.png b/src/assets/img/shuju/measure/qita.png new file mode 100644 index 000000000..82b583cd2 Binary files /dev/null and b/src/assets/img/shuju/measure/qita.png differ diff --git a/src/assets/img/shuju/measure/xq@2x.png b/src/assets/img/shuju/measure/xq@2x.png new file mode 100644 index 000000000..bb4674f9d Binary files /dev/null and b/src/assets/img/shuju/measure/xq@2x.png differ diff --git a/src/assets/img/shuju/top/1.png b/src/assets/img/shuju/top/1.png new file mode 100644 index 000000000..1f4ddc87f Binary files /dev/null and b/src/assets/img/shuju/top/1.png differ diff --git a/src/assets/img/shuju/top/2.png b/src/assets/img/shuju/top/2.png new file mode 100644 index 000000000..fc2e96ca4 Binary files /dev/null and b/src/assets/img/shuju/top/2.png differ diff --git a/src/assets/img/shuju/top/3.png b/src/assets/img/shuju/top/3.png new file mode 100644 index 000000000..7e89e2154 Binary files /dev/null and b/src/assets/img/shuju/top/3.png differ diff --git a/src/assets/scss/modules/visual/people.scss b/src/assets/scss/modules/visual/people.scss index dc7217eb4..f382abc1a 100644 --- a/src/assets/scss/modules/visual/people.scss +++ b/src/assets/scss/modules/visual/people.scss @@ -6,6 +6,8 @@ display: flex; flex-wrap: wrap; justify-content: center; + margin-top: 5px; + .g-l { width: 850px; margin-bottom: 20px; @@ -177,7 +179,7 @@ .m-pop { @include shield; background-color: rgba(#000, 0.9); - overflow-y: scroll; + overflow-y: auto; .wrap { position: relative; @@ -288,7 +290,7 @@ .m-relation { position: relative; - margin-top: 20px; + margin-top: 10px; .title { padding: 10px; @@ -455,7 +457,7 @@ } .tb { height: 300px; - overflow-y: scroll; + overflow-y: auto; @include scrollBar; } } @@ -463,7 +465,7 @@ .m-row { display: flex; justify-content: space-between; - margin-top: 20px; + margin-top: 10px; .m-list { width: calc(50% - 3px); @@ -484,11 +486,124 @@ span { display: block; } + + a { + display: block; + color: rgba(#fff, 0.5); + font-size: 22px; + font-family: PingFang SC; + font-weight: 800; + margin-right: 10px; + cursor: pointer; + + &.z-on { + color: #fff; + cursor: default; + + &:hover { + color: #fff; + text-decoration: none; + } + } + + &:hover { + color: rgba(#fff, 0.5); + text-decoration: underline; + } + } } - .list { + + .list-wrap { height: 480px; - overflow-y: scroll; + overflow-y: auto; @include scrollBar; + + .list { + .item { + position: relative; + background-color: #104ba4; + padding: 10px 20px; + margin-bottom: 4px; + cursor: pointer; + transition: all ease 0.1s; + + .item-row { + display: flex; + justify-content: space-between; + align-items: center; + + .item-l { + width: 25%; + } + .item-r { + width: 75%; + } + + &:hover { + &::before { + content: ""; + position: absolute; + display: block; + left: 0; + top: 0; + bottom: 0; + width: 6px; + background: linear-gradient(270deg, #0336ff, #01b4ff); + border-radius: 2px; + } + + &::after { + content: ""; + position: absolute; + display: block; + left: 15px; + top: 0; + bottom: 0; + margin: auto 0; + width: 0; + height: 0; + border-width: 10px; + border-style: solid; + border-color: transparent transparent transparent #20edff; + } + } + } + + .item-point { + text-align: center; + padding-left: 10%; + height: 16px; + font-size: 22px; + font-family: PingFang SC; + font-weight: bold; + color: #ffffff; + line-height: 12px; + } + + .item-title { + padding: 10px 0; + font-size: 18px; + font-family: PingFang SC; + font-weight: 400; + color: #ffffff; + line-height: 24px; + } + + .item-date { + padding: 10px 0; + border-top: 1px dashed #8398d9; + font-size: 14px; + font-family: PingFang SC; + font-weight: 400; + color: #ffffff; + opacity: 0.67; + } + &:hover { + box-shadow: 0 0 30px 5px inset #22f; + background-color: darken(#104ba4, 12); + } + } + } } } } diff --git a/src/views/modules/visual/basicinfo/cpts/demand-info.vue b/src/views/modules/visual/basicinfo/cpts/demand-info.vue new file mode 100644 index 000000000..31ed33e1e --- /dev/null +++ b/src/views/modules/visual/basicinfo/cpts/demand-info.vue @@ -0,0 +1,503 @@ + + + + + diff --git a/src/views/modules/visual/basicinfo/cpts/incident-info.vue b/src/views/modules/visual/basicinfo/cpts/incident-info.vue new file mode 100644 index 000000000..31ed33e1e --- /dev/null +++ b/src/views/modules/visual/basicinfo/cpts/incident-info.vue @@ -0,0 +1,503 @@ + + + + + diff --git a/src/views/modules/visual/basicinfo/cpts/topic-info.vue b/src/views/modules/visual/basicinfo/cpts/topic-info.vue new file mode 100644 index 000000000..31ed33e1e --- /dev/null +++ b/src/views/modules/visual/basicinfo/cpts/topic-info.vue @@ -0,0 +1,503 @@ + + + + + diff --git a/src/views/modules/visual/basicinfo/people.vue b/src/views/modules/visual/basicinfo/people.vue index e62bd04bf..4335105fd 100644 --- a/src/views/modules/visual/basicinfo/people.vue +++ b/src/views/modules/visual/basicinfo/people.vue @@ -304,16 +304,17 @@ :loading="demand.loading" :header="demand.header" :list="demand.list" + @operate="handleOperateDemandList" > -
+
@@ -326,9 +327,71 @@
- 上报事件 + 上报事件 + 发布话题 +
+
+
+
+
{{ item.eventContent }}
+
{{ item.reportTime }}
+
+
+ +
+ + +
+
+ +
+
+
+
{{ item.eventContent }}
+
{{ item.reportTime }}
+
+
+ +
+ + +
-
@@ -338,11 +401,67 @@ 积分记录 -
+ +
+
+
+
+
+
{{ item.point }}
+
+
+
{{ item.title }}
+
{{ item.dateTime }}
+
+
+
+
+ +
+ + +
+
+ + + + + + @@ -351,6 +470,9 @@ import { Loading } from "element-ui"; //引入Loading服务 import { requestPost } from "@/js/dai/request"; import cptCard from "@/views/modules/visual/cpts/card"; import peopleMore from "@/views/modules/visual/basicinfo/cpts/people-more"; +import demandInfo from "@/views/modules/visual/basicinfo/cpts/demand-info"; +import incidentInfo from "@/views/modules/visual/basicinfo/cpts/incident-info"; +import topicInfo from "@/views/modules/visual/basicinfo/cpts/topic-info"; import cptTb from "@/views/modules/visual/cpts/tb"; export default { @@ -358,10 +480,12 @@ export default { data() { return { showedMoreInfo: false, + showedDemandInfo: false, userId: "", info: { + epmetUserId: "", financialSituation: { monthlyIncome: "", retirementAmount: "" }, gridName: "", houseInfo: [], @@ -413,10 +537,44 @@ export default { ], header: ["序号", "服务时间", "需求类型", "需求内容", "状态", "操作"], list: [], + srcList: [], + currentIndex: 0, pageSize: 5, pageNo: 1, total: 0, }, + + showedIncidentOrTopic: "incident", + + incident: { + loading: false, + list: [], + pageSize: 10, + pageNo: 1, + total: 0, + showedInfo: false, + currentIndex: 0, + }, + + topic: { + loading: false, + list: [], + pageSize: 10, + pageNo: 1, + total: 0, + showedInfo: false, + currentIndex: 0, + }, + + point: { + loading: false, + list: [], + pageSize: 10, + pageNo: 1, + total: 0, + showedInfo: false, + currentIndex: 0, + }, }; }, @@ -434,6 +592,9 @@ export default { cptCard, peopleMore, cptTb, + demandInfo, + incidentInfo, + topicInfo }, watch: { @@ -454,10 +615,13 @@ export default { methods: { handleSearch() {}, - getApiData() { - this.getInfo(); + async getApiData() { + await this.getInfo(); this.getHouseInfo(); this.getDemandData(); + this.getIncidentData(); + this.getTopicData(); + this.getPointData(); }, toUserInfo(uid) { @@ -496,16 +660,23 @@ export default { } }, - handlePageNoChange_demand(val) { + handlePageNoChangeDemand(val) { this.demand.pageNo = val; this.getDemandData(); }, + handleOperateDemandList(index, type) { + if (type == "查看") { + this.showedDemandInfo = true; + this.demand.currentIndex = index; + } + }, + //加载组织数据 async getDemandData() { - const url = - "http://yapi.elinkservice.cn/mock/245/heart/userdemand/mydemand"; + const url = "/heart/userdemand/mydemand"; let params = { + epmetUserId: this.info.epmetUserId, userId: this.userId, pageNo: this.demand.pageNo, pageSize: this.demand.pageSize, @@ -520,12 +691,109 @@ export default { return [ { type: "index" }, item.wantServiceTime, - item.content, item.categoryName, + item.content, item.statusName, { type: "operate", list: ["查看"] }, ]; }); + this.demand.srcList = data.list; + } else { + this.$message.error(msg); + } + }, + + handlePageNoChangeIncident(val) { + this.incident.pageNo = val; + this.getIncidentData(); + }, + + handleClickIncident(index) { + this.incident.showedInfo = true; + this.incident.currentIndex = index; + }, + + //加载组织数据 + async getIncidentData() { + const url = + "http://yapi.elinkservice.cn/mock/245/gov/project/resievent/pageuserreported"; + let params = { + epmetUserId: this.info.epmetUserId, + userId: this.userId, + pageNo: this.incident.pageNo, + pageSize: this.incident.pageSize, + }; + + const { data, code, msg } = await requestPost(url, params); + this.incident.loading = false; + + if (code === 0) { + this.incident.total = data.total; + this.incident.list = data.list; + } else { + this.$message.error(msg); + } + }, + + handlePageNoChangeTopic(val) { + this.topic.pageNo = val; + this.getTopicData(); + }, + + handleClickTopic(index) { + this.topic.showedInfo = true; + this.topic.currentIndex = index; + }, + + //加载组织数据 + async getTopicData() { + const url = + "http://yapi.elinkservice.cn/mock/245/gov/project/resievent/pageuserreported"; + let params = { + epmetUserId: this.info.epmetUserId, + userId: this.userId, + pageNo: this.topic.pageNo, + pageSize: this.topic.pageSize, + }; + + const { data, code, msg } = await requestPost(url, params); + this.topic.loading = false; + + if (code === 0) { + this.topic.total = data.total; + this.topic.list = data.list; + } else { + this.$message.error(msg); + } + }, + + handlePageNoChangePoint(val) { + this.point.pageNo = val; + this.getPointData(); + }, + + handleClickPoint(index) { + this.point.showedInfo = true; + this.point.currentIndex = index; + }, + + //加载组织数据 + async getPointData() { + const url = + "http://yapi.elinkservice.cn/mock/245/point/resi/point/pageuserpoint"; + let params = { + epmetUserId: this.info.epmetUserId, + userId: this.userId, + pageNo: this.point.pageNo, + pageSize: this.point.pageSize, + }; + + const { data, code, msg } = await requestPost(url, params); + this.point.loading = false; + + if (code === 0) { + this.point.total = data.total; + this.point.list = data.list; } else { this.$message.error(msg); } diff --git a/src/views/modules/visual/communityGovern/resiPieOption.js b/src/views/modules/visual/communityGovern/resiPieOption.js index f9493b840..2ee466608 100644 --- a/src/views/modules/visual/communityGovern/resiPieOption.js +++ b/src/views/modules/visual/communityGovern/resiPieOption.js @@ -1,5 +1,5 @@ -export function pieOption () { +export function pieOption (_charts) { const center= ['50%', '250px'] return { title: { @@ -47,25 +47,19 @@ const center= ['50%', '250px'] center: center, radius: ['55%', '55.3%'], label: { - normal: { - show: false - } + show: false }, labelLine: { - normal: { - show: false - } + show: false }, data: [{ value: 360, itemStyle: { - normal: { - color: 'rgba(40, 101, 250, 0)', - width:0, - borderColor: 'rgba(40, 101, 250, 0.5)', - borderWidth: 1, - borderType: 'dotted' - } + color: 'rgba(40, 101, 250, 0)', + width:0, + borderColor: 'rgba(40, 101, 250, 0.5)', + borderWidth: 1, + borderType: 'dotted' } } ] @@ -85,33 +79,55 @@ const center= ['50%', '250px'] left: 'center', width: 400, label: { - position: 'outer', - // alignTo: 'edge', - formatter: '{a|{c}}\n\n{name|{b}}', - // minMargin: 100, - // edgeDistance: 0, - // lineHeight: 20, + // show: false, + position: 'outside', + alignTo: 'edge', + // formatter: '{a|{c}}\n\n{name|{b}}', + formatter: '{a|{c}}\n{r|}\n{name|{b}}', + minMargin: 5, + edgeDistance: 1, + lineHeight: 15, color: '#fff', fontSize: 12, - distanceToLabelLine: -60, + // distanceToLabelLine: -60, rich: { + name: { + padding: [0, 6, 0, 6] + }, a: { - fontSize: '30px', - color: ' #00F5FE', - + fontSize: 30, + color: '#fff', + padding: [0, 6, 6, 6] }, - b: { - lineHeight: 0, - fontSize: '20px', - color: ' #FFFFFF' - + r: { + backgroundColor: 'auto', + borderRadius: 6, + width: 6, + height: 6, + // padding: [3, 3, 0, -12] } } }, labelLine: { + show: false, smooth: 0.2, length: 30, - length2: 90 + length2: 0, + maxSurfaceAngle: 80 + }, + labelLayout: function (params) { + const isLeft = params.labelRect.x < _charts.getWidth() / 2; + const points = params.labelLinePoints; + // Update the end point. + if (points) { + points[2][0] = isLeft + ? params.labelRect.x + : params.labelRect.x + params.labelRect.width; + } + + return { + labelLinePoints: points + }; }, itemStyle: { // color:function(params) { diff --git a/src/views/modules/visual/communityGovern/resibuzz.vue b/src/views/modules/visual/communityGovern/resibuzz.vue index 858ecf93e..403594857 100644 --- a/src/views/modules/visual/communityGovern/resibuzz.vue +++ b/src/views/modules/visual/communityGovern/resibuzz.vue @@ -172,6 +172,7 @@ export default { pageSize: 10, pageNo: 1, total: 0, + pieChartS: null }, casOptions: [], @@ -229,190 +230,209 @@ export default { } }, - pieInitOk () { - console.log('pie准备好了') - 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"; - let params = { - orgId: this.orgId, - }; - - const { data, code, msg } = await requestPost(url, params); - - if (code === 0) { - // 获取pieChart配置 - this.pieOption = pieOption() - if (data && data.length > 0) { - // this.pieData = data + methods: { + pieInitOk (dom) { + console.log('pie准备好了', dom) + this.pieChartS = dom + this.pieInitState = true + }, + getPie () { + if (this.pieInitState) { + this.getPieChart() } else { - this.pieData = [{ count: 0, categoryName: '无分类', color: '#00E5ED' }] + 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"; + let params = { + orgId: this.orgId, + }; + + const { data, code, msg } = await requestPost(url, params); + // 获取pieChart配置 + this.pieOption = pieOption(this.pieChartS) + this.pieOption.title.text = this.pieTotal + this.pieOption.series[1].data = this.pieData - this.pieData.forEach(item => { - item.name = item.categoryName - item.value = item.count - this.colorArray.push(item.color) - this.pieTotal = this.pieTotal + item.value - - }); - + if (code === 0) { + // 获取pieChart配置 + this.pieOption = pieOption() + if (data && data.length > 0) { + // this.pieData = data - this.pieOption.title.text = this.pieTotal - this.pieOption.series[1].itemStyle = { - color: function (params) { - return _that.colorArray[params.dataIndex] + } else { + this.pieData = [{ count: 0, categoryName: '无分类', color: '#00E5ED' }] } - } - this.clickPie(0) - let fun = function (params) { - _that.clickPie(params.dataIndex) - } - this.$refs.pieChart.handleClick(fun) - } else { - this.$message.error(msg); - } + this.pieData.forEach(item => { + item.name = item.categoryName + item.value = item.count + this.colorArray.push(item.color) + this.pieTotal = this.pieTotal + item.value + }); - }, - clickPie (seriesIndex) { - this.pieData.forEach((element, index) => { - if (index === seriesIndex) { - element.label = { - show: true, - - }; - element.labelLine = { - show: true, - lineStyle: { - opacity: 1, + this.pieOption.title.text = this.pieTotal + this.pieOption.series[1].itemStyle = { + color: function (params) { + return _that.colorArray[params.dataIndex] } + } + this.clickPie(0) - }; - + let fun = function (params) { + _that.clickPie(params.dataIndex) + } + this.$refs.pieChart.handleClick(fun) } else { - element.label = { - show: false, - - }; - element.labelLine = { - show: false, - lineStyle: { - opacity: 0, - color: 'rgba(255,255,255,0)' - } + this.$message.error(msg); + } - }; - } - }); - this.pieOption.series[1].data = this.pieData - // this.$refs.pieChart.hideLoading() - this.$refs.pieChart.setOption(this.pieOption) + }, - }, + clickPie (seriesIndex) { + this.pieData.forEach((element, index) => { + if (index === seriesIndex) { + element.label = { + show: true, + + }; + element.labelLine = { + show: true, + lineStyle: { + opacity: 1, + } + + }; + console.log('zhilma') + // element.labelLayout = (params) => { + // const isLeft = params.labelRect.x < this.pieChartS.getWidth() / 2; + // const points = params.labelLinePoints; + // console.log('isLeft', isLeft, points) + // // Update the end point. + // points[2][0] = isLeft + // ? params.labelRect.x + // : params.labelRect.x + params.labelRect.width; + // return { + // labelLinePoints: points + // }; + // } + + } else { + element.label = { + show: false, + + }; + element.labelLine = { + show: false, + lineStyle: { + opacity: 0, + color: 'rgba(255,255,255,0)' + } + + }; - handleChangeState (index) { - this.getTable() - }, + } + }); + this.pieOption.series[1].data = this.pieData + // this.$refs.pieChart.hideLoading() + this.$refs.pieChart.setOption(this.pieOption) - 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 getTable () { - // 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, - pageNo: this.demand.pageNo, - pageSize: this.demand.pageSize, - }; + handleChangeState (index) { + this.getTable() + }, - const { data, code, msg } = await requestPost(url, params); - this.demand.loading = false; + 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) + }, - if (code === 0) { - this.demand.total = data.total; - 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, - { type: "operate", list: ["查看"] }, - ]; - }); - } else { - this.$message.error(msg); - } - }, + //加载组织数据 + async getTable () { + // 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, + pageNo: this.demand.pageNo, + pageSize: this.demand.pageSize, + }; + + const { data, code, msg } = await requestPost(url, params); + this.demand.loading = false; + + if (code === 0) { + this.demand.total = data.total; + 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, + { type: "operate", list: ["查看"] }, + ]; + }); + } else { + this.$message.error(msg); + } + }, - handlePageNoChange_demand (val) { - this.demand.pageNo = val; - this.getTable(); - }, - toUserInfo (uid) { - this.$router.push({ path: `/main-shuju/visual-basicinfo-people/${uid}` }); + handlePageNoChange_demand (val) { + this.demand.pageNo = val; + this.getTable(); + }, + toUserInfo (uid) { + this.$router.push({ path: `/main-shuju/visual-basicinfo-people/${uid}` }); + }, }, - }, - props: { - uid: { - type: String, - default: "", - // default: "8ada68cb6f1e4b9a8333348a39ef3aee", + props: { + uid: { + type: String, + default: "", + // default: "8ada68cb6f1e4b9a8333348a39ef3aee", + }, }, - }, - - computed: {}, - components: { - cptCard, - cptTb, - screenEchartsFrame, - }, + computed: {}, - watch: { - uid (id) { - this.userId = id; + components: { + cptCard, + cptTb, + screenEchartsFrame, }, - userId () { - this.getApiData(); - window.scrollTo(0, 0); + + watch: { + uid (id) { + this.userId = id; + }, + userId () { + this.getApiData(); + window.scrollTo(0, 0); + }, }, - }, -}; + }; + diff --git a/src/views/modules/visual/measure/service.vue b/src/views/modules/visual/measure/service.vue index eff367fef..96cc33bac 100644 --- a/src/views/modules/visual/measure/service.vue +++ b/src/views/modules/visual/measure/service.vue @@ -29,7 +29,7 @@ -
+ + +
+
@@ -173,218 +177,125 @@ export default { async mounted() { await nextTick(100); this.initCharts() - this.initChartType() + // this.initChartType() this.getBuildingwarnlist(); }, methods: { initCharts() { - const eId = document.getElementById('echartOrg') + const eId = document.getElementById('echartsBox') let _charts = echarts.init(eId) + let option = { tooltip: { - show: false, - trigger: 'item' + trigger: 'axis', + axisPointer: { + // Use axis to trigger tooltip + type: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow' + } }, legend: { - show: false, - orient: 'vertical', - top: '40%', - left: 'right', + top: 'bottom', + bottom: 'bottom', textStyle: { color: '#fff' } }, - title: { - text: '12000', //图形标题,配置在中间对应效果图的80% - subtext: '总数', - left: "center", - top: "center", - textStyle: { - color: "#fff", - fontSize: 28, - align: "center" + grid: { + left: '3%', + right: '4%', + bottom: '10%', + containLabel: true + }, + xAxis: { + type: 'category', + axisLabel: { + color: '#fff' + }, + data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] + }, + yAxis: { + type: 'value', + splitLine: { + show: false }, - subtextStyle: { - fontSize: 16, + axisLabel: { color: '#fff' - } + }, + // axisLine: false }, series: [ { - // name: 'Access From', - type: 'pie', - // center: ['10%', '50%'], - radius: ['40%', '60%'], - avoidLabelOverlap: false, - // top: top + '%', - // height: '80%', - left: 'center', - width: 400, + name: '区域化党建单位', + type: 'bar', + stack: 'total', + // barWidth: 20, label: { - show: true, - position: 'outer', - alignTo: 'edge', - formatter: '{a|{c}}\n{r|}\n{name|{b}}', - minMargin: 5, - edgeDistance: 20, - lineHeight: 15, - color: '#fff', - fontSize: 12, - // padding: [5], - distanceToLabelLine: 10, - rich: { - name: { - padding: [0, 6, 0, 6] - }, - a: { - fontSize: 15, - color: '#fff', - padding: [0, 6, 0, 6] - }, - r: { - backgroundColor: 'auto', - borderRadius: 6, - width: 6, - height: 6, - // padding: [3, 3, 0, -12] - } - } + show: true }, emphasis: { - label: { - show: true, - fontSize: '14', - fontWeight: 'bold' - } + focus: 'series' }, - labelLine: { - show: true, - length: 20, - length2: 0, - maxSurfaceAngle: 80, - lineStyle: { - cap: 'round' - } + data: [320, 302, 301, 334, 390, 330, 320] + }, + { + name: '社会组织', + type: 'bar', + stack: 'total', + // barWidth: 20, + label: { + show: true }, - labelLayout: function (params) { - const isLeft = params.labelRect.x < _charts.getWidth() / 2; - const points = params.labelLinePoints; - // Update the end point. - points[2][0] = isLeft - ? params.labelRect.x - : params.labelRect.x + params.labelRect.width; - return { - labelLinePoints: points - }; + emphasis: { + focus: 'series' }, - data: [ - { value: 1048, name: 'Search Engine' }, - { value: 735, name: 'Direct' }, - { value: 580, name: 'Email' }, - { value: 484, name: 'Union Ads' }, - { value: 300, name: 'Video Ads' } - ] - } - ] - } - option && _charts.setOption(option); - - }, - initChartType() { - const eId = document.getElementById('echartType') - let _charts = echarts.init(eId) - let option = { - tooltip: { - trigger: 'item' - }, - legend: { - show: false, - orient: 'vertical', - top: '40%', - left: 'right', - textStyle: { - color: '#fff' - } - }, - title: { - text: '12000', //图形标题,配置在中间对应效果图的80% - subtext: '总数', - left: "center", - top: "center", - textStyle: { - color: "#fff", - fontSize: 28, - align: "center" + data: [120, 132, 101, 134, 90, 230, 210] }, - subtextStyle: { - fontSize: 16, - color: '#fff' - } - }, - series: [ { - // name: 'Access From', - type: 'pie', - // center: ['10%', '50%'], - radius: ['40%', '60%'], - avoidLabelOverlap: false, - // top: top + '%', - // height: '80%', - left: 'center', - width: 400, + name: '社区自组织', + type: 'bar', + stack: 'total', + // barWidth: 20, label: { - position: 'outer', - alignTo: 'labelLine', - formatter: '{name|{b}}\n{time|{c} 小时}', - minMargin: 5, - edgeDistance: 20, - lineHeight: 15, - color: '#fff', - fontSize: 15, - rich: { - time: { - fontSize: 10, - color: '#fff' - } - } + show: true }, emphasis: { - label: { - show: true, - fontSize: '14', - fontWeight: 'bold' - } + focus: 'series' }, - labelLine: { - show: true, - length: 20, - length2: 0, - maxSurfaceAngle: 80 + data: [220, 182, 191, 234, 290, 330, 310] + }, + { + name: '志愿者', + type: 'bar', + stack: 'total', + // barWidth: 20, + label: { + show: true }, - labelLayout: function (params) { - const isLeft = params.labelRect.x < _charts.getWidth() / 2; - const points = params.labelLinePoints; - // Update the end point. - points[2][0] = isLeft - ? params.labelRect.x - : params.labelRect.x + params.labelRect.width; - return { - labelLinePoints: points - }; + emphasis: { + focus: 'series' }, - data: [ - { value: 1048, name: 'Search Engine' }, - { value: 735, name: 'Direct' }, - { value: 580, name: 'Email' }, - { value: 484, name: 'Union Ads' }, - { value: 300, name: 'Video Ads' } - ] + data: [150, 212, 201, 154, 190, 330, 410] + }, + { + name: '未完成', + type: 'bar', + stack: 'total', + // barWidth: 20, + label: { + show: true + }, + emphasis: { + focus: 'series' + }, + data: [820, 832, 901, 934, 1290, 1330, 1320] } ] - } + }; + option && _charts.setOption(option); }, + onClickList(index, level) { this.activeIndex = index; this.activeLevel = level; @@ -597,4 +508,12 @@ export default { } } } + + +.echarts-boxs { + width: 100%; + height: 400px; +} + +