Browse Source

可视化五大图层

shibei_master
jiangyy 3 years ago
parent
commit
e34baeb6d2
  1. BIN
      src/assets/img/shuju/weixuan.png
  2. BIN
      src/assets/img/shuju/xuanzhong.png
  3. 621
      src/assets/scss/modules/visual/fiveLayerMap.scss
  4. 2
      src/views/modules/communityService/ninePlaces/inspect/inspect.vue
  5. 2
      src/views/modules/communityService/ninePlaces/places/places.vue
  6. 2
      src/views/modules/communityService/ninePlaces/team/team.vue
  7. 548
      src/views/modules/shequzhili/csgltc/csgl.vue
  8. 281
      src/views/modules/shequzhili/csgltc/csglDetail.vue
  9. 495
      src/views/modules/shequzhili/csgltc/csglForm.vue
  10. 705
      src/views/modules/shequzhili/ggfwtc/ggfw.vue
  11. 281
      src/views/modules/shequzhili/ggfwtc/ggfwDetail.vue
  12. 527
      src/views/modules/shequzhili/ggfwtc/ggfwForm.vue
  13. 973
      src/views/modules/visual/communityGovern/fivelayers/mapIndex.vue

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 B

621
src/assets/scss/modules/visual/fiveLayerMap.scss

