Merge branch 'dev-sy-10-10'

This commit is contained in:
BianLzhaoMin 2024-12-10 09:20:13 +08:00
commit 9b5d6173d8
10 changed files with 261 additions and 66 deletions

View File

@ -4,13 +4,19 @@
"version" : "0.0",
"configurations" : [
{
"app-plus" : {
"launchtype" : "local"
},
"default" : {
"launchtype" : "local"
},
"type" : "uniCloud"
"app-plus" :
{
"launchtype" : "local"
},
"default" :
{
"launchtype" : "local"
},
"mp-weixin" :
{
"launchtype" : "local"
},
"type" : "uniCloud"
},
{
"playground" : "standard",

View File

@ -0,0 +1,129 @@
<template>
<view class="notice-bar-container">
<view class="notice-bar-wrapper">
<view class="notice-bar-content" :style="scrollStyle">
<text v-for="(text, index) in textArray" :key="index" :style="textStyle[index]">
{{ text }}
</text>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
textArray: {
type: Array,
default: () => []
},
textStyle: {
type: Array,
default: () => []
},
scrollSpeed: {
type: Number,
default: 1 //
}
},
data() {
return {
scrollPosition: 0, //
totalWidth: 0, //
containerWidth: 0, //
scrollInterval: null //
}
},
computed: {
// transform
scrollStyle() {
return {
transform: `translateX(${this.scrollPosition}px)`,
transition: 'transform 0s linear' // transition
}
}
},
mounted() {
this.calculateDimensions() //
},
methods: {
//
calculateDimensions() {
const query = uni.createSelectorQuery().in(this)
//
query
.select('.notice-bar-content')
.boundingClientRect(rect => {
this.totalWidth = rect.width
this.startScroll() //
})
.exec()
//
query
.select('.notice-bar-container')
.boundingClientRect(rect => {
this.containerWidth = rect.width
})
.exec()
},
//
startScroll() {
let currentPosition = 0 //
const speed = this.scrollSpeed
const updateScroll = () => {
//
currentPosition += speed
//
if (currentPosition >= this.totalWidth) {
currentPosition = 0 //
}
//
this.scrollPosition = -currentPosition
}
//
if (this.scrollInterval) {
clearInterval(this.scrollInterval) //
}
this.scrollInterval = setInterval(updateScroll, 20) // 20ms `scrollSpeed`
}
},
destroyed() {
if (this.scrollInterval) {
clearInterval(this.scrollInterval) //
}
}
}
</script>
<style scoped lang="scss">
.notice-bar-container {
width: 100%;
height: 100%;
overflow: hidden;
white-space: nowrap;
background-color: #fff; /* 可根据需要修改背景颜色 */
}
.notice-bar-wrapper {
display: flex;
align-items: center;
}
.notice-bar-content {
display: flex;
align-items: center;
white-space: nowrap;
height: 56rpx;
line-height: 56rpx;
text {
margin-left: 20rpx;
}
}
</style>

View File

