Browse Source

服务未完成

feature
tianq 3 years ago
parent
commit
0e923720db
  1. 37
      src/assets/scss/dataBoard/renfang/index.scss
  2. 154
      src/views/dataBoard/sida/cpts/fwBar.vue
  3. 130
      src/views/dataBoard/sida/cpts/fwBarOption.js
  4. 93
      src/views/dataBoard/sida/cpts/fwPieOption.js
  5. 208
      src/views/dataBoard/sida/fw.vue

37
src/assets/scss/dataBoard/renfang/index.scss

@ -675,3 +675,40 @@
height: 270px;
}
}
.kuangkuang {
width: 100%;
// height: calc(100% - 120px);
border: 0px solid rgb(26, 149, 255);
// background: rgba(26, 149, 255, 0.3);
box-shadow: inset 0px 0px 20px 0px rgba(26, 149, 255, 1);
background: linear-gradient(to left, rgb(26, 149, 255), rgb(26, 149, 255)) left top no-repeat,
linear-gradient(to bottom, rgb(26, 149, 255), rgb(26, 149, 255)) left top no-repeat,
linear-gradient(to left, rgb(26, 149, 255), rgb(26, 149, 255)) right top no-repeat,
linear-gradient(to bottom, rgb(26, 149, 255), rgb(26, 149, 255)) right top no-repeat,
linear-gradient(to left, rgb(26, 149, 255), rgb(26, 149, 255)) left bottom no-repeat,
linear-gradient(to bottom, rgb(26, 149, 255), rgb(26, 149, 255)) left bottom no-repeat,
linear-gradient(to left, rgb(26, 149, 255), rgb(26, 149, 255)) right bottom no-repeat,
linear-gradient(to left, rgb(26, 149, 255), rgb(26, 149, 255)) right bottom no-repeat;
background-size: 3px 10px, 10px 3px, 3px 10px, 10px 3px;
margin-top: 20px;
text-align: center;
color: #fff;
overflow: hidden;
h3 {
font-size: 14px;
font-weight: 400;
color: #ffffff;
line-height: 20px;
margin-top: 16px;
}
h2 {
font-size: 32px;
font-weight: 500;
color: #ffffff;
line-height: 32px;
letter-spacing: 2px;
}
}

154
src/views/dataBoard/sida/cpts/fwBar.vue

@ -0,0 +1,154 @@
<template>
<div class="m-zyqd">
<el-row :gutter="16">
<el-col :span="12">
<div class="kuangkuang">
<h3>公共服务数量</h3>
<h2>256</h2>
</div>
</el-col>
<el-col :span="12">
<div class="kuangkuang">
<h3>指派服务数量</h3>
<h2>2545</h2>
</div>
</el-col>
</el-row>
<div class="pie-main" style="height: 300px;"><screen-echarts-frame class="" @myChartMethod="pieInitOk" ref="pieChart"></screen-echarts-frame></div>
</div>
</template>
<script>
import screenEchartsFrame from '@/views/dataBoard/cpts/screen-echarts-frame/index';
import { pieOption } from './fwBarOption.js';
import { requestPostBi } from '@/js/dai/request-bipass';
export default {
props: {
orgId: {
type: String,
default: ''
}
},
data() {
return {
showNoData: false,
timer: null,
pieChart: '',
pieOption: {},
pieInitState: false,
pieData: [],
tabList: [
'人资源',
'物资源',
'场所资源'
// "",
],
currentTab: '人资源',
info: {}
};
},
components: {
screenEchartsFrame
},
mounted() {
this.init();
},
watch: {
currentTab() {
this.setPieData();
},
orgId() {
this.init();
}
},
methods: {
async init() {
await this.getInfo();
this.getPie();
},
handleClickItem(item) {
// const { type, name } = item;
// this.$router.push({
// path: '/dataBoard/renfang/resi-analyze',
// query: {
// org_id: this.orgId,
// type,
// type_category: this.currentTab,
// type_name: name
// }
// });
},
//
async getInfo() {
let url = 'house_trend';
this.$refs.pieChart.showLoading();
const { data, code, msg } = await requestPostBi(
url,
{
queryParam: {
org_id: this.orgId
}
},
{
// mockId: 60041615,
}
);
this.$refs.pieChart.hideLoading();
if (code === 0) {
if (data && Array.isArray(data) && data.length > 0) {
let info = data[0];
this.info = {
...this.info,
...info
};
}
} else {
this.$message.error(msg);
}
},
selItem(selItem, selIndex) {
this.tabList.forEach((element, index) => {
if (index === selIndex) {
element.sel = true;
} else {
element.sel = false;
}
});
},
pieInitOk() {
this.pieInitState = true;
},
getPie() {
if (this.pieInitState) {
this.setPieData();
} else {
setTimeout(() => {
this.getPie();
}, 500);
}
},
setPieData() {
const { currentTab, info } = this;
data = JSON.parse(JSON.stringify(data).replace(/count/g, 'value'));
console.log('data', data);
this.pieData = data;
this.iniPieChart();
},
//
async iniPieChart() {
this.$refs.pieChart.clear();
// pieChart
this.pieOption = pieOption();
this.pieOption.series[0].name = this.currentTab;
this.pieOption.series[0].data = this.pieData;
this.$refs.pieChart.setOption(this.pieOption);
}
}
};
</script>
<style lang="scss" src="@/assets/scss/dataBoard/renfang/index.scss" scoped></style>