@ -0,0 +1,621 @@
@import "../../c/config";
@import "../../c/function";
@import "./c/common";
.div_top {
margin-left: 10px;
height: 35px;
.router_line {
width: 212px;
height: 1px;
border: 1px solid #ffffff;
opacity: 0.09;
/* opacity: 0.09; */
}
.div_router {
margin-top: 5px;
font-size: 16px;
.router_parents {
color: #a0c3d9;
.arrow {
padding: 0 5px;
}
}
.router_parents:hover {
cursor: pointer;
}
.router_child {
color: #ffffff;
}
}
}
.div_content {
display: flex;
.div_map {
box-sizing: border-box;
width: 100%;
// padding: 10px 5px 13px;
// margin-top: 8px;
height: calc(88vh - 15px);
color: #fff;
// background: url('../../../img/modules/visual/warning-box.png') no-repeat
// center;
// background-size: 100% 100%;
position: relative;
}
.div_data {
flex: 0 0 622px;
margin-left: 12px;
.div_search {
width: 100%;
height: 56px;
text-align: center;
background-color: #011168;
border-radius: 4px 0 0 4px;
border: none;
box-shadow: 0 0 10px inset #1a5afd;
font-size: 18px;
font-family: PingFang SC;
font-weight: 400;
color: #ffffff;
opacity: 0.7;
display: flex;
justify-content: space-between;
.div_search_left {
display: flex;
justify-content: flex-start;
.icon {
display: flex;
align-items: center;
margin-left: 29px;
> img {
width: 24px;
height: 24px;
}
}
> span {
line-height: 56px;
margin-left: 10px;
}
}
.btn {
text-align: center;
flex: 0 0 113px;
height: 56px;
background: linear-gradient(90deg, #1a5afd, #26c4ff);
font-size: 20px;
font-family: PingFang SC;
font-weight: 400;
color: #ffffff;
line-height: 56px;
border-radius: 0 4px 4px 0;
}
}
.div_search:hover {
cursor: pointer;
}
.div_tips{
box-sizing: border-box;
width: 100%;
height: 302px;
color: #fff;
background: url('../../../img/modules/visual/warning-box.png') no-repeat
center;
background-size: 100% 100%;
.div_coverage{
padding: 30px 20px 30px 20px;
display: flex;
justify-content: space-around;
.coverage_item{
// padding-right:11px;
>img{
width:16px;
height:16px;
}
>span{
margin-left:6px;
font-size: 14px;
font-family: PingFang SC;
font-weight: 400;
color: #FFFFFF;
}
}
.coverage_item:hover{
cursor: pointer;
}
}
}
.div_info {
box-sizing: border-box;
width: 100%;
height: calc(88vh - 302px - 10px);
color: #fff;
background: url('../../../img/modules/visual/warning-box.png') no-repeat
center;
background-size: 100% 100%;
// padding: 45px 21px 35px 24px;
.info_loading {
margin-top: 50px;
}
.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;
}
}
}
}
::v-deep .el-popper {
padding: 0px;
}
//
}
}
}
.div_tips {
/deep/ .el-scrollbar__wrap {
overflow-x: hidden !important;
}
}
}
}
.div_community_info {
box-sizing: border-box;
flex: 0 0 calc(100vw - 620px);
// width: calc(100vw - 560px);
height: calc(88vh - 10px);
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;
.customer_select {
display: flex;
justify-content: flex-start;
> span {
width: auto;
font-size: 22px;
font-family: PingFang SC;
font-weight: 800;
color: #ffffff;
line-height: 34px;
}
}
> 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_bar {
box-sizing: border-box;
margin-top: 9px;
height: calc(88vh - 120px);
}
.div_room {
// height: calc(88vh - 40px);
// margin-top: 9px;
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
margin: 0 21px 0 21px;
.item:hover {
cursor: pointer;
}
.item_sel {
box-shadow: 0 0 10px inset #1a5afd;
}
.item {
background-color: #011168;
margin-top: 12px;
width: 244px;
height: 190px;
border: 1px solid #037ddc;
border-radius: 8px;
text-align: center;
margin-left: 11px;
position: relative;
// &:first-child {
// margin-left: 0;
// }
.housename {
margin-top: 70px;
font-size: 24px;
font-family: PingFang SC;
font-weight: 500;
color: #ffffff;
// line-height: 180px;
}
.icon_party {
position: absolute;
top: 10px;
left: 12px;
}
.icon_roomstate {
position: absolute;
top: 16px;
right: 16px;
font-size: 14px;
font-family: PingFang SC;
font-weight: 500;
color: #ffffff;
}
.icon_category {
position: absolute;
bottom: 14px;
left: 9px;
display: flex;
justify-content: flex-start;
// margin-left: 7px;
.div_icon_item{
.icon_img{
margin-left: 5px;
width: 21px;
height: 20px;
}
.icon_name{
text-align: center;
display: flex;
justify-content: center;
}
}
}
.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;
}
}
}
}
.div_room::after {
content: '';
flex: 1;
}
}
.user_list {
position: relative;
z-index: 10;
background: #020340;
border: 1px solid #0a359b;
border-radius: 4px;
box-shadow: 0 0 10px inset #1a5afd;
.user_item {
padding: 9px 8px 0 12px;
font-size: 14px;
font-family: PingFang SC;
font-weight: 400;
color: #ffffff;
line-height: 10px;
.user_item_content {
display: flex;
// justify-content: space-between;
align-items: center;
.name {
max-width: 80%;
text-align: left;
}
> img {
margin-left: auto;
margin-top: 4px;
width: 8px;
height: 12px;
}
}
.item_line {
margin-top: 9px;
width: 70px;
height: 0px;
border: 1px dotted #1797ff31;
border-width: 0.5px;
}
.last_line {
border: 1px dotted #1797ff00;
}
}
}
.m-sidebar {
position: absolute;
right: 0;
top: 50px;
z-index: 1000;
width: 370px;
height: 470px;
overflow: hidden;
.wrap {
display: flex;
justify-content: flex-start;
align-items: center;
background-color: rgba(rgb(173, 173, 173), 0);
transform: translateX(-5px);
transition: all ease 1s;
border-radius: 4px;
}
.wrap-hidden {
transform: translateX(339px);
}
.div_agency_list {
width: 320px;
height: 470px;
color: #fff;
background: url('../../../img/modules/visual/box-2.png') no-repeat center;
background-size: 100% 100%;
padding: 45px 20px 35px 20px;
.agency_main {
height: 100%;
position: relative;
}
.agency_main {
/deep/ .el-scrollbar__wrap {
overflow-x: hidden !important;
}
}
.no-data-img {
text-align: center;
margin-top: 50px;
margin-left: 15px;
}
.agency_list {
.agency_item {
// height: 60px;
padding: 15px 0;
font-size: 17px;
font-family: PingFang SC;
font-weight: 400;
color: #ffffff;
// line-height: 50px;
padding-left: 12px;
display: flex;
flex-direction: row;
align-items: center;
// padding-top: 15px;
.agency_item_name {
// line-height: 20px;
}
}
.agency_item_on {
background: #08216c;
border-radius: 2px;
}
.agency_item:hover {
cursor: pointer;
background-color: #011168;
border-radius: 4px 0 0 4px;
border: none;
box-shadow: 0 0 10px inset #1a5afd;
border-radius: 2px;
}
}
}
.arrow_tip {
margin-right: -2px;
margin-left: 10px;
> img {
width: 22px;
height: 176px;
}
}
.arrow_tip:hover {
cursor: pointer;
}
}
.m-room-pop {
@include shield;
background-color: rgba(#000, 0.9);
overflow-y: auto;
.wrap {
position: relative;
margin: 120px auto;
width: 680px;
.title {
padding: 10px;
font-size: 22px;
font-family: PingFang SC;
font-weight: 800;
color: #ffffff;
display: flex;
align-items: center;
img {
display: block;
margin-right: 5px;
}
span {
display: block;
}
}
.btn-close {
position: absolute;
top: -15px;
right: -15px;
cursor: pointer;
}
.list {
// display: flex;
// flex-wrap: wrap;
padding: 5px 60px 5px 30px;
.item {
position: relative;
box-sizing: border-box;
padding: 0 15px;
width: 100%;
color: #fff;
font-size: 18px;
font-family: PingFang SC;
font-weight: 400;
color: #ffffff;
line-height: 24px;
margin: 15px 0;
&::before {
position: absolute;
left: 0;
top: 9px;
content: "";
display: block;
width: 7px;
height: 7px;
background: #0c81fe;
border-radius: 3px;
}
}
}
}
}

2
src/views/modules/communityService/ninePlaces/inspect/inspect.vue

@ -277,7 +277,7 @@ export default {
return {
loading: false,
total: 0,
pageSize: 10,
pageSize: 20,
pageNo: 0,
tableLoading: false,

2
src/views/modules/communityService/ninePlaces/places/places.vue

@ -209,7 +209,7 @@ export default {
return {
loading: false,
total: 0,
pageSize: 10,
pageSize: 20,
pageNo: 0,
tableLoading: false,

2
src/views/modules/communityService/ninePlaces/team/team.vue

@ -202,7 +202,7 @@ export default {
return {
loading: false,
total: 0,
pageSize: 10,
pageSize: 20,
pageNo: 0,
tableLoading: false,

548
src/views/modules/shequzhili/csgltc/csgl.vue

@ -0,0 +1,548 @@
<template>
<div class="div_main">
<div class="div_search">
<el-form :inline="true"
:model="formData"
ref="ref_searchform"
:label-width="'100px'">
<el-form-item label="单位名称"
prop="unitName">
<el-input v-model="formData.unitName"
class="item_width_1"
clearable
size="small"
placeholder="请输入内容">
</el-input>
</el-form-item>
<el-form-item label="服务事项"
prop="serviceMatter">
<el-select class="item_width_1"
v-model="formData.serviceMatter"
placeholder="请选择"
size="small"
clearable>
<el-option v-for="item in serviceList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-button style="margin-left:10px"
class="diy-button--search"
size="small"
@click="handleSearch">查询</el-button>
<el-button style="margin-left:10px"
class="diy-button--reset"
size="small"
@click="resetSearch">重置</el-button>
</el-form>
</div>
<div class="div_table">
<div class="div_btn">
<el-button class="diy-button--add"
size="small"
@click="handleAdd">新增</el-button>
<el-upload ref="upload"
:multiple='false'
:show-file-list='false'
:before-upload="beforeUpload"
action=""
accept=".xls,.xlsx"
:limit="1"
:on-exceed="handleExceed"
:http-request="uploadFile">
<el-button style="margin-left:10px"
size="small"
class="diy-button--delete">导入</el-button>
</el-upload>
<el-button style="float:left;margin-left:10px"
class="diy-button--reset"
size="small"
@click="handleExport">导出</el-button>
</div>
<el-table class="table"
:data="tableData"
border
:height="tableHeight"
v-loading="tableLoading"
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}"
style="width: 100%">
<el-table-column label="序号"
header-align="center"
align="center"
type="index"
width="50"></el-table-column>
<el-table-column prop="unitName"
header-align="center"
align="center"
label="场所名称"
min-width="100">
</el-table-column>
<el-table-column prop="type"
header-align="center"
align="center"
label="场所类别"
min-width="80">
</el-table-column>
<el-table-column prop="serviceMatterListShow"
header-align="center"
align="center"
label="占地面积"
show-overflow-tooltip
min-width="250">
</el-table-column>
<el-table-column prop="contact"
header-align="center"
align="center"
label="容纳人数"
width="80">
</el-table-column>
<el-table-column prop="contactMobile"
header-align="center"
align="center"
label="地址"
width="120">
</el-table-column>
<el-table-column label="操作"
fixed="right"
width="250"
header-align="center"
align="center"
class="operate">
<template slot-scope="scope">
<el-button type="text"
class="div-table-button--detail"
size="small"
@click="handleDetail(scope.row)">查看</el-button>
<el-button type="text"
class="div-table-button--edit"
size="small"
@click="handleEdit(scope.row)">修改</el-button>
<el-button type="text"
class="div-table-button--delete"
size="small"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div>
<el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pageNo"
:page-sizes="[20, 50, 100, 200]"
:page-size="pageSize"
layout="sizes, prev, pager, next, total"
:total="total">
</el-pagination>
</div>
</div>
<!-- 修改弹出框 -->
<el-dialog :visible.sync="formShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="formTitle"
:destroy-on-close="true"
width="950px"
top="5vh"
class="dialog-h"
@closed="editDiaClose">
<csgl-form ref="ref_form"
:typeList="typeList"
@dialogCancle="addFormCancle"
@dialogOk="addFormOk"></csgl-form>
</el-dialog>
<el-dialog :visible.sync="detailShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="'单位详情'"
width="950px"
top="5vh"
class="dialog-h"
@closed="diaClose">
<csgl-detail ref="ref_detail"
@diaClose="diaClose"></csgl-detail>
</el-dialog>
</div>
</template>
<script>
import csglForm from './csglForm'
import csglDetail from './csglDetail'
import { requestPost } from "@/js/dai/request";
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
let loading //
export default {
data () {
return {
loading: false,
total: 0,
pageSize: 10,
pageNo: 0,
tableLoading: false,
agencyId: '',
unitList: [],//list
serviceList: [],//list
typeList: [],//list
unitId: '',
formData: {
unitName: '',
serviceMatter: '',
type: '',
contact: '',
contactMobile: ''
},
tableData: [],
//form
formShow: false,
formTitle: '新增场所',
detailShow: false,
files: "",
fileName: "",
uploadUlr: window.SITE_CONFIG['apiURL'] + '/gov/org/neighborhood/import'
}
},
components: {
csglForm, csglDetail
},
async created () {
},
async mounted () {
//
await this.loadService()
const { user } = this.$store.state
this.agencyId = user.agencyId
await this.loadTable()
},
methods: {
handleSearch () {
this.loadTable()
},
//
async loadService () {
const url = "/heart/serviceitem/dict-list"
let params = {
// parentCategoryCode: '1010'
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.serviceList = data
} else {
this.$message.error(msg)
}
},
async loadTable () {
this.tableLoading = true
const url = "/heart/icpartyunit/list"
// const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/list"
let params = {
pageSize: this.pageSize,
pageNo: this.pageNo,
agencyId: this.agencyId,
...this.formData
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.total = data.total
data.list.forEach(element => {
if (element.serviceMatterList.length > 0) {
element.serviceMatterListShow = element.serviceMatterList.join(',')
} else {
element.serviceMatterListShow = ''
}
});
this.tableData = data.list
} else {
this.$message.error(msg)
}
this.tableLoading = false
},
editDiaClose () {
this.$refs.ref_form.resetData()
this.formShow = false
},
diaClose () {
this.detailShow = false
this.finishDiaShow = false
this.scoreDiaShow = false
},
handleDetail (row) {
this.detailShow = true
this.$nextTick(() => {
this.$refs.ref_detail.initForm(row)
})
},
handleAdd () {
this.formTitle = '新增'
this.formShow = 'edit'
this.$nextTick(() => {
this.$refs.ref_form.initForm('add', null)
})
},
handleEdit (row) {
this.formTitle = '修改'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('edit', row.id)
})
},
addFormCancle () {
this.formShow = false
},
addFormOk () {
this.formShow = false
this.loadTable()
},
async handleDelete (row) {
this.$confirm("确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.deleteUnit(row)
})
.catch(err => {
if (err == "cancel") {
}
});
},
async deleteUnit (row) {
const url = "/heart/icpartyunit/delete"
// const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/delete"
let params = {
id: row.id
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.$message({
type: "success",
message: "删除成功"
});
this.loadTable()
} else {
this.$message.error(msg)
}
},
//
resetSearch () {
this.formData = {
unitName: '',
serviceMatter: '',
type: '',
contact: '',
contactMobile: ''
}
this.pageSize = 10
this.pageNo = 0
// this.loadTable()
},
//
async handleExport () {
let title = '城市管理图层'
const url = "/heart/icpartyunit/export"
let params = {
agencyId: this.agencyId,
...this.formData
}
app.ajax.exportFilePost(
url,
params,
(data, rspMsg) => {
this.download(data, title + '.xls')
},
(rspMsg, data) => {
this.$message.error(rspMsg);
}
);
},
//
download (data, fileName) {
if (!data) {
return
}
var csvData = new Blob([data])
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveOrOpenBlob(csvData, fileName);
}
// for Non-IE (chrome, firefox etc.)
else {
var a = document.createElement('a');
document.body.appendChild(a);
a.style = 'display: none';
var url = window.URL.createObjectURL(csvData);
a.href = url;
a.download = fileName;
a.click();
a.remove();
window.URL.revokeObjectURL(url);
}
},
//
beforeUpload (file) {
this.files = file;
const isText = file.type === 'application/vnd.ms-excel'
const isTextComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
if (!isText && !isTextComputer) {
this.$message.error('请选择正确格式的文件')
return false
} else {
this.fileName = file.name;
return true
}
},
//
handleExceed (files, fileList) {
this.$message.warning(`当前限制选择 1 个文件,请删除后继续上传`)
},
async uploadFile () {
this.loading = true
if (this.fileName == "") {
this.$message.warning('请选择要上传的文件!')
return false
}
//
this.$refs['upload'].clearFiles()
var url = '/heart/icpartyunit/import'
let fileFormData = new FormData();
fileFormData.append('file', this.files);//filenamefiletest.zip
const { data, code, msg } = await requestPost(url, fileFormData)
if (code === 0) {
this.$message({
type: "success",
message: "导入成功"
});
this.loadTable()
} else {
this.$message.error(msg)
}
},
handleSizeChange (val) {
this.pageSize = val
this.pageNo = 1
this.loadTable()
},
handleCurrentChange (val) {
this.pageNo = val
this.loadTable()
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
tableHeight () {
return this.$store.state.inIframe ? this.clientHeight - 430 + this.iframeHeight : this.clientHeight - 430
},
...mapGetters(['clientHeight', 'iframeHeight'])
},
watch: {
},
props: {
}
}
</script>
<style lang="scss" scoped>
@import "@/assets/scss/buttonstyle.scss";
@import "@/assets/scss/modules/management/list-main.scss";
</style>

281
src/views/modules/shequzhili/csgltc/csglDetail.vue

@ -0,0 +1,281 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<el-form ref="ref_form"
:inline="true"
:model="formData"
class="form">
<el-form-item label="单位名称:"
prop="unitName"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.unitName}}</span>
</el-form-item>
<el-form-item label="分类:"
prop="type"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.type}}</span>
</el-form-item>
<el-form-item label="服务事项:"
prop="serviceMatterList"
label-width="150px"
style="display: block">
<p class="detail_span"
v-for="(item,index) in formData.serviceMatterList"
:key="index">{{item}}</p>
</el-form-item>
<el-form-item label="联系人:"
prop="contact"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.contact}}</span>
</el-form-item>
<el-form-item label="联系电话:"
prop="contactMobile"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.contactMobile}}</span>
</el-form-item>
<el-form-item label="在职党员:"
style="display: block"
prop="memberCount"
label-width="150px">
<span class="detail_span">{{formData.memberCount}}</span>
</el-form-item>
<el-form-item label="备注:"
prop="remark"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.remark?formData.remark:'无'}}</span>
</el-form-item>
<el-form-item label="地理位置:"
prop="address"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.address}}</span>
</el-form-item>
<el-form-item label="位置坐标:"
prop="longitude"
label-width="150px"
style="display: block">
<div style="width:500px">
<div id="app">
</div>
</div>
</el-form-item>
</el-form>
</div>
<div class="div_btn">
<el-button size="small"
@click="handleCancle"> </el-button>
</div>
</div>
</template>
<script>
import { Loading } from 'element-ui' // Loading
var map
var search
var markers
var infoWindowList
var geocoder //
let loading //
export default {
data () {
return {
formData: {},
}
},
components: {},
mounted () {
this.initMap()
},
methods: {
handleCancle () {
this.$emit('diaClose')
},
async initForm (row) {
this.startLoading()
this.formData = { ...row }
map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude))
this.setMarker(this.formData.latitude, this.formData.longitude)
this.endLoading()
},
// init
initMap () {
//
var center = new window.TMap.LatLng(36.0722275, 120.38945519)
// map TMap.Map()
map = new window.TMap.Map(document.getElementById('app'), {
center: center, //
zoom: 17.2, //
pitch: 43.5, //
rotation: 45 //
})
search = new window.TMap.service.Search({ pageSize: 10 })
//
markers = new TMap.MultiMarker({
map: map,
geometries: []
})
infoWindowList = Array(10)
geocoder = new TMap.service.Geocoder(); //
//
map.on('panend', () => {
this.handleMoveCenter()
})
this.handleMoveCenter()
this.convert()
},
setMarker (lat, lng) {
markers.setGeometries([])
markers.add([
{
id: '4',
styleId: 'marker',
position: new TMap.LatLng(lat, lng),
properties: {
title: 'marker4'
}
}
])
},
handleSearchMap () {
infoWindowList.forEach((infoWindow) => {
infoWindow.close()
})
infoWindowList.length = 0
markers.setGeometries([])
//
search
.searchRectangle({
keyword: this.keyWords,
bounds: map.getBounds()
})
.then((result) => {
let { data } = result
if (Array.isArray(data) && data.length > 0) {
const {
location: { lat, lng }
} = data[0]
map.setCenter(new TMap.LatLng(lat, lng))
this.setMarker(lat, lng)
this.formData.latitude = lat
this.formData.longitude = lng
this.convert()
} else {
this.$message.error('未检索到相关位置坐标')
}
})
},
handleMoveCenter () {
//
const center = map.getCenter()
const lat = center.getLat()
const lng = center.getLng()
this.formData.latitude = lat
this.formData.longitude = lng
this.setMarker(lat, lng)
this.convert(lat, lng)
},
convert (lat, lng) {
markers.setGeometries([]);
// var input = document.getElementById('location').value.split(',');
let location
if (lat && lng) {
location = new TMap.LatLng(lat, lng);
} else {
location = new TMap.LatLng(this.formData.latitude, this.formData.longitude);
}
// map.setCenter(location);
markers.updateGeometries([
{
id: 'main', //
position: location,
},
]);
geocoder
.getAddress({ location: location }) //
.then((result) => {
// this.formData.address = result.result.address
//
});
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
},
props: {
}
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/visual/communityManageForm.scss";
</style>
<style scoped>
.detail_span {
width: 500px;
font-weight: bold;
text-align: left;
margin: 0 0;
font-size: 16px;
}
.form {
margin-top: 30px;
}
</style>

