Merge branch 'jiayu-dev' of http://139.9.66.234:18023/dhp/zhgdyunapp into jiayu-dev

# Conflicts:
#	unpackage/dist/dev/app-plus/app-service.js
This commit is contained in:
jiayu 2024-07-23 18:13:43 +08:00
commit 20f0604e39
26 changed files with 1671 additions and 294 deletions

View File

@ -32,14 +32,14 @@ export default {
// "YYYY-MM-DD hh:mm"
start: {
type: String,
default: '1970-1-1 00:00'
default: '1970-01-01 00:00'
},
//
// "YYYY-MM-DD hh:mm"
end: {
type: String,
default: '2300-1-1 00:00'
default: '2300-01-01 00:00'
},
// year | month | day | hour | minute
@ -102,11 +102,11 @@ export default {
//
if(!utils.isString(this.start)) {
start = '1970-1-1 00:00';
start = '1970-01-01 00:00';
}
if(!utils.isString(this.start)) {
start = '2300-1-1 00:00';
start = '2300-01-01 00:00';
}
// Date
@ -135,6 +135,7 @@ export default {
*/
change(event) {
console.log(this.fields,777888999)
console.log(1111111,this.range)
let year, month, day, hour, minute, second;
if(this.fields == 'year') {
year = this.range[0][this.value[0]].number; //
@ -178,6 +179,7 @@ export default {
day = this.range[2][this.value[2]].number; //
hour = this.range[3][this.value[3]].number; //
minute = this.range[4][this.value[4]].number; //
let dtStr = `${year}-${month}-${day} ${hour}:${minute}`;
this.setDateStr(dtStr);
this.$emit('change', utils.formatDate(dtStr));

View File

@ -11,7 +11,7 @@
</movable-view>
</movable-area>
</cover-view> -->
</template>
<script>
import {
@ -57,7 +57,7 @@
pyType: 1,
imgWidth: 0,
imgHeight: 0,
moduleInfo:{},
moduleInfo: {},
}
},
mounted() {
@ -74,7 +74,7 @@
let routes = getCurrentPages(); //
let curRoute = routes[routes.length - 1].route //
this.moduleFn(curRoute)
console.log(111111111,curRoute)
console.log(111111111, curRoute)
console.log(JSON.parse(uni.getStorageSync('userInfo')));
this.$nextTick(() => {
@ -97,10 +97,10 @@
},
methods: {
moduleFn(curRoute){
moduleFn(curRoute) {
this.moduleInfo = uni.getStorageSync('moduleInfo') && JSON.parse(uni.getStorageSync('moduleInfo'));
if(curRoute == "pages/projectEnd/projectIndex/projectIndex" && !this.moduleInfo){
if (curRoute == "pages/projectEnd/projectIndex/projectIndex" && !this.moduleInfo) {
// console.log(22222222222222)
setTimeout(() => {
this.moduleFn(curRoute);
@ -194,136 +194,140 @@
this.orientation();
return
}
uni.showModal({
title: '提示信息',
content: '是否快速报警?',
cancelText: "取消",
confirmText: "确认",
success: function(res) {
if (res.confirm) {
// uni.navigateTo({
// url: `${url}?id=${that.id}`,
// });
emergencyRecordAdd({
projectSn: that.projectSn,
emergencyTypeId: -1,
alarmPersonId: that.workerInfoId,
}).then(result => {
if (result.code == 200) {
// uni.showToast({
// title: ""
// })
that.id = result.result.id;
console.log(result);
uni.showLoading({
title: "报警中..."
})
uni.getLocation({
type: 'gcj02',
// type: 'wgs84',
geocode: true, //true
isHighAccuracy: "true",
accuracy: "best", // 20m
success: function(res) {
console.log(res)
// const latitude = parseFloat(res.latitude);
// const longitude = parseFloat(res.longitude);
that.emergencyInfo.longitude = parseFloat(res
.longitude);
that.emergencyInfo.latitude = parseFloat(res
.latitude);
that.addressList = [
res.address.province,
res.address.city,
res.address.district,
res.address.street,
res.address.poiName,
]
that.emergencyInfo.incidentSite = that
.addressList.map(
item => item).join('')
console.log(111111111);
console.log(that.emergencyInfo.longitude, that
.emergencyInfo.latitude);
emergencyRecordEdit({
id: that.id,
projectSn: that.projectSn,
incidentSite: that.emergencyInfo
.incidentSite,
longitude: that.emergencyInfo
.longitude,
latitude: that.emergencyInfo
.latitude,
}).then(result => {
if (result.code == 200) {
uni.showToast({
title: result
.message,
})
emergencyRecordSendNotice({
projectSn: that
.projectSn,
incidentSite: that
.emergencyInfo
.incidentSite,
id: that.id,
}).then(result => {
if (result.code ==
200) {
uni
.hideLoading(); //
} else {
uni.showToast({
title: result
.message,
icon: "none"
})
}
})
} else {
uni.showToast({
title: result
.message,
icon: "none"
})
uni.hideLoading(); //
}
})
// that.addrDel = res;
},
fail: function() {
uni.showToast({
title: '获取地址失败,将导致部分功能不可用',
icon: 'none'
});
}
});
} else {
uni.showToast({
title: result.message,
icon: "none"
})
}
})
} else if (res.cancel) {
console.log('用户点击取消');
}
emergencyRecordAdd({
projectSn: that.projectSn,
emergencyTypeId: -1,
alarmPersonId: that.workerInfoId,
}).then(result => {
if (result.code == 200) {
// uni.showToast({
// title: ""
// })
that.id = result.result.id;
console.log(result);
} else {
uni.showToast({
title: result.message,
icon: "none"
})
}
});
}).finally(() => {
//
uni.showModal({
title: '提示信息',
content: '报警信息已经发送给救援人员,是否需要补充表单信息?',
cancelText: "取消",
confirmText: "确认",
success: function(res) {
if (res.confirm) {
uni.navigateTo({
url: `/pages/personLocation/emergencyalarm/emergencyalarm?id=${that.id}&sn=${that.projectSn}`,
});
} else if (res.cancel) {
// console.log('');
uni.showLoading({
title: "报警中..."
})
uni.getLocation({
type: 'gcj02',
// type: 'wgs84',
geocode: true, //true
isHighAccuracy: "true",
accuracy: "best", // 20m
success: function(res) {
console.log(res)
// const latitude = parseFloat(res.latitude);
// const longitude = parseFloat(res.longitude);
that.emergencyInfo.longitude = parseFloat(res
.longitude);
that.emergencyInfo.latitude = parseFloat(res
.latitude);
that.addressList = [
res.address.province,
res.address.city,
res.address.district,
res.address.street,
res.address.poiName,
]
that.emergencyInfo.incidentSite = that
.addressList.map(
item => item).join('')
console.log(111111111);
console.log(that.emergencyInfo.longitude, that
.emergencyInfo.latitude);
emergencyRecordEdit({
id: that.id,
projectSn: that.projectSn,
incidentSite: that.emergencyInfo
.incidentSite,
longitude: that.emergencyInfo
.longitude,
latitude: that.emergencyInfo
.latitude,
}).then(result => {
if (result.code == 200) {
uni.showToast({
title: result
.message,
})
emergencyRecordSendNotice({
projectSn: that
.projectSn,
incidentSite: that
.emergencyInfo
.incidentSite,
id: that.id,
}).then(result => {
if (result.code ==
200) {
uni
.hideLoading(); //
} else {
uni.showToast({
title: result
.message,
icon: "none"
})
}
})
} else {
uni.showToast({
title: result
.message,
icon: "none"
})
uni.hideLoading(); //
}
})
// that.addrDel = res;
},
fail: function() {
uni.showToast({
title: '获取地址失败,将导致部分功能不可用',
icon: 'none'
});
}
});
}
}
});
})
},
}
}
</script>
<style lang="less">
.holdon /deep/ .uni-cover-view{
.holdon /deep/ .uni-cover-view {
visibility: initial;
}
// .movable-area {
// position: absolute;
// width: 100vw;

View File

@ -2,8 +2,8 @@
"name" : "智慧安全", //
"appid" : "__UNI__4AA4101",
"description" : "",
"versionName" : "1.6.4",
"versionCode" : 164,
"versionName" : "1.6.6",
"versionCode" : 166,
"transformPx" : false,
/* 5+App */
"app-plus" : {

View File

@ -51,9 +51,8 @@
<view class="property-item">
<view class="item-top">资质照片</view>
<view class="item-bottom" v-if="enterpriseInfo.enterpriseQualificationUrl">
<image :src="url_config+'image/'+enterpriseInfo.enterpriseQualificationUrl"
@click="previewImage(url_config+'image/'+enterpriseInfo.enterpriseQualificationUrl)"
class="icon-image"></image>
<image :src="enterpriseInfo.enterpriseQualificationUrl"
@click="previewImage(enterpriseInfo.enterpriseQualificationUrl)" class="icon-image"></image>
<!-- <image :src="enterpriseInfo.enterpriseQualificationUrl[0].url"
@click="previewImage(enterpriseInfo.enterpriseQualificationUrl[0].url)"
class="icon-image"></image> -->
@ -64,7 +63,58 @@
</view>
</scroll-view>
<scroll-view :scroll-y="true" class="scrollBox" :style="{height: scrollHeight + 'px'}" v-if="checked == 2">
<view class="property-item">
<div class="conProjectItem" v-for="item in conProjectList" :key="item.id">
<view class="property-item">
<view class="item-top">承包商名称</view>
<view class="item-bottom">{{item.cbsName || '--'}}</view>
</view>
<view class="property-item">
<view class="item-top">项目施工区域</view>
<view class="item-bottom">{{item.projectBuildArea || '--'}}</view>
</view>
<view class="property-item">
<view class="item-top">项目经理</view>
<view class="item-bottom">{{item.projectManage || '--'}}</view>
</view>
<view class="property-item">
<view class="item-top">项目类型</view>
<view class="item-bottom">{{item.cbsProjectTypeName || '--'}}</view>
</view>
<view class="property-item">
<view class="item-top">施工阶段</view>
<view class="item-bottom">{{item.constructionStageName || '--'}}</view>
</view>
<view class="property-item">
<view class="item-top">经度位置</view>
<view class="item-bottom">{{item.longitude || '--'}}</view>
</view>
<view class="property-item">
<view class="item-top">纬度位置</view>
<view class="item-bottom">{{item.latitude || '--'}}</view>
</view>
<view class="property-item">
<view class="item-top">项目编号</view>
<view class="item-bottom">{{item.projectNumber || '--'}}</view>
</view>
<view class="property-item">
<view class="item-top">结构类型</view>
<view class="item-bottom">{{item.structureTypeName || '--'}}</view>
</view>
<view class="property-item">
<view class="item-top">项目面积()</view>
<view class="item-bottom">{{item.projectAcreage ? item.projectAcreage + '㎡' : '--'}}</view>
</view>
<view class="property-item">
<view class="item-top">工程状态</view>
<view class="item-bottom">{{
item.bulidStatus == 0 ? '未开工' :
item.bulidStatus == 1 ? '在建' :
item.bulidStatus == 2 ? '停工' :
item.bulidStatus == 3 ? '竣备' : '--'
}}</view>
</view>
</div>
<!-- <view class="property-item">
<view class="item-top">承包商名称</view>
<view class="item-bottom">{{conProjectInfo.cbsName || '--'}}</view>
</view>
@ -112,7 +162,7 @@
conProjectInfo.bulidStatus == 2 ? '停工' :
conProjectInfo.bulidStatus == 3 ? '竣备' : '--'
}}</view>
</view>
</view> -->
</scroll-view>
</view>
</template>
@ -128,6 +178,7 @@
scrollHeight: '',
enterpriseInfo: '',
conProjectInfo: '',
conProjectList: [],
};
},
onReady() {
@ -137,46 +188,64 @@
this.id = option.id
this.projectId = option.projectId
this.getDetailInfo()
this.supplierInfoList();
},
methods: {
async getHeight() {
const query = uni.createSelectorQuery().in(this);
let fixedheaderHeight = 0
const fixedHeaderPromise = new Promise((resolve) => {
query.select('.fixedheader').boundingClientRect(data => {
fixedheaderHeight = data.height
console.log('fixedheaderHeight', data.height);
resolve();
}).exec();
});
let mobileTopHeight = 0
const systemInfoPromise = new Promise((resolve) => {
uni.getSystemInfo({
success(res) {
mobileTopHeight = res.statusBarHeight ? res.statusBarHeight : 0;
resolve();
}
});
});
await fixedHeaderPromise;
await systemInfoPromise;
this.barBoxHeight = fixedheaderHeight + mobileTopHeight;
console.log('this.barBoxHeight', this.barBoxHeight);
let screenHeight = uni.getSystemInfoSync().screenHeight;
console.log('screenHeight', screenHeight);
this.scrollHeight = screenHeight - this.barBoxHeight -44;
console.log('this.scrollHeight', this.scrollHeight);
let fixedheaderHeight = 0
const fixedHeaderPromise = new Promise((resolve) => {
query.select('.fixedheader').boundingClientRect(data => {
fixedheaderHeight = data.height
console.log('fixedheaderHeight', data.height);
resolve();
}).exec();
});
let mobileTopHeight = 0
const systemInfoPromise = new Promise((resolve) => {
uni.getSystemInfo({
success(res) {
mobileTopHeight = res.statusBarHeight ? res.statusBarHeight : 0;
resolve();
}
});
});
await fixedHeaderPromise;
await systemInfoPromise;
this.barBoxHeight = fixedheaderHeight + mobileTopHeight;
console.log('this.barBoxHeight', this.barBoxHeight);
let screenHeight = uni.getSystemInfoSync().screenHeight;
console.log('screenHeight', screenHeight);
this.scrollHeight = screenHeight - this.barBoxHeight - 44 - 20;
console.log('this.scrollHeight', this.scrollHeight);
},
handleTab(val){
handleTab(val) {
this.checked = val
},
getDetailInfo(){
supplierInfoList() {
let data = {
type: 2,
enterpriseId: this.id,
projectSn: JSON.parse(uni.getStorageSync('projectDetail')).projectSn,
}
let that = this
this.sendRequest({
url: 'xmgl/projectEnterpriseSupplierInfo/list',
method: 'get',
data: data,
success: res => {
console.log("enterpriseInfo", res);
that.conProjectList = res.result;
}
})
},
getDetailInfo() {
let data = {
enterpriseId: this.id,
projectSn: JSON.parse(uni.getStorageSync('projectDetail')).projectSn,
@ -189,32 +258,35 @@
success: res => {
console.log("enterpriseInfo", res);
this.enterpriseInfo = res.result
// if(this.enterpriseInfo.enterpriseQualificationUrl){
// pc
// this.enterpriseInfo.enterpriseQualificationUrl =
// res.result.enterpriseQualificationUrl && res.result.enterpriseQualificationUrl.split(',').length > 0 ?
// res.result.enterpriseQualificationUrl.split(',').map(item => {
// return {
// name: item.split('*')[0],
// url: that.url_config+'image/'+ item.split('*')[1],
// }
// }) : res.result.enterpriseQualificationUrl.indexOf('http://') >= 0 ? res.result.enterpriseQualificationUrl :
// res.result.enterpriseQualificationUrl,
// }
//apppc
if(this.enterpriseInfo.enterpriseQualificationUrl){
this.enterpriseInfo.enterpriseQualificationUrl = this.enterpriseInfo.enterpriseQualificationUrl.split('*')[1]
if (this.enterpriseInfo.enterpriseQualificationUrl) {
// pc
this.enterpriseInfo.enterpriseQualificationUrl =
res.result.enterpriseQualificationUrl && res.result.enterpriseQualificationUrl
.split(',').length > 1 ?
res.result.enterpriseQualificationUrl.split(',').map(item => {
return {
name: item.split('*')[0],
url: that.url_config + 'image/' + item.split('*')[1],
}
}) : res.result.enterpriseQualificationUrl.indexOf('http://') >= 0 ? res.result
.enterpriseQualificationUrl :
url_config + 'image/' + res.result.enterpriseQualificationUrl;
console.log(this.enterpriseInfo.enterpriseQualificationUrl)
}
//apppc
// if(this.enterpriseInfo.enterpriseQualificationUrl){
// this.enterpriseInfo.enterpriseQualificationUrl = this.enterpriseInfo.enterpriseQualificationUrl.split('*')[1]
// }
this.conProjectInfo = res.result.projectEnterprise
}
})
},
//
previewImage(url) {
console.log('url',url);
console.log('url', url);
uni.previewImage({
urls: [url]
})
@ -224,27 +296,38 @@
</script>
<style lang="scss" scoped>
.conProjectItem {
border: 2rpx solid #EBECF0;
border-radius: 20rpx;
padding: 20rpx;
margin-top: 20rpx;
}
.barBox {
// background-color: #5181F6;
background-color: #f6f6f6;
min-height: 100%;
height: 44px;
.fixedheader {
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 999;
.headerName {
z-index: 1;
}
}
}
.tabBox{
.tabBox {
width: 100%;
height: 44px;
display: flex;
.enterprise-tab{
.enterprise-tab {
width: 50%;
height: 100%;
border: 1rpx solid #e5e5e5;
@ -253,7 +336,8 @@
line-height: 44px;
text-align: center;
}
.project-tab{
.project-tab {
width: 50%;
height: 100%;
border: 1rpx solid #e5e5e5;
@ -262,31 +346,39 @@
line-height: 44px;
text-align: center;
}
.active-tab{
.active-tab {
background-color: #2b8df3;
color: #fff;
}
}
.scrollBox{
.scrollBox {
height: 100%;
width: calc(100% - 20px);
width: calc(100% - 20rpx);
// background-color: darkred;
margin: 0 10px;
word-break: break-all;
.property-item{
padding-bottom: 20rpx;
.property-item {
// line-height: 25px;
margin-bottom: 15px;
.item-top{
.item-top {
color: #878787;
}
.item-bottom{
.item-bottom {
margin-top: 5px;
width: auto;
height: auto;
.icon-image{
.icon-image {
width: 50px;
height: 50px;
}
}
}
}
</style>
</style>

View File

@ -21,7 +21,8 @@
<view class="itemBox">
<view class="file-info">
<image :src="item.logoUrl" class="icon-image" v-if="fileTypeCondition(item.logoUrl)"></image>
<image v-else src="/static/documentIcon/JPG.png" class="icon-image"></image>
<!-- <image v-else-if="getFileSuffix(item.logoUrl) == 'zip'" :src="'/static/documentIcon/ZIP.png'" class="icon-image"></image> -->
<image v-else :src="getFileSuffix(item.logoUrl)" class="icon-image"></image>
<view class="info">
<view class="info-inner">{{item.fileName}}</view>
<view class="info-inner">{{item.createTime}}</view>
@ -55,6 +56,7 @@
barBoxHeight: '',
scrollHeight:'',
listData: [],
};
},
onReady() {
@ -76,6 +78,19 @@
//
return imageExtensions.includes(extension);
},
getFileSuffix(fileName){
console.log(fileName)
let suffixName = fileName.split('.').pop().toLowerCase()
if(suffixName == 'pdf') return '/static/documentIcon/pdf.png'
if(suffixName == 'ppt' || suffixName == 'pptx') return '/static/documentIcon/ppt.png'
if(suffixName == 'rar' || suffixName == 'zip') return '/static/documentIcon/rar.png'
if(suffixName == 'txt') return '/static/documentIcon/txt.png'
if(suffixName == 'mp4') return '/static/documentIcon/video.png'
if(suffixName == 'doc' || suffixName == 'docx') return '/static/documentIcon/word.png'
if(suffixName == 'xlsx' || suffixName == 'excel') return '/static/documentIcon/excel.png'
return '/static/documentIcon/null.png'
// return fileName.split('.').pop();
},
async getHeight() {
const query = uni.createSelectorQuery().in(this);
@ -120,6 +135,15 @@
this.scrollHeight = screenHeight - this.barBoxHeight;
console.log('this.scrollHeight', this.scrollHeight);
},
isJSON(str) {
try {
JSON.parse(str);
} catch (e) {
//
return false;
}
return true;
},
getListData(){
this.searchForm.enterpriseId = this.id
// let data = {
@ -132,7 +156,8 @@
success: res => {
console.log("enterpriseQualification", res);
this.listData = res.result.map(item => {
item.logoUrl = this.url_config+'image/'+ JSON.parse(item.fileUrl)[0].url
const fileUrl = this.isJSON(item.fileUrl) && JSON.parse(item.fileUrl) instanceof Array ? JSON.parse(item.fileUrl)[0].url : item.fileUrl;
item.logoUrl = this.url_config+'image/'+ fileUrl
return item
})
}
@ -144,7 +169,8 @@
// uni.previewImage({
// urls: [url]
// })
let url = this.url_config + 'image/' + JSON.parse(item.fileUrl)[0].url
const fileUrl = this.isJSON(item.fileUrl) ? JSON.parse(item.fileUrl)[0].url: item.fileUrl;
let url = this.url_config + 'image/' + fileUrl
console.log(url)
uni.downloadFile({
url: url,

View File

@ -120,7 +120,7 @@
onLoad(options) {
this.id = options.id;
console.log(uni.getStorageSync('devInfoList'));
this.projectSn = uni.getStorageSync('devInfoList').projectSn;
this.projectSn = options.sn ? options.sn : uni.getStorageSync('devInfoList').projectSn;
this.statusBarHeight = uni.getStorageSync('systemInfo').statusBarHeight
console.log(options);
emergencyRecordQueryById({
@ -392,7 +392,8 @@
// console.log(res)
// // const latitude = parseFloat(res.latitude);
// // const longitude = parseFloat(res.longitude);
// that.emergencyInfo.longitude =
// console.log(222222222,res)
// that.emergencyInfo.longitude = parseFloat(res.longitude);
// that.emergencyInfo.latitude = parseFloat(res.latitude);
// that.addressList = [
// res.address.province,

View File

@ -8,7 +8,19 @@
<text>学习详情</text>
</view>
</headers>
<view class="video" v-show="videoList.length">
<view class="video rules" v-show="videoList.length || dataList.length">
<view class="rules-box" v-for="(item,index) in dataList" :key="item.url">
<image :src="item.url" v-if="fileTypeCondition(item.url)"></image>
<image src="../../../../static/images.png" v-else></image>
<view>
<view class="rules-text1">
<text>{{item.name}}</text>
</view>
<view class="rules-text2" @click="downLoadFile(item,2,index)">
<text>下载预览</text>
</view>
</view>
</view>
<video v-for="(item,index) in videoList" :key="index" id="myVideo" class="disable-progress"
style="width: 100%;height: 390rpx;" :muted="false" :show-mute-btn="true" :src="item.url"
:enable-progress-gesture="false" :controls="item.controlsBool" @play="videoStart(index)"
@ -24,14 +36,15 @@
</swiper-item>
</swiper> -->
</view>
<view class="studybox" v-if="videoList.length">
<view class="studybox" v-if="videoList.length || dataList.length">
<view class="studybox-line"></view>
<view class="studybox-text1">
<!-- <text>安全教育视频</text> -->
<text>{{responseData.courseName}}</text>
</view>
</view>
<button type="primary" :disabled="isStartExam || pageData.examCount<=0" class="btn" @click="goHiidden"
<!-- || pageData.examCount<=0 -->
<button type="primary" :disabled="isStartExam" class="btn" @click="goHiidden"
v-if="pageData.examPaperId">开始考试</button>
<levitatedsphere :x="100" :y="80"></levitatedsphere>
</view>
@ -44,11 +57,42 @@
return {
videoUrl: "",
videoList: [],
dataList: [],
pageData: {},
videoStartTime: "",
userInfo: "",
responseData: {},
isStartExam: false
isPageLength: 0,
startFlag: true,
// isStartExam: false
}
},
computed: {
isStartExam() {
const videoEvery = this.videoList.every(item => item.isVideoOver && item.controlsBool);
const dataEvery = this.dataList.every(item => item.isFileOver);
console.log('计算属性执行了', this.videoList, this.dataList, videoEvery, dataEvery)
if(this.startFlag){
this.videoStartTime = this.$formatDates(new Date().getTime(), 'yyyy-MM-dd HH:mm:ss');
this.startFlag = false;
}
console.log(dataEvery && videoEvery && (this.videoList.length > 0 || this.dataList > 0))
if(dataEvery && videoEvery && (this.videoList.length > 0 || this.dataList > 0)){
let requestData = {
workerId: this.userInfo.id,
trainId: this.pageData.trainId,
beginTime: this.videoStartTime,
endTime: this.$formatDates(new Date().getTime(), 'yyyy-MM-dd HH:mm:ss')
}
this.sendRequest({
url: "xmgl/workerExam/submitStudy",
data: requestData,
method: 'post',
success(res) {}
})
}
return !(videoEvery && dataEvery);
}
},
onReady: function(res) {
@ -67,13 +111,76 @@
this.$forceUpdate();
},
methods: {
fileTypeCondition(file) {
//
const extension = file.substring(file.lastIndexOf('.') + 1).toLowerCase();
//
const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg'];
//
return imageExtensions.includes(extension);
},
downLoadFile(val, type, index) {
// let url = this.url_config + 'image/' + val.logoUrl
let that = this;
let url = val.url
console.log(val)
uni.downloadFile({
url: url,
success: function(res) {
var filePath = res.tempFilePath;
// if (type == 1) {
// //
// console.log(navigator && navigator.userAgent && /Mobi|Android|iPhone/i.test(navigator.userAgent))
// if(navigator && navigator.userAgent && /Mobi|Android|iPhone/i.test(navigator.userAgent)){
// console.log("111")
// window.open(filePath, "_blank");
// return
// }
// console.log("222")
// return
// uni.saveFile({
// tempFilePath: filePath, //
// success: function(res) {
// uni.showToast({
// icon: 'none',
// mask: true,
// title: '' + res.savedFilePath, //
// duration: 3000,
// });
// setTimeout(() => {
// //
// uni.openDocument({
// filePath: res.savedFilePath,
// success: function(res) {
// // console.log('');
// }
// });
// }, 3000)
// }
// });
// } else
if (type == 2) {
uni.openDocument({
filePath: filePath,
success: function(res) {
console.log('打开文档成功');
that.dataList[index].isFileOver = true;
console.log(that.dataList);
}
});
}
}
});
},
returnBack() {
uni.navigateTo({
url: '../index/index'
})
},
videoStart(index) {
this.videoStartTime = this.$formatDates(new Date().getTime(), 'yyyy-MM-dd HH:mm:ss');
},
videoEnd(index) {
var that = this
@ -85,29 +192,18 @@
setTimeout(function() {
that.$forceUpdate();
}, 500)
let startExamBool = true;
that.videoList.map(item => {
if (!item.isVideoOver) {
startExamBool = false;
}
})
if (!startExamBool) {
that.isStartExam = true;
} else {
that.isStartExam = false;
}
let requestData = {
workerId: this.userInfo.id,
trainId: this.pageData.trainId,
beginTime: this.videoStartTime,
endTime: this.$formatDates(new Date().getTime(), 'yyyy-MM-dd HH:mm:ss')
}
this.sendRequest({
url: "xmgl/workerExam/submitStudy",
data: requestData,
method: 'post',
success(res) {}
})
// let startExamBool = true;
// that.videoList.map(item => {
// if (!item.isVideoOver) {
// startExamBool = false;
// }
// })
// if (!startExamBool) {
// that.isStartExam = true;
// } else {
// that.isStartExam = false;
// }
},
getDataFn() {
var that = this
@ -122,15 +218,19 @@
console.log('试题信息', res)
if (res.result) {
that.responseData = res.result;
that.videoList = res.result.fileUrl ? JSON.parse(res.result.fileUrl) : [],
that.videoList.map(item => {
item.isVideoOver = false
item.controlsBool = false
})
if (that.videoList.length) {
that.isStartExam = true;
that.videoUrl = that.videoList[0].url
}
const result = res.result.fileUrl ? JSON.parse(res.result.fileUrl) : [];
that.videoList = result.filter(item => item.url.substring(item.url.lastIndexOf(".") +
1) == "mp4");
that.dataList = result.filter(item => item.url.substring(item.url.lastIndexOf(".") +
1) != "mp4");
console.log(result, that.videoList, that.dataList);
// that.videoList
// dataList
// if (that.videoList.length) {
// that.isStartExam = true;
// that.videoUrl = that.videoList[0].url
// }
that.trainRecordId();
console.log(that.src)
}
}
@ -142,6 +242,37 @@
showCancel: false
})
},
trainRecordId() {
var that = this
const devInfoList = uni.getStorageSync('devInfoList')
let requestData = {
pageNo: 1,
pageSize: 10,
number: 1,
trainId: this.pageData.trainId,
workerCard: devInfoList.idCard,
projectSn: devInfoList.projectSn,
}
this.sendRequest({
url: "exam/courseRecord/page",
data: requestData,
method: 'post',
success(res) {
if (res.code == 200) {
that.isPageLength = res.result.records instanceof Array ? res.result.records.length : 0;
console.log(22222, res, that.isPageLength);
const isPageFlag = that.isPageLength > 0 ? true : false;
that.dataList.map(item => {
that.$set(item,'isFileOver',isPageFlag)
})
that.videoList.map(item => {
that.$set(item,'isVideoOver',isPageFlag)
that.$set(item,'controlsBool',isPageFlag)
})
}
}
})
},
goHiidden() {
var that = this
let requestData = {
@ -226,4 +357,53 @@
margin: 159.62rpx 40.38rpx;
}
}
.rules {
box-shadow: 4rpx 4rpx 8rpx 2rpx rgba(81, 129, 246, 0.12);
// height: calc(100vh - 270rpx);
// padding-bottom: 60rpx;
// overflow-y: scroll;
}
.rules-box {
display: flex;
padding: 13.46rpx 28.85rpx 17.31rpx 23.08rpx;
border-top: 2rpx solid #D8DBE8;
}
.rules-box image {
width: 61.15rpx;
height: 70.77rpx;
}
.rules-box>view {
display: flex;
justify-content: space-between;
flex: 1;
}
.rules-text1 {
display: flex;
flex-direction: column;
justify-content: center;
margin-left: 13.46rpx;
}
.rules-text1>text {
font-size: 25rpx;
line-height: 40rpx;
}
.rules-text2 {
display: flex;
justify-content: center;
align-items: center;
color: #5181F6;
font-size: 19.23rpx;
white-space: nowrap;
>text:last-child {
margin-left: 10rpx;
}
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -945,7 +945,7 @@
} else if (type == 'startTime') {
this.form.inspectTime = e.f3;
} else if (type == 'startTime2') {
this.form.changeLimitTime = e.f3;
this.form.changeLimitTime = `${e.f1} ${e.f8}`;
} else if (type == 6) {
this.changePeopleIndex = e.detail.value;
this.form.changeId = this.personUpdateList[e.detail.value].userId;
@ -1237,6 +1237,8 @@
//
async addSaveBtn() {
console.log(this.form.inspectTime)
console.log(this.form.changeLimitTime)
let arr = [],
arr2 = [];

View File

@ -952,7 +952,7 @@
} else if (type == 'startTime') {
this.form.inspectTime = e.f3;
} else if (type == 'startTime2') {
this.form.changeLimitTime = e.f3;
this.form.changeLimitTime = `${e.f1} ${e.f8}`;
} else if (type == 6) {
this.changePeopleIndex = e.detail.value;
this.form.changeId = this.personUpdateList[e.detail.value].userId;

View File

@ -48,7 +48,7 @@
<view class="type">
<view class="textColor">图片</view>
<view class="type-img">
<image :src="item" mode="" v-for="(item,index) in itemFrom.imgList" :key="index"></image>
<image @click="previewImage(item)" :src="item" mode="" v-for="(item,index) in itemFrom.imgList" :key="index"></image>
</view>
</view>
<view class="type">
@ -109,6 +109,11 @@
this.projectSn = JSON.parse(uni.getStorageSync('projectDetail')).projectSn;
},
methods: {
previewImage(url) {
uni.previewImage({
urls: [url]
})
},
//
submitAudit() {
//
@ -280,8 +285,8 @@
flex-wrap: wrap;
image {
width: 80rpx;
height: 80rpx;
width: 280rpx;
height: 200rpx;
margin-right: 20rpx;
}
}

View File

@ -48,7 +48,7 @@
<view class="type">
<view class="textColor">图片</view>
<view class="type-img">
<image :src="item" mode="" v-for="(item,index) in itemFrom.imgList" :key="index"></image>
<image @click="previewImage(item)" :src="item" mode="" v-for="(item,index) in itemFrom.imgList" :key="index"></image>
</view>
</view>
<view class="type">
@ -108,6 +108,11 @@
},
},
methods: {
previewImage(url) {
uni.previewImage({
urls: [url]
})
},
filterItemForm() {
console.log(this.itemFrom)
if (this.itemFrom.image) {
@ -163,8 +168,8 @@
flex-wrap: wrap;
image {
width: 80rpx;
height: 80rpx;
width: 280rpx;
height: 200rpx;
margin-right: 20rpx;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
static/documentIcon/img.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
static/documentIcon/mp3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB