From 972f27e9d36b125f8ac6fc32c8b43590d8ba6b46 Mon Sep 17 00:00:00 2001 From: 18650502300 <18650502300@163.com> Date: Thu, 18 Jul 2024 12:01:43 +0800 Subject: [PATCH] =?UTF-8?q?1.=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Map/TrajectoryMap.vue | 10 +- src/components/Map/location/LocationMap.vue | 202 +++++++------- src/views/system/commandLog/index.vue | 1 + src/views/system/dept/index.vue | 291 +++++++++++--------- src/views/system/device/index.vue | 19 +- src/views/system/fee/index.vue | 68 ++--- src/views/system/order/index.vue | 13 +- src/views/system/partner/index.vue | 9 + src/views/system/user/index.vue | 4 +- 9 files changed, 350 insertions(+), 267 deletions(-) diff --git a/src/components/Map/TrajectoryMap.vue b/src/components/Map/TrajectoryMap.vue index d8e5445..fc9dc00 100644 --- a/src/components/Map/TrajectoryMap.vue +++ b/src/components/Map/TrajectoryMap.vue @@ -67,7 +67,13 @@ export default { }, methods: { destroyMap() { - this.map?.destroy(); + if (this.map) { + console.log("轨迹=====地图实例存在,销毁地图..."); + this.map.destroy(); + console.log("轨迹=====地图已销毁"); + } else { + console.log("轨迹=====地图实例不存在,无需销毁"); + } }, initAMap() { AMapLoader.load({ @@ -86,12 +92,14 @@ export default { this.trajectory(); //轨迹 }).catch((e) => { + console.log("地图加载失败!!!"); console.log(e); }); }, // 显示轨迹 trajectory() { this.line = JSON.parse(this.tripRouteStr) + console.log("this.line================"+this.line) let line = this.line; this.marker = new AMap.Marker({ map: this.map, diff --git a/src/components/Map/location/LocationMap.vue b/src/components/Map/location/LocationMap.vue index c2c38f3..ce45695 100644 --- a/src/components/Map/location/LocationMap.vue +++ b/src/components/Map/location/LocationMap.vue @@ -2,20 +2,6 @@
- - - - - - - - - - - - - -
@@ -78,21 +64,28 @@ export default { this.initAMap(); }, beforeDestroy() { + console.log("轨迹=====组件将被销毁"); this.destroyMap(); }, methods: { destroyMap() { - this.map?.destroy(); - }, - onChangeArea() { - this.loadPlaceSearch(this.area.province, this.area.city); - if (this.keyword != null) { - this.doPlaceSearch(this.keyword); + if (this.map) { + console.log("位置=====地图实例存在,销毁地图..."); + this.map.destroy(); + console.log("位置=====地图已销毁"); } else { - let city = this.area.city === '市辖区' ? this.area.province : this.area.city; - this.doPlaceSearch(city + '人民政府'); + console.log("位置=====地图实例不存在,无需销毁"); } }, + // onChangeArea() { + // this.loadPlaceSearch(this.area.province, this.area.city); + // if (this.keyword != null) { + // this.doPlaceSearch(this.keyword); + // } else { + // let city = this.area.city === '市辖区' ? this.area.province : this.area.city; + // this.doPlaceSearch(city + '人民政府'); + // } + // }, initAMap() { AMapLoader.load({ key: globalConfig.aMap.key, // 申请好的Web端开发者Key,首次调用 load 时必填 @@ -109,37 +102,38 @@ export default { // this.map.on('click', this.onClickMap); // POI - this.loadPlaceSearch(this.area.province, this.area.city); + // this.loadPlaceSearch(this.area.province, this.area.city); // 逆地理编码 - this.loadGeoCoder(); + // this.loadGeoCoder(); // 加载初始地址 this.initMarker(); }).catch((e) => { + console.log("地图加载失败!!!"); console.log(e); }); }, - async initMarker() { + initMarker() { this.removeAllMarker(); if (this.initLng != null && this.initLat != null) { - this.getGeoAddress(this.initLng, this.initLat).then(res => { + // this.getGeoAddress(this.initLng, this.initLat).then(res => { // 标点 this.removeAllMarker(); console.log("添加标记点") this.addMarker(this.initLng, this.initLat, this.deviceSn, this.status, this.onlineStatus); - this.$emit('map-geo', res, this.initLng, this.initLat); + // this.$emit('map-geo', res, this.initLng, this.initLat); // 地区 - let component = res.regeocode.addressComponent; - this.area = { - province: component.province, - city: component.city === '' ? '市辖区' : component.city, - } - }).finally(() => { - this.loading = false; - }) + // let component = res.regeocode.addressComponent; + // this.area = { + // province: component.province, + // city: component.city === '' ? '市辖区' : component.city, + // } + // }).finally(() => { + // this.loading = false; + // }) } }, addMarker: function(lng, lat, title, status, onlineStatus) { @@ -212,75 +206,75 @@ export default { this.markers = []; }, // 点击地图事件 - onClickMap(e) { - console.log('clickMap', e); - let lng = e.lnglat.lng; - let lat = e.lnglat.lat; - this.changeMarker(lng, lat); - }, - // 逆地理编码,并标点 - changeMarker(lng, lat) { - console.log('changeMarker', lng,lat); - this.loading = true; - this.getGeoAddress(lng, lat).then(res => { - this.removeAllMarker(); - this.addMarker(lng, lat, res.regeocode.formattedAddress); - this.$emit('map-geo', res, lng, lat); - }).finally(() => { - this.loading = false; - }) - }, - // 获取逆地理编码 - getGeoAddress(lng, lat) { - console.log('getGeoAddress', lng,lat); - console.log('this.geocoder', this.geocoder); - if(this.geocoder){ - return new Promise((resolve, reject) =>{ - this.geocoder.getAddress([lng, lat], (status, result) => { - if (status === 'complete' && result.info === 'OK') { - console.log('resolve', result); - resolve(result); - } else { - console.log('reject', status,result); - reject(status); - } - }) - }) - } - }, - // 加载逆地理编码 - loadGeoCoder() { - AMap.plugin('AMap.Geocoder', () => { - this.geocoder = new AMap.Geocoder({ - city: '全国' // city 指定进行编码查询的城市,支持传入城市名、adcode 和 citycode - }) - }) - }, - // 加载POI - loadPlaceSearch(province, city) { - if (city == null) { - city = '北京市'; - } - if (city === '市辖区') { - city = province; - } - AMap.plugin(["AMap.PlaceSearch"], () => { - //构造地点查询类 - this.placeSearch = new AMap.PlaceSearch({ - pageSize: 5, // 单页显示结果条数 - pageIndex: 1, // 页码 - city: city, // 兴趣点城市 - citylimit: true, //是否强制限制在设置的城市内搜索 - map: this.map, // 展现结果的地图实例 - panel: "panel", // 结果列表将在此容器中进行展示。 - autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围 - }); - }); - // 事件绑定 - this.placeSearch.on('selectChanged', (data) => { - this.$emit('select-changed', data); - }) - }, + // onClickMap(e) { + // console.log('clickMap', e); + // let lng = e.lnglat.lng; + // let lat = e.lnglat.lat; + // this.changeMarker(lng, lat); + // }, + // // 逆地理编码,并标点 + // changeMarker(lng, lat) { + // console.log('changeMarker', lng,lat); + // this.loading = true; + // this.getGeoAddress(lng, lat).then(res => { + // this.removeAllMarker(); + // this.addMarker(lng, lat, res.regeocode.formattedAddress); + // this.$emit('map-geo', res, lng, lat); + // }).finally(() => { + // this.loading = false; + // }) + // }, + // // 获取逆地理编码 + // getGeoAddress(lng, lat) { + // console.log('getGeoAddress', lng,lat); + // console.log('this.geocoder', this.geocoder); + // if(this.geocoder){ + // return new Promise((resolve, reject) =>{ + // this.geocoder.getAddress([lng, lat], (status, result) => { + // if (status === 'complete' && result.info === 'OK') { + // console.log('resolve', result); + // resolve(result); + // } else { + // console.log('reject', status,result); + // reject(status); + // } + // }) + // }) + // } + // }, + // // 加载逆地理编码 + // loadGeoCoder() { + // AMap.plugin('AMap.Geocoder', () => { + // this.geocoder = new AMap.Geocoder({ + // city: '全国' // city 指定进行编码查询的城市,支持传入城市名、adcode 和 citycode + // }) + // }) + // }, + // // 加载POI + // loadPlaceSearch(province, city) { + // if (city == null) { + // city = '北京市'; + // } + // if (city === '市辖区') { + // city = province; + // } + // AMap.plugin(["AMap.PlaceSearch"], () => { + // //构造地点查询类 + // this.placeSearch = new AMap.PlaceSearch({ + // pageSize: 5, // 单页显示结果条数 + // pageIndex: 1, // 页码 + // city: city, // 兴趣点城市 + // citylimit: true, //是否强制限制在设置的城市内搜索 + // map: this.map, // 展现结果的地图实例 + // panel: "panel", // 结果列表将在此容器中进行展示。 + // autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围 + // }); + // }); + // // 事件绑定 + // this.placeSearch.on('selectChanged', (data) => { + // this.$emit('select-changed', data); + // }) + // }, //关键字查询 doPlaceSearch(keyword) { if (keyword == null) { diff --git a/src/views/system/commandLog/index.vue b/src/views/system/commandLog/index.vue index b21b7e1..7aff973 100644 --- a/src/views/system/commandLog/index.vue +++ b/src/views/system/commandLog/index.vue @@ -73,6 +73,7 @@ + @@ -340,6 +383,8 @@ export default { options: [], // 运营区选项 areaOptions: [], + // 默认排序 + defaultSort: {prop: 'createTime', order: 'descending'}, // 弹出层标题 title: "", title2: "", @@ -356,10 +401,13 @@ export default { queryParams: { deptName: undefined, status: undefined, - phonenumber: null + phonenumber: null, + areaName: undefined }, // 表单参数 - form: {}, + form: { + isProfitSharing: 'N' + }, form2: {}, // 表单校验 rules: { @@ -405,20 +453,11 @@ export default { this.getList(); }, methods: { - submitForm2: function() { - let form2 = this.form2 - this.$refs['form2'].validate(valid => { - if (valid) { - this.$modal.confirm('是否确认绑定?').then(function() { - return bandAppUser({appUserId:form2.phonenumber,deptId:form2.deptId}) - }).then(() => { - // 刷新页面 - location.reload() - this.$modal.msgSuccess('操作成功') - }).catch(() => { - }) - } - }) + /** 排序触发事件 */ + handleSortChange(column, prop, order) { + this.queryParams.orderByColumn = column.prop; + this.queryParams.isAsc = column.order; + this.getList(); }, queryPhonenumber(query) { console.log("query:",query) @@ -435,12 +474,6 @@ export default { this.options = [] } }, - bandWxUser(row){ - this.reset(); - this.form2 = row; - this.open2 = true; - this.title2 = "绑定微信用户"; - }, /** 查询运营商列表 */ getList() { this.loading = true; @@ -476,7 +509,18 @@ export default { leader: undefined, phone: undefined, email: undefined, - status: "0" + status: "0", + isProfitSharing: false, + separateAccount: 'N', + platformServiceFee: '4', + handlingCharge: '5.4', + isUsePlatformApp: true, + merchantId: null, + apiV3Key: null, + notifyUrl: null, + privateKeyPath: null, + merchantSerialNumber: null, + refundNotifyUrl: null }; this.resetForm("form"); }, @@ -496,7 +540,8 @@ export default { this.open = true; this.title = "添加运营商"; listDept().then(response => { - this.deptOptions = this.handleTree(response.data, "deptId"); + console.log("response=============",response) + this.deptOptions = response.data; listArea().then(response => { this.areaOptions = response.rows; this.form.parentId = 100; diff --git a/src/views/system/device/index.vue b/src/views/system/device/index.vue index 9c7ab88..e9542a9 100644 --- a/src/views/system/device/index.vue +++ b/src/views/system/device/index.vue @@ -410,10 +410,10 @@ {{ form.latitude }} - + {{ form.lastTime }} - + 当前无gps信号 @@ -454,7 +454,7 @@ @@ -604,6 +604,15 @@ export default { if (newVal) { this.fetchData(newVal); } + }, + open2(val) { + if (!val) { + console.log("========关闭地图=============") + this.showPlaceSearchMap = false; // 关闭地图 + } else { + console.log("========打开地图=============") + this.showPlaceSearchMap = true; // 打开地图 + } } }, beforeDestroy() { @@ -732,6 +741,10 @@ export default { this.open = false; this.reset(); }, + // 取消按钮 + cancel2() { + this.open2 = false; + }, // 表单重置 reset() { this.form = { diff --git a/src/views/system/fee/index.vue b/src/views/system/fee/index.vue index bfd63a8..858d24e 100644 --- a/src/views/system/fee/index.vue +++ b/src/views/system/fee/index.vue @@ -87,16 +87,16 @@ - - - - - - - - - - + + + + + @@ -113,19 +113,19 @@ 小时 后自动退押金 - - - - - - 分钟,每 - + + + + + + + - - - - 分钟语音提醒一次归还设备 - + + + + + @@ -161,7 +161,7 @@ - + @@ -179,7 +179,7 @@ - + @@ -423,14 +423,14 @@ export default { sectionCharges: [ { required: true, message: '请输入区间收费', trigger: 'blur' }, ], - startingTime: [ - { required: true, message: '请输入起步时间', trigger: 'blur' }, - { pattern: /^\d+$/, message: '起步时间必须为正整数', trigger: 'blur' } - ], - timeoutTime: [ - { required: true, message: '请输入超时时间', trigger: 'blur' }, - { pattern: /^\d+$/, message: '超时时间必须为正整数', trigger: 'blur' } - ], + // startingTime: [ + // { required: true, message: '请输入起步时间', trigger: 'blur' }, + // { pattern: /^\d+$/, message: '起步时间必须为正整数', trigger: 'blur' } + // ], + // timeoutTime: [ + // { required: true, message: '请输入超时时间', trigger: 'blur' }, + // { pattern: /^\d+$/, message: '超时时间必须为正整数', trigger: 'blur' } + // ], }, }; }, @@ -536,7 +536,9 @@ export default { }else if(this.form.rentalUnit=='day'){ this.timeUnit='天' } - this.returnVerify = this.form.area.returnVerify; + if(this.form.area){ + this.returnVerify = this.form.area.returnVerify; + } // console.log("-------returnVerify------",this.returnVerify) // delete this.form.ridingRuleJson; let json = JSON.parse(response.data.ridingRuleJson) diff --git a/src/views/system/order/index.vue b/src/views/system/order/index.vue index 2a2cb79..125b7a0 100644 --- a/src/views/system/order/index.vue +++ b/src/views/system/order/index.vue @@ -457,6 +457,17 @@ export default { this.getList(); this.getAreaList(); }, + watch: { + open(val) { + if (!val) { + console.log("========关闭轨迹地图=============") + this.showPlaceSearchMap = false; // 关闭地图 + } else { + console.log("========打开轨迹地图=============") + this.showPlaceSearchMap = true; // 打开地图 + } + } + }, methods: { toLog(row){ this.$router.push(`/system/commandLog/orderNo/index/${row.orderNo}`); @@ -705,7 +716,7 @@ export default { this.reset(); const orderId = row.orderId || this.ids getOrder(orderId).then(response => { - console.log("=====getOrder======="+JSON.stringify(response)) + // console.log("=====getOrder======="+JSON.stringify(response)) this.form = response.data; if (response.data.etRefund) { this.form.etRefund = response.data.etRefund; diff --git a/src/views/system/partner/index.vue b/src/views/system/partner/index.vue index 2423901..7fb2a37 100644 --- a/src/views/system/partner/index.vue +++ b/src/views/system/partner/index.vue @@ -93,6 +93,11 @@ + + +