495
src/views/modules/shequzhili/csgltc/csglForm.vue

@ -0,0 +1,495 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<el-form ref="ref_form"
:inline="true"
:model="formData"
:rules="dataRule"
:disabled="formType === 'detail'"
class="form">
<el-form-item label="场所名称"
prop="unitName"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入单位名称"
v-model="formData.unitName">
</el-input>
</el-form-item>
<el-form-item label="场所类型"
prop="type"
label-width="150px"
style="display: block">
<el-select class="item_width_1"
v-model="formData.type"
placeholder="请选择"
filterable
clearable>
<el-option v-for="item in typeList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="占地面积"
style="display: block"
prop="memberCount"
label-width="150px">
<el-input-number class="item_width_4"
v-model="formData.memberCount"
:min="0"
:max="9999"
label="占地面积"></el-input-number>
</el-form-item>
<el-form-item label="容纳人数"
style="display: block"
prop="memberCount"
label-width="150px">
<el-input-number class="item_width_4"
v-model="formData.memberCount"
:min="0"
:max="9999"
label="容纳人数"></el-input-number>
</el-form-item>
<el-form-item label="位置坐标"
prop="longitude"
label-width="150px"
style="display: block">
<div style="width:500px">
<div class="div_map">
<div id="app">
</div>
<div class="div_searchmap">
<el-input class="item_width_4"
maxlength="50"
size="mini"
placeholder="请输入关键字"
v-model="keyWords">
</el-input>
<el-button style="margin-left: 10px"
type="primary"
size="mini"
@click="handleSearchMap">查询</el-button>
</div>
</div>
<!-- <div style="margin-top: 10px">
<span>经度</span>
<el-input class="item_width_3"
maxlength="50"
placeholder="请输入经度"
v-model="formData.longitude">
</el-input>
<span style="margin-left: 20px">纬度</span>
<el-input class="item_width_3"
maxlength="50"
placeholder="请输入纬度"
v-model="formData.latitude">
</el-input>
</div> -->
</div>
</el-form-item>
<el-form-item label="地理位置"
prop="address"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
v-model="formData.address">
</el-input>
</el-form-item>
</el-form>
</div>
<div class="div_btn">
<el-button size="small"
@click="handleCancle"> </el-button>
<el-button size="small"
v-if="formType != 'detail'"
type="primary"
:disabled="btnDisable"
@click="handleComfirm"> </el-button>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request'
var map
var search
var markers
var infoWindowList
var geocoder //
let loading //
export default {
data () {
return {
formType: 'add', // addeditdetail
btnDisable: false,
unitId: '',
keyWords: '',
formData: {
unitName: '',
serviceMatterList: [],
type: '',
contact: '',
contactMobile: '',
memberCount: 0,
remark: '', //500
address: '', //
longitude: 36.0722275, //
latitude: 120.38945519 //
},
serviceList: [],//list
}
},
components: {},
mounted () {
this.initMap()
},
methods: {
async initForm (type, unitId) {
this.startLoading()
this.$refs.ref_form.resetFields();
//
await this.loadService()
this.formType = type
if (unitId) {
this.unitId = unitId
this.formData.id = unitId
await this.loadFormData()
} else {
map.setCenter(new TMap.LatLng(36.0722275, 120.38945519))
this.setMarker(36.0722275, 120.38945519)
}
this.endLoading()
},
//
async loadService () {
const url = "/heart/serviceitem/dict-list"
let params = {
type: 'usable'
// parentCategoryCode: '1010'
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.serviceList = data
} else {
this.$message.error(msg)
}
},
//
async loadFormData () {
const url = '/heart/icpartyunit/detail'
// const url = 'http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/detail'
let params = {
id: this.unitId
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
if (!data.serviceMatterList || !Array.isArray(data.serviceMatterList)) {
data.serviceMatterList = []
}
this.formData = { ...data }
map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude))
this.setMarker(this.formData.latitude, this.formData.longitude)
} else {
this.$message.error(msg)
}
},
async handleComfirm () {
this.btnDisable = true
setTimeout(() => {
this.btnDisable = false
}, 10000)
this.$refs['ref_form'].validate((valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj)
this.btnDisable = false
} else {
this.addUnit()
}
})
},
async addUnit () {
// const regPhone = /^1(3|4|5|6|7|8|9)\d{9}$/; //
// if (regPhone.test(this.formData.contactMobile) === false) {
// this.btnDisable = false
// this.$message({
// type: 'warning',
// message: ''
// })
// return false;
// }
let url = '/heart/icpartyunit/save'
// let url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/save"
// if (this.formType === 'edit') {
// this.formData.id = this.unitId
// }
const { data, code, msg } = await requestPost(url, this.formData)
if (code === 0) {
this.$message({
type: 'success',
message: '操作成功'
})
this.resetData()
this.$emit('dialogOk')
this.btnDisable = false
} else {
this.btnDisable = false
this.$message.error(msg)
}
},
handleCancle () {
this.resetData()
this.$emit('dialogCancle')
},
// init
initMap () {
//
var center = new window.TMap.LatLng(36.0722275, 120.38945519)
// map TMap.Map()
map = new window.TMap.Map(document.getElementById('app'), {
center: center, //
zoom: 17.2, //
pitch: 43.5, //
rotation: 45 //
})
search = new window.TMap.service.Search({ pageSize: 10 })
//
markers = new TMap.MultiMarker({
map: map,
geometries: []
})
infoWindowList = Array(10)
geocoder = new TMap.service.Geocoder(); //
//
map.on('panend', () => {
this.handleMoveCenter()
})
this.handleMoveCenter()
this.convert()
},
setMarker (lat, lng) {
markers.setGeometries([])
markers.add([
{
id: '4',
styleId: 'marker',
position: new TMap.LatLng(lat, lng),
properties: {
title: 'marker4'
}
}
])
},
handleSearchMap () {
infoWindowList.forEach((infoWindow) => {
infoWindow.close()
})
infoWindowList.length = 0
markers.setGeometries([])
//
search
.searchRectangle({
keyword: this.keyWords,
bounds: map.getBounds()
})
.then((result) => {
let { data } = result
if (Array.isArray(data) && data.length > 0) {
const {
location: { lat, lng }
} = data[0]
map.setCenter(new TMap.LatLng(lat, lng))
this.setMarker(lat, lng)
this.formData.latitude = lat
this.formData.longitude = lng
this.convert()
} else {
this.$message.error('未检索到相关位置坐标')
}
})
},
handleMoveCenter () {
//
const center = map.getCenter()
const lat = center.getLat()
const lng = center.getLng()
this.formData.latitude = lat
this.formData.longitude = lng
this.setMarker(lat, lng)
this.convert(lat, lng)
},
convert (lat, lng) {
markers.setGeometries([]);
// var input = document.getElementById('location').value.split(',');
let location
if (lat && lng) {
location = new TMap.LatLng(lat, lng);
} else {
location = new TMap.LatLng(this.formData.latitude, this.formData.longitude);
}
// map.setCenter(location);
markers.updateGeometries([
{
id: 'main', //
position: location,
},
]);
geocoder
.getAddress({ location: location }) //
.then((result) => {
this.formData.address = result.result.address
//
});
},
resetData () {
this.unitId = ''
this.keyWords = ''
this.formData = {
unitName: '',
serviceMatterList: [],
type: '',
contact: '',
contactMobile: '',
memberCount: 0,
remark: '', //500
address: '', //
longitude: '', //
latitude: '' //
}
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
dataRule () {
return {
unitName: [
{ required: true, message: '单位名称不能为空', trigger: 'blur' },
],
type: [
{ required: true, message: '分类不能为空', trigger: 'blur' }
],
contact: [
{ required: true, message: '联系人不能为空', trigger: 'blur' }
],
contactMobile: [
{ required: true, message: '联系电话不能为空', trigger: 'blur' }
],
memberCount: [
{ required: true, message: '在职党员数不能为空', trigger: 'blur' }
],
address: [
{ required: true, message: '详细地址不能为空', trigger: 'blur' }
],
longitude: [
{ required: true, message: '坐标不能为空', trigger: 'blur' }
]
}
},
},
props: {
typeList: {
type: Array,
default: []
},
}
}
</script>
<style scoped>
.div_map {
position: relative;
}
.div_searchmap {
z-index: 5000;
position: absolute;
top: 5px;
left: 5px;
}
</style>
<style lang="scss" scoped >
@import "@/assets/scss/modules/visual/communityManageForm.scss";
</style>

