Browse Source

Merge branch 'dev-天地图' into dev

dev-用户反馈
jiangyy 3 years ago
parent
commit
43ed3518d3
  1. 193
      src/views/modules/communityParty/heart/heartDetail.vue
  2. 712
      src/views/modules/communityParty/heart/heartForm.vue
  3. 416
      src/views/modules/communityService/dqfwzx/cpts/edit.vue

193
src/views/modules/communityParty/heart/heartDetail.vue

@ -113,13 +113,13 @@
<div class="info-prop"> <div class="info-prop">
<span class="info-title-3">活动地图位置</span> <span class="info-title-3">活动地图位置</span>
<div class="div_map2"> <div class="div_map2">
<div id="map_act_id"></div> <div id="app_heart_detail_act"></div>
</div> </div>
</div> </div>
<div class="info-prop"> <div class="info-prop">
<span class="info-title-3">签到地图位置</span> <span class="info-title-3">签到地图位置</span>
<div class="div_map2"> <div class="div_map2">
<div id="map_signin_id"></div> <div id="app_heart_detail_signin"></div>
</div> </div>
</div> </div>
@ -183,6 +183,7 @@
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request' import { requestPost } from '@/js/dai/request'
import daiMap from "@/utils/dai-map";
let loading // let loading //
@ -226,10 +227,10 @@ export default {
methods: { methods: {
diaDestroy () { diaDestroy () {
if (map_act) { if (map_act) {
map_act.destroy() // map_act.destroy()
} }
if (map_signin) { if (map_signin) {
map_signin.destroy() // map_signin.destroy()
} }
}, },
@ -241,9 +242,27 @@ export default {
await this.loadFormData() await this.loadFormData()
this.initLoading = true this.initLoading = true
let { latitude, longitude } = this.$store.state.user;
console.log('lat' + latitude + ',lon' + longitude)
if (this.formData.latitude && this.formData.longitude) {
latitude = this.formData.latitude
longitude = this.formData.longitude
}
if (!latitude || latitude == "" || latitude == "0") {
latitude = 39.9088810666821;
longitude = 116.39743841556731;
}
this.$nextTick(() => { this.$nextTick(() => {
this.initMap() if (!map_act) {
this.initMap(this.formData.actLatitude, this.formData.actLongitude, this.formData.signInLatitude, this.formData.signInLongitude)
} else {
map_act.setCenter(this.formData.actLatitude, this.formData.actLongitude);
map_act.setMarker(this.formData.actLatitude, this.formData.actLongitude);
map_signin.setCenter(this.formData.signInLatitude, this.formData.signInLongitude);
map_signin.setMarker(this.formData.signInLatitude, this.formData.signInLongitude);
}
}) })
this.endLoading() this.endLoading()
@ -291,150 +310,44 @@ export default {
return c || content return c || content
}, },
// init // init
initMap () { initMap (latitude1, longitude1, latitude2, longitude2) {
//
var centerAct = new window.TMap.LatLng(this.formData.actLatitude, this.formData.actLongitude); map_act = new daiMap(
var centerSign = new window.TMap.LatLng(this.formData.signInLatitude, this.formData.signInLongitude); document.getElementById("app_heart_detail_act"),
// map TMap.Map() { latitude1, longitude1 },
map_act = new window.TMap.Map(document.getElementById("map_act_id"), { {
center: centerAct, // zoom: 16.2, //
zoom: 17.2, //
pitch: 43.5, // pitch: 43.5, //
rotation: 45, // rotation: 45, //
}); }
map_signin = new window.TMap.Map(document.getElementById("map_signin_id"), { );
center: centerSign, // map_signin = new daiMap(
zoom: 17.2, // document.getElementById("app_heart_detail_signin"),
{ latitude2, longitude2 },
{
zoom: 16.2, //
pitch: 43.5, // pitch: 43.5, //
rotation: 45, // rotation: 45, //
}); }
);
// search_act = new window.TMap.service.Search({ pageSize: 10 });
//
markers_act = new TMap.MultiMarker({
map: map_act,
geometries: [],
});
infoWindowList_act = Array(10);
geocoder_act = new TMap.service.Geocoder(); //
// search_signin = new window.TMap.service.Search({ pageSize: 10 });
//
markers_signin = new TMap.MultiMarker({
map: map_signin,
geometries: [],
});
infoWindowList_signin = Array(10);
geocoder_signin = new TMap.service.Geocoder(); //
//
map_act.on("panend", (e) => {
this.handleMoveCenterAct(e);
});
this.handleMoveCenterAct();
//
map_signin.on("panend", (e) => {
this.handleMoveCenterSignin(e);
});
this.handleMoveCenterSignin();
},
setMarkerAct (lat, lng) {
markers_act.setGeometries([]);
markers_act.add([
{
id: "4",
styleId: "marker",
position: new TMap.LatLng(lat, lng),
properties: {
title: "marker4",
},
},
]);
},
// //
// map_act.on("dragend", (e) => {
// this.handleMoveCenterAct(e);
// });
map_act.setCenter(latitude1, longitude1);
map_act.setMarker(latitude1, longitude1);
handleMoveCenterAct (e) { // //
// // map_signin.on("dragend", (e) => {
const center = map_act.getCenter(); // this.handleMoveCenterSignin(e);
const lat = center.getLat(); // });
const lng = center.getLng();
this.formData.actLatitude = lat;
this.formData.actLongitude = lng;
this.setMarkerAct(lat, lng);
if (e && e.originalEvent) { map_signin.setCenter(latitude2, longitude2);
geocoder_act map_signin.setMarker(latitude2, longitude2);
.getAddress({ location: new TMap.LatLng(lat, lng) }) //
.then((result) => {
this.formData.actAddress = result.result.address;
});
}
},
setMarkerSignin (lat, lng) {
markers_signin.setGeometries([]);
markers_signin.add([
{
id: "4",
styleId: "marker",
position: new TMap.LatLng(lat, lng),
properties: {
title: "marker4",
},
},
]);
},
handleSearchMapSignin () {
infoWindowList_signin.forEach((infoWindow) => {
infoWindow.close();
});
infoWindowList_signin.length = 0;
markers_signin.setGeometries([]);
//
search_signin
.searchRectangle({
keyword: this.formData.signInAddress,
bounds: map_signin.getBounds(),
})
.then((result) => {
let { data } = result;
if (Array.isArray(data) && data.length > 0) {
const {
location: { lat, lng },
} = data[0];
map_signin.setCenter(new TMap.LatLng(lat, lng));
this.setMarkerSignin(lat, lng);
this.formData.signInLatitude = lat;
this.formData.signInLongitude = lng;
} else {
this.$message.error("未检索到相关位置坐标");
}
});
},
handleMoveCenterSignin (e) {
//
const center = map_signin.getCenter();
const lat = center.getLat();
const lng = center.getLng();
this.formData.signInLatitude = lat;
this.formData.signInLongitude = lng;
this.setMarkerSignin(lat, lng);
if (e && e.originalEvent) {
geocoder_signin
.getAddress({ location: new TMap.LatLng(lat, lng) }) //
.then((result) => {
this.formData.signInAddress = result.result.address;
});
}
}, },
handleCancle () { handleCancle () {

712
src/views/modules/communityParty/heart/heartForm.vue

File diff suppressed because it is too large

416
src/views/modules/communityService/dqfwzx/cpts/edit.vue

@ -1,188 +1,140 @@
<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="centerName" prop="centerName"
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.centerName" v-model="dataForm.centerName">
>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="办公电话"
label="办公电话"
prop="workPhone" prop="workPhone"
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.workPhone" v-model="dataForm.workPhone">
>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="办公时间"
label="社区地址"
prop="address"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入社区地址 "
v-model="dataForm.address"
>
</el-input>
</el-form-item>
<el-form-item
label="办公时间"
prop="amStartTime" prop="amStartTime"
label-width="150px" label-width="150px"
style="display: block" style="display: block">
>
<div class="row"> <div class="row">
<span>上午</span> <span>上午</span>
<el-time-select <el-time-select style="margin-left: 10px"
style="margin-left: 10px"
v-model="dataForm.amStartTime" v-model="dataForm.amStartTime"
:picker-options="{ :picker-options="{
start: '00:00', start: '00:00',
step: '00:30', step: '00:30',
end: '12:00', end: '12:00',
}" }"
placeholder="开始时间" placeholder="开始时间">
>
</el-time-select> </el-time-select>
<span style="margin: 0 5px"></span> <span style="margin: 0 5px"></span>
<el-time-select <el-time-select v-model="dataForm.amEndTime"
v-model="dataForm.amEndTime"
:picker-options="{ :picker-options="{
start: '00:00', start: '00:00',
step: '00:30', step: '00:30',
end: '12:00', end: '12:00',
minTime: dataForm.amStartTime, minTime: dataForm.amStartTime,
}" }"
placeholder="结束时间" placeholder="结束时间">
>
</el-time-select> </el-time-select>
</div> </div>
<div class="row" style="margin-top: 5px"> <div class="row"
style="margin-top: 5px">
<span>下午</span> <span>下午</span>
<el-time-select <el-time-select style="margin-left: 10px"
style="margin-left: 10px"
v-model="dataForm.pmStartTime" v-model="dataForm.pmStartTime"
:picker-options="{ :picker-options="{
start: '12:00', start: '12:00',
step: '00:30', step: '00:30',
end: '24:00', end: '24:00',
}" }"
placeholder="开始时间" placeholder="开始时间">
>
</el-time-select> </el-time-select>
<span style="margin: 0 5px"></span> <span style="margin: 0 5px"></span>
<el-time-select <el-time-select v-model="dataForm.pmEndTime"
v-model="dataForm.pmEndTime"
:picker-options="{ :picker-options="{
start: '12:00', start: '12:00',
step: '00:30', step: '00:30',
end: '24:00', end: '24:00',
minTime: dataForm.pmStartTime, minTime: dataForm.pmStartTime,
}" }"
placeholder="结束时间" placeholder="结束时间">
>
</el-time-select> </el-time-select>
</div> </div>
</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-select v-model="searchValue"
class="item_width_4" filterable
maxlength="50" style="width: 500px"
placeholder="请输入关键字" remote
v-model="dataForm.locationAddress" :reserve-keyword="true"
> placeholder="请输入关键词"
</el-input> :remote-method="remoteMethod"
<el-button :loading="loading">
style="margin-left: 10px" <el-option v-for="(item,index) in searchOptions"
type="primary" @click.native="handleClickKey(index)"
size="small" :key="item.value"
@click="handleSearchMap" :label="item.label"
>查询</el-button :value="item.value">
> </el-option>
<div id="app" class="div_map"></div> </el-select>
<div style="margin-top: 10px" v-show="false"> <div id="app_dqfwzx"
<span>经度</span> class="div_map"></div>
<el-input </div>
class="item_width_3" </el-form-item>
maxlength="50" <el-form-item label="社区地址"
placeholder="请输入经度" prop="address"
v-model="dataForm.longitude" label-width="150px"
> style="display: block">
</el-input> <el-input class="item_width_1"
<span style="margin-left: 20px">纬度</span>
<el-input
class="item_width_3"
maxlength="50" maxlength="50"
placeholder="请输入纬度" show-word-limit
v-model="dataForm.latitude" placeholder="请输入社区地址 "
> v-model="dataForm.address">
</el-input> </el-input>
</div>
</div>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="可预约事项"
label="可预约事项"
prop="matterList" prop="matterList"
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.matterList" v-for="(item, index) in dataForm.matterList">
>
<div class="item-info"> <div class="item-info">
<el-input <el-input class="item_width_1"
class="item_width_1"
style="width: 150px" style="width: 150px"
maxlength="50" maxlength="50"
show-word-limit show-word-limit
placeholder="事项名" placeholder="事项名"
v-model="item.matterName" v-model="item.matterName"
:disabled="item.matterId != undefined" :disabled="item.matterId != undefined" />
/>
<el-upload :headers="$getElUploadHeaders()" <el-upload :headers="$getElUploadHeaders()"
:disabled="item.matterId != undefined" :disabled="item.matterId != undefined"
class="avatar-uploader" class="avatar-uploader"
@ -193,39 +145,32 @@
(response, file, fileList) => (response, file, fileList) =>
handleImgSuccess(index, response, file, fileList) handleImgSuccess(index, response, file, fileList)
" "
:before-upload="beforeImgUpload" :before-upload="beforeImgUpload">
> <img v-if="item.matterImg"
<img
v-if="item.matterImg"
:src="item.matterImg" :src="item.matterImg"
style="width: 36px; height: 36px" style="width: 36px; height: 36px"
class="function-icon" class="function-icon" />
/> <i v-else
<i v-else class="el-icon-plus avatar-uploader-icon"></i> class="el-icon-plus avatar-uploader-icon"></i>
</el-upload> </el-upload>
<div class="hint">事项封面图片小于1M</div> <div class="hint">事项封面图片小于1M</div>
</div> </div>
<div class="item-pic"> <div class="item-pic">
<el-select <el-select style="width: 150px; margin-left: 0"
style="width: 150px; margin-left: 0"
v-model="item.appointmentType" v-model="item.appointmentType"
filterable filterable
placeholder="预约类型" placeholder="预约类型"
:disabled="item.matterId != undefined" :disabled="item.matterId != undefined">
> <el-option v-for="item in appointmentTypeOptions"
<el-option
v-for="item in appointmentTypeOptions"
: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-time-select <el-time-select style="width: 120px; margin-left: 20px"
style="width: 120px; margin-left: 20px"
v-model="item.startTime" v-model="item.startTime"
:picker-options="{ :picker-options="{
start: '00:00', start: '00:00',
@ -233,12 +178,10 @@
end: '24:00', end: '24:00',
}" }"
placeholder="开始时间" placeholder="开始时间"
:disabled="item.matterId != undefined" :disabled="item.matterId != undefined">
>
</el-time-select> </el-time-select>
<span style="margin: 0 5px"></span> <span style="margin: 0 5px"></span>
<el-time-select <el-time-select style="width: 120px"
style="width: 120px"
v-model="item.endTime" v-model="item.endTime"
:picker-options="{ :picker-options="{
start: '00:00', start: '00:00',
@ -247,37 +190,31 @@
minTime: item.startTime, minTime: item.startTime,
}" }"
placeholder="结束时间" placeholder="结束时间"
:disabled="item.matterId != undefined" :disabled="item.matterId != undefined">
>
</el-time-select> </el-time-select>
<el-button <el-button style="margin-left: 20px"
style="margin-left: 20px"
size="small" size="small"
@click="handleDelStaff(index)" @click="handleDelStaff(index)">删除</el-button>
>删除</el-button
>
</div> </div>
</div> </div>
<div class="item-add"> <div class="item-add">
<el-button size="small" type="warning" @click="handleAddStaff" <el-button size="small"
>添加</el-button type="warning"
> @click="handleAddStaff">添加</el-button>
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div class="div_btn"> <div class="div_btn">
<el-button size="small" @click="handleCancle"> </el-button> <el-button size="small"
<el-button @click="handleCancle"> </el-button>
size="small" <el-button size="small"
v-if="formType != 'detail'" v-if="formType != 'detail'"
type="primary" type="primary"
:disabled="btnDisable" :disabled="btnDisable"
@click="handleComfirm" @click="handleComfirm"> </el-button>
> </el-button
>
</div> </div>
</div> </div>
</template> </template>
@ -286,6 +223,7 @@
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import { Loading } from "element-ui"; // Loading import { Loading } from "element-ui"; // Loading
import { requestPost } from "@/js/dai/request"; import { requestPost } from "@/js/dai/request";
import daiMap from "@/utils/dai-map";
var map; var map;
var search; var search;
@ -295,12 +233,16 @@ let loading; // 加载动画
var geocoder; // var geocoder; //
export default { export default {
data() { data () {
return { return {
uploadUlr: window.SITE_CONFIG["apiURL"] + "/oss/file/uploadqrcodeV2", uploadUlr: window.SITE_CONFIG["apiURL"] + "/oss/file/uploadqrcodeV2",
customerId: "", customerId: "",
formType: "add", // addeditdetail formType: "add", // addeditdetail
searchOptions: [],
searchValue: '',
resultList: [],
loading: false,
btnDisable: false, btnDisable: false,
@ -339,7 +281,7 @@ export default {
}, },
components: {}, components: {},
computed: { computed: {
dataRule() { dataRule () {
return { return {
centerName: [ centerName: [
{ required: true, message: "中心名称 不能为空", trigger: "blur" }, { required: true, message: "中心名称 不能为空", trigger: "blur" },
@ -375,13 +317,13 @@ export default {
props: {}, props: {},
watch: {}, watch: {},
async mounted() { async mounted () {
this.customerId = localStorage.getItem("customerId"); this.customerId = localStorage.getItem("customerId");
this.initMap();
}, },
methods: { methods: {
handleImgSuccess(index, res, file) { handleImgSuccess (index, res, file) {
if (res.code === 0 && res.msg === "success") { if (res.code === 0 && res.msg === "success") {
console.log("res.data.url", res.data.url); console.log("res.data.url", res.data.url);
this.dataForm.matterList[index].matterImg = res.data.url; this.dataForm.matterList[index].matterImg = res.data.url;
@ -390,7 +332,7 @@ export default {
} }
}, },
beforeImgUpload(file) { beforeImgUpload (file) {
const isLt1M = file.size / 1024 / 1024 < 1; const isLt1M = file.size / 1024 / 1024 < 1;
if (!isLt1M) { if (!isLt1M) {
@ -399,7 +341,7 @@ export default {
return isLt1M; return isLt1M;
}, },
handleAddStaff() { handleAddStaff () {
this.dataForm.matterList = [ this.dataForm.matterList = [
...this.dataForm.matterList, ...this.dataForm.matterList,
{ {
@ -411,7 +353,7 @@ export default {
}, },
]; ];
}, },
async handleDelStaff(index) { async handleDelStaff (index) {
const { matterList } = this.dataForm; const { matterList } = this.dataForm;
let list = [...matterList]; let list = [...matterList];
let delItem = list.splice(index, 1); let delItem = list.splice(index, 1);
@ -428,7 +370,7 @@ export default {
this.dataForm.matterList = list; this.dataForm.matterList = list;
}, },
async delStaff(matterId) { async delStaff (matterId) {
const { data, code, msg } = await requestPost( const { data, code, msg } = await requestPost(
"/gov/org/icpartyservicecenter/delmatter", "/gov/org/icpartyservicecenter/delmatter",
{ {
@ -438,114 +380,114 @@ export default {
return code === 0; return code === 0;
}, },
// init // init
initMap() { initMap (latitude, longitude) {
let { latitude, longitude } = this.$store.state.user;
if (!latitude || latitude == "" || latitude == "0") { map = new daiMap(
latitude = 39.9088810666821; document.getElementById("app_dqfwzx"),
longitude = 116.39743841556731; { latitude, longitude },
} {
//
var center = new window.TMap.LatLng(latitude, longitude);
// map TMap.Map()
map = new window.TMap.Map(document.getElementById("app"), {
center: center, //
zoom: 16.2, // zoom: 16.2, //
pitch: 43.5, // pitch: 43.5, //
rotation: 45, // 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", (e) => { map.on("dragend", (e) => {
this.handleMoveCenter(e); this.handleMoveCenter(e);
}); });
// this.handleMoveCenter();
},
setMarker(lat, lng) { map.setCenter(latitude, longitude);
markers.setGeometries([]); map.setMarker(latitude, longitude);
markers.add([
{
id: "4",
styleId: "marker",
position: new TMap.LatLng(lat, lng),
properties: {
title: "marker4",
},
},
]);
}, },
handleSearchMap() {
infoWindowList.forEach((infoWindow) => { async handleMoveCenter () {
infoWindow.close(); //
}); const { lat, lng } = map.getCenter();
infoWindowList.length = 0;
markers.setGeometries([]);
//
search
.searchNearby({
keyword: this.dataForm.locationAddress,
radius: 1000,
autoExtend: true,
center: map.getCenter(),
})
.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.dataForm.latitude = lat; this.dataForm.latitude = lat;
this.dataForm.longitude = lng; this.dataForm.longitude = lng;
} else { map.setMarker(lat, lng);
this.$message.error("未检索到相关位置坐标");
let { msg, data } = await map.getAddress(lat, lng);
if (msg == "success") {
this.dataForm.address = data.address
this.searchValue = data.address
this.searchOptions = []
} }
});
}, },
handleMoveCenter(e) { async remoteMethod (query) {
//
const center = map.getCenter(); if (query !== '') {
const lat = center.getLat(); this.loading = true;
const lng = center.getLng();
this.dataForm.latitude = lat; const { msg, data } = await map.searchNearby(query);
this.dataForm.longitude = lng; this.loading = false;
this.setMarker(lat, lng); this.resultList = []
if (msg == "success" && data.resultList && data.resultList.length > 0) {
if (data.resultList && data.resultList.length > 0) {
this.resultList = data.resultList
this.searchOptions = this.resultList.map(item => {
return { value: `${item.hotPointID}`, label: `${item.address + item.name}` };
if (e && e.originalEvent) {
geocoder
.getAddress({ location: new TMap.LatLng(lat, lng) }) //
.then((result) => {
this.dataForm.locationAddress = result.result.address;
}); });
} }
} else {
this.searchOptions = [
{
value: '0',
label: '未检索到结果'
}
]
}
} else {
this.searchOptions = [];
}
}, },
async initForm(type, row) { handleClickKey (index) {
this.$refs.ref_form.resetFields(); let selPosition = this.resultList[index]
let lonlat = selPosition.lonlat.split(" ")
map.setCenter(lonlat[1], lonlat[0]);
map.setMarker(lonlat[1], lonlat[0]);
this.dataForm.latitude = lonlat[1];
this.dataForm.longitude = lonlat[0];
this.dataForm.address = selPosition.address + selPosition.name
},
async initForm (type, row) {
this.$refs.ref_form.resetFields();
let { latitude, longitude } = this.$store.state.user;
this.formType = type; this.formType = type;
console.log(row); console.log(row);
if (row) { if (row) {
this.dataForm = { ...this.dataForm, ...row }; this.dataForm = { ...this.dataForm, ...row };
this.partyServiceCenterId = this.dataForm.partyServiceCenterId; this.partyServiceCenterId = this.dataForm.partyServiceCenterId;
map.setCenter(new TMap.LatLng(row.latitude, row.longitude));
} else {
this.dataForm.latitude = latitude
this.dataForm.longitude = longitude
}
this.$nextTick(() => {
if (!map) {
this.initMap(this.dataForm.latitude, this.dataForm.longitude)
} else {
map.setCenter(this.dataForm.latitude, this.dataForm.longitude);
map.setMarker(this.dataForm.latitude, this.dataForm.longitude);
} }
})
}, },
async handleComfirm() { async handleComfirm () {
this.btnDisable = true; this.btnDisable = true;
setTimeout(() => { setTimeout(() => {
this.btnDisable = false; this.btnDisable = false;
@ -560,7 +502,7 @@ export default {
}); });
}, },
async submit() { async submit () {
let url = ""; let url = "";
if (this.formType === "add") { if (this.formType === "add") {
url = "/gov/org/icpartyservicecenter/addpartyservicecenter"; url = "/gov/org/icpartyservicecenter/addpartyservicecenter";
@ -609,11 +551,15 @@ export default {
} }
}, },
handleCancle() { handleCancle () {
this.resetData(); this.resetData();
this.$emit("dialogCancle"); this.$emit("dialogCancle");
}, },
resetData() { resetData () {
this.searchValue = ''
this.searchOptions = []
this.resultList = []
this.partyServiceCenterId = ""; this.partyServiceCenterId = "";
this.dataForm = { this.dataForm = {
centerName: "", centerName: "",
@ -631,7 +577,7 @@ export default {
}; };
}, },
// //
startLoading() { startLoading () {
loading = Loading.service({ loading = Loading.service({
lock: true, // lock: true, //
text: "正在加载……", // text: "正在加载……", //
@ -639,7 +585,7 @@ export default {
}); });
}, },
// //
endLoading() { endLoading () {
// clearTimeout(timer); // clearTimeout(timer);
if (loading) { if (loading) {
loading.close(); loading.close();

Loading…
Cancel
Save