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", "version" : "0.0",
"configurations" : [ "configurations" : [
{ {
"app-plus" : { "app-plus" :
"launchtype" : "local" {
}, "launchtype" : "local"
"default" : { },
"launchtype" : "local" "default" :
}, {
"type" : "uniCloud" "launchtype" : "local"
},
"mp-weixin" :
{
"launchtype" : "local"
},
"type" : "uniCloud"
}, },
{ {
"playground" : "standard", "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 => { .catch(err => {
uni.$u.toast('登录失败') uni.$u.toast('登录失败')
this.$store.dispatch('LogOut').then(() => { this.$store.dispatch('LogOut').then(() => {
console.log(err) console.log(err + '999')
uni.showToast({ uni.showToast({
title: err, title: err,
icon: 'none' icon: 'none'

View File

@ -115,15 +115,26 @@
<!-- 风险提示 --> <!-- 风险提示 -->
<view class="today-warning"> <view class="today-warning">
<image class="warning-img" src="../../../static/images/img-phase-two/index_news.png" mode=""></image> <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"> <view class="uni-notice-bar" @tap="onJumpWorkPlan">
<uni-notice-bar <!-- <uni-notice-bar
style="height: 100%" style="height: 100%"
:speed="30" :speed="30"
background-color="#fff" background-color="#fff"
scrollable scrollable
:text="noticeText" :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>
</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 PieChartsModelMan from './components/pie-charts-model-man.vue'
import PieChartsModelGirl from './components/pie-charts-model-girl.vue' import PieChartsModelGirl from './components/pie-charts-model-girl.vue'
import { getHomePageListApi } from '@/api/phaseTwo/homePage' import { getHomePageListApi } from '@/api/phaseTwo/homePage'
import MultiColorNoticeBar from '../../../components/MultiColorNoticeBar'
export default { export default {
components: { components: {
@ -360,7 +372,8 @@ export default {
PieChartsModelRing, PieChartsModelRing,
PieChartsModelRingTwo, PieChartsModelRingTwo,
PieChartsModelMan, PieChartsModelMan,
PieChartsModelGirl PieChartsModelGirl,
MultiColorNoticeBar
}, },
data() { data() {
return { return {
@ -1065,7 +1078,7 @@ export default {
.today-warning { .today-warning {
margin: 30rpx 0; margin: 30rpx 0;
height: 68rpx; height: 68rpx;
padding: 0 30rpx; padding-left: 30rpx;
display: flex; display: flex;
align-items: center; align-items: center;
border: 1rpx solid #ccc; border: 1rpx solid #ccc;
@ -1078,8 +1091,10 @@ export default {
} }
.uni-notice-bar { .uni-notice-bar {
flex: 1; // flex: 1;
width: 65%;
height: 50rpx; height: 50rpx;
padding-left: 20rpx;
// line-height: 50rpx; // line-height: 50rpx;
// background-color: orange; // background-color: orange;
} }

View File

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

View File

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

View File

@ -371,14 +371,20 @@ export default {
this.subUserList = [] this.subUserList = []
// this.subUserListTemp // this.subUserListTemp
tempArray.forEach(e => { tempArray.forEach(e => {
this.subUserListAll.forEach(j => { if (e.length > 1) {
if (!e.includes(j.idNumber)) { this.subUserListAll.forEach(j => {
// this.subUserList.push(j) if (!e.includes(j.idNumber)) {
this.subUserList.push(JSON.parse(JSON.stringify(j))) // this.subUserList.push(j)
// this.subUserListTemp.push(JSON.parse(JSON.stringify(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 { } else {
this.subUserList = JSON.parse(JSON.stringify(this.subUserListAll)) this.subUserList = JSON.parse(JSON.stringify(this.subUserListAll))
// this.subUserListTemp = 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 this.personList = JSON.parse(options.personList).personList
console.log(this.personList, ' this.personList****')
// console.log('options.index', options.index) // console.log('options.index', options.index)
this.currentIndex = options.index this.currentIndex = options.index
@ -634,31 +642,34 @@ export default {
computed: { computed: {
onAlreadySelect() { onAlreadySelect() {
let amount = 0 let amount = 0
if (this.subUserList.length > 0) { // if (this.subUserList.length > 0) {
this.subUserList.forEach(e => { // this.subUserList.forEach(e => {
if (e.isChecked) { // if (e.isChecked) {
amount++ // amount++
} // }
}) // })
} // }
return amount
if (this.subUserList.length > 0) return this.subUserList.filter(e => e.isChecked == true).length
// return amount
}, },
isAllChecked() { isAllChecked() {
let isCheckedAll = false let isCheckedAll = false
if (this.subUserList.length > 0) { if (this.subUserList.length > 0) return this.subUserList.every(e => e.isChecked === true)
isCheckedAll = this.subUserList.every(e => e.isChecked === true) // if (this.subUserList.length > 0) {
// isCheckedAll = this.subUserList.every(e => e.isChecked === true)
// if (isCheckedAll) { // // if (isCheckedAll) {
// this.subUserListTemp.forEach(e => { // // this.subUserListTemp.forEach(e => {
// e.isChecked = true // // e.isChecked = true
// }) // // })
// } else { // // } else {
// this.subUserListTemp.forEach(e => { // // this.subUserListTemp.forEach(e => {
// e.isChecked = false // // e.isChecked = false
// }) // // })
// } // // }
} // }
return isCheckedAll // 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: 'fzrdh' },
{ form_label: '全体人数', items_type: 'ipt', required: true, name: 'qtrs', isType: 'number' }, { 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: '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: 'jtcls' },
{ form_label: '特种作业车辆', items_type: 'ipt', required: true, name: 'tscls' }, { 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: 'fzrdh' },
{ form_label: '全体人数', items_type: 'ipt', required: true, name: 'qtrs', isType: 'number' }, { 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: '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: 'jtcls' },
{ form_label: '特种作业车辆', items_type: 'ipt', required: true, name: 'tscls' }, { form_label: '特种作业车辆', items_type: 'ipt', required: true, name: 'tscls' },

View File

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