130
src/views/dataBoard/sida/cpts/fwBarOption.js

@ -0,0 +1,130 @@
import * as echarts from 'echarts'
export function pieOption () {
return {
title: {
text: '单位(户)',
left: 5,
textStyle: {
fontSize: 14,
color: " rgba(255,255,255,0.65)",
fontWeight: 400,
},
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
// legend: {},
grid: {
top:40,
left: '3%',
right: '4%',
bottom: 19,
containLabel: true
},
xAxis: [
{
type: 'category',
axisLine: {
lineStyle: {
color:'rgba(255,255,255,0.15)',
width: 1,
type: 'solid'
}
},
axisTick: {
alignWithLabel: true
},
axisLabel: {
show: true,
textStyle: {
color: 'rgba(255,255,255,0.85)', //更改坐标轴文字颜色
fontSize : 12 //更改坐标轴文字大小
}
},
data: []
}
],
yAxis: [
{
type: 'value',
max : 1000,
splitNumber : 5,
splitLine: {
show: true,
lineStyle:{
color:'rgba(255,255,255,0.15)',
width: 1,
type: 'solid'
}
},
axisLabel: {
show: true,
textStyle: {
color: 'rgba(255,255,255,0.85)', //更改坐标轴文字颜色
fontSize : 12 //更改坐标轴文字大小
}
},
}
],
series: [
{
name: '自住房屋',
type: 'bar',
stack: 'Ad',
barWidth:12,
emphasis: {
focus: 'series'
},
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: '#6FDEFF' },
{ offset: 1, color: 'rgba(168,241,255,0)' }
])
},
data: []
},
{
name: '出租房屋',
type: 'bar',
barWidth:12,
stack: 'Ad',
emphasis: {
focus: 'series'
},
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: '#1A95FF' },
{ offset: 1, color: 'rgba(168,241,255,0)' }
])
},
data: []
},
{
name: '闲置房屋',
type: 'bar',
barWidth:12,
stack: 'Ad',
emphasis: {
focus: 'series'
},
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: '#FFAA00' },
{ offset: 1, color: 'rgba(168,241,255,0)' }
])
},
data: []
},
]
}
}

93
src/views/dataBoard/sida/cpts/fwPieOption.js

