提交app代码
This commit is contained in:
@@ -152,6 +152,7 @@ export default {
|
||||
uni.setStorageSync('messageParams', {
|
||||
name: item.engineeringName,
|
||||
id: item.engineeringId,
|
||||
type: '',
|
||||
})
|
||||
uni.switchTab({
|
||||
url: '/pages/index/message1',
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
<view style="padding: 20rpx 20rpx 0">
|
||||
<Cn-grid title="" :auto-fill="false">
|
||||
<Cn-grid-item src="/static/device2.png" text="设备注册" @click="registerDevice(4)"></Cn-grid-item>
|
||||
<Cn-grid-item
|
||||
<!-- <Cn-grid-item
|
||||
src="/static/device2.png"
|
||||
text="功能调试"
|
||||
@click="registerDevice(2)"
|
||||
@@ -64,12 +64,12 @@
|
||||
text="出厂调试"
|
||||
@click="registerDevice(3)"
|
||||
v-if="config.factory"
|
||||
></Cn-grid-item>
|
||||
<Cn-grid-item background="#fff" v-if="!config.feature"></Cn-grid-item>
|
||||
<Cn-grid-item background="#fff" v-if="!config.factory"></Cn-grid-item>
|
||||
></Cn-grid-item> -->
|
||||
<!-- <Cn-grid-item background="#fff" v-if="!config.feature"></Cn-grid-item>
|
||||
<Cn-grid-item background="#fff" v-if="!config.factory"></Cn-grid-item> -->
|
||||
<Cn-grid-item background="#fff"></Cn-grid-item>
|
||||
<Cn-grid-item background="#fff"></Cn-grid-item>
|
||||
<Cn-grid-item background="#fff"></Cn-grid-item>
|
||||
<!-- <Cn-grid-item background="#fff"></Cn-grid-item>
|
||||
<Cn-grid-item background="#fff"></Cn-grid-item> -->
|
||||
<!-- <Cn-grid-item src="/static/gateway2.png" text="网关注册" @click="registerGateway"></Cn-grid-item> -->
|
||||
<!-- <Cn-grid-item src="/static/feedback2.png" text="问题反馈" @click="submitFeedBack"></Cn-grid-item>-->
|
||||
</Cn-grid>
|
||||
|
||||
@@ -34,6 +34,14 @@
|
||||
<view class="header-item-value">{{ devCount.currentOffLineDevCount || 0 }}</view>
|
||||
<view class="header-item-label">离线设备</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jumpMessage('0')">
|
||||
<view class="header-item-value">{{ devCount.eventCount || 0 }}</view>
|
||||
<view class="header-item-label">暂态事件</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jumpMessage('1')">
|
||||
<view class="header-item-value">{{ devCount.harmonicCount || 0 }}</view>
|
||||
<view class="header-item-label">稳态事件</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="canneng-index-title mt20">常用功能</view>
|
||||
<view style="padding: 20rpx 20rpx 0">
|
||||
@@ -113,9 +121,9 @@ export default {
|
||||
},
|
||||
confirm(value) {
|
||||
// if (this.devCount.engineeringListLength > 0) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/new?type=4',
|
||||
})
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/new?type=4',
|
||||
})
|
||||
// } else {
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/engineering/new?from=index',
|
||||
@@ -134,6 +142,16 @@ export default {
|
||||
url: '/pages/device/list?type=' + type,
|
||||
})
|
||||
},
|
||||
jumpMessage(type) {
|
||||
uni.setStorageSync('messageParams', {
|
||||
name:'',
|
||||
id: '',
|
||||
type: type,
|
||||
})
|
||||
uni.switchTab({
|
||||
url: '/pages/index/message1',
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
refresher-enabled="true"
|
||||
class="event-list mt20"
|
||||
v-if="eventList.length != 0"
|
||||
:style="{ height: 'calc(100vh - ' + height + 'px)', overflow: 'auto' }"
|
||||
:style="{ height: 'calc(100vh - ' + (navHeight + height) + 'px)', overflow: 'auto' }"
|
||||
>
|
||||
<!-- 循环渲染事件项 -->
|
||||
<uni-card class="event-item" :class="item.type" v-for="(item, index) in store.data" :key="index">
|
||||
@@ -106,10 +106,10 @@ export default {
|
||||
.boundingClientRect((rect) => {
|
||||
//
|
||||
// #ifdef H5
|
||||
this.height = rect?.height + 130 || 0
|
||||
this.height = rect?.height + 20 || 0
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.height = rect?.height + 75 || 0
|
||||
this.height = rect?.height + 30 || 0
|
||||
// #endif
|
||||
})
|
||||
.exec()
|
||||
@@ -157,58 +157,67 @@ export default {
|
||||
startTime: item.startTime,
|
||||
time: '',
|
||||
timeType: this.selectValue.report,
|
||||
}).then((res) => {
|
||||
// 下载文件资源到本地
|
||||
uni.downloadFile({
|
||||
url: res.data, // 后端返回的线上文件路径
|
||||
success: function (res) {
|
||||
if (res.statusCode === 200) {
|
||||
// 文件到本地
|
||||
uni.saveFile({
|
||||
tempFilePath: res.tempFilePath, //临时路径
|
||||
success: function (data) {
|
||||
var savedFilePath = data.savedFilePath
|
||||
// 在app端执行
|
||||
// #ifdef APP-PLUS
|
||||
let osname = plus.os.name
|
||||
// 如果是安卓的话弹出提示
|
||||
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
mask: true,
|
||||
title: '下载成功!',
|
||||
duration: 1000,
|
||||
})
|
||||
|
||||
// #endif
|
||||
//ios手机直接打开文件,手动存储文件到手机,Android手机从根目录创建文件夹,保存文件并改名
|
||||
setTimeout(() => {
|
||||
//打开文档查看
|
||||
uni.openDocument({
|
||||
filePath: data.savedFilePath,
|
||||
success: function (ress) {
|
||||
console.log('成功打开文件')
|
||||
},
|
||||
fail() {
|
||||
console.log('打开文件失败')
|
||||
},
|
||||
})
|
||||
}, 500)
|
||||
},
|
||||
})
|
||||
console.log('下载成功')
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
mask: true,
|
||||
title: '下载失败!',
|
||||
duration: 1000,
|
||||
})
|
||||
}
|
||||
},
|
||||
fail: function (res) {},
|
||||
})
|
||||
})
|
||||
.then((res) => {
|
||||
// 下载文件资源到本地
|
||||
uni.downloadFile({
|
||||
url: res.data, // 后端返回的线上文件路径
|
||||
success: function (res) {
|
||||
if (res.statusCode === 200) {
|
||||
// 文件到本地
|
||||
uni.saveFile({
|
||||
tempFilePath: res.tempFilePath, //临时路径
|
||||
success: function (data) {
|
||||
var savedFilePath = data.savedFilePath
|
||||
// 在app端执行
|
||||
// #ifdef APP-PLUS
|
||||
let osname = plus.os.name
|
||||
// 如果是安卓的话弹出提示
|
||||
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
mask: true,
|
||||
title: '下载成功!',
|
||||
duration: 1000,
|
||||
})
|
||||
|
||||
// #endif
|
||||
//ios手机直接打开文件,手动存储文件到手机,Android手机从根目录创建文件夹,保存文件并改名
|
||||
setTimeout(() => {
|
||||
//打开文档查看
|
||||
uni.openDocument({
|
||||
filePath: data.savedFilePath,
|
||||
success: function (ress) {
|
||||
console.log('成功打开文件')
|
||||
},
|
||||
fail() {
|
||||
console.log('打开文件失败')
|
||||
},
|
||||
})
|
||||
}, 500)
|
||||
},
|
||||
})
|
||||
console.log('下载成功')
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
mask: true,
|
||||
title: '下载失败!',
|
||||
duration: 1000,
|
||||
})
|
||||
}
|
||||
},
|
||||
fail: function (res) {},
|
||||
})
|
||||
})
|
||||
.catch((err) => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
mask: true,
|
||||
title: err.message,
|
||||
duration: 1000,
|
||||
})
|
||||
})
|
||||
},
|
||||
// 下拉
|
||||
refresherrefresh() {
|
||||
@@ -233,7 +242,7 @@ export default {
|
||||
.event-tags {
|
||||
display: flex;
|
||||
font-size: 27rpx !important ;
|
||||
line-height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
|
||||
.event-detail {
|
||||
|
||||
@@ -208,58 +208,67 @@ export default {
|
||||
})
|
||||
downloadEventReport({
|
||||
id: item.eventId,
|
||||
}).then((res) => {
|
||||
// 下载文件资源到本地
|
||||
uni.downloadFile({
|
||||
url: res.data, // 后端返回的线上文件路径
|
||||
success: function (res) {
|
||||
if (res.statusCode === 200) {
|
||||
// 文件到本地
|
||||
uni.saveFile({
|
||||
tempFilePath: res.tempFilePath, //临时路径
|
||||
success: function (data) {
|
||||
var savedFilePath = data.savedFilePath
|
||||
// 在app端执行
|
||||
// #ifdef APP-PLUS
|
||||
let osname = plus.os.name
|
||||
// 如果是安卓的话弹出提示
|
||||
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
mask: true,
|
||||
title: '下载成功!',
|
||||
duration: 1000,
|
||||
})
|
||||
|
||||
// #endif
|
||||
//ios手机直接打开文件,手动存储文件到手机,Android手机从根目录创建文件夹,保存文件并改名
|
||||
setTimeout(() => {
|
||||
//打开文档查看
|
||||
uni.openDocument({
|
||||
filePath: data.savedFilePath,
|
||||
success: function (ress) {
|
||||
console.log('成功打开文件')
|
||||
},
|
||||
fail() {
|
||||
console.log('打开文件失败')
|
||||
},
|
||||
})
|
||||
}, 500)
|
||||
},
|
||||
})
|
||||
console.log('下载成功')
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
mask: true,
|
||||
title: '下载失败!',
|
||||
duration: 1000,
|
||||
})
|
||||
}
|
||||
},
|
||||
fail: function (res) {},
|
||||
})
|
||||
})
|
||||
.then((res) => {
|
||||
// 下载文件资源到本地
|
||||
uni.downloadFile({
|
||||
url: res.data, // 后端返回的线上文件路径
|
||||
success: function (res) {
|
||||
if (res.statusCode === 200) {
|
||||
// 文件到本地
|
||||
uni.saveFile({
|
||||
tempFilePath: res.tempFilePath, //临时路径
|
||||
success: function (data) {
|
||||
var savedFilePath = data.savedFilePath
|
||||
// 在app端执行
|
||||
// #ifdef APP-PLUS
|
||||
let osname = plus.os.name
|
||||
// 如果是安卓的话弹出提示
|
||||
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
mask: true,
|
||||
title: '下载成功!',
|
||||
duration: 1000,
|
||||
})
|
||||
|
||||
// #endif
|
||||
//ios手机直接打开文件,手动存储文件到手机,Android手机从根目录创建文件夹,保存文件并改名
|
||||
setTimeout(() => {
|
||||
//打开文档查看
|
||||
uni.openDocument({
|
||||
filePath: data.savedFilePath,
|
||||
success: function (ress) {
|
||||
console.log('成功打开文件')
|
||||
},
|
||||
fail() {
|
||||
console.log('打开文件失败')
|
||||
},
|
||||
})
|
||||
}, 500)
|
||||
},
|
||||
})
|
||||
console.log('下载成功')
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
mask: true,
|
||||
title: '下载失败!',
|
||||
duration: 1000,
|
||||
})
|
||||
}
|
||||
},
|
||||
fail: function (res) {},
|
||||
})
|
||||
})
|
||||
.catch((err) => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
mask: true,
|
||||
title: err.message,
|
||||
duration: 1000,
|
||||
})
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {},
|
||||
|
||||
Reference in New Issue
Block a user