From fb026e6052b4d843d327312db398cf791ac57ab9 Mon Sep 17 00:00:00 2001
From: cyy <cuiqian2004@163.com>
Date: 星期日, 28 九月 2025 22:43:29 +0800
Subject: [PATCH] test
---
images/Frame_139.svg | 0
pages/task/update.vue | 43 -
pages/map/scene.vue | 46 +-
comm/utils.js | 2
pages/my/log.vue | 2
pages/map/teaching.vue | 8
images/Frame_174.svg | 0
pages/station/index.vue | 10
pages/index/connect.vue | 6
images/Frame_178.svg | 0
pages/map/js/ctx.js | 295 +++++++-----
api/request.js | 38 +
static/images/station.svg | 11
.hbuilderx/launch.json | 9
pages/map/task.vue | 2
images/Frame_180.svg | 0
package-lock.json | 2
images/Frame_153.svg | 0
pages/task/list.vue | 13
pages/task/add.vue | 50 +
api/vehicle.js | 3
pages/index/detail.vue | 10
/dev/null | 0
pages/task/infos/task-item.vue | 2
images/Frame_5.png | 0
pages/map/infos/scene-create.vue | 4
images/image_25.png | 0
pages/map/index.vue | 307 +++++++++----
pages/index/index.vue | 194 ++++---
images/Frame_179.svg | 0
pages/station/delete.vue | 241 ++++++++++
pages.json | 6
images/image_15.png | 0
manifest.json | 8
34 files changed, 891 insertions(+), 421 deletions(-)
diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json
index 422b9af..7e4d039 100644
--- a/.hbuilderx/launch.json
+++ b/.hbuilderx/launch.json
@@ -9,6 +9,13 @@
"openVueDevtools" : false,
"playground" : "standard",
"type" : "uni-app:app-android"
- }
+ },
+ {
+ "app-plus" :
+ {
+ "launchtype" : "local"
+ },
+ "type" : "uniCloud"
+ }
]
}
diff --git a/api/request.js b/api/request.js
index 7a144b3..421f7cc 100644
--- a/api/request.js
+++ b/api/request.js
@@ -14,6 +14,7 @@
apiCount: {
agv_state: 0,
laser_data: 0,
+ current_teaching:0
},
addLog(item) {
if (!getApp().globalData.withLog) {
@@ -30,18 +31,27 @@
}
this.apiCount.agv_state = 1;
}
- if (item.url.indexOf("laser_data") > 0) {
-
- if (ret.data?.base_map?.image_base64) {
- this.apiCount.laser_data++;
- } else {
- if (this.apiCount.laser_data % 20 != 0) {
- this.apiCount.laser_data++;
- return
- }
- this.apiCount.laser_data = 1;
+ if (item.url.indexOf("get_current_teaching_data") > 0) {
+
+ if (this.apiCount.current_teaching % 20 != 0) {
+ this.apiCount.current_teaching++;
+ return
}
+ this.apiCount.current_teaching = 1;
}
+
+ // if (item.url.indexOf("laser_data") > 0) {
+
+ // if (ret.data?.base_map?.image_base64) {
+ // this.apiCount.laser_data++;
+ // } else {
+ // if (this.apiCount.laser_data % 20 != 0) {
+ // this.apiCount.laser_data++;
+ // return
+ // }
+ // this.apiCount.laser_data = 1;
+ // }
+ // }
const res = ret.data
if (res) {
if (item.url.indexOf("getMapUrl") > 0) {
@@ -95,8 +105,8 @@
options.method = options.method || this.common.method;
options.dataType = options.dataType || this.common.dataType;
- if (options.url.indexOf("get_agv_state") < 0 && options.url.indexOf("laser_data") < 0 && options.url.indexOf(
- "taskGroupStatus") < 0) {
+ if (options.url.indexOf("get_agv_state") < 0 && options.url.indexOf("laser_data") < 0
+ && options.url.indexOf("taskGroupStatus") < 0 &&options.url.indexOf("get_current_teaching_data") < 0) {
console.log("url", options.url, options.data)
}
return new Promise((resolve, reject) => {
@@ -108,8 +118,8 @@
method: options.method,
dataType: options.dataType,
success: (result) => {
- if (options.url.indexOf("get_agv_state") < 0 && options.url.indexOf(
- "laser_data") < 0) { //
+ if (options.url.indexOf("get_agv_state") < 0 && options.url.indexOf("laser_data") < 0
+ && options.url.indexOf("taskGroupStatus") < 0 &&options.url.indexOf("get_current_teaching_data") < 0) { //
console.log("result", result)
}
diff --git a/api/vehicle.js b/api/vehicle.js
index 5fc8768..c440418 100644
--- a/api/vehicle.js
+++ b/api/vehicle.js
@@ -89,6 +89,7 @@
method: "GET",
url,
header,
+
})
@@ -109,6 +110,8 @@
method: "GET",
url,
header,
+ timeout: 5000,
+
})
}
diff --git a/comm/utils.js b/comm/utils.js
index a109d14..8e8692a 100644
--- a/comm/utils.js
+++ b/comm/utils.js
@@ -66,7 +66,6 @@
if (!ex)
return
let tip = ex
- console.log(ex);
if (typeof ex !== "string") {
let exStr = JSON.stringify(ex)
if (exStr == "{}")
@@ -74,6 +73,7 @@
tip = typeof ex.errMsg == "string" ? ex.errMsg : typeof ex.msg == "string" ? ex.msg : typeof ex.message ==
"string" ? ex.message : exStr
}
+ console.log(ex,tip)
//plus.nativeUI.alert(tip,title);
return uni.showModal({
title: title || "",
diff --git a/images/Frame 139.svg b/images/Frame_139.svg
similarity index 100%
rename from images/Frame 139.svg
rename to images/Frame_139.svg
diff --git a/images/Frame 153.svg b/images/Frame_153.svg
similarity index 100%
rename from images/Frame 153.svg
rename to images/Frame_153.svg
diff --git a/images/Frame 174.svg b/images/Frame_174.svg
similarity index 100%
rename from images/Frame 174.svg
rename to images/Frame_174.svg
diff --git a/images/Frame 178.svg b/images/Frame_178.svg
similarity index 100%
rename from images/Frame 178.svg
rename to images/Frame_178.svg
diff --git a/images/Frame 179.svg b/images/Frame_179.svg
similarity index 100%
rename from images/Frame 179.svg
rename to images/Frame_179.svg
diff --git a/images/Frame 180.svg b/images/Frame_180.svg
similarity index 100%
rename from images/Frame 180.svg
rename to images/Frame_180.svg
diff --git a/images/Frame 5.png b/images/Frame_5.png
similarity index 100%
rename from images/Frame 5.png
rename to images/Frame_5.png
Binary files differ
diff --git a/images/image 15.png b/images/image_15.png
similarity index 100%
rename from images/image 15.png
rename to images/image_15.png
Binary files differ
diff --git a/images/image 25.png b/images/image_25.png
similarity index 100%
rename from images/image 25.png
rename to images/image_25.png
Binary files differ
diff --git a/manifest.json b/manifest.json
index c959315..9cad931 100644
--- a/manifest.json
+++ b/manifest.json
@@ -2,8 +2,8 @@
"name" : "ES-GO",
"appid" : "__UNI__C988375",
"description" : "",
- "versionName" : "1.3.2",
- "versionCode" : 132,
+ "versionName" : "1.3.6",
+ "versionCode" : 136,
"transformPx" : false,
/* 5+App鐗规湁鐩稿叧 */
"app-plus" : {
@@ -47,7 +47,9 @@
"dSYMs" : false
},
/* SDK閰嶇疆 */
- "sdkConfigs" : {}
+ "sdkConfigs" : {
+ "ad" : {}
+ }
}
},
/* 蹇簲鐢ㄧ壒鏈夌浉鍏�*/
diff --git a/package-lock.json b/package-lock.json
index 42022fa..4e73299 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,5 +1,5 @@
{
- "name": "鍦扮墰App",
+ "name": "diniu",
"lockfileVersion": 3,
"requires": true,
"packages": {
diff --git a/pages.json b/pages.json
index 07b1844..cc782b2 100644
--- a/pages.json
+++ b/pages.json
@@ -165,6 +165,12 @@
}
},
{
+ "path": "pages/station/delete",
+ "style": {
+ "navigationBarTitleText": "鎵归噺鍒犻櫎绔欑偣"
+ }
+ },
+ {
"path": "pages/teaching/index",
"style": {
"navigationBarTitleText": "绀烘暀璺嚎鍒楄〃"
diff --git a/pages/index/connect.vue b/pages/index/connect.vue
index ff1ed67..9fddb1c 100644
--- a/pages/index/connect.vue
+++ b/pages/index/connect.vue
@@ -11,14 +11,14 @@
<view class="content" v-else-if="connectState == 2">
<view class="title">杩炴帴鎴愬姛</view>
<view class="content2">
- <image class="img" src="/images/Frame 178.svg" alt=" 鍥剧墖" />
+ <image class="img" src="/images/Frame_178.svg" alt=" 鍥剧墖" />
<view>銆恵{connectedDevice}}銆戣繛鎺ユ垚鍔�/view>
</view>
</view>
<view class="content" v-else-if="connectState == 3">
<view class="title">杩炴帴澶辫触</view>
<view class="content2">
- <image class="img" src="/images/Frame 179.svg" alt=" 鍥剧墖" />
+ <image class="img" src="/images/Frame_179.svg" alt=" 鍥剧墖" />
<view class="title">鏃犳硶杩炴帴璁惧</view>
<view>璇风‘淇濊溅杈嗗紑鏈轰笖鏈笌鍏朵粬缁堢閰嶅</view>
</view>
@@ -29,7 +29,7 @@
<view>1銆佽灏嗘墜鏈鸿繛鎺ュ埌鈥榹{ip}}鈥欑殑Wifi缃戠粶</view>
<view>2銆佽繛鎺ュ悗鍥炲埌鏈簲鐢�/view>
- <image class="img-2" src="/images/Frame 180.svg" alt=" 鍥剧墖" />
+ <image class="img-2" src="/images/Frame_180.svg" alt=" 鍥剧墖" />
</view>
</view>
<view class="content" v-else>
diff --git a/pages/index/detail.vue b/pages/index/detail.vue
index 5c410d6..c615aa2 100644
--- a/pages/index/detail.vue
+++ b/pages/index/detail.vue
@@ -6,16 +6,16 @@
<text class="uni-nav-bar-text">{{navigationBarTitle }}</text>
</view>
<template v-slot:right>
- <view class="uni-navbar-btn-text">
- <a @click="clickSave" class="uni-nav-bar-right-text">
+ <view class="uni-navbar-btn-text" @click="clickSave">
+ <a class="uni-nav-bar-right-text">
淇濆瓨
</a>
</view>
</template>
<template v-slot:left>
- <view class="uni-navbar-btn-text">
- <a @click="clickCancel" class="uni-nav-bar-left-text">
+ <view class="uni-navbar-btn-text" @click="clickCancel">
+ <a class="uni-nav-bar-left-text">
鍙栨秷
</a>
</view>
@@ -26,7 +26,7 @@
<view class="group">
<view class="item line">
<view>鍚嶇О锛�/view>
- <input class="input" v-model="vehicleName"> </input>
+ <input class="input" v-model="vehicleName"/>
</view>
<view class="item line">
<view>ip鍦板潃锛�/view>
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 1f9d046..e3c22da 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -20,63 +20,63 @@
<swiper v-if="pageList.length > 0" circular indicator-dots class="swiper" :current="currentPage"
@change="changeSwiper">
<swiper-item v-for="(page,index) in pageList" class="swiper-item">
- <view class="vehicle-header">
- <view class="link-view">
- <view v-if="page.link_status">
- <!-- <image class="img-battery-charging" src="/images/bx_battery3.svg" alt="SVG 鍥剧墖" /> -->
- <image class="img-battery-charging" src="/images/bx_battery2.svg" alt="SVG 鍥剧墖" />
- <image class="img-battery-soc" :style="{width:(page.soc*0.4)+'rpx'}"
- src="/images/bx_battery4.svg" alt="SVG 鍥剧墖" />
+
+ <view class="vehicle-header">
+ <view class="link-view">
+ <view v-if="page.link_status">
+ <!-- <image class="img-battery-charging" src="/images/bx_battery3.svg" alt="SVG 鍥剧墖" /> -->
+ <image class="img-battery-charging" src="/images/bx_battery2.svg" alt="SVG 鍥剧墖" />
+ <image class="img-battery-soc" :style="{width:(page.soc*0.4)+'rpx'}"
+ src="/images/bx_battery4.svg" alt="SVG 鍥剧墖" />
+
+ </view>
+ <view v-else>
+ <image class="img-battery" src="/images/bx_battery1.svg" alt="SVG 鍥剧墖" />
+ </view>
+ <template v-if="page.link_status">
+ <view class="soc-text">{{page.soc}}%</view>
+ <view class="status-text">{{getAgvStateText(page)}}</view>
+ </template>
+
+
+ <view v-else class="gray-text">宸茬绾�/view>
+ </view>
+ </view>
+ <image class="vehicle-img " :class="page.link_status ?'':'gray-image'" mode="aspectFit"
+ src="/images/che.png" alt="鍥剧墖" />
+ <view v-if="page.link_status" class="img-button-group">
+ <view type="primary" plain="true" class="img-text-button" @click="clickToMap(index,page)">
+ <a-button class="img-button" color='primary'>
+ <text class="ico map" />
+ </a-button>
+ <text>鍦烘櫙鏋勫缓</text>
</view>
- <view v-else>
- <image class="img-battery" src="/images/bx_battery1.svg" alt="SVG 鍥剧墖" />
+ <view type="primary" class="img-text-button" @click="clickToTask(page)">
+ <a-button class="img-button" color='primary'>
+ <text class="ico task-list" />
+ </a-button>
+ <text>浠诲姟璁板綍</text>
</view>
- <template v-if="page.link_status">
- <view class="soc-text">{{page.soc}}%</view>
- <view class="status-text">{{getAgvStateText(page)}}</view>
- </template>
-
-
- <view v-else class="gray-text">宸茬绾�/view>
</view>
- </view>
- <image class="vehicle-img " :class="page.link_status ?'':'gray-image'" mode="aspectFit"
- src="/images/che.png" alt="鍥剧墖" />
- <view v-if="page.link_status" class="img-button-group">
- <view type="primary" plain="true" class="img-text-button" @click="clickToMap(index,page)">
- <a-button class="img-button" color='primary'>
- <text class="ico map" />
- </a-button>
- <text>鍦烘櫙鏋勫缓</text>
+ <view v-else class="unlink-content">
+ <view class="content2" v-if="page.conntecting">
+ <view class="auto-circle"></view>
+
+ <view class="text">杩炴帴涓�..</view>
+ </view>
+ <view class="content2" v-else>
+ <view class="text"> 杞﹁締宸茬绾匡紝璇烽噸鏂拌繛鎺�/view>
+ <a-button type="primary" class="button" @click="clickRelink">閲嶆柊杩炴帴
+ </a-button>
+ </view>
</view>
- <view type="primary" class="img-text-button" @click="clickToTask(page)">
- <a-button class="img-button" color='primary'>
- <text class="ico task-list" />
- </a-button>
- <text>浠诲姟璁板綍</text>
- </view>
- </view>
- <view v-else class="unlink-content">
- <view class="content2" v-if="page.conntecting">
- <view class="auto-circle"></view>
-
- <view class="text">杩炴帴涓�..</view>
- </view>
- <view class="content2" v-else>
- <view class="text"> 杞﹁締宸茬绾匡紝璇烽噸鏂拌繛鎺�/view>
- <a-button type="primary" class="button" @click="clickRelink">閲嶆柊杩炴帴
- </a-button>
- </view>
-
- </view>
-
-
+
</swiper-item>
- <swiper-item class="swiper-item">
+ <swiper-item class="swiper-item">
- <image class="title-img gray-image" src="/images/image 15.png" alt="鍥剧墖" />
+ <image class="title-img gray-image" src="/images/image_15.png" alt="鍥剧墖" />
<view class="button-group">
<a-button type="primary" class="button" @click="clickScanCode">鎵弿娣诲姞璁惧</a-button>
<a-button type="ghost" class="button" @click="clickManualAdd">鎵嬪姩娣诲姞璁惧</a-button>
@@ -85,7 +85,7 @@
</swiper>
<view v-else class="no-page items-center">
<view class="content ">
- <image class="title-img gray-image" src="/images/image 15.png" alt="鍥剧墖" />
+ <image class="title-img gray-image" src="/images/image_15.png" alt="鍥剧墖" />
<view class="button-group">
<a-button type="primary" class="button" @click="clickScanCode">鎵弿娣诲姞璁惧</a-button>
<a-button type="ghost" class="button" @click="clickManualAdd">鎵嬪姩娣诲姞璁惧</a-button>
@@ -204,8 +204,13 @@
console.log("hide")
},
computed: {
-
+ tabList() {
+ return [...this.pageList, {
+ ip: ""
+ }]
+ }
},
+
methods: {
setData(obj) {
let that = this;
@@ -261,8 +266,10 @@
break
}
}
-
- this.pageList = [...list]
+ this.setData({
+ pageList: list
+ })
+ //this.pageList = [...list]
} else {
this.setData({
currentPage: curIndex
@@ -302,11 +309,14 @@
page.soc = 0
page.link_status = false
}
+ this.pageList = [...list]
}
- this.pageList = [...list]
+
+ // this.pageList = [...list]
} catch (ex) {
- showError(ex)
+ // showError(ex)
+ showToast(ex)
}
},
@@ -378,6 +388,7 @@
this.navigationBarTitle = "娣诲姞璁惧"
else
this.navigationBarTitle = this.pageList[this.currentPage].name
+ this.loadVehicleBattery()
},
async clickRelink() {
try {
@@ -484,10 +495,13 @@
pageList: list
})
session.setValue("vehicles", list)
- if (list.length > 0)
- that.navigationBarTitle = that.pageList[that.currentPage].name
- else
- that.navigationBarTitle = "娣诲姞璁惧"
+ // if (list.length > 0)
+ // that.navigationBarTitle = that.pageList[that.currentPage].name
+ // else
+ // that.navigationBarTitle = "娣诲姞璁惧"
+ uni.reLaunch({
+ url:"/pages/indde/index"
+ })
},
update_vehicle: function(data) {
console.log("update_vehicle", data)
@@ -504,23 +518,26 @@
},
async clickToMap(index, page) {
try {
-
+console.log("clicktomap")
const _this = this
- // const res = await getAllScene(page.ip) || []
- // const list = res?.sceneList || []
- // if (list.length === 0) {
- // uni.navigateTo({
- // url: `/pages/scene/index?ip=${page.ip}`,
- // events: {
- // // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�鍒板綋鍓嶉〉闈㈢殑鏁版嵁
- // finish: function() {
- // _this.clickToMap(index, page)
- // },
- // }
- // })
- // return
- // }
- // getApp().globalData.sceneList = list
+ const res = await getAllScene(page.ip) || []
+ const list = res?.sceneList || []
+ if (list.length === 0) {
+ uni.navigateTo({
+ url: `/pages/map/scene?ip=${page.ip}`,
+ events: {
+ // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�鍒板綋鍓嶉〉闈㈢殑鏁版嵁
+ create_finish: function() {
+ setTimeout(() => {
+ _this.clickToMap(index, page)
+ }, 500);
+
+ },
+ }
+ })
+ return
+ }
+ // getApp().globalData.sceneList = list
uni.navigateTo({
url: `/pages/map/index?ip=${page.ip}`,
@@ -538,7 +555,7 @@
}
},
- clickToTask( page) {
+ clickToTask(page) {
uni.navigateTo({
url: `/pages/task/log-list?ip=${page.ip}`
@@ -599,24 +616,29 @@
showModal(`纭畾瑕佸垹闄よ澶団�${ page.name}鈥濆悧`, "璀﹀憡", true, "纭畾", "鍙栨秷").then((res) => {
if (res) {
const list = this.pageList
- const curPage = this.currentPage
+ let curPage = this.currentPage
list.splice(this.currentPage, 1)
- this.setData({
- currentPage: curPage,
- pageList: list
- })
+
+ // this.setData({
+ // currentPage: 0,
+ // pageList: list
+ // })
+ console.log(curPage, this.currentPage, this.pageList)
session.setValue("vehicles", list)
- if (list.length > 0)
- this.navigationBarTitle = this.pageList[this.currentPage].name
- else
- this.navigationBarTitle = "娣诲姞璁惧"
+ // if (list.length > 0)
+ // this.navigationBarTitle = this.pageList[this.currentPage].name
+ // else
+ // this.navigationBarTitle = "娣诲姞璁惧"
+ uni.reLaunch({
+ url: "/pages/index/index"
+ })
}
})
} else if (item.text == "澶囦唤") {
const page = this.pageList[this.currentPage]
uni.navigateTo({
-
+
url: `/pages/index/backup?ip=${page.ip}`
})
}
diff --git a/pages/map/index.vue b/pages/map/index.vue
index b76665c..9240203 100644
--- a/pages/map/index.vue
+++ b/pages/map/index.vue
@@ -10,22 +10,22 @@
alt="SVG 鍥剧墖" @click="clickShowMenu" />
</view>
<template v-slot:left>
- <view>
- <uni-icons type="left" size="24" @click="clickBack"></uni-icons>
+ <view @click="clickBack">
+ <uni-icons type="left" size="24"></uni-icons>
</view>
</template>
- <template v-slot:right>
+ <!-- <template v-slot:right>
<view v-if="sceneList.length > 0 && !mapOperationType">
<a @click="clickMore">
<uni-icons class="uni-panel-bar-icon" type="more-filled" size="24"></uni-icons>
</a>
</view>
- </template>
+ </template> -->
</uni-nav-bar>
<view class="no-content" v-if="unlinked">
- <image class="img" src="/images/image 25.png" alt=" 鍥剧墖" mode="aspectFit" />
+ <image class="img" src="/images/image_25.png" alt=" 鍥剧墖" mode="aspectFit" />
<view class="title">杞﹁締杩炴帴澶辫触</view>
<view class="space">璇锋鏌ヤ綘鐨勭綉缁滆缃垨閲嶆柊鍔犺浇</view>
</view>
@@ -89,7 +89,7 @@
<view class="tip">璇疯緭鍏ュ満鏅悕绉�/view>
<view class="name-input">
<input ref="refInputName" :focus="true" placeholder="璇疯緭鍏ュ満鏅悕绉� :value="sceneInputName"
- @input="onInputName"></input>
+ @input="onInputName" />
<uni-icons class="clear" color="#ccc" type="clear" size="20" v-if="sceneInputName"
@click="clickClearName"></uni-icons>
</view>
@@ -108,14 +108,14 @@
<view class="coordinate">
<text class="name">妯潗鏍�</text>
<input ref="refInputX" class="number-input" type="number" :value="stationEdit.x"
- @input="onInputStationX" :maxlength="4"></input>
+ @input="onInputStationX" :maxlength="4" />
<uni-icons class="clear" color="#ccc" type="clear" size="20"
v-if="stationEdit.x && stationEdit.x!='0'" @click="clickClearStationX"></uni-icons>
</view>
<view class="coordinate">
<text class="name">绔栧潗鏍�</text>
<input ref="refInputX" class="number-input" type="number" :value="stationEdit.y"
- @input="onInputStationY" :maxlength="4"></input>
+ @input="onInputStationY" :maxlength="4" />
<uni-icons class="clear" color="#ccc" type="clear" size="20"
v-if="stationEdit.y&& stationEdit.y!='0'" @click="clickClearStationY"></uni-icons>
</view>
@@ -124,7 +124,7 @@
<view class="tip">璋冭妭鏈濆悜</view>
<view class="angle-group">
<image class="img-angle" :src="angleSvg" alt="SVG 鍥剧墖" />
- <image class="img-angle-pos" src="/images/Frame 153.svg" alt="SVG 鍥剧墖"
+ <image class="img-angle-pos" src="/images/Frame_153.svg" alt="SVG 鍥剧墖"
@touchstart="handleAngleTouchStart" @touchmove="handleAngleTouchMove" />
</view>
</view>
@@ -132,7 +132,7 @@
<view class="tip">璇疯緭鍏ョ珯鐐瑰悕绉�/view>
<view class="name-input">
<input ref="refInputName" :focus="true" placeholder="杈撳叆绔欑偣鍚嶇О" :value="stationEdit.name"
- @input="onInputStationName"></input>
+ @input="onInputStationName" />
<uni-icons class="clear" color="#ccc" type="clear" size="20" v-if="stationEdit.name"
@click="clickClearStationName"></uni-icons>
</view>
@@ -211,8 +211,8 @@
<view class="bottom-content" v-if="mapOperationStatus =='teaching'">
<view class="tip">璺緞璁板綍涓�..</view>
<view v-if="mapOperationType =='public_teaching'">
- <view>姝e湪璁板綍鎼繍杞﹁杩涜矾寰勶紝鍙殢鏃跺垏鎹富璺�鏀矾绀烘暀锛屽畬鎴愬悗鐐规寜閽互缁撴潫绀烘暀銆傚湪绀烘暀杩囩▼涓彲浠ユ坊鍔犵珯鐐广�</view>
- <view class="switch-type">
+ <view>姝e湪璁板綍鎼繍杞﹁杩涜矾寰勶紝瀹屾垚鍚庣偣鎸夐挳浠ョ粨鏉熺ず鏁欍�鍦ㄧず鏁欒繃绋嬩腑鍙互娣诲姞绔欑偣銆�/view>
+ <!-- <view class="switch-type">鍙殢鏃跺垏鎹富璺�鏀矾绀烘暀锛� <view class="switch-button-group">
<view class="switch-button"
:class="teachingModeCur.main_road ==1?'switch-button-checked':''"
@@ -221,7 +221,7 @@
:class="teachingModeCur.main_road ==0?'switch-button-checked':''"
@click="onTeachingModeMainRoad(0)">鏀矾绀烘暀</view>
</view>
- </view>
+ </view> -->
</view>
<view v-else>
@@ -347,7 +347,7 @@
<view class="img-button-group">
<view fill="none" class="button" @click.stop="clickStationDelete">
<text class="ico delete-outline"></text>
- <view class="text"> 鍒犻櫎绔欑偣</view>
+ <view class="text"> 鎵归噺鍒犻櫎</view>
</view>
<view type="text" class="button" @click.stop="clickStationPostion">
<text class="ico edit-line"></text>
@@ -475,7 +475,8 @@
wallList: [],
regionList: [],
unlinked: false,
- showTeachingPathFlag: false,
+ showTeachingPathFlag: true,
+ curTeachingPathFlag: false,
curMapInfo: {
proportion: 1,
img_proportion: 1,
@@ -556,7 +557,7 @@
},
onBackPress() {
- this.isPageVisible = false
+ this.isPageVisible = false
if (this.destroyFlag)
return false
else {
@@ -597,6 +598,10 @@
this.mapOperationType = ''
const scene = this.sceneList[0]
this.changeMap(scene)
+ } else {
+ uni.navigateBack({
+ delta: 1, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉
+ })
}
this.refreshAgvPosition()
} catch (ex) {
@@ -751,19 +756,26 @@
showModal("宸茶褰曠殑璺緞灏嗕細琚垹闄ゃ�", "鏄惁瑕侀�鍑虹ず鏁欙紵").then(async (res) => {
if (res) {
+ const listDataStr = []
if (this.mapOperationStatus == 'end' || this.mapOperationStatus ==
'save') {
try {
await delTeachingMode(this.vehicleIp, [this.teachingModeCur])
+ listDataStr.push({
+ method: "remove_teaching_path",
+ param: {
+ name: this.teachingModeCur.name,
+ mode: "Public"
+ },
+ })
} catch (ex) {
showError(ex)
}
-
}
- this.ctxDataStr = JSON.stringify([{
+ listDataStr.push({
method: "teaching_finish",
- }])
-
+ })
+ this.ctxDataStr = JSON.stringify(listDataStr)
this.mapOperationType = ""
}
})
@@ -776,11 +788,7 @@
}
} else {
- // const eventChannel = this.getOpenerEventChannel();
- // eventChannel.emit('udapte_station', this.unlinked);
- // uni.navigateBack({
- // delta: 1
- // })
+
const eventChannel = this.getOpenerEventChannel();
eventChannel.emit('check_connect', !this.unlinked);
uni.navigateBack({
@@ -815,7 +823,7 @@
// this.mapOperationType = 'scene_create'
// this.opSceneType = 'add_name'
uni.navigateTo({
- url: `/pages/map/scene?ip=${_this.vehicleIp}`,
+ url: `/pages/map/scene?ip=${_this.vehicleIp}&opType=create`,
events: {
// 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�鍒板綋鍓嶉〉闈㈢殑鏁版嵁
create_finish: function(data) {
@@ -831,15 +839,13 @@
this.clickDelete()
}
}
-
-
},
async loadAgvState() {
try {
const info = await getAgvState(this.vehicleIp)
return info
} catch (ex) {
- showError(ex)
+ showToast(ex)
return {}
}
},
@@ -848,7 +854,7 @@
const paths = await getCurrentTeachingData(this.vehicleIp) || []
return paths
} catch (ex) {
- showError(ex)
+ showToast(ex)
return []
}
},
@@ -913,7 +919,6 @@
img_x: parseInt(infoMap.img_x) || 1,
img_y: parseInt(infoMap.img_y) || 1
}
- // getApp().globalData.curScene = infoMap
this.setData({
bgProgressPercent: 30,
bgLoading: infoMap.filedata ? true : false
@@ -936,6 +941,12 @@
{
method: "add_station",
param: stationLst
+ },
+ {
+ method: "show_teaching_path",
+ param: {
+ show: this.showTeachingPathFlag
+ }
},
{
method: "public_teaching_path",
@@ -1017,6 +1028,9 @@
width: param.view?.width || 0,
height: param.view?.height || 0,
}
+ const angle = this.getStantardAngle(this.stationEdit.angle * 180 / Math.PI)
+
+ this.angleSvg = `/static/images/angle${angle}.svg`
this.mapOperationType = ""
this.$refs.refPopupOperateStation.open("bottom")
@@ -1043,6 +1057,9 @@
const angle = this.getStantardAngle(this.stationEdit.angle * 180 / Math.PI)
this.angleSvg = `/static/images/angle${angle}.svg`
+ if (this.mapOperationType == "teaching_add_station") {
+ this.positioningAgv = true
+ }
this.clickStationPositonOk()
} else if (param.type == "edit_teaching") {
// console.log(param.type,JSON.stringify(param.data))
@@ -1090,7 +1107,7 @@
this.stationEdit.stationID = ""
this.mapOperationType = "public_teaching"
this.mapOperationStatus = "teaching"
-
+ this.positioningAgv = true
} else if (this.mapOperationType == "edit_station") {
this.mapOperationType = ""
this.mapOperationStatus = ""
@@ -1112,12 +1129,10 @@
param: true
}])
}
-
}
} else if (param.method == "select_teaching_path") {
console.log("point", param.point)
if (param.type == "station") {
-
this.selectTeachingMode = {
mode: "Stations",
name: param.data?.name || "",
@@ -1132,17 +1147,18 @@
point: param.point
}
}
-
this.$refs.refPopupOperateTeaching.open("bottom")
} else if (param.method == "cancel_positioning_agv") {
- this.positioningAgv = false
+ if (this.mapOperationType == "public_teaching"
+ && this.mapOperationStatus == "teaching") {
+ this.positioningAgv = true
+ } else
+ this.positioningAgv = false
} else if (param.method == "show_log") {
const listLog = session.getValue("request_log") || []
listLog.unshift(param.data)
session.setValue("request_log", listLog)
}
-
-
},
clickMapStation() {
this.stationEdit = {
@@ -1214,9 +1230,7 @@
async loadSceneList() {
try {
- uni.showLoading({
- title: "鍔犺浇鍦烘櫙涓�
- })
+
const _this = this
const res = await getAllScene(this.vehicleIp) || []
const list = res?.sceneList || []
@@ -1232,25 +1246,27 @@
// sceneId: "",
// navigationBarTitle: "鍦板浘"
// })
- uni.navigateTo({
- url: `/pages/map/scene?ip=${this.vehicleIp}&opType=create`,
- events: {
- // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�鍒板綋鍓嶉〉闈㈢殑鏁版嵁
- create_finish: function(data) {
- _this.onCreateSceneOk(data)
- },
- }
+ // uni.navigateTo({
+ // url: `/pages/map/scene?ip=${this.vehicleIp}`,
+ // events: {
+ // // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�鍒板綋鍓嶉〉闈㈢殑鏁版嵁
+ // create_finish: function(data) {
+ // _this.onCreateSceneOk(data)
+ // },
+ // }
+ // })
+ uni.navigateBack({
+ delta: 1, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉
})
return
}
} catch (ex) {
showError(ex)
- } finally {
- uni.hideLoading()
- }
+ }
},
clickDelete() {
+ const _this = this
showModal(`鍒犻櫎鍦烘櫙[${this.sceneId}]浼氭妸鍦烘櫙瀵瑰簲鐨勫湴鍥句换鍔′俊鎭兘浼氬垹闄わ紝鏄惁纭鍒犻櫎锛焋, "鍒犻櫎鍦烘櫙").then(async (res) => {
if (res) {
try {
@@ -1262,6 +1278,15 @@
await this.loadSceneList()
if (this.sceneList.length > 0)
this.changeMap(this.sceneList[0])
+ // else {
+ // _this.mapOperationType = ""
+ // setTimeout(() => {
+ // uni.navigateBack({
+ // delta: 1, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉
+ // })
+ // }, 500)
+
+ // }
} catch (ex) {
showError(ex)
} finally {
@@ -1431,14 +1456,23 @@
showToast("鍦烘櫙鍚嶇О涓嶈兘涓虹┖锛�)
return
}
- console.log(name, this.sceneId)
+ // console.log(name, this.sceneId)
if (name == this.sceneId) {
showToast("鍦烘櫙鍚嶇О鏈彉鍖栵紒")
return
}
+ const curIndex = this.sceneList.findIndex((param) => param == this.sceneId)
this.mapOperationType = ""
await updateScene(this.vehicleIp, this.sceneId, name)
+
+
this.sceneId = name
+ if (curIndex > -1) {
+ this.sceneList[curIndex] = name
+ }
+ this.setData({
+ navigationBarTitle: name
+ })
showToast("鍦烘櫙閲嶅懡鍚嶆垚鍔燂紒")
} catch (ex) {
this.mapOperationType = "edit_scene_name"
@@ -1471,7 +1505,27 @@
this.mapOperationType = ""
},
clickStationDelete() {
- this.stationDelete(this.stationEdit)
+ const _this = this
+ uni.navigateTo({
+ url: `/pages/station/delete?ip=${ this.vehicleIp}`,
+ events: {
+ // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�鍒板綋鍓嶉〉闈㈢殑鏁版嵁
+ delete_finish: function(data) {
+ console.log(data)
+ const list = data.map((a) => {
+ return {
+ stationID: a
+ }
+
+ })
+ _this.ctxDataStr = JSON.stringify([{
+ method: "remove_station",
+ param: list
+ }])
+ }
+ }
+ })
+ //this.stationDelete(this.stationEdit)
// const _this = this
// showModal("璇ョ珯鐐瑰凡缁戝畾浠诲姟锛屽垹闄ょ珯鐐瑰悗缁戝畾鐨勪换鍔′細鍋滄骞跺垹闄�, "鏄惁纭鍒犻櫎锛�).then((res) => {
// if (res) {
@@ -1770,10 +1824,8 @@
return resAngle
},
-
touchAngleChange(e) {
let angle = 0
-
const ptX = e.touches[0].clientX
const offX = ptX // ptX - e.target.offsetLeft
@@ -1911,12 +1963,7 @@
show: this.showTeachingPathFlag
}
}
- // , {
- // method: "show_teaching_path",
- // param: {
- // show: this.showTeachingPathFlag
- // }
- // }
+
]
if (finish) {
list.push({
@@ -1979,40 +2026,110 @@
method: "update_agv_state",
param: agv
}]
+ // if (this.mapOperationType === "public_teaching" && this.mapOperationStatus ===
+ // "teaching") {
+ const list = await this.loadCurrentTeachingData()
- if (this.mapOperationType === "public_teaching" && this.mapOperationStatus ===
- "teaching") {
- const list = await this.loadCurrentTeachingData()
- listCtrData.push({
- method: "update_current_teaching",
- param: {
- main_road: this.teachingModeCur.main_road,
- pos_list: list
+ listCtrData.push({
+ method: "update_current_teaching",
+ param: {
+ main_road: 1, //this.teachingModeCur.main_road,
+ pos_list: list
+ }
+ })
+ if (list.length > 0) {
+ this.curTeachingPathFlag = true
+ } else {
+ if (this.curTeachingPathFlag) {
+ this.curTeachingPathFlag = false
+ const teaching = await this.loadTeachingMode()
+
+ const publicOld = this.teachingMode.Public || []
+ const stationOld = this.teachingMode.Stations || []
+ const publicNew = teaching.Public || []
+ const stationNew = teaching.Stations || []
+ const publicAdd = []
+ const stationAdd = []
+ for (let i in publicNew) {
+ const item = publicNew[i]
+ const curIndex = publicOld.findIndex((a) => a.name == item.name)
+ console.log(curIndex, item)
+ if (curIndex < 0) {
+ publicAdd.push(item)
+ publicOld.push(item)
+ }
+
}
- })
+ for (let i in stationNew) {
+ const item = stationNew[i]
+ const curIndex = stationOld.findIndex((a) => a.name == item.name)
+ if (curIndex < 0) {
+ stationAdd.push(item)
+ stationOld.push(item)
+ }
+
+ }
+ this.teachingMode.Public = publicOld
+ this.teachingMode.Stations = stationOld
+
+ if (publicAdd.length > 0) {
+ listCtrData.push({
+ method: "public_teaching_path",
+ param: {
+ list: publicAdd,
+ show: this.showTeachingPathFlag
+ }
+ })
+ }
+ if (stationAdd.length > 0) {
+ listCtrData.push({
+ method: "station_teaching_path",
+ param: {
+ list: stationAdd,
+ show: this.showTeachingPathFlag
+ }
+ })
+ }
+ }
}
+
+ // }
+
if (this.positioningAgv) {
- listCtrData.push({
- method: "move_pt_visible",
- param: {
- x: agv.x,
- y: agv.y,
- width: 80,
- height: 80,
- }
- })
+ if (this.curTeachingPathFlag) {
+ listCtrData.push({
+ method: "move_pt_center",
+ param: {
+ x: agv.x,
+ y: agv.y,
+ }
+ })
+ } else {
+ listCtrData.push({
+ method: "move_pt_visible",
+ param: {
+ x: agv.x,
+ y: agv.y,
+ width: 80,
+ height: 80,
+ }
+ })
+
+ }
}
+
this.ctxDataStr = JSON.stringify(listCtrData)
}
- setTimeout(this.refreshAgvPosition, 1000);
+ //setTimeout(this.refreshAgvPosition, 1000);
} catch (ex) {
- showError(ex).then((res) => {
- setTimeout(this.refreshAgvPosition, 1000);
- })
+ // showError(ex).then((res) => {
+
+ // })
+ showToast(ex)
} finally {
// 鏃犺鎴愬姛澶辫触锛� 绉掑悗鍐嶆潵
-
+ setTimeout(this.refreshAgvPosition, 1000);
}
},
@@ -2044,7 +2161,6 @@
uni.hideLoading()
}
},
-
async clickTeachingStart() {
const _this = this
@@ -2082,6 +2198,16 @@
this.loading = true
await delTeachingMode(_this.vehicleIp, [_this.teachingModeCur])
_this.mapOperationStatus = ""
+ const listDataStr = []
+ listDataStr.push({
+ method: "remove_teaching_path",
+ param: {
+ name: _this.teachingModeCur.name,
+ mode: "Public"
+ },
+ })
+ _this.ctxDataStr = JSON.stringify(listDataStr)
+
} catch (ex) {
showError(ex)
@@ -2090,8 +2216,7 @@
}
} else {
- _this.mapOperationStatus =
- "save"
+ _this.mapOperationStatus = "save"
}
})
@@ -2108,7 +2233,7 @@
clickTeachingFinish() {
this.mapOperationType = ""
- this.reloadTeachingMode(true)
+ //this.reloadTeachingMode(true)
},
async teachingStart(mode) {
@@ -2267,7 +2392,7 @@
async removeTeachingMode(item) {
try {
uni.showLoading({
- title: "鍒犻櫎鍦烘櫙涓�
+ title: "鍒犻櫎绀烘暀涓�
})
await delTeachingMode(this.vehicleIp, [item])
this.ctxDataStr =
@@ -2286,7 +2411,7 @@
async removeTeachingModeData(data) {
try {
uni.showLoading({
- title: "鍒犻櫎鍦烘櫙鏁版嵁涓�
+ title: "鍒犻櫎绀烘暀鏁版嵁涓�
})
await delTeachingModeData(this.vehicleIp, data)
this.reloadTeachingMode()
diff --git a/pages/map/infos/scene-create.vue b/pages/map/infos/scene-create.vue
index 3aa1b1b..629e98a 100644
--- a/pages/map/infos/scene-create.vue
+++ b/pages/map/infos/scene-create.vue
@@ -1,7 +1,7 @@
<template>
<view class="pages-map-scene-create">
<view class="scene-content" v-if="opSceneType =='' ">
- <image class="img" src="/images/image 25.png" alt=" 鍥剧墖" mode="aspectFit" />
+ <image class="img" src="/images/image_25.png" alt=" 鍥剧墖" mode="aspectFit" />
<view class="space">娌℃湁鎵惧埌绗﹀悎鏉′欢鐨勫湴鍥�/view>
<view class="text-button-group">
<a-button type="primary" class="button" @click="clickStartConstructScene">
@@ -18,7 +18,7 @@
<view class="tip">璇疯緭鍏ュ満鏅悕绉�/view>
<view class="name-input">
<input ref="refInputName" :focus="true" placeholder="璇疯緭鍏ュ満鏅悕绉� :value="sceneName"
- @input="onInputName"></input>
+ @input="onInputName"/>
<uni-icons class="clear" color="#ccc" type="clear" size="20" v-if="showClearName"
@click="clickClearName"></uni-icons>
</view>
diff --git a/pages/map/js/ctx.js b/pages/map/js/ctx.js
index 16814c0..9af2077 100644
--- a/pages/map/js/ctx.js
+++ b/pages/map/js/ctx.js
@@ -468,12 +468,18 @@
cantainerEl.addEventListener('touchend', function(e) {
// _this.canvas._onMouseUp(e);
- // console.log('touchend:');
+
e.preventDefault(); // 闃绘榛樿琛屼负
_this.touchPoint = {
x: 0,
y: 0
};
+ if (_this.pressObjTimer) {
+
+ clearTimeout(_this.pressObjTimer);
+ _this.pressObjTimer = null
+
+ }
const activeObj = _this.canvas.getActiveObject()
if (!activeObj) {
// 澶勭悊缁撴潫浜嬩欢
@@ -488,16 +494,13 @@
// _this.canvas.discardActiveObject();
// }
}
- if (this.pressObjTimer) {
- clearTimeout(this.pressObjTimer);
- this.pressObjTimer = null
- }
+
});
cantainerEl.addEventListener('touchcancel', function(e) {
// console.log('touchcancel:');
- if (this.pressObjTimer) {
- clearTimeout(this.pressObjTimer);
- this.pressObjTimer = null
+ if (_this.pressObjTimer) {
+ clearTimeout(_this.pressObjTimer);
+ _this.pressObjTimer = null
}
})
@@ -522,6 +525,7 @@
const list = _this.canvas.getActiveObjects()
if (list.length === 1) {
if (!_this.objEditing) {
+
this.pressObjTimer = setTimeout(function() {
const zoom = _this.canvas.getZoom();
@@ -569,6 +573,7 @@
});
}
}, 1000); //
+
}
let activeObj = list[0]
if (activeObj.eleType == "region_pt_add") {
@@ -812,7 +817,10 @@
if (obj instanceof fabric.Path || obj instanceof fabric.Line) {
if (this.isPointOnStroke(obj, pointer, 1)) {
if (objActive != obj) {
-
+ if (this.pressObjTimer) {
+ clearTimeout(this.pressObjTimer);
+ this.pressObjTimer = null
+ }
this.canvas.discardActiveObject()
this.canvas.setActiveObject(obj);
this.canvas.requestRenderAll();
@@ -822,7 +830,10 @@
pointerList2.unshift(obj)
} else {
if (objActive != obj) {
-
+ if (this.pressObjTimer) {
+ clearTimeout(this.pressObjTimer);
+ this.pressObjTimer = null
+ }
this.canvas.discardActiveObject()
this.canvas.setActiveObject(obj);
this.canvas.requestRenderAll();
@@ -835,7 +846,10 @@
if (pointerList2.length == 1) {
const obj = pointerList2[0];
if (objActive != obj) {
-
+ if (this.pressObjTimer) {
+ clearTimeout(this.pressObjTimer);
+ this.pressObjTimer = null
+ }
this.canvas.discardActiveObject()
this.canvas.setActiveObject(obj);
this.canvas.requestRenderAll();
@@ -848,7 +862,10 @@
const obj = pointerList[i];
if (this.isPointOnStroke(obj, pointer, 2)) {
if (objActive != obj) {
-
+ if (this.pressObjTimer) {
+ clearTimeout(this.pressObjTimer);
+ this.pressObjTimer = null
+ }
this.canvas.discardActiveObject()
this.canvas.setActiveObject(obj);
this.canvas.requestRenderAll();
@@ -862,7 +879,10 @@
if (pointerList2.length == 1) {
const obj = pointerList2[0];
if (objActive != obj) {
-
+ if (this.pressObjTimer) {
+ clearTimeout(this.pressObjTimer);
+ this.pressObjTimer = null
+ }
this.canvas.discardActiveObject()
this.canvas.setActiveObject(obj);
this.canvas.requestRenderAll();
@@ -875,7 +895,10 @@
const obj = pointerList[i];
if (this.isPointOnStroke(obj, pointer, 3)) {
if (objActive != obj) {
-
+ if (this.pressObjTimer) {
+ clearTimeout(this.pressObjTimer);
+ this.pressObjTimer = null
+ }
this.canvas.discardActiveObject()
this.canvas.setActiveObject(obj);
this.canvas.requestRenderAll();
@@ -889,7 +912,10 @@
if (pointerList2.length == 1) {
const obj = pointerList2[0];
if (objActive != obj) {
-
+ if (this.pressObjTimer) {
+ clearTimeout(this.pressObjTimer);
+ this.pressObjTimer = null
+ }
this.canvas.discardActiveObject()
this.canvas.setActiveObject(obj);
this.canvas.requestRenderAll();
@@ -902,7 +928,10 @@
const obj = pointerList[i];
if (this.isPointOnStroke(obj, pointer, 4)) {
if (objActive != obj) {
-
+ if (this.pressObjTimer) {
+ clearTimeout(this.pressObjTimer);
+ this.pressObjTimer = null
+ }
this.canvas.discardActiveObject()
this.canvas.setActiveObject(obj);
this.canvas.requestRenderAll();
@@ -916,7 +945,10 @@
const obj = pointerList2[pointerList2.length - 1];
if (objActive != obj) {
-
+ if (this.pressObjTimer) {
+ clearTimeout(this.pressObjTimer);
+ this.pressObjTimer = null
+ }
this.canvas.discardActiveObject()
this.canvas.setActiveObject(obj);
this.canvas.requestRenderAll();
@@ -1202,7 +1234,7 @@
_this.$ownerInstance.callMethod('receiveRenderData', {
method: "set_backgroud_progress",
type: "error",
- msg:err
+ msg: err
});
console.error("鍥剧墖鍔犺浇澶辫触", err)
reject(new Error('鍥剧墖鍔犺浇澶辫触'));
@@ -1370,6 +1402,8 @@
// _this.canvas.renderAll()
_this.workSpace = wsGroup
+ const scale = _this.eleWidth / (4 * 84)
+ _this.setZoomAuto(scale); //
}
//_this.checkMemoryUsage()
resolve()
@@ -1391,7 +1425,7 @@
strokeLineCap: 'butt',
fill: "rgba(255,255,255,0)",
})
- let wsGroup = new fabric.Group([ rect], {
+ let wsGroup = new fabric.Group([rect], {
id: "workspace",
eleType: "workspace",
selectable: false,
@@ -1400,11 +1434,13 @@
top: 0,
width: _this.mapInfo.img_x,
height: _this.mapInfo.img_y,
-
+
});
_this.clearObjects()
_this.canvas.add(wsGroup)
_this.workSpace = wsGroup
+ const scale = _this.eleWidth / (4 * 84)
+ _this.setZoomAuto(scale); //
resolve()
})
@@ -1539,11 +1575,13 @@
clearTimeout(this.pressObjTimer);
this.pressObjTimer = null
}
+
+ }
+ if (Math.abs(deltaX) > 20 || Math.abs(deltaY) > 20) {
this.$ownerInstance.callMethod('receiveRenderData', {
method: "cancel_positioning_agv",
});
}
-
// 绉诲姩瑙嗗彛
const vpt = this.canvas.viewportTransform;
this.canvas.relativePan(new fabric.Point(deltaX, deltaY));
@@ -1773,9 +1811,7 @@
}
//console.log(scale, scaleAuto)
this.setZoomAuto(scale, center)
- this.$ownerInstance.callMethod('receiveRenderData', {
- method: "cancel_positioning_agv",
- });
+
// console.log('澶氱偣绉诲姩 - 璺濈:', distance, '瑙掑害:', angle);
// 澶氱偣绉诲姩閫昏緫
},
@@ -1886,7 +1922,7 @@
const left = _this.getXOnImg(info.x) // * scale
const top = _this.getYOnImg(info.y) //* scale
- const angle = info.angle * 180 / Math.PI
+ const angle = -(info.angle * 180 / Math.PI)
fabric.loadSVGFromURL(svg).then(
({
objects,
@@ -2018,7 +2054,8 @@
this.canvas.remove(this.curTeachingObj)
this.curTeachingObj = null
}
-
+ if (teachingData.lenght === 0)
+ return
posArr.forEach((item) => {
const curIndex = pos_list.findIndex((item2) => item2.x === item.x && item2.y === item.y)
if (curIndex < 0) {
@@ -2042,40 +2079,41 @@
y: this.getYOnImg(pt.y)
}
if (index > 0) {
- if ((index % 50 == 0 || index == len - 1 || index % 50 == 1)) {
- if (index % 50 == 0 || index == len - 1) {
- toX = pt2.x
- toY = pt2.y
- path2 += ` L${pt2.x} ${pt2.y}`
+ // if ((index % 50 == 0 || index == len - 1 || index % 50 == 1)) {
+ // if (index % 50 == 0 || index == len - 1) {
+ // toX = pt2.x
+ // toY = pt2.y
+ // path2 += ` L${pt2.x} ${pt2.y}`
- // 璁$畻鍚勮搴﹀拰瀵瑰簲鐨凱2,P3鍧愭爣
- let angle = (Math.atan2(fromY - toY, fromX - toX) * 180) / Math.PI,
- angle1 = ((angle + theta) * Math.PI) / 180,
- angle2 = ((angle - theta) * Math.PI) / 180,
- topX = headlen * Math.cos(angle1),
- topY = headlen * Math.sin(angle1),
- botX = headlen * Math.cos(angle2),
- botY = headlen * Math.sin(angle2);
- let arrowX = fromX - topX,
- arrowY = fromY - topY;
- arrowX = toX + topX;
- arrowY = toY + topY;
- path2 += " L " + arrowX + " " + arrowY;
- arrowX = toX + botX;
- arrowY = toY + botY;
- path2 += " M " + arrowX + " " + arrowY;
- path2 += " L " + toX + " " + toY;
- }
- } else {
- path2 += ` L${pt2.x} ${pt2.y}`
- }
+ // // 璁$畻鍚勮搴﹀拰瀵瑰簲鐨凱2,P3鍧愭爣
+ // let angle = (Math.atan2(fromY - toY, fromX - toX) * 180) / Math.PI,
+ // angle1 = ((angle + theta) * Math.PI) / 180,
+ // angle2 = ((angle - theta) * Math.PI) / 180,
+ // topX = headlen * Math.cos(angle1),
+ // topY = headlen * Math.sin(angle1),
+ // botX = headlen * Math.cos(angle2),
+ // botY = headlen * Math.sin(angle2);
+ // let arrowX = fromX - topX,
+ // arrowY = fromY - topY;
+ // arrowX = toX + topX;
+ // arrowY = toY + topY;
+ // path2 += " L " + arrowX + " " + arrowY;
+ // arrowX = toX + botX;
+ // arrowY = toY + botY;
+ // path2 += " M " + arrowX + " " + arrowY;
+ // path2 += " L " + toX + " " + toY;
+ // }
+ // } else {
+ // path2 += ` L${pt2.x} ${pt2.y}`
+ // }
+ path2 += ` L${pt2.x} ${pt2.y}`
} else {
path2 = `M${pt2.x} ${pt2.y}`
}
fromX = pt2.x
fromY = pt2.y
}
- let strokeWidth = 1
+ let strokeWidth = 5
let stroke = "#95DE64"
if (main_road == 1) {
@@ -2132,72 +2170,73 @@
y: this.getYOnImg(pt.y)
}
if (index > 0) {
- if ((type == "public_teaching") && (index % 50 == 0 || index == len - 1 || index % 50 == 1)) {
- if (index % 50 == 1 || index == len - 1) {
- if (teachingData.bidirection == 1 && index < len - 1) { //- 1
- toY = fromY
- toX = fromX
- fromX = pt2.x
- fromY = pt2.y
- let angle = (Math.atan2(fromY - toY, fromX - toX) * 180) / Math.PI,
- angle1 = ((angle + theta) * Math.PI) / 180,
- angle2 = ((angle - theta) * Math.PI) / 180,
- topX = headlen * Math.cos(angle1),
- topY = headlen * Math.sin(angle1),
- botX = headlen * Math.cos(angle2),
- botY = headlen * Math.sin(angle2);
- let arrowX = fromX - topX,
- arrowY = fromY - topY;
- arrowX = toX + topX;
- arrowY = toY + topY;
- let path3 = " L " + arrowX + " " + arrowY;
- arrowX = toX + botX;
- arrowY = toY + botY;
- path3 += " M " + arrowX + " " + arrowY;
- path3 += " L " + toX + " " + toY;
+ // if ((type == "public_teaching") && (index % 50 == 0 || index == len - 1 || index % 50 == 1)) {
+ // if (index % 50 == 1 || index == len - 1) {
+ // if (teachingData.bidirection == 1 && index < len - 1) { //- 1
+ // toY = fromY
+ // toX = fromX
+ // fromX = pt2.x
+ // fromY = pt2.y
+ // let angle = (Math.atan2(fromY - toY, fromX - toX) * 180) / Math.PI,
+ // angle1 = ((angle + theta) * Math.PI) / 180,
+ // angle2 = ((angle - theta) * Math.PI) / 180,
+ // topX = headlen * Math.cos(angle1),
+ // topY = headlen * Math.sin(angle1),
+ // botX = headlen * Math.cos(angle2),
+ // botY = headlen * Math.sin(angle2);
+ // let arrowX = fromX - topX,
+ // arrowY = fromY - topY;
+ // arrowX = toX + topX;
+ // arrowY = toY + topY;
+ // let path3 = " L " + arrowX + " " + arrowY;
+ // arrowX = toX + botX;
+ // arrowY = toY + botY;
+ // path3 += " M " + arrowX + " " + arrowY;
+ // path3 += " L " + toX + " " + toY;
- path2 += path3
- fromY = toY
- fromX = toX
- }
- }
- if (index % 50 == 0 || index == len - 1) {
- toX = pt2.x
- toY = pt2.y
- // if (fromX == toX && fromY == toY) {
- // if (index - 2 >= 0) {
- // const pt3 = pos_list[index - 2]
- // fromX = this.getXOnImg(pt3.x),
- // fromY = this.getYOnImg(pt3.y)
- // } else {
- // continue;
- // }
- // }
- path2 += ` L${pt2.x} ${pt2.y}`
+ // path2 += path3
+ // fromY = toY
+ // fromX = toX
+ // }
+ // }
+ // if (index % 50 == 0 || index == len - 1) {
+ // toX = pt2.x
+ // toY = pt2.y
+ // // if (fromX == toX && fromY == toY) {
+ // // if (index - 2 >= 0) {
+ // // const pt3 = pos_list[index - 2]
+ // // fromX = this.getXOnImg(pt3.x),
+ // // fromY = this.getYOnImg(pt3.y)
+ // // } else {
+ // // continue;
+ // // }
+ // // }
+ // path2 += ` L${pt2.x} ${pt2.y}`
- // 璁$畻鍚勮搴﹀拰瀵瑰簲鐨凱2,P3鍧愭爣
- let angle = (Math.atan2(fromY - toY, fromX - toX) * 180) / Math.PI,
- angle1 = ((angle + theta) * Math.PI) / 180,
- angle2 = ((angle - theta) * Math.PI) / 180,
- topX = headlen * Math.cos(angle1),
- topY = headlen * Math.sin(angle1),
- botX = headlen * Math.cos(angle2),
- botY = headlen * Math.sin(angle2);
- let arrowX = fromX - topX,
- arrowY = fromY - topY;
- arrowX = toX + topX;
- arrowY = toY + topY;
- path2 += " L " + arrowX + " " + arrowY;
- arrowX = toX + botX;
- arrowY = toY + botY;
- path2 += " M " + arrowX + " " + arrowY;
- path2 += " L " + toX + " " + toY;
- }
- // console.log(`绠ご L${pt2.x} ${pt2.y}`)
- } else {
- // console.log(`鐐�L${pt2.x} ${pt2.y} ${index} == ${len-1}`)
- path2 += ` L${pt2.x} ${pt2.y}`
- }
+ // // 璁$畻鍚勮搴﹀拰瀵瑰簲鐨凱2,P3鍧愭爣
+ // let angle = (Math.atan2(fromY - toY, fromX - toX) * 180) / Math.PI,
+ // angle1 = ((angle + theta) * Math.PI) / 180,
+ // angle2 = ((angle - theta) * Math.PI) / 180,
+ // topX = headlen * Math.cos(angle1),
+ // topY = headlen * Math.sin(angle1),
+ // botX = headlen * Math.cos(angle2),
+ // botY = headlen * Math.sin(angle2);
+ // let arrowX = fromX - topX,
+ // arrowY = fromY - topY;
+ // arrowX = toX + topX;
+ // arrowY = toY + topY;
+ // path2 += " L " + arrowX + " " + arrowY;
+ // arrowX = toX + botX;
+ // arrowY = toY + botY;
+ // path2 += " M " + arrowX + " " + arrowY;
+ // path2 += " L " + toX + " " + toY;
+ // }
+ // // console.log(`绠ご L${pt2.x} ${pt2.y}`)
+ // } else {
+ // // console.log(`鐐�L${pt2.x} ${pt2.y} ${index} == ${len-1}`)
+ // path2 += ` L${pt2.x} ${pt2.y}`
+ // }
+ path2 += ` L${pt2.x} ${pt2.y}`
} else {
main_road = pt.main_road
if (main_road == 1) {
@@ -2213,13 +2252,20 @@
// console.log("addTeachingPath",path2)
// path2 += " Z"
- let strokeWidth = 1
+ let strokeWidth = 2
let stroke = "#95DE64"
if (type == "station_teaching") {
stroke = "#69C0FF"
} else {
if (main_road == 1) {
stroke = "#69C0FF"
+ if (teachingData.bidirection == 1) {
+ stroke = "#FF00FF"
+ }
+ } else {
+ if (teachingData.bidirection == 1) {
+ stroke = "#ffaa00"
+ }
}
}
let list = this.canvas.getObjects() || []
@@ -2461,7 +2507,7 @@
// const scale = this.getAutoScale()
const left = _this.getXOnImg(info.x) // * scale
const top = _this.getYOnImg(info.y) //* scale
- const angle = info.angle * 180 / Math.PI
+ const angle = -(info.angle * 180 / Math.PI) + 90
if (obj) {
obj.set({
left,
@@ -3028,7 +3074,7 @@
this.canvas.remove(obj)
},
updateAgvLaser(param) {
- const angle = param.angle - Math.PI / 2 // * 180 / Math.PI
+ const angle = -param.angle //- Math.PI / 2 // * 180 / Math.PI
const pt = {
x: this.getXOnImg(param.x),
y: this.getYOnImg(param.y)
@@ -3066,7 +3112,7 @@
id: "agv_laser_angle",
eleType: "agv_laser_angle",
stroke: "#00aa00",
- strokeWidth: 2,
+ strokeWidth: 1,
lockRotation: true,
lockScalingX: true,
lockScalingY: true,
@@ -3325,7 +3371,7 @@
} else {
// _this.canvas.remove(list[curIndex])
const curStationObj = list[curIndex]
- const angle = station.angle * 180 / Math.PI
+ const angle = -station.angle * 180 / Math.PI
//const scale = this.getAutoScale()
const left = this.getXOnImg(station.x) //* scale
const top = this.getYOnImg(station.y) //* scale
@@ -3360,6 +3406,7 @@
} else if (item.method == "remove_station") {
const stationList = item.param || []
+ this.canvas.discardActiveObject()
let list = _this.canvas.getObjects() || []
list = list.filter((a) => a.eleType == "station")
@@ -3536,6 +3583,7 @@
_this.showTeachingPath(_this.showTeachPathFlag ? true : false)
} else if (item.method == "clear_teaching_path") {
+ this.canvas.discardActiveObject()
let list = _this.canvas.getObjects() || []
list = list.filter((a) => a.eleType == "public_teaching" || a.eleType ==
"station_teaching")
@@ -3575,6 +3623,7 @@
_this.showTeachingPath(item.param.show)
} else if (item.method == "remove_teaching_path") {
+ this.canvas.discardActiveObject()
let list = _this.canvas.getObjects() || []
if (item.param.mode == "Public") {
list = list.filter((a) => a.eleType == "public_teaching")
@@ -3648,6 +3697,7 @@
}
} else if (item.method == "remove_wall") {
const wallList = item.param || []
+ this.canvas.discardActiveObject()
let list = _this.canvas.getObjects() || []
list = list.filter((a) => a.eleType == "virtual_wall")
for (let i2 in wallList) {
@@ -3659,6 +3709,7 @@
}
} else if (item.method == "remove_region") {
const regionList = item.param || []
+ this.canvas.discardActiveObject()
let list = _this.canvas.getObjects() || []
list = list.filter((a) => a.eleType == "region")
for (let i2 in regionList) {
diff --git a/pages/map/scene.vue b/pages/map/scene.vue
index 99fd981..8f93cbf 100644
--- a/pages/map/scene.vue
+++ b/pages/map/scene.vue
@@ -1,7 +1,7 @@
<template>
<view class="pages-scene">
<view class="map-content" v-if="opSceneType =='' ">
- <image v-if="opType != 'extend'" class="img" src="/images/image 25.png" alt=" 鍥剧墖" mode="aspectFit" />
+ <image v-if="opType != 'extend'" class="img" src="/images/image_25.png" alt=" 鍥剧墖" mode="aspectFit" />
<image v-else class="img" :src="extendBase64Img" alt=" 鍥剧墖" mode="aspectFit" />
<view v-if="opType != 'extend'" class="space">娌℃湁鎵惧埌绗﹀悎鏉′欢鐨勫湴鍥�/view>
<!-- <view class="loading-view">{{mapserverIsOk?"鏋勫浘绋嬪簭鍑嗗灏辩华":"绛夊緟鏋勫浘绋嬪簭灏辩华..."}}
@@ -29,7 +29,7 @@
<view class="tip">璇疯緭鍏ュ満鏅悕绉�/view>
<view class="name-input">
<input ref="refInputName" :focus="true" placeholder="璇疯緭鍏ュ満鏅悕绉� :value="sceneName"
- @input="onInputName"></input>
+ @input="onInputName" />
<uni-icons class="clear" color="#ccc" type="clear" size="20" v-if="showClearName"
@click="clickClearName"></uni-icons>
</view>
@@ -51,13 +51,13 @@
</view>
</view>
<view class="bottom-content" v-else-if="opSceneType =='finish'">
- <view class="tip">鍦烘櫙鏋勫缓瀹屾垚</view>
- <view>宸叉垚鍔熸瀯寤衡�{{sceneName}}鈥�/view>
- <!-- <view class="loading-view">{{saveMapIsOk?"鏋勫浘淇濆瓨瀹屾垚":"绛夊緟鏋勫浘淇濆瓨瀹屾垚..."}}
+ <view class="tip"> 鈥渰{sceneName}}鈥漿{opType == "extend"?"鍦烘櫙鎵╁睍瀹屾垚"+"":"鍦烘櫙鏋勫缓瀹屾垚"}}</view>
+ <!-- <view> 宸叉垚鍔熸瀯寤衡�{{sceneName}}鈥�/view> -->
+ <view class="loading-view">{{saveMapIsOk?"鏋勫浘淇濆瓨瀹屾垚":"绛夊緟鏋勫浘淇濆瓨瀹屾垚..."}}
<view v-if="!saveMapIsOk" class="auto-circle"></view>
- </view> !saveMapIsOk ||-->
+ </view>
<view class="text-button-group">
- <a-button type="primary" class="button" :disabled=" loading" @click="clickFinish">鏋勫缓瀹屾垚</a-button>
+ <a-button type="primary" class="button" :disabled=" !saveMapIsOk || loading" @click="clickFinish">{{opType == "extend"?"鎵╁睍瀹屾垚":"鏋勫缓瀹屾垚"}}</a-button>
</view>
</view>
</view>
@@ -124,6 +124,7 @@
},
onLoad(option) {
+ console.log("scene load")
const _this = this
this.ip = option.ip || ""
uni.getSystemInfo({
@@ -139,7 +140,7 @@
},
onUnload() {
-
+ console.log("scene unload")
},
onBackPress() {
@@ -360,7 +361,7 @@
}
} else if (param.method == "cancel_positioning_agv") {
- this.positioningAgv = false
+ //this.positioningAgv = false
} else if (param.method == "show_log") {
const listLog = session.getValue("request_log") || []
listLog.unshift(param.data)
@@ -474,15 +475,16 @@
await stopMap(this.ip, this.sceneName)
// await startOrStopMapServer(this.ip, 2)
// this.checkSaveMapState();
- if (this.opType == "extend") {
- this.opSceneType = ""
- const eventChannel = this.getOpenerEventChannel();
- eventChannel.emit('create_finish', this.sceneName);
- uni.navigateBack({
- delta: 1, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉
- })
- }
-
+ // if (this.opType == "extend") {
+ // this.opSceneType = ""
+ // const eventChannel = this.getOpenerEventChannel();
+ // eventChannel.emit('create_finish', this.sceneName);
+ // uni.navigateBack({
+ // delta: 1, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉
+ // })
+ // }
+ setTimeout(() => {this.saveMapIsOk = true}, 5000);
+
} catch (ex) {
console.log(ex)
showModal("璇锋鏌ヨ溅杈嗚繛鎺ワ紝骞堕噸鏂板紑濮嬫瀯寤哄満鏅�, "鍦烘櫙鏋勫缓澶辫触", false, "纭畾").then((res) => {
@@ -522,7 +524,7 @@
const info = await getMapLaserData(this.ip, this.mapId)
return info
} catch (ex) {
- showError(ex)
+ showToast(ex)
return {}
}
},
@@ -531,15 +533,15 @@
if (this.opSceneType === "scan") {
const data = await this.loadMapLaserData()
-
+
const listCtrData = []
let newMap = false
if (data.base_map?.image_base64) {
this.robotPos = {}
newMap = true
- const mapData = data.base_map.image_base64 //this.mapId ?"terdy":
+ const mapData = data.base_map.image_base64 //this.mapId ?"terdy":
this.mapId = data.base_map.map_id
-
+
listCtrData.push({
method: "background",
param: {
diff --git a/pages/map/task.vue b/pages/map/task.vue
index 0e8b8af..a5bcc03 100644
--- a/pages/map/task.vue
+++ b/pages/map/task.vue
@@ -1,7 +1,7 @@
<template>
<view class="pages-map-task">
<view class="no-content" v-if="unlinked">
- <image class="img" src="/images/image 25.png" alt=" 鍥剧墖" mode="aspectFit" />
+ <image class="img" src="/images/image_25.png" alt=" 鍥剧墖" mode="aspectFit" />
<view class="title">杞﹁締杩炴帴澶辫触</view>
<view class="space">璇锋鏌ヤ綘鐨勭綉缁滆缃垨閲嶆柊鍔犺浇</view>
</view>
diff --git a/pages/map/teaching.vue b/pages/map/teaching.vue
index bb5182d..7f11824 100644
--- a/pages/map/teaching.vue
+++ b/pages/map/teaching.vue
@@ -122,7 +122,7 @@
<view class="tip">璇疯緭鍏ョ珯鐐瑰悕绉�/view>
<view class="name-input">
<input ref="refInputName" :focus="true" placeholder="杈撳叆绔欑偣鍚嶇О" :value="stationEdit.name"
- @input="onInputStationName"></input>
+ @input="onInputStationName"/>
<uni-icons class="clear" color="#ccc" type="clear" size="20" v-if="stationEdit.name"
@click="clickClearStationName"></uni-icons>
</view>
@@ -138,14 +138,14 @@
<view class="coordinate">
<text class="name">妯潗鏍�</text>
<input ref="refInputX" class="number-input" type="number" :value="stationEdit.x"
- @input="onInputStationX" :maxlength="4"></input>
+ @input="onInputStationX" :maxlength="4"/>
<uni-icons class="clear" color="#ccc" type="clear" size="20"
v-if="stationEdit.x && stationEdit.x!='0'" @click="clickClearStationX"></uni-icons>
</view>
<view class="coordinate">
<text class="name">绔栧潗鏍�</text>
<input ref="refInputX" class="number-input" type="number" :value="stationEdit.y"
- @input="onInputStationY" :maxlength="4"></input>
+ @input="onInputStationY" :maxlength="4"/>
<uni-icons class="clear" color="#ccc" type="clear" size="20"
v-if="stationEdit.y&& stationEdit.y!='0'" @click="clickClearStationY"></uni-icons>
</view>
@@ -154,7 +154,7 @@
<view class="tip">璋冭妭鏈濆悜</view>
<view class="angle-group">
<image class="img-angle" :src="angleSvg" alt="SVG 鍥剧墖" />
- <image class="img-angle-pos" src="/images/Frame 153.svg" alt="SVG 鍥剧墖"
+ <image class="img-angle-pos" src="/images/Frame_153.svg" alt="SVG 鍥剧墖"
@touchstart="handleAngleTouchStart" @touchmove="handleAngleTouchMove" />
</view>
</view>
diff --git a/pages/my/log.vue b/pages/my/log.vue
index 958ad3f..3a85e49 100644
--- a/pages/my/log.vue
+++ b/pages/my/log.vue
@@ -2,7 +2,7 @@
<view class="pages-my-log">
<view class="top">
<view class="input">
- <input placeholder="璇疯緭鍏ユ煡鎵炬帴鍙RL" v-model="keyMethod"></input>
+ <input placeholder="璇疯緭鍏ユ煡鎵炬帴鍙RL" v-model="keyMethod"/>
<uni-icons class="clear" color="#ccc" type="clear" size="20" v-if="keyMethod"
@click="clickClearKey"></uni-icons>
</view>
diff --git a/pages/station/delete.vue b/pages/station/delete.vue
new file mode 100644
index 0000000..c63dab1
--- /dev/null
+++ b/pages/station/delete.vue
@@ -0,0 +1,241 @@
+<template>
+ <view class="pages-station-delete">
+ <view class="uni-list">
+ <checkbox-group @change="checkboxChange">
+ <label class="list-item" v-for="item in stationList" :key="item.stationID">
+ <view>
+ <checkbox :value="item.stationID" :checked="item.checked" />
+ </view>
+ <view>
+
+ <view class="item-title">{{item.name}}</view>
+ <view class="item-text">
+ 瑙掑害锛歿{Math.round(item.angle *180/3.14)}}锛屽潗鏍囷紙{{Math.round(Number(item.x)*100)/100}},{{Math.round(Number(item.y)*100)/100}})
+ </view>
+ </view>
+ </label>
+ </checkbox-group>
+ </view>
+ <view class="bottom">
+ <checkbox :checked="checkedAll" @click="onSelectAll">鍏ㄩ�</checkbox>
+ <view class="button-group">
+
+ <a-button type="primary" class="button" @click="clickDelelte">鍒犻櫎</a-button>
+ </view>
+
+
+ </view>
+
+ </view>
+</template>
+<script>
+ import {
+ showToast,
+ showModal,
+ session,
+ showError,
+ showInfo
+ } from "@/comm/utils.js"
+ import {
+ Button
+ } from 'antd-mobile-vue-next'
+ import {
+ stations,
+ delStation
+ } from "@/api/vehicle.js"
+ export default {
+ name: "PagesStationDelete",
+ components: {
+ 'a-button': Button
+ },
+ data() {
+ return {
+ ip: "",
+ checkedAll: false,
+ stationList: [],
+ keyMethod: "",
+ listDel: []
+ }
+ },
+ onLoad(option) {
+ this.ip = option.ip || ""
+
+ this.loadData()
+ },
+ onBackPress() {
+ const eventChannel = this.getOpenerEventChannel();
+ eventChannel.emit('delete_finish', this.listDel);
+
+ },
+ methods: {
+ async loadData() {
+ try {
+
+ this.stationList = await this.loadStations() || []
+
+ } catch (ex) {
+
+ showError(ex)
+ }
+ },
+ async loadStations() {
+ try {
+ const info = await stations(this.ip)
+ return info.station_list || []
+ } catch (ex) {
+ showError(ex)
+ return []
+ }
+ },
+ checkboxChange(e) {
+ var items = this.stationList
+ const values = e.detail.value;
+ for (var i = 0, lenI = items.length; i < lenI; ++i) {
+ const item = items[i]
+ if (values.includes(item.stationID)) {
+ this.$set(item, 'checked', true)
+ } else {
+ this.$set(item, 'checked', false)
+ }
+ }
+ },
+ onSelectAll() {
+ this.checkedAll = !this.checkedAll
+ var items = this.stationList
+
+ console.log(this.checkedAll)
+ for (let i in items) {
+ const item = items[i]
+ this.$set(item, 'checked', this.checkedAll)
+ }
+
+ },
+ clickDelelte() {
+ const _this = this
+ var items = this.stationList
+ const list = []
+ for (var i = 0; i < items.length; ++i) {
+ const item = items[i]
+ if (item.checked) {
+ list.push(item.stationID)
+ }
+
+ }
+ if (list.length === 0) {
+ showInfo("鏈�鎷╃珯鐐癸紒")
+ return
+ }
+ showModal("鍒犻櫎閫夋嫨鐨勭珯鐐�, "鏄惁纭鍒犻櫎锛�).then((res) => {
+ if (res) {
+ _this.stationDelete(list)
+ }
+ })
+
+
+ },
+ async stationDelete(list) {
+ try {
+ uni.showLoading({
+ title: "姝e湪鍒犻櫎绔欑偣"
+ })
+
+ await delStation(this.ip, list)
+ this.stationList = await this.loadStations() || []
+
+ this.listDel.push(...list)
+ showToast("鍒犻櫎绔欑偣鎴愬姛")
+ } catch (ex) {
+
+ showError(ex)
+ } finally {
+ uni.hideLoading()
+ }
+ },
+
+ }
+ }
+</script>
+
+<style lang="scss">
+ .pages-station-delete {
+ display: flex;
+ width: 750rpx;
+ height: 100vh;
+ flex-direction: column;
+ background-color: #F5F5F5;
+
+ .uni-list {
+ flex: 1;
+ overflow-y: auto;
+
+ width: 730rpx;
+ margin: 10rpx;
+ border-radius: 10px;
+
+ background-color: #fff;
+
+ .list-item {
+ display: flex;
+
+ flex-direction: row;
+ padding: 10rpx;
+ border-bottom: 1px solid #ddd;
+ // justify-content: center;
+ align-items: center;
+
+ .item-title {
+ font-size: 32rpx;
+ padding: 10rpx 20rpx;
+ }
+
+
+ .item-text {
+ font-size: 28rpx;
+ color: #888;
+ padding: 10rpx 20rpx;
+ }
+ }
+
+ .list-item:first-child {
+ /* 鍙充笅瑙�*/
+ border-top-right-radius: 10px;
+ }
+
+ .list-item:last-child {
+ border-bottom: 0;
+ border-bottom-right-radius: 10px;
+ /* 鍙充笅瑙�*/
+ }
+
+ }
+
+ .bottom {
+ margin: 10rpx;
+ width: 730rpx;
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+
+ .button-group {
+ flex: 1;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+ font-size: 30rpx !important;
+
+ .am-button {
+ border-radius: 30px;
+
+ }
+
+ .button {
+
+ width: 300rpx;
+
+ }
+ }
+ }
+
+ }
+</style>
\ No newline at end of file
diff --git a/pages/station/index.vue b/pages/station/index.vue
index abf4d17..c22a196 100644
--- a/pages/station/index.vue
+++ b/pages/station/index.vue
@@ -45,7 +45,7 @@
<view class="tip">璇疯緭鍏ョ珯鐐瑰悕绉�/view>
<view class="name-input">
<input ref="refInputName" :focus="true" placeholder="杈撳叆绔欑偣鍚嶇О" :value="stationEdit.name"
- @input="onInputName"></input>
+ @input="onInputName"/>
<uni-icons class="clear" color="#ccc" type="clear" size="20" v-if="showClearName"
@click="clickClearName"></uni-icons>
</view>
@@ -60,19 +60,19 @@
<view class="coordinate">
<text class="name">妯潗鏍�</text>
<input ref="refInputX" class="number-input" type="number" :value="stationEdit.x"
- @input="onInputX"></input>
+ @input="onInputX"/>
</view>
<view class="coordinate">
<text class="name">绔栧潗鏍�</text>
<input ref="refInputX" class="number-input" type="number" :value="stationEdit.y"
- @input="onInputY"></input>
+ @input="onInputY"/>
</view>
</view>
<view class="tip">璋冭妭鏈濆悜</view>
<view class="angle-group">
<image class="img-angle" :src="angleSvg" alt="SVG 鍥剧墖" />
- <image class="img-angle-pos" src="/images/Frame 153.svg" alt="SVG 鍥剧墖"
+ <image class="img-angle-pos" src="/images/Frame_153.svg" alt="SVG 鍥剧墖"
@touchstart="handleAngleTouchStart" @touchmove="handleAngleTouchMove" />
</view>
<a-button type="primary" class="button" @click="clickPosOK">瀹屾垚</a-button>
@@ -113,7 +113,7 @@
showError,
showInfo
} from "@/comm/utils.js"
- // import OIFabric from "@/components/oi-fabric/index.vue"
+
import {
Button
} from 'antd-mobile-vue-next'
diff --git a/pages/task/add.vue b/pages/task/add.vue
index e0dacb4..88067f0 100644
--- a/pages/task/add.vue
+++ b/pages/task/add.vue
@@ -65,13 +65,15 @@
<a @click.stop="(e)=>{ clickPathwayPoint(e,index,'actionType')}">
{{actionTypeText(item.actionType)}}
</a>
- <view v-if="item.actionType === 3">
+ <template class="time" v-if="item.actionType === 3">
<a @click.stop="()=>{item.wait = 0}" v-if="item.wait===undefined">
绛夊緟鏃堕棿
</a>
- <view v-else class="time"> <input class="input" type="number" v-model="item.wait"
- :maxlength="4" />绉�/view>
- </view>
+ <input v-else class="input" type="number" v-model="item.wait" :maxlength="4" />
+ </template>
+ <span v-if="item.actionType === 3 && item.wait!==undefined">
+ 绉�+ </span>
</view>
<template v-slot:right>
<view class="btn-del" @click="clickDelPathWay(index)">鍒犻櫎</view>
@@ -133,7 +135,7 @@
taskGroupName: "",
cycleTime: 1,
taskButton: 0,
- tasktype:1
+ tasktype: 1
},
pathwayList: [{}],
pickerView: {
@@ -220,8 +222,12 @@
showToast("鏈�鎷╀换鍔″睘鎬э紒")
return
}
+ if (!this.info.taskButton) {
+ showToast("鏈�鎷╂寜閽彿锛�)
+ return
+ }
uni.showLoading({
- title:"浠诲姟鏂板涓�
+ title: "浠诲姟鏂板涓�
})
const taskList = []
const task = {
@@ -234,8 +240,13 @@
}
const taskStartTimeStamp = `${new Date().getTime()}`
- this.pathwayList.forEach((item) => {
+ for (let i in this.pathwayList) {
+ const item = this.pathwayList[i]
if (item.stationID) {
+ if (!item.actionType) {
+ showToast("鐩爣鐐规湭閫夋嫨鎿嶄綔绫诲瀷锛�)
+ return
+ }
task.taskList.push({
stationID: item.stationID,
actionType: item.actionType || 0,
@@ -251,13 +262,15 @@
})
}
- })
+
+ }
+
if (taskList.length == 0) {
- showToast("鐩爣鐐规湭閫夋嫨绔欏彴锛�)
+ showToast("蹇呴』娣诲姞鑷冲皯涓�釜鐩爣鐐癸紒")
return
}
await addTask(this.ip, task)
-
+
task.taskList = taskList
const eventChannel = this.getOpenerEventChannel();
eventChannel.emit('add_task', task);
@@ -266,8 +279,7 @@
})
} catch (ex) {
showError(ex)
- }
- finally {
+ } finally {
uni.hideLoading()
}
},
@@ -290,7 +302,7 @@
}
if (flag) {
- showModal(`褰撳墠缂栬緫鐨勫唴瀹瑰皢涓嶄細琚繚瀛榒, "纭畾瑕侀�鍑虹紪杈戝悧?",true,"纭畾","鍙栨秷").then((res) => {
+ showModal(`褰撳墠缂栬緫鐨勫唴瀹瑰皢涓嶄細琚繚瀛榒, "纭畾瑕侀�鍑虹紪杈戝悧?", true, "纭畾", "鍙栨秷").then((res) => {
if (res) {
uni.navigateBack({
delta: 1, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉
@@ -519,6 +531,7 @@
padding: 20rpx 10rpx;
display: flex;
flex-direction: row;
+ align-items: center;
.right {
flex: 1;
@@ -549,15 +562,12 @@
margin-left: 20rpx;
}
- .time {
- display: flex;
- flex-direction: row;
+ .input {
margin-left: 20rpx;
-
- .input {
- width: 75rpx;
- }
+ margin-right: 10rpx;
+ width: 75rpx;
}
+
}
.btn-del {
diff --git a/pages/task/infos/task-item.vue b/pages/task/infos/task-item.vue
index 6cc732f..72fd1ae 100644
--- a/pages/task/infos/task-item.vue
+++ b/pages/task/infos/task-item.vue
@@ -106,7 +106,7 @@
taskCycleTime() {
if (this.taskIsRun)
- return `绗�{this.taskStatus?.curCycleNumber || 0}/${this.taskStatus?.cycleTotleNumber || 0}娆
+ return `绗�{this.taskStatus?.curCycleNumber || 0}/${this.taskStatus?.cycleTotalNumber || 0}娆
else
return `閲嶅${this.taskData.cycleTime || 0}娆
diff --git a/pages/task/list.vue b/pages/task/list.vue
index 4d85b88..e7d9573 100644
--- a/pages/task/list.vue
+++ b/pages/task/list.vue
@@ -184,13 +184,14 @@
try {
if (this.isPageVisible)
await this.checkTaskGroupStatus()
- setTimeout(this.timerCheckTaskGroupStatus, 1000);
+ // setTimeout(this.timerCheckTaskGroupStatus, 1000);
} catch (ex) {
- showError(ex).then((res)=>{
- setTimeout(this.timerCheckTaskGroupStatus, 1000);
- })
+ showToast(ex)
+ // showError(ex).then((res)=>{
+ // setTimeout(this.timerCheckTaskGroupStatus, 1000);
+ // })
} finally {
-
+ setTimeout(this.timerCheckTaskGroupStatus, 1000);
}
},
async checkTaskGroupStatus() {
@@ -220,7 +221,7 @@
} catch (ex) {
this.taskStatus = {}
- showError(ex)
+ showToast(ex)
}
},
setTaskGroupStatus(cmdID) {
diff --git a/pages/task/update.vue b/pages/task/update.vue
index 72c2f7f..d40a729 100644
--- a/pages/task/update.vue
+++ b/pages/task/update.vue
@@ -6,8 +6,8 @@
<text class="uni-nav-bar-text">{{navigationBarTitle }}</text>
</view>
<template v-slot:right>
- <view class="uni-navbar-btn-text">
- <a @click="clickSave" class="uni-nav-bar-right-text">
+ <view class="uni-navbar-btn-text" @click="clickSave">
+ <a class="uni-nav-bar-right-text">
淇濆瓨
</a>
</view>
@@ -64,13 +64,15 @@
<a @click.stop="(e)=>{ clickPathwayPoint(e,index,'actionType')}">
{{actionTypeText(item.actionType)}}
</a>
- <view v-if="item.actionType === 3">
+ <template class="time" v-if="item.actionType === 3">
<a @click.stop="()=>{item.wait = 0}" v-if="item.wait===undefined">
绛夊緟鏃堕棿
</a>
- <view v-else class="time"> <input class="input" type="number" v-model="item.wait"
- :maxlength="4" />绉�/view>
- </view>
+ <input v-else class="input" type="number" v-model="item.wait" :maxlength="4" />
+ </template>
+ <span v-if="item.actionType === 3 && item.wait!==undefined">
+ 绉�+ </span>
</view>
</view>
</view>
@@ -179,13 +181,12 @@
}
this.info = info
let list = info.taskList || []
-
for (let i = 0; i < list.length; i++) {
const item = list[i]
this.pathwayList.push({
actionType: item.actionType,
dest: item.dest || {},
- wait: parseInt(item.wait) || 0,
+ wait: parseInt(item.wait) || 0,
taskID: item.taskID,
taskStartTimeStamp: item.taskStartTimeStamp,
})
@@ -246,7 +247,7 @@
return
}
uni.showLoading({
- title:"浠诲姟鏇存柊涓�
+ title: "浠诲姟鏇存柊涓�
})
const task = {
taskGroupID: this.form.taskGroupID,
@@ -262,12 +263,13 @@
const item2 = this.info.taskList[i]
const item = this.pathwayList[i]
let flag = false
+
if (item?.actionType != item2.actionType) {
flag = true
} else if (item?.dest?.stationID != item2.dest?.stationID) {
flag = true
} else {
- if (item?.actionType == 1) {
+ if (item?.actionType == 3) {
if (item?.wait != item2.wait) {
flag = true
}
@@ -304,8 +306,7 @@
})
} catch (ex) {
showError(ex)
- }
- finally {
+ } finally {
uni.hideLoading()
}
},
@@ -342,7 +343,7 @@
if (flag) {
- showModal(`褰撳墠缂栬緫鐨勫唴瀹瑰皢涓嶄細琚繚瀛榒, "纭畾瑕侀�鍑虹紪杈戝悧?",true,"纭畾","鍙栨秷").then((res) => {
+ showModal(`褰撳墠缂栬緫鐨勫唴瀹瑰皢涓嶄細琚繚瀛榒, "纭畾瑕侀�鍑虹紪杈戝悧?", true, "纭畾", "鍙栨秷").then((res) => {
if (res) {
uni.navigateBack({
delta: 1, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉
@@ -599,6 +600,7 @@
padding: 20rpx 10rpx;
display: flex;
flex-direction: row;
+ align-items: center;
.right {
flex: 1;
@@ -607,9 +609,6 @@
padding-right: 5px;
}
-
-
-
.right-input {
text-align: right;
flex: 1;
@@ -629,15 +628,11 @@
margin-left: 20rpx;
}
- .time {
- display: flex;
- flex-direction: row;
- margin-left: 20rpx;
-
.input {
- width: 75rpx;
- }
- }
+ margin-left: 20rpx;
+ width: 75rpx;
+ margin-right: 10rpx;
+ }
}
.btn-del {
diff --git a/static/images/station.svg b/static/images/station.svg
index fae579e..400db3f 100644
--- a/static/images/station.svg
+++ b/static/images/station.svg
@@ -1,11 +1,6 @@
+
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="36" height="36" rx="18" fill="#90D3FF"/>
-<g clip-path="url(#clip0_647_7172)">
-<path d="M11.7515 17.0488C11.5265 16.8238 11.4001 16.5186 11.4001 16.2004C11.4001 15.8822 11.5265 15.577 11.7515 15.352L17.1515 9.95199C17.3765 9.72702 17.6817 9.60065 17.9999 9.60065C18.3181 9.60065 18.6233 9.72702 18.8483 9.95199L24.2483 15.352C24.4669 15.5783 24.5878 15.8814 24.5851 16.1961C24.5824 16.5107 24.4562 16.8117 24.2337 17.0342C24.0112 17.2567 23.7102 17.3829 23.3956 17.3856C23.0809 17.3883 22.7778 17.2674 22.5515 17.0488L19.1999 13.8004L19.1999 25.2004C19.1999 25.5187 19.0735 25.8239 18.8484 26.0489C18.6234 26.274 18.3181 26.4004 17.9999 26.4004C17.6816 26.4004 17.3764 26.274 17.1514 26.0489C16.9263 25.8239 16.7999 25.5187 16.7999 25.2004L16.7999 13.8004L13.4483 17.0488C13.2233 17.2738 12.9181 17.4001 12.5999 17.4001C12.2817 17.4001 11.9765 17.2738 11.7515 17.0488Z" fill="#0050B2"/>
-</g>
-<defs>
-<clipPath id="clip0_647_7172">
-<rect width="18" height="18" fill="white" transform="translate(9 27) rotate(-90)"/>
-</clipPath>
-</defs>
+<path d="M18.9517 11.7517C19.1767 11.5268 19.4819 11.4004 19.8001 11.4004C20.1183 11.4004 20.4235 11.5268 20.6485 11.7517L26.0485 17.1517C26.2735 17.3768 26.3998 17.6819 26.3998 18.0001C26.3998 18.3183 26.2735 18.6235 26.0485 18.8485L20.6485 24.2485C20.4222 24.4671 20.1191 24.5881 19.8044 24.5853C19.4898 24.5826 19.1888 24.4564 18.9663 24.2339C18.7438 24.0114 18.6176 23.7105 18.6149 23.3958C18.6122 23.0812 18.7331 22.7781 18.9517 22.5517L22.2001 19.2001H10.8001C10.4818 19.2001 10.1766 19.0737 9.95157 18.8487C9.72653 18.6236 9.6001 18.3184 9.6001 18.0001C9.6001 17.6819 9.72653 17.3766 9.95157 17.1516C10.1766 16.9266 10.4818 16.8001 10.8001 16.8001H22.2001L18.9517 13.4485C18.7267 13.2235 18.6004 12.9183 18.6004 12.6001C18.6004 12.2819 18.7267 11.9768 18.9517 11.7517Z" fill="#0050B2"/>
</svg>
+
diff --git a/static/map.png b/static/map.png
deleted file mode 100644
index 9007b1f..0000000
--- a/static/map.png
+++ /dev/null
Binary files differ
--
Gitblit v1.9.1