Browse Source

Merge branch 'dev-0420' of http://git.elinkit.com.cn:7070/r/epmet-oper-gov into dev-0420

shibei_master
dai 3 years ago
parent
commit
7543749620
  1. BIN
      src/assets/img/shuju/logo1.png
  2. 344
      src/assets/scss/modules/visual/houseStatic.scss
  3. 5
      src/router/index.js
  4. 115
      src/views/components/rangeInput.vue
  5. 141
      src/views/components/resiSearch.vue
  6. 3
      src/views/modules/base/community/buildTable.vue
  7. 139
      src/views/modules/base/resi.vue
  8. 3
      src/views/modules/visual/basicinfo/basicInfoCommunity.vue
  9. 633
      src/views/modules/visual/basicinfo/houseStatic/houseStatic.vue
  10. 180
      src/views/modules/visual/basicinfo/houseStatic/options.js
  11. 182
      src/views/modules/visual/basicinfo/houseStatic/userOptions.js
  12. 4
      src/views/modules/visual/communityGovern/typeAnalyze.vue

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

344
src/assets/scss/modules/visual/houseStatic.scss

@ -0,0 +1,344 @@
.warning-box{
padding: 0 21px 20px 24px
}
.no-data{
margin-top:50px;
display:flex;
justify-content: center;
}
.card-title {
display: flex;
align-items: center;
cursor: pointer;
.title-icon {
display: block;
width: 46px;
height: 34px;
box-sizing: border-box;
margin-right: 6px;
}
::v-deep .el-dropdown {
font-size: 18px;
color: #fff;
font-weight: 800;
}
.title-time {
display: flex;
align-items: center;
box-sizing: border-box;
margin-left: 30px;
font-size: 14px;
color: #fff;
.title-time-label {
margin-right: 10px;
}
::v-deep .el-date-editor--month {
width: 100px;
.el-input__inner {
width: 100px;
height: 24px;
box-sizing: border-box;
padding: 0;
font-size: 14px;
color: #fff;
line-height: 24px;
text-align: center;
background: #06186d;
border: 1px solid #1a64cc;
border-radius: 2px;
}
.el-input__prefix {
display: none;
}
.el-input__suffix {
right: 0;
.el-input__icon {
line-height: 24px;
}
}
}
}
.title-label {
font-size: 20px;
font-weight: 800;
::v-deep .el-input {
width: 180px;
.el-input__inner {
font-size: 18px;
// font-weight: 800;
color: #fff;
background: #06186d;
border: 1px solid #1a64cc;
}
.el-icon-arrow-down::before {
content: "\e790";
}
}
}
}
.card-left-title {
margin-top: 20px;
position: relative;
padding-left: 40px;
font-size: 16px;
font-weight: 500;
color: #fff;
}
.card-left-title::after {
content: "";
position: absolute;
top: 5%;
left: 20px;
width: 12px;
height: 12px;
box-sizing: border-box;
background: #2865fa;
border-radius: 50%;
}
.card-echart {
min-height: 500px;
display: flex;
margin-top: 10px;
height: 100%;
.card-left {
position: relative;
flex-grow:0;
flex-shrink:0;
width:50%;
height: 100%;
.div-chart{
display: flex;
width: 100%;
.echart-wr{
flex-shrink: 0;
height: 420px;
width: 70%;
}
.div-tip{
flex-shrink: 0;
width: 30%;
display: flex;
flex-direction: column;
justify-content: center;
margin-left:20px;
margin-top: -23px;
display: flex;
justify-content: center;
.legend_item {
margin-top: 30px;
.item_name {
margin-left: 5px;
font-size: 10px;
font-family: PingFang SC;
font-weight: 500;
color: #eff0f1;
}
> img {
margin-top: -10px;
width: 80px;
height: 10px;
}
}
}
.div-tip2{
flex-shrink: 0;
width: 30%;
display: flex;
flex-direction: column;
justify-content: center;
margin-left:20px;
margin-top: -23px;
display: flex;
justify-content: center;
.cz-tip{
display: flex;
justify-content: flex-start;
margin-top: 30px;
.cz-tip-dot {
margin-top:2px;
width: 20px;
height: 10px;
background: #1B51FF;
border-radius: 4px;
}
>span{
margin-left:10px;
}
}
.ld-tip{
display: flex;
justify-content: flex-start;
margin-top: 30px;
.ld-tip-dot{
margin-top:2px;
width: 20px;
height: 10px;
background: #00E5ED;
border-radius: 4px;
}
>span{
margin-left:10px;
}
}
}
}
.pie-table{
margin-top:0px;
display: flex;
justify-content: center;
align-items:center;
}
.loading-status{
width: 100%;
display: flex;
justify-content: center;
margin-top: 200px;
}
}
}
.card-table{
margin:37px 70px 0;
.table_item{
padding:31px 60px 36px 30px;
.item_name{
font-size: 18px;
font-family: PingFang SC;
font-weight: bold;
color: #FFFFFF;
>img{
width:25px;
height:14px;
padding-right: 10px;
}
}
.item_name:hover{
cursor: pointer;
}
.item_data{
margin-top:31px;
display: flex;
justify-content: space-between;
}
.item_left{
align-items: center;
display: flex;
justify-content: space-around;
flex-grow:0;
flex-shrink:0;
}
.item_right{
align-items: center;
display: flex;
justify-content: space-around;
flex-grow:0;
flex-shrink:0;
// margin-left:250px;
}
}
.item_dark{
background: #082586;
opacity: 0.85;
}
}
.pie-table-total{
margin-left:40px;
.pie-table-total-count{
min-width: 98px;
text-align: center;
font-size: 40px;
font-family: PingFang SC;
font-weight: bold;
color: #FFFFFF;
}
.zz{
font-size: 35px;
font-family: PingFang SC;
font-weight: bold;
color: #FAC126;
}
.cz{
font-size: 35px;
font-family: PingFang SC;
font-weight: bold;
color: #45D97F;
}
.xz{
font-size: 35px;
font-family: PingFang SC;
font-weight: bold;
color: #2865FA;
}
.colorwhite{
font-size: 35px;
font-family: PingFang SC;
font-weight: bold;
color: #ffffff;
}
.pie-table-title{
margin-top:7px;
text-align: center;
font-size:10px;
font-family: PingFang SC;
font-weight: 400;
color: #FFFFFF;
min-width:62px;
}
.table-table-title{
margin-top:2px;
}
}
.pie-table-line{
margin-left:40px;
height:30px;
width:1px;
background-color: #1797FF;
opacity: 0.5;
}
.table-table-line{
}

