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.$getDictLabel = getDictLabel
//事件总线
Vue.prototype.$EventBus = new Vue()
// 保存整站vuex本地储存初始状态 // 保存整站vuex本地储存初始状态
window.SITE_CONFIG["storeState"] = cloneDeep(store.state); window.SITE_CONFIG["storeState"] = cloneDeep(store.state);

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

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

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

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

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

@ -316,7 +316,12 @@ export default {
return {} return {}
} }
}, },
transferObj: {
type: Object,
default () {
return {}
}
},
source: {//manage visiual source: {//manage visiual
type: String, type: String,
default: 'manage' default: 'manage'
@ -334,6 +339,16 @@ export default {
this.formData.reportUserMobile = val this.formData.reportUserMobile = val
this.formData.demandUserMobile = 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) { demandUserId: function (val) {
this.formData.demandUserId = val this.formData.demandUserId = val
@ -566,7 +581,7 @@ export default {
// init // init
initMap () { 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 TMap.Map()
map = new window.TMap.Map(document.getElementById('app_map'), { map = new window.TMap.Map(document.getElementById('app_map'), {
center: center, // 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> <template>
<div class="search"> <div class="search">
<el-form <el-form
@ -13,20 +22,14 @@
prop="categoryList" prop="categoryList"
> >
<div :class="{ 'visiual-form': source === 'visiual' }"> <div :class="{ 'visiual-form': source === 'visiual' }">
<!-- <el-cascader class="cell-width-2" <el-cascader class="cell-width-2"
ref="myCascader" ref="myCascader"
v-model="selCategoryArray" v-model="selCategoryArray"
:key="iscascaderShow" :key="iscascaderShow"
:options="casOptions" :options="casOptions"
:props="optionProps" :props="optionProps"
:show-all-levels="false" :show-all-levels="false"
@change="handleChangeCate"></el-cascader> --> @change="handleChangeCate"></el-cascader>
<my-cascader
v-model="formData.categoryList"
:casOptions="casOptions"
:optionProps="optionProps"
@handleChangeCate="handleChangeCate"
></my-cascader>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
@ -71,7 +74,6 @@ import { requestPost } from "@/js/dai/request";
import formVltHelper from "dai-js/tools/formVltHelper"; import formVltHelper from "dai-js/tools/formVltHelper";
import { isCard } from "@/utils/validate"; import { isCard } from "@/utils/validate";
import myCascader from "./myCascader.vue";
let loading; // let loading; //
export default { export default {
@ -89,11 +91,9 @@ export default {
okflag: false, okflag: false,
eventDetailCopy: {}, eventDetailCopy: {},
selCategoryArray:[],
casOptions: [], casOptions: [],
iscascaderShow: 0, iscascaderShow: 0,
selCategoryArray: [],
selCateObj: {},
optionProps: { optionProps: {
multiple: false, multiple: false,
value: "id", value: "id",
@ -110,19 +110,8 @@ export default {
} }
}; };
}, },
components: { myCascader }, components: { },
computed: { computed: {},
// dataRule() {
// return {
// content: [
// { required: true, message: "", trigger: "blur" },
// ],
// categoryList: [
// { required: true, message: "", trigger: "blur" },
// ],
// };
// },
},
props: { props: {
eventId: { eventId: {
type: String, type: String,
@ -150,20 +139,14 @@ export default {
this.getCategoryList(); this.getCategoryList();
if (this.eventId) { if (this.eventId) {
this.eventDetailCopy = JSON.parse(JSON.stringify(this.eventDetailData)); this.eventDetailCopy = JSON.parse(JSON.stringify(this.eventDetailData));
// eventDetailCopy
if ( if (
this.eventDetailCopy.parentCategoryId && this.eventDetailCopy.parentCategoryId &&
this.eventDetailCopy.categoryId this.eventDetailCopy.categoryId
) { ) {
this.selCategoryArray = []; this.selCategoryArray.push( this.eventDetailCopy.parentCategoryId,this.eventDetailCopy.categoryId)
this.selCategoryArray.push(this.eventDetailCopy.parentCategoryId);
this.selCategoryArray.push(this.eventDetailCopy.categoryId);
this.selCateObj = {
name: this.eventDetailCopy.categoryName,
id: this.eventDetailCopy.categoryId,
};
} }
} }
}, },
@ -188,16 +171,13 @@ export default {
} }
}, },
handleChangeCate(obj) { handleChangeCate() {
if(obj){ if(this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0]){
this.selCateObj = obj; this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0].data
this.formData.categoryList = []; }else{
let flag = JSON.stringify(obj) == "{}"; this.selCateObj = {}
if (flag) this.formData.categoryList = []; }
else this.formData.categoryList.push(this.selCateObj); console.log(this.selCateObj);
}else{
this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0].data
}
}, },
// //

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

@ -45,6 +45,7 @@
<process-form-demand ref="ref_process_form_demond" <process-form-demand ref="ref_process_form_demond"
:source="source" :source="source"
:eventId="eventId" :eventId="eventId"
:transferObj="transferObj"
:demandUserId="demandUserId" :demandUserId="demandUserId"
:demandUserName="demandUserName" :demandUserName="demandUserName"
:demandUserMobile="demandUserMobile" :demandUserMobile="demandUserMobile"
@ -99,8 +100,11 @@ export default {
issueInfo: {}, issueInfo: {},
okflag: false, okflag: false,
eventDetailCopy: {} eventDetailCopy: {},
transferObj:{
latitude :"",
longitude :""
}
}; };
}, },
components: { components: {
@ -173,7 +177,14 @@ export default {
this.eventDetailCopy = JSON.parse(JSON.stringify(this.eventDetailData)); 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: { methods: {

Loading…
Cancel
Save