Browse Source

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

shibei_master
dai 4 years ago
parent
commit
1ee6b54860
  1. 23663
      package-lock.json
  2. 1
      package.json
  3. BIN
      src/assets/img/shuju/dangyuan.png
  4. BIN
      src/assets/img/shuju/xiala.png
  5. 230
      src/assets/scss/modules/visual/basicInfoMain.scss
  6. 6
      src/views/components/resiSearch.vue
  7. 28
      src/views/modules/base/resi.vue
  8. 566
      src/views/modules/visual/basicinfo/basicInfoCommunity.vue
  9. 293
      src/views/modules/visual/basicinfo/basicInfoMain.vue
  10. 551
      src/views/modules/workSys/resiCate.vue

23663
package-lock.json

File diff suppressed because it is too large

1
package.json

@ -31,6 +31,7 @@
"jsencrypt": "^3.0.3",
"lodash": "^4.17.15",
"node-sass": "^4.12.0",
"ol": "^6.9.0",
"portfinder": "^1.0.21",
"qs": "^6.7.0",
"quill": "^1.3.6",

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 B

230
src/assets/scss/modules/visual/basicInfoMain.scss

@ -1,4 +1,5 @@
.div_top {
margin-left: 10px;
height: 35px;
.router_line {
width: 212px;
@ -18,6 +19,9 @@
padding: 0 5px;
}
}
.router_parents:hover {
cursor: pointer;
}
.router_child {
color: #ffffff;
@ -29,7 +33,10 @@
display: flex;
.div_map {
width: 100%;
height: calc(88vh - 8px);
border-radius: 5px;
}
.div_data {
flex: 0 0 562px;
margin-left: 12px;
@ -69,7 +76,7 @@
}
}
.div_infolist {
.div_info {
box-sizing: border-box;
width: 100%;
margin-top: 21px;
@ -79,6 +86,79 @@
center;
background-size: 100% 100%;
// padding: 45px 21px 35px 24px;
.info_tip {
padding: 31px 0 0 19px;
display: flex;
> img {
height: 34px;
width: 46px;
}
.tip_title {
line-height: 34px;
margin-left: 7px;
font-size: 22px;
font-family: PingFang SC;
font-weight: 800;
color: #ffffff;
}
}
.info_list {
margin-top: 9px;
.item {
.item_line {
margin-top: 13px;
margin-left: 24px;
width: 517px;
height: 0px;
border: 1px dotted #1797ff31;
border-width: 0.5px;
}
.last_line {
border: 1px dotted #1797ff00;
}
.list_item {
display: flex;
padding: 18px 59px 0;
justify-content: space-between;
.list_item_col {
flex: 0 0 240px;
display: flex;
> img {
height: 76px;
width: 76px;
}
.item_content {
margin-left: 10px;
height: 76px;
display: flex;
flex-direction: column;
justify-content: center;
.item_label {
font-size: 18px;
font-family: PingFang SC;
font-weight: 400;
color: #ffffff;
}
.item_count {
margin-top: 10px;
font-size: 28px;
font-family: PingFang SC;
font-weight: bold;
color: #00fffc;
}
}
}
}
}
}
}
}
}
@ -94,3 +174,151 @@
background-size: 100% 100%;
padding: 45px 21px 35px 24px;
}
.div_community_info {
box-sizing: border-box;
width: 100%;
height: calc(88vh);
color: #fff;
background: url('../../../img/modules/visual/warning-box.png') no-repeat
center;
background-size: 100% 100%;
.div_select {
margin-top: 28px;
margin-left: 24px;
display: flex;
> img {
height: 34px;
width: 46px;
}
.tip_title {
line-height: 34px;
margin-left: 12px;
font-size: 22px;
font-family: PingFang SC;
font-weight: 800;
color: #ffffff;
}
}
.div_room {
margin-top: 9px;
display: flex;
flex-wrap: wrap;
justify-content: space-around;
margin: 0 21px 0 11px;
.item:hover {
cursor: pointer;
}
.item_sel {
box-shadow: 0 0 10px inset #1a5afd;
}
.item {
background-color: #011168;
margin-top: 12px;
width: 234px;
height: 190px;
border: 1px solid #037ddc;
border-radius: 8px;
text-align: center;
margin-left: 11px;
position: relative;
// &:first-child {
// margin-left: 0;
// }
> span {
font-size: 24px;
font-family: PingFang SC;
font-weight: 500;
color: #ffffff;
line-height: 18px;
line-height: 190px;
}
.icon_party {
position: absolute;
top: 13px;
left: 18px;
}
.icon_category {
position: absolute;
bottom: 10px;
left: 9px;
margin-left: 9px;
> img {
width: 21px;
height: 20px;
}
}
.div_user:hover {
cursor: pointer;
}
.div_user {
position: absolute;
bottom: 10px;
right: 11px;
width: 88px;
height: 30px;
background: #073082;
border-radius: 15px;
> img {
width: 10px;
height: 6px;
margin-left: 4px;
}
> span {
font-size: 14px;
font-family: PingFang SC;
font-weight: 400;
color: #ffffff;
line-height: 30px;
}
.user_list {
margin-top: 2px;
position: relative;
z-index: 10;
width: 90px;
background: #020340;
border: 1px solid #0a359b;
border-radius: 4px;
box-shadow: 0 0 10px inset #1a5afd;
.user_item {
padding: 13px 14px 0 14px;
font-size: 16px;
font-family: PingFang SC;
font-weight: 400;
color: #ffffff;
.item_line {
margin-top: 9px;
width: 70px;
height: 0px;
border: 1px dotted #1797ff31;
border-width: 0.5px;
}
.last_line {
border: 1px dotted #1797ff00;
}
}
}
}
}
}
.div_room::after {
content: '';
flex: auto;
}
}