5
src/router/index.js

@ -239,6 +239,11 @@ router.beforeEach((to, from, next) => {
name: "人员类别分析",
id: "5fwaefwaefawef5",
},
{
url: "/visual/basicinfo/houseStatic/houseStatic",
name: "人房概览统计",
id: "5fwaefwaefawef6",
},
],
},
{

115
src/views/components/rangeInput.vue

@ -0,0 +1,115 @@
<template>
<el-form :model="inputForm" :rules="rules" class="demo-form-inline">
<div class="flex-div">
<el-form-item prop="start">
<el-input
v-model="inputForm.start"
class="wd50"
size="small"
:type="inputType"
clearable
placeholder="请输入内容"
@change="handleChange"
/>
</el-form-item>
<div>-</div>
<el-form-item prop="end">
<el-input
v-model="inputForm.end"
class="wd50"
size="small"
:type="inputType"
clearable
placeholder="请输入内容"
@change="handleChange"
@blur="handleBlur"
/>
</el-form-item>
</div>
</el-form>
</template>
<script>
export default {
name: 'inputRange',
model: {
prop: 'value',
event: 'change'
},
props: {
value: {
type: Object,
default: () => {
return {
start: '',
end: ''
}
}
},
type: {
type: String,
default: ''
}
},
data() {
let checkAge = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入内容'))
} else {
if (value < this.inputForm.start) {
callback(new Error('结束值不能小于开始值'))
}
callback()
}
}
return {
inputForm: {...this.value},
rules: {
end: [
{ validator: checkAge, trigger: 'blur' }
],
}
}
},
computed: {
inputType() {
if (this.type == 'num') return 'number'
}
},
watch: {
'value.start'(val) {
this.inputForm.start = val
},
'value.end'(val) {
this.inputForm.end = val
},
},
methods: {
handleChange(val) {
// if ()
this.$emit('change', { ...this.inputForm})
},
handleBlur() {
}
}
}
</script>
<style lang="scss" scoped>
.flex-div {
display: flex;
align-items: center;
}
.wd50 {
// width: 45%;
}
.demo-form-inline {
::v-deep .el-form-item {
width: 40%;
margin: 0;
}
}
</style>

141
src/views/components/resiSearch.vue

