Merge branch 'test' of http://42.192.7.176:3000/suojin/laboratory_maintenance_app into test
commit
a3b1073204
23 changed files with 947 additions and 285 deletions
@ -0,0 +1,130 @@ |
||||
<template> |
||||
<view class="eacharts-box"> |
||||
|
||||
<!-- 饼状图 --> |
||||
<view class="echartsPie"> |
||||
<view class="pie-item"> |
||||
<view style="height:308rpx;margin-top: 40rpx;"><l-echart ref="chartRefPieLeft" :key="Math.random()"></l-echart></view> |
||||
</view> |
||||
</view> |
||||
|
||||
</view> |
||||
</template> |
||||
<script> |
||||
import * as echarts from "echarts"; |
||||
import lEchart from "@/uni_modules/lime-echart/components/lime-echart/"; |
||||
export default { |
||||
components: { lEchart }, |
||||
props: { |
||||
type: { |
||||
type: String, |
||||
default: "", |
||||
}, |
||||
echartData: { |
||||
type: Array, |
||||
default: [] |
||||
} |
||||
}, |
||||
watch: { |
||||
echartData(val) { |
||||
this.pieInfo = val |
||||
this.maintenancePieInit() |
||||
} |
||||
}, |
||||
data() { |
||||
return { |
||||
form: { |
||||
searchTime: "", |
||||
startTime: "", |
||||
endTime: "", |
||||
}, |
||||
pieInfo: [],//饼图数据 |
||||
|
||||
}; |
||||
}, |
||||
mounted() { }, |
||||
methods: { |
||||
// 故障现象分类 |
||||
maintenancePieInit() { |
||||
let opts = { |
||||
series: [ |
||||
{ |
||||
name: "", |
||||
type: "pie", |
||||
center: ['50%', '50%'], |
||||
roseType: 'area', |
||||
label: { |
||||
// 饼图图形上的文本标签,可用于说明图形的一些数据信息,比如值,名称等. |
||||
normal: { |
||||
show: true, |
||||
fontSize: 8, // 是否显示标签[ default: false ] |
||||
position: "outside", // 标签的位置。'outside'饼图扇区外侧,通过视觉引导线连到相应的扇区。'inside','inner' 同 'inside',饼图扇区内部。'center'在饼图中心位置。 |
||||
formatter: "{b}\n {c}", // 标签内容 |
||||
color: '#000' |
||||
}, |
||||
}, |
||||
|
||||
data: this.pieInfo, |
||||
emphasis: { |
||||
itemStyle: { |
||||
shadowBlur: 10, |
||||
shadowOffsetX: 0, |
||||
shadowColor: "rgba(0, 0, 0, 1)", |
||||
}, |
||||
}, |
||||
labelLine: { |
||||
// 标签的视觉引导线样式,在 label 位置 设置为'outside'的时候会显示视觉引导线。 |
||||
normal: { |
||||
show: true, // 是否显示视觉引导线。 |
||||
length: 5, // 在 label 位置 设置为'outside'的时候会显示视觉引导线。 |
||||
length2: 5, |
||||
|
||||
// 视觉引导项第二段的长度。 |
||||
lineStyle: { |
||||
// 视觉引导线的样式 |
||||
type: "solid", |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
], |
||||
}; |
||||
this.$refs.chartRefPieLeft.init((config) => { |
||||
const { canvas } = config; |
||||
const chart = echarts.init(canvas, null, config); |
||||
chart.setOption(opts); |
||||
// 需要把 chart 返回 |
||||
return chart; |
||||
}); |
||||
}, |
||||
|
||||
}, |
||||
}; |
||||
</script> |
||||
<style lang="scss" scoped> |
||||
.eacharts-box { |
||||
background: #fff; |
||||
margin: 0 32rpx 32rpx; |
||||
border-radius: 20rpx; |
||||
overflow: hidden; |
||||
|
||||
.echarts { |
||||
width: calc(100% - 64rpx); |
||||
height: 368rpx; |
||||
margin: 0 auto 20rpx; |
||||
} |
||||
|
||||
.echartsPie { |
||||
width: calc(100% - 64rpx); |
||||
min-height: 308rpx; |
||||
margin: 0 auto 0; |
||||
|
||||
.pie-item { |
||||
width: 100%; |
||||
height: 368rpx; |
||||
overflow: hidden; |
||||
// float: left; |
||||
} |
||||
} |
||||
} |
||||
</style> |
||||
@ -0,0 +1,129 @@ |
||||
<template> |
||||
<view class="eacharts-box"> |
||||
|
||||
<!-- 饼状图 --> |
||||
<view class="echartsPie"> |
||||
<view class="pie-item"> |
||||
<view style="height:308rpx;margin-top: 40rpx;"><l-echart ref="chartRefPieLeft" :key="Math.random()"></l-echart></view> |
||||
</view> |
||||
</view> |
||||
|
||||
</view> |
||||
</template> |
||||
<script> |
||||
import * as echarts from "echarts"; |
||||
import lEchart from "@/uni_modules/lime-echart/components/lime-echart/"; |
||||
export default { |
||||
components: { lEchart }, |
||||
props: { |
||||
type: { |
||||
type: String, |
||||
default: "", |
||||
}, |
||||
echartData: { |
||||
type: Array, |
||||
default: [] |
||||
} |
||||
}, |
||||
watch: { |
||||
echartData(val) { |
||||
this.pieInfo = val |
||||
this.maintenancePieInit() |
||||
} |
||||
}, |
||||
data() { |
||||
return { |
||||
form: { |
||||
searchTime: "", |
||||
startTime: "", |
||||
endTime: "", |
||||
}, |
||||
pieInfo: [],//饼图数据 |
||||
|
||||
}; |
||||
}, |
||||
mounted() { }, |
||||
methods: { |
||||
// 故障现象分类 |
||||
maintenancePieInit() { |
||||
let opts = { |
||||
series: [ |
||||
{ |
||||
name: "", |
||||
type: "pie", |
||||
radius: ['40%', '70%'], |
||||
label: { |
||||
// 饼图图形上的文本标签,可用于说明图形的一些数据信息,比如值,名称等. |
||||
normal: { |
||||
show: true, |
||||
fontSize: 8, // 是否显示标签[ default: false ] |
||||
position: "outside", // 标签的位置。'outside'饼图扇区外侧,通过视觉引导线连到相应的扇区。'inside','inner' 同 'inside',饼图扇区内部。'center'在饼图中心位置。 |
||||
formatter: "{b}\n {c}", // 标签内容 |
||||
color: '#000' |
||||
}, |
||||
}, |
||||
|
||||
data: this.pieInfo, |
||||
emphasis: { |
||||
itemStyle: { |
||||
shadowBlur: 10, |
||||
shadowOffsetX: 0, |
||||
shadowColor: "rgba(0, 0, 0, 1)", |
||||
}, |
||||
}, |
||||
labelLine: { |
||||
// 标签的视觉引导线样式,在 label 位置 设置为'outside'的时候会显示视觉引导线。 |
||||
normal: { |
||||
show: true, // 是否显示视觉引导线。 |
||||
length: 5, // 在 label 位置 设置为'outside'的时候会显示视觉引导线。 |
||||
length2: 5, |
||||
|
||||
// 视觉引导项第二段的长度。 |
||||
lineStyle: { |
||||
// 视觉引导线的样式 |
||||
type: "solid", |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
], |
||||
}; |
||||
this.$refs.chartRefPieLeft.init((config) => { |
||||
const { canvas } = config; |
||||
const chart = echarts.init(canvas, null, config); |
||||
chart.setOption(opts); |
||||
// 需要把 chart 返回 |
||||
return chart; |
||||
}); |
||||
}, |
||||
|
||||
}, |
||||
}; |
||||
</script> |
||||
<style lang="scss" scoped> |
||||
.eacharts-box { |
||||
background: #fff; |
||||
margin: 0 32rpx 32rpx; |
||||
border-radius: 20rpx; |
||||
overflow: hidden; |
||||
|
||||
.echarts { |
||||
width: calc(100% - 64rpx); |
||||
height: 368rpx; |
||||
margin: 0 auto 20rpx; |
||||
} |
||||
|
||||
.echartsPie { |
||||
width: calc(100% - 64rpx); |
||||
min-height: 308rpx; |
||||
margin: 0 auto 0; |
||||
|
||||
.pie-item { |
||||
width: 100%; |
||||
height: 368rpx; |
||||
overflow: hidden; |
||||
// float: left; |
||||
} |
||||
} |
||||
} |
||||
</style> |
||||
@ -0,0 +1,178 @@ |
||||
<template> |
||||
<view class="notice-list"> |
||||
|
||||
<scroll-view scroll-y="true" |
||||
style="height:calc(100vh - 140rpx);width: 100%;background: #F5F5F5;margin-top:32rpx" |
||||
:refresher-triggered="triggered" :refresher-enabled="true" @refresherrefresh="refresherrefresh" |
||||
refresher-background="#f1f1f1" @scrolltolower="onListBottom"> |
||||
<ul class="card"> |
||||
<li v-for="(item, index) in dataList" :key="index" @click="jump(item)"> |
||||
<view class="title"> |
||||
<view class="text"> |
||||
<view>{{ item.title }}</view> |
||||
<!-- <view class="mark" v-if="!item.readStatus"></view> --> |
||||
</view> |
||||
<view style="flex-shrink: 0;color: #999999;">{{ item.categoryName }}</view> |
||||
</view> |
||||
<view> |
||||
<u-parse :html="item.content"></u-parse> |
||||
</view> |
||||
</li> |
||||
</ul> |
||||
<view style=" line-height: 100rpx;"> |
||||
<uni-load-more :status="scrollType"></uni-load-more> |
||||
</view> |
||||
</scroll-view> |
||||
</view> |
||||
</template> |
||||
<script> |
||||
// import requestName from '@/common/requestName' |
||||
export default { |
||||
name: 'NoticeList', |
||||
data() { |
||||
return { |
||||
dataList: [ |
||||
], |
||||
current: 0, |
||||
style: { |
||||
borderRadius: '100px', |
||||
background: '#fff', |
||||
padding: '0 32rpx' |
||||
}, |
||||
search: { |
||||
pageNo: 1, |
||||
pageSize: 20, |
||||
readStatus: '' |
||||
}, |
||||
scrollType: '', |
||||
triggered: false, |
||||
refreshNeed: false |
||||
} |
||||
}, |
||||
onLoad(data) { |
||||
this.getList() |
||||
}, |
||||
onShow() { |
||||
console.log(this.refreshNeed); |
||||
if (this.refreshNeed) { |
||||
this.reSearch() |
||||
} |
||||
}, |
||||
|
||||
methods: { |
||||
|
||||
getList() { |
||||
this.$u.api.getNoticeList(this.search).then(res => { |
||||
if (res.code == 200) { |
||||
let data = res.data.records |
||||
this.scrollType = '' |
||||
this.triggered = false |
||||
if (data.length >= this.search.pageSize) { |
||||
this.scrollType = 'more' |
||||
} |
||||
this.dataList = this.dataList.concat(data) |
||||
} |
||||
}) |
||||
}, |
||||
|
||||
reSearch() { |
||||
this.search.pageNo = 1 |
||||
this.dataList = [] |
||||
this.getList() |
||||
}, |
||||
|
||||
onListBottom() { |
||||
if (this.scrollType == 'more') { |
||||
this.search.pageNo += 1 |
||||
this.getList() |
||||
} |
||||
}, |
||||
onreachBottom() { |
||||
this.getDevicePage() |
||||
}, |
||||
refresherrefresh() { |
||||
this.triggered = true |
||||
this.reSearch() |
||||
} |
||||
}, |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.notice-list { |
||||
height: calc(100vh - 0px); |
||||
background: #F5F5F5; |
||||
overflow: hidden; |
||||
|
||||
.mark-read-btn { |
||||
background: #FFFFFF; |
||||
border-radius: 8rpx; |
||||
border: 1px solid rgba(255, 255, 255, 0.43); |
||||
padding: 0; |
||||
margin: 24rpx 30rpx; |
||||
text-align: center; |
||||
height: 88rpx; |
||||
line-height: 88rpx; |
||||
font-size: 30rpx; |
||||
color: #FF8800; |
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
|
||||
image { |
||||
width: 34rpx; |
||||
height: 32rpx; |
||||
display: block; |
||||
margin-right: 20rpx; |
||||
fill: #004BAA |
||||
} |
||||
} |
||||
|
||||
|
||||
.card { |
||||
margin: 0 16px; |
||||
list-style: none; |
||||
padding: 0; |
||||
|
||||
li { |
||||
background: #FFFFFF; |
||||
border-radius: 4px; |
||||
border: 1px solid rgba(255, 255, 255, 0.43); |
||||
padding: 12px 14px; |
||||
margin-bottom: 24rpx; |
||||
font-size: 28rpx; |
||||
|
||||
.title { |
||||
border-bottom: 1px solid #F0F0F0; |
||||
display: flex; |
||||
justify-content: space-between; |
||||
padding-bottom: 10rpx; |
||||
margin-bottom: 15rpx; |
||||
|
||||
|
||||
.text { |
||||
font-size: 30rpx; |
||||
flex-grow: 1; |
||||
display: flex; |
||||
margin-right: 20rpx; |
||||
font-weight: 400; |
||||
color: #333333; |
||||
} |
||||
|
||||
.mark { |
||||
width: 16rpx; |
||||
height: 16rpx; |
||||
background: #D9362D; |
||||
border-radius: 50%; |
||||
margin-left: 12rpx; |
||||
margin-top: 5rpx; |
||||
flex-shrink: 0; |
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
} |
||||
} |
||||
} |
||||
</style> |
||||
@ -0,0 +1,187 @@ |
||||
<template> |
||||
<view class="notice-list"> |
||||
<view @click="markReadAll" class="mark-read-btn"> |
||||
<image src="@/static/images/home/notice.svg" alt="" /> |
||||
一键标记为已读 |
||||
</view> |
||||
<scroll-view scroll-y="true" style="height:calc(100vh - 140rpx);width: 100%;background: #F5F5F5;" |
||||
:refresher-triggered="triggered" :refresher-enabled="true" @refresherrefresh="refresherrefresh" |
||||
refresher-background="#f1f1f1" @scrolltolower="onListBottom"> |
||||
<ul class="card"> |
||||
<li v-for="(item, index) in dataList" :key="index" @click="jump(item)"> |
||||
<view class="title"> |
||||
<view class="text"> |
||||
<view>{{ item.title }}</view> |
||||
<view class="mark" v-if="!item.readStatus"></view> |
||||
</view> |
||||
<view style="flex-shrink: 0;color: #999999;">{{ item.createdAt }}</view> |
||||
</view> |
||||
<view> |
||||
{{ item.content }} |
||||
</view> |
||||
</li> |
||||
</ul> |
||||
<view style=" line-height: 100rpx;"> |
||||
<uni-load-more :status="scrollType"></uni-load-more> |
||||
</view> |
||||
</scroll-view> |
||||
</view> |
||||
</template> |
||||
<script> |
||||
// import requestName from '@/common/requestName' |
||||
export default { |
||||
name: 'NoticeList', |
||||
data() { |
||||
return { |
||||
dataList: [], |
||||
current: 0, |
||||
style: { |
||||
borderRadius: '100px', |
||||
background: '#fff', |
||||
padding: '0 32rpx' |
||||
}, |
||||
search: { |
||||
pageNo: 1, |
||||
pageSize: 20, |
||||
readStatus: '' |
||||
}, |
||||
scrollType: '', |
||||
triggered: false, |
||||
refreshNeed: false |
||||
} |
||||
}, |
||||
onLoad(data) { |
||||
this.getList() |
||||
}, |
||||
onShow() { |
||||
console.log(this.refreshNeed); |
||||
if (this.refreshNeed) { |
||||
this.reSearch() |
||||
} |
||||
}, |
||||
methods: { |
||||
|
||||
/** |
||||
* @description 全部设为已读 |
||||
*/ |
||||
markReadAll() { |
||||
// this.$wx_http.post(requestName['updateReadStatus'], [-1]).then(res => { |
||||
// if (res.code == 0) { |
||||
// this.reSearch() |
||||
// } |
||||
// }) |
||||
}, |
||||
|
||||
getList() { |
||||
// this.$wx_http.get(requestName['pageNotice'], this.search).then(res => { |
||||
// let data = res.data.records |
||||
// this.scrollType = '' |
||||
// this.triggered = false |
||||
// if (data.length >= this.search.pageSize) { |
||||
// this.scrollType = 'more' |
||||
// } |
||||
// this.dataList = this.dataList.concat(data) |
||||
// }) |
||||
}, |
||||
|
||||
reSearch() { |
||||
this.search.pageNo = 1 |
||||
this.dataList = [] |
||||
this.getList() |
||||
}, |
||||
|
||||
onListBottom() { |
||||
if (this.scrollType == 'more') { |
||||
this.search.pageNo += 1 |
||||
this.getList() |
||||
} |
||||
}, |
||||
onreachBottom() { |
||||
this.getDevicePage() |
||||
}, |
||||
refresherrefresh() { |
||||
this.triggered = true |
||||
this.reSearch() |
||||
} |
||||
}, |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.notice-list { |
||||
height: calc(100vh - 0px); |
||||
background: #F5F5F5; |
||||
overflow: hidden; |
||||
|
||||
.mark-read-btn { |
||||
background: #FFFFFF; |
||||
border-radius: 8rpx; |
||||
border: 1px solid rgba(255, 255, 255, 0.43); |
||||
padding: 0; |
||||
margin: 24rpx 30rpx; |
||||
text-align: center; |
||||
height: 88rpx; |
||||
line-height: 88rpx; |
||||
font-size: 30rpx; |
||||
color: #FF8800; |
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
|
||||
image { |
||||
width: 34rpx; |
||||
height: 32rpx; |
||||
display: block; |
||||
margin-right: 20rpx; |
||||
fill:#004BAA |
||||
} |
||||
} |
||||
|
||||
|
||||
.card { |
||||
margin: 0 16px; |
||||
list-style: none; |
||||
padding: 0; |
||||
|
||||
li { |
||||
background: #FFFFFF; |
||||
border-radius: 4px; |
||||
border: 1px solid rgba(255, 255, 255, 0.43); |
||||
padding: 12px 14px; |
||||
margin-bottom: 24rpx; |
||||
font-size: 28rpx; |
||||
|
||||
.title { |
||||
border-bottom: 1px solid #F0F0F0; |
||||
display: flex; |
||||
justify-content: space-between; |
||||
padding-bottom: 10rpx; |
||||
margin-bottom: 15rpx; |
||||
|
||||
|
||||
.text { |
||||
font-size: 30rpx; |
||||
flex-grow: 1; |
||||
display: flex; |
||||
margin-right: 20rpx; |
||||
font-weight: 400; |
||||
color: #333333; |
||||
} |
||||
|
||||
.mark { |
||||
width: 16rpx; |
||||
height: 16rpx; |
||||
background: #D9362D; |
||||
border-radius: 50%; |
||||
margin-left: 12rpx; |
||||
margin-top: 5rpx; |
||||
flex-shrink: 0; |
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
} |
||||
} |
||||
} |
||||
</style> |
||||
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
Loading…
Reference in new issue