705
src/views/modules/shequzhili/ggfwtc/ggfw.vue

@ -0,0 +1,705 @@
<template>
<div class="div_main">
<div class="div_search">
<el-form :inline="true"
:model="formData"
ref="ref_searchform"
:label-width="'100px'">
<div>
<el-form-item label="单位名称"
prop="unitName">
<el-input v-model="formData.unitName"
class="item_width_1"
clearable
size="small"
placeholder="请输入内容">
</el-input>
</el-form-item>
<el-form-item label="服务事项"
prop="serviceMatter">
<el-select class="item_width_2"
v-model="formData.serviceMatter"
placeholder="请选择"
size="small"
clearable>
<el-option v-for="item in serviceList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</div>
<div>
<el-form-item label="分类"
prop="type">
<el-select class="item_width_1"
v-model="formData.type"
placeholder="请选择"
size="small"
clearable>
<el-option v-for="item in typeList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="联系人"
prop="contact">
<el-input v-model="formData.contact"
class="item_width_1"
size="small"
clearable
placeholder="请输入内容">
</el-input>
</el-form-item>
<el-form-item label="联系电话"
prop="contactMobile">
<el-input v-model="formData.contactMobile"
class="item_width_1"
size="small"
clearable
placeholder="请输入内容">
</el-input>
</el-form-item>
<el-button style="margin-left:10px"
class="diy-button--search"
size="small"
@click="handleSearch">查询</el-button>
<el-button style="margin-left:10px"
class="diy-button--reset"
size="small"
@click="resetSearch">重置</el-button>
</div>
</el-form>
</div>
<div class="div_table">
<div class="div_btn">
<el-button class="diy-button--add"
size="small"
@click="handleAdd">新增</el-button>
<!--
<el-upload ref="upload"
:multiple='false'
:show-file-list='false'
:before-upload="beforeUpload"
action=""
accept=".xls,.xlsx"
:limit="1"
:on-exceed="handleExceed"
:http-request="uploadFile">
<el-button style="margin-left:10px"
size="small"
class="diy-button--delete">导入</el-button>
</el-upload>
<el-button style="float:left"
class="diy-button--reset"
size="small"
@click="handleExport">导出</el-button>-->
</div>
<el-table class="table"
:data="tableData"
border
:height="tableHeight"
v-loading="tableLoading"
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}"
style="width: 100%">
<el-table-column label="序号"
header-align="center"
align="center"
type="index"
width="50"></el-table-column>
<el-table-column prop="unitName"
header-align="center"
align="center"
label="单位名称"
min-width="100">
</el-table-column>
<el-table-column prop="type"
header-align="center"
align="center"
label="分类"
min-width="80">
</el-table-column>
<el-table-column prop="serviceMatterListShow"
header-align="center"
align="center"
label="服务事项"
show-overflow-tooltip
min-width="250">
<!-- <template slot-scope="scope">
<p style="text-align:center;margin:2px 0;"
v-for="(item,index) in scope.row.serviceMatterList"
:key="index">{{item}}</p>
</template> -->
</el-table-column>
<el-table-column prop="contact"
header-align="center"
align="center"
label="联系人"
width="80">
</el-table-column>
<el-table-column prop="contactMobile"
header-align="center"
align="center"
label="联系电话"
width="120">
</el-table-column>
<el-table-column prop="memberCount"
header-align="center"
align="center"
label="在职党员数"
width="100">
</el-table-column>
<el-table-column prop="satisfaction"
header-align="center"
align="center"
label="群众满意度"
width="100">
</el-table-column>
<el-table-column prop="score"
header-align="center"
align="center"
label="积分"
width="80">
</el-table-column>
<el-table-column prop="remark"
header-align="center"
align="center"
label="备注"
show-overflow-tooltip
width="150">
</el-table-column>
<el-table-column label="操作"
fixed="right"
width="250"
header-align="center"
align="center"
class="operate">
<template slot-scope="scope">
<el-button type="text"
class="div-table-button--detail"
size="small"
@click="handleDetail(scope.row)">查看</el-button>
<el-button type="text"
class="div-table-button--edit"
size="small"
@click="handleEdit(scope.row)">修改</el-button>
<el-button type="text"
class="div-table-button--detail"
size="small"
@click="handleFinish(scope.row)">完成情况</el-button>
<el-button type="text"
class="div-table-button--detail"
size="small"
@click="handleScore(scope.row)">积分记录</el-button>
<el-button type="text"
class="div-table-button--delete"
size="small"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div>
<el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pageNo"
:page-sizes="[10, 20, 50]"
:page-size="pageSize"
layout="sizes, prev, pager, next, total"
:total="total">
</el-pagination>
</div>
</div>
<!-- 修改弹出框 -->
<el-dialog :visible.sync="formShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="formTitle"
:destroy-on-close="true"
width="950px"
top="5vh"
class="dialog-h"
@closed="editDiaClose">
<ggfw-form ref="ref_form"
:typeList="typeList"
@dialogCancle="addFormCancle"
@dialogOk="addFormOk"></ggfw-form>
</el-dialog>
<el-dialog :visible.sync="detailShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="'单位详情'"
width="950px"
top="5vh"
class="dialog-h"
@closed="diaClose">
<ggfw-detail ref="ref_detail"
@diaClose="diaClose"></ggfw-detail>
</el-dialog>
</div>
</template>
<script>
import ggfwForm from './ggfwForm'
import ggfwDetail from './ggfwDetail'
import { requestPost } from "@/js/dai/request";
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
let loading //
export default {
data () {
return {
loading: false,
total: 0,
pageSize: 10,
pageNo: 0,
tableLoading: false,
agencyId: '',
unitList: [],//list
serviceList: [],//list
typeList: [],//list
unitId: '',
formData: {
unitName: '',
serviceMatter: '',
type: '',
contact: '',
contactMobile: ''
},
tableData: [],
//form
formShow: false,
formTitle: '新增单位',
detailShow: false,
//
finishDiaTitle: '区域化党建单位完成情况',
finishDiaShow: false,
//
scoreDiaTitle: '积分记录',
scoreDiaShow: false,
files: "",
fileName: "",
uploadUlr: window.SITE_CONFIG['apiURL'] + '/gov/org/neighborhood/import'
}
},
components: {
ggfwForm, ggfwDetail
},
async created () {
},
async mounted () {
//
await this.loadService()
//
await this.loadType()
const { user } = this.$store.state
this.agencyId = user.agencyId
await this.loadTable()
},
methods: {
handleSearch () {
this.loadTable()
},
//
async loadService () {
const url = "/heart/serviceitem/dict-list"
let params = {
// parentCategoryCode: '1010'
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.serviceList = data
} else {
this.$message.error(msg)
}
},
//
async loadType () {
const url = "/sys/dict/data/dictlist"
let params = {
dictType: 'party_unit_type'
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.typeList = data
} else {
this.$message.error(msg)
}
},
async loadTable () {
this.tableLoading = true
const url = "/heart/icpartyunit/list"
// const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/list"
let params = {
pageSize: this.pageSize,
pageNo: this.pageNo,
agencyId: this.agencyId,
...this.formData
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.total = data.total
data.list.forEach(element => {
if (element.serviceMatterList.length > 0) {
element.serviceMatterListShow = element.serviceMatterList.join(',')
} else {
element.serviceMatterListShow = ''
}
});
this.tableData = data.list
} else {
this.$message.error(msg)
}
this.tableLoading = false
},
editDiaClose () {
this.$refs.ref_form.resetData()
this.formShow = false
},
diaClose () {
this.detailShow = false
this.finishDiaShow = false
this.scoreDiaShow = false
},
handleDetail (row) {
this.detailShow = true
this.$nextTick(() => {
this.$refs.ref_detail.initForm(row)
})
},
//
handleFinish (row) {
this.finishDiaTitle = row.unitName + '完成情况'
this.finishDiaShow = true
this.$nextTick(() => {
this.$refs.ref_finish.initTable(row)
})
},
//
handleScore (row) {
this.scoreDiaShow = true
this.$nextTick(() => {
this.$refs.ref_score.initForm(row.id)
})
},
handleAdd () {
this.formTitle = '新增'
this.formShow = 'edit'
this.$nextTick(() => {
this.$refs.ref_form.initForm('add', null)
})
},
handleEdit (row) {
this.formTitle = '修改'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('edit', row.id)
})
},
addFormCancle () {
this.formShow = false
},
addFormOk () {
this.formShow = false
this.loadTable()
},
async handleDelete (row) {
this.$confirm("确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.deleteUnit(row)
})
.catch(err => {
if (err == "cancel") {
}
});
},
async deleteUnit (row) {
const url = "/heart/icpartyunit/delete"
// const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/delete"
let params = {
id: row.id
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.$message({
type: "success",
message: "删除成功"
});
this.loadTable()
} else {
this.$message.error(msg)
}
},
//
resetSearch () {
this.formData = {
unitName: '',
serviceMatter: '',
type: '',
contact: '',
contactMobile: ''
}
this.pageSize = 10
this.pageNo = 0
// this.loadTable()
},
//
async handleExport () {
let title = '联建单位列表'
const url = "/heart/icpartyunit/export"
let params = {
agencyId: this.agencyId,
...this.formData
}
app.ajax.exportFilePost(
url,
params,
(data, rspMsg) => {
this.download(data, title + '.xls')
},
(rspMsg, data) => {
this.$message.error(rspMsg);
}
);
},
//
download (data, fileName) {
if (!data) {
return
}
var csvData = new Blob([data])
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveOrOpenBlob(csvData, fileName);
}
// for Non-IE (chrome, firefox etc.)
else {
var a = document.createElement('a');
document.body.appendChild(a);
a.style = 'display: none';
var url = window.URL.createObjectURL(csvData);
a.href = url;
a.download = fileName;
a.click();
a.remove();
window.URL.revokeObjectURL(url);
}
},
//
beforeUpload (file) {
this.files = file;
const isText = file.type === 'application/vnd.ms-excel'
const isTextComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
if (!isText && !isTextComputer) {
this.$message.error('请选择正确格式的文件')
return false
} else {
this.fileName = file.name;
return true
}
},
//
handleExceed (files, fileList) {
this.$message.warning(`当前限制选择 1 个文件,请删除后继续上传`)
},
async uploadFile () {
this.loading = true
if (this.fileName == "") {
this.$message.warning('请选择要上传的文件!')
return false
}
//
this.$refs['upload'].clearFiles()
var url = '/heart/icpartyunit/import'
let fileFormData = new FormData();
fileFormData.append('file', this.files);//filenamefiletest.zip
const { data, code, msg } = await requestPost(url, fileFormData)
if (code === 0) {
this.$message({
type: "success",
message: "导入成功"
});
this.loadTable()
} else {
this.$message.error(msg)
}
},
handleSizeChange (val) {
this.pageSize = val
this.pageNo = 1
this.loadTable()
},
handleCurrentChange (val) {
this.pageNo = val
this.loadTable()
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
tableHeight () {
return this.$store.state.inIframe ? this.clientHeight - 430 + this.iframeHeight : this.clientHeight - 430
},
...mapGetters(['clientHeight', 'iframeHeight'])
},
watch: {
},
props: {
}
}
</script>
<style lang="scss" scoped >
.div_main {
width: 100%;
}
.div_search {
background: #ffffff;
border-radius: 4px;
padding: 30px 20px 5px;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1);
}
.item_width_1 {
width: 260px;
}
.item_width_2 {
width: 620px;
}
.div_table {
background: #ffffff;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1);
border-radius: 4px;
margin-top: 15px;
padding: 23px 30px 10px;
.table {
margin-top: 20px;
}
}
.el-row {
/* margin-bottom: 20px; */
display: flex;
flex-wrap: wrap;
margin-top: 10px;
margin-right: 50px;
}
</style>