@ -0,0 +1,93 @@
import * as echarts from 'echarts'
export function pieOption() {
const center = ["50%", "170px"];
return {
title: {
text: "0",
top: 45,
left: "center",
textStyle: {
width: "100%",
fontSize: 24,
color: "#FFFFFF",
fontWeight: 400,
},
itemGap: 5,
// subtext: "总数",
// subtextStyle: {
// fontSize: 20,
// color: "#fff",
// fontWeight: 400,
// },
},
tooltip: {
show: false,
},
// legend: {
// top: 350,
// bottom: 0,
// itemWidth: 20,
// itemHeight: 10,
// textStyle: {
// color: '#D2E7FF',
// fontSize: 16,
// lineHeight: 20,
// },
// },
series: [
{
name: 'Access From',
type: 'pie',
radius: ['60%', '90%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
// emphasis: {
// label: {
// show: true,
// fontSize: 40,
// fontWeight: 'bold'
// }
// },
labelLine: {
show: false
},
itemStyle: {
normal: {
color: (list) => {
// 注意 !!!!! 这里的数组一定要和实际的类目长度相等或大于,不然会缺少颜色报错
var colorList = [
{
colorStart:'#00023A',
colorEnd:'#6FDEFF'
},
{
colorStart:'#00023A',
colorEnd:'#FFAA00'
},
{
colorStart:'#00023A',
colorEnd:'#1A95FF'
},
]
return new echarts.graphic.LinearGradient(1, 0, 0, 0, [{ //左、下、右、上
offset: 0,
color: colorList[list.dataIndex]['colorStart']
}, {
offset: 1,
color: colorList[list.dataIndex]['colorEnd']
}])
}
}
},
data: [
]
}
]
};
}

208
src/views/dataBoard/sida/fw.vue

@ -1,6 +1,6 @@
<template>
<div>
<cpt-bread @tap="clickBreadItem" v-if="breadList.length > 1" :bread-list="breadList" />
<!-- <cpt-bread @tap="clickBreadItem" v-if="breadList.length > 1" :bread-list="breadList" /> -->
<div class="g-row">
<div class="g-left">
<div class="m-box">
@ -9,10 +9,12 @@
<div class="tip_title">图层公共服务数据统计</div>
<div class="title_line"></div>
</div>
<div class="m-subbox"><xqqd :orgId="orgData.org_id"></xqqd></div>
<div class="m-subbox">
<fwBar :orgId="orgData.org_id"></fwBar>
</div>
</div>
<div class="g-center">
</div>
<!-- <div class="g-center">
<div class="m-box">
<div class="m-title">
<img class="title_img" src="@/assets/images/index/list-logo.png" alt />
@ -21,8 +23,8 @@
</div>
<div class="m-subbox"><wtqd :orgId="orgData.org_id"></wtqd></div>
</div>
</div>
<div class="g-right">
</div> -->
<!-- <div class="g-right">
<div class="m-box">
<div class="m-title">
<img class="title_img" src="@/assets/images/index/list-logo.png" alt />
@ -31,9 +33,9 @@
</div>
<div class="m-subbox"><wtqd :orgId="orgData.org_id"></wtqd></div>
</div>
</div> -->
</div>
</div>
<div class="g-row">
<!-- <div class="g-row">
<div class="g-left" style="flex:1">
<div class="m-box">
<div class="m-title">
@ -50,9 +52,9 @@
<fwqd :orgId="orgData.org_id"></fwqd>
</div>
</div>
</div>
<div class="g-left"style="flex:1">
<div class="m-box" >
<div class="g-left" style="flex:1">
<div class="m-box">
<div class="m-title">
<img class="title_img" src="@/assets/images/index/list-logo.png" alt />
<div class="tip_title">政策找人数据统计</div>
@ -62,187 +64,55 @@
</div>
</div>
<cpt-loading v-show="false" />
</div>
</div> -->
</div>
</template>
<script>
import gridMap from '@/views/dataBoard/cpts/map/index';
import xqqd from '@/views/dataBoard/sida/cpts/xqqd';
import wtqd from '@/views/dataBoard/sida/cpts/wtqd';
import zyqd from '@/views/dataBoard/sida/cpts/zyqd';
import fwqd from '@/views/dataBoard/sida/cpts/fwqd';
import sqpj from '@/views/dataBoard/sida/cpts/sqpj';
import cptLoading from '@/views/dataBoard/cpts/loading';
import { requestPostBi } from '@/js/dai/request-bipass';
import { requestPost } from '@/js/dai/request';
import getQueryPara from 'dai-js/modules/getQueryPara';
import cptBread from '@/views/dataBoard/renfang/cpts/bread';
import fwBar from '@/views/dataBoard/sida/cpts/fwBar';
export default {
name: 'sida',
props: {
orgId: {
type: String,
default: ''
}
},
components: {
gridMap,
xqqd,
wtqd,
zyqd,
fwqd,
sqpj,
cptLoading
fwBar
},
data() {
return {
breadList: [
{
orgId: '',
orgLevel: '',
meta: { title: '服务清单数据统计' }
}
],
loading: false,
orgData: {
children: []
}, //
orgId: '',
orgLevel: ''
showNoData: false,
barChart: '',
barOption: {},
barInitState: false,
barData: []
};
},
mounted() {
const queryOrgId = getQueryPara('orgId');
const queryOrgLevel = getQueryPara('orgLevel');
this.init(queryOrgId, queryOrgLevel);
},
watch: {},
components: {
cptBread
watch: {
},
methods: {
clickBreadItem({ item }) {
this.toBread(item);
},
async init(queryOrgId, queryOrgLevel) {
if (queryOrgId) {
this.orgId = queryOrgId;
this.orgLevel = queryOrgLevel || 'agency';
} else {
this.orgId = this.$store.state.user.agencyId;
this.orgLevel = 'agency';
toListPage(type = '', type_name = '') {
this.$router.push({
path: '/dataBoard/renfang/house-list',
query: {
org_id: this.orgId,
type,
type_name
}
//
this.loading = false;
// await this.loadOrgData();
await this.getMapData();
await this.getSubMapData();
this.loading = true;
});
},
handleClickDotBtn(type, info) {
// console.log('handleClickDotBtn', type, info);
// if (type == 'watch-resi') {
// this.displayedResiId = info.user_id;
// } else if (type == 'watch-house') {
// this.displayedHouseId = info.house_id;
// }
},
clickBreadItem({ item }) {
// this.toBread(item);
},
clickAgencyItem(item) {
// console.log(item);
// this.toBread({
// orgId: item.id,
// orgLevel: item.level,
// meta: {
// title: item.name
// }
// });
},
// toBread(item) {
// const { orgId } = item;
// const { breadList } = this;
// let index = breadList.findIndex(val => val.orgId === orgId);
// // return console.log(item, breadList, index);
// if (index >= 0) {
// this.breadList = breadList.slice(0, index + 1);
// } else {
// breadList.push(item);
// this.breadList = breadList;
// }
// this.init(item.orgId, item.orgLevel);
// },
//
//
async getMapData() {
console.log('=========================getMapData');
const url = 'org_map';
const { data, code, msg } = await requestPostBi(
url,
{
queryParam: {
org_id: this.orgId
}
},
{
// mockId: 60810589,
}
);
if (code === 0) {
let info = data[0];
this.orgData = {
...info,
id: info.org_id,
name: info.org_name,
latitude: parseFloat(info.latitude),
longitude: parseFloat(info.longitude),
coordinates: info.coordinates || '',
children: []
};
this.orgId = this.orgData.org_id;
this.orgLevel = this.orgData.level;
} else {
this.$message.error(msg);
}
},
//
async getSubMapData() {
console.log('=========================getSubMapData');
const url = 'sub_org_map';
const { data, code, msg } = await requestPostBi(
url,
{
queryParam: {
org_id: this.orgId
}
},
{
// mockId: 61831860,
}
);
if (code === 0) {
const { orgData } = this;
orgData.children = data.map(item => {
return {
...item,
id: item.org_id,
name: item.org_name,
latitude: parseFloat(item.latitude),
longitude: parseFloat(item.longitude),
coordinates: item.coordinates || ''
};
});
this.orgData = {
...orgData
};
console.log('==========================getSubMapData:result', this.orgData);
} else {
this.$message.error(msg);
}
}
}
};
</script>
<style lang="scss" src="@/assets/scss/dataBoard/renfang/index.scss" scoped></style>
<style lang="scss" src="@/assets/scss/dataBoard/listBox.scss" scoped></style>

Loading…
Cancel
Save