Browse Source

Merge branch 'feature/dev_party_mange' into dev

feature
YUJT 4 years ago
parent
commit
ceba73c247
  1. 67
      src/assets/scss/buttonstyle copy.scss
  2. 12
      src/utils/validate.js
  3. 2
      src/views/main-shuju/main-content.vue
  4. 2
      src/views/main-shuju/main.vue
  5. 2
      src/views/main.vue
  6. 18
      src/views/modules/communityParty/regionalParty/unitsForm.vue
  7. 18
      src/views/modules/communityService/ninePlaces/places/placesForm.vue
  8. 203
      src/views/modules/communityService/sqzzz/cpts/edit.vue
  9. 32
      src/views/modules/partymember/icpartyorg-add-or-update.vue
  10. 6
      src/views/modules/shequzhili/event/cpts/event-detail.vue
  11. 1
      src/views/modules/visual/communityParty/community.vue
  12. 3
      src/views/modules/visual/communityParty/party.vue
  13. 123
      src/views/modules/workSys/mapConfig.vue

67
src/assets/scss/buttonstyle copy.scss

@ -1,67 +0,0 @@
//新增
.el-button--add {
color: #fff;
background-color: #22c1c3;
border-color: #22c1c3;
}
.el-button--add:hover {
color: #fff;
background-color: #05b1b4;
border-color: #05b1b4;
}
.el-button--add:focus {
color: #fff;
background-color: #22c1c3;
border-color: #22c1c3;
}
//删除导入
.el-button--delete {
color: #fff;
background-color: #fe6252;
border-color: #fe6252;
}
.el-button--delete:hover {
color: #fff;
background-color: #fe6252;
border-color: #fe6252;
}
.el-button--delete:focus {
color: #fff;
background-color: #fe6252;
border-color: #fe6252;
}
//重置导出
.el-button--reset {
color: #fff;
background-color: #feb349;
border-color: #feb349;
}
.el-button--reset:hover {
color: #fff;
background-color: #feb349;
border-color: #feb349;
}
.el-button--reset:focus {
color: #fff;
background-color: #feb349;
border-color: #feb349;
}
//查询确定
.el-button--search:hover {
color: #fff;
background-color: #3e8ef7;
border-color: #3e8ef7;
}
.el-button--search:focus {
color: #fff;
background-color: #3e8ef7;
border-color: #3e8ef7;
}
.el-button--search {
color: #fff;
background-color: #3e8ef7;
border-color: #3e8ef7;
}

12
src/utils/validate.js

@ -3,7 +3,9 @@
* @param {*} s * @param {*} s
*/ */
export function isEmail(s) { export function isEmail(s) {
return /^([a-zA-Z0-9._-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(s) return /^([a-zA-Z0-9._-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(
s
);
} }
/** /**
@ -11,7 +13,7 @@ export function isEmail (s) {
* @param {*} s * @param {*} s
*/ */
export function isMobile(s) { export function isMobile(s) {
return /^1[0-9]{10}$/.test(s) return /^1[0-9]{10}$/.test(s);
} }
/** /**
@ -19,7 +21,7 @@ export function isMobile (s) {
* @param {*} s * @param {*} s
*/ */
export function isPhone(s) { export function isPhone(s) {
return /^([0-9]{3,4}-)?[0-9]{7,8}$/.test(s) return /^([0-9]{3,4}-)?[0-9]{7,8}$/.test(s);
} }
/** /**
@ -27,7 +29,7 @@ export function isPhone (s) {
* @param {*} s * @param {*} s
*/ */
export function isURL(s) { export function isURL(s) {
return /^http[s]?:\/\/.*/.test(s) return /^http[s]?:\/\/.*/.test(s) || /^\/\/.*/.test(s);
} }
/** /**
@ -35,5 +37,5 @@ export function isURL (s) {
* @param {*} s * @param {*} s
*/ */
export function isCard(s) { export function isCard(s) {
return /^(\d{15}$)|(^\d{17}([0-9]|X)$)/.test(s) return /^(\d{15}$)|(^\d{17}([0-9]|X)$)/.test(s);
} }

2
src/views/main-shuju/main-content.vue

@ -60,6 +60,8 @@ export default {
// localStorage.getItem("token") + // localStorage.getItem("token") +
// "&customerId=" + // "&customerId=" +
// localStorage.getItem("customerId"); // localStorage.getItem("customerId");
// return /^http[s]?:\/\/.*/.test(url);
return isURL(url); return isURL(url);
}, },
// tabs, tab // tabs, tab

2
src/views/main-shuju/main.vue

@ -123,7 +123,7 @@ export default {
localStorage.setItem("customerName", data.customerName || ""); localStorage.setItem("customerName", data.customerName || "");
} }
} else { } else {
this.$message.error(rspMsg); this.$message.error(msg);
} }
}, },
}, },

