Merge branch 'dev-jack' into 'master'

Dev jack

See merge request !36
This commit is contained in:
杜海鹏 2022-07-16 09:05:24 +08:00
commit 38b58b7978
4 changed files with 176 additions and 51 deletions

View File

@ -50,8 +50,21 @@ export default {
trainPerson:'培训人',
trainPersonNum:'培训人数',
remarks:'备注',
educateTypeList:['入场三级教育','定期安全教育','安全技术交底','VR安全教育'],
educateTypeList:[
'入场安全教育',
'日常安全教育',
'每日安全交底',
'VR安全教育',
'班前教育',
'日常教育(日常违规教育)',
'每日交底(方案交底)',
'每日交底(安全技术交底)',
'每日交底(大工程交底)',
],
signInInfo:'签到信息',
trainVideo:'教学视频上传',
photo:'培训照片',
trainDateTime:'培训时间',
selectWorker: '选择工人',
allGroup:'全部班组',
allCompany:'全部企业',

View File

@ -39,6 +39,7 @@ if (process.env.NODE_ENV == 'development') {
// axios.defaults.baseURL = 'http://36.137.53.203:9090/'; // 南昌地铁 17512009894 123456789 gdjt 123456789
axios.defaults.baseURL = 'http://192.168.34.125:6023/'
// axios.defaults.baseURL = 'http://124.71.178.44:100/' // 河南
// tag: 本地
// axios.defaults.baseURL = 'http://192.168.34.148:6023/' // 老大本地

View File

@ -45,16 +45,16 @@ export default new Vuex.Store({
// UPLOADURL:'http://10.0.1.43:6023/upload/image',//测试
// FILEURL:'http://10.0.1.43:6023/image/',//测试
BASEURL: baseUrl?baseUrl:window.location.protocol + '//' + window.location.host + '/', //
UPLOADURL: window.location.protocol + '//' + window.location.host + '/upload/image', //
FILEURL: window.location.protocol + '//' + window.location.host + '/image/',//测试
// UPLOADURL: window.location.protocol + '//' + window.location.host + '/upload/image', //
// FILEURL: window.location.protocol + '//' + window.location.host + '/image/',//测试
/* 2022-05-16 */
// tag: 部署河南项目时,需要打开这两行代码
// UPLOADURL: 'http://124.71.178.44:100/upload/image',
// FILEURL: 'http://124.71.178.44:100/image/',
/* 2022-06-06 */ // tag: 本地测试接口
// UPLOADURL: 'http://192.168.34.125:6023/upload/image',
// FILEURL: 'http://192.168.34.125:6023/image/',
UPLOADURL: 'http://192.168.34.125:6023/upload/image',
FILEURL: 'http://192.168.34.125:6023/image/',
// UPLOADURL:'http://'+"61.190.32.219:9050"+'/upload/image',//正式
// FILEURL:'http://'+"61.190.32.219:9050"+'/image/',//正式
ACCOUNTTYPE: ['系统管理员', '企业一级管理员', '企业二级管理员', '企业三级管理员', '项目管理员'], //1系统管理员2企业管理员账号3企业区账号4企业市账号5项目账号

View File

@ -205,6 +205,33 @@
style="width: 100%"
></el-date-picker>
</el-form-item>
<el-form-item
:label="$t('message.laborDev.trainDateTime')"
prop="eduDateTime"
>
<el-time-select
class="startTime"
placeholder="起始时间"
v-model="cardForm.eduStartTime"
:picker-options="{
start: '08:30',
step: '00:15',
end: '18:30',
maxTime: cardForm.eduEndTime
}">
</el-time-select>
<el-time-select
class="endTime"
placeholder="结束时间"
v-model="cardForm.eduEndTime"
:picker-options="{
start: '08:30',
step: '00:15',
end: '18:30',
minTime: cardForm.eduStartTime
}">
</el-time-select>
</el-form-item>
<el-form-item
:label="$t('message.laborDev.trainPerson')"
prop="eduTeacher"
@ -226,23 +253,56 @@
<el-form-item :label="$t('message.laborDev.trainPersonNum')">
<el-input :value="cardForm.list.length" disabled></el-input>
</el-form-item>
<!-- 签到信息 -->
<el-form-item :label="$t('message.laborDev.signInInfo')" prop="list">
<el-button type="primary" @click="selectWorkerDialog = true">
<el-button type="primary" @click="selectWorkerDialog = true" style="margin-right: 200px">
{{ $t("message.laborDev.selectWorker") }}
</el-button>
<!-- 添加上传相关材料 -->
<el-upload
name="files"
class="upload-demo uploadBtn"
:action="$store.state.UPLOADURL"
multiple
:file-list="fileList"
:on-preview="handlePreview"
:on-success="handleSuccess"
:show-file-list="false"
>
<el-button type="primary">材料上传</el-button>
</el-upload>
</el-form-item>
<!-- 教学视频上传 -->
<el-form-item :label="$t('message.laborDev.trainVideo')" prop="uploadAttachments" >
<div class="videoUpload">
<el-upload
name="files"
:action="$store.state.UPLOADURL"
multiple
:file-list="fileList"
:on-success="handleSuccess"
:before-upload="beforeUpload"
:show-file-list="false"
>
<el-button type="primary">教学视频上传</el-button>
</el-upload>
<template v-if="cardForm.uploadAttachments">
<video width="120" height="80" controls autoplay style="margin-left: 10px">
<source :src="$store.state.FILEURL + cardForm.uploadAttachments" type="video/mp4">
<source :src="$store.state.FILEURL + cardForm.uploadAttachments" type="video/ogg">
<source :src="$store.state.FILEURL + cardForm.uploadAttachments" type="video/x-ms-wmv">
您的浏览器不支持 video 标签
</video>
</template>
</div>
</el-form-item>
<!-- 培训照片 -->
<el-form-item :label="$t('message.laborDev.photo')" prop="photo" >
<div class="form-photo" >
<el-upload
v-for="i in 3" :key="i"
name="files"
class="photoUpload"
:action="$store.state.UPLOADURL"
:show-file-list="false"
:on-success="file => handleUpload(file, i)"
>
<img v-if="cardForm[`edu${i === 1 ? 'Before': i === 2 ? 'In' : 'After'}Photo`]"
:src="$store.state.FILEURL + cardForm[`edu${i === 1 ? 'Before': i === 2 ? 'In' : 'After'}Photo`]"
class="photo">
<template v-else>
<i class="el-icon-plus avatar-uploader-icon"></i>
<span>培训{{i === 1 ? '前' : i === 2 ? '中' : '后'}}</span>
</template>
</el-upload>
</div>
</el-form-item>
<el-table
class="tables dialogTable"
@ -343,6 +403,7 @@
size="medium"
>{{ $t("message.personnelPosition.cancel") }}
</el-button>
<!-- 取消 -->
<el-button
type="primary"
icon="el-icon-circle-check"
@ -350,6 +411,7 @@
size="medium"
>{{ $t("message.personnelPosition.determine") }}
</el-button>
<!-- 确定 -->
</div>
</el-form>
</div>
@ -385,6 +447,12 @@ import {
export default {
components: { selectWorker },
data() {
const validateConfig = {
required: true,
message: this.$t("message.personnelPosition.mandatory"),
trigger: "blur",
}
return {
uploadaurl:'',
fileList:[],
@ -405,35 +473,23 @@ export default {
eduContent: "",
eduCourseName: "",
eduPhoto: "",
eduBeforePhoto: "",
eduInPhoto: "",
eduAfterPhoto: "",
eduTeacher: "",
eduTime: "",
eduStartTime: '',
eduEndTime: '',
eduType: 1,
list: [],
workernum: 0,
projectSn: this.$store.state.projectSn,
},
cardFormRules: {
eduCourseName: [
{
required: true,
message: this.$t("message.personnelPosition.mandatory"),
trigger: "blur",
},
],
eduTime: [
{
required: true,
message: this.$t("message.personnelPosition.mandatory"),
trigger: "blur",
},
],
list: [
{
required: true,
message: this.$t("message.personnelPosition.mandatory"),
trigger: "blur",
},
],
eduCourseName: [validateConfig],
eduTime: [validateConfig],
list: [validateConfig],
uploadAttachments: [validateConfig],
},
isAdd: false,
allPersonList: [],
@ -448,25 +504,29 @@ export default {
console.log('url',xxx)
},
methods: {
handlePreview(file,type){
// console.log('file',file)
// console.log('fileList',type)
handleUpload(res, num) {
const imageUrl = res.data[0].imageUrl
this.cardForm[`edu${num === 1 ? 'Before': num === 2 ? 'In' : 'After'}Photo`] = imageUrl
console.log(this.eduPhoto1,this.eduPhoto2,this.eduPhoto3, num);
},
handleSuccess(file,fileList){
console.log('成功的file',file)
this.cardForm.uploadAttachments = file.data[0].filename
if(file.status == "SUCCESS"){
this.$message({
message: '相关材料上传成功!',
type: 'success'
});
this.$message({ message: '视频上传成功', type: 'success' });
}else{
this.$message({
message: '上传失败,请重新上传!',
type: 'error'
});
this.$message({ message: '上传失败,请重新上传!', type: 'error' });
}
},
beforeUpload(file){
const videoTypes = ['video/mp4','application/x-mpegURL','video/x-ms-wmv','video/x-msvideo','video/x-flv','video/x-ms-wmv']
const type = file.type
const flag = videoTypes.includes(type)
if (!flag) {
this.$message({ message: '只能上传视频', type: 'error' });
}
return flag
},
changeScore(index, value) {
console.log("changeScore", value, index);
var json = this.cardForm.list[index];
@ -697,4 +757,55 @@ export default {
left: 50%;
transform: translate(-50%, -50%);
}
.form-photo{
display: flex;
flex-wrap: wrap;
.photoUpload{
margin-right: 10px;
.photo{
width: 100%;
height: 100%;
}
}
}
/deep/.photoUpload .el-upload {
position: relative;
width: 80px;
height: 80px;
border: 1px dashed #d9d9d9;
border-radius: 6px;
overflow: hidden;
cursor: pointer;
span{
position: relative;
bottom: 36px;
}
}
.avatar-uploader-icon {
font-size: 20px;
color: #8c939d;
width: 80px;
height: 80px;
line-height: 80px;
text-align: center;
}
.startTime, .endTime{
width: 170px !important;
/deep/.el-input__inner{
width: 150px;
}
}
/deep/.el-date-editor{
width: 120px;
}
.videoUpload{
width: 320px;
display: flex;
// align-items: center;
>div{
margin-left: 10px;
}
}
</style>