281
src/views/modules/shequzhili/ggfwtc/ggfwDetail.vue

@ -0,0 +1,281 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<el-form ref="ref_form"
:inline="true"
:model="formData"
class="form">
<el-form-item label="单位名称:"
prop="unitName"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.unitName}}</span>
</el-form-item>
<el-form-item label="分类:"
prop="type"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.type}}</span>
</el-form-item>
<el-form-item label="服务事项:"
prop="serviceMatterList"
label-width="150px"
style="display: block">
<p class="detail_span"
v-for="(item,index) in formData.serviceMatterList"
:key="index">{{item}}</p>
</el-form-item>
<el-form-item label="联系人:"
prop="contact"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.contact}}</span>
</el-form-item>
<el-form-item label="联系电话:"
prop="contactMobile"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.contactMobile}}</span>
</el-form-item>
<el-form-item label="在职党员:"
style="display: block"
prop="memberCount"
label-width="150px">
<span class="detail_span">{{formData.memberCount}}</span>
</el-form-item>
<el-form-item label="备注:"
prop="remark"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.remark?formData.remark:'无'}}</span>
</el-form-item>
<el-form-item label="地理位置:"
prop="address"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.address}}</span>
</el-form-item>
<el-form-item label="位置坐标:"
prop="longitude"
label-width="150px"
style="display: block">
<div style="width:500px">
<div id="app">
</div>
</div>
</el-form-item>
</el-form>
</div>
<div class="div_btn">
<el-button size="small"
@click="handleCancle"> </el-button>
</div>
</div>
</template>
<script>
import { Loading } from 'element-ui' // Loading
var map
var search
var markers
var infoWindowList
var geocoder //
let loading //
export default {
data () {
return {
formData: {},
}
},
components: {},
mounted () {
this.initMap()
},
methods: {
handleCancle () {
this.$emit('diaClose')
},
async initForm (row) {
this.startLoading()
this.formData = { ...row }
map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude))
this.setMarker(this.formData.latitude, this.formData.longitude)
this.endLoading()
},
// init
initMap () {
//
var center = new window.TMap.LatLng(36.0722275, 120.38945519)
// map TMap.Map()
map = new window.TMap.Map(document.getElementById('app'), {
center: center, //
zoom: 17.2, //
pitch: 43.5, //
rotation: 45 //
})
search = new window.TMap.service.Search({ pageSize: 10 })
//
markers = new TMap.MultiMarker({
map: map,
geometries: []
})
infoWindowList = Array(10)
geocoder = new TMap.service.Geocoder(); //
//
map.on('panend', () => {
this.handleMoveCenter()
})
this.handleMoveCenter()
this.convert()
},
setMarker (lat, lng) {
markers.setGeometries([])
markers.add([
{
id: '4',
styleId: 'marker',
position: new TMap.LatLng(lat, lng),
properties: {
title: 'marker4'
}
}
])
},
handleSearchMap () {
infoWindowList.forEach((infoWindow) => {
infoWindow.close()
})
infoWindowList.length = 0
markers.setGeometries([])
//
search
.searchRectangle({
keyword: this.keyWords,
bounds: map.getBounds()
})
.then((result) => {
let { data } = result
if (Array.isArray(data) && data.length > 0) {
const {
location: { lat, lng }
} = data[0]
map.setCenter(new TMap.LatLng(lat, lng))
this.setMarker(lat, lng)
this.formData.latitude = lat
this.formData.longitude = lng
this.convert()
} else {
this.$message.error('未检索到相关位置坐标')
}
})
},
handleMoveCenter () {
//
const center = map.getCenter()
const lat = center.getLat()
const lng = center.getLng()
this.formData.latitude = lat
this.formData.longitude = lng
this.setMarker(lat, lng)
this.convert(lat, lng)
},
convert (lat, lng) {
markers.setGeometries([]);
// var input = document.getElementById('location').value.split(',');
let location
if (lat && lng) {
location = new TMap.LatLng(lat, lng);
} else {
location = new TMap.LatLng(this.formData.latitude, this.formData.longitude);
}
// map.setCenter(location);
markers.updateGeometries([
{
id: 'main', //
position: location,
},
]);
geocoder
.getAddress({ location: location }) //
.then((result) => {
// this.formData.address = result.result.address
//
});
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
},
props: {
}
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/visual/communityManageForm.scss";
</style>
<style scoped>
.detail_span {
width: 500px;
font-weight: bold;
text-align: left;
margin: 0 0;
font-size: 16px;
}
.form {
margin-top: 30px;
}
</style>