@ -1,8 +1,8 @@
<template>
<div class="resi-container">
<el-card class="resi-card">
<el-row class="resi-row-box" :class="openSearch && 'resi-row-more'">
<el-row class="resi-row">
<!-- <el-card class="resi-card"> -->
<el-row class="resi-row-box" :class="!isArrow && 'resi-row-more'">
<el-row v-if="showGrid" class="resi-row">
<el-col :span="6">
<div class="resi-cell">
<div class="resi-cell-label">所属网格</div>
@ -107,13 +107,13 @@
</el-col>
</el-row>
<el-row
v-for="(item, index) in sliceList(formList, 4)"
v-for="(item, index) in sliceList(itemList, 4)"
:key="index"
class="resi-row"
>
<el-col v-for="n in item" :key="n.id" :span="6">
<el-col v-for="n in item" :key="n.id" :span="computdSpan(item.length)">
<div class="resi-cell">
<div class="resi-cell-label">{{ n.label }}</div>
<div class="resi-cell-label" :class="item.length != 4 && 'resi-cell-label1'">{{ n.label }}</div>
<div
class="resi-cell-value"
:class="n.itemType === 'radio' && 'resi-cell-value-radio'"
@ -127,6 +127,16 @@
placeholder="请输入内容"
>
</el-input>
<template v-else-if="n.itemType == 'inputRange'">
<!-- <el-input
v-model.trim="form[n.columnName]"
class="resi-cell-input"
size="small"
clearable
placeholder="请输入内容"
/> -->
<inputRange v-model="form[n.columnName]" :type="n.validType" @change="handleAgeChange" />
</template>
<template v-else-if="n.itemType === 'datepicker'">
<el-date-picker
v-if="n.queryType === 'daterange'"
@ -182,12 +192,18 @@
class="resi-cell-select"
>
</el-cascader>
<template v-else-if="n.itemType === 'checkbox'">
<el-checkbox-group v-model="form[n.columnName]">
<el-checkbox v-for="ns in n.options" :key="ns.value" :label="ns.value">{{ns.label}}</el-checkbox>
<!-- <el-checkbox label="n.la"></el-checkbox> -->
</el-checkbox-group>
</template>
</div>
</div>
</el-col>
</el-row>
</el-row>
<el-row class="resi-search">
<el-row v-if="isArrow" class="resi-search">
<!-- <el-col :span="20">
<el-button type="primary" size="mini">查询</el-button>
</el-col> -->
@ -196,17 +212,21 @@
<el-button class="diy-button--reset" size="small" @click="resetForm">重置</el-button>
</el-col>
</el-row>
<div class="resi-down" @click="handleOpenSearch">
<!-- <div v-if="isArrow" class="resi-down" @click="handleOpenSearch">
<img v-if="openSearch" src="../../assets/img/arrow-up.png" />
<img v-else src="../../assets/img/arrow-down.png" />
</div>
</el-card>
</div> -->
<!-- </el-card> -->
</div>
</template>
<script>
import inputRange from './rangeInput.vue'
export default {
name: 'ResiSearch',
components: {
inputRange
},
props: {
formList: {
type: Array,
@ -215,6 +235,14 @@ export default {
columnName: {
type: String,
default: ''
},
showGrid: {
type: Boolean,
default: false
},
isArrow: {
type: Boolean,
default: false
}
},
data() {
@ -226,13 +254,23 @@ export default {
// return _form
// }
arr.forEach((item) => {
if (columnName && columnName === item.columnName) _form[item.columnName] = '1'
if (item.itemType == 'checkbox') _form[item.columnName] = []
else if (columnName && columnName === item.columnName) _form[item.columnName] = '1'
else if (item.itemType == 'inputRange') _form[item.columnName] = { start: '', end: ''}
else _form[item.columnName] = ''
})
return _form
}
let form = initForm(this.formList, this.columnName)
let tempFormList = this.formList.map(item => {
let itemList = this.formList.map(item => {
if (item.itemType == 'inputRange' && item.funType == 'agetoyear') {
item.columnName = 'age'
}
return {
...item
}
})
let form = initForm(itemList, this.columnName)
let tempFormList = itemList.map(item => {
return {
...item,
@ -256,6 +294,7 @@ export default {
optionsD: [],
optionsG: [],
value: '',
itemList,
fixedList: [],
fixedForm: {
GRID_ID: '',
@ -332,7 +371,7 @@ export default {
},
changeDDisabled() {
return !this.form.UNIT_ID
}
},
},
watch: {
form: {
@ -352,6 +391,7 @@ export default {
created() {
// this.initForm()
// console.log('formcccc---', this.form)
this.getGridList()
this.getValiheList()
if (this.columnName) this.handleChangeForm(this.columnName)
@ -363,6 +403,9 @@ export default {
})
console.log('formcccc---', this.form)
},
computdSpan(len) {
return len == 1 ? 24 : 6
},
handleClearVillage() {
this.form.BUILD_ID = ''
this.form.HOME_ID = ''
@ -378,28 +421,37 @@ export default {
},
resetForm(formName) {
for(const n in this.form) {
this.form[n] = ''
if (n == 'age') {
this.form.age = {
start: '',
end: ''
}
} else if (typeof this.form[n] == 'object') this.form[n] = []
else this.form[n] = ''
}
this.handleSearch()
// let arr3 = [...arr1, ...arr]
this.$emit('search', [])
// this.handleSearch()
},
handleSearch() {
// console.log('formmmmm---', this.form)
const itemTypes = ['daterange', 'timerange']
let arr = this.tempFormList
.filter((n) => n.isChange)
.map((item) => {
const itemTypes = ['daterange', 'timerange', 'checkbox']
let a = this.tempFormList.filter(item => item.itemType != 'inputRange')
let arr = a.filter((n) => n.isChange).map((item) => {
return {
queryType: item.queryType,
tableName: item.tableName,
columnName: item.columnName,
// columnValue: []
columnValue:
itemTypes.includes(item.queryType) ||
columnValue: this.form[item.columnName] &&
(itemTypes.includes(item.queryType) ||
itemTypes.includes(item.itemType)
? this.form[item.columnName]
: [this.form[item.columnName].toString()]
: [this.form[item.columnName].toString()])
}
})
const arr2 = arr.filter(item => item.columnValue.length > 0)
let arr1 = this.fixedList
.filter((n) => n.columnValue.length > 0)
.map((item) => {
@ -407,12 +459,21 @@ export default {
...item
}
})
let arr3 = [...arr1, ...arr]
let arr3 = [...arr1, ...arr2]
this.$emit('search', arr3)
return arr3
},
handleOpenSearch() {
this.openSearch = !this.openSearch
},
handleAgeChange(val) {
console.log('val----age---', val)
if (val.end) {
const s = this.computedBirth(val.end)
const e = this.computedBirth(val.start)
this.form.BIRTHDAY = [s, e]
}
},
handleChangeGrid(val) {
console.log('val', val)
this.form.VILLAGE_ID = ''
@ -563,16 +624,35 @@ export default {
.catch(() => {
return this.$message.error('网络错误')
})
},
computedBirth(age) {
let now = new Date();
let nowYear = now.getFullYear();
let nowMonth = now.getMonth()+1;
let nowDay = now.getDate(); // daymonthmonthyearyear
let subYear = nowYear - age
if(nowMonth < 10){
nowMonth = '0'+ nowMonth
}
if(nowDay < 10){
nowDay = '0' + nowDay
}
console.log(subYear+'-'+nowMonth+'-'+nowDay);
return subYear + '-' + nowMonth + '-' + nowDay
}
}
}
</script>
<style lang="scss" scope>
.resi-container .resi-card {
position: relative;
overflow: visible;
}
// .resi-container {
// position: relative;
// overflow: visible;
// }
// .resi-container .resi-card {
// position: relative;
// overflow: visible;
// }
.resi-down {
position: absolute;
left: 50%;
@ -614,12 +694,15 @@ export default {
align-items: center;
.resi-cell-label {
flex-shrink: 0;
width: 70px;
min-width: 70px;
box-sizing: border-box;
margin-right: 15px;
text-align: right;
// line-height: 32;
}
.resi-cell-label1 {
width: max-content;
}
.resi-cell-value-radio {
display: flex;
align-items: center;

3
src/views/modules/base/community/buildTable.vue

@ -92,6 +92,9 @@
<el-table-column prop="totalFloorNum"
label="层数">
</el-table-column>
<el-table-column prop="realTotalHouseNum"
label="实际录入总数">
</el-table-column>
<el-table-column prop="totalHouseNum"
label="总户数">
</el-table-column>

139
src/views/modules/base/resi.vue

@ -1,10 +1,39 @@
<template>
<div class="resi-container">
<resi-search v-if="searchList.length > 0"
ref="resiSearch"
:form-list="searchList"
:column-name="defaultCategotyKey"
@search="handleSearch" />
<el-card class="resi-card">
<el-collapse v-if="openSearch" v-model="activeNames">
<el-collapse-item v-for="item in searchList" :key="item.itemGroupId"
:title="item.groupName" :name="item.itemGroupId">
<resi-search v-if="searchList.length > 0"
:ref="'resiSearch' + item.itemGroupId"
:form-list="item.queryItemList"
:column-name="defaultCategotyKey"
:show-grid="item.groupName == '基础信息'"
/>
</el-collapse-item>
</el-collapse>
<template v-else>
<resi-search v-if="searchList.length > 0"
ref="resiSearch"
:form-list="searchList[0].queryItemList"
:column-name="defaultCategotyKey"
:is-arrow="true"
@search="handleSearch" />
</template>
<el-row v-if="openSearch" class="resi-search">
<!-- <el-col :span="20">
<el-button type="primary" size="mini">查询</el-button>
</el-col> -->
<el-col :span="24">
<el-button type="primary" size="small" @click="handleSearchFrom">查询</el-button>
<el-button class="diy-button--reset" size="small" @click="resetSearchForm">重置</el-button>
</el-col>
</el-row>
<div class="resi-down" @click="handleOpenSearch">
<img v-if="openSearch" src="../../../assets/img/arrow-up.png" />
<img v-else src="../../../assets/img/arrow-down.png" />
</div>
</el-card>
<el-card class="resi-card-table">
<div class="resi-row-btn">
<el-button size="small"
@ -277,6 +306,7 @@ import { mapGetters } from 'vuex'
import resiTransfer from '../../components/resiTransfer.vue'
import resiChangeRecord from '../../components/resiChangeRecord.vue'
import peopleMore from "@/views/modules/shequ/cpts/people-more";
import { listen } from 'ol/events'
export default {
components: {
@ -289,6 +319,8 @@ export default {
},
data () {
return {
activeNames: [],
openSearch: false,
exportBtn: false,
exportBtnTitle: '导出',
importBtnTitle: '导入',
@ -342,11 +374,12 @@ export default {
},
async activated () {
if (this.$route.query) {
console.log('this.$route.query---', this.$route.query)
if (this.$route.query && this.$route.query.columnName) {
this.searchList = []
let query = this.$route.query
this.defaultCategotyKey = query.columnName
console.log(this.defaultCategotyKey)
console.log('defaultCategotyKey----', this.defaultCategotyKey)
await this.getSearchList()
this.$refs.resiSearch.handleSearch()
}
@ -419,6 +452,11 @@ export default {
this.tranferShow = false
this.getTableData()
},
handleOpenSearch() {
if (!this.openSearch) this.activeNames = [this.searchList[0].itemGroupId]
this.openSearch = !this.openSearch
},
computedWidth (label, type) {
let wd = ''
@ -514,12 +552,39 @@ export default {
return _val || row[item.columnName]
},
handleSearchFrom() {
let arr = []
this.searchList.forEach(item => {
const arr1 = this.$refs[`resiSearch${item.itemGroupId}`][0].handleSearch()
arr = arr.concat(arr1)
// console.log('search-----refs', this.$refs[`resiSearch${item.itemGroupId}`])
})
console.log('search-----refs', this.$refs)
console.log('search-----arr', arr)
this.currentPage = 1
this.conditions = arr
this.getTableData()
},
handleSearch (val) {
console.log('searchhh--', val)
this.currentPage = 1
this.conditions = val
this.getTableData()
},
resetSearchForm(formName) {
// for(const n in this.form) {
// this.form[n] = ''
// }
// this.handleSearch()
this.searchList.forEach(item => {
this.$refs[`resiSearch${item.itemGroupId}`][0].resetForm()
// console.log('search-----refs', this.$refs[`resiSearch${item.itemGroupId}`])
})
this.currentPage = 1
this.conditions = []
this.getTableData()
},
async handleExportModule () {
let url = "/epmetuser/icresiuser/import/download-template"
@ -1055,8 +1120,9 @@ export default {
return options
},
async getSearchList () {
// /oper/customize/icform/conditionlist
await this.$http
.post('/oper/customize/icform/conditionlist', {
.post('/oper/customize/icform/conditionlist-bygroup', {
formCode: 'resi_base_info',
dynamic: true
})
@ -1065,15 +1131,29 @@ export default {
return this.$message.error(res.msg)
} else {
console.log('获取查询详情成功--sss', res)
this.searchList = res.data
res.data.forEach((item) => {
if (item.optionSourceType === 'remote') {
this.getOptionsList(item.optionSourceValue).then((res) => {
item.options = res
})
// console.log('')
}
item.queryItemList.forEach(n => {
if (n.optionSourceType === 'remote') {
this.getOptionsList(n.optionSourceValue).then((res) => {
n.options = res
})
// console.log('')
} else if (n.itemType == 'radio' && n.options.length == 0) {
n.options = [
{
label: "是",
value: "1"
},
{
label: "否",
value: "0"
}
]
}
})
})
this.searchList = res.data
}
})
.catch(() => {
@ -1197,6 +1277,10 @@ export default {
background: linear-gradient(90deg, #1a5afd, #26c4ff);
}
}
.resi-container .resi-card {
position: relative;
overflow: visible;
}
.resi-container .resi-card-table {
::v-deep .el-table th {
color: #fff;
@ -1216,6 +1300,31 @@ export default {
color: rgba(0, 167, 169, 1);
}
}
.resi-search {
// padding-right: 20px;
margin-top: 10px;
.el-col {
text-align: right;
}
}
.resi-down {
position: absolute;
left: 50%;
bottom: -10px;
display: flex;
justify-content: center;
align-items: center;
width: 46px;
height: 12px;
box-sizing: border-box;
margin-left: -23rpx;
cursor: pointer;
background: #ffffff;
border-radius: 0 0 10px 10px;
img {
display: block;
}
}
</style>
<style lang="scss" scoped>

3
src/views/modules/visual/basicinfo/basicInfoCommunity.vue

@ -184,6 +184,8 @@ export default {
if (this.selBuildingId) {
await this.loadRoom()
} else {
this.roomArray = []
}
},
@ -250,6 +252,7 @@ export default {
//
handleClickUser (userId) {
this.handleCloseAllUser()
this.$emit('toSubAgency', 'people', userId, "")
},
//infolist

633
src/views/modules/visual/basicinfo/houseStatic/houseStatic.vue

@ -0,0 +1,633 @@
<template>
<div class="warning-box">
<!-- 组织路由 -->
<div class="div_top">
<div class="router_line"></div>
<div class="div_router">
<span class="router_parents"
v-for="(item,index) in runAgencyArray"
@click="handleClickAgency(index)"
:key="index">{{item.orgName}}<span class="arrow">></span></span>
<span class="router_child">{{orgName}}</span>
</div>
</div>
<cpt-card>
<div class="card-title">
<img class="title-icon"
src="@/assets/img/shuju/title-tip.png" />
<div class="title-label">
人房概览统计
</div>
</div>
<div class="card-left-title">本级人房概览数据统计</div>
<div class="card-echart">
<div class="card-left">
<div v-if="!dataLoading"
class="div-chart">
<screen-echarts-frame class="echart-wr"
@myChartMethod="housePieInitOk"
ref="housePieChart"></screen-echarts-frame>
<div class="div-tip">
<div :class="['legend_item',{'item_last':index===legendArray.length-1}]"
v-for="(item,index) in legendArray"
:key="index">
<div class="item_name">{{item.name}}</div>
<img :src="item.url" />
</div>
</div>
</div>
<div v-if="!dataLoading"
class="pie-table">
<div class="pie-table-total">
<div class="pie-table-total-count">{{houseData.houseTotal}}</div>
<div class="pie-table-title">房屋总数</div>
</div>
<div class="pie-table-line"></div>
<div class="pie-table-total ">
<div class="pie-table-total-count zz">{{houseData.zzHouseTotal}}</div>
<div class="pie-table-title">自住房屋数</div>
</div>
<div class="pie-table-total ">
<div class="pie-table-total-count cz">{{houseData.czHouseTotal}}</div>
<div class="pie-table-title">出租房屋数</div>
</div>
<div class="pie-table-total ">
<div class="pie-table-total-count xz">{{houseData.xzHouseTotal}}</div>
<div class="pie-table-title">闲置房屋数</div>
</div>
</div>
<div class="loading-status"
v-if="dataLoading">
<screen-loading>加载中</screen-loading>
</div>
</div>
<div class="card-left">
<div v-if="!dataLoading"
class="div-chart">
<screen-echarts-frame class="echart-wr"
@myChartMethod="userPieInitOk"
ref="userPieChart"></screen-echarts-frame>
<div class="div-tip2">
<div class="cz-tip">
<div class="cz-tip-dot"></div>
<span>常住人口数</span>
</div>
<div class="ld-tip">
<div class="ld-tip-dot"></div>
<span>流动人口数</span>
</div>
</div>
</div>
<div v-if="!dataLoading"
class="pie-table">
<div class="pie-table-total">
<div class="pie-table-total-count">{{userData.userTotal}}</div>
<div class="pie-table-title">居民总数</div>
</div>
<div class="pie-table-line"></div>
<div class="pie-table-total ">
<div class="pie-table-total-count zz">{{userData.czUserTotal}}</div>
<div class="pie-table-title">常住人口数</div>
</div>
<div class="pie-table-total ">
<div class="pie-table-total-count cz">{{userData.ldUserTotal}}</div>
<div class="pie-table-title">流动人口数</div>
</div>
</div>
<div class="loading-status"
v-if="dataLoading">
<screen-loading>加载中</screen-loading>
</div>
</div>
</div>
<div class="card-left-title">下级人房概览数据统计</div>
<div v-if="subList.length>0"
class="card-table">
<div v-for="(item,index) in subList"
:key="index"
:class="['table_item',index%2 === 0?'item_dark':'']">
<div class="item_name"
@click="handleToSubAgency(item)">
<img src="@/assets/img/shuju/logo1.png" />
<span>{{item.orgName}}</span>
</div>
<div class="item_data">
<div class="item_left">
<div class="pie-table-total">
<div class="pie-table-total-count">{{item.houseTotal}}</div>
<div class="pie-table-title">房屋总数</div>
</div>
<div class="pie-table-line"></div>
<div class="pie-table-total ">
<div class="pie-table-total-count colorwhite">{{item.zzHouseTotal}}</div>
<div class="pie-table-title table-table-title">{{item.zzHouseRatio+'%'}}</div>
<div class="pie-table-title table-table-title">自住房屋数</div>
</div>
<div class="pie-table-total ">
<div class="pie-table-total-count colorwhite">{{item.czHouseTotal}}</div>
<div class="pie-table-title table-table-title">{{item.czHouseRatio+'%'}}</div>
<div class="pie-table-title table-table-title">出租房屋数</div>
</div>
<div class="pie-table-total ">
<div class="pie-table-total-count colorwhite">{{item.xzHouseTotal}}</div>
<div class="pie-table-title table-table-title">{{item.xzHouseRatio+'%'}}</div>
<div class="pie-table-title table-table-title">闲置房屋数</div>
</div>
</div>
<div class="item_right">
<div class="pie-table-total">
<div class="pie-table-total-count">{{item.userTotal}}</div>
<div class="pie-table-title">居民总数</div>
</div>
<div class="pie-table-line"></div>
<div class="pie-table-total ">
<div class="pie-table-total-count colorwhite">{{item.czUserTotal}}</div>
<div class="pie-table-title table-table-title">{{item.czUserRatio+'%'}}</div>
<div class="pie-table-title table-table-title">常住人口数</div>
</div>
<div class="pie-table-total ">
<div class="pie-table-total-count colorwhite">{{item.ldUserTotal}}</div>
<div class="pie-table-title table-table-title">{{item.ldUserRatio+'%'}}</div>
<div class="pie-table-title table-table-title">流动人口数</div>
</div>
</div>
</div>
</div>
</div>
<div v-if="subList.length===0"
class="no-data">
<img src="@/assets/img/modules/visual/noData.png"
class="no-data-img" />
</div>
</cpt-card>
</div>
</template>
<script>
import { requestPost } from "@/js/dai/request";
import screenTable from "../../components/screen-table/index";
import cptCard from "@/views/modules/visual/cpts/card";
import nextTick from "dai-js/tools/nextTick";
import screenEchartsFrame from "../../components/screen-echarts-frame";
import ScreenLoading from "@/views/modules/visual/components/screen-loading";
import { housePieOption } from './options'
import { userPieOption } from './userOptions'
import * as echarts from 'echarts';
export default {
name: "warning-box",
components: {
cptCard,
screenTable,
screenEchartsFrame,
ScreenLoading
},
data () {
return {
dataLoading: true,
orgId: '',
orgType: '',
orgName: this.$store.state.user.agencyName,
// orgShowName: this.$store.state.user.agencyName,//
housePieChartS: null,
housePieChart: '',
housePieOption: {},
housePieInitState: false,
houseData: {
orgId: '',//Id
orgType: '',// agency grid village
houseTotal: 198000,//
zzHouseTotal: 2000,//
zzHouseRatio: '90%',//
czHouseTotal: 30,//
czHouseRatio: '5%',//
xzHouseTotal: 200,//
xzHouseRatio: '70%',//
},
houseColorArray: ['#FAC126', '#3DDA83', '#2865FA'],
housePieData: [],
legendArray: [
{
name: '自住房屋数',
url: require('../../../../../assets/img/shuju/measure/huang@2x.png')
},
{
name: '出租房屋数',
url: require('../../../../../assets/img/shuju/measure/lv@2x.png')
},
{
name: '闲置房屋数',
url: require('../../../../../assets/img/shuju/measure/lan@2x.png')
}
],
userPieChartS: null,
userPieChart: '',
userPieOption: {},
userPieInitState: false,
userData: {
orgId: '',//Id
orgType: '',// agency grid village
userTotal: 198000,//
czUserTotal: 2000,//
czUserRatio: '90%',//
ldUserTotal: 30,//
ldUserRatio: '5%',//
},
userColorArray: ['#1B51FF', '#00E5ED'],
userPieData: [],
subList: [],
//
runNum: 0,
runAgencyArray: [],
selUserId: '',
center: [],
zoom: null,
parentPolygon: [],
};
},
async mounted () {
this.dataLoading = true
await this.getApiData()
this.dataLoading = false
},
methods: {
async getApiData () {
await this.getHousechart()
await this.getUserchart()
await this.getSubuserhouselist()
this.getHousePie()
this.getUserPie()
},
housePieInitOk (dom) {
console.log('pie准备好了', dom)
this.housePieChartS = dom
this.housePieInitState = true
},
userPieInitOk (dom) {
console.log('pie准备好了', dom)
this.userPieChartS = dom
this.userPieInitState = true
},
async getHousechart (node, resolve) {
if (this.$refs.housePieChart) {
this.$refs.housePieChart.showLoading()
}
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/house/housechart";
const url = '/gov/org/house/housechart'
let params = {
orgId: this.orgId,
orgType: this.orgType
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.houseData = data
if (this.$refs.housePieChart) {
this.$refs.housePieChart.hideLoading()
}
} else {
this.houseData = {}
this.$message.error(msg);
}
},
getHousePie () {
if (this.housePieInitState) {
this.assignHousePieChart()
} else {
setTimeout(() => {
this.getHousePie()
}, 500)
}
},
assignHousePieChart () {
if (this.houseData) {
this.$refs.housePieChart.setNoData(false)
this.$refs.housePieChart.clear()
this.housePieData = []
const _that = this
// pieChart
this.housePieOption = housePieOption(this.housePieChartS)
// let maxValue = this.housePieData[0].total
// let maxIndex = 0
let obj1 = {
name: '自住房屋数',
value: this.houseData.zzHouseRatio,
selected: true
}
let obj2 = {
name: '出租房屋数',
value: this.houseData.czHouseRatio
}
let obj3 = {
name: '闲置房屋数',
value: this.houseData.xzHouseRatio
}
this.housePieData.push(obj1)
this.housePieData.push(obj2)
this.housePieData.push(obj3)
this.housePieOption.title.text = this.houseData.houseTotal
this.housePieOption.series[1].itemStyle = {
color: function (params) {
return _that.houseColorArray[params.dataIndex]
}
}
let fun = function (params) {
_that.clickHousePie(params.dataIndex)
}
this.$refs.housePieChart.handleClick(fun)
this.clickHousePie(0)
} else {
this.$refs.housePieChart.setNoData(true)
}
},
async getUserchart (node, resolve) {
if (this.$refs.userPieChart) {
this.$refs.userPieChart.showLoading()
}
// const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/icresiuser/userchart";
const url = '/epmetuser/icresiuser/userchart'
let params = {
orgId: this.orgId,
orgType: this.orgType
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.userData = data
if (this.$refs.userPieChart) {
this.$refs.userPieChart.hideLoading()
}
} else {
this.userData = {}
this.$message.error(msg);
}
},
getUserPie () {
if (this.userPieInitState) {
this.assignUserPieChart()
} else {
setTimeout(() => {
this.getUserPie()
}, 500)
}
},
assignUserPieChart () {
if (this.userData) {
this.$refs.userPieChart.setNoData(false)
this.$refs.userPieChart.clear()
this.userPieData = []
const _that = this
// pieChart
this.userPieOption = userPieOption(this.userPieChartS)
// let maxValue = this.userPieData[0].total
// let maxIndex = 0
let obj1 = {
name: '常住人口数',
value: this.userData.czUserRatio,
selected: true
}
let obj2 = {
name: '流动人口树',
value: this.userData.ldUserRatio
}
this.userPieData.push(obj1)
this.userPieData.push(obj2)
this.userPieOption.title.text = this.userData.userTotal
this.userPieOption.series[1].itemStyle = {
color: function (params) {
return _that.userColorArray[params.dataIndex]
}
}
let fun = function (params) {
_that.clickUserPie(params.dataIndex)
}
this.$refs.userPieChart.handleClick(fun)
this.clickUserPie(0)
} else {
this.$refs.userPieChart.setNoData(true)
}
},
async getSubuserhouselist (node, resolve) {
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/house/subuserhouselist";
const url = '/gov/org/house/subuserhouselist'
let params = {
orgId: this.orgId,
orgType: this.orgType
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.subList = data
} else {
}
},
async clickHousePie (seriesIndex) {
this.housePieData.forEach((element, index) => {
if (index === seriesIndex) {
element.label = {
show: true,
};
element.labelLine = {
show: true,
lineStyle: {
opacity: 1,
}
};
console.log('zhilma')
} else {
element.label = {
show: false,
};
element.labelLine = {
show: false,
lineStyle: {
opacity: 0,
color: 'rgba(255,255,255,0)'
}
};
}
});
this.housePieOption.series[1].data = this.housePieData
// this.$refs.housePieChart.hideLoading()
this.$refs.housePieChart.setOption(this.housePieOption)
},
async clickUserPie (seriesIndex) {
this.userPieData.forEach((element, index) => {
if (index === seriesIndex) {
element.label = {
show: true,
};
element.labelLine = {
show: true,
lineStyle: {
opacity: 1,
}
};
console.log('zhilma')
} else {
element.label = {
show: false,
};
element.labelLine = {
show: false,
lineStyle: {
opacity: 0,
color: 'rgba(255,255,255,0)'
}
};
}
});
this.userPieOption.series[1].data = this.userPieData
// this.$refs.userPieChart.hideLoading()
this.$refs.userPieChart.setOption(this.userPieOption)
// this.getTable()
},
handleToSubAgency (item) {
this.toSubAgency(item)
this.getApiData()
},
// type:polygon / people
async toSubAgency (item) {
this.runNum++
let obj = {
orgId: this.orgId,
orgType: this.orgType,
orgName: this.orgName,
}
this.runAgencyArray.push(obj)
this.orgId = item.orgId
this.orgType = item.orgType
this.orgName = item.orgName
},
//
handleClickAgency (index) {
const cutNum = this.runAgencyArray.length - index//
this.runNum = this.runNum - cutNum
let orgData = this.runAgencyArray[index]
for (let i = 0; i < cutNum; i++) {
this.runAgencyArray.pop()
}
this.orgId = orgData.id
this.orgType = orgData.orgType
this.orgName = orgData.orgName
this.getApiData()
},
},
};
</script>
<style
lang="scss"
src="@/assets/scss/modules/visual/warning.scss"
scoped
></style>
<style
lang="scss"
src="@/assets/scss/modules/visual/basicInfoMain.scss"
scoped
></style>
<style
lang="scss"
src="@/assets/scss/modules/visual/houseStatic.scss"
scoped
></style>

180
src/views/modules/visual/basicinfo/houseStatic/options.js

@ -0,0 +1,180 @@
export function housePieOption (_charts) {
const center= ['50%', '200px']
return {
title: {
text: '0',
top: 170,
left: 'center',
textStyle: {
width: '100%',
fontSize: 30,
color: '#FFFFFF',
fontWeight: 400
},
itemGap: 5,
subtext: '房屋总数',
subtextStyle: {
fontSize: 20,
color: '#fff',
fontWeight: 400
}
},
tooltip: {
show: false
},
// legend: {
// top: 500,
// bottom: 0,
// itemWidth: 20,
// itemHeight: 10,
// textStyle: {
// color: '#D2E7FF',
// fontSize: 16,
// lineHeight: 20,
// },
// },
series: [
// 外侧圆环
{
type: 'pie',
// 起始刻度的角度,默认为 90 度,即圆心的正上方。0 度为圆心的正右方。
startAngle: 0,
hoverAnimation: false,
// tooltip: {
// },
center: center,
radius: ['61%', '61.3%'],
label: {
show: false
},
labelLine: {
show: false
},
data: [{
value: 360,
itemStyle: {
color: 'rgba(40, 101, 250, 0)',
width:0,
borderColor: 'rgba(40, 101, 250, 0.5)',
borderWidth: 1,
borderType: 'dotted'
}
}
]
},
// 突出的
{
hoverAnimation: false,
// name: 'Access From',
type: 'pie',
center: center,
radius: ['40%', '54%'],
avoidLabelOverlap: false,
// top: top + '%',
// height: '80%',
selectedMode: 'single',
left: 'center',
width: 480,
label: {
// show: false,
position: 'outside',
alignTo: 'edge',
// formatter: '{a|{c}}\n\n{name|{b}}',
formatter: '{name|{b}}\n{r|}\n{a|{c}%}',
minMargin: 5,
edgeDistance: 1,
lineHeight: 15,
color: '#fff',
fontSize: 10,
// distanceToLabelLine: -60,
rich: {
name: {
padding: [0, 6, 0, 6]
},
a: {
fontSize: 20,
color: '#fff',
padding: [16, 0, 6, 6]
},
r: {
backgroundColor: 'auto',
borderRadius: 6,
width: 6,
height: 6,
// padding: [3, 3, 0, -12]
}
}
},
labelLine: {
show: false,
smooth: 0.2,
length: 50,
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) {
// //自定义颜色
// var colorList = [
// '#00FFFF', '#00FF00', '#FFFF00', '#FF8C00', '#FF0000', '#FE8463',
// ];
// return colorList[params.dataIndex]
// }
},
data: [],
},
// 中间圆环
{
type: 'pie',
// 起始刻度的角度,默认为 90 度,即圆心的正上方。0 度为圆心的正右方。
startAngle: 0,
hoverAnimation: false,
center: center,
// tooltip: {
// },
radius: ['0%', '27%'],
label: {
show: false
},
labelLine: {
show: false
},
data: [{
value: 360,
itemStyle: {
normal: {
color: 'rgba(8, 37, 134, 1)',
}
}
}
]
},
]
}
}

182
src/views/modules/visual/basicinfo/houseStatic/userOptions.js

@ -0,0 +1,182 @@
export function userPieOption (_charts) {
const center= ['50%', '200px']
return {
title: {
text: '0',
top: 170,
left: 'center',
textStyle: {
width: '100%',
fontSize: 30,
color: '#FFFFFF',
fontWeight: 400
},
itemGap: 5,
subtext: '房屋总数',
subtextStyle: {
fontSize: 20,
color: '#fff',
fontWeight: 400
}
},
tooltip: {
show: false
},
// legend: {
// orient: 'vertical',
// right: 0,
// top: 200,
// bottom: 20,
// itemWidth: 20,
// itemHeight: 10,
// textStyle: {
// color: '#D2E7FF',
// fontSize: 16,
// lineHeight: 20,
// },
// },
series: [
// 外侧圆环
{
type: 'pie',
// 起始刻度的角度,默认为 90 度,即圆心的正上方。0 度为圆心的正右方。
startAngle: 0,
hoverAnimation: false,
// tooltip: {
// },
center: center,
radius: ['61%', '61.3%'],
label: {
show: false
},
labelLine: {
show: false
},
data: [{
value: 360,
itemStyle: {
color: 'rgba(40, 101, 250, 0)',
width:0,
borderColor: 'rgba(40, 101, 250, 0.5)',
borderWidth: 1,
borderType: 'dotted'
}
}
]
},
// 突出的
{
hoverAnimation: false,
// name: 'Access From',
type: 'pie',
center: center,
radius: ['40%', '54%'],
avoidLabelOverlap: false,
// top: top + '%',
// height: '80%',
selectedMode: 'single',
left: 'center',
width: 480,
label: {
// show: false,
position: 'outside',
alignTo: 'edge',
// formatter: '{a|{c}}\n\n{name|{b}}',
formatter: '{name|{b}}\n{r|}\n{a|{c}%}',
minMargin: 5,
edgeDistance: 1,
lineHeight: 15,
color: '#fff',
fontSize: 10,
// distanceToLabelLine: -60,
rich: {
name: {
padding: [0, 6, 0, 6]
},
a: {
fontSize: 20,
color: '#fff',
padding: [16, 0, 6, 6]
},
r: {
backgroundColor: 'auto',
borderRadius: 6,
width: 6,
height: 6,
// padding: [3, 3, 0, -12]
}
}
},
labelLine: {
show: false,
smooth: 0.2,
length: 50,
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) {
// //自定义颜色
// var colorList = [
// '#00FFFF', '#00FF00', '#FFFF00', '#FF8C00', '#FF0000', '#FE8463',
// ];
// return colorList[params.dataIndex]
// }
},
data: [],
},
// 中间圆环
{
type: 'pie',
// 起始刻度的角度,默认为 90 度,即圆心的正上方。0 度为圆心的正右方。
startAngle: 0,
hoverAnimation: false,
center: center,
// tooltip: {
// },
radius: ['0%', '27%'],
label: {
show: false
},
labelLine: {
show: false
},
data: [{
value: 360,
itemStyle: {
normal: {
color: 'rgba(8, 37, 134, 1)',
}
}
}
]
},
]
}
}

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

@ -76,7 +76,7 @@
</template>
<script>
import { Loading } from "element-ui"; //Loading
import { requestPost } from "@/js/dai/request";
import cptCard from "@/views/modules/visual/cpts/card";
import cptTb from "@/views/modules/visual/cpts/tb";
@ -84,7 +84,7 @@ import screenEchartsFrame from "@/views/modules/visual/components/screen-echarts
import projectInfo from "./cpt/project-info";
import ScreenLoading from "@/views/modules/visual/components/screen-loading";
import { pieOption } from './typePieOption.js'
import nextTick from 'dai-js/tools/nextTick'
export default {
name: "HomeMap",

Loading…
Cancel
Save