liwei19941102 2 лет назад
Родитель
Сommit
260b4d119d

+ 12 - 3
src/components/Map/index.vue

@@ -18,6 +18,12 @@ import { getGpsData } from '@/api/gpsData/index'
 import carImage from "@/assets/images/icon/小货车.png";
 import add from '@/views/car/carInfo/add.vue';
 
+const props = defineProps({
+  showMarket: {
+    type: Boolean,
+    default: true
+  },
+})
 
 // const map = shallowRef(null);
 const path = ref([]);
@@ -41,7 +47,8 @@ const getDictsData = (param) => {
 }
 
 const getGpsDataList = (param) => {
-    console.log(param)
+    console.log(11111111);
+    console.log(param);
     getGpsData(param).then(res => {
         console.log(res);
         addLine(res.rows);
@@ -90,8 +97,9 @@ const initMap = () => {
         //     // map.addControl(new AMap.MapType()); // 实现默认图层与卫星图,实时交通图层之间切换
 
         // });
-
-        getDictsData("tbl_sites");
+        if(props.showMarket){
+            getDictsData("tbl_sites");
+        }
         // 单击
         map.on('click', (e) => {
             // lng ==> 经度值  lat => 维度值
@@ -240,6 +248,7 @@ const formatGCJ = (lng, lat) => {
 
 
 initMap()
+console.log(props.showMarket);
 // getGpsDataList();
 defineExpose({
     getGpsDataList,

+ 1 - 0
src/views/car/carInfo/add.vue

@@ -662,6 +662,7 @@ const setTableData = (tab) => {
 
 const setData = async (id) => {
     const res = await getCarInfo(id);
+    console.log(res)
     formParams.value = JSON.parse(res.data.ext1)
     if(res.data.ext2 != null){
         ext2.value = JSON.parse(res.data.ext2)

+ 3 - 1
src/views/car/carInfo/index.vue

@@ -73,7 +73,7 @@
           <el-button type="primary" @click="initMapLine">查询</el-button>
         </el-form-item>
       </el-form>
-      <mapDiv style="width:50vw;height:40vh;" ref="mapElm"></mapDiv>
+      <mapDiv :showMarket="showMarket" style="width:50vw;height:40vh;" ref="mapElm"></mapDiv>
     </el-dialog>
   </div>
 
@@ -105,6 +105,8 @@ const single = ref(true);
 const multiple = ref(true);
 const total = ref(0);
 
+const showMarket = ref(false)
+
 const timeArry = ref('')
 
 const queryFormRef = ref<ElFormInstance>();

+ 2 - 3
src/views/yunying/scheduling/index.vue

@@ -267,10 +267,9 @@ const getScheduleList = async () => {
 
 const getTimeFormat = (data) => {
     var value = JSON.parse(data).pathLine
-    console.log(JSON.parse(data))
     if (value.length > 0) {
-        if (value[0].planInTime) {
-            return value[0].planInTime
+        if (value[0].planInTime && value[value.length -1].planInTime) {
+            return value[0].planInTime +'-'+value[value.length -1].planInTime
         } else {
             return "请填写路线时间"
         }