Browse Source

界面高度、地图不显示经纬度

V1.0
dai 3 years ago
parent
commit
ed7ac80be6
  1. 1
      package.json
  2. 21
      src/views/modules/communityService/dqfwzx/cpts/edit.vue
  3. 10
      src/views/modules/communityService/sqzzz/cpts/edit.vue
  4. 47
      src/views/modules/cpts/base/cpts/edit.vue
  5. 30
      src/views/modules/cpts/base/index.vue
  6. 8
      src/views/modules/shequzhili/tuceng/anquan/weihua/index.vue
  7. 8
      src/views/modules/shequzhili/tuceng/anquan/xuncha/index.vue
  8. 8
      src/views/modules/shequzhili/tuceng/yingji/ziyuan/index.vue
  9. 4
      src/views/modules/shequzhili/tuceng/zhonghe/base.vue

1
package.json

@ -18,6 +18,7 @@
"dependencies": {
"@riophae/vue-treeselect": "^0.4.0",
"@tinymce/tinymce-vue": "^3.2.8",
"async-validator": "^4.2.5",
"axios": "^0.19.0",
"babel-eslint": "^8.0.1",
"babel-plugin-component": "^1.1.1",

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

@ -140,7 +140,7 @@
>查询</el-button
>
<div id="app" class="div_map"></div>
<div style="margin-top: 10px">
<div style="margin-top: 10px" v-show="false">
<span>经度</span>
<el-input
class="item_width_3"
@ -292,6 +292,7 @@ var search;
var markers;
var infoWindowList;
let loading; //
var geocoder; //
export default {
data() {
@ -461,11 +462,13 @@ export default {
});
infoWindowList = Array(10);
geocoder = new TMap.service.Geocoder(); //
//
map.on("panend", () => {
this.handleMoveCenter();
map.on("panend", (e) => {
this.handleMoveCenter(e);
});
this.handleMoveCenter();
// this.handleMoveCenter();
},
setMarker(lat, lng) {
@ -510,7 +513,7 @@ export default {
});
},
handleMoveCenter() {
handleMoveCenter(e) {
//
const center = map.getCenter();
const lat = center.getLat();
@ -518,6 +521,14 @@ export default {
this.dataForm.latitude = lat;
this.dataForm.longitude = lng;
this.setMarker(lat, lng);
if (e && e.originalEvent) {
geocoder
.getAddress({ location: new TMap.LatLng(lat, lng) }) //
.then((result) => {
this.dataForm.locationAddress = result.result.address;
});
}
},
async initForm(type, row) {

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

@ -186,13 +186,13 @@
</el-input>
<el-button
style="margin-left: 10px"
type="primary"
type="default"
size="small"
@click="handleSearchMap"
>查询</el-button
>
<div id="app" class="div_map"></div>
<div style="margin-top: 10px">
<div style="margin-top: 10px" v-show="false">
<span>经度</span>
<el-input
class="item_width_3"
@ -315,7 +315,7 @@ export default {
{ required: true, message: "联系电话不能为空", trigger: "blur" },
],
longitude: [
{ required: true, message: "位置坐标不能为空", trigger: "blur" },
{ required: true, message: "请拖动地图选择坐标点", trigger: "blur" },
],
};
},
@ -420,7 +420,7 @@ export default {
map.on("panend", (e) => {
this.handleMoveCenter(e);
});
this.handleMoveCenter();
// this.handleMoveCenter();
},
setMarker(lat, lng) {
@ -613,7 +613,7 @@ export default {
width: 200px;
}
.item_width_4 {
width: 200px;
width: 430px;
}
.div_map {

47
src/views/modules/cpts/base/cpts/edit.vue

@ -110,11 +110,12 @@
style="margin-left: 10px"
type="default"
size="small"
ref="mapSearch"
@click="handleSearchMap(item)"
>查询</el-button
>
<div id="app" class="div_map"></div>
<div style="margin-top: 10px">
<div style="margin-top: 10px" v-show="false">
<span>经度</span>
<el-input
class="address-item-input2"
@ -241,7 +242,7 @@
>查询</el-button
>
<div id="app" class="div_map"></div>
<div style="margin-top: 10px">
<div style="margin-top: 10px" v-show="false">
<span>经度</span>
<el-input
class="address-item-input2"
@ -301,6 +302,7 @@
<script>
import { requestPost } from "@/js/dai/request";
import nextTick from "dai-js/tools/nextTick";
import Schema from "async-validator";
var map;
var search;
@ -349,14 +351,16 @@ export default {
},
editFixedParams: {
type: Object,
default: () => {
return {};
},
default: () => ({}),
},
editParamsDiv: {
type: Number,
default: 0,
},
editElseRules: {
type: Object,
default: () => ({}),
},
},
data() {
@ -460,7 +464,7 @@ export default {
// map TMap.Map()
map = new window.TMap.Map(document.getElementById("app"), {
center: center, //
zoom: 17.2, //
zoom: 15, //
pitch: 43.5, //
rotation: 45, //
});
@ -479,7 +483,7 @@ export default {
map.on("panend", (e) => {
this.handleMoveCenter(item, e);
});
this.handleMoveCenter(item);
// this.handleMoveCenter(item);
},
setMarker(lat, lng) {
@ -569,8 +573,15 @@ export default {
console.log("------------------------------------info", this.fmData);
await nextTick(800);
if (map && data.latitude) {
map.setCenter(new TMap.LatLng(data.latitude, data.longitude));
if (map) {
if (data.latitude) {
map.setCenter(new TMap.LatLng(data.latitude, data.longitude));
} else {
if (this.$refs && this.$refs.mapSearch) {
console.log(this.$refs.mapSearch[0].handleClick);
this.$refs.mapSearch[0].handleClick();
}
}
}
} else {
this.$message.error(msg);
@ -587,12 +598,28 @@ export default {
this.btnDisable = false;
}, 5000);
console.log(this.$refs["ref_form"]);
this.$refs["ref_form"].validate((valid, messageObj) => {
console.log(valid, messageObj);
if (!valid) {
app.util.validateRule(messageObj);
this.btnDisable = false;
} else {
this.submit();
if (this.editElseRules) {
const validator = new Schema(this.editElseRules);
validator
.validate(this.fmData)
.then(() => {
this.submit();
})
.catch(({ err, fields }) => {
console.log("--------------", err, fields);
app.util.validateRule(fields);
});
} else {
this.submit();
}
}
});
},

30
src/views/modules/cpts/base/index.vue

@ -1,7 +1,7 @@
<template>
<div class="div_main">
<div v-show="true">
<div class="div_search">
<div class="div_search" ref="ref_search">
<el-form :inline="true" ref="ref_searchform" label-width="100px">
<div>
<el-form-item
@ -211,6 +211,7 @@
:editUrl="editUrl"
:editParams="editParams"
:editParamsDiv="editParamsDiv"
:editElseRules="editElseRules"
:editFixedParams="editFixedParams"
:formBtnFixed="formBtnFixed"
@close="handleClose"
@ -234,6 +235,7 @@ import { requestPost } from "@/js/dai/request";
import { mapGetters } from "vuex";
import axios from "axios";
import editForm from "./cpts/edit";
import nextTick from "dai-js/tools/nextTick";
export default {
components: { editForm },
@ -304,11 +306,13 @@ export default {
type: Array,
default: () => [],
},
editElseRules: {
type: Object,
default: () => ({}),
},
editFixedParams: {
type: Object,
default: () => {
return {};
},
default: () => ({}),
},
editParamsDiv: {
type: Number,
@ -338,21 +342,24 @@ export default {
formShow: false,
formTitle: "详情",
formType: "", // list add edit info
ref_search_height: 100,
};
},
computed: {
maxTableHeight() {
const { ref_search_height } = this;
return this.$store.state.inIframe
? this.clientHeight - 410 + this.iframeHeigh
: this.clientHeight - 410;
? this.clientHeight - ref_search_height - 260 + this.iframeHeight
: this.clientHeight - ref_search_height - 260;
},
...mapGetters(["clientHeight", "iframeHeight"]),
},
watch: {},
mounted() {
async mounted() {
console.log(this.$store.state);
this.user = this.$store.state.user;
@ -361,8 +368,17 @@ export default {
this.iniSearchData();
this.getTableData();
await nextTick(100);
this.computeSearchHeight();
},
methods: {
computeSearchHeight() {
this.ref_search_height = this.$refs["ref_search"].clientHeight;
console.log(this.$refs["ref_search"]);
console.log(this.ref_search_height);
},
iniSearchData() {
const { searchParams } = this;
searchParams.forEach((item, index) => {

8
src/views/modules/shequzhili/tuceng/anquan/weihua/index.vue

@ -12,6 +12,7 @@
:importUrl="importUrl"
:mubanUrl="mubanUrl"
:editParams="editParams"
:editElseRules="editElseRules"
:editBtnName="(item) => (!item.latitude ? '待完善' : '修改')"
idName="icDangerousChemicalsId"
></base-page>
@ -148,6 +149,13 @@ export default {
},
{ field: "备注", keyName: "remark", type: "textarea" },
],
editElseRules: {
longitude: {
type: "number",
required: true,
message: "请拖动地图选择坐标点",
},
},
};
},
components: { basePage },

8
src/views/modules/shequzhili/tuceng/anquan/xuncha/index.vue

@ -14,6 +14,7 @@
:importUrl="importUrl"
:mubanUrl="mubanUrl"
:editParams="editParams"
:editElseRules="editElseRules"
:editFixedParams="editFixedParams"
:editParamsDiv="5"
:editBtnName="(item) => (!item.latitude ? '待完善' : '修改')"
@ -228,6 +229,13 @@ export default {
editFixedParams: {
agencyId: this.$store.state.user.agencyId,
},
editElseRules: {
longitude: {
type: "number",
required: true,
message: "请拖动地图选择坐标点",
},
},
};
},
computed: {},

8
src/views/modules/shequzhili/tuceng/yingji/ziyuan/index.vue

@ -12,6 +12,7 @@
:importUrl="importUrl"
:mubanUrl="mubanUrl"
:editParams="editParams"
:editElseRules="editElseRules"
:editBtnName="(item) => (!item.latitude ? '待完善' : '修改')"
idName="icSuperiorResourceId"
></base-page>
@ -119,6 +120,13 @@ export default {
],
},
],
editElseRules: {
longitude: {
type: "number",
required: true,
message: "请拖动地图选择坐标点",
},
},
};
},
components: { basePage },

4
src/views/modules/shequzhili/tuceng/zhonghe/base.vue

@ -194,7 +194,7 @@
<el-table-column
prop="HOME_ID"
label="所属家庭"
label="所属房屋"
align="center"
min-width="160"
:show-overflow-tooltip="true"
@ -212,7 +212,7 @@
prop="MOBILE"
width="140"
align="center"
label="手机"
label="手机"
:show-overflow-tooltip="true"
>
</el-table-column>

Loading…
Cancel
Save