527
src/views/modules/shequzhili/ggfwtc/ggfwForm.vue

@ -0,0 +1,527 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<el-form ref="ref_form"
:inline="true"
:model="formData"
:rules="dataRule"
:disabled="formType === 'detail'"
class="form">
<el-form-item label="单位名称"
prop="unitName"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入单位名称"
v-model="formData.unitName">
</el-input>
</el-form-item>
<el-form-item label="分类"
prop="type"
label-width="150px"
style="display: block">
<el-select class="item_width_1"
v-model="formData.type"
placeholder="请选择"
filterable
clearable>
<el-option v-for="item in typeList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="服务事项"
prop="serviceMatterList"
label-width="150px"
style="display: block">
<el-checkbox-group class="item_width_1"
style="display:flex;flex-wrap:wrap"
v-model="formData.serviceMatterList">
<el-checkbox v-for="item in serviceList"
:key="item.value"
:label="item.value">{{item.label}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="联系人"
prop="contact"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
placeholder="请输入联系人姓名"
v-model="formData.contact">
</el-input>
</el-form-item>
<el-form-item label="联系电话"
prop="contactMobile"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
placeholder="请输入联系人电话"
v-model="formData.contactMobile">
</el-input>
</el-form-item>
<el-form-item label="在职党员"
style="display: block"
prop="memberCount"
label-width="150px">
<el-input-number class="item_width_4"
v-model="formData.memberCount"
:min="0"
:max="9999"
label="在职党员"></el-input-number>
</el-form-item>
<el-form-item label="备注"
prop="remark"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
type="textarea"
maxlength="500"
show-word-limit
:rows="3"
placeholder="请输入备注,不超过500字"
v-model="formData.remark"></el-input>
</el-form-item>
<el-form-item label="位置坐标"
prop="longitude"
label-width="150px"
style="display: block">
<div style="width:500px">
<div class="div_map">
<div id="app">
</div>
<div class="div_searchmap">
<el-input class="item_width_4"
maxlength="50"
size="mini"
placeholder="请输入关键字"
v-model="keyWords">
</el-input>
<el-button style="margin-left: 10px"
type="primary"
size="mini"
@click="handleSearchMap">查询</el-button>
</div>
</div>
<div style="margin-top: 10px">
<span>经度</span>
<el-input class="item_width_3"
maxlength="50"
placeholder="请输入经度"
v-model="formData.longitude">
</el-input>
<span style="margin-left: 20px">纬度</span>
<el-input class="item_width_3"
maxlength="50"
placeholder="请输入纬度"
v-model="formData.latitude">
</el-input>
</div>
</div>
</el-form-item>
<el-form-item label="地理位置"
prop="address"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
v-model="formData.address">
</el-input>
</el-form-item>
</el-form>
</div>
<div class="div_btn">
<el-button size="small"
@click="handleCancle"> </el-button>
<el-button size="small"
v-if="formType != 'detail'"
type="primary"
:disabled="btnDisable"
@click="handleComfirm"> </el-button>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request'
var map
var search
var markers
var infoWindowList
var geocoder //
let loading //
export default {
data () {
return {
formType: 'add', // addeditdetail
btnDisable: false,
unitId: '',
keyWords: '',
formData: {
unitName: '',
serviceMatterList: [],
type: '',
contact: '',
contactMobile: '',
memberCount: 0,
remark: '', //500
address: '', //
longitude: 36.0722275, //
latitude: 120.38945519 //
},
serviceList: [],//list
}
},
components: {},
mounted () {
this.initMap()
},
methods: {
async initForm (type, unitId) {
this.startLoading()
this.$refs.ref_form.resetFields();
//
await this.loadService()
this.formType = type
if (unitId) {
this.unitId = unitId
this.formData.id = unitId
await this.loadFormData()
} else {
map.setCenter(new TMap.LatLng(36.0722275, 120.38945519))
this.setMarker(36.0722275, 120.38945519)
}
this.endLoading()
},
//
async loadService () {
const url = "/heart/serviceitem/dict-list"
let params = {
type: 'usable'
// parentCategoryCode: '1010'
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.serviceList = data
} else {
this.$message.error(msg)
}
},
//
async loadFormData () {
const url = '/heart/icpartyunit/detail'
// const url = 'http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/detail'
let params = {
id: this.unitId
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
if (!data.serviceMatterList || !Array.isArray(data.serviceMatterList)) {
data.serviceMatterList = []
}
this.formData = { ...data }
map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude))
this.setMarker(this.formData.latitude, this.formData.longitude)
} else {
this.$message.error(msg)
}
},
async handleComfirm () {
this.btnDisable = true
setTimeout(() => {
this.btnDisable = false
}, 10000)
this.$refs['ref_form'].validate((valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj)
this.btnDisable = false
} else {
this.addUnit()
}
})
},
async addUnit () {
// const regPhone = /^1(3|4|5|6|7|8|9)\d{9}$/; //
// if (regPhone.test(this.formData.contactMobile) === false) {
// this.btnDisable = false
// this.$message({
// type: 'warning',
// message: ''
// })
// return false;
// }
let url = '/heart/icpartyunit/save'
// let url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/save"
// if (this.formType === 'edit') {
// this.formData.id = this.unitId
// }
const { data, code, msg } = await requestPost(url, this.formData)
if (code === 0) {
this.$message({
type: 'success',
message: '操作成功'
})
this.resetData()
this.$emit('dialogOk')
this.btnDisable = false
} else {
this.btnDisable = false
this.$message.error(msg)
}
},
handleCancle () {
this.resetData()
this.$emit('dialogCancle')
},
// init
initMap () {
//
var center = new window.TMap.LatLng(36.0722275, 120.38945519)
// map TMap.Map()
map = new window.TMap.Map(document.getElementById('app'), {
center: center, //
zoom: 17.2, //
pitch: 43.5, //
rotation: 45 //
})
search = new window.TMap.service.Search({ pageSize: 10 })
//
markers = new TMap.MultiMarker({
map: map,
geometries: []
})
infoWindowList = Array(10)
geocoder = new TMap.service.Geocoder(); //
//
map.on('panend', () => {
this.handleMoveCenter()
})
this.handleMoveCenter()
this.convert()
},
setMarker (lat, lng) {
markers.setGeometries([])
markers.add([
{
id: '4',
styleId: 'marker',
position: new TMap.LatLng(lat, lng),
properties: {
title: 'marker4'
}
}
])
},
handleSearchMap () {
infoWindowList.forEach((infoWindow) => {
infoWindow.close()
})
infoWindowList.length = 0
markers.setGeometries([])
//
search
.searchRectangle({
keyword: this.keyWords,
bounds: map.getBounds()
})
.then((result) => {
let { data } = result
if (Array.isArray(data) && data.length > 0) {
const {
location: { lat, lng }
} = data[0]
map.setCenter(new TMap.LatLng(lat, lng))
this.setMarker(lat, lng)
this.formData.latitude = lat
this.formData.longitude = lng
this.convert()
} else {
this.$message.error('未检索到相关位置坐标')
}
})
},
handleMoveCenter () {
//
const center = map.getCenter()
const lat = center.getLat()
const lng = center.getLng()
this.formData.latitude = lat
this.formData.longitude = lng
this.setMarker(lat, lng)
this.convert(lat, lng)
},
convert (lat, lng) {
markers.setGeometries([]);
// var input = document.getElementById('location').value.split(',');
let location
if (lat && lng) {
location = new TMap.LatLng(lat, lng);
} else {
location = new TMap.LatLng(this.formData.latitude, this.formData.longitude);
}
// map.setCenter(location);
markers.updateGeometries([
{
id: 'main', //
position: location,
},
]);
geocoder
.getAddress({ location: location }) //
.then((result) => {
this.formData.address = result.result.address
//
});
},
resetData () {
this.unitId = ''
this.keyWords = ''
this.formData = {
unitName: '',
serviceMatterList: [],
type: '',
contact: '',
contactMobile: '',
memberCount: 0,
remark: '', //500
address: '', //
longitude: '', //
latitude: '' //
}
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
dataRule () {
return {
unitName: [
{ required: true, message: '单位名称不能为空', trigger: 'blur' },
],
type: [
{ required: true, message: '分类不能为空', trigger: 'blur' }
],
contact: [
{ required: true, message: '联系人不能为空', trigger: 'blur' }
],
contactMobile: [
{ required: true, message: '联系电话不能为空', trigger: 'blur' }
],
memberCount: [
{ required: true, message: '在职党员数不能为空', trigger: 'blur' }
],
address: [
{ required: true, message: '详细地址不能为空', trigger: 'blur' }
],
longitude: [
{ required: true, message: '坐标不能为空', trigger: 'blur' }
]
}
},
},
props: {
typeList: {
type: Array,
default: []
},
}
}
</script>
<style scoped>
.div_map {
position: relative;
}
.div_searchmap {
z-index: 5000;
position: absolute;
top: 5px;
left: 5px;
}
</style>
<style lang="scss" scoped >
@import "@/assets/scss/modules/visual/communityManageForm.scss";
</style>

