Browse Source

2023-9-15

master
guoxing 2 years ago
parent
commit
5d53619f74
  1. 26
      supervise-uniapp/common/request.api.js
  2. 142
      supervise-uniapp/pages.json
  3. 330
      supervise-uniapp/pages/home/MessageFragment - 副本.vue
  4. 417
      supervise-uniapp/pages/home/MessageFragment.vue
  5. 4
      supervise-uniapp/pages/home/UserFragment.vue
  6. 268
      supervise-uniapp/pages/index/ContactWarehouse.vue
  7. 481
      supervise-uniapp/pages/index/DeviceException.vue
  8. 220
      supervise-uniapp/pages/index/DeviceStatus.vue
  9. 330
      supervise-uniapp/pages/index/FormsData.vue
  10. 600
      supervise-uniapp/pages/index/GoodsException.vue
  11. 190
      supervise-uniapp/pages/index/RiskWarning.vue
  12. 196
      supervise-uniapp/pages/index/SystemFailure.vue

26
supervise-uniapp/common/request.api.js

@ -69,10 +69,33 @@ export default {
// "/report/projectdaily/getProjectDailyFiles/" + params.projectSid + "/" + params.orderDate, params),
// 设备异常信息
getDeviceExceptionInfo: (params = {}) => request.get(
"/reportwxmpapi/RiskMessagesLog/getMessageBySid/" + params.sid + "/" + params.wxCode, params),
// "/report/RiskMessagesLog/getMessageBySid/" + params.sid + "/" + params.wxCode, params),
// 货物比对异常信息
getGoodsExceptionInfo: (params = {}) => request.get(
"/reportwxmpapi/ImgMessagesLog/getMessageBySid/" + params.sid + "/" + params.wxCode, params),
// "/report/ImgMessagesLog/getMessageBySid/" + params.sid + "/" + params.wxCode, params),
// 获取首页面数据
getWorkData: (params = {}) => request.get("/reportwxmpapi/messagepushlog/numberOfJobs/" + params, params),
// 获取消息类型列表
messageTypeList: (params = {}) => request.post("/reportwxmpapi/MessageType/list ", params),
// 获取风险预警消息
riskListPage: (params = {}) => request.post("/reportwxmpapi/ImgMessagesLog/listPage", params),
// 获取待阅工作、已阅工作
messageListPage: (params = {}) => request.post("/reportwxmpapi/messagepushlog/listPage", params),
// 获取设备状态
deviceListPage: (params = {}) => request.post("/reportwxmpapi/RiskMessagesLog/listPage", params),
// 获取云仓列表
storeHouseListPage: (params = {}) => request.post("/api/portal/v1/flow/storeHouseListPage", params),
@ -97,8 +120,7 @@ export default {
// 获取数据总览列表
projectListPage: (params = {}) => request.post("/reportwxmpapi/projectdaily/selectListPage", params),
// 获取消息总览
messageListPage: (params = {}) => request.post("/reportwxmpapi/messagepushlog/listPage", params),

142
supervise-uniapp/pages.json

@ -13,6 +13,7 @@
// #ifdef APP-PLUS
{
@ -33,6 +34,51 @@
}
},
{
"path": "pages/home/MessageFragment",
"style": {
"navigationBarTitleText": "消息",
"enablePullDownRefresh": true
}
},
{
"path": "pages/index/SystemFailure",
"style": {
"navigationBarTitleText": "系统故障",
"enablePullDownRefresh": false
}
},
{
"path": "pages/index/DeviceException",
"style": {
"navigationBarTitleText": "设备异常",
"enablePullDownRefresh": false
}
},
{
"path": "pages/index/GoodsException",
"style": {
"navigationBarTitleText": "货物异常",
"enablePullDownRefresh": false
}
},
{
"path": "pages/index/WaitingProcessed",
"style": {
"navigationBarTitleText": "待办工作",
"enablePullDownRefresh": true
}
},
{
"path": "pages/index/RegulatoryReporting",
"style": {
@ -118,13 +164,6 @@
"enablePullDownRefresh": true
}
}, {
"path": "pages/index/WaitingProcessed",
"style": {
"navigationBarTitleText": "待办工作",
"enablePullDownRefresh": true
}
},
@ -225,13 +264,7 @@
"navigationBarTitleText": "云仓管理"
}
},
{
"path": "pages/home/MessageFragment",
"style": {
"navigationBarTitleText": "消息",
"enablePullDownRefresh": true
}
}, {
{
"path": "pages/index/WarehouseList",
"style": {
"navigationBarTitleText": "云仓列表",
@ -256,47 +289,76 @@
}
, {
"path": "pages/index/NotReadWork",
"style": {
"navigationBarTitleText": "待阅工作",
"enablePullDownRefresh": false
}
}, {
"path": "pages/index/ReadWork",
"style": {
"navigationBarTitleText": "已阅工作",
"enablePullDownRefresh": false
}
}, {
"path": "pages/index/SetUp",
"style": {
"navigationBarTitleText": "设置",
"enablePullDownRefresh": false
}
}, {
"path": "pages/index/SetUp2",
"style": {
"navigationBarTitleText": "个人信息",
"enablePullDownRefresh": false
}
}, {
"path": "pages/index/ChangePassword",
"style": {
"navigationBarTitleText": "修改密码",
"enablePullDownRefresh": false
}
}
, {
"path": "pages/index/ContactWarehouse",
"style": {
"navigationBarTitleText": "联系库房",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/index/NotReadWork",
"path" : "pages/index/RiskWarning",
"style" :
{
"navigationBarTitleText": "待阅工作",
"enablePullDownRefresh": false
"navigationBarTitleText": "风险预警",
"enablePullDownRefresh": true
}
}
,{
"path" : "pages/index/ReadWork",
"path" : "pages/index/DeviceStatus",
"style" :
{
"navigationBarTitleText": "已阅工作",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/index/SetUp",
"style" :
{
"navigationBarTitleText": "设置",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/index/SetUp2",
"style" :
{
"navigationBarTitleText": "个人信息",
"enablePullDownRefresh": false
"navigationBarTitleText": "设备状态",
"enablePullDownRefresh": true
}
}
,{
"path" : "pages/index/ChangePassword",
"path" : "pages/index/FormsData",
"style" :
{
"navigationBarTitleText": "修改密码",
"navigationBarTitleText": "数据消息",
"enablePullDownRefresh": false
}

330
supervise-uniapp/pages/home/MessageFragment - 副本.vue

@ -0,0 +1,330 @@
<template>
<view class="pages">
<view>
<view v-for="(item,index) in dataList" class="newslist" @click="itemClick(item)">
<view class="item-top">
<view class="drop" v-show="item.ostate=='0'"></view>
<view class="item-top-text">{{item.messageName}}</view>
<image class="item-top-img" src="../../static/baseIcon/zy.png" mode="aspectFill"></image>
</view>
<view class="item-con">
<view>
<text class="item-con-text">提交人</text>
<text class="item-con-text">{{item.name}}</text>
</view>
<view style="margin-top: 8px;">
<text class="item-con-text">提交时间</text>
<text class="item-con-text">{{item.date}}</text>
</view>
</view>
</view>
<!-- <uni-load-more :status="loadingType"></uni-load-more> -->
</view>
<!-- 加载....没有更多 -->
<view style="line-height: 60rpx;margin-bottom: 50rpx;">
<u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" />
</view>
</view>
</template>
<script>
export default {
data() {
return {
triggered: true,
status: 'loadmore',
iconType: 'flower',
loadText: {
loadmore: '轻轻上拉',
loading: '努力加载中',
nomore: '拉也没用,没有了'
},
listQuery: {
current: 1,
size: 10,
params: {
userSid: "",
messageName: "",
state: "2", //0 1 2
}
},
loadingType: 'more', //
dataList: [
],
};
},
onPullDownRefresh() {
this.listQuery.current = 1
this.loadData('refresh');
setTimeout(function() {
uni.stopPullDownRefresh();
}, 2000);
},
//
onReachBottom() {
this.listQuery.current = this.listQuery.current + 1
this.loadData();
},
onLoad() {
let token = uni.getStorageSync("Global-Auth-Token")
if (token != null && token.length != 0) {
getApp().globalData.token = token
}
let isLogin = uni.getStorageSync("isLogin")
if (isLogin != null && isLogin == 1) {
getApp().globalData.isLogin = isLogin
}
let sid = uni.getStorageSync("sid")
if (sid != null && sid.length != 0) {
getApp().globalData.sid = sid
}
console.log('用户Sid', getApp().globalData.sid)
console.log('token', getApp().globalData.token)
console.log('是否登陆', getApp().globalData.isLogin)
// setTimeout(() => {
if (getApp().globalData.isLogin) {
var userSid = getApp().globalData.sid
console.log(">>>>>", userSid)
this.listQuery.params.userSid = userSid
this.loadData();
// uni.setTabBarBadge({ //
// index: 0, //tabbar
// text: '100' //
// })
} else {
/* #ifdef MP-WEIXIN */
this.WxSilentLogin()
/* #endif */
/* #ifdef APP-PLUS */
uni.redirectTo({
url: '../login/login'
})
/* #endif */
}
},
onShow() {
console.log('onShow', getApp().globalData.isLogin)
if (this.dataList.length > 0) {
var num = 0
for (var i = 0; i < this.dataList.length; i++) {
var item = this.dataList[i]
if (item.ostate == '0') {
num++;
}
}
console.log('num', num)
if (num != 0) {
uni.setTabBarBadge({ //
index: 1, //tabbar
text: num > 100 ? "99+" : num + "" //
})
}
}
},
methods: {
itemClick(item) {
console.log('item', item.pagepath)
uni.navigateTo({
url: "/" + item.pagepath
})
item.ostate = "2"
},
//
async loadData(type = 'add', loading) {
//
if (type === 'add') {
if (this.loadingType === 'nomore') {
return;
}
this.loadingType = 'loading';
} else {
this.loadingType = 'more';
}
var list = []
this.$api.messageListPage(this.listQuery).then((resp) => {
// if (resp.success) {
console.log('1111', resp)
// list = resp.records
for (var i = 0; i < resp.records.length; i++) {
var item = resp.records[i]
var title = item.map.thing2
console.log("title", title)
list.push({
messageName: title,
name: item.map.thing3,
date: item.map.time1,
pagepath: item.pagepath,
ostate: item.ostate
})
}
console.log("消息列表", list)
if (type === 'refresh') {
this.dataList = [];
}
this.dataList = this.dataList.concat(list);
console.log("消息列表>>>>>", this.dataList.length)
if (this.dataList.length > 0) {
var num = 0
for (var i = 0; i < this.dataList.length; i++) {
var item = this.dataList[i]
if (item.ostate == '0') {
num++;
}
}
if (num != 0) {
uni.setTabBarBadge({ //
index: 1, //tabbar
text: num > 100 ? "99+" : num + "" //
})
}
}
//more nomore(20)
this.loadingType = this.dataList.length > list.total ? 'nomore' : 'more';
if (type === 'refresh') {
if (loading == 1) {
uni.hideLoading();
} else {
uni.stopPullDownRefresh();
}
}
}).catch(e => {
console.log('eeeee', e)
})
},
}
}
</script>
<style lang="scss">
.pages {
width: 100%;
height: 100%;
.newslist {
display: flex;
flex-direction: column;
background: #fff;
border-radius: 12px;
margin-left: 12px;
margin-right: 12px;
margin-top: 12px;
padding: 15px 20px;
.item-top {
display: flex;
flex-direction: row;
align-items: center;
padding-bottom: 12px;
padding-left: 5px;
padding-right: 5px;
border-bottom: 1px solid #F1F3F5;
.drop {
width: 6px;
height: 6px;
background: #f00;
border-radius: 50%;
margin-right: 5px;
}
.item-top-img {
width: 18px;
height: 18px;
}
.item-top-text {
flex: 1;
margin-right: 10px;
font-size: 16px;
color: #101010;
font-weight: 600;
font-family: sans-serif;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.item-top-text2 {
font-size: 14px;
color: #0A59F7;
}
}
.item-con {
margin-top: 12px;
display: flex;
flex-direction: column;
.item-con-text {
font-size: 15px;
color: #666666;
}
}
.item-bom {
width: 100%;
margin-top: 12px;
padding-top: 10px;
border-top: 1px solid #F1F3F5;
display: flex;
flex-direction: row;
align-items: center;
justify-content: end;
.item-bom-img {
width: 14px;
height: 14px;
}
.item-bom-text {
margin-left: 5px;
font-size: 14px;
color: #999;
}
}
}
}
</style>

417
supervise-uniapp/pages/home/MessageFragment.vue

@ -1,34 +1,32 @@
<template>
<view class="pages">
<view>
<view v-for="(item,index) in dataList" class="newslist" @click="itemClick(item)">
<view v-for="(item,index) in dataList" class="newslist">
<view class="item-top">
<view class="drop" v-show="item.ostate=='0'"></view>
<view class="item-top-text">{{item.messageName}}</view>
<image class="item-top-img" src="../../static/baseIcon/zy.png" mode="aspectFill"></image>
</view>
<view class="item" @click="itemClick(index)">
<image class="item-img" :src="item.icon" mode="aspectFit"></image>
<view class="item-con">
<view class="item-con-top">
<text class="item-con-top-title">{{item.name}}</text>
<text class="item-con-top-time">{{item.messageTime}}</text>
</view>
<view class="item-con-bom">
<text class="item-con-bom-content">{{item.content}}</text>
<view v-show="item.imgCount!=0">
<text class="item-con-bom-number">{{item.imgCount}}</text>
</view>
</view>
<view class="item-con">
<view>
<text class="item-con-text">提交人</text>
<text class="item-con-text">{{item.name}}</text>
</view>
<view style="margin-top: 8px;">
<text class="item-con-text">提交时间</text>
<text class="item-con-text">{{item.date}}</text>
</view>
</view>
</view>
<!-- <uni-load-more :status="loadingType"></uni-load-more> -->
</view>
<!-- 加载....没有更多 -->
<view style="line-height: 60rpx;margin-bottom: 50rpx;">
<u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" />
</view>
</view>
@ -38,198 +36,126 @@
export default {
data() {
return {
triggered: true,
status: 'loadmore',
iconType: 'flower',
loadText: {
loadmore: '轻轻上拉',
loading: '努力加载中',
nomore: '拉也没用,没有了'
params: {
userSid: "",
wxCode: "",
},
listQuery: {
current: 1,
size: 10,
params: {
userSid: "",
messageName: "",
state: "2", //0 1 2
}
},
loadingType: 'more', //
dataList: [
],
};
},
onPullDownRefresh() {
this.listQuery.current = 1
this.loadData('refresh');
setTimeout(function() {
uni.stopPullDownRefresh();
}, 2000);
},
//
onReachBottom() {
this.listQuery.current = this.listQuery.current + 1
this.loadData();
},
onLoad() {
let token = uni.getStorageSync("Global-Auth-Token")
if (token != null && token.length != 0) {
getApp().globalData.token = token
}
let isLogin = uni.getStorageSync("isLogin")
if (isLogin != null && isLogin == 1) {
getApp().globalData.isLogin = isLogin
}
let sid = uni.getStorageSync("sid")
if (sid != null && sid.length != 0) {
getApp().globalData.sid = sid
}
console.log('用户Sid', getApp().globalData.sid)
console.log('token', getApp().globalData.token)
console.log('是否登陆', getApp().globalData.isLogin)
onLoad() {},
// setTimeout(() => {
if (getApp().globalData.isLogin) {
var userSid = getApp().globalData.sid
console.log(">>>>>", userSid)
onShow() {
this.listQuery.params.userSid = userSid
console.log('userSid>>>>>>', getApp().globalData.sid)
this.loadData();
// uni.setTabBarBadge({ //
// index: 0, //tabbar
// text: '100' //
// })
if (getApp().globalData.sid) {
this.params.userSid = getApp().globalData.sid
this.getData()
} else {
/* #ifdef MP-WEIXIN */
this.WxSilentLogin()
/* #endif */
/* #ifdef APP-PLUS */
uni.redirectTo({
url: '../login/login'
})
/* #endif */
this.init()
}
},
onShow() {
console.log('onShow', getApp().globalData.isLogin)
if (this.dataList.length > 0) {
var num = 0
for (var i = 0; i < this.dataList.length; i++) {
var item = this.dataList[i]
if (item.ostate == '0') {
num++;
}
}
console.log('num', num)
if (num != 0) {
uni.setTabBarBadge({ //
index: 1, //tabbar
text: num > 100 ? "99+" : num + "" //
})
}
}
},
methods: {
itemClick(item) {
console.log('item', item.pagepath)
uni.navigateTo({
url: "/" + item.pagepath
})
item.ostate = "2"
init() {
let that = this
wx.login({
success: function(res) {
if (res.code) {
console.log('Http网络请求信息', {
"wxCode": res.code
})
},
//
async loadData(type = 'add', loading) {
//
if (type === 'add') {
if (this.loadingType === 'nomore') {
return;
that.params.wxCode = res.code
that.getData();
}
},
fail: function(res) {
uni.showToast({
title: "网络错误,请退出后重新进入。",
icon: 'none'
})
}
this.loadingType = 'loading';
} else {
this.loadingType = 'more';
}
var list = []
this.$api.messageListPage(this.listQuery).then((resp) => {
});
},
getData() {
// let data = await axios.get('/api/portal/v1/flow/task/'+userSid)
// console.log('data', data)
var _this = this
console.log('params', this.params)
this.$api.messageTypeList(this.params).then((resp) => {
// if (resp.success) {
console.log('1111', resp)
_this.dataList = []
var data = resp
var item1 = data[0]
var content = item1.messageLogs.message[1]
_this.dataList.push({
icon: item1.icon,
name: item1.name,
messageTime: item1.messageLogs.messageTime,
content: content,
imgCount: item1.messageLogs.count,
})
// list = resp.records
for (var i = 0; i < resp.records.length; i++) {
var item = resp.records[i]
var title = item.map.thing2
console.log("title", title)
list.push({
messageName: title,
name: item.map.thing3,
date: item.map.time1,
pagepath: item.pagepath,
ostate: item.ostate
})
}
console.log("消息列表", list)
if (type === 'refresh') {
this.dataList = [];
}
this.dataList = this.dataList.concat(list);
console.log("消息列表>>>>>", this.dataList.length)
if (this.dataList.length > 0) {
var num = 0
for (var i = 0; i < this.dataList.length; i++) {
var item = this.dataList[i]
if (item.ostate == '0') {
num++;
}
var item2 = data[1]
var content = item2.messageLogs.message[2]
}
if (num != 0) {
_this.dataList.push({
icon: item2.icon,
name: item2.name,
messageTime: item2.messageLogs.messageTime,
content: content,
imgCount: item2.messageLogs.count,
})
var item3 = data[2]
var type = "[" + item3.messageLogs.type + "]"
var content = item3.messageLogs.message[1]
_this.dataList.push({
icon: item3.icon,
name: item3.name,
messageTime: item3.messageLogs.messageTime,
content: type + content,
imgCount: item3.messageLogs.count,
})
uni.setTabBarBadge({ //
index: 1, //tabbar
text: num > 100 ? "99+" : num + "" //
})
}
}
//more nomore(20)
this.loadingType = this.dataList.length > list.total ? 'nomore' : 'more';
if (type === 'refresh') {
if (loading == 1) {
uni.hideLoading();
} else {
uni.stopPullDownRefresh();
}
}
}).catch(e => {
console.log('eeeee', e)
})
},
itemClick(index) {
console.log('index', index)
switch (index) {
case 0: //
uni.navigateTo({
url: "/pages/index/RiskWarning"
})
break;
case 1: //
uni.navigateTo({
url: "/pages/index/FormsData"
})
break;
case 2: //
uni.navigateTo({
url: "/pages/index/DeviceStatus"
})
break;
default:
break;
}
}
}
}
@ -248,83 +174,82 @@
margin-left: 12px;
margin-right: 12px;
margin-top: 12px;
padding: 15px 20px;
padding: 10px 15px;
.item-top {
.item {
display: flex;
flex-direction: row;
align-items: center;
padding-bottom: 12px;
padding-left: 5px;
padding-right: 5px;
border-bottom: 1px solid #F1F3F5;
.drop {
width: 6px;
height: 6px;
background: #f00;
border-radius: 50%;
margin-right: 5px;
}
.item-top-img {
width: 18px;
height: 18px;
.item-img {
width: 55px;
height: 55px;
}
.item-top-text {
flex: 1;
margin-right: 10px;
font-size: 16px;
color: #101010;
font-weight: 600;
font-family: sans-serif;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.item-con {
width: 100%;
margin-left: 10px;
display: flex;
flex-direction: column;
.item-con-top {
display: flex;
flex-direction: row;
.item-con-top-title {
flex: 1;
font-size: 15px;
color: #101010;
margin-right: 10px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.item-top-text2 {
font-size: 14px;
color: #0A59F7;
}
}
.item-con-top-time {
font-size: 14px;
color: #A1A1A1;
}
}
.item-con {
margin-top: 12px;
display: flex;
flex-direction: column;
.item-con-bom {
margin-top: 5px;
display: flex;
flex-direction: row;
.item-con-bom-content {
flex: 1;
font-size: 14px;
color: #777777;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.item-con-text {
font-size: 15px;
color: #666666;
.item-con-bom-number {
color: #fff;
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
margin-left: 10px;
flex-shrink: 0;
text-align: center;
background: #CBCBCB;
border-radius: 50%;
font-size: 12px;
}
}
}
}
.item-bom {
width: 100%;
margin-top: 12px;
padding-top: 10px;
border-top: 1px solid #F1F3F5;
display: flex;
flex-direction: row;
align-items: center;
justify-content: end;
.item-bom-img {
width: 14px;
height: 14px;
}
.item-bom-text {
margin-left: 5px;
font-size: 14px;
color: #999;
}
}
}
}
</style>

4
supervise-uniapp/pages/home/UserFragment.vue

@ -142,6 +142,10 @@
uni.navigateTo({
url: '../index/SetUp'
});
// uni.navigateTo({
// url: '../index/DeviceException?sid=994d75b6-eb29-4733-bd48-dcfdf9f7dd47'
// });
break;
case "3":
break;

268
supervise-uniapp/pages/index/ContactWarehouse.vue

@ -0,0 +1,268 @@
<template>
<view class="pages">
<view class="top">
<view class="top-item">
<view class="top-item-drop"></view>
<view class="top-item-text">
<text class="top-item-text1">仓库名称</text>
<text class="top-item-text2">{{info.warehouseName}}</text>
</view>
</view>
<view class="top-item" style="margin-top: 20px;">
<view class="top-item-drop"></view>
<view class="top-item-text">
<text class="top-item-text1">异常时间</text>
<text class="top-item-text2">{{info.exceptionTime}}</text>
</view>
</view>
<view class="top-item" style="margin-top: 20px;">
<view class="top-item-bom">
<text class="top-item-bom-text1" @click="textClick('1')">库房详情</text>
<text class="top-item-bom-text2" @click="textClick('2')">工作派单</text>
</view>
</view>
</view>
<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltoupper="upper"
@scrolltolower="lower" @scroll="scroll">
<view style="padding-bottom: 50px;">
<view v-for="(item,index) in info.linkers" class="newslist">
<view class="item" :class="{'item2':index+1== info.linkers.length}">
<view class="item-lift">
<text class="item-lift-text">联系人{{item.name}}</text>
<text class="item-lift-text">联系电话{{item.mobile}}</text>
</view>
<image class="item-img" src="https://supervise.yxtsoft.com/img/base/lxkf.png"
@click="makeCall(item.mobile)"></image>
</view>
</view>
</view>
</scroll-view>
</view>
</template>
<script>
export default {
data() {
return {
scrollTop: 0,
old: {
scrollTop: 0
},
info: {
warehouseSid: "",
warehouseName: "",
exceptionTime: "",
linkers: [],
}
}
},
onLoad(option) {
console.log("option", option)
console.log("info", option.info)
console.log("info22", JSON.parse(option.info))
var data = JSON.parse(option.info)
this.info = {
warehouseSid: data.warehouseSid,
warehouseName: data.warehouseName,
exceptionTime: data.exceptionTime,
linkers: data.linkers,
}
},
methods: {
//
preventHandler() {
return
},
upper: function(e) {
console.log(e)
},
lower: function(e) {
console.log(e)
},
scroll: function(e) {
console.log(e)
this.old.scrollTop = e.detail.scrollTop
},
textClick(index) {
switch (index) {
case "1":
//
uni.navigateTo({
url: 'WarehouseDetaile?sid='+this.info.warehouseSid
});
break;
case "2":
//
uni.showToast({
icon: "none",
title: '工作派单',
duration: 2000,
});
// uni.navigateTo({
// url: '../index/ReadWork'
// });
break;
default:
break;
}
},
makeCall(mobile) {
wx.makePhoneCall({
//
phoneNumber: mobile
})
}
}
}
</script>
<style lang="scss">
.pages {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
position: fixed;
overflow: auto;
.top {
display: flex;
flex-direction: column;
padding: 15px 20px;
.top-item {
display: flex;
flex-direction: row;
align-items: center;
.top-item-drop {
background: #1684FC;
border-radius: 50%;
width: 8px;
height: 8px;
}
.top-item-text {
margin-left: 10px;
display: flex;
flex-direction: row;
align-items: center;
.top-item-text1 {
font-size: 15px;
color: #666;
}
.top-item-text2 {
font-size: 18px;
color: #000;
font-weight: 600;
font-family: sans-serif;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
}
.top-item-bom {
display: flex;
flex-direction: row;
width: 100%;
margin-left: 30px;
margin-right: 30px;
justify-content: space-between;
.top-item-bom-text1 {
padding: 5px 20px;
color: #2F96E1;
font-size: 14px;
border: 1px solid #2F96E1;
border-radius: 5px;
}
.top-item-bom-text2 {
padding: 5px 20px;
color: #fff;
font-size: 14px;
background: #2F96E1;
border-radius: 5px;
}
}
}
}
.scroll-Y {
overflow-y: hidden;
height: 90vh;
background: #fff;
.newslist {
margin-top: 10px;
display: flex;
flex-direction: column;
padding-left: 10px;
padding-right: 10px;
.item {
display: flex;
flex-direction: row;
border-bottom: 1px solid #eee;
padding: 10px;
align-items: center;
.item-lift {
flex: 1;
display: flex;
flex-direction: column;
.item-lift-text {
margin-top: 10px;
font-size: 14px;
color: #777777;
}
}
.item-img {
margin-left: 20px;
width: 35px;
height: 35px;
}
}
.item2 {
display: flex;
flex-direction: row;
padding: 10px;
align-items: center;
border-bottom: none;
}
}
}
}
</style>

481
supervise-uniapp/pages/index/DeviceException.vue

@ -0,0 +1,481 @@
<template>
<view class="pages">
<view class="top">
<view class="top-item">
<view class="top-item-drop"></view>
<view class="top-item-text">
<text class="top-item-text1">仓库名称</text>
<text class="top-item-text2">{{info.warehouseName}}</text>
</view>
</view>
<view class="top-item" style="margin-top: 20px;">
<view class="top-item-drop"></view>
<view class="top-item-text">
<text class="top-item-text1">异常时间</text>
<text class="top-item-text2">{{info.exceptionTime}}</text>
</view>
</view>
<view class="top-item" style="margin-top: 20px;">
<view class="top-item-bom">
<text class="top-item-bom-text1" @click="textClick('1')">联系库房</text>
<text class="top-item-bom-text2" @click="textClick('2')">工作派单</text>
</view>
</view>
</view>
<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltoupper="upper"
@scrolltolower="lower" @scroll="scroll">
<view style="padding-bottom: 50px;">
<view v-for="(item,index) in info.dataList" class="newslist">
<view class="list-item">
<!-- <view class="list-item-text">
<text class="list-item-text1">名称</text>
<text class="list-item-text2">{{item.name}}</text>
</view>
<view class="list-item-text">
<text class="list-item-text1">序列号</text>
<text class="list-item-text2">{{item.code}}</text>
</view>
<view class="list-item-text">
<text class="list-item-text1">状态</text>
<text class="list-item-text2">{{item.state}}</text>
</view> -->
<view class="item-lift">
<image class="item-img" src="https://supervise.yxtsoft.com/img/base/sbyc.png"></image>
<text class="item-state">{{item.state}}</text>
</view>
<view class="item-text">
<view class="item-text-lay">
<text class="item-lay-text1">名称</text>
<text class="item-lay-text2">{{item.name}}</text>
</view>
<view class="item-text-lay" style="margin-top: 10px;">
<text class="item-lay-text1">序列号</text>
<text class="item-lay-text2">{{item.code}}</text>
</view>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</template>
<script>
export default {
data() {
return {
scrollTop: 0,
old: {
scrollTop: 0
},
params: {
sid: "",
// sid: "",
wxCode: "",
},
info: {
warehouseSid: "",
warehouseName: "",
exceptionTime: "",
linkers: [],
dataList: [
// {
// name: "1",
// code: "sak-545-an-5464",
// state: ""
// },
// {
// name: "2",
// code: "sak-545-an-5464",
// state: ""
// },
// {
// name: "3",
// code: "sak-545-an-5464",
// state: ""
// },
// {
// name: "4",
// code: "sak-545-an-5464",
// state: ""
// },
// {
// name: "5",
// code: "sak-545-an-5464",
// state: ""
// },
// {
// name: "6",
// code: "sak-545-an-5464",
// state: ""
// },
// {
// name: "7",
// code: "sak-545-an-5464",
// state: ""
// },
// {
// name: "8",
// code: "sak-545-an-5464",
// state: ""
// },
// {
// name: "9",
// code: "sak-545-an-5464",
// state: ""
// },
// {
// name: "10",
// code: "sak-545-an-5464",
// state: ""
// }
]
}
}
},
onLoad(option) {
// this.sid = option.sid
this.params = {
sid: option.sid
}
console.log("sid", this.params.sid)
wx.hideHomeButton()
this.init()
},
methods: {
//
preventHandler() {
return
},
upper: function(e) {
console.log(e)
},
lower: function(e) {
console.log(e)
},
scroll: function(e) {
console.log(e)
this.old.scrollTop = e.detail.scrollTop
},
init() {
let that = this
wx.login({
success: function(res) {
if (res.code) {
console.log('Http网络请求信息', {
"wxCode": res.code
})
that.params.wxCode = res.code
that.getData(that.params)
}
},
fail: function(res) {
uni.showToast({
title: "网络错误,请退出后重新进入。",
icon: 'none'
})
}
});
},
getData(data) {
console.log("data", data)
this.$api.getDeviceExceptionInfo(data).then((resp) => {
// if (resp.success) {
console.log('1111', resp)
this.info.warehouseSid = resp.shSid
this.info.warehouseName = resp.shName
this.info.exceptionTime = resp.messageTime
this.info.linkers = resp.linkers
var str = resp.text.substring(1, (resp.text.length - 1))
console.log('1111', str)
var str2 = str.split("Device")
console.log('222', str2)
for (var i = 0; i < str2.length; i++) {
var item = str2[i]
if (item) {
var str3 = item.split(", ")
console.log('3333', str3)
var name = str3[0].substring(6)
console.log('name', name)
var code = str3[1].substring(13)
console.log('code', code)
var state = str3[2].substring(7, str3[2].length - 1)
console.log('state', state)
this.info.dataList.push({
name: name,
code: code,
state: state,
})
}
}
}).catch(e => {
console.log('eeeee', e)
})
},
textClick(index) {
switch (index) {
case "1":
//
// uni.showToast({
// icon: "none",
// title: '',
// duration: 2000,
// });
uni.navigateTo({
url: '../index/ContactWarehouse?info=' + JSON.stringify(this.info),
});
break;
case "2":
//
uni.showToast({
icon: "none",
title: '工作派单',
duration: 2000,
});
// uni.navigateTo({
// url: '../index/ReadWork'
// });
break;
default:
break;
}
},
}
}
</script>
<style lang="scss">
.pages {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
position: fixed;
overflow: auto;
.top {
display: flex;
flex-direction: column;
padding: 15px 20px;
.top-item {
display: flex;
flex-direction: row;
align-items: center;
.top-item-drop {
background: #1684FC;
border-radius: 50%;
width: 8px;
height: 8px;
}
.top-item-text {
margin-left: 10px;
display: flex;
flex-direction: row;
align-items: center;
.top-item-text1 {
font-size: 15px;
color: #666;
}
.top-item-text2 {
font-size: 18px;
color: #000;
font-weight: 600;
font-family: sans-serif;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
}
.top-item-bom {
display: flex;
flex-direction: row;
width: 100%;
margin-left: 30px;
margin-right: 30px;
justify-content: space-between;
.top-item-bom-text1 {
padding: 5px 20px;
color: #2F96E1;
font-size: 14px;
border: 1px solid #2F96E1;
border-radius: 5px;
}
.top-item-bom-text2 {
padding: 5px 20px;
color: #fff;
font-size: 14px;
background: #2F96E1;
border-radius: 5px;
}
}
}
}
.scroll-Y {
overflow-y: hidden;
height: 90vh;
.newslist {
margin-top: 10px;
display: flex;
flex-direction: column;
padding-left: 10px;
padding-right: 10px;
.list-item {
margin-top: 10px;
display: flex;
flex-direction: row;
background: #fff;
border-radius: 5px;
align-items: center;
padding: 20px 25px;
.item-lift {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.item-img {
width: 30px;
height: 30px;
}
.item-state {
font-size: 12px;
color: #fff;
margin-top: 5px;
background: #41CAC0;
border-radius: 15px;
padding: 2px 15px;
}
}
.item-text {
margin-left: 20px;
flex: 1;
display: flex;
flex-direction: column;
.item-text-lay {
display: flex;
flex-direction: row;
align-items: center;
.item-lay-text1 {
font-size: 14px;
color: #9F9F9F;
}
.item-lay-text2 {
flex: 1;
font-size: 16px;
color: #000;
// font-weight: 600;
// font-family: sans-serif;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
}
}
// .list-item-text {
// margin-top: 5px;
// display: flex;
// flex-direction: row;
// align-items: center;
// .list-item-text1 {
// font-size: 15px;
// color: #666;
// }
// .list-item-text2 {
// font-size: 18px;
// color: #000;
// font-weight: 600;
// font-family: sans-serif;
// overflow: hidden;
// text-overflow: ellipsis;
// display: -webkit-box;
// -webkit-line-clamp: 1;
// -webkit-box-orient: vertical;
// }
// }
}
}
}
}
</style>

220
supervise-uniapp/pages/index/DeviceStatus.vue

@ -0,0 +1,220 @@
<template>
<view class="pages">
<view>
<view v-for="(item,index) in dataList" class="newslist">
<view class="item" @click="itemClick(item)" :class="{'item2':index+1 == dataList.length}">
<view class="item-lift" >
<text class="item-lift-top">{{item.time}} [{{item.type}}]</text>
<text class="item-lift-bom">{{item.name}}</text>
</view>
<image class="imge" src="../../static/baseIcon/zy.png"></image>
</view>
</view>
</view>
<!-- 加载....没有更多 -->
<view style="line-height: 60rpx;margin-bottom: 50px;">
<u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" />
</view>
</view>
</template>
<script>
export default {
data() {
return {
status: 'loadmore',
iconType: 'flower',
loadText: {
loadmore: '轻轻上拉',
loading: '努力加载中',
nomore: '拉也没用,没有了'
},
listQuery: {
current: 1,
size: 10,
params: {
userSid: "",
}
},
loadingType: 'more', //
dataList: [
]
}
},onPullDownRefresh() {
this.listQuery.current = 1
this.loadData('refresh');
setTimeout(function() {
uni.stopPullDownRefresh();
}, 2000);
},
//
onReachBottom() {
this.listQuery.current = this.listQuery.current + 1
this.loadData();
},
onLoad() {
var userSid = getApp().globalData.sid
console.log(">>>>>", userSid)
this.listQuery.params.userSid = userSid
this.loadData();
},
methods: {
//
async loadData(type = 'add', loading) {
//
if (type === 'add') {
if (this.loadingType === 'nomore') {
return;
}
this.loadingType = 'loading';
} else {
this.loadingType = 'more';
}
var list = []
console.log('listQuery', this.listQuery)
this.$api.deviceListPage(this.listQuery).then((resp) => {
// if (resp.success) {
console.log('1111', resp)
for (var i = 0; i < resp.records.length; i++) {
var item = resp.records[i]
var data = item.templateMessageVo
console.log("data", data)
list.push({
sid:item.riskSid,
time: data.time,
name: data.shName,
type: item.type,
})
}
console.log("消息列表", list)
if (type === 'refresh') {
this.dataList = [];
}
this.dataList = this.dataList.concat(list);
console.log("消息列表>>>>>", this.dataList.length)
//more nomore(20)
this.loadingType = this.dataList.length > list.total ? 'nomore' : 'more';
if (type === 'refresh') {
if (loading == 1) {
uni.hideLoading();
} else {
uni.stopPullDownRefresh();
}
}
}).catch(e => {
console.log('eeeee', e)
})
},
itemClick(item) {
console.log('item', item)
var type = item.type
var sid = item.sid
var date = item.time
if('设备离线'==type){
// 线
uni.navigateTo({
url: "/pages/index/DeviceException?sid="+sid
})
}else if('系统异常'==type){
//
uni.navigateTo({
url: "/pages/index/SystemFailure?date="+date
})
} else{
uni.showToast({
icon: "none",
title: '暂不支持',
duration: 2000,
});
return
}
}
}
}
</script>
<style lang="scss">
.pages {
width: 100%;
height: 100%;
padding-top: 10px;
.newslist {
display: flex;
flex-direction: column;
.item {
background: #fff;
border-bottom: 1px solid #eee;
display: flex;
flex-direction: row;
align-items: center;
padding: 15px 20px;
.item-lift {
flex: 1;
display: flex;
flex-direction: column;
.item-lift-top {
color: #101010;
font-size: 16px;
font-weight: 600;
font-family: sans-serif
}
.item-lift-bom {
margin-top: 5px;
color: #707070;
font-size: 15px;
}
}
.imge {
width: 20px;
height: 20px;
}
}
.item2{
background: #fff;
border-bottom: none;
display: flex;
flex-direction: row;
align-items: center;
padding: 15px 20px;
}
}
}
</style>

330
supervise-uniapp/pages/index/FormsData.vue

@ -0,0 +1,330 @@
<template>
<view class="pages">
<view>
<view v-for="(item,index) in dataList" class="newslist" @click="itemClick(item)">
<view class="item-top">
<view class="drop" v-show="item.ostate=='0'"></view>
<view class="item-top-text">{{item.messageName}}</view>
<image class="item-top-img" src="../../static/baseIcon/zy.png" mode="aspectFill"></image>
</view>
<view class="item-con">
<view>
<text class="item-con-text">提交人</text>
<text class="item-con-text">{{item.name}}</text>
</view>
<view style="margin-top: 8px;">
<text class="item-con-text">提交时间</text>
<text class="item-con-text">{{item.date}}</text>
</view>
</view>
</view>
<!-- <uni-load-more :status="loadingType"></uni-load-more> -->
</view>
<!-- 加载....没有更多 -->
<view style="line-height: 60rpx;margin-bottom: 50rpx;">
<u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" />
</view>
</view>
</template>
<script>
export default {
data() {
return {
triggered: true,
status: 'loadmore',
iconType: 'flower',
loadText: {
loadmore: '轻轻上拉',
loading: '努力加载中',
nomore: '拉也没用,没有了'
},
listQuery: {
current: 1,
size: 10,
params: {
userSid: "",
messageName: "",
state: "2", //0 1 2
}
},
loadingType: 'more', //
dataList: [
],
};
},
onPullDownRefresh() {
this.listQuery.current = 1
this.loadData('refresh');
setTimeout(function() {
uni.stopPullDownRefresh();
}, 2000);
},
//
onReachBottom() {
this.listQuery.current = this.listQuery.current + 1
this.loadData();
},
onLoad() {
let token = uni.getStorageSync("Global-Auth-Token")
if (token != null && token.length != 0) {
getApp().globalData.token = token
}
let isLogin = uni.getStorageSync("isLogin")
if (isLogin != null && isLogin == 1) {
getApp().globalData.isLogin = isLogin
}
let sid = uni.getStorageSync("sid")
if (sid != null && sid.length != 0) {
getApp().globalData.sid = sid
}
console.log('用户Sid', getApp().globalData.sid)
console.log('token', getApp().globalData.token)
console.log('是否登陆', getApp().globalData.isLogin)
// setTimeout(() => {
if (getApp().globalData.isLogin) {
var userSid = getApp().globalData.sid
console.log(">>>>>", userSid)
this.listQuery.params.userSid = userSid
this.loadData();
// uni.setTabBarBadge({ //
// index: 0, //tabbar
// text: '100' //
// })
} else {
/* #ifdef MP-WEIXIN */
this.WxSilentLogin()
/* #endif */
/* #ifdef APP-PLUS */
uni.redirectTo({
url: '../login/login'
})
/* #endif */
}
},
onShow() {
console.log('onShow', getApp().globalData.isLogin)
if (this.dataList.length > 0) {
var num = 0
for (var i = 0; i < this.dataList.length; i++) {
var item = this.dataList[i]
if (item.ostate == '0') {
num++;
}
}
console.log('num', num)
if (num != 0) {
uni.setTabBarBadge({ //
index: 1, //tabbar
text: num > 100 ? "99+" : num + "" //
})
}
}
},
methods: {
itemClick(item) {
console.log('item', item.pagepath)
uni.navigateTo({
url: "/" + item.pagepath
})
item.ostate = "2"
},
//
async loadData(type = 'add', loading) {
//
if (type === 'add') {
if (this.loadingType === 'nomore') {
return;
}
this.loadingType = 'loading';
} else {
this.loadingType = 'more';
}
var list = []
this.$api.messageListPage(this.listQuery).then((resp) => {
// if (resp.success) {
console.log('1111', resp)
// list = resp.records
for (var i = 0; i < resp.records.length; i++) {
var item = resp.records[i]
var title = item.map.thing2
console.log("title", title)
list.push({
messageName: title,
name: item.map.thing3,
date: item.map.time1,
pagepath: item.pagepath,
ostate: item.ostate
})
}
console.log("消息列表", list)
if (type === 'refresh') {
this.dataList = [];
}
this.dataList = this.dataList.concat(list);
console.log("消息列表>>>>>", this.dataList.length)
if (this.dataList.length > 0) {
var num = 0
for (var i = 0; i < this.dataList.length; i++) {
var item = this.dataList[i]
if (item.ostate == '0') {
num++;
}
}
if (num != 0) {
uni.setTabBarBadge({ //
index: 1, //tabbar
text: num > 100 ? "99+" : num + "" //
})
}
}
//more nomore(20)
this.loadingType = this.dataList.length > list.total ? 'nomore' : 'more';
if (type === 'refresh') {
if (loading == 1) {
uni.hideLoading();
} else {
uni.stopPullDownRefresh();
}
}
}).catch(e => {
console.log('eeeee', e)
})
},
}
}
</script>
<style lang="scss">
.pages {
width: 100%;
height: 100%;
.newslist {
display: flex;
flex-direction: column;
background: #fff;
border-radius: 12px;
margin-left: 12px;
margin-right: 12px;
margin-top: 12px;
padding: 15px 20px;
.item-top {
display: flex;
flex-direction: row;
align-items: center;
padding-bottom: 12px;
padding-left: 5px;
padding-right: 5px;
border-bottom: 1px solid #F1F3F5;
.drop {
width: 6px;
height: 6px;
background: #f00;
border-radius: 50%;
margin-right: 5px;
}
.item-top-img {
width: 18px;
height: 18px;
}
.item-top-text {
flex: 1;
margin-right: 10px;
font-size: 16px;
color: #101010;
font-weight: 600;
font-family: sans-serif;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.item-top-text2 {
font-size: 14px;
color: #0A59F7;
}
}
.item-con {
margin-top: 12px;
display: flex;
flex-direction: column;
.item-con-text {
font-size: 15px;
color: #666666;
}
}
.item-bom {
width: 100%;
margin-top: 12px;
padding-top: 10px;
border-top: 1px solid #F1F3F5;
display: flex;
flex-direction: row;
align-items: center;
justify-content: end;
.item-bom-img {
width: 14px;
height: 14px;
}
.item-bom-text {
margin-left: 5px;
font-size: 14px;
color: #999;
}
}
}
}
</style>

600
supervise-uniapp/pages/index/GoodsException.vue

@ -0,0 +1,600 @@
<template>
<view class="pages">
<view class="top">
<view class="top-item">
<view class="top-item-drop"></view>
<view class="top-item-text">
<text class="top-item-text1">仓库名称</text>
<text class="top-item-text2">{{info.warehouseName}}</text>
</view>
</view>
<view class="top-item" style="margin-top: 20px;">
<view class="top-item-drop"></view>
<view class="top-item-text">
<text class="top-item-text1">异常时间</text>
<text class="top-item-text2">{{info.exceptionTime}}</text>
</view>
</view>
<view class="top-item" style="margin-top: 20px;">
<view class="top-item-bom">
<text class="top-item-bom-text1" @click="textClick('1')">联系库房</text>
<text class="top-item-bom-text2" @click="textClick('2')">工作派单</text>
</view>
</view>
</view>
<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltoupper="upper"
@scrolltolower="lower" @scroll="scroll">
<view style="padding-bottom: 50px;">
<view v-for="(item,index) in info.dataList" class="newslist">
<view class="list-item">
<view class="list-item-top">
<text class="list-item-top-text1">摄像头</text>
<text class="list-item-top-text2">{{item.name}}</text>
<text class="list-item-top-text3" @click="openApplet(item.name)">查看设备</text>
</view>
<view class="list-item-bom">
<view class="list-item-image">
<image class="img" :src="item.startImage" mode="aspectFill"
@click="amplifyImage(item.startImage)"></image>
<text class="time">{{item.startTime}}</text>
</view>
<view class="content">
<text class="content-text1">{{item.similarity}}</text>
<text class="content-text2"> 相似度 </text>
</view>
<view class="list-item-image">
<image class="img" :src="item.endImage" mode="aspectFill"
@click="amplifyImage(item.endImage)"></image>
<text class="time">{{item.endTime}}</text>
</view>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</template>
<script>
export default {
data() {
return {
tokenValue: '',
scrollTop: 0,
old: {
scrollTop: 0
},
params: {
sid: "",
// sid: "",
wxCode: "",
},
info: {
warehouseSid: "",
warehouseName: "",
exceptionTime: "",
linkers:[],
dataList: [
// {
// url1: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg",
// time1: "2023-04-06 16:00",
// ratio: "80%",
// name: "1",
// url2: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg",
// time2: "2023-04-06 16:00",
// },
// {
// url1: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg",
// time1: "2023-04-06 16:00",
// ratio: "80%",
// name: "2",
// url2: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg",
// time2: "2023-04-06 16:00",
// },
// {
// url1: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg",
// time1: "2023-04-06 16:00",
// ratio: "80%",
// name: "3",
// url2: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg",
// time2: "2023-04-06 16:00",
// },
// {
// url1: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg",
// time1: "2023-04-06 16:00",
// ratio: "80%",
// name: "4",
// url2: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg",
// time2: "2023-04-06 16:00",
// },
// {
// url1: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg",
// time1: "2023-04-06 16:00",
// ratio: "80%",
// name: "5",
// url2: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg",
// time2: "2023-04-06 16:00",
// },
// {
// url1: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg",
// time1: "2023-04-06 16:00",
// ratio: "80%",
// name: "6",
// url2: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg",
// time2: "2023-04-06 16:00",
// },
// {
// url1: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg",
// time1: "2023-04-06 16:00",
// ratio: "80%",
// name: "7",
// url2: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg",
// time2: "2023-04-06 16:00",
// },
// {
// url1: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg",
// time1: "2023-04-06 16:00",
// ratio: "80%",
// name: "8",
// url2: "http://e.hiphotos.baidu.com/image/pic/item/a1ec08fa513d2697e542494057fbb2fb4316d81e.jpg",
// time2: "2023-04-06 16:00",
// },
]
}
}
},
onLoad(option) {
this.params = {
sid: option.sid
}
console.log("sid", this.params.sid)
wx.hideHomeButton()
this.init()
uni.request({
//
url: "https://supervise.yxtsoft.com/monitorapi/device/getToken",
// GET POST
method: "GET",
header: {
//
'content-type': "application/x-www-form-urlencoded"
},
//
data: {},
success: res => {
this.tokenValue = res.data.data
console.log("tokenValueres", this.tokenValue)
},
fail: (err) => {},
complete: () => {}
});
},
methods: {
//
preventHandler() {
return
},
upper: function(e) {
console.log(e)
},
lower: function(e) {
console.log(e)
},
scroll: function(e) {
console.log(e)
this.old.scrollTop = e.detail.scrollTop
},
init() {
let that = this
wx.login({
success: function(res) {
if (res.code) {
console.log('Http网络请求信息', {
"wxCode": res.code
})
that.params.wxCode = res.code
that.getData(that.params)
}
},
fail: function(res) {
uni.showToast({
title: "网络错误,请退出后重新进入。",
icon: 'none'
})
}
});
},
getData(data) {
console.log("data", data)
this.$api.getGoodsExceptionInfo(data).then((resp) => {
// if (resp.success) {
console.log('1111', resp)
this.info.warehouseSid = resp.shSid
this.info.warehouseName = resp.shName
this.info.exceptionTime = resp.messageTime
this.info.linkers = resp.linkers
var str = resp.text.substring(1, (resp.text.length - 1))
console.log('1111', str)
var str2 = str.split("DeviceImages")
console.log('222', str2)
for (var i = 0; i < str2.length; i++) {
var item = str2[i]
if (item) {
var str3 = item.split(", ")
console.log('3333', str3)
var endImage = str3[0].substring(10)
console.log('endImage', endImage)
var endTime = str3[1].substring(8)
console.log('endTime', endTime)
var name = str3[2].substring(5)
console.log('name', name)
var similarity = str3[3].substring(11)
console.log('similarity', similarity)
var startImage = str3[4].substring(11)
console.log('startImage', startImage)
var startTime = str3[5].substring(10, str3[5].length - 1)
console.log('startTime', startTime)
this.info.dataList.push({
endImage: endImage,
endTime: endTime,
name: name,
similarity: similarity,
startImage: startImage,
startTime: startTime,
})
}
}
}).catch(e => {
console.log('eeeee', e)
})
},
textClick(index) {
switch (index) {
case "1":
//
// uni.showToast({
// icon: "none",
// title: '',
// duration: 2000,
// });
uni.navigateTo({
url: '../index/ContactWarehouse?info='+JSON.stringify( this.info),
});
break;
case "2":
//
uni.showToast({
icon: "none",
title: '工作派单',
duration: 2000,
});
// uni.navigateTo({
// url: '../index/ReadWork'
// });
break;
default:
break;
}
},
amplifyImage(imgUrl) {
wx.previewImage({
current: '',
urls: [imgUrl]
})
},
openApplet(name) {
var _this = this
// var deviceValue = "" //
// var channelNoValue = "" // IPC1
var modelTypeValue = "" // full,simple,voiceType,security
var backModelTypeValue = "" // full,simple
var startTimeValue = Date.parse(new Date()) - 24 * 60 * 60 *
1000 // << 132022-09-14 20:52:05 == 1663159925000
var endTimeValue = Date.parse(new Date()) // 132022-09-14 20:52:05 == 1663159925000
var playbackSourceValue = "" // cloudlocal使
// var envVersion = "release" // release
uni.request({
//
url: "https://supervise.yxtsoft.com/monitorapi/device/getDeviceListBySid",
// GET POST
method: "GET",
header: {
//
'content-type': "application/x-www-form-urlencoded"
},
//
data: {
"sid": _this.info.warehouseSid,
"deviceName": name
},
success: res => {
console.log("请求res", res)
// deviceValue = res.data.nvrSerial
// channelNoValue = res.data.channelNo
console.log("tokenValue", _this.tokenValue)
console.log("deviceValue", res.data.data.nvrSerial)
console.log("channelNoValue", res.data.data.channelNo)
console.log("startTimeValue", startTimeValue)
console.log("endTimeValue", endTimeValue)
wx.openEmbeddedMiniProgram({
appId: 'wxf2b3a0262975d8c2',
path: '/pages/live/live?accessToken=' + _this.tokenValue + '&deviceSerial=' +
res.data.data.nvrSerial + '&channelNo=' + res.data.data.channelNo + '&modelType=' +
modelTypeValue + '&backModelType=' + backModelTypeValue +
'&startTime=' +
startTimeValue + '&endTime=' + endTimeValue + '&playbackSource=' +
playbackSourceValue,
envVersion: 'release'
})
},
fail: (err) => {},
complete: () => {}
});
}
}
}
</script>
<style lang="scss">
.pages {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
position: fixed;
overflow: auto;
.top {
display: flex;
flex-direction: column;
padding: 15px 20px;
.top-item {
display: flex;
flex-direction: row;
align-items: center;
.top-item-drop {
background: #1684FC;
border-radius: 50%;
width: 8px;
height: 8px;
}
.top-item-text {
margin-left: 10px;
display: flex;
flex-direction: row;
align-items: center;
.top-item-text1 {
font-size: 15px;
color: #666;
}
.top-item-text2 {
font-size: 18px;
color: #000;
font-weight: 600;
font-family: sans-serif;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
}
.top-item-bom {
display: flex;
flex-direction: row;
width: 100%;
margin-left: 30px;
margin-right: 30px;
justify-content: space-between;
.top-item-bom-text1 {
padding: 5px 20px;
color: #2F96E1;
font-size: 14px;
border: 1px solid #2F96E1;
border-radius: 5px;
}
.top-item-bom-text2 {
padding: 5px 20px;
color: #fff;
font-size: 14px;
background: #2F96E1;
border-radius: 5px;
}
}
}
}
.scroll-Y {
overflow-y: hidden;
height: 90vh;
.newslist {
margin-top: 10px;
display: flex;
flex-direction: column;
padding-left: 10px;
padding-right: 10px;
.list-item {
margin-top: 10px;
display: flex;
flex-direction: column;
background: #fff;
border-radius: 5px;
.list-item-top {
display: flex;
flex-direction: row;
align-items: center;
border-bottom: 1px solid #ECECEC;
padding-bottom: 10px;
margin-top: 10px;
padding-left: 10px;
.list-item-top-text1 {
font-size: 15px;
color: #666;
}
.list-item-top-text2 {
font-size: 18px;
flex: 1;
margin-right: 10px;
color: #000;
font-weight: 600;
font-family: sans-serif;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.list-item-top-text3 {
margin-right: 10px;
font-size: 12px;
color: #2F96E1;
border: 1px solid #2F96E1;
border-radius: 5px;
padding: 5px 10px;
}
}
.list-item-bom {
display: flex;
flex-direction: row;
margin-bottom: 15px;
margin-top: 10px;
margin-left: 15px;
margin-right: 15px;
.list-item-image {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.img {
border-radius: 8px;
width: 100%;
height: 70px;
}
.time {
margin-top: 8px;
color: #1684FC;
font-size: 10px;
}
}
.content {
margin-top: 5px;
height: 65px;
margin-left: 10px;
margin-right: 10px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border: 1px solid #FC8C05;
border-radius: 50%;
padding-left: 13px;
padding-right: 13px;
.content-text1 {
font-size: 18px;
font-weight: 600;
font-family: sans-serif;
color: #ff5500;
}
.content-text2 {
font-size: 12px;
color: #000;
}
}
}
}
}
}
}
</style>

190
supervise-uniapp/pages/index/RiskWarning.vue

@ -0,0 +1,190 @@
<template>
<view class="pages">
<view>
<view v-for="(item,index) in dataList" class="newslist">
<view class="item" @click="itemClick(item.sid)">
<view class="item-lift">
<text class="item-lift-top">{{item.time}} [二级风险]</text>
<text class="item-lift-bom">{{item.name}}-{{item.cont}}</text>
</view>
<image class="imge" src="../../static/baseIcon/zy.png"></image>
</view>
</view>
</view>
<!-- 加载....没有更多 -->
<view style="line-height: 60rpx;margin-bottom: 50px;">
<u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" />
</view>
</view>
</template>
<script>
export default {
data() {
return {
status: 'loadmore',
iconType: 'flower',
loadText: {
loadmore: '轻轻上拉',
loading: '努力加载中',
nomore: '拉也没用,没有了'
},
listQuery: {
current: 1,
size: 10,
params: {
userSid: "",
}
},
loadingType: 'more', //
dataList: [
]
}
},
onPullDownRefresh() {
this.listQuery.current = 1
this.loadData('refresh');
setTimeout(function() {
uni.stopPullDownRefresh();
}, 2000);
},
//
onReachBottom() {
this.listQuery.current = this.listQuery.current + 1
this.loadData();
},
onLoad() {
var userSid = getApp().globalData.sid
console.log(">>>>>", userSid)
this.listQuery.params.userSid = userSid
this.loadData();
},
methods: {
//
async loadData(type = 'add', loading) {
//
if (type === 'add') {
if (this.loadingType === 'nomore') {
return;
}
this.loadingType = 'loading';
} else {
this.loadingType = 'more';
}
var list = []
console.log('listQuery', this.listQuery)
this.$api.riskListPage(this.listQuery).then((resp) => {
// if (resp.success) {
console.log('1111', resp)
for (var i = 0; i < resp.records.length; i++) {
var item = resp.records[i]
var data = item.map
console.log("data", data)
list.push({
sid:item.riskSid,
time: data.time5,
name: data.thing3,
cont: data.thing4,
})
}
console.log("消息列表", list)
if (type === 'refresh') {
this.dataList = [];
}
this.dataList = this.dataList.concat(list);
console.log("消息列表>>>>>", this.dataList.length)
//more nomore(20)
this.loadingType = this.dataList.length > list.total ? 'nomore' : 'more';
if (type === 'refresh') {
if (loading == 1) {
uni.hideLoading();
} else {
uni.stopPullDownRefresh();
}
}
}).catch(e => {
console.log('eeeee', e)
})
},
itemClick(sid) {
console.log('sid', sid)
uni.navigateTo({
url: "/pages/index/GoodsException?sid=" + sid
})
}
}
}
</script>
<style lang="scss">
.pages {
width: 100%;
height: 100%;
padding-top: 10px;
.newslist {
display: flex;
flex-direction: column;
.item {
background: #fff;
border-bottom: 1px solid #eee;
display: flex;
flex-direction: row;
align-items: center;
padding: 15px 20px;
.item-lift {
flex: 1;
display: flex;
flex-direction: column;
.item-lift-top {
color: #101010;
font-size: 16px;
font-weight: 600;
font-family: sans-serif
}
.item-lift-bom {
margin-top: 5px;
color: #707070;
font-size: 15px;
}
}
.imge {
width: 20px;
height: 20px;
}
}
}
}
</style>

196
supervise-uniapp/pages/index/SystemFailure.vue

@ -0,0 +1,196 @@
<template>
<view class="pages">
<view class="top">
<view class="top-item" >
<view class="top-item-drop"></view>
<view class="top-item-text">
<text class="top-item-text1">异常时间</text>
<text class="top-item-text2">{{info.exceptionTime}}</text>
</view>
</view>
<view class="top-item" style="margin-top: 20px;">
<view class="top-item-bom">
<text class="top-item-bom-text1" @click="textClick('1')">联系技术人员</text>
<text class="top-item-bom-text2" @click="textClick('2')">工作派单</text>
</view>
</view>
</view>
<view class="bom">
<image class="img" src="https://supervise.yxtsoft.com/img/base/xtgz.png"></image>
<text class="text" >提示监控中心未收到报警系统的消息请联系技术人员</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
info: {
warehouseSid: "",
exceptionTime: "",
}
}
},
onLoad(option) {
// this.sid = option.sid
this.info = {
warehouseSid: option.shSid,
exceptionTime: option.date,
}
console.log("sid", this.info.warehouseSid)
wx.hideHomeButton()
},
methods: {
textClick(index) {
switch (index) {
case "1":
//
uni.showToast({
icon: "none",
title: '联系技术人员',
duration: 2000,
});
// wx.makePhoneCall({
// //
// phoneNumber: ""
// })
break;
case "2":
//
uni.showToast({
icon: "none",
title: '工作派单',
duration: 2000,
});
// uni.navigateTo({
// url: '../index/ReadWork'
// });
break;
default:
break;
}
},
}
}
</script>
<style lang="scss">
.pages {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
position: fixed;
overflow: auto;
.top {
display: flex;
flex-direction: column;
padding: 15px 20px;
.top-item {
display: flex;
flex-direction: row;
align-items: center;
.top-item-drop {
background: #1684FC;
border-radius: 50%;
width: 8px;
height: 8px;
}
.top-item-text {
margin-left: 10px;
display: flex;
flex-direction: row;
align-items: center;
.top-item-text1 {
font-size: 15px;
color: #666;
}
.top-item-text2 {
font-size: 18px;
color: #000;
font-weight: 600;
font-family: sans-serif;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
}
.top-item-bom {
display: flex;
flex-direction: row;
width: 100%;
margin-left: 30px;
margin-right: 30px;
justify-content: space-between;
.top-item-bom-text1 {
padding: 5px 20px;
color: #2F96E1;
font-size: 14px;
border: 1px solid #2F96E1;
border-radius: 5px;
}
.top-item-bom-text2 {
padding: 5px 20px;
color: #fff;
font-size: 14px;
background: #2F96E1;
border-radius: 5px;
}
}
}
}
.bom {
display: flex;
padding: 20px;
flex-direction: column;
justify-content: center;
align-items: center;
.img {
width: 180px;
height: 180px;
}
.text{
width: 60%;
line-height: 25px;
color: #6C6C6C;
margin-top: 10px;
}
}
}
</style>
Loading…
Cancel
Save