diff --git a/common/api/feedback.js b/common/api/feedback.js
index 800a3cd..74b8ad6 100644
--- a/common/api/feedback.js
+++ b/common/api/feedback.js
@@ -94,3 +94,16 @@ export function updateChatStatus(params) {
},
});
}
+
+/**
+ * 更新反馈状态
+ */
+
+export function updateFeedBackStatus(params) {
+ console.log(params);
+ return request({
+ url: '/cs-system-boot/feedback/auditFeedBack',
+ method: 'post',
+ data: params,
+ });
+}
diff --git a/common/api/mine.js b/common/api/mine.js
index aff6125..48d60b5 100644
--- a/common/api/mine.js
+++ b/common/api/mine.js
@@ -41,7 +41,7 @@ export const queryAppInfoByType = (type) => {
export const queryUserPushConfig = () => {
return request({
- url: '/cs-system-boot/appInfoSet/queryByUserId',
+ url: '/user-boot/appInfoSet/queryByUserId',
method: 'post',
header: {
'Content-Type': 'application/json',
@@ -56,7 +56,7 @@ export const queryUserPushConfig = () => {
export const updatePushConfig = (params) => {
return request({
- url: '/cs-system-boot/appInfoSet/update',
+ url: '/user-boot/appInfoSet/update',
method: 'post',
header: {
'Content-Type': 'application/json',
diff --git a/common/js/request.js b/common/js/request.js
index cceb302..c378a4a 100644
--- a/common/js/request.js
+++ b/common/js/request.js
@@ -38,7 +38,9 @@ export default (options = {}) => {
success: async (res) => {
console.log(res)
if (arr.indexOf(options.url) > -1) {
- arr.splice(arr.indexOf(options.url), 1)
+ setTimeout(() => {
+ arr.splice(arr.indexOf(options.url), 1)
+ }, 300)
}
if (res.data.resultCode !== 10000 && res.data.code !== 'A0000') {
errHandler(res.data)
@@ -49,7 +51,9 @@ export default (options = {}) => {
},
fail: (err) => {
if (arr.indexOf(options.url) > -1) {
- arr.splice(arr.indexOf(options.url), 1)
+ setTimeout(() => {
+ arr.splice(arr.indexOf(options.url), 1)
+ }, 300)
}
reject(err)
uni.showToast({
diff --git a/common/js/util.js b/common/js/util.js
index 82a64dd..3ace6ae 100644
--- a/common/js/util.js
+++ b/common/js/util.js
@@ -1,9 +1,10 @@
import request from './request'
import cache from './cacheKey.js'
-import { getImageUrl } from '@/common/api/basic'
-import { apiUpdatePush } from '@/common/api/user'
-import { queryDictDataCache } from '../api/dictionary.js'
+import {getImageUrl} from '@/common/api/basic'
+import {apiUpdatePush} from '@/common/api/user'
+import {queryDictDataCache} from '../api/dictionary.js'
import cacheKey from './cacheKey.js'
+
const toast = (title, duration = 1500, call, mask = false, icon = 'none') => {
if (Boolean(title) === false) {
return
@@ -18,6 +19,7 @@ const toast = (title, duration = 1500, call, mask = false, icon = 'none') => {
call && call()
}, duration)
}
+
/**
* @description 格式化时间
* @param time
@@ -101,6 +103,7 @@ function formatTime(time, option) {
)
}
}
+
const h5Helper = {
isAndroid: function () {
return window.navigator.appVersion.toLowerCase().indexOf('android') != -1
@@ -210,6 +213,7 @@ const loginSuccess = (data, jump = true) => {
console.log(escape, atob)
var userInfo = JSON.parse(decodeURIComponent(escape(atob(strings[1].replace(/-/g, '+').replace(/_/g, '/')))))
userInfo.authorities = userInfo.authorities[0]
+ uni.setStorageSync(cache.userInfo, userInfo)
if (userInfo.headSculpture) {
getImageUrl(userInfo.headSculpture).then((res) => {
userInfo.avatar = res.data
@@ -226,12 +230,12 @@ const loginSuccess = (data, jump = true) => {
if (jump) {
queryDictDataCache().then((res) => {
uni.setStorageSync(cacheKey.dictData, res.data)
- uni.reLaunch({
- url: '/pages/index/index',
- fail: (err) => {
- console.log(err)
- },
- })
+ })
+ uni.reLaunch({
+ url: '/pages/index/index',
+ fail: (err) => {
+ console.log(err)
+ },
})
}
})
@@ -245,7 +249,7 @@ const refreshPrePage = (number = 1, time = 1500) => {
let pages = getCurrentPages()
let prePage = pages[pages.length - number - 1]
if (prePage && time) {
- prePage.$vm.store.reload()
+ prePage.$vm.store?.reload()
setTimeout(() => {
uni.navigateBack({
delta: number,
diff --git a/manifest.json b/manifest.json
index e2c3c2c..25c9748 100644
--- a/manifest.json
+++ b/manifest.json
@@ -2,8 +2,8 @@
"name" : "灿能物联",
"appid" : "__UNI__88BC25B",
"description" : "",
- "versionName" : "1.1.5",
- "versionCode" : 115,
+ "versionName" : "1.1.6",
+ "versionCode" : 116,
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
diff --git a/pages/device/APF/detail.vue b/pages/device/APF/detail.vue
index 9213122..4d30097 100644
--- a/pages/device/APF/detail.vue
+++ b/pages/device/APF/detail.vue
@@ -144,10 +144,10 @@ export default {
iconPath: '/static/report.png',
text: '告警',
},
- {
- iconPath: '/static/record.png',
- text: '记录',
- },
+ // {
+ // iconPath: '/static/record.png',
+ // text: '记录',
+ // },
{
iconPath: '/static/about.png',
text: '关于',
@@ -208,7 +208,7 @@ export default {
trigger(e) {
console.log(e)
if (e.item.text === '分享') {
- this.$refs.share.open()
+ uni.navigateTo({url: '/pages/device/share?id=' + this.devId})
} else if (e.item.text === '删除') {
uni.showModal({
title: '提示',
diff --git a/pages/device/edit.vue b/pages/device/edit.vue
index 240353f..cce7924 100644
--- a/pages/device/edit.vue
+++ b/pages/device/edit.vue
@@ -111,8 +111,8 @@
请拖动图中的蓝色定位图标选择监测点位置(左上角)
{
- return {
- ...item,
- disable: this.point.linePostion !== item.id && this.pointList.some(item2 => item2.linePostion === item.id)
- }
- })
- }
- },
onLoad(options) {
this.deviceInfo = JSON.parse(decodeURIComponent(options.deviceInfo))
console.log(this.deviceInfo)
@@ -178,7 +168,6 @@ export default {
return {
...item,
name: item.label,
- position: item.linePostion,
}
})
console.log(this.pointList, 'this.poinitList')
@@ -224,10 +213,9 @@ export default {
this.formData.topologyDiagramUrl = this.imageList[this.activeGplot].filePath
this.formData.topologyDiagram = this.imageList[this.activeGplot].id
this.pointList.forEach((item) => {
- console.log(item.position)
this.imageList[this.activeGplot].csLineTopologyTemplateVOList.forEach((item3) => {
console.log(item3.linePostion)
- if (item3.linePostion === item.position) {
+ if (item3.linePostion === item.linePostion) {
item.lat = item3.lat
item.lng = item3.lng
}
@@ -311,7 +299,7 @@ export default {
this.$refs.point.open()
},
addPoint() {
- if (!this.point.position) {
+ if (!this.point.linePostion) {
this.$util.toast('请选择监测点')
return
}
@@ -319,13 +307,15 @@ export default {
this.point.name = this.point.alias
} else {
this.positionList.forEach((item) => {
- if (item.id == this.point.position) {
+ if (item.id === this.point.linePostion) {
this.point.name = item.name
}
})
}
- this.point.lat = this.point.coordinate.x
- this.point.lng = this.point.coordinate.y
+ if (this.point.coordinate) {
+ this.point.lat = this.point.coordinate.x
+ this.point.lng = this.point.coordinate.y
+ }
this.pointList[this.editIndex] = this.point
console.log(this.pointList)
this.closeDrawer()
@@ -360,6 +350,16 @@ export default {
// this.point.lng = e.detail.y
},
submit() {
+ // 检查pointLlist监测点是否重复,并给出提示
+ let arr = []
+ this.pointList.forEach((item) => {
+ arr.push(item.linePostion)
+ })
+ let set = new Set(arr)
+ if (set.size !== arr.length) {
+ this.$util.toast('监测点不能重复')
+ return
+ }
updateDevice({
pointList: this.pointList,
id: this.imageList[this.activeGplot].id
diff --git a/pages/device/new.vue b/pages/device/new.vue
index e7d8985..6975d76 100644
--- a/pages/device/new.vue
+++ b/pages/device/new.vue
@@ -45,24 +45,24 @@
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -111,7 +111,8 @@
v-for="(item, key) in imageList"
:key="key"
/>
- 暂无拓扑图
+ 暂无拓扑图
+
取消
确定
@@ -139,7 +140,7 @@
{
- return {
- ...item,
- disable: this.point.linePostion !== item.id && this.pointList.some(item2 => item2.linePostion === item.id)
- }
- })
+ onBackPress() {
+ if (this.dialogOpen) {
+ this.closeDrawer()
+ return true
+ } else if (this.type === 3) {
+ return false
+ } else if (this.type === 2) {
+ this.type = 1
+ return true
+ } else {
+ return false
}
},
onLoad() {
@@ -287,7 +292,7 @@ export default {
},
scanCode() {
uni.scanCode({
- success (res) {
+ success(res) {
console.log('条码类型:' + res.scanType)
console.log('条码内容:' + res.result)
let content = JSON.parse(res.result)
@@ -329,10 +334,12 @@ export default {
},
chooseGplot() {
this.$refs.gplot.open()
+ this.dialogOpen = true
},
closeDrawer() {
this.$refs.gplot.close()
this.$refs.point.close()
+ this.dialogOpen = false
},
add() {
this.$refs.point.open()
@@ -351,8 +358,10 @@ export default {
}
})
}
- this.point.lat = this.point.coordinate.x
- this.point.lng = this.point.coordinate.y
+ if (this.point.coordinate) {
+ this.point.lat = this.point.coordinate.x
+ this.point.lng = this.point.coordinate.y
+ }
this.pointList[this.editIndex] = this.point
console.log(this.pointList)
this.closeDrawer()
@@ -373,6 +382,7 @@ export default {
this.point.alias = ''
}
}
+ this.dialogOpen = true
this.$refs.point.open()
this.$forceUpdate()
},
@@ -392,6 +402,16 @@ export default {
if (!this.formData.topologyDiagram) {
return this.$util.toast('请选择拓扑图')
}
+ // 检查pointLlist监测点是否重复,并给出提示
+ let arr = []
+ this.pointList.forEach((item) => {
+ arr.push(item.position)
+ })
+ let set = new Set(arr)
+ if (set.size !== arr.length) {
+ this.$util.toast('监测点不能重复')
+ return
+ }
addDevice({
...this.formData,
list: this.pointList,
@@ -400,6 +420,7 @@ export default {
console.log(res)
this.$util.toast('提交成功')
setTimeout(() => {
+ this.type = 3
uni.navigateBack({delta: 1})
}, 1500)
})
diff --git a/pages/engineering/detail.vue b/pages/engineering/detail.vue
index 97d0df3..a5f2e82 100644
--- a/pages/engineering/detail.vue
+++ b/pages/engineering/detail.vue
@@ -22,11 +22,11 @@
>{{ item.text }}
-
+
-
+
diff --git a/pages/engineering/new.vue b/pages/engineering/new.vue
index 20520c0..d23641e 100644
--- a/pages/engineering/new.vue
+++ b/pages/engineering/new.vue
@@ -23,7 +23,7 @@
@@ -72,14 +72,9 @@ export default {
this.formData.id = this.engineering.id
uni.setNavigationBarTitle({title: '工程编辑'})
}
- uni.getLocation({
- type: 'wgs84',
- success: function (res) {
- console.log(res)
- console.log('当前位置的经度:' + res.longitude)
- console.log('当前位置的纬度:' + res.latitude)
- },
- })
+ if(options.from === 'index'){
+ this.$util.toast('请先创建一个工程')
+ }
// console.log(area);
console.log(this.$util.prePage())
},
diff --git a/pages/home/feedback.vue b/pages/home/feedback.vue
index 6f8ee11..c4beb42 100644
--- a/pages/home/feedback.vue
+++ b/pages/home/feedback.vue
@@ -103,7 +103,7 @@ export default {
},
onLoad(options) {
this.formData.userId = uni.getStorageSync('userInfo').userIndex
- this.formData.engineeringId = uni.getStorageSync('engineering').engineeringId
+ this.formData.engineeringId = uni.getStorageSync('engineering').id
}
}
diff --git a/pages/home/selectEngineering.vue b/pages/home/selectEngineering.vue
index 19d6236..972f773 100644
--- a/pages/home/selectEngineering.vue
+++ b/pages/home/selectEngineering.vue
@@ -19,7 +19,8 @@ export default {
data() {
return {
loading: false,
- engineeringList: []
+ engineeringList: [],
+ options: {}
}
},
computed: {
@@ -42,7 +43,8 @@ export default {
return result
},
},
- onLoad() {
+ onLoad(options) {
+ this.options = options
this.engineeringList = uni.getStorageSync('engineeringList')
},
onShow() {
@@ -51,7 +53,7 @@ export default {
})
},
onNavigationBarButtonTap(e) {
- uni.redirectTo({
+ uni.navigateTo({
url: '/pages/engineering/new',
})
},
@@ -59,7 +61,12 @@ export default {
confirm(e) {
console.log(e)
let engineering = this.engineeringList.find((item) => item.name === e.item.name)
- uni.setStorageSync('engineering', engineering)
+ if (this.options.from === 'projectNew') {
+ // 创建项目的时候选择工程 用完即删
+ uni.setStorageSync('projectSelectEngineering', engineering)
+ } else {
+ uni.setStorageSync('engineering', engineering)
+ }
uni.navigateBack()
},
}
diff --git a/pages/index/comp/indexZhuanZhi.vue b/pages/index/comp/indexZhuanZhi.vue
index 08ca7c6..68aaf71 100644
--- a/pages/index/comp/indexZhuanZhi.vue
+++ b/pages/index/comp/indexZhuanZhi.vue
@@ -23,7 +23,7 @@
-
@@ -32,7 +41,8 @@