@ -440,7 +440,7 @@ export default {
.catch(err => {
uni.$u.toast('登录失败')
this.$store.dispatch('LogOut').then(() => {
console.log(err)
console.log(err + '999')
uni.showToast({
title: err,
icon: 'none'

View File

@ -115,15 +115,26 @@
<!-- 风险提示 -->
<view class="today-warning">
<image class="warning-img" src="../../../static/images/img-phase-two/index_news.png" mode=""></image>
<text>今日风险</text>
<text style="margin-right: 20rpx">今日风险</text>
<view class="uni-notice-bar" @tap="onJumpWorkPlan">
<uni-notice-bar
<!-- <uni-notice-bar
style="height: 100%"
:speed="30"
background-color="#fff"
scrollable
:text="noticeText"
></uni-notice-bar>
></uni-notice-bar> -->
<MultiColorNoticeBar
:textArray="[
`高风险:${highRiskNum}`,
`中风险:${mediumRiskNum}`,
`低风险:${lowRiskNum}`,
`作业计划人数:${planPersonNum}`
]"
:textStyle="[{ color: '#bc2843' }, { color: '#ffed51' }, { color: '#7dda76' }, { color: '#000000' }]"
:scrollSpeed="1"
/>
</view>
</view>
@ -352,6 +363,7 @@ import PieChartsModelRingTwo from './components/pie-charts-model-ring-two'
import PieChartsModelMan from './components/pie-charts-model-man.vue'
import PieChartsModelGirl from './components/pie-charts-model-girl.vue'
import { getHomePageListApi } from '@/api/phaseTwo/homePage'
import MultiColorNoticeBar from '../../../components/MultiColorNoticeBar'
export default {
components: {
@ -360,7 +372,8 @@ export default {
PieChartsModelRing,
PieChartsModelRingTwo,
PieChartsModelMan,
PieChartsModelGirl
PieChartsModelGirl,
MultiColorNoticeBar
},
data() {
return {
@ -1065,7 +1078,7 @@ export default {
.today-warning {
margin: 30rpx 0;
height: 68rpx;
padding: 0 30rpx;
padding-left: 30rpx;
display: flex;
align-items: center;
border: 1rpx solid #ccc;
@ -1078,8 +1091,10 @@ export default {
}
.uni-notice-bar {
flex: 1;
// flex: 1;
width: 65%;
height: 50rpx;
padding-left: 20rpx;
// line-height: 50rpx;
// background-color: orange;
}

View File

@ -1958,7 +1958,7 @@ export default {
console.log('上传成功!', uploadFileRes)
const imgInfo = {
name: imgName,
tempUrl: `ynPlan/zbh/${this.$moment().format('YYYY')}/${this.$moment().format(
tempUrl: `ynPlanf/zbh/${this.$moment().format('YYYY')}/${this.$moment().format(
'MM'
)}/${this.$moment().format('DD')}/${imgName}`,
url: imgUrl

View File

@ -712,7 +712,7 @@ export default {
zgs: {
rules: [{ required: true, errorMessage: '请填写公司职工人数' }]
},
rys: {
fbrys: {
rules: [{ required: true, errorMessage: '请填写分包人员人数' }]
},
jtcls: {
@ -758,7 +758,7 @@ export default {
{ form_label: '现场负责人电话', items_type: 'ipt', required: true, name: 'fzrdh' },
{ form_label: '全体人数', items_type: 'ipt', required: true, name: 'qtrs', isType: 'number' },
{ form_label: '公司职工人数', items_type: 'ipt', required: true, name: 'zgs', isType: 'number' },
{ form_label: '分包人员人数', items_type: 'ipt', required: true, name: 'rys', isType: 'number' },
{ form_label: '分包人员人数', items_type: 'ipt', required: true, name: 'fbrys', isType: 'number' },
{ form_label: '交通用车', items_type: 'ipt', required: true, name: 'jtcls' },
{ form_label: '特种作业车辆', items_type: 'ipt', required: true, name: 'tscls' },

View File

@ -371,14 +371,20 @@ export default {
this.subUserList = []
// this.subUserListTemp
tempArray.forEach(e => {
this.subUserListAll.forEach(j => {
if (!e.includes(j.idNumber)) {
// this.subUserList.push(j)
this.subUserList.push(JSON.parse(JSON.stringify(j)))
// this.subUserListTemp.push(JSON.parse(JSON.stringify(j)))
}
})
if (e.length > 1) {
this.subUserListAll.forEach(j => {
if (!e.includes(j.idNumber)) {
// this.subUserList.push(j)
this.subUserList.push(JSON.parse(JSON.stringify(j)))
// this.subUserListTemp.push(JSON.parse(JSON.stringify(j)))
}
})
}
})
if (this.subUserList.length == 0) {
this.subUserList = JSON.parse(JSON.stringify(this.subUserListAll))
}
} else {
this.subUserList = JSON.parse(JSON.stringify(this.subUserListAll))
// this.subUserListTemp = JSON.parse(JSON.stringify(this.subUserListAll))
@ -624,6 +630,8 @@ export default {
this.personList = JSON.parse(options.personList).personList
console.log(this.personList, ' this.personList****')
// console.log('options.index', options.index)
this.currentIndex = options.index
@ -634,31 +642,34 @@ export default {
computed: {
onAlreadySelect() {
let amount = 0
if (this.subUserList.length > 0) {
this.subUserList.forEach(e => {
if (e.isChecked) {
amount++
}
})
}
return amount
// if (this.subUserList.length > 0) {
// this.subUserList.forEach(e => {
// if (e.isChecked) {
// amount++
// }
// })
// }
if (this.subUserList.length > 0) return this.subUserList.filter(e => e.isChecked == true).length
// return amount
},
isAllChecked() {
let isCheckedAll = false
if (this.subUserList.length > 0) {
isCheckedAll = this.subUserList.every(e => e.isChecked === true)
if (this.subUserList.length > 0) return this.subUserList.every(e => e.isChecked === true)
// if (this.subUserList.length > 0) {
// isCheckedAll = this.subUserList.every(e => e.isChecked === true)
// if (isCheckedAll) {
// this.subUserListTemp.forEach(e => {
// e.isChecked = true
// })
// } else {
// this.subUserListTemp.forEach(e => {
// e.isChecked = false
// })
// }
}
return isCheckedAll
// // if (isCheckedAll) {
// // this.subUserListTemp.forEach(e => {
// // e.isChecked = true
// // })
// // } else {
// // this.subUserListTemp.forEach(e => {
// // e.isChecked = false
// // })
// // }
// }
// return isCheckedAll
}
}
}

View File

@ -253,7 +253,7 @@ export default {
{ form_label: '现场负责人电话', items_type: 'ipt', required: true, name: 'fzrdh' },
{ form_label: '全体人数', items_type: 'ipt', required: true, name: 'qtrs', isType: 'number' },
{ form_label: '公司职工人数', items_type: 'ipt', required: true, name: 'zgs', isType: 'number' },
{ form_label: '分包人员人数', items_type: 'ipt', required: true, name: 'rys', isType: 'number' },
{ form_label: '分包人员人数', items_type: 'ipt', required: true, name: 'fbrys', isType: 'number' },
{ form_label: '交通用车', items_type: 'ipt', required: true, name: 'jtcls' },
{ form_label: '特种作业车辆', items_type: 'ipt', required: true, name: 'tscls' },

View File

@ -247,7 +247,7 @@ export default {
{ form_label: '现场负责人电话', items_type: 'ipt', required: true, name: 'fzrdh' },
{ form_label: '全体人数', items_type: 'ipt', required: true, name: 'qtrs', isType: 'number' },
{ form_label: '公司职工人数', items_type: 'ipt', required: true, name: 'zgs', isType: 'number' },
{ form_label: '分包人员人数', items_type: 'ipt', required: true, name: 'rys', isType: 'number' },
{ form_label: '分包人员人数', items_type: 'ipt', required: true, name: 'fbrys', isType: 'number' },
{ form_label: '交通用车', items_type: 'ipt', required: true, name: 'jtcls' },
{ form_label: '特种作业车辆', items_type: 'ipt', required: true, name: 'tscls' },

View File

@ -2,22 +2,49 @@
<view class="notice-container">
<!-- <uni-notice-bar :showClose="showClose" :showIcon="showIcon" scrollable :text="noticeContent" /> -->
<image class="warning-img" src="../../../../static/images/img-phase-two/index_news.png" mode=""></image>
<text>今日风险</text>
<view class="uni-notice-bar" @tap="onViewRiskDetails">
<uni-notice-bar
style="height: 100%"
:speed="50"
scrollable
:text="noticeContent"
:showClose="showClose"
:showIcon="showIcon"
></uni-notice-bar>
<view style="width: 200rpx">今日风险</view>
<!-- <MultiColorNoticeBar :speed="30" backgroundColor="#fff" @tap="onViewRiskDetails">
<text style="color: red">重要通知</text>
<text style="color: blue">这是一条</text>
<text style="color: green">多彩的</text>
<text style="color: orange">滚动公告</text>
<text style="color: orange">滚动公告</text>
<text style="color: orange">滚动公告</text>
<text style="color: orange">滚动公告</text>
</MultiColorNoticeBar> -->
<view @tap="onViewRiskDetails" style="width: 70%">
<MultiColorNoticeBar
:textArray="[
`风险总数:${tfx} `,
`可接受风险:${kjs} `,
`低风险:${dfx} `,
`中风险:${zfx} `,
`高风险:${gfx} `,
`特高风险:${tfx} `
]"
:textStyle="[
{ color: '#000000' },
{ color: '#7dda76' },
{ color: '#7dda76' },
{ color: '#ffed51' },
{ color: '#bc2843' },
{ color: '#bc2843' }
]"
:scrollSpeed="1"
/>
</view>
<!-- <view class="uni-notice-bar" >
</view> -->
</view>
</template>
<script>
import { getTitleRiskApi } from '../../../../api/workPlan/homePage'
import MultiColorNoticeBar from '../../../../components/MultiColorNoticeBar/index.vue'
export default {
props: {
// /* */
@ -36,13 +63,17 @@ export default {
default: false
}
},
components: {
MultiColorNoticeBar
},
data() {
return {
kjs: 0,
dfx: 0,
zfx: 0,
gfx: 0,
tfx: 0
tfx: 0,
amount: 0
}
},
computed: {
@ -74,6 +105,8 @@ export default {
this.tfx = e.num * 1
}
})
this.amount = this.kjs + this.dfx + +this.zfx + this.gfx + this.tfx
}
},
onViewRiskDetails() {
@ -89,6 +122,7 @@ export default {
<style lang="scss" scoped>
.notice-container {
width: 100vw;
height: 56rpx;
margin: 20rpx 0;
display: flex;
@ -98,15 +132,15 @@ export default {
.warning-img {
width: 48rpx;
height: 48rpx;
}
.uni-notice-bar {
flex: 1;
height: 56rpx;
}
text {
margin: 0 10rpx;
}
// .uni-notice-bar {
// flex: 1;
// }
// text {
// margin: 0 10rpx;
// }
}
</style>