2
src/views/main.vue

@ -159,7 +159,7 @@ export default {
localStorage.setItem("customerName", data.customerName || ""); localStorage.setItem("customerName", data.customerName || "");
} }
} else { } else {
this.$message.error(rspMsg); this.$message.error(msg);
} }
}, },
}, },

18
src/views/modules/communityParty/regionalParty/unitsForm.vue

@ -287,15 +287,15 @@ export default {
}, },
async addUnit () { async addUnit () {
const regPhone = /^1(3|4|5|6|7|8|9)\d{9}$/; // // const regPhone = /^1(3|4|5|6|7|8|9)\d{9}$/; //
if (regPhone.test(this.formData.contactMobile) === false) { // if (regPhone.test(this.formData.contactMobile) === false) {
this.btnDisable = false // this.btnDisable = false
this.$message({ // this.$message({
type: 'warning', // type: 'warning',
message: '请输入正确的手机号码' // message: ''
}) // })
return false; // return false;
} // }
let url = '/heart/icpartyunit/save' let url = '/heart/icpartyunit/save'
// let url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/save" // let url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/save"

18
src/views/modules/communityService/ninePlaces/places/placesForm.vue

@ -197,15 +197,15 @@ export default {
}, },
async addPlace () { async addPlace () {
const regPhone = /^1(3|4|5|6|7|8|9)\d{9}$/; // // const regPhone = /^1(3|4|5|6|7|8|9)\d{9}$/; //
if (regPhone.test(this.formData.mobile) === false) { // if (regPhone.test(this.formData.mobile) === false) {
this.btnDisable = false // this.btnDisable = false
this.$message({ // this.$message({
type: 'warning', // type: 'warning',
message: '请输入正确的手机号码' // message: ''
}) // })
return false; // return false;
} // }
let url = '' let url = ''

203
src/views/modules/communityService/sqzzz/cpts/edit.vue

@ -1,243 +1,185 @@
<template> <template>
<div> <div>
<div class="dialog-h-content scroll-h"> <div class="dialog-h-content scroll-h">
<el-form <el-form ref="ref_form"
ref="ref_form"
:inline="true" :inline="true"
:model="dataForm" :model="dataForm"
:rules="dataRule" :rules="dataRule"
:disabled="formType === 'detail'" :disabled="formType === 'detail'"
class="form" class="form">
> <el-form-item label="组织名称 "
<el-form-item
label="组织名称 "
prop="organizationName" prop="organizationName"
label-width="150px" label-width="150px"
style="display: block" style="display: block">
> <el-input class="item_width_1"
<el-input
class="item_width_1"
maxlength="50" maxlength="50"
show-word-limit show-word-limit
placeholder="请输入组织名称 " placeholder="请输入组织名称 "
v-model="dataForm.organizationName" v-model="dataForm.organizationName">
>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="分类名称 "
label="分类名称 "
prop="categoryCode" prop="categoryCode"
label-width="150px" label-width="150px"
style="display: block" style="display: block">
> <el-select v-model="dataForm.categoryCode"
<el-select
v-model="dataForm.categoryCode"
placeholder="请选择" placeholder="请选择"
clearable clearable>
> <el-option v-for="item in categoryList"
<el-option
v-for="item in categoryList"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value">
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="组织人数 "
label="组织人数 "
prop="organizationPersonCount" prop="organizationPersonCount"
label-width="150px" label-width="150px"
style="display: block" style="display: block">
> <el-input class="item_width_1"
<el-input
class="item_width_1"
type="number" type="number"
maxlength="50" maxlength="50"
show-word-limit show-word-limit
placeholder="请输入组织人数 " placeholder="请输入组织人数 "
v-model="dataForm.organizationPersonCount" v-model="dataForm.organizationPersonCount">
>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="组织成员 "
label="组织成员 "
prop="organizationPersonnel" prop="organizationPersonnel"
label-width="150px" label-width="150px"
style="display: block" style="display: block">
>
<div class="m-staffs"> <div class="m-staffs">
<div <div class="item"
class="item"
:key="'staff' + index" :key="'staff' + index"
v-for="(item, index) in dataForm.organizationPersonnel" v-for="(item, index) in dataForm.organizationPersonnel">
> <el-input class="item_width_1"
<el-input
class="item_width_1"
maxlength="50" maxlength="50"
show-word-limit show-word-limit
placeholder="成员姓名" placeholder="成员姓名"
v-model="item.personName" v-model="item.personName" />
/>
<el-input <el-input style="margin-left: 10px"
style="margin-left: 10px"
class="item_width_1" class="item_width_1"
maxlength="50" maxlength="50"
show-word-limit show-word-limit
placeholder="联系电话" placeholder="联系电话"
v-model="item.personPhone" v-model="item.personPhone" />
/>
<el-button <el-button style="margin-left: 10px"
style="margin-left: 10px"
size="small" size="small"
@click="handleDelStaff(index)" @click="handleDelStaff(index)">删除</el-button>
>删除</el-button
>
</div> </div>
<div class="item-add"> <div class="item-add">
<el-button size="small" @click="handleAddStaff">添加</el-button> <el-button size="small"
@click="handleAddStaff">添加</el-button>
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="服务事项"
label="服务事项"
prop="serviceItem" prop="serviceItem"
label-width="150px" label-width="150px"
style="display: block" style="display: block">
> <el-input class="item_width_1"
<el-input
class="item_width_1"
type="textarea" type="textarea"
maxlength="1000" maxlength="1000"
show-word-limit show-word-limit
:rows="3" :rows="3"
placeholder="请输入服务事项,不超过1000字" placeholder="请输入服务事项,不超过1000字"
v-model="dataForm.serviceItem" v-model="dataForm.serviceItem"></el-input>
></el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="负责人 "
label="负责人 "
prop="principalName" prop="principalName"
label-width="150px" label-width="150px"
style="display: block" style="display: block">
> <el-input class="item_width_1"
<el-input
class="item_width_1"
maxlength="50" maxlength="50"
show-word-limit show-word-limit
placeholder="请输入负责人 " placeholder="请输入负责人 "
v-model="dataForm.principalName" v-model="dataForm.principalName">
>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="联系电话 "
label="联系电话 "
prop="principalPhone" prop="principalPhone"
label-width="150px" label-width="150px"
style="display: block" style="display: block">
> <el-input class="item_width_1"
<el-input
class="item_width_1"
maxlength="50" maxlength="50"
show-word-limit show-word-limit
placeholder="请输入联系电话 " placeholder="请输入联系电话 "
v-model="dataForm.principalPhone" v-model="dataForm.principalPhone">
>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="创建时间"
label="创建时间"
prop="organizationCreatedTime" prop="organizationCreatedTime"
label-width="150px" label-width="150px"
style="display: block" style="display: block">
> <el-date-picker v-model="dataForm.organizationCreatedTime"
<el-date-picker
v-model="dataForm.organizationCreatedTime"
placeholder="创建时间" placeholder="创建时间"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd">
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="位置坐标"
label="位置坐标"
prop="longitude" prop="longitude"
label-width="150px" label-width="150px"
style="display: block" style="display: block">
>
<div style="width: 500px"> <div style="width: 500px">
<el-input <el-input class="item_width_4"
class="item_width_4"
maxlength="50" maxlength="50"
placeholder="请输入关键字" placeholder="请输入关键字"
v-model="dataForm.address" v-model="dataForm.address">
>
</el-input> </el-input>
<el-button <el-button style="margin-left: 10px"
style="margin-left: 10px"
type="primary" type="primary"
size="small" size="small"
@click="handleSearchMap" @click="handleSearchMap">查询</el-button>
>查询</el-button <div id="app"
> class="div_map"></div>
<div id="app" class="div_map"></div>
<div style="margin-top: 10px"> <div style="margin-top: 10px">
<span>经度</span> <span>经度</span>
<el-input <el-input class="item_width_3"
class="item_width_3"
maxlength="50" maxlength="50"
placeholder="请输入经度" placeholder="请输入经度"
v-model="dataForm.longitude" v-model="dataForm.longitude">
>
</el-input> </el-input>
<span style="margin-left: 20px">纬度</span> <span style="margin-left: 20px">纬度</span>
<el-input <el-input class="item_width_3"
class="item_width_3"
maxlength="50" maxlength="50"
placeholder="请输入纬度" placeholder="请输入纬度"
v-model="dataForm.latitude" v-model="dataForm.latitude">
>
</el-input> </el-input>
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="备注"
label="备注"
prop="remark" prop="remark"
label-width="150px" label-width="150px"
style="display: block" style="display: block">
> <el-input class="item_width_1"
<el-input
class="item_width_1"
type="textarea" type="textarea"
maxlength="500" maxlength="500"
show-word-limit show-word-limit
:rows="3" :rows="3"
placeholder="请输入备注,不超过500字" placeholder="请输入备注,不超过500字"
v-model="dataForm.remark" v-model="dataForm.remark"></el-input>
></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div class="div_btn resi-btns"> <div class="div_btn resi-btns">
<el-button size="small" @click="handleCancle"> </el-button> <el-button size="small"
<el-button @click="handleCancle"> </el-button>
v-if="formType != 'detail'" <el-button v-if="formType != 'detail'"
type="primary" type="primary"
size="small" size="small"
:disabled="btnDisable" :disabled="btnDisable"
@click="handleComfirm" @click="handleComfirm"> </el-button>
> </el-button
>
</div> </div>
</div> </div>
</template> </template>
@ -448,26 +390,25 @@ export default {
app.util.validateRule(messageObj); app.util.validateRule(messageObj);
this.btnDisable = false; this.btnDisable = false;
} else { } else {
if (!formVltHelper.userOrMobile(this.dataForm.principalPhone)) { // if (!formVltHelper.userOrMobile(this.dataForm.principalPhone)) {
return this.$message({ // return this.$message({
type: "error", // type: "error",
message: "手机号格式有误", // message: "",
}); // });
} // }
const { const {
dataForm: { organizationPersonnel }, dataForm: { organizationPersonnel },
} = this; } = this;
let vlt = organizationPersonnel.every((item) => { let vlt = organizationPersonnel.every((item) => {
return ( return (
item.personName && item.personName &&
item.personPhone && item.personPhone
formVltHelper.userOrMobile(item.personPhone)
); );
}); });
if (!vlt) { if (!vlt) {
return this.$message({ return this.$message({
type: "error", type: "error",
message: "成员姓名/手机号为空或格式有误", message: "成员姓名/手机号为空",
}); });
} }
this.submit(); this.submit();

32
src/views/modules/partymember/icpartyorg-add-or-update.vue

@ -145,12 +145,6 @@
agencyOrgList:[] agencyOrgList:[]
} }
}, },
// mounted () {
// setTimeout(() => {
// console.log(':::::::::::::::::::::::')
// this.initMap()
// }, 800);
// },
methods: { methods: {
init() { init() {
this.visible = true this.visible = true
@ -159,10 +153,10 @@
this.dataForm.staffId = localStorage.getItem('staffId') this.dataForm.staffId = localStorage.getItem('staffId')
this.keyWords = '' this.keyWords = ''
// //
setTimeout(() => {
this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
this.dataForm.latitude = '' this.dataForm.latitude = ''
this.dataForm.agencyId = ''
if (this.dataForm.id) { if (this.dataForm.id) {
this.setPartyOrgType() this.setPartyOrgType()
this.getInfo() this.getInfo()
@ -174,14 +168,17 @@
this.dataForm.orgPid = this.dataForm.orgId this.dataForm.orgPid = this.dataForm.orgId
this.dataForm.orgPids = this.dataForm.orgPids ? this.dataForm.orgPids + ':' + this.dataForm.orgId : this.dataForm.orgId this.dataForm.orgPids = this.dataForm.orgPids ? this.dataForm.orgPids + ':' + this.dataForm.orgId : this.dataForm.orgId
this.dataForm.partyOrgType = this.dataForm._partyOrgType this.dataForm.partyOrgType = this.dataForm._partyOrgType
console.log(this.dataForm.partyOrgType, this.dataForm.orgPid, this.dataForm.orgPids)
this.setPartyOrgType_xzxj() this.setPartyOrgType_xzxj()
this.getInfoAgencyLisy() this.getInfoAgencyLisy()
} else { } else {
this.dataForm.mySelectOrg = '' this.dataForm.mySelectOrg = ''
} }
} }
}) }, 50);
// this.$nextTick(() => {
// })
}, },
// //
setPartyOrgType_xzxj() { setPartyOrgType_xzxj() {
@ -250,9 +247,22 @@
if(value == '5'){ // if(value == '5'){ //
this.dataForm.agencyId = localStorage.getItem('agencyId') this.dataForm.agencyId = localStorage.getItem('agencyId')
this.dataForm.agencyPids = '' this.dataForm.agencyPids = ''
//
this.orgList = []
this.dataForm.mySelectOrg = '', //
this.dataForm.orgPid = '', // ID,0
this.dataForm.orgPids = ''
this.getOrgList() this.getOrgList()
} else { } else {
// //
this.agencyOrgList = []
this.dataForm.agencyId = ''
//
this.orgList = []
this.dataForm.mySelectOrg = '', //
this.dataForm.orgPid = '', // ID,0
this.dataForm.orgPids = ''
this.getInfoAgencyLisy() this.getInfoAgencyLisy()
} }
}, },

