Browse Source

bug#428,事件管理新增事件转服务地图与报事位置保持统一

feature
mk 2 years ago
parent
commit
ae9ff40c7d
  1. 3
      src/main.js
  2. 94
      src/views/modules/shequzhili/event/cpts/add.vue
  3. 1
      src/views/modules/shequzhili/event/cpts/event-info.vue
  4. 19
      src/views/modules/shequzhili/event/cpts/process-form-demand.vue
  5. 68
      src/views/modules/shequzhili/event/cpts/process-form-replay.vue
  6. 17
      src/views/modules/shequzhili/event/cpts/process-form.vue

3
src/main.js

@ -73,6 +73,9 @@ Vue.prototype.$getElUploadHeaders = () => ({
});
// Vue.prototype.$getDictLabel = getDictLabel
//事件总线
Vue.prototype.$EventBus = new Vue()
// 保存整站vuex本地储存初始状态
window.SITE_CONFIG["storeState"] = cloneDeep(store.state);

94
src/views/modules/shequzhili/event/cpts/add.vue

@ -137,21 +137,26 @@
label-width="150px"
style="display: block">
<div style="width: 500px">
<el-select v-model="searchValue"
filterable
style="width: 500px"
remote
:reserve-keyword="true"
placeholder="请输入关键词"
:remote-method="remoteMethod"
:loading="loading">
<el-option v-for="(item,index) in searchOptions"
@click.native="handleClickKey(index)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-form-item prop="location" style="display: block">
<el-select
v-model="formData.location"
filterable
remote
:reserve-keyword="true"
placeholder="请输入关键词"
:remote-method="remoteMethod"
:loading="loading"
@keyup.enter.native="remoteMethod(formData.location)"
>
<el-option
v-for="(item, index) in searchOptions"
@click.native="handleClickKey(index)"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<div id="app_event"
class="div_map"></div>
</div>
@ -191,7 +196,7 @@
clearable>
<el-option v-for="item in gridList"
@click.native="handleChangeGrid"
:key="item.value"
:key=`abc-${value}`
:label="item.label"
:value="item.value">
</el-option>
@ -230,7 +235,6 @@ import { requestPost } from "@/js/dai/request";
import formVltHelper from "dai-js/tools/formVltHelper";
import daiMap from "@/utils/dai-map";
import { isCard } from "@/utils/validate";
let loading; //
var map;
var search;
@ -575,12 +579,12 @@ export default {
// init
initMap (latitude, longitude) {
this.$nextTick(()=>{
map = new daiMap(
document.getElementById("app_event"),
{ latitude, longitude },
{
zoom: 16.2, //
zoom: 17.2, //
pitch: 43.5, //
rotation: 45, //
}
@ -593,6 +597,7 @@ export default {
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
})
},
@ -603,7 +608,7 @@ export default {
this.formData.latitude = lat;
this.formData.longitude = lng;
map.setMarker(lat, lng);
this.$EventBus.$emit('map',{lat,lng})
let { msg, data } = await map.getAddress(lat, lng);
if (msg == "success") {
this.formData.address = data.address
@ -614,34 +619,29 @@ export default {
},
async remoteMethod (query) {
if (query !== '') {
this.loading = true;
const { msg, data } = await map.searchNearby(query);
this.loading = false;
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}` };
});
}
} else {
this.searchOptions = [
{
value: '0',
label: '未检索到结果'
}
]
}
} else {
this.searchOptions = [];
}
this.loading = true;
const { msg, data } = await map.searchNearby(query);
this.loading = false;
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.id}`, label: `${item.address + item.name}` };
});
}
} else {
this.searchOptions = [
{
value: '0',
label: '未检索到结果'
}
];
}
} else {
this.searchOptions = [];
}
},
handleClickKey (index) {

1
src/views/modules/shequzhili/event/cpts/event-info.vue

@ -18,6 +18,7 @@
<process-form
ref="ref_processinfo_add"
:demandUserId="demandUserId"
:eventDetailData="eventDetailData"
:demandUserName="demandUserName"
:demandUserMobile="demandUserMobile"
:gridId="gridId"

19
src/views/modules/shequzhili/event/cpts/process-form-demand.vue

@ -316,7 +316,12 @@ export default {
return {}
}
},
transferObj: {
type: Object,
default () {
return {}
}
},
source: {//manage visiual
type: String,
default: 'manage'
@ -334,6 +339,16 @@ export default {
this.formData.reportUserMobile = val
this.formData.demandUserMobile = val
},
"transferObj.longitude":{
handler(newVal,oldVal){
this.$nextTick(()=>{
map.setCenter(new TMap.LatLng(this.transferObj.latitude,this.transferObj.longitude))
})
},
immediate: true //
},
demandUserId: function (val) {
this.formData.demandUserId = val
@ -566,7 +581,7 @@ export default {
// init
initMap () {
//
var center = new window.TMap.LatLng(36.0722275, 120.38945519)
var center = new window.TMap.LatLng(this.transferObj.latitude||36.0722275,this.transferObj.longitude|| 120.38945519)
// map TMap.Map()
map = new window.TMap.Map(document.getElementById('app_map'), {
center: center, //

68
src/views/modules/shequzhili/event/cpts/process-form-replay.vue

@ -1,3 +1,12 @@
<!--
* @Author: mk 2403457699@qq.com
* @Date: 2023-07-26 16:23:24
* @LastEditors: mk 2403457699@qq.com
* @LastEditTime: 2023-08-09 10:21:34
* @Description: 事件分类回填
*
*
-->
<template>
<div class="search">
<el-form
@ -13,20 +22,14 @@
prop="categoryList"
>
<div :class="{ 'visiual-form': source === 'visiual' }">
<!-- <el-cascader class="cell-width-2"
<el-cascader class="cell-width-2"
ref="myCascader"
v-model="selCategoryArray"
:key="iscascaderShow"
:options="casOptions"
:props="optionProps"
:show-all-levels="false"
@change="handleChangeCate"></el-cascader> -->
<my-cascader
v-model="formData.categoryList"
:casOptions="casOptions"
:optionProps="optionProps"
@handleChangeCate="handleChangeCate"
></my-cascader>
@change="handleChangeCate"></el-cascader>
</div>
</el-form-item>
<el-form-item
@ -71,7 +74,6 @@ import { requestPost } from "@/js/dai/request";
import formVltHelper from "dai-js/tools/formVltHelper";
import { isCard } from "@/utils/validate";
import myCascader from "./myCascader.vue";
let loading; //
export default {
@ -89,11 +91,9 @@ export default {
okflag: false,
eventDetailCopy: {},
selCategoryArray:[],
casOptions: [],
iscascaderShow: 0,
selCategoryArray: [],
selCateObj: {},
optionProps: {
multiple: false,
value: "id",
@ -110,19 +110,8 @@ export default {
}
};
},
components: { myCascader },
computed: {
// dataRule() {
// return {
// content: [
// { required: true, message: "", trigger: "blur" },
// ],
// categoryList: [
// { required: true, message: "", trigger: "blur" },
// ],
// };
// },
},
components: { },
computed: {},
props: {
eventId: {
type: String,
@ -150,20 +139,14 @@ export default {
this.getCategoryList();
if (this.eventId) {
this.eventDetailCopy = JSON.parse(JSON.stringify(this.eventDetailData));
// eventDetailCopy
if (
this.eventDetailCopy.parentCategoryId &&
this.eventDetailCopy.categoryId
) {
this.selCategoryArray = [];
this.selCategoryArray.push(this.eventDetailCopy.parentCategoryId);
this.selCategoryArray.push(this.eventDetailCopy.categoryId);
this.selCateObj = {
name: this.eventDetailCopy.categoryName,
id: this.eventDetailCopy.categoryId,
};
this.selCategoryArray.push( this.eventDetailCopy.parentCategoryId,this.eventDetailCopy.categoryId)
}
}
},
@ -188,16 +171,13 @@ export default {
}
},
handleChangeCate(obj) {
if(obj){
this.selCateObj = obj;
this.formData.categoryList = [];
let flag = JSON.stringify(obj) == "{}";
if (flag) this.formData.categoryList = [];
else this.formData.categoryList.push(this.selCateObj);
}else{
this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0].data
}
handleChangeCate() {
if(this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0]){
this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0].data
}else{
this.selCateObj = {}
}
console.log(this.selCateObj);
},
//

17
src/views/modules/shequzhili/event/cpts/process-form.vue

@ -45,6 +45,7 @@
<process-form-demand ref="ref_process_form_demond"
:source="source"
:eventId="eventId"
:transferObj="transferObj"
:demandUserId="demandUserId"
:demandUserName="demandUserName"
:demandUserMobile="demandUserMobile"
@ -99,8 +100,11 @@ export default {
issueInfo: {},
okflag: false,
eventDetailCopy: {}
eventDetailCopy: {},
transferObj:{
latitude :"",
longitude :""
}
};
},
components: {
@ -173,7 +177,14 @@ export default {
this.eventDetailCopy = JSON.parse(JSON.stringify(this.eventDetailData));
}
if(this.eventDetailData.operationType){
this.operationType = this.eventDetailCopy.operationType
// this.getProcessInfo()
}
this.$EventBus.$on('map',(val)=>{
this.transferObj.latitude = val.lat
this.transferObj.longitude = val.lng
})
},
methods: {

Loading…
Cancel
Save