新增班前喊话
This commit is contained in:
parent
c53e25a5eb
commit
bfb98cd2aa
@ -20,6 +20,14 @@
|
||||
"path": "pages/videoManage/videoList",
|
||||
"style": {}
|
||||
},
|
||||
{
|
||||
"path": "pages/videoManage/safeMeeting",
|
||||
"style": {}
|
||||
},
|
||||
{
|
||||
"path": "pages/videoManage/component/canversCom",
|
||||
"style": {}
|
||||
},
|
||||
{
|
||||
"path": "pages/areaTree/areaTree",
|
||||
"style": {}
|
||||
|
||||
@ -140,6 +140,14 @@
|
||||
考勤记录
|
||||
</view>
|
||||
</view>
|
||||
<view class="item" @click="safeMeeting">
|
||||
<view class="imgBox">
|
||||
<image src="/static/personManage/kqjl.png" mode="" style="width: 23px;height: 20px;"></image>
|
||||
</view>
|
||||
<view class="txt">
|
||||
班前喊话
|
||||
</view>
|
||||
</view>
|
||||
<view class="item" @click="viewVideo" v-if="COMPANY != 'nanchang'">
|
||||
<view class="imgBox">
|
||||
<image src="/static/personManage/video.png" mode="" style="width: 25px;height: 18px;"></image>
|
||||
@ -268,6 +276,11 @@
|
||||
url: 'attendanceManage'
|
||||
})
|
||||
},
|
||||
safeMeeting(){
|
||||
uni.navigateTo({
|
||||
url:'../../videoManage/safeMeeting?sn='+this.projectDetail.projectSn
|
||||
})
|
||||
},
|
||||
viewVideo(){
|
||||
uni.navigateTo({
|
||||
url: '../../videoManage/videoList?sn='+this.projectDetail.projectSn+'&pageType=backEnd'
|
||||
|
||||
127
pages/videoManage/component/canversCom.vue
Normal file
127
pages/videoManage/component/canversCom.vue
Normal file
@ -0,0 +1,127 @@
|
||||
<template>
|
||||
<view>
|
||||
<canvas canvas-id="myCanvas" :style="`width:${imgList.imgWidth}px;height:${imgList.imgHeight}px;`"
|
||||
style="position: fixed;top:0px;left: 0rpx;"></canvas>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
imgUrl: '',
|
||||
date:'',//现在时间
|
||||
}
|
||||
},
|
||||
props: ['imgList'],
|
||||
watch: {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
console.log("啦啦啦啦啦", this.imgList)
|
||||
let that = this;
|
||||
setInterval(function() {
|
||||
that.date = Date.parse(new Date());
|
||||
}, 1000);
|
||||
this.date = this.dateFormat(new Date().toISOString())
|
||||
this.getPosition();
|
||||
this.canversImg()
|
||||
},
|
||||
methods: {
|
||||
canversImg() {
|
||||
let that = this
|
||||
console.log('我开始画啦')
|
||||
const ctx = uni.createCanvasContext('myCanvas', that); //获取一个画布对象
|
||||
ctx.drawImage(that.imgList.imgUrl, 0, 0, that.imgList.imgWidth, that.imgList
|
||||
.imgHeight); //画一个图片底图(路径,位置,大小)
|
||||
ctx.drawImage(require('@/static/CanvarsImg.png'), that.imgList.imgWidth * 0.52, that.imgList.imgHeight *
|
||||
0.72, that.imgList.imgWidth * 0.46, that.imgList.imgHeight * 0.22); //画一个图片底图(路径,位置,大小)
|
||||
ctx.setFillStyle('#FFFFFF'); // 文字颜色
|
||||
ctx.setFontSize(25); // 文字字号
|
||||
ctx.fillText('详情', that.imgList.imgWidth * 0.73, that.imgList.imgHeight * 0.755); // 绘制文字
|
||||
ctx.setFillStyle('#000000'); // 文字颜色
|
||||
ctx.fillText('负责人:' + (that.imgList.name ? that.imgList.name : '暂无'), that.imgList.imgWidth * 0.56, that.imgList.imgHeight * 0.8); // 绘制文字
|
||||
ctx.fillText('班 组:' + (that.imgList.team ? that.imgList.team : '暂无'), that.imgList.imgWidth * 0.56, that.imgList.imgHeight * 0.825); // 绘制文字
|
||||
ctx.fillText('天 气:'+'晴', that.imgList.imgWidth * 0.56, that.imgList.imgHeight * 0.85); // 绘制文字
|
||||
ctx.fillText('拍摄时间:'+that.date, that.imgList.imgWidth * 0.56, that.imgList.imgHeight * 0.875); // 绘制文字
|
||||
ctx.fillText('地 点:'+'福永意库9栋201', that.imgList.imgWidth * 0.56, that.imgList.imgHeight * 0.9); // 绘制文字
|
||||
ctx.draw(false, () => {
|
||||
// canvas画布转成图片并返回图片地址
|
||||
uni.canvasToTempFilePath({
|
||||
canvasId: 'myCanvas',
|
||||
width: that.imgList.imgWidth,
|
||||
height: that.imgList.imgHeight,
|
||||
destWidth: that.imgList.imgWidth,
|
||||
destHeight: that.imgList.imgHeight,
|
||||
fileType:'png',
|
||||
success: res => {
|
||||
console.log(res.tempFilePath,'res.tempFilePath')
|
||||
that.imgUrl = res.tempFilePath;
|
||||
that.showShareImg = true;
|
||||
uni.showToast({
|
||||
title: '绘制成功'
|
||||
});
|
||||
that.$emit('imgUrl', that.imgUrl)
|
||||
},
|
||||
fail: err => {
|
||||
uni.showToast({
|
||||
title: '绘制失败'
|
||||
});
|
||||
},
|
||||
complete: () => {
|
||||
uni.hideLoading();
|
||||
uni.hideToast();
|
||||
}
|
||||
}, );
|
||||
});
|
||||
},
|
||||
getPosition() {
|
||||
console.log("正在获取当前位置啦")
|
||||
const that = this;
|
||||
uni.getLocation({
|
||||
type: 'wgs84',
|
||||
success: function(lb) {
|
||||
console.log("位置信息", lb);
|
||||
console.log('当前位置的经度:' + lb.longitude);
|
||||
console.log('当前位置的纬度:' + lb.latitude);
|
||||
// that.latitude = lb.latitude;
|
||||
// that.longitude = lb.longitude;
|
||||
// console.log(lb.longitude, lb.latitude);
|
||||
|
||||
let key = '56c91fb2683e5bf0f46014ac200d4c1b'; //高德地图key
|
||||
uni.request({
|
||||
// 高德
|
||||
url: 'https://restapi.amap.com/v3/geocode/regeo?output=json&location=' +
|
||||
lb.longitude + ',' + lb.latitude + '&key=' + key +
|
||||
'&radius=1000&extensions=all',
|
||||
data: {},
|
||||
header: {
|
||||
'Content-Type': 'application/json',
|
||||
'Access-Control-Allow-Origin': '*'
|
||||
},
|
||||
success: function(res) {
|
||||
console.log('高德地图API接口返回信息', res)
|
||||
},
|
||||
})
|
||||
},
|
||||
})
|
||||
},
|
||||
dateFormat(time) {
|
||||
let date = new Date(time);
|
||||
let year = date.getFullYear();
|
||||
// 在日期格式中,月份是从0开始的,因此要加0,使用三元表达式在小于10的前面加0,以达到格式统一 如 09:11:05
|
||||
let month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
|
||||
let day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
|
||||
let hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
|
||||
let minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
|
||||
let seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
|
||||
// 拼接
|
||||
return year + "年" + month + "月" + day + "日" + hours + ":" + minutes + ":" + seconds;
|
||||
// return year + "-" + month + "-" + day;
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
370
pages/videoManage/safeMeeting.vue
Normal file
370
pages/videoManage/safeMeeting.vue
Normal file
@ -0,0 +1,370 @@
|
||||
<template>
|
||||
<view class="fullHeight">
|
||||
<headers :showBack="true" class="fixedHeaderBox">
|
||||
<view class="headerName">
|
||||
班前喊话
|
||||
</view>
|
||||
</headers>
|
||||
<view class="listBox">
|
||||
<!-- @click="searchPerson(item.id)" -->
|
||||
<view v-for="item in list" :key="item.id">
|
||||
<uni-card>
|
||||
<view class="personItem">
|
||||
<view class="leftImg">
|
||||
<image :src="url_config+'image/'+item.shoutImage" style="width: 180rpx;height: 150rpx;"
|
||||
@click="lookImg(url_config+'image/'+item.shoutImage)"></image>
|
||||
</view>
|
||||
<view class="rightMessage">
|
||||
<view>企业:{{item.enterpriseName}}</view>
|
||||
<view>班组:{{item.teamName}}</view>
|
||||
<view>负责人:{{item.dutyUserName}}</view>
|
||||
<view>时间:{{item.updateTime}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-card>
|
||||
</view>
|
||||
<view class="placeholderBox" v-show="list.length==0">
|
||||
<image src="/static/noData.png" class="noDataImg"></image>
|
||||
<view class="text">
|
||||
暂无数据
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="addBtn">
|
||||
<image src="../../static/addImg.png" mode="" style="width: 180rpx;height: 180rpx;"
|
||||
@click="openAdd('center')"></image>
|
||||
<uni-popup ref="popup" background-color="#fff" @change="change">
|
||||
<view class="dialogStyle">
|
||||
<view class="leftTitle">
|
||||
<view>新增班前喊话</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="flex">
|
||||
<view class="title">企 业:</view>
|
||||
<view class="uni-list">
|
||||
<picker @change="companyChange" :value="companyindex" mode="selector"
|
||||
:range="companyList" range-key="enterpriseName">
|
||||
<view class="titleSelect">
|
||||
{{companyList[companyindex].enterpriseName}}
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex">
|
||||
<view class="title">班 组:</view>
|
||||
<view class="uni-list">
|
||||
<picker @change="teamChange" :value="teamindex" :range="teamList" range-key="teamName">
|
||||
<view class="titleSelect">{{teamList[teamindex].teamName}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view :range="name" class="flex">
|
||||
<view class="title"> 负责人:</view>
|
||||
<view class="titleSelect">{{name}}</view>
|
||||
</view>
|
||||
<view class="flexPhone">
|
||||
<view class="title">拍 摄: </view>
|
||||
</view>
|
||||
<view class="example-body">
|
||||
<uni-file-picker v-model="imageValue" limit="1" @select="canversList"></uni-file-picker>
|
||||
</view>
|
||||
<view>
|
||||
<button type="primary" class="btnStyle" @click="submit">确认</button>
|
||||
</view>
|
||||
<view>
|
||||
<button class="btnStyle" @click="close">取消</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
<canversCom v-if="openImg" @imgUrl="imgUrl" :imgList="imgList"></canversCom>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import headers from "@/components/headers/headers.vue"
|
||||
import canversCom from "@/pages/videoManage/component/canversCom.vue"
|
||||
import {
|
||||
GetDateStr
|
||||
} from "@/static/js/util.js"
|
||||
export default {
|
||||
components: {
|
||||
headers
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
imageValue: [],
|
||||
type: 'center',
|
||||
array: ['中国', '美国', '巴西', '日本'],
|
||||
companyindex: 0, //企业
|
||||
teamindex: 0, //班组
|
||||
value: 'xxx',
|
||||
list: [],
|
||||
sn: '',
|
||||
companyList: [],
|
||||
teamList: [],
|
||||
teamId: '',
|
||||
name: '', //负责人
|
||||
openImg: false,
|
||||
imgList: {},
|
||||
addTeamId: ''
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
this.getCompany()
|
||||
this.getTeam()
|
||||
console.log('sn', this.sn)
|
||||
},
|
||||
onLoad(sn) {
|
||||
this.sn = sn.sn
|
||||
},
|
||||
components: {
|
||||
canversCom
|
||||
},
|
||||
methods: {
|
||||
lookImg(a) {
|
||||
console.log('11111111111111111', a)
|
||||
let data = []
|
||||
data.push(a)
|
||||
uni.previewImage({
|
||||
urls:data,
|
||||
longPressActions: {
|
||||
itemList: ['发送给朋友', '保存图片', '收藏'],
|
||||
success: function(suc) {
|
||||
console.log('选中了第' + suc);
|
||||
},
|
||||
fail: function(err) {
|
||||
console.log(err.errMsg);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
getCompany() {
|
||||
var that = this
|
||||
this.sendRequest({
|
||||
url: 'xmgl/enterpriseInfo/selectHierarchyEnterpriseList',
|
||||
data: {
|
||||
projectSn: this.sn
|
||||
},
|
||||
method: "POST",
|
||||
success(res) {
|
||||
that.companyList = res.result
|
||||
that.teamId = that.companyList[1].enterpriseId
|
||||
}
|
||||
})
|
||||
},
|
||||
getTeam() {
|
||||
var that = this
|
||||
this.sendRequest({
|
||||
url: 'xmgl/teamInfo/getTeamInfoList',
|
||||
data: {
|
||||
enterpriseId: this.teamId,
|
||||
projectSn: this.sn
|
||||
},
|
||||
method: "POST",
|
||||
success(res) {
|
||||
that.teamList = res.result.list
|
||||
}
|
||||
})
|
||||
},
|
||||
openAdd(type) {
|
||||
this.type = type
|
||||
this.$refs.popup.open(type)
|
||||
},
|
||||
submit() {
|
||||
this.sendRequest({
|
||||
url: 'xmgl/shoutInfo/addShoutInfo',
|
||||
data: {
|
||||
teamId: this.addTeamId,
|
||||
projectSn: this.sn,
|
||||
shoutImage: this.imageValue[0].url
|
||||
},
|
||||
method: "POST",
|
||||
success(res) {
|
||||
// that.teamList = res.result.list
|
||||
console.log('ok', res)
|
||||
this.$refs.popup.close()
|
||||
}
|
||||
})
|
||||
},
|
||||
getList() {
|
||||
var that = this
|
||||
this.sendRequest({
|
||||
url: 'xmgl/shoutInfo/selectPage',
|
||||
data: {
|
||||
projectSn: this.sn
|
||||
},
|
||||
method: "GET",
|
||||
success(res) {
|
||||
that.list = res.result.records
|
||||
console.log('66', that.list)
|
||||
}
|
||||
})
|
||||
},
|
||||
change(e) {
|
||||
console.log('当前模式:' + e.type + ',状态:' + e.show);
|
||||
},
|
||||
companyChange: function(e) {
|
||||
this.companyindex = e.detail.value
|
||||
this.teamId = this.companyList[e.detail.value].enterpriseId
|
||||
},
|
||||
teamChange: function(e) {
|
||||
console.log(e)
|
||||
this.teamindex = e.detail.value
|
||||
this.name = this.teamList[e.detail.value].leaderName
|
||||
this.addTeamId = this.teamList[e.detail.value].id
|
||||
},
|
||||
close() {
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
canversList(e) {
|
||||
this.imgList = {
|
||||
imgUrl: e.tempFiles[0].image.location,
|
||||
imgWidth: e.tempFiles[0].image.width,
|
||||
imgHeight: e.tempFiles[0].image.height,
|
||||
team: this.teamList[this.teamindex].teamName,
|
||||
name: this.teamList[this.teamindex].leaderName
|
||||
}
|
||||
this.openImg = true
|
||||
console.log('传过去啦', this.imgList)
|
||||
},
|
||||
imgUrl(val) {
|
||||
console.log('11111111111111', val)
|
||||
this.imageValue = [{
|
||||
url: val
|
||||
}]
|
||||
this.openImg = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.fixedHeaderBox {
|
||||
// position: relative;
|
||||
}
|
||||
|
||||
.searchBox {
|
||||
// background-color: #2b8df3;
|
||||
padding: 0 15px 5px;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
width: calc(100% - 30px);
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.selectContent {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
|
||||
.selectItem {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.listBox {
|
||||
margin-top: 55px;
|
||||
}
|
||||
|
||||
.personItem {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.leftImg {
|
||||
flex: 3;
|
||||
}
|
||||
|
||||
.rightMessage {
|
||||
flex: 6;
|
||||
font-size: 15rpx;
|
||||
}
|
||||
|
||||
// align-items: center;
|
||||
// box-shadow: 0px 4px 13px 0px rgba(212, 220, 236, 0.53);
|
||||
// position: relative;
|
||||
// margin-bottom: 5px;
|
||||
// padding: 15px;
|
||||
// border-radius: 8px;
|
||||
// // padding: 0 15px;
|
||||
// font-size: 15px;
|
||||
// .teamName{
|
||||
// font-size: 13px;
|
||||
// }
|
||||
// .small{
|
||||
// font-size: 12px;
|
||||
// opacity: 0.8;
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
.addBtn {
|
||||
position: absolute;
|
||||
top: 80%;
|
||||
left: 38%;
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
.dialogStyle {
|
||||
width: 600rpx;
|
||||
height: 750rpx;
|
||||
background-color: white;
|
||||
border: 2px solid white;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.leftTitle {
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin: 30rpx 0 40rpx 0;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
|
||||
.titleSelect {
|
||||
font-size: 13px;
|
||||
width: 400rpx;
|
||||
height: 50rpx;
|
||||
border: 1px solid rgb(241, 241, 241);
|
||||
border-radius: 10rpx;
|
||||
line-height: 50rpx;
|
||||
padding-left: 20rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.flexItem {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.flexPhone {
|
||||
margin-left: 38rpx;
|
||||
}
|
||||
|
||||
.example-body {
|
||||
padding: 0 0 20rpx 140rpx;
|
||||
}
|
||||
|
||||
.btnStyle {
|
||||
font-size: 14px;
|
||||
border-radius: 10rpx;
|
||||
width: 500rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
</style>
|
||||
BIN
static/CanvarsImg.png
Normal file
BIN
static/CanvarsImg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.7 KiB |
Loading…
x
Reference in New Issue
Block a user