6
src/views/modules/shequzhili/event/cpts/event-detail.vue

@ -78,8 +78,12 @@
</div> </div>
</div> </div>
<!--
显示关闭
1状态=完成 (已评价)||(没评价&&不是本人)
<div v-if="info.operationId&&!(info.status==='closed_case'&&!info.satisfactionName && user.id===info.createdUserId)" 2状态=未完成 有操作id -->
<div v-if="(info.status==='processing'&&info.operationId)||(info.status==='closed_case'&&(info.satisfactionName||(!info.satisfactionName && user.id!=info.createdUserId)))"
class="div-btn "> class="div-btn ">
<el-button size="small" <el-button size="small"
@click="handleCloseEvent">关闭</el-button> @click="handleCloseEvent">关闭</el-button>

1
src/views/modules/visual/communityParty/community.vue

@ -530,6 +530,7 @@ export default {
this.unitTableData = data.list.map((item, index) => { this.unitTableData = data.list.map((item, index) => {
return { return {
...item, ...item,
index: index + 1,
urlIndex: index urlIndex: index
} }
}) })

3
src/views/modules/visual/communityParty/party.vue

@ -317,6 +317,7 @@ export default {
// return // return
// } // }
if (params.seriesIndex == 0 || params.seriesIndex == 2) { if (params.seriesIndex == 0 || params.seriesIndex == 2) {
console.log('请求了吗')
this.ageCode = '' this.ageCode = ''
// this.getUnitList(this.agencyId) // this.getUnitList(this.agencyId)
this.getAgeList() this.getAgeList()
@ -378,7 +379,7 @@ export default {
// this.getEduList() // this.getEduList()
// return // return
// } // }
this.clickEduPie(params.dataIndex) // this.clickEduPie(params.dataIndex)
if (params.seriesIndex == 0 || params.seriesIndex == 2) { if (params.seriesIndex == 0 || params.seriesIndex == 2) {
this.eduCode = '' this.eduCode = ''
this.getEduList() this.getEduList()

123
src/views/modules/workSys/mapConfig.vue

@ -49,8 +49,8 @@
resize="none" resize="none"
size="small" size="small"
style="width:200px" style="width:200px"
:precision="6" :precision="5"
:step="0.00001" :step="0.0001"
placeholder='请输入经度偏差' placeholder='请输入经度偏差'
v-model="xOffset"> v-model="xOffset">
</el-input-number> </el-input-number>
@ -58,8 +58,8 @@
<el-input-number v-if="showBtn&&hasPolygon" <el-input-number v-if="showBtn&&hasPolygon"
resize="none" resize="none"
size="small" size="small"
:precision="6" :precision="5"
:step="0.00001" :step="0.0001"
style="width:200px" style="width:200px"
placeholder='请输入维度偏差' placeholder='请输入维度偏差'
v-model="yOffset"> v-model="yOffset">
@ -100,14 +100,48 @@
width="50%" width="50%"
:before-close="handleClose"> :before-close="handleClose">
<div class="div_textarea"> <div class="div_textarea">
<div style="margin-top:10px">
<span> 中心点经度</span>
<el-input-number size="small"
style="width:250px"
v-model="longitude">
</el-input-number>
<span style="margin-left:15px"> 中心点纬度</span>
<el-input-number size="small"
style="width:250px"
v-model="latitude">
</el-input-number>
</div>
<div style="margin-top:20px">
<el-input type="textarea" <el-input type="textarea"
:autosize="{ minRows: 20, maxRows: 50}" :rows="15"
:rows="20" style="width:600px;max-height:500px"
style="width:600px;height:500px"
placeholder='请复制坐标数据' placeholder='请复制坐标数据'
v-model="polygonManullyString"> v-model="polygonManullyString">
</el-input> </el-input>
</div> </div>
<div style="margin-top:20px">
<span> 经度偏差</span>
<el-input-number resize="none"
size="small"
style="width:200px"
:precision="5"
:step="0.0001"
placeholder='请输入经度偏差'
v-model="xOffset_customize">
</el-input-number>
<span style="margin-left:15px"> 纬度偏差</span>
<el-input-number resize="none"
size="small"
:precision="5"
:step="0.0001"
style="width:200px"
placeholder='请输入维度偏差'
v-model="yOffset_customize">
</el-input-number>
</div>
</div>
<span slot="footer" <span slot="footer"
class="dialog-footer"> class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button> <el-button @click="dialogVisible = false"> </el-button>
@ -248,10 +282,16 @@ const vueGis = {
showOffset: false, showOffset: false,
// polygonManullyString: "POLYGON (( 120.33902844 36.10290786, 120.33928218 36.10292997, 120.33956336 36.10316381, 120.34016675 36.10367715, 120.34044913 36.10391476, 120.34045707 36.10392145, 120.34068696 36.10411489, 120.34103181 36.10436285, 120.34117309 36.10441824, 120.34134613 36.10447927, 120.34164715 36.10465122, 120.34124679 36.10507284, 120.34088128 36.10538902, 120.34076198 36.10549222, 120.34053890 36.10520966, 120.34044967 36.10507284, 120.34030632 36.10494761, 120.34019091 36.10484679, 120.33976558 36.10448095, 120.33966658 36.10439980, 120.33947147 36.10425822, 120.33932037 36.10417613, 120.33913002 36.10411307, 120.33895751 36.10406073, 120.33879451 36.10403693, 120.33864104 36.10403158, 120.33864031 36.10395235, 120.33863211 36.10305897, 120.33902175 36.10290728, 120.33902844 36.10290786))", // polygonManullyString: "POLYGON (( 120.33902844 36.10290786, 120.33928218 36.10292997, 120.33956336 36.10316381, 120.34016675 36.10367715, 120.34044913 36.10391476, 120.34045707 36.10392145, 120.34068696 36.10411489, 120.34103181 36.10436285, 120.34117309 36.10441824, 120.34134613 36.10447927, 120.34164715 36.10465122, 120.34124679 36.10507284, 120.34088128 36.10538902, 120.34076198 36.10549222, 120.34053890 36.10520966, 120.34044967 36.10507284, 120.34030632 36.10494761, 120.34019091 36.10484679, 120.33976558 36.10448095, 120.33966658 36.10439980, 120.33947147 36.10425822, 120.33932037 36.10417613, 120.33913002 36.10411307, 120.33895751 36.10406073, 120.33879451 36.10403693, 120.33864104 36.10403158, 120.33864031 36.10395235, 120.33863211 36.10305897, 120.33902175 36.10290728, 120.33902844 36.10290786))",
polygonManullyString: "", polygonManullyString: "",
polygonStringResult: '',
xOffset: 0, xOffset: 0,
yOffset: 0, yOffset: 0,
xOffset_customize: 0,
yOffset_customize: 0,
// xOffset_customize: 0.0051,//
// yOffset_customize: 0.0002,//
longitude: undefined,
latitude: undefined,
} }
}, },
async mounted () { async mounted () {
@ -717,6 +757,17 @@ const vueGis = {
// //
handleManually () { handleManually () {
this.dialogVisible = true this.dialogVisible = true
this.polygonManullyString = ''
this.longitude = undefined
this.latitude = undefined
if (this.selAgency) {
if (this.selAgency.longitude) {
this.longitude = this.selAgency.longitude
}
if (this.selAgency.latitude) {
this.latitude = this.selAgency.latitude
}
}
}, },
// //
@ -725,6 +776,17 @@ const vueGis = {
}, },
handleManuallyOk () { handleManuallyOk () {
if (this.longitude || this.latitude) {
if (!(this.longitude && this.latitude)) {
this.$message({
type: "warning",
message: "请同时填写中心点经纬度,或不填写"
});
return false
}
}
// //
//120.54033616308595,36.53603370922851,120.69620469335939,36.5408402277832,120.63166001562502,36.46771248120117,120.52728989843752,36.458786089599606,120.54033616308595,36.53603370922851 //120.54033616308595,36.53603370922851,120.69620469335939,36.5408402277832,120.63166001562502,36.46771248120117,120.52728989843752,36.458786089599606,120.54033616308595,36.53603370922851
// //
@ -732,20 +794,29 @@ const vueGis = {
// 3°51N53°33N // 3°51N53°33N
const arrayString = this.polygonManullyString const arrayString = this.polygonManullyString
let array = arrayString.split(/[, ]/) let array = arrayString.split(/[, ()]/)
console.log(array) console.log(array)
this.polygonStringResult = '' let polygonStringResult = ''
array.forEach(element => { array.forEach(element => {
let num = Number(element) let num = Number(element)
if (num) { if (num) {
this.polygonStringResult = this.polygonStringResult + element + ',' polygonStringResult = polygonStringResult + element + ','
} }
}); });
this.polygonStringResult = this.polygonStringResult.substring(0, this.polygonStringResult.length - 1) polygonStringResult = polygonStringResult.substring(0, polygonStringResult.length - 1)
if (this.xOffset_customize !== 0 || this.yOffset_customize !== 0) {
this.saveOffset(this.xOffset_customize, this.yOffset_customize, polygonStringResult)
} else {
this.addPolygon(polygonStringResult)
}
this.addPolygon(this.polygonStringResult)
}, },
handleSetOffset () { handleSetOffset () {
@ -753,7 +824,7 @@ const vueGis = {
}, },
handleOffsetOk () { handleOffsetOk () {
let selPolygonString = "" let selPolygonString = ""
let offsetPolygonString = ''//
this.subAgencyArray.forEach(element => { this.subAgencyArray.forEach(element => {
if (element.id === this.selAgencyId && element.coordinates && element.coordinates.length > 0) { if (element.id === this.selAgencyId && element.coordinates && element.coordinates.length > 0) {
selPolygonString = element.coordinates selPolygonString = element.coordinates
@ -761,15 +832,21 @@ const vueGis = {
}); });
if (selPolygonString) { if (selPolygonString) {
this.saveOffset(tyhis.xOffset, this.yOffset, selPolygonString)
}
},
saveOffset (xOffset, yOffset, selPolygonString) {
let offsetPolygonString = ''//
let tempArray = selPolygonString.split(',') let tempArray = selPolygonString.split(',')
tempArray.forEach((element, index) => { tempArray.forEach((element, index) => {
let aaa = 0 let aaa = 0
if (index % 2 === 0) {// if (index % 2 === 0) {//
aaa = parseFloat(element) + parseFloat(this.xOffset) aaa = parseFloat(element) + parseFloat(xOffset)
} else { } else {
aaa = parseFloat(element) + parseFloat(this.yOffset) aaa = parseFloat(element) + parseFloat(yOffset)
} }
if (index % 2 !== 0) {// if (index % 2 !== 0) {//
@ -780,16 +857,7 @@ const vueGis = {
}); });
offsetPolygonString = offsetPolygonString.substring(0, offsetPolygonString.length - 1) offsetPolygonString = offsetPolygonString.substring(0, offsetPolygonString.length - 1)
}
console.log('selPolygonString', selPolygonString)
console.log('offsetPolygonString', offsetPolygonString)
this.addPolygon(offsetPolygonString) this.addPolygon(offsetPolygonString)
}, },
handleSetOffset () { handleSetOffset () {
this.handleOffsetCancel = false this.handleOffsetCancel = false
@ -924,7 +992,9 @@ const vueGis = {
let params = { let params = {
orgId: this.selAgency.id, orgId: this.selAgency.id,
level: this.selAgency.level, level: this.selAgency.level,
coordinates: coorString coordinates: coorString,
longitude: this.longitude,
latitude: this.latitude
} }
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)
@ -935,6 +1005,7 @@ const vueGis = {
message: "绘制成功" message: "绘制成功"
}); });
if (this.dialogVisible) { if (this.dialogVisible) {
this.polygonManullyString = ''
this.dialogVisible = false this.dialogVisible = false
} }
this.refreshMap(false) this.refreshMap(false)

Loading…
Cancel
Save