Browse Source

Merge branch 'feature/dev_party_mange' into dev

feature
YUJT 3 years ago
parent
commit
ceba73c247
  1. 67
      src/assets/scss/buttonstyle copy.scss
  2. 22
      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. 385
      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. 151
      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;
}

22
src/utils/validate.js

@ -2,38 +2,40 @@
* 邮箱
* @param {*} s
*/
export function isEmail (s) {
return /^([a-zA-Z0-9._-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(s)
export function isEmail(s) {
return /^([a-zA-Z0-9._-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(
s
);
}
/**
* 手机号码
* @param {*} s
*/
export function isMobile (s) {
return /^1[0-9]{10}$/.test(s)
export function isMobile(s) {
return /^1[0-9]{10}$/.test(s);
}
/**
* 电话号码
* @param {*} s
*/
export function isPhone (s) {
return /^([0-9]{3,4}-)?[0-9]{7,8}$/.test(s)
export function isPhone(s) {
return /^([0-9]{3,4}-)?[0-9]{7,8}$/.test(s);
}
/**
* URL地址
* @param {*} s
*/
export function isURL (s) {
return /^http[s]?:\/\/.*/.test(s)
export function isURL(s) {
return /^http[s]?:\/\/.*/.test(s) || /^\/\/.*/.test(s);
}
/**
* 身份证
* @param {*} s
*/
export function isCard (s) {
return /^(\d{15}$)|(^\d{17}([0-9]|X)$)/.test(s)
export function isCard(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") +
// "&customerId=" +
// localStorage.getItem("customerId");
// return /^http[s]?:\/\/.*/.test(url);
return isURL(url);
},
// tabs, tab

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

@ -123,7 +123,7 @@ export default {
localStorage.setItem("customerName", data.customerName || "");
}
} 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 || "");
}
} 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 () {
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;
}
// 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"

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

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

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

@ -1,243 +1,185 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<el-form
ref="ref_form"
:inline="true"
:model="dataForm"
:rules="dataRule"
:disabled="formType === 'detail'"
class="form"
>
<el-form-item
label="组织名称 "
prop="organizationName"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入组织名称 "
v-model="dataForm.organizationName"
>
<el-form ref="ref_form"
:inline="true"
:model="dataForm"
:rules="dataRule"
:disabled="formType === 'detail'"
class="form">
<el-form-item label="组织名称 "
prop="organizationName"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入组织名称 "
v-model="dataForm.organizationName">
</el-input>
</el-form-item>
<el-form-item
label="分类名称 "
prop="categoryCode"
label-width="150px"
style="display: block"
>
<el-select
v-model="dataForm.categoryCode"
placeholder="请选择"
clearable
>
<el-option
v-for="item in categoryList"
:key="item.value"
:label="item.label"
:value="item.value"
>
<el-form-item label="分类名称 "
prop="categoryCode"
label-width="150px"
style="display: block">
<el-select v-model="dataForm.categoryCode"
placeholder="请选择"
clearable>
<el-option v-for="item in categoryList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item
label="组织人数 "
prop="organizationPersonCount"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
type="number"
maxlength="50"
show-word-limit
placeholder="请输入组织人数 "
v-model="dataForm.organizationPersonCount"
>
<el-form-item label="组织人数 "
prop="organizationPersonCount"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
type="number"
maxlength="50"
show-word-limit
placeholder="请输入组织人数 "
v-model="dataForm.organizationPersonCount">
</el-input>
</el-form-item>
<el-form-item
label="组织成员 "
prop="organizationPersonnel"
label-width="150px"
style="display: block"
>
<el-form-item label="组织成员 "
prop="organizationPersonnel"
label-width="150px"
style="display: block">
<div class="m-staffs">
<div
class="item"
:key="'staff' + index"
v-for="(item, index) in dataForm.organizationPersonnel"
>
<el-input
class="item_width_1"
maxlength="50"
show-word-limit
placeholder="成员姓名"
v-model="item.personName"
/>
<el-input
style="margin-left: 10px"
class="item_width_1"
maxlength="50"
show-word-limit
placeholder="联系电话"
v-model="item.personPhone"
/>
<el-button
style="margin-left: 10px"
size="small"
@click="handleDelStaff(index)"
>删除</el-button
>
<div class="item"
:key="'staff' + index"
v-for="(item, index) in dataForm.organizationPersonnel">
<el-input class="item_width_1"
maxlength="50"
show-word-limit
placeholder="成员姓名"
v-model="item.personName" />
<el-input style="margin-left: 10px"
class="item_width_1"
maxlength="50"
show-word-limit
placeholder="联系电话"
v-model="item.personPhone" />
<el-button style="margin-left: 10px"
size="small"
@click="handleDelStaff(index)">删除</el-button>
</div>
<div class="item-add">
<el-button size="small" @click="handleAddStaff">添加</el-button>
<el-button size="small"
@click="handleAddStaff">添加</el-button>
</div>
</div>
</el-form-item>
<el-form-item
label="服务事项"
prop="serviceItem"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
type="textarea"
maxlength="1000"
show-word-limit
:rows="3"
placeholder="请输入服务事项,不超过1000字"
v-model="dataForm.serviceItem"
></el-input>
<el-form-item label="服务事项"
prop="serviceItem"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
type="textarea"
maxlength="1000"
show-word-limit
:rows="3"
placeholder="请输入服务事项,不超过1000字"
v-model="dataForm.serviceItem"></el-input>
</el-form-item>
<el-form-item
label="负责人 "
prop="principalName"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入负责人 "
v-model="dataForm.principalName"
>
<el-form-item label="负责人 "
prop="principalName"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入负责人 "
v-model="dataForm.principalName">
</el-input>
</el-form-item>
<el-form-item
label="联系电话 "
prop="principalPhone"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入联系电话 "
v-model="dataForm.principalPhone"
>
<el-form-item label="联系电话 "
prop="principalPhone"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入联系电话 "
v-model="dataForm.principalPhone">
</el-input>
</el-form-item>
<el-form-item
label="创建时间"
prop="organizationCreatedTime"
label-width="150px"
style="display: block"
>
<el-date-picker
v-model="dataForm.organizationCreatedTime"
placeholder="创建时间"
value-format="yyyy-MM-dd"
>
<el-form-item label="创建时间"
prop="organizationCreatedTime"
label-width="150px"
style="display: block">
<el-date-picker v-model="dataForm.organizationCreatedTime"
placeholder="创建时间"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
<el-form-item
label="位置坐标"
prop="longitude"
label-width="150px"
style="display: block"
>
<el-form-item label="位置坐标"
prop="longitude"
label-width="150px"
style="display: block">
<div style="width: 500px">
<el-input
class="item_width_4"
maxlength="50"
placeholder="请输入关键字"
v-model="dataForm.address"
>
<el-input class="item_width_4"
maxlength="50"
placeholder="请输入关键字"
v-model="dataForm.address">
</el-input>
<el-button
style="margin-left: 10px"
type="primary"
size="small"
@click="handleSearchMap"
>查询</el-button
>
<div id="app" class="div_map"></div>
<el-button style="margin-left: 10px"
type="primary"
size="small"
@click="handleSearchMap">查询</el-button>
<div id="app"
class="div_map"></div>
<div style="margin-top: 10px">
<span>经度</span>
<el-input
class="item_width_3"
maxlength="50"
placeholder="请输入经度"
v-model="dataForm.longitude"
>
<el-input class="item_width_3"
maxlength="50"
placeholder="请输入经度"
v-model="dataForm.longitude">
</el-input>
<span style="margin-left: 20px">纬度</span>
<el-input
class="item_width_3"
maxlength="50"
placeholder="请输入纬度"
v-model="dataForm.latitude"
>
<el-input class="item_width_3"
maxlength="50"
placeholder="请输入纬度"
v-model="dataForm.latitude">
</el-input>
</div>
</div>
</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="dataForm.remark"
></el-input>
<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="dataForm.remark"></el-input>
</el-form-item>
</el-form>
</div>
<div class="div_btn resi-btns">
<el-button size="small" @click="handleCancle"> </el-button>
<el-button
v-if="formType != 'detail'"
type="primary"
size="small"
:disabled="btnDisable"
@click="handleComfirm"
> </el-button
>
<el-button size="small"
@click="handleCancle"> </el-button>
<el-button v-if="formType != 'detail'"
type="primary"
size="small"
:disabled="btnDisable"
@click="handleComfirm"> </el-button>
</div>
</div>
</template>
@ -255,7 +197,7 @@ var infoWindowList;
let loading; //
export default {
data() {
data () {
return {
formType: "add", // addeditdetail
@ -281,7 +223,7 @@ export default {
},
components: {},
computed: {
dataRule() {
dataRule () {
return {
organizationName: [
{ required: true, message: "组织名称 不能为空", trigger: "blur" },
@ -316,15 +258,15 @@ export default {
props: {},
watch: {},
async created() {
async created () {
this.getCategoryList();
},
async mounted() {
async mounted () {
this.initMap();
},
methods: {
async getCategoryList() {
async getCategoryList () {
const url = "/sys/dict/data/dictlist";
const params = {
dictType: "self_org_category",
@ -336,19 +278,19 @@ export default {
this.$message.error(msg);
}
},
handleAddStaff() {
handleAddStaff () {
this.dataForm.organizationPersonnel = [
...this.dataForm.organizationPersonnel,
{ personName: "", personPhone: "" },
];
},
handleDelStaff(index) {
handleDelStaff (index) {
const { organizationPersonnel } = this.dataForm;
organizationPersonnel.splice(index, 1);
this.dataForm.organizationPersonnel = organizationPersonnel;
},
// init
initMap() {
initMap () {
//
var center = new window.TMap.LatLng(36.0722275, 120.38945519);
// map TMap.Map()
@ -374,7 +316,7 @@ export default {
this.handleMoveCenter();
},
setMarker(lat, lng) {
setMarker (lat, lng) {
markers.setGeometries([]);
markers.add([
{
@ -388,7 +330,7 @@ export default {
]);
},
handleSearchMap() {
handleSearchMap () {
infoWindowList.forEach((infoWindow) => {
infoWindow.close();
});
@ -416,7 +358,7 @@ export default {
});
},
handleMoveCenter() {
handleMoveCenter () {
//
const center = map.getCenter();
const lat = center.getLat();
@ -426,7 +368,7 @@ export default {
this.setMarker(lat, lng);
},
async initForm(type, row) {
async initForm (type, row) {
this.$refs.ref_form.resetFields();
this.formType = type;
@ -438,7 +380,7 @@ export default {
}
},
async handleComfirm() {
async handleComfirm () {
this.btnDisable = true;
setTimeout(() => {
this.btnDisable = false;
@ -448,26 +390,25 @@ export default {
app.util.validateRule(messageObj);
this.btnDisable = false;
} else {
if (!formVltHelper.userOrMobile(this.dataForm.principalPhone)) {
return this.$message({
type: "error",
message: "手机号格式有误",
});
}
// if (!formVltHelper.userOrMobile(this.dataForm.principalPhone)) {
// return this.$message({
// type: "error",
// message: "",
// });
// }
const {
dataForm: { organizationPersonnel },
} = this;
let vlt = organizationPersonnel.every((item) => {
return (
item.personName &&
item.personPhone &&
formVltHelper.userOrMobile(item.personPhone)
item.personPhone
);
});
if (!vlt) {
return this.$message({
type: "error",
message: "成员姓名/手机号为空或格式有误",
message: "成员姓名/手机号为空",
});
}
this.submit();
@ -475,7 +416,7 @@ export default {
});
},
async submit() {
async submit () {
let url = "";
if (this.formType === "add") {
url = "/heart/iccommunityselforganization/addcommunityselforganization";
@ -503,11 +444,11 @@ export default {
}
},
handleCancle() {
handleCancle () {
this.resetData();
this.$emit("dialogCancle");
},
resetData() {
resetData () {
this.orgId = "";
this.dataForm = {
organizationName: "",
@ -525,7 +466,7 @@ export default {
};
},
//
startLoading() {
startLoading () {
loading = Loading.service({
lock: true, //
text: "正在加载……", //
@ -533,7 +474,7 @@ export default {
});
},
//
endLoading() {
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close();

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

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

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

@ -78,8 +78,12 @@
</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 ">
<el-button size="small"
@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) => {
return {
...item,
index: index + 1,
urlIndex: index
}
})

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

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

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

@ -49,8 +49,8 @@
resize="none"
size="small"
style="width:200px"
:precision="6"
:step="0.00001"
:precision="5"
:step="0.0001"
placeholder='请输入经度偏差'
v-model="xOffset">
</el-input-number>
@ -58,8 +58,8 @@
<el-input-number v-if="showBtn&&hasPolygon"
resize="none"
size="small"
:precision="6"
:step="0.00001"
:precision="5"
:step="0.0001"
style="width:200px"
placeholder='请输入维度偏差'
v-model="yOffset">
@ -100,14 +100,48 @@
width="50%"
:before-close="handleClose">
<div class="div_textarea">
<el-input type="textarea"
:autosize="{ minRows: 20, maxRows: 50}"
:rows="20"
style="width:600px;height:500px"
placeholder='请复制坐标数据'
v-model="polygonManullyString">
</el-input>
<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"
:rows="15"
style="width:600px;max-height:500px"
placeholder='请复制坐标数据'
v-model="polygonManullyString">
</el-input>
</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"
class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
@ -248,10 +282,16 @@ const vueGis = {
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: "",
polygonStringResult: '',
xOffset: 0,
yOffset: 0,
xOffset_customize: 0,
yOffset_customize: 0,
// xOffset_customize: 0.0051,//
// yOffset_customize: 0.0002,//
longitude: undefined,
latitude: undefined,
}
},
async mounted () {
@ -717,6 +757,17 @@ const vueGis = {
//
handleManually () {
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 () {
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
//
@ -732,20 +794,29 @@ const vueGis = {
// 3°51N53°33N
const arrayString = this.polygonManullyString
let array = arrayString.split(/[, ]/)
let array = arrayString.split(/[, ()]/)
console.log(array)
this.polygonStringResult = ''
let polygonStringResult = ''
array.forEach(element => {
let num = Number(element)
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 () {
@ -753,7 +824,7 @@ const vueGis = {
},
handleOffsetOk () {
let selPolygonString = ""
let offsetPolygonString = ''//
this.subAgencyArray.forEach(element => {
if (element.id === this.selAgencyId && element.coordinates && element.coordinates.length > 0) {
selPolygonString = element.coordinates
@ -761,35 +832,32 @@ const vueGis = {
});
if (selPolygonString) {
let tempArray = selPolygonString.split(',')
tempArray.forEach((element, index) => {
let aaa = 0
if (index % 2 === 0) {//
aaa = parseFloat(element) + parseFloat(this.xOffset)
} else {
aaa = parseFloat(element) + parseFloat(this.yOffset)
}
if (index % 2 !== 0) {//
this.saveOffset(tyhis.xOffset, this.yOffset, selPolygonString)
}
}
offsetPolygonString = offsetPolygonString + aaa + ','
},
saveOffset (xOffset, yOffset, selPolygonString) {
let offsetPolygonString = ''//
let tempArray = selPolygonString.split(',')
});
tempArray.forEach((element, index) => {
let aaa = 0
offsetPolygonString = offsetPolygonString.substring(0, offsetPolygonString.length - 1)
}
if (index % 2 === 0) {//
aaa = parseFloat(element) + parseFloat(xOffset)
} else {
aaa = parseFloat(element) + parseFloat(yOffset)
}
if (index % 2 !== 0) {//
}
offsetPolygonString = offsetPolygonString + aaa + ','
console.log('selPolygonString', selPolygonString)
console.log('offsetPolygonString', offsetPolygonString)
});
offsetPolygonString = offsetPolygonString.substring(0, offsetPolygonString.length - 1)
this.addPolygon(offsetPolygonString)
},
handleSetOffset () {
this.handleOffsetCancel = false
@ -924,7 +992,9 @@ const vueGis = {
let params = {
orgId: this.selAgency.id,
level: this.selAgency.level,
coordinates: coorString
coordinates: coorString,
longitude: this.longitude,
latitude: this.latitude
}
const { data, code, msg } = await requestPost(url, params)
@ -935,6 +1005,7 @@ const vueGis = {
message: "绘制成功"
});
if (this.dialogVisible) {
this.polygonManullyString = ''
this.dialogVisible = false
}
this.refreshMap(false)

Loading…
Cancel
Save