973
src/views/modules/visual/communityGovern/fivelayers/mapIndex.vue

@ -0,0 +1,973 @@
<template>
<div style="position: relative">
<!-- 组织路由 -->
<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.name}}<span class="arrow">></span></span>
<span class="router_child">{{orgData.name}}</span>
</div>
</div>
<div class="div_content">
<div class="div_map"
id="map"
ref="map">
</div>
<div class="div_data">
<div class="div_tips">
<div class="div_coverage">
<div class="coverage_item"
@click="handleClickCoverage(index)"
v-for="(item,index) in coverageTypes"
:key="index">
<img :src="item.select?selImg:noSelImg" />
<span>{{item.label}}</span>
</div>
</div>
<el-scrollbar style="height:98%">
<div class="div_category">
<div v-for="(item,index) in categoryListshow"
:key="index"
class="category_item">
<div class="list_item">
<div v-for="(colItem,colIndex) in item"
:key="colIndex"
class="list_item_col"
@click="handleTo(colItem)">
<img :src="colItem.dataIcon"
alt />
<div class="item_content">
<div class="item_label">{{colItem.categoryName}}</div>
</div>
</div>
</div>
<div :class="['item_line',{'last_line':index==(listDatashow.length-1)}]"></div>
</div>
</div>
</el-scrollbar>
</div>
<div class="div_info">
<el-scrollbar style="height:98%">
<div class="info_tip">
<img src="../../../../../assets/img/shuju/title-tip.png"
alt />
<div class="tip_title">分类列表</div>
</div>
<div class="info_loading"
v-if="infoLoading">
<screen-loading>加载中</screen-loading>
</div>
<div v-if="!infoLoading"
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"
@click="handleTo(colItem)">
<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>
</div>
</template>
<script>
import 'ol/ol.css'
import { Map, View } from 'ol'
import TileLayer from 'ol/layer/Tile.js';
import XYZ from 'ol/source/XYZ.js';
import VectorLayer from 'ol/layer/Vector.js';
import VectorSource from 'ol/source/Vector.js';
import GeoJSON from 'ol/format/GeoJSON.js';
import Point from "ol/geom/Point.js";
import Feature from "ol/Feature.js";
import Overlay from 'ol/Overlay';
import { defaults as defaultInteractions, Select, DoubleClickZoom } from 'ol/interaction.js';
import { getCenter, boundingExtent } from 'ol/extent.js';
import { Circle as CircleStyle, Icon, Fill, Stroke, Style, Text } from 'ol/style.js';
import nextTick from 'dai-js/tools/nextTick'
import { mapGetters } from "vuex";
import { Loading } from 'element-ui'; //Loading
import { requestPost } from "@/js/dai/request";
import cptCard from "@/views/modules/visual/cpts/card";
import ScreenLoading from "@/views/modules/visual/cpts/loading";
var centerPointGlobal = [120.664619, 36.504963]
let loading;//
let map;
let mapView;
let gaodeMapLayer;//
let parentLayer;//
let parentSource;//
let polygonLayer;//
let iconLayer; // icon
let iconSource; // icon
let polygonSource;//
let select;//
let xoffset = 0
let yoffset = 0
//url
let iconUrlArray = [
'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20211116/a219130b6bc74b0b80b5ddb0fce0892a.png',
'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20211116/a775d15e62374350b80e5cdf1912a4eb.png',
'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20211116/884efcf6d6b44224a7fda599dd1b14cb.png'
];
let textColorArray = [
'rgba(236, 69, 4, 0.66)',
'rgba(0, 146, 238, 0.75)',
'rgba(238, 151, 0, 0.8)'
];
let polygonColorArray = [
'rgba(210, 2, 2, 0.24)',
'rgba(43, 231, 253, 0.25)',
'rgba(183, 185, 0, 0.16)'
];
//
var createTextStyle = function (feature) {
return new Text({
textAlign: undefined,
font: "18px Arial",
//fontFamily: "Courier New, monospace",
// fontWeight: "bold",
text: feature.values_.name,
backgroundFill: new Fill({
// color: 'rgba(0, 146, 238, 0.75)'
color: textColorArray[feature.values_.colorIndex]
}),
padding: [4, 10, 4, 10],
//text: "",
fill: new Fill({ color: "#ffffff" }),
// stroke: new Stroke({ color: "#ffffff", width: 3 }),
offsetY: -30,
offsetX: -50,
overflow: true,
});
};
//
var parentStyleFunction = (function () {
return function (feature) {
return new Style({
// fill: new Fill({
// color: [255, 255, 255, 0.3]
// }),
stroke: new Stroke({
color: [0, 103, 182, 1],
width: 2
}),
// text: createTextStyle(feature)
});;
};
})()
//
var polygonStyleFunction = (function () {
return function (feature) {
return new Style({
fill: new Fill({
// color: [255, 255, 255, 0.3]
color: polygonColorArray[feature.values_.colorIndex]
}),
stroke: new Stroke({
color: polygonColorArray[feature.values_.colorIndex],
width: 3
}),
text: createTextStyle(feature)
});;
};
})()
const vueGis = {
name: 'HomeMap',
data () {
return {
centerPoint: [],//
zoom: 14,//14
minZoom: 1,//
orgData: {},//
orgId: '',
orgLevel: '',
subAgencyArray: [],//
iconCoordinators: [],
currentCoordinate: null,
overlay: null,
//
searchName: "",
//
infoLoading: true,
listData: [],//
listDatashow: [],//
//
runNum: 0,
runAgencyArray: [],
selUserId: '',
center: [],
zoom: null,
parentPolygon: [],
centerFlag: 'point',//flag point fit
coverageTypes: [//zhzlyjclaqsccsglggfw
{
select: true,
label: '综合治理图层',
value: 'zhzl'
},
{
select: true,
label: '应急处置图层',
value: 'yjcl'
},
{
select: true,
label: '安全生产图层',
value: 'aqsc'
},
{
select: true,
label: '城市管理图层',
value: 'csgl'
},
{
select: true,
label: '公共服务图层',
value: 'ggfw'
},
],
categoryList: [],//
categoryListshow: [],//
selImg: require('../../../../../assets/img/shuju/xuanzhong.png'),
noSelImg: require('../../../../../assets/img/shuju/weixuan.png'),
coverageTypes: ['zhzl', 'yjcl', 'aqsc', 'csgl', 'ggfw'],
categoryKeys: [],
search: '',
pageNo: 1,
pageSize: 10
}
},
async mounted () {
//
await this.loadOrgData()
//
this.initMap()
await nextTick(300)
this.addParentLayer()
this.loadParentPolygon()
//
this.addPolygonLayer()
//icontuceng
this.addIconLayer()
//
this.loadPolygon(this.subAgencyArray)
this.setMapLocation()
await this.loadList()
},
methods: {
//
handleClickCoverage (index) {
this.coverageTypes[index].select = !this.coverageTypes[index].select
let item = this.coverageTypes[index]
this.$set(this.coverageTypes, index, item)
this.coverageTypes = []
this.coverageTypes.forEach(element => {
if (element.select) {
this.coverageTypes.push(element.value)
}
});
},
//
handleClickCategory (index) {
},
//infolist
async loadList () {
this.infoLoading = true
// const url = "/data/aggregator/coverage/dataList"
const url = "http://yapi.elinkservice.cn/mock/245/data/aggregator/coverage/dataList"
let params = {
coverageTypes: this.coverageTypes,
categoryKeys: this.categoryKeys,
search: '',
pageNo: this.pageNo,
pageSize: this.pageSize
}
const { data, code, msg } = await requestPost(url, params)
this.infoLoading = false
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 loadCategoryList () {
// const url = "/data/aggregator/coverage/categoryList"
const url = "http://yapi.elinkservice.cn/mock/245/data/aggregator/coverage/categoryList"
let params = {
coverageTypes: this.coverageTypes,
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.categoryList = data
this.categoryListshow = []
let itemArray = []
this.listData.forEach((item, index) => {
if (!item.dataIcon) {
item.dataIcon = require('../../../../assets/img/shuju/volunteer3.png')
}
if (index % 4 === 0) {//
itemArray.push(item)
} else {
itemArray.push(item)
this.categoryListshow.push(itemArray)
itemArray = []
}
});
} else {
this.$message.error(msg)
}
},
//
async refreshMap (isRefreshView) {
//
await this.loadOrgData()
//
this.loadParentPolygon()
//
this.loadPolygon(this.subAgencyArray)
//
// if (isRefreshView) {
this.setMapLocation()
// }
await this.loadList()
},
//
setMapLocation () {
if (!this.zoom) {
this.setZoom(this.orgData.agencyLevel)
}
this.centerPoint = []
//
if (this.center && this.center.length > 0) {
this.centerPoint = this.center
this.centerFlag = 'point'
this.center = []
} else if (parentLayer.getSource().getFeatures()[0]) {//
this.centerFlag = 'flag_parent'
} else if (polygonLayer.getSource().getFeatures()[0]) {//,
this.centerFlag = 'flag_polygon'
} else if (this.orgData.longitude && this.orgData.latitude) {
this.centerPoint.push(this.orgData.longitude)
this.centerPoint.push(this.orgData.latitude)
this.centerFlag = 'point'
} else {
this.centerPoint = centerPointGlobal
this.centerFlag = 'point'
}
// debugger
if (this.centerFlag === 'flag_parent') {
let parentFeatures = parentLayer.getSource().getFeatures()[0]
let polygon = parentFeatures.getGeometry();
map.getView().fit(polygon, map.getSize());
this.zoom = map.getView().getZoom() - 1
} else if (this.centerFlag === 'flag_polygon') {
let polygonFeatures = polygonLayer.getSource().getFeatures()[0]
let polygon = polygonFeatures.getGeometry();
map.getView().fit(polygon, map.getSize());
this.zoom = map.getView().getZoom() - 1
} else {
mapView.setCenter(this.centerPoint);
}
mapView.setZoom(this.zoom);
},
//
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
this.center = this.orgData.center
this.zoom = this.orgData.zoom
this.$nextTick(() => {
this.refreshMap(true)
this.$forceUpdate()
});
},
//
async loadOrgData () {
const url = "/gov/org/agency/maporg"
let params = {
orgId: this.orgId,
level: this.orgLevel
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.orgData = data
this.orgId = this.orgData.id
this.orgLevel = this.orgData.level
this.parentPolygon = []
this.parentPolygon.push(data)
if (data.children && data.children.length > 0) {
this.subAgencyArray = data.children
} else {
this.subAgencyArray = []
}
} else {
this.$message.error(msg)
}
},
//
loadParentPolygon () {
parentSource.clear()//
let featureData = []//
if (this.parentPolygon && this.parentPolygon.length > 0) {//
let oneData = {}
this.parentPolygon.forEach(agencyItem => {
if (agencyItem.coordinates && agencyItem.coordinates !== '') {//
oneData = {
type: 'Feature',
id: agencyItem.id,
properties: {
id: agencyItem.id,
level: agencyItem.level,
name: agencyItem.name
},
geometry: {
type: 'Polygon',
coordinates: [],
},
}
let coorArray = agencyItem.coordinates.split(',')//
let itemArray = []//[lon,lat]
let polygonArray = []//[[lon,lat],[lon,lat],[lon,lat]]
coorArray.forEach((item, index) => {
if (index % 2 == 0) {//
item = (parseFloat(item) + parseFloat(xoffset)) + ''
itemArray.push(item)
} else {//
item = (parseFloat(item) + parseFloat(yoffset)) + ''
itemArray.push(item)
polygonArray.push(itemArray)
itemArray = []
}
});
oneData.geometry.coordinates.push(polygonArray)
featureData.push(oneData)
}
});
}
if (featureData && featureData.length > 0) {
var geojsonObject = {
'type': 'FeatureCollection',
'features': featureData
};
let feature = (new GeoJSON()).readFeatures(geojsonObject)
parentSource.addFeatures(feature)
}
},
//
loadPolygon (subAgencyArray) {
polygonSource.clear()//
iconSource.clear()//
let featureData = []//
if (subAgencyArray && subAgencyArray.length > 0) {//
let oneData = {}
let count = 0
for (let i = 0; i < subAgencyArray.length; i++) {
const agencyItem = subAgencyArray[i]
if (agencyItem.coordinates && agencyItem.coordinates !== '') {//
let urlNum = count % 3
count++
oneData = {
type: 'Feature',
id: agencyItem.id,
properties: {
id: agencyItem.id,
level: agencyItem.level,
name: agencyItem.name,
colorIndex: urlNum//
},
geometry: {
type: 'Polygon',
coordinates: [],
},
}
let coorArray = agencyItem.coordinates.split(',')//
let itemArray = []//[lon,lat]
let polygonArray = []//[[lon,lat],[lon,lat],[lon,lat]]
coorArray.forEach((item, index) => {
// itemArray.push(item)
if (index % 2 == 0) {//
item = (parseFloat(item) + parseFloat(xoffset)) + ''
itemArray.push(item)
} else {//
item = (parseFloat(item) + parseFloat(yoffset)) + ''
itemArray.push(item)
polygonArray.push(itemArray)
itemArray = []
}
});
oneData.geometry.coordinates.push(polygonArray)
featureData.push(oneData)
}
}
}
if (featureData && featureData.length > 0) {
var geojsonObject = {
'type': 'FeatureCollection',
'features': featureData
};
let feature = (new GeoJSON()).readFeatures(geojsonObject)
console.log(geojsonObject)
polygonSource.addFeatures(feature)
let iconFeatures = [];
feature.forEach(oneIcon => {
var extent = boundingExtent(oneIcon.getGeometry().getCoordinates()[0]); //[minx,miny,maxx,maxy]
// var center = getCenter(extent); //
//
let x = (parseFloat(extent[0]) + parseFloat(extent[2])) / 2
let y = (parseFloat(extent[1]) + parseFloat(extent[3])) / 2
let oneArray = [x, y]
this.iconCoordinators.push(oneArray)
// debugger
//icon
let oneCctv = new Feature({
geometry: new Point([x, y]),
id: oneIcon.id_,
properties: {
type: "icon",
id: oneIcon.id_
}
});
let iconStyle = new Style({
image: new Icon({
// anchor: [0.5, 0.5],
// imgSize: [32, 32],
scale: 0.5,
// src: "/img/largeScreen/icon_camra.png"
// src: "https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20211116/a219130b6bc74b0b80b5ddb0fce0892a.png"
src: iconUrlArray[oneIcon.values_.colorIndex]
})
});
oneCctv.setStyle(iconStyle);
iconFeatures.push(oneCctv);
});
iconSource.addFeatures(iconFeatures);
}
},
//
setZoom (agencyLevel) {
if (agencyLevel === 'district') {
this.zoom = 12
} else if (agencyLevel === 'street') {
this.zoom = 13
} else if (agencyLevel === 'community') {
this.zoom = 14
}
},
firstCenterMap () {
this.centerPoint = []
if (this.orgData.longitude && this.orgData.latitude) {
this.centerPoint.push(this.orgData.longitude)
this.centerPoint.push(this.orgData.latitude)
} else {
this.centerPoint = centerPointGlobal
}
if (!this.zoom) {
this.setZoom(this.orgData.agencyLevel)
}
},
initMap () {
this.firstCenterMap()
gaodeMapLayer = new TileLayer({
title: "地图",
source: new XYZ({
//url
url: 'http://wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=7&x={x}&y={y}&z={z}',
wrapX: true//xfalse
}),
zIndex: 20
});
mapView = new View({
//
center: this.centerPoint,
// projection: 'EPSG:3857',
projection: 'EPSG:4326',
zoom: this.zoom,
minZoom: this.minZoom
})
//map
//
map = new Map({
layers: [gaodeMapLayer],
//
view: mapView,
target: 'map'
//map
})
map.on('singleclick', function (e) {
// console.log(e.coordinate)
// console.log(transform(e.coordinate, 'EPSG:3857', 'EPSG:4326'));
})
//
const dblClickInteraction = map
.getInteractions()
.getArray()
.find(interaction => {
return interaction instanceof DoubleClickZoom;
});
map.removeInteraction(dblClickInteraction);
},
//
addParentLayer () {
parentSource = new VectorSource({
//features: (new GeoJSON()).readFeatures(geojsonObject)
});
parentLayer = new VectorLayer({
source: parentSource,
style: parentStyleFunction,
zIndex: 50
});
map.addLayer(parentLayer)
},
//
addPolygonLayer () {
polygonSource = new VectorSource({
//features: (new GeoJSON()).readFeatures(geojsonObject)
});
polygonLayer = new VectorLayer({
source: polygonSource,
style: polygonStyleFunction,
zIndex: 50
});
//
var overlayStyle = (function () {
return function (feature) {
var styles = {};
styles['Polygon'] = [
new Style({
stroke: new Stroke({
color: '#ec9000',
width: 2
})
}),
new Style({
fill: new Fill({
color: 'rgba(0, 0, 255, 0.1)'
})
}),
new Style({
text: createTextStyle(feature)
})
];
styles['MultiPolygon'] = styles['Polygon'];
return styles[feature.getGeometry().getType()];
};
})();
select = new Select({
style: overlayStyle
});
map.addLayer(polygonLayer)
map.addInteraction(select);
select.on('select', e => {
});
},
addIconLayer () {
iconSource = new VectorSource({
//features: (new GeoJSON()).readFeatures(geojsonObject)
});
iconLayer = new VectorLayer({
source: iconSource,
zIndex: 70
});
map.addLayer(iconLayer);
},
//
getRndBetween (lowerLimit, upperLimit) {
return Math.floor(Math.random() * (upperLimit - lowerLimit + 1)) + lowerLimit;
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
});
},
//
endLoading () {
//clearTimeout(timer);
if (loading) {
loading.close();
}
},
},
props: {
// vueFlag: {
// type: String,
// default: "alarm"
// }
},
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: { cptCard, ScreenLoading },
}
export default vueGis;
</script>
<style
lang="scss"
src="@/assets/scss/modules/visual/fiveLayerMap.scss"
scoped
></style>
<style lang="scss" >
.div_content {
.ol-viewport {
border-radius: 5px;
}
}
.ol-overlaycontainer-stopevent {
display: none;
}
</style>
<style lang="scss" scoped>
</style>
Loading…
Cancel
Save