6
src/views/components/resiSearch.vue

@ -189,9 +189,7 @@
<el-button type="primary" size="mini">查询</el-button>
</el-col> -->
<el-col :span="24">
<el-button type="primary" size="mini" @click="handleSearch"
>查询</el-button
>
<el-button type="primary" size="mini" @click="handleSearch">查询</el-button>
</el-col>
</el-row>
<div class="resi-down" @click="handleOpenSearch">
@ -578,7 +576,7 @@ export default {
margin-bottom: 20px;
}
.resi-search {
padding-right: 20px;
// padding-right: 20px;
.el-col {
text-align: right;
}

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

@ -43,6 +43,7 @@
:prop="item.columnName"
:label="item.label"
align="center"
:show-overflow-tooltip="true"
:width="item.itemType === 'radio' ? computedWidth(item.label) : 180"
>
<template slot-scope="scope">
@ -823,9 +824,9 @@ export default {
}
</script>
<style lang="scss">
<style lang="scss" scoped>
.tabs-other-info {
.el-tabs__item {
::v-deep .el-tabs__item {
// width: 50px;
height: 20px;
box-sizing: border-box;
@ -838,12 +839,12 @@ export default {
background: #ebecf1;
border-radius: 2px;
}
.el-tabs__nav-wrap::after,
.el-tabs__active-bar {
::v-deep .el-tabs__nav-wrap::after,
::v-deep .el-tabs__active-bar {
display: none;
}
.el-tabs__nav-next,
.el-tabs__nav-prev {
::v-deep .el-tabs__nav-next,
::v-deep .el-tabs__nav-prev {
// width: 12px;
// height: 12px;
color: rgba(30, 122, 254, 1);
@ -851,32 +852,27 @@ export default {
background: rgba(30, 122, 254, .2);
// border-radius: 50%;
}
.el-tabs__item.is-active {
::v-deep .el-tabs__item.is-active {
color: #fff;
background: linear-gradient(90deg, #1A5AFD, #26C4FF);
}
}
.resi-container .resi-card-table {
.el-table th {
::v-deep .el-table th {
color: #fff;
background-color: rgba(33, 149, 254, 1);
border-right: 1px solid rgba(33, 149, 254, 1);;
}
}
.resi-table {
// .el-table__header-wrapper .el-table__header th {
// color: #fff;
// background-color: rgba(33, 149, 254, 1);
// border-right: 1px solid rgba(33, 149, 254, 1);;
// }
.el-button--text {
::v-deep .el-button--text {
text-decoration: underline;
}
.btn-color-del {
::v-deep .btn-color-del {
margin-left: 10px;
color: rgba(213, 16, 16, 1);
}
.btn-color-edit {
::v-deep .btn-color-edit {
color: rgba(0, 167, 169, 1);
}
}

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

@ -0,0 +1,566 @@
<template>
<div class="div_community_info">
<div class="div_select">
<img src="../../../../assets/img/shuju/title-tip.png"
alt />
<div class="customer_select">
<el-select v-model="selBuildingId"
:popper-append-to-body="false"
style="width:100%"
placeholder="请选择">
<el-option v-for="item in buildingArray"
:key="item.buildingId"
:label="item.buildingName"
:value="item.buildingId">
</el-option>
</el-select>
</div>
</div>
<el-scrollbar style="height:100%">
<div v-if="roomLoaded"
class="div_room">
<div v-for="(item,index) in roomArray"
:key="index"
:class="['item',{'item_sel':selHouseIndex==index}]"
@click="handleClickRoom(index)">
<span>{{item.houseName}}</span>
<div class="icon_party">
<img :src="item.partyUrl"
alt />
</div>
<div class="icon_category">
<img v-for="(iconItem,iconIndex) in item.iconArrayShow"
:key="iconIndex"
:src="iconItem.iconUrl"
alt />
</div>
<div @click="handleShowAllUser(index)"
class="div_user">
<span>全部成员</span>
<img src="../../../../assets/img/shuju/xiala.png"
alt />
<div class="user_list"
v-show="item.showAllUser">
<div v-for="(userItem,userIndex) in userArray"
:key="userIndex"
class="user_item"
@click.stop="handleClickUser(userIndex)">
{{userItem.name}}
<div :class="['item_line',{'last_line':userIndex==(userArray.length-1)}]"></div>
</div>
</div>
</div>
</div>
</div>
</el-scrollbar>
</div>
</template>
<script>
import { mapGetters } from "vuex";
import { Loading } from 'element-ui'; //Loading
import { requestPost } from "@/js/dai/request";
let loading;//
export default {
data () {
return {
//id
neighborHoodId: '',
neighborHoodName: '',
buildingArray: [
{
buildingId: "1",
buildingName: '1号楼'
},
{
buildingId: "2",
buildingName: '2号楼'
},
{
buildingId: "3",
buildingName: '3号楼'
},
{
buildingId: "4",
buildingName: '4号楼'
},
{
buildingId: "5",
buildingName: '5号楼'
},
{
buildingId: "6",
buildingName: '6号楼'
}
],//
selBuildingId: '',
selBuildingName: '',
roomLoaded: false,
roomArray: [
{
houseId: "1",
houseName: "101室",
categoryList: [
{
name: '党员',
iconUrl: require('../../../../assets/img/shuju/dangyuan.png'),
isSpecial: '1',
},
{
name: '低保',
iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
isSpecial: '0',
}
]
},
{
houseId: "2",
houseName: "102室",
categoryList: [
{
name: '低保',
iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
isSpecial: '0',
},
{
name: '低保',
iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
isSpecial: '0',
},
{
name: '低保',
iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
isSpecial: '0',
},
{
name: '低保',
iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
isSpecial: '0',
}
]
},
{
houseId: "3",
houseName: "103室",
categoryList: [
{
name: '低保',
iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
isSpecial: '0',
}
]
},
{
houseId: "4",
houseName: "104室",
categoryList: [
{
name: '低保',
iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
isSpecial: '0',
}
]
},
{
houseId: "5",
houseName: "105室",
categoryList: [
{
name: '低保',
iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
isSpecial: '0',
}
]
},
{
houseId: "6",
houseName: "106室",
categoryList: [
{
name: '低保',
iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
isSpecial: '0',
}
]
}
],
selHouseId: '',
selHouseName: '',
selHouseIndex: 0,
userArray: [
{
name: '张三',
userId: '1',
},
{
name: '李四',
userId: '2',
},
{
name: '王婷婷',
userId: '3',
}
],
selUserName: '',
selUserId: '',
orgData: {},//
orgId: '',
orgLevel: '',
//
runNum: 0,
runAgencyArray: [],
}
},
async mounted () {
},
methods: {
async initData (neighborHoodId, neighborHoodName) {
this.roomLoaded = false
this.neighborHoodId = neighborHoodId
this.neighborHoodName = neighborHoodName
//
await this.loadBuilding()
if (this.selBuildingId) {
await this.loadRoom()
this.roomLoaded = true
}
},
//
handleClickRoom (index) {
this.selHouseIndex = index
},
//
async handleShowAllUser (selIndex) {
this.roomArray.forEach((element, index) => {
let obj = JSON.parse(JSON.stringify(element))
if (index === selIndex) {
obj.showAllUser = !obj.showAllUser
this.$set(this.roomArray, selIndex, obj)
this.loadUser(element.houseId, selIndex)
} else {
obj.showAllUser = false
this.$set(this.roomArray, index, obj)
// element.showAllUser = false
}
});
},
//
handleClickUser (index) {
},
//infolist
async loadList () {
},
//
toSubAgency (e) {
//neighborHood
this.runNum++
this.runAgencyArray.push(this.orgData)
this.subAgencyArray.forEach(item => {
if (item.id === e.selected[0].id_) {
this.selPolygonId = item.id
this.selPolygon = item
this.orgId = item.id
this.orgLevel = item.level
}
});
console.log(this.runNum)
console.log(this.runAgencyArray)
if (this.orgLevel === 'neighborHood') {
} else {
this.refreshMap(true)
}
},
//
handleClickAgency (index) {
const cutNum = this.runAgencyArray.length - index//
this.runNum = this.runNum - cutNum
this.orgData = this.runAgencyArray[index]
for (let i = 0; i < cutNum; i++) {
this.runAgencyArray.pop()
}
this.orgId = this.orgData.id
this.orgLevel = this.orgData.level
console.log(this.runAgencyArray)
console.log(this.orgData)
if (this.orgLevel === 'neighborHood') {//
} else {
this.refreshMap(true)
}
},
//
async loadBuilding () {
// const url = "/gov/org/agency/baseinfofamilybuilding"
const url = "http://yapi.elinkservice.cn/mock/245/gov/org/agency/baseinfofamilybuilding"
let params = {
neighborHoodId: this.orgId
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
// this.buildingArray = data
this.buildingArray.forEach(item => {
item.buildingName = this.neighborHoodName + "-" + item.buildingName
});
if (this.buildingArray.length > 0) {
this.selBuildingId = this.buildingArray[0].buildingId
this.selBuildingName = this.buildingArray[0].buildingName
} else {
this.selBuildingId = ''
this.selBuildingName = ''
}
} else {
this.$message.error(msg)
}
},
//
async loadRoom () {
// const url = "/gov/org/ichouse/houselist"
const url = "http://yapi.elinkservice.cn/mock/245/gov/org/ichouse/houselist"
let params = {
buildingId: this.selBuildingId
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
// this.roomArray = data
if (this.roomArray.length > 0) {
this.selHouseId = this.roomArray[0].houseId
this.selHouseName = this.roomArray[0].houseName
this.roomArray.forEach(roomItem => {
let iconArrayShow = JSON.parse(JSON.stringify(roomItem.categoryList))
// debugger
if (iconArrayShow.length > 0) {
if (iconArrayShow[0].isSpecial === '1') {//
roomItem.isParty = true
roomItem.partyUrl = iconArrayShow[0].iconUrl
iconArrayShow.shift();//
} else {
roomItem.isParty = false
}
}
this.$nextTick(() => {
// ref_tree ref value node-key
roomItem.iconArrayShow = iconArrayShow
});
roomItem.showAllUser = false
});
}
} else {
this.$message.error(msg)
}
},
//
async loadUser (houseId, index) {
// const url = "/epmetuser/icresiuser/getpeoplebyroom"
const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/icresiuser/getpeoplebyroom"
let params = {
homeId: houseId
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
// this.userArray = data
} else {
this.$message.error(msg)
}
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
});
},
//
endLoading () {
//clearTimeout(timer);
if (loading) {
loading.close();
}
},
},
props: {
},
computed: {
mapHeight () {
return this.clientHeight - 120;
},
// zoom: {
// get () {
// //zoom
// if (this.clientHeight < 900) {
// return 2.3
// } else {
// return 2.8
// }
// },
// set (value) {
// }
// },
...mapGetters(["clientHeight"])
},
components: {},
}
</script>
<style
lang="scss"
src="@/assets/scss/modules/visual/basicInfoMain.scss"
scoped
></style>
<style lang=scss scoped>
.customer_select {
/* 未选中任何选项的时候 placeholder的样式 需要先选中父元素 增加权重 */
/deep/ input::-webkit-input-placeholder {
color: #fff;
}
/deep/ input::-moz-input-placeholder {
color: #fff;
}
/deep/ input::-ms-input-placeholder {
color: #fff;
}
/* 修改的是el-input的样式 */
/* 一种方法是设置最里层el-input__inner的背景色 外层的两级父元素设置为透明色 */
/* 另一种方法是从el-select到el-input__inenr的背景色都设置为需要的颜色 */
/deep/ .el-select,
/deep/ .el-input,
/deep/ .el-input__inner {
background-color: #08164d00;
color: #fff;
border: 0px;
border-radius: 0px;
text-align: left;
font-size: 22px;
font-family: PingFang SC;
font-weight: 800;
color: #ffffff;
display: flex;
}
/* el-input聚焦的时候 外层的border会有一个样式 */
/deep/ .el-select .el-input.is-focus .el-input__inner {
border: 0px;
}
/* 修改的是el-input上下的小图标的颜色 */
/deep/ .el-select .el-input .el-select__caret {
color: #fff;
}
/* 修改总体选项的样式 最外层 */
/deep/ .el-select-dropdown {
background-color: #08164d;
margin: 0px;
border: 0px;
border-radius: 0px;
}
/* 修改单个的选项的样式 */
/deep/ .el-select-dropdown__item {
background-color: transparent;
color: #fff;
}
/* item选项的hover样式 */
/deep/ .el-select-dropdown__item.hover,
/deep/ .el-select-dropdown__item:hover {
color: #409eff;
}
/* 修改的是下拉框选项内容上方的尖角 */
/deep/ .el-popper .popper__arrow,
.el-popper .popper__arrow::after {
display: none;
}
}
</style>
<style lang=scss >
.el-scrollbar__wrap {
overflow-x: hidden !important;
}
</style>

293
src/views/modules/visual/basicinfo/basicInfoMain.vue

@ -6,7 +6,8 @@
<div class="router_line"></div>
<div class="div_router">
<span class="router_parents"
v-for="(item,index) in runAgency"
v-for="(item,index) in runAgencyArray"
@click="handleClickAgency(index)"
:key="index">{{item.name}}<span class="arrow">></span></span>
<span class="router_child">{{orgData.name}}</span>
@ -15,16 +16,22 @@
<div class="div_content">
<div id="map"
class="div_map"
:style="{height:mapHeight+'px'}"></div>
<basic-info-community ref="ref_community"></basic-info-community>
<!-- <basic-info-community v-if="orgLevel==='neighborHood'"
ref="ref_community"></basic-info-community>
<div v-else
id="map"
class="div_map">
</div> -->
<div class="div_data">
<div class="div_search">
<el-input size="mini"
WarningColor='warning'
placeholder="请输入姓名"
v-model="name">
v-model="searchName">
<i slot="prefix"
class="icon">
<img src="../../../../assets/img/modules/visual/sousuo.png"
@ -36,7 +43,39 @@
@click="handleSearch">搜索</div>
</div>
<div class="div_infolist"></div>
<div class="div_info">
<el-scrollbar style="height:100%">
<div class="info_tip">
<img src="../../../../assets/img/shuju/title-tip.png"
alt />
<div class="tip_title">分类列表</div>
</div>
<div class="info_list">
<div v-for="(item,index) in listDatashow"
:key="index"
class="item">
<div class="list_item">
<div v-for="(colItem,colIndex) in item"
:key="colIndex"
class="list_item_col">
<img :src="colItem.dataIcon"
alt />
<div class="item_content">
<div class="item_label">{{colItem.label}}</div>
<div class="item_count">{{colItem.count}}</div>
</div>
</div>
</div>
<div :class="['item_line',{'last_line':index==(listDatashow.length-1)}]"></div>
</div>
</div>
</el-scrollbar>
</div>
</div>
</div>
@ -57,7 +96,7 @@ import { Circle as CircleStyle, Fill, Stroke, Style, Text } from 'ol/style.js';
import { mapGetters } from "vuex";
import { Loading } from 'element-ui'; //Loading
import { requestPost } from "@/js/dai/request";
import BasicInfoCommunity from "./basicInfoCommunity";
let loading;//
@ -72,7 +111,6 @@ let polygonLayer;//变电站标注图层
let polygonSource;//
let select;//
//
var createTextStyle = function (feature) {
return new Text({
@ -123,12 +161,102 @@ const vueGis = {
selPolygonId: '',//id
selPolygon: {},
//
searchName: "",
//
name: "",
listData: [],//
listDatashow: [],//
listData1: [
{
id: "1",
label: "党员",
count: 300,
dataIcon: require('../../../../assets/img/modules/visual/dabing.png')
},
{
id: "2",
label: "低保人员",
count: 30000,
dataIcon: ''
},
{
id: "3",
label: "保障房人员",
count: 3,
dataIcon: ''
},
{
id: "4",
label: "失业人员",
count: 300,
dataIcon: require('../../../../assets/img/modules/visual/dibao.png')
},
{
id: "5",
label: "失业人员",
count: 300,
dataIcon: require('../../../../assets/img/modules/visual/dibao.png')
},
{
id: "6",
label: "失业人员",
count: 300,
dataIcon: require('../../../../assets/img/modules/visual/dibao.png')
},
{
id: "7",
label: "失业人员",
count: 300,
dataIcon: require('../../../../assets/img/modules/visual/dibao.png')
},
{
id: "8",
label: "失业人员",
count: 300,
dataIcon: require('../../../../assets/img/modules/visual/dibao.png')
},
{
id: "9",
label: "失业人员",
count: 300,
dataIcon: require('../../../../assets/img/modules/visual/dibao.png')
},
{
id: "10",
label: "失业人员",
count: 300,
dataIcon: require('../../../../assets/img/modules/visual/dibao.png')
},
{
id: "11",
label: "失业人员",
count: 300,
dataIcon: require('../../../../assets/img/modules/visual/dibao.png')
},
{
id: "12",
label: "失业人员",
count: 300,
dataIcon: require('../../../../assets/img/modules/visual/dibao.png')
},
{
id: "13",
label: "失业人员3",
count: 300,
dataIcon: require('../../../../assets/img/modules/visual/dibao.png')
},
{
id: "14",
label: "失业人员2",
count: 300,
dataIcon: require('../../../../assets/img/modules/visual/dibao.png')
},
],
//
runNum: 0,
runAgency: [],
runAgencyArray: [],
}
},
@ -136,6 +264,11 @@ const vueGis = {
//
await this.loadOrgData()
this.$nextTick(() => {
// ref_tree ref value node-key
this.$refs.ref_community.initData('', '南山111小区');
});
//
this.initMap()
@ -145,14 +278,81 @@ const vueGis = {
//
this.loadPolygon(this.subAgencyArray)
await this.loadList()
},
methods: {
handleSearch () {
},
//infolist
async loadList () {
// const url = "/epmetuser/statsresiwarn/list"
const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/statsresiwarn/list"
let params = {
id: this.orgId,
level: this.orgLevel
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
// this.listData = data
this.listData = this.listData1
this.listDatashow = []
let itemArray = []
this.listData.forEach((item, index) => {
if (!item.dataIcon) {
item.dataIcon = require('../../../../assets/img/modules/visual/dibao.png')
}
if (index % 2 === 0) {//
itemArray.push(item)
} else {
itemArray.push(item)
this.listDatashow.push(itemArray)
itemArray = []
}
});
} else {
this.$message.error(msg)
}
},
//
async toSubAgency (e) {
//neighborHood
this.runNum++
this.runAgencyArray.push(this.orgData)
this.subAgencyArray.forEach(item => {
if (item.id === e.selected[0].id_) {
this.selPolygonId = item.id
this.selPolygon = item
this.orgId = item.id
this.orgLevel = item.level
this.orgData = item
}
});
console.log(this.runNum)
console.log(this.runAgencyArray)
// debugger
if (this.orgLevel === 'neighborHood') {
} else {
this.refreshMap(true)
}
},
//
async refreshMap (isRefreshView) {
//
await this.loadOrgData()
@ -165,26 +365,38 @@ const vueGis = {
mapView.setCenter(this.centerPoint);
mapView.setZoom(this.zoom);
}
await this.loadList()
},
//
handleBack () {
this.runNum--
this.runAgency.pop()
if (this.runNum === 0) {
this.orgId = ''
this.orgLevel = ''
} else {
this.orgId = this.runAgency[this.runAgency.length - 1].id
this.orgLevel = this.runAgency[this.runAgency.length - 1].level
//
handleClickAgency (index) {
const cutNum = this.runAgencyArray.length - index//
this.runNum = this.runNum - cutNum
this.orgData = this.runAgencyArray[index]
for (let i = 0; i < cutNum; i++) {
this.runAgencyArray.pop()
}
this.refreshMap(true)
this.orgId = this.orgData.id
this.orgLevel = this.orgData.level
console.log(this.runAgencyArray)
console.log(this.orgData)
if (this.orgLevel === 'neighborHood') {//
} else {
this.refreshMap(true)
}
},
//
async loadOrgData () {
const url = "/gov/org/agency/maporg"
let params = {
orgId: this.orgId,
@ -194,10 +406,15 @@ const vueGis = {
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.orgData = data
this.orgId = this.orgData.id
this.orgLevel = this.orgData.level
if (data.children && data.children.length > 0) {
this.subAgencyArray = data.children
} else {
this.subAgencyArray = []
}
} else {
@ -265,27 +482,6 @@ const vueGis = {
},
//
toSubAgency (e) {
console.log(e)
this.subAgencyArray.forEach(item => {
if (item.id === e.selected[0].id_) {
this.selPolygonId = item.id
this.selPolygon = item
this.orgId = item.id
this.orgLevel = item.level
}
});
this.runNum++
this.runAgency.push(this.selPolygon)
this.refreshMap(true)
},
//
setMapLocation () {
this.centerPoint = []
@ -431,10 +627,10 @@ const vueGis = {
},
props: {
vueFlag: {
type: String,
default: "alarm"
}
// vueFlag: {
// type: String,
// default: "alarm"
// }
},
computed: {
@ -458,7 +654,7 @@ const vueGis = {
...mapGetters(["clientHeight"])
},
components: {},
components: { BasicInfoCommunity },
}
export default vueGis;
</script>
@ -486,4 +682,7 @@ export default vueGis;
color: #ffffff;
opacity: 0.7;
}
.el-scrollbar__wrap {
overflow-x: hidden !important;
}
</style>

551
src/views/modules/workSys/resiCate.vue

@ -0,0 +1,551 @@
<template>
<div v-if="pageLoading" class="resi-container">
<el-card class="resi-card-table">
<div class="resi-row-btn">
<el-select
v-model="value"
placeholder="请选择"
size="small"
clearable
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<el-select
v-model="value"
placeholder="请选择"
size="small"
clearable
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<el-button type="primary" size="mini" @click="handleSearch">查询</el-button>
</div>
<el-table
:data="tableData"
row-key="id"
v-loading="tableLoading"
border
style="width: 100%"
class="resi-table"
>
<el-table-column label="序号" type="index" align="center" width="50">
</el-table-column>
<el-table-column
v-for="item in tableHeader"
:key="item.columnName"
:prop="item.columnName"
:label="item.label"
align="center"
width="180"
>
<template slot-scope="scope">
<el-image
v-if="filterImage(item.columnName)"
style="width: 70px; height: 70px"
:src="handleFilterSpan(scope.row, item) "
fit="fill"></el-image>
<span v-else>{{ handleFilterSpan(scope.row, item) }}</span>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center" width="120">
<template slot-scope="scope">
<el-button
@click="handleLook(scope.row)"
type="text"
size="small"
class="btn-color-look"
>{{(scope.row.status === 'show'&&'隐藏') || '显示'}}</el-button
>
<el-button
@click="handleEdit(scope.row)"
type="text"
size="small"
class="btn-color-edit"
>编辑</el-button
>
</template>
</el-table-column>
</el-table>
<div>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
:page-sizes="[20, 50, 100, 200]"
:page-size="pageSize"
layout="sizes, prev, pager, next"
:total="total"
>
</el-pagination>
</div>
</el-card>
<el-dialog
title="居民类别配置"
:visible.sync="dialogVisible"
width="40%"
append-to-body
:close-on-click-modal="false"
:before-close="handlerCancle"
>
<el-form label-width="100px" :model="form" :rules="rules" ref="ruleForm">
<el-form-item label="类别名称">
<el-input v-model="form.label" size="small" style="width: 180px;" disabled></el-input>
</el-form-item>
<el-form-item label="管理平台图标" prop="managementIcon">
<el-upload class="avatar-uploader"
:action="uploadUlr"
:data="{customerId:customerId}"
:show-file-list="false"
:on-success="(response, file, fileList) => handleImgSuccess('managementIcon', response, file, fileList)"
:before-upload="beforeImgUpload">
<img v-if="form.managementIcon"
:src="form.managementIcon"
style="width:70px;height:70px"
class="function-icon">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
<el-form-item label="数据平台图标" prop="dataIcon">
<el-upload class="avatar-uploader"
:action="uploadUlr"
:data="{customerId:customerId}"
:show-file-list="false"
:on-success="(response, file, fileList) => handleImgSuccess('dataIcon', response, file, fileList)"
:before-upload="beforeImgUpload">
<img v-if="form.dataIcon"
:src="form.dataIcon"
style="width:70px;height:70px"
class="function-icon">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
<el-form-item label="房屋显示图标" prop="houseShowIcon">
<el-upload class="avatar-uploader"
:action="uploadUlr"
:data="{customerId:customerId}"
:show-file-list="false"
:on-success="(response, file, fileList) => handleImgSuccess('houseShowIcon', response, file, fileList)"
:before-upload="beforeImgUpload">
<img v-if="form.houseShowIcon"
:src="form.houseShowIcon"
style="width:70px;height:70px"
class="function-icon">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
<el-form-item label="是否预警">
<el-switch v-model="form.warn"></el-switch>
</el-form-item>
<el-form-item label="黄色预警">
<el-input-number v-model="form.level1" :min="0" size="small" label="描述文字"></el-input-number> /楼宇
</el-form-item>
<el-form-item label="红色预警">
<el-input-number v-model="form.level2" :min="0" size="small" label="描述文字"></el-input-number> /楼宇
</el-form-item>
</el-form>
<div class="resi-btns">
<el-button size="small" @click="handlerCancle">取消</el-button>
<el-button
type="primary"
size="small"
:loading="btnLoading"
@click="handleSUbmit"
>提交</el-button
>
</div>
</el-dialog>
</div>
</template>
<script>
import axios from 'axios'
import Sortable from 'sortablejs'
export default {
data() {
return {
tableLoading: false,
btnLoading: false,
disabled: false,
pageLoading: false,
dialogVisible: false,
uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2',
currentPage: 1,
pageSize: 20,
total: null,
conditions: [],
tableData: [],
value: '',
options: [
{
label: '是',
value: 1
},{
label: '否',
value: 2
}
],
tableHeader: [
{
label: '类别名称',
columnName: 'label'
}, {
label: '管理平台图标',
columnName: 'managementIcon'
}, {
label: '数据平台图标',
columnName: 'dataIcon'
}, {
label: '房屋显示图标',
columnName: 'houseShowIcon'
}, {
label: '状态',
columnName: 'status',
options: [{
value: 'show',
label: '显示'
}, {
value: 'hidden',
label: '隐藏'
}]
}, {
label: '是否预警',
columnName: 'warn',
options: [{
value: '1',
label: '是'
}, {
value: '0',
label: '否'
}]
}, {
label: '黄色预警',
columnName: 'level1'
}, {
label: '红色预警',
columnName: 'level2'
}
],
customerId: '',
form: {
label: '',
dataIcon: '',
managementIcon: '',
houseShowIcon: '',
warn: '',
level1: '',
level2: ''
},
rules: {
managementIcon: [{ required: true, message: '管理平台图标不能为空', trigger: 'blur' }],
dataIcon: [{ required: true, message: '数据平台图标不能为空', trigger: 'blur' }],
houseShowIcon: [{ required: true, message: '房屋显示图标不能为空', trigger: 'blur' }]
}
}
},
async created() {
this.customerId = localStorage.getItem('customerId')
this.getTableData()
this.pageLoading = true
},
mounted() {
this.rowDrop()
},
methods: {
rowDrop() {
const tbody = document.querySelector('.el-table__body-wrapper tbody')
const _this = this
Sortable.create(tbody, {
onEnd({ newIndex, oldIndex }) {
const currRow = _this.tableData.splice(oldIndex, 1)[0]
_this.tableData.splice(newIndex, 0, currRow)
console.log('rowdrap', newIndex, oldIndex)
if (newIndex || newIndex === 0) _this.sortData()
//
}
})
},
computedWidth(label) {
const wd = 20 * label.length
return wd > 80 ? wd : 80
},
filterImage(item) {
const arr = ['managementIcon', 'dataIcon', 'houseShowIcon']
return arr.includes(item)
},
handleSizeChange(val) {
console.log(`每页 ${val}`)
this.pageSize = val
this.getTableData()
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`)
this.currentPage = val
this.getTableData()
},
handleFilterSpan(row, item) {
let _val = ''
if (item.options && item.options.length > 0) {
item.options.forEach((n) => {
if (n.value === row[item.columnName]) _val = n.label
})
}
return _val || row[item.columnName]
},
handleSearch(val) {
console.log('searchhh--', val)
this.currentPage = 1
this.conditions = val
this.getTableData()
},
handlerCancle() {
this.dialogVisible = false
},
beforeImgUpload (file) {
const isPNG = (file.type === 'image/png') || (file.type === 'image/jpeg')
const isLt1M = file.size / 1024 / 1024 < 1
if (!isPNG) {
this.$message.error('上传图片只能是 PNG 格式!')
}
if (!isLt1M) {
this.$message.error('上传图片大小不能超过 1MB!')
}
return isPNG && isLt1M
},
handleImgSuccess (type, res, file) {
if (res.code === 0 && res.msg === 'success') {
console.log('type', type)
console.log('res.data.url', res.data.url)
this.form[type] = res.data.url
} else {
this.$message.error(res.msg)
}
},
async handleLook(row) {
const _show = {
show: 'hidden',
hidden: 'show'
}
const params = {
id: row.id,
status: _show[row.status]
}
this.$http
.post('/oper/customize/resicategorystatsconfig/updatestatus', params)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
this.getTableData()
}
})
.catch(() => {
return this.$message.error('网络错误')
})
},
async handleEdit(row) {
this.form = { ...row }
this.dialogVisible = true
},
async handleSUbmit() {
this.$refs.ruleForm.validate(async (valid) => {
if (valid) {
this.btnLoading = true
const _form = {
...this.form,
warn: (this.form.warn && 1) || 0
}
await this.$http
.post('/oper/customize/resicategorystatsconfig/update', _form)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
this.dialogVisible = false
this.getTableData()
}
})
.catch(() => {
return this.$message.error('网络错误')
})
this.btnLoading = false
} else {
console.log('error submit!!');
return false;
}
});
},
handleDel(row) {
let params = {
formCode: 'resi_base_info',
icResiUserId: row.icResiUserId
}
console.log('row1', row)
this.$http
.post('/epmetuser/icresiuser/delete', params)
.then(({ data: res }) => {
console.log('row2', row)
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
console.log('row3', row)
this.$message.success('删除成功')
this.getTableData()
}
})
.catch((err) => {
console.log('row4', err)
return this.$message.error('网络错误')
})
},
sortData() {
const _data = this.tableData.map((item, index)=> {
return {
id: item.id,
sort: index
}
})
this.$http
.post('/oper/customize/resicategorystatsconfig/updatesort', _data)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
// this.getTableData()
}
})
.catch((err) => {
console.log('row4', err)
return this.$message.error('网络错误')
})
},
getTableHeader() {
this.$http
.post('/oper/customize/icform/tableheaders', {
formCode: 'resi_base_info'
})
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
this.tableHeader = res.data
}
})
.catch(() => {
return this.$message.error('网络错误')
})
},
async getTableData() {
this.tableLoading = true
let params = {
// formCode: 'resi_base_info',
pageNo: this.currentPage,
pageSize: this.pageSize
}
await this.$http
.post('/oper/customize/resicategorystatsconfig/list', params)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
this.tableData = res.data
this.total = res.data.total
}
})
.catch(() => {
return this.$message.error('网络错误')
})
this.tableLoading = false
}
}
}
</script>
<style lang="scss" scoped>
.resi-container .resi-card-table {
::v-deep .el-table th {
color: #fff;
background-color: rgba(33, 149, 254, 1);
border-right: 1px solid rgba(33, 149, 254, 1);;
}
}
.resi-table {
::v-deep .el-button--text {
text-decoration: underline;
}
::v-deep .btn-color-del {
margin-left: 10px;
color: rgba(213, 16, 16, 1);
}
::v-deep .btn-color-edit {
color: rgba(0, 167, 169, 1);
}
}
</style>
<style lang="scss" scoped>
.resi-row-btn {
display: flex;
margin-bottom: 13px;
::v-deep .el-button {
// margin-left: 10px;
border: 0;
}
::v-deep .el-select {
margin-right: 10px;
}
}
.avatar-uploader {
::v-deep
.el-upload {
cursor: pointer;
position: relative;
overflow: hidden;
}
.el-upload:hover {
border-color: #409EFF;
}
.avatar {
width: 70px;
height: 70px;
display: block;
}
.avatar-uploader-icon {
border: 1px dashed #d9d9d9;
border-radius: 6px;
font-size: 28px;
color: #8c939d;
width: 70px;
height: 70px;
line-height: 70px;
text-align: center;
}
}
.resi-btns {
margin-top: 20px;
text-align: center;
}
</style>
Loading…
Cancel
Save