Commit 303d4ad6 by zhangzhen

细节优化

parent 1bcfc2e2
......@@ -37,7 +37,7 @@
<view class="flex-between">
<view class="flex-row-center">
<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 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>
......@@ -165,7 +165,8 @@
4:"复位",
5:"一级报警",
6:"二级报警"
}
},
mockDataList: []
};
},
onLoad() {
......@@ -212,8 +213,135 @@
companyCode: this.factoryList[this.factoryIndex].companyCode,
date: moment(this.date).format("YYYYMMDD")
}).then(res => {
if (res.data.__sys__.status === 0) {
this.dataChatList = res.data.result.map(item => {
if (res.data.__sys__.status === 0 && res.data.result) {
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 {
...item,
echartShow: false,
......
......@@ -2,17 +2,17 @@
<view class="bg-gradual-blue">
<scroll-view scroll-y class="DrawerPage" :class="modalName=='viewModal'?'show':''">
<view class="header" :style="{paddingTop:statusBarHeight+8+'px'}">
<view class="title-header">
<image class="logo" v-if="companyInfo.appIconUrl" :src="companyInfo.appIconUrl" mode="heightFix"></image>
<!-- <img class="logo" :src="companyInfo.appIconUrl" alt="" /> -->
<text v-else class="text-white">{{companyInfo.companyName}}</text>
</view>
<view class="out-login" >
<text class="text-title text-grey margin-right-sm text-lg">{{userInfo.userName || ''}}</text>
<text class="out-login-btn text-blue" @tap="outLogin">退出</text>
</view>
<view class="title-header">
<image class="logo" v-if="userInfo.appIconUrl" :src="userInfo.appIconUrl" mode="heightFix"></image>
<!-- <img class="logo" :src="companyInfo.appIconUrl" alt="" /> -->
<text v-else class="text-white">{{userInfo.userName}}</text>
</view>
<view class="out-login">
<text class="text-title text-grey margin-right-sm text-lg">{{userInfo.userName || ''}}</text>
<text class="out-login-btn text-blue" @tap="outLogin">退出</text>
</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 class="flex-col content" :style="">
......@@ -22,31 +22,35 @@
<text class="text-1">内部管理</text>
<text class="text-2">Internal management</text>
</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">
<view class="swiper-item">
<image class="img" :src="item.img" mode="scaleToFill"></image>
</view>
</swiper-item>
</swiper>
</view>
</view>
<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">
<text class="text-lg text-black text-title text-bold">{{val.text}}</text>
</view>
<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">
<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>
<text class="text-black margin-top-sm text-bold">{{item.text}}</text>
</view>
</view>
</view>
</view>
</view>
......@@ -84,24 +88,23 @@
} from "@/utils/tools.js";
import banner1 from "@/static/banner_1.png";
import config from "@/config/index.config";
export default {
components: {},
data() {
return {
assetsPath: config.assetsPath,
companyInfo:'',
mode:'',
companyInfo: '',
mode: '',
queryData: "",
statusBarHeight: uni.getStorageSync("statusHeight") || 0,
modalName: null,
userInfo:"",
swiperList:[
{
img:banner1
}
],
list: []
userInfo: "",
swiperList: [{
img: banner1
}],
list: [],
companyList: []
};
},
onShow() {
......@@ -113,22 +116,22 @@
if (option && option.mode && option.sheight) {
this.queryData = option;
this.statusBarHeight = Number(option.sheight);
uni.setStorageSync("mode",option.mode)
uni.setStorageSync("statusHeight",this.statusBarHeight)
uni.setStorageSync("mode", option.mode)
uni.setStorageSync("statusHeight", this.statusBarHeight)
}
},
methods: {
onGetBannerList(){
onGetBannerList() {
getBannerList({
"companyCode": uni.getStorageSync("orgCode")
}).then(res =>{
if(res.data.result && res.data.result.length){
this.swiperList = res.data.result.map(item =>{
"companyCode": uni.getStorageSync("orgCode")
}).then(res => {
if (res.data.result && res.data.result.length) {
this.swiperList = res.data.result.map(item => {
return {
img:this.assetsPath+"/hggp/file/download/"+item.DOC_ID
img: this.assetsPath + "/hggp/file/download/" + item.DOC_ID
}
})
}
})
},
......@@ -142,37 +145,51 @@
getOrgInfo({
'inqu_status-0-companyCodes': uni.getStorageSync("orgCode")
}).then(res => {
let resData = toJsonData(res.data.__blocks__.result.rows,res.data.__blocks__.result.meta.columns);
if(resData && resData.length){
let list = resData.map(item=>{
return {
...item,
appIconUrl: item.docIdApp ? this.assetsPath+"/hggp/file/download/"+item.docIdApp: ''
}
})
this.companyInfo = list[0]
}
})
getUserInfo({
'userId': uni.getStorageSync("orgCode")
}).then(res=>{
if(res.data.__sys__.status ==1){
this.userInfo = res.data.result;
uni.setStorageSync("userInfor",this.userInfo)
if (res.data.__blocks__.result.rows && res.data.__blocks__.result.rows.length) {
let resData = toJsonData(res.data.__blocks__.result.rows, res.data.__blocks__.result.meta
.columns);
if (resData && resData.length) {
this.companyList = resData.map(item => {
return {
...item,
appIconUrl: item.docIdApp ? this.assetsPath + "/hggp/file/download/" +
item.docIdApp : ''
}
})
getUserInfo({
'userId': uni.getStorageSync("orgCode")
}).then(res => {
if (res.data.__sys__.status == 1) {
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(){
getMenu().then(res=>{
if(res.data.__sys__.status === 0){
this.list = res.data.menu.map(item=>{
onGetMenu() {
getMenu().then(res => {
if (res.data.__sys__.status === 0) {
this.list = res.data.menu.map(item => {
return {
...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 = []
}
})
......@@ -205,37 +222,43 @@
width: 100vw;
overflow: hidden;
}
.header{
.header {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 8px;
.title-header{
.title-header {
margin-left: 30upx;
height: 32px;
.logo{
.logo {
display: block;
height: 100%;
max-width: 375upx;
}
}
}
.content{
.title-header{
.content {
.title-header {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
.logo{
.logo {
width: 160px;
height: 26px;
border-radius: 4px;
}
}
}
}
.DrawerPage {
position: fixed;
width: 100vw;
......@@ -251,8 +274,9 @@
align-items: center;
height: 100%;
padding: 0 20upx;
// min-width: 300upx;
.out-login-btn{
.out-login-btn {
text-decoration: underline;
}
}
......@@ -359,20 +383,24 @@
display: flex;
flex-direction: row;
align-items: center;
.icon {
width: 100%;
max-height: 170px;
max-height: 170px;
}
.absolute{
.absolute {
z-index: 10;
.text-1{
.text-1 {
font-weight: 600;
font-size: 36upx;
color: #235BC5;
margin-top: 6%;
margin-left: 30upx;
}
.text-2{
.text-2 {
font-size: 26upx;
color: #3068D2;
font-weight: 500;
......@@ -381,37 +409,43 @@
margin-left: 30upx;
}
}
.text-black {
color: #101010;
font-weight: bold;
}
}
.list-content-box{
display: flex;
flex-direction: column;
.list-content-item{
.list-content-box {
display: flex;
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 {
display: flex;
flex-wrap: wrap;
margin:20upx 30upx;
background-color: #ffffff;
margin: 20upx 30upx;
background-color: #ffffff;
padding: 30upx 12upx 20upx;
border-radius: 20upx;
box-shadow: 0 4upx 12upx rgba(0, 0, 0, 0.2);
.list-item {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 25%;
.icon-box {
display: flex;
justify-content: center;
......@@ -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;
border-radius: 24upx;
background: linear-gradient(-84deg, #3386FF 0%, #39A9FC 100%);
.img {
width: 100%;
height: 100%;
}
}
.margin-top-sm{
.margin-top-sm {
margin-top: 12upx;
font-weight: 600;
font-size: 24upx;
......@@ -437,21 +472,24 @@
}
}
}
.content-black{
.content-black {
display: flex;
width: 100%;
}
.swiper-box{
.swiper-box {
width: 100%;
height: 168px;
.swiper-item{
.swiper-item {
width: 100%;
height: 100%;
.img{
.img {
width: 100%;
height: 100%;
}
}
}
</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