diff --git a/src/assets/i18n/langs/cn/laborManage/laborDev.js b/src/assets/i18n/langs/cn/laborManage/laborDev.js index c19244d9..475423eb 100644 --- a/src/assets/i18n/langs/cn/laborManage/laborDev.js +++ b/src/assets/i18n/langs/cn/laborManage/laborDev.js @@ -50,8 +50,21 @@ export default { trainPerson:'培训人', trainPersonNum:'培训人数', remarks:'备注', - educateTypeList:['入场三级教育','定期安全教育','安全技术交底','VR安全教育'], + educateTypeList:[ + '入场安全教育', + '日常安全教育', + '每日安全交底', + 'VR安全教育', + '班前教育', + '日常教育(日常违规教育)', + '每日交底(方案交底)', + '每日交底(安全技术交底)', + '每日交底(大工程交底)', + ], signInInfo:'签到信息', + trainVideo:'教学视频上传', + photo:'培训照片', + trainDateTime:'培训时间', selectWorker: '选择工人', allGroup:'全部班组', allCompany:'全部企业', diff --git a/src/assets/js/http.js b/src/assets/js/http.js index ffdc9d63..244963c9 100644 --- a/src/assets/js/http.js +++ b/src/assets/js/http.js @@ -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/' // 老大本地 diff --git a/src/store/index.js b/src/store/index.js index 151aa154..fde8c534 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -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项目账号 diff --git a/src/views/projectFront/laborManage/safetyTrainManage.vue b/src/views/projectFront/laborManage/safetyTrainManage.vue index f2671d06..fba2359f 100644 --- a/src/views/projectFront/laborManage/safetyTrainManage.vue +++ b/src/views/projectFront/laborManage/safetyTrainManage.vue @@ -205,6 +205,33 @@ style="width: 100%" > + + + + + + + - + {{ $t("message.laborDev.selectWorker") }} - - - 材料上传 - + + + +
+ + 教学视频上传 + + +
+
+ + +
+ + + + +
{{ $t("message.personnelPosition.cancel") }} + {{ $t("message.personnelPosition.determine") }} + @@ -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; + } +}