Commit 303d4ad6 by zhangzhen

细节优化

parent 1bcfc2e2
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<view class="flex-between"> <view class="flex-between">
<view class="flex-row-center"> <view class="flex-row-center">
<image class="icon" src="../../static/big-data/line_icon.png" mode="widthFix"></image> <image class="icon" src="../../static/big-data/line_icon.png" mode="widthFix"></image>
<text class="text-title text-lg text-bold">{{item.deviceName}}</text> <text class="text-title text-lg text-bold">{{item.deviceName}}-{{item.deviceModel}}</text>
</view> </view>
<view class="flex-row-center"> <view class="flex-row-center">
<image v-if="['1','2','3','4'].includes(item.status)" class="icon" src="../../static/d_s_1.png" mode="widthFix"></image> <image v-if="['1','2','3','4'].includes(item.status)" class="icon" src="../../static/d_s_1.png" mode="widthFix"></image>
...@@ -165,7 +165,8 @@ ...@@ -165,7 +165,8 @@
4:"复位", 4:"复位",
5:"一级报警", 5:"一级报警",
6:"二级报警" 6:"二级报警"
} },
mockDataList: []
}; };
}, },
onLoad() { onLoad() {
...@@ -212,8 +213,135 @@ ...@@ -212,8 +213,135 @@
companyCode: this.factoryList[this.factoryIndex].companyCode, companyCode: this.factoryList[this.factoryIndex].companyCode,
date: moment(this.date).format("YYYYMMDD") date: moment(this.date).format("YYYYMMDD")
}).then(res => { }).then(res => {
if (res.data.__sys__.status === 0) { if (res.data.__sys__.status === 0 && res.data.result) {
this.dataChatList = res.data.result.map(item => {
let list = res.data.result
this.mockDataList =[
{
deviceCode:'SB000098',
deviceModel:'G8098F',
deviceName:'切割机_98',
errerTime:[
{
[moment(this.date).subtract(6, 'd').format("MMDD")]:212
},
{
[moment(this.date).subtract(5, 'd').format("MMDD")]:300,
},
{
[moment(this.date).subtract(4, 'd').format("MMDD")]:146,
},
{
[moment(this.date).subtract(3, 'd').format("MMDD")]:245,
},
{
[moment(this.date).subtract(2, 'd').format("MMDD")]:242,
},
{
[moment(this.date).subtract(1, 'd').format("MMDD")]:106,
},
{
[moment(this.date).format("MMDD")]:123
}
],
runTime:[
{
[moment(this.date).subtract(6, 'd').format("MMDD")]:12
},
{
[moment(this.date).subtract(5, 'd').format("MMDD")]:34
},
{
[moment(this.date).subtract(4, 'd').format("MMDD")]:24
},
{
[moment(this.date).subtract(3, 'd').format("MMDD")]:45
},
{
[moment(this.date).subtract(2, 'd').format("MMDD")]:61
},
{
[moment(this.date).subtract(1, 'd').format("MMDD")]:68
},
{
[moment(this.date).format("MMDD")]:31
}
],
status:'1'
},
{
deviceCode:'SB000099',
deviceModel:'G8099F',
deviceName:'切割机_99',
errerTime:[
{
[moment(this.date).subtract(6, 'd').format("MMDD")]:232
},
{
[moment(this.date).subtract(5, 'd').format("MMDD")]:240,
},
{
[moment(this.date).subtract(4, 'd').format("MMDD")]:186,
},
{
[moment(this.date).subtract(3, 'd').format("MMDD")]:145,
},
{
[moment(this.date).subtract(2, 'd').format("MMDD")]:222,
},
{
[moment(this.date).subtract(1, 'd').format("MMDD")]:116,
},
{
[moment(this.date).format("MMDD")]:223
}
],
runTime:[
{
[moment(this.date).subtract(6, 'd').format("MMDD")]:24
},
{
[moment(this.date).subtract(5, 'd').format("MMDD")]:24
},
{
[moment(this.date).subtract(4, 'd').format("MMDD")]:14
},
{
[moment(this.date).subtract(3, 'd').format("MMDD")]:25
},
{
[moment(this.date).subtract(2, 'd').format("MMDD")]:41
},
{
[moment(this.date).subtract(1, 'd').format("MMDD")]:48
},
{
[moment(this.date).format("MMDD")]:21
}
],
status:'1'
}
]
list.push(...this.mockDataList)
this.dataChatList = list.map(item => {
return { return {
...item, ...item,
echartShow: false, echartShow: false,
......
...@@ -2,17 +2,17 @@ ...@@ -2,17 +2,17 @@
<view class="bg-gradual-blue"> <view class="bg-gradual-blue">
<scroll-view scroll-y class="DrawerPage" :class="modalName=='viewModal'?'show':''"> <scroll-view scroll-y class="DrawerPage" :class="modalName=='viewModal'?'show':''">
<view class="header" :style="{paddingTop:statusBarHeight+8+'px'}"> <view class="header" :style="{paddingTop:statusBarHeight+8+'px'}">
<view class="title-header"> <view class="title-header">
<image class="logo" v-if="companyInfo.appIconUrl" :src="companyInfo.appIconUrl" mode="heightFix"></image> <image class="logo" v-if="userInfo.appIconUrl" :src="userInfo.appIconUrl" mode="heightFix"></image>
<!-- <img class="logo" :src="companyInfo.appIconUrl" alt="" /> --> <!-- <img class="logo" :src="companyInfo.appIconUrl" alt="" /> -->
<text v-else class="text-white">{{companyInfo.companyName}}</text> <text v-else class="text-white">{{userInfo.userName}}</text>
</view> </view>
<view class="out-login" > <view class="out-login">
<text class="text-title text-grey margin-right-sm text-lg">{{userInfo.userName || ''}}</text> <text class="text-title text-grey margin-right-sm text-lg">{{userInfo.userName || ''}}</text>
<text class="out-login-btn text-blue" @tap="outLogin">退出</text> <text class="out-login-btn text-blue" @tap="outLogin">退出</text>
</view> </view>
</view> </view>
<!-- <view v-if="statusBarHeight>0" class="content-black" :style="{height:statusBarHeight+45+'px'}"> <!-- <view v-if="statusBarHeight>0" class="content-black" :style="{height:statusBarHeight+45+'px'}">
</view> --> </view> -->
<view class="flex-col content" :style=""> <view class="flex-col content" :style="">
...@@ -22,31 +22,35 @@ ...@@ -22,31 +22,35 @@
<text class="text-1">内部管理</text> <text class="text-1">内部管理</text>
<text class="text-2">Internal management</text> <text class="text-2">Internal management</text>
</view> --> </view> -->
<swiper class="swiper-box" :indicator-dots="true" :autoplay="true" indicator-active-color="#ffffff" :circular="true" :interval="3000" :duration="1000"> <swiper class="swiper-box" :indicator-dots="true" :autoplay="true" indicator-active-color="#ffffff"
:circular="true" :interval="3000" :duration="1000">
<swiper-item v-for="(item,k) in swiperList" :key="k"> <swiper-item v-for="(item,k) in swiperList" :key="k">
<view class="swiper-item"> <view class="swiper-item">
<image class="img" :src="item.img" mode="scaleToFill"></image> <image class="img" :src="item.img" mode="scaleToFill"></image>
</view> </view>
</swiper-item> </swiper-item>
</swiper> </swiper>
</view> </view>
<view class="list-content-box"> <view class="list-content-box">
<view v-for="(val, i) in list" :key="i" v-if="val.childMenu && val.childMenu.length" class="list-content-item"> <view v-for="(val, i) in list" :key="i" v-if="val.childMenu && val.childMenu.length"
class="list-content-item">
<view class="header-title"> <view class="header-title">
<text class="text-lg text-black text-title text-bold">{{val.text}}</text> <text class="text-lg text-black text-title text-bold">{{val.text}}</text>
</view> </view>
<view class="flex-row list-box"> <view class="flex-row list-box">
<view v-for="(item,k) in val.childMenu" :key="k" class="flex-col list-item" :class="k>=4?'margin-top-sm':''" @tap="onNavTo(item)"> <view v-for="(item,k) in val.childMenu" :key="k" class="flex-col list-item"
:class="k>=4?'margin-top-sm':''" @tap="onNavTo(item)">
<view class="icon-box"> <view class="icon-box">
<image class="img" :src="item.imagePath || '../../static/'+item.label+'.png'" mode="scaleToFill"></image> <image class="img" :src="item.imagePath || '../../static/'+item.label+'.png'"
mode="scaleToFill"></image>
</view> </view>
<text class="text-black margin-top-sm text-bold">{{item.text}}</text> <text class="text-black margin-top-sm text-bold">{{item.text}}</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
...@@ -84,24 +88,23 @@ ...@@ -84,24 +88,23 @@
} from "@/utils/tools.js"; } from "@/utils/tools.js";
import banner1 from "@/static/banner_1.png"; import banner1 from "@/static/banner_1.png";
import config from "@/config/index.config"; import config from "@/config/index.config";
export default { export default {
components: {}, components: {},
data() { data() {
return { return {
assetsPath: config.assetsPath, assetsPath: config.assetsPath,
companyInfo:'', companyInfo: '',
mode:'', mode: '',
queryData: "", queryData: "",
statusBarHeight: uni.getStorageSync("statusHeight") || 0, statusBarHeight: uni.getStorageSync("statusHeight") || 0,
modalName: null, modalName: null,
userInfo:"", userInfo: "",
swiperList:[ swiperList: [{
{ img: banner1
img:banner1 }],
} list: [],
], companyList: []
list: []
}; };
}, },
onShow() { onShow() {
...@@ -113,22 +116,22 @@ ...@@ -113,22 +116,22 @@
if (option && option.mode && option.sheight) { if (option && option.mode && option.sheight) {
this.queryData = option; this.queryData = option;
this.statusBarHeight = Number(option.sheight); this.statusBarHeight = Number(option.sheight);
uni.setStorageSync("mode",option.mode) uni.setStorageSync("mode", option.mode)
uni.setStorageSync("statusHeight",this.statusBarHeight) uni.setStorageSync("statusHeight", this.statusBarHeight)
} }
}, },
methods: { methods: {
onGetBannerList(){ onGetBannerList() {
getBannerList({ getBannerList({
"companyCode": uni.getStorageSync("orgCode") "companyCode": uni.getStorageSync("orgCode")
}).then(res =>{ }).then(res => {
if(res.data.result && res.data.result.length){ if (res.data.result && res.data.result.length) {
this.swiperList = res.data.result.map(item =>{ this.swiperList = res.data.result.map(item => {
return { return {
img:this.assetsPath+"/hggp/file/download/"+item.DOC_ID img: this.assetsPath + "/hggp/file/download/" + item.DOC_ID
} }
}) })
} }
}) })
}, },
...@@ -142,37 +145,51 @@ ...@@ -142,37 +145,51 @@
getOrgInfo({ getOrgInfo({
'inqu_status-0-companyCodes': uni.getStorageSync("orgCode") 'inqu_status-0-companyCodes': uni.getStorageSync("orgCode")
}).then(res => { }).then(res => {
let resData = toJsonData(res.data.__blocks__.result.rows,res.data.__blocks__.result.meta.columns); if (res.data.__blocks__.result.rows && res.data.__blocks__.result.rows.length) {
if(resData && resData.length){ let resData = toJsonData(res.data.__blocks__.result.rows, res.data.__blocks__.result.meta
let list = resData.map(item=>{ .columns);
return { if (resData && resData.length) {
...item, this.companyList = resData.map(item => {
appIconUrl: item.docIdApp ? this.assetsPath+"/hggp/file/download/"+item.docIdApp: '' return {
} ...item,
}) appIconUrl: item.docIdApp ? this.assetsPath + "/hggp/file/download/" +
this.companyInfo = list[0] item.docIdApp : ''
} }
}) })
getUserInfo({ getUserInfo({
'userId': uni.getStorageSync("orgCode") 'userId': uni.getStorageSync("orgCode")
}).then(res=>{ }).then(res => {
if(res.data.__sys__.status ==1){ if (res.data.__sys__.status == 1) {
this.userInfo = res.data.result;
uni.setStorageSync("userInfor",this.userInfo) let obj = this.companyList.find(item => item.accountCode === res.data
.result.accountCode)
if (obj) {
this.userInfo = {
...obj,
...res.data.result
}
} else {
this.userInfo = res.data.result;
}
uni.setStorageSync("userInfor", this.userInfo)
}
})
}
} }
}) })
}, },
onGetMenu(){ onGetMenu() {
getMenu().then(res=>{ getMenu().then(res => {
if(res.data.__sys__.status === 0){ if (res.data.__sys__.status === 0) {
this.list = res.data.menu.map(item=>{ this.list = res.data.menu.map(item => {
return { return {
...item, ...item,
imagePath: item.imagePath? this.assetsPath+"/hggp/file/download/"+item.imagePath:false imagePath: item.imagePath ? this.assetsPath + "/hggp/file/download/" + item
.imagePath : false
} }
}); });
}else{ } else {
this.list = [] this.list = []
} }
}) })
...@@ -205,37 +222,43 @@ ...@@ -205,37 +222,43 @@
width: 100vw; width: 100vw;
overflow: hidden; overflow: hidden;
} }
.header{
.header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding-bottom: 8px; padding-bottom: 8px;
.title-header{
.title-header {
margin-left: 30upx; margin-left: 30upx;
height: 32px; height: 32px;
.logo{
.logo {
display: block; display: block;
height: 100%; height: 100%;
max-width: 375upx; max-width: 375upx;
} }
} }
} }
.content{
.title-header{ .content {
.title-header {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: 100%; width: 100%;
height: 100%; height: 100%;
.logo{
.logo {
width: 160px; width: 160px;
height: 26px; height: 26px;
border-radius: 4px; border-radius: 4px;
} }
} }
} }
.DrawerPage { .DrawerPage {
position: fixed; position: fixed;
width: 100vw; width: 100vw;
...@@ -251,8 +274,9 @@ ...@@ -251,8 +274,9 @@
align-items: center; align-items: center;
height: 100%; height: 100%;
padding: 0 20upx; padding: 0 20upx;
// min-width: 300upx; // min-width: 300upx;
.out-login-btn{ .out-login-btn {
text-decoration: underline; text-decoration: underline;
} }
} }
...@@ -359,20 +383,24 @@ ...@@ -359,20 +383,24 @@
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
.icon { .icon {
width: 100%; width: 100%;
max-height: 170px; max-height: 170px;
} }
.absolute{
.absolute {
z-index: 10; z-index: 10;
.text-1{
.text-1 {
font-weight: 600; font-weight: 600;
font-size: 36upx; font-size: 36upx;
color: #235BC5; color: #235BC5;
margin-top: 6%; margin-top: 6%;
margin-left: 30upx; margin-left: 30upx;
} }
.text-2{
.text-2 {
font-size: 26upx; font-size: 26upx;
color: #3068D2; color: #3068D2;
font-weight: 500; font-weight: 500;
...@@ -381,37 +409,43 @@ ...@@ -381,37 +409,43 @@
margin-left: 30upx; margin-left: 30upx;
} }
} }
.text-black { .text-black {
color: #101010; color: #101010;
font-weight: bold; font-weight: bold;
} }
} }
.list-content-box{ .list-content-box {
display: flex;
flex-direction: column;
.list-content-item{
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.header-title{
padding: 12upx 30upx 0 30upx; .list-content-item {
display: flex;
flex-direction: column;
.header-title {
padding: 12upx 30upx 0 30upx;
}
} }
} }
}
.list-box { .list-box {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
margin:20upx 30upx; margin: 20upx 30upx;
background-color: #ffffff; background-color: #ffffff;
padding: 30upx 12upx 20upx; padding: 30upx 12upx 20upx;
border-radius: 20upx; border-radius: 20upx;
box-shadow: 0 4upx 12upx rgba(0, 0, 0, 0.2); box-shadow: 0 4upx 12upx rgba(0, 0, 0, 0.2);
.list-item { .list-item {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: 25%; width: 25%;
.icon-box { .icon-box {
display: flex; display: flex;
justify-content: center; justify-content: center;
...@@ -422,14 +456,15 @@ ...@@ -422,14 +456,15 @@
// box-shadow: 0 8upx 12upx rgba(0, 0, 0, 0.2), 0 -4upx 12upx rgba(0, 0, 0, 0.34) inset; // box-shadow: 0 8upx 12upx rgba(0, 0, 0, 0.2), 0 -4upx 12upx rgba(0, 0, 0, 0.34) inset;
border-radius: 24upx; border-radius: 24upx;
background: linear-gradient(-84deg, #3386FF 0%, #39A9FC 100%); background: linear-gradient(-84deg, #3386FF 0%, #39A9FC 100%);
.img { .img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
} }
.margin-top-sm{
.margin-top-sm {
margin-top: 12upx; margin-top: 12upx;
font-weight: 600; font-weight: 600;
font-size: 24upx; font-size: 24upx;
...@@ -437,21 +472,24 @@ ...@@ -437,21 +472,24 @@
} }
} }
} }
.content-black{
.content-black {
display: flex; display: flex;
width: 100%; width: 100%;
} }
.swiper-box{
.swiper-box {
width: 100%; width: 100%;
height: 168px; height: 168px;
.swiper-item{
.swiper-item {
width: 100%; width: 100%;
height: 100%; height: 100%;
.img{
.img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
} }
} }
</style> </style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment