合并冲突
This commit is contained in:
commit
895bb4f73e
30
main.js
30
main.js
@ -306,6 +306,36 @@ Vue.prototype.sendRequest = function(param) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 按钮权限控制指令
|
||||||
|
Vue.directive('permission', {
|
||||||
|
inserted: (el, binding) => {
|
||||||
|
const {
|
||||||
|
value
|
||||||
|
} = binding;
|
||||||
|
// 判断当前用户是否拥有该按钮权限
|
||||||
|
if (!Vue.prototype.checkPermission(value)) {
|
||||||
|
el.parentNode.removeChild(el);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 判断权限的函数
|
||||||
|
Vue.prototype.checkPermission = function(permission) {
|
||||||
|
var permissions = JSON.parse(uni.getStorageSync("userInfo")).menuAuthority.menuList;
|
||||||
|
console.log(permission,'我的测试指令1')
|
||||||
|
console.log(permissions,'我的测试指令2')
|
||||||
|
// var permissions = store.state.userInfo.menuAuthority.menuList;
|
||||||
|
permissions = permissions.filter(
|
||||||
|
(x) => x.path == permission.menuPath
|
||||||
|
)[0];
|
||||||
|
if (!permissions.actionList) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
let index = permissions.actionList.findIndex(
|
||||||
|
(x) => x.actionCode == permission.key
|
||||||
|
)
|
||||||
|
console.log(index,'我的测试指令3')
|
||||||
|
return index != -1 ? true : false;
|
||||||
|
}
|
||||||
const app = new Vue({
|
const app = new Vue({
|
||||||
...App
|
...App
|
||||||
})
|
})
|
||||||
|
|||||||
@ -2,8 +2,8 @@
|
|||||||
"name" : "智慧安全", //中建四局
|
"name" : "智慧安全", //中建四局
|
||||||
"appid" : "__UNI__4AA4101",
|
"appid" : "__UNI__4AA4101",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.5.6",
|
"versionName" : "1.5.7",
|
||||||
"versionCode" : 156,
|
"versionCode" : 157,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
|
|||||||
@ -2464,7 +2464,6 @@
|
|||||||
"path": "pages/personLocation/exam/rules/rules",
|
"path": "pages/personLocation/exam/rules/rules",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "规章",
|
"navigationBarTitleText": "规章",
|
||||||
"enablePullDownRefresh": true,
|
|
||||||
"onReachBottomDistance": 100
|
"onReachBottomDistance": 100
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -2580,7 +2579,7 @@
|
|||||||
// }]
|
// }]
|
||||||
// }],
|
// }],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
"navigationBarBackgroundColor": "#F0AD4E",
|
// "navigationBarBackgroundColor": "#F0AD4E",
|
||||||
"navigationStyle": "custom",
|
"navigationStyle": "custom",
|
||||||
"app-plus": {
|
"app-plus": {
|
||||||
"bounce": "none"
|
"bounce": "none"
|
||||||
|
|||||||
@ -5,38 +5,46 @@
|
|||||||
开始考试
|
开始考试
|
||||||
</view>
|
</view>
|
||||||
</headers>
|
</headers>
|
||||||
|
<view class="content-part">
|
||||||
|
<text class="rest-time">剩余时间:{{ timeLeft }}</text>
|
||||||
<view class="beginexam" v-for="(item,index) in stList" :key="index" v-show="index == stIndex">
|
<view class="beginexam" v-for="(item,index) in stList" :key="index" v-show="index == stIndex">
|
||||||
<view class="questionTitle">
|
<view class="questionTitle">
|
||||||
<text class="text">{{index + 1}}、{{item.questionName}}({{item.score||0}}分)</text>
|
<text class="text">{{index + 1}}、</text>
|
||||||
<text class="rest-time">剩余时间:{{ timeLeft }}</text>
|
<text class="text">{{item.questionName}}({{item.score||0}}分)</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="radio-content">
|
<view class="radio-content">
|
||||||
<radio-group @change="radioChange" class="radio-boxs" v-if="item.type == 1">
|
<radio-group @change="radioChange" class="radio-boxs" v-if="item.type == 1">
|
||||||
<label class="radio" v-for="(item2,index2) in item.optionList">
|
<label class="radio" v-for="(item2,index2) in item.optionList">
|
||||||
<radio :value="item2.optionCode" /><text>{{item2.optionCode}}、</text>{{item2.optionDesc}}
|
<radio :value="item2.optionCode" /><text>{{item2.optionCode}}、</text><text
|
||||||
|
class="question-desc">{{item2.optionDesc}}</text>
|
||||||
</label>
|
</label>
|
||||||
</radio-group>
|
</radio-group>
|
||||||
<checkbox-group @change="checkChange" class="check-boxs" v-if="item.type == 2">
|
<checkbox-group @change="checkChange" class="check-boxs" v-if="item.type == 2">
|
||||||
<label class="radio" v-for="(item2,index2) in item.optionList">
|
<label class="check" v-for="(item2,index2) in item.optionList">
|
||||||
<checkbox :value="item2.optionCode" /><text>{{item2.optionCode}}、</text>{{item2.optionDesc}}
|
<checkbox :value="item2.optionCode" /><text>{{item2.optionCode}}、</text><text
|
||||||
|
class="question-desc">{{item2.optionDesc}}</text>
|
||||||
</label>
|
</label>
|
||||||
</checkbox-group>
|
</checkbox-group>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="progress-style" v-show="stList.length > 0">
|
<view class="progress-style" v-show="stList.length > 0">
|
||||||
<progress :percent="((stIndex + 1) * 100 / stList.length).toFixed(0)" :stroke-width="11" backgroundColor="#F5F5F5" />
|
<progress :percent="((stIndex + 1) * 100 / stList.length).toFixed(0)" :stroke-width="11"
|
||||||
|
backgroundColor="#F5F5F5" />
|
||||||
</view>
|
</view>
|
||||||
<view class="step-btn" v-show="stList.length > 0">
|
<view class="step-btn" v-show="stList.length > 0">
|
||||||
<button type="primary" class="btn-front" @click="goFront" v-show="stIndex > 0">上一题</button>
|
<button type="primary" class="btn-front" @click="goFront" v-show="stIndex > 0">上一题</button>
|
||||||
<button type="primary" class="btn-front" @click="goNext" v-show="stIndex < stList.length - 1">下一题</button>
|
<button type="primary" class="btn-front" @click="goNext"
|
||||||
|
v-show="stIndex < stList.length - 1">下一题</button>
|
||||||
<button type="primary" class="btn" @click="goHiidden">交卷</button>
|
<button type="primary" class="btn" @click="goHiidden">交卷</button>
|
||||||
</view>
|
</view>
|
||||||
<view class="placeholderBox" v-if="stList.length == 0">
|
<view class="placeholderBox" v-if="stList.length == 0">
|
||||||
<image src="/static/exam/noCourseData.png" class="noDataImg" style="width: 180rpx; height: 160rpx;"></image>
|
<image src="/static/exam/noCourseData.png" class="noDataImg" style="width: 180rpx; height: 160rpx;">
|
||||||
|
</image>
|
||||||
<!-- <view class="text">
|
<!-- <view class="text">
|
||||||
暂无数据
|
暂无数据
|
||||||
</view> -->
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
<levitatedsphere :x="100" :y="80"></levitatedsphere>
|
<levitatedsphere :x="100" :y="80"></levitatedsphere>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@ -58,16 +66,20 @@
|
|||||||
this.getDataFn();
|
this.getDataFn();
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
console.log(options, 123456)
|
||||||
this.pageData = JSON.parse(options.transportData)
|
this.pageData = JSON.parse(options.transportData)
|
||||||
console.log(this.pageData.examDuration)
|
console.log(this.pageData.examDuration)
|
||||||
this.totalTime = +this.pageData.examDuration * 60;
|
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
this.totalTime = +this.pageData.examDuration * 60;
|
||||||
this.startTimer();
|
this.startTimer();
|
||||||
},
|
},
|
||||||
onHide() {
|
onHide() {
|
||||||
this.stopTimer();
|
this.stopTimer();
|
||||||
},
|
},
|
||||||
|
onUnload() {
|
||||||
|
this.stopTimer();
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
timeLeft() {
|
timeLeft() {
|
||||||
let hours = Math.floor(this.totalTime / 3600);
|
let hours = Math.floor(this.totalTime / 3600);
|
||||||
@ -132,6 +144,7 @@
|
|||||||
}, 1000);
|
}, 1000);
|
||||||
},
|
},
|
||||||
stopTimer() {
|
stopTimer() {
|
||||||
|
console.log('我计时器已卸载')
|
||||||
clearInterval(this.timer);
|
clearInterval(this.timer);
|
||||||
this.timer = null;
|
this.timer = null;
|
||||||
},
|
},
|
||||||
@ -207,15 +220,15 @@
|
|||||||
goFront(index) {
|
goFront(index) {
|
||||||
let that = this;
|
let that = this;
|
||||||
that.stIndex--;
|
that.stIndex--;
|
||||||
var progressTip = document.querySelector('.uni-progress-info');
|
// var progressTip = document.querySelector('.uni-progress-info');
|
||||||
progressTip.innerText = (((that.stIndex + 1) * 100) / that.stList.length).toFixed(0) + '%'
|
// progressTip.innerText = (((that.stIndex + 1) * 100) / that.stList.length).toFixed(0) + '%'
|
||||||
},
|
},
|
||||||
// 去下一题
|
// 去下一题
|
||||||
goNext(index) {
|
goNext(index) {
|
||||||
let that = this;
|
let that = this;
|
||||||
that.stIndex++;
|
that.stIndex++;
|
||||||
var progressTip = document.querySelector('.uni-progress-info');
|
// var progressTip = document.querySelector('.uni-progress-info');
|
||||||
progressTip.innerText = (((that.stIndex + 1) * 100) / that.stList.length).toFixed(0) + '%'
|
// progressTip.innerText = (((that.stIndex + 1) * 100) / that.stList.length).toFixed(0) + '%'
|
||||||
// uni.hideLoading()
|
// uni.hideLoading()
|
||||||
},
|
},
|
||||||
goHiidden() {
|
goHiidden() {
|
||||||
@ -260,32 +273,63 @@
|
|||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.main-content {
|
.main-content {
|
||||||
|
height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
.content-part {
|
||||||
|
// height: 100%;
|
||||||
|
flex: 1;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.rest-time {
|
||||||
|
position: absolute;
|
||||||
|
top: 0rpx;
|
||||||
|
right: 5rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.beginexam {
|
.beginexam {
|
||||||
padding: 26.92rpx 32.69rpx;
|
padding: 26.92rpx 32.69rpx;
|
||||||
|
height: 58%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
// overflow-y: scroll;
|
||||||
.questionTitle {
|
.questionTitle {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: relative;
|
display: flex;
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
width: 61%;
|
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-size: 34.62rpx;
|
font-size: 34.62rpx;
|
||||||
color: #272D45;
|
color: #272D45;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rest-time {
|
.text:nth-child(2) {
|
||||||
position: absolute;
|
font-size: 34rpx;
|
||||||
top: 7rpx;
|
width: 52%;
|
||||||
right: 20rpx;
|
overflow-wrap: anywhere;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.radio-content {
|
.radio-content {
|
||||||
|
flex: 1;
|
||||||
|
overflow-y: scroll;
|
||||||
|
|
||||||
.radio-boxs {
|
.radio-boxs {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
|
.radio {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex;
|
||||||
|
|
||||||
|
.question-desc {
|
||||||
|
display: inline-block;
|
||||||
|
width: 82%;
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.radio-boxs>label {
|
.radio-boxs>label {
|
||||||
@ -295,6 +339,17 @@
|
|||||||
.check-boxs {
|
.check-boxs {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
|
.check {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex;
|
||||||
|
|
||||||
|
.question-desc {
|
||||||
|
display: inline-block;
|
||||||
|
width: 82%;
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.check-boxs>label {
|
.check-boxs>label {
|
||||||
@ -362,6 +417,7 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
background: linear-gradient(111deg, #5383F6 0%, #7FF0FF 100%);
|
background: linear-gradient(111deg, #5383F6 0%, #7FF0FF 100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .uni-progress-info {
|
/deep/ .uni-progress-info {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 20rpx;
|
right: 20rpx;
|
||||||
|
|||||||
@ -51,6 +51,25 @@
|
|||||||
this.pageData = JSON.parse(options.examData)
|
this.pageData = JSON.parse(options.examData)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
examAgain(url){
|
||||||
|
var that = this
|
||||||
|
let requestData = {
|
||||||
|
id: this.pageData.trainRecordId
|
||||||
|
}
|
||||||
|
this.sendRequest({
|
||||||
|
url: "xmgl/workerExam/startExam",
|
||||||
|
data: requestData,
|
||||||
|
method: 'post',
|
||||||
|
success(res) {
|
||||||
|
if (res.code == 200) {
|
||||||
|
uni.redirectTo({
|
||||||
|
url: `/pages${url}?transportData=` + JSON.stringify(that
|
||||||
|
.pageData)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
goHiidden(url) {
|
goHiidden(url) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages${url}`
|
url: `/pages${url}`
|
||||||
|
|||||||
@ -13,6 +13,8 @@
|
|||||||
<image src="/static/exam/courseImg.png"></image>
|
<image src="/static/exam/courseImg.png"></image>
|
||||||
<view class="course-title">
|
<view class="course-title">
|
||||||
<text>科目类型:{{item.subjectName}}</text>
|
<text>科目类型:{{item.subjectName}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="course-title">
|
||||||
<text>培训计划名称:{{item.trainName}}</text>
|
<text>培训计划名称:{{item.trainName}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-boxs">
|
<view class="text-boxs">
|
||||||
|
|||||||
@ -53,12 +53,12 @@
|
|||||||
this.userInfo = JSON.parse(uni.getStorageSync("userInfo"))
|
this.userInfo = JSON.parse(uni.getStorageSync("userInfo"))
|
||||||
this.getRulesDataFn();
|
this.getRulesDataFn();
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
// onPullDownRefresh() {
|
||||||
setTimeout(function() {
|
// setTimeout(function() {
|
||||||
uni.stopPullDownRefresh()
|
// uni.stopPullDownRefresh()
|
||||||
}, 1000)
|
// }, 1000)
|
||||||
console.log("下拉刷新");
|
// console.log("下拉刷新");
|
||||||
},
|
// },
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
// console.log("============================")
|
// console.log("============================")
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
@ -201,8 +201,8 @@
|
|||||||
|
|
||||||
.rules {
|
.rules {
|
||||||
box-shadow: 4rpx 4rpx 8rpx 2rpx rgba(81, 129, 246, 0.12);
|
box-shadow: 4rpx 4rpx 8rpx 2rpx rgba(81, 129, 246, 0.12);
|
||||||
margin-top: 44rpx;
|
height: calc(100vh - 270rpx);
|
||||||
height: calc(100vh - 300rpx);
|
padding-bottom: 60rpx;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
</headers>
|
</headers>
|
||||||
<view class="video" v-show="videoList.length">
|
<view class="video" v-show="videoList.length">
|
||||||
<video v-for="(item,index) in videoList" :key="index" id="myVideo" class="disable-progress" style="width: 100%;height: 390rpx;"
|
<video v-for="(item,index) in videoList" :key="index" id="myVideo" class="disable-progress" style="width: 100%;height: 390rpx;"
|
||||||
:muted="true" :show-mute-btn="true" :src="item.url" :enable-progress-gesture="false"
|
:muted="false" :show-mute-btn="true" :src="item.url" :enable-progress-gesture="false"
|
||||||
:controls="item.controlsBool" @play="videoStart(index)" @ended="videoEnd(index)">
|
:controls="item.controlsBool" @play="videoStart(index)" @ended="videoEnd(index)">
|
||||||
</video>
|
</video>
|
||||||
<!-- <swiper circular :indicator-dots="false" indicator-color="rgba(99, 99, 99, 1)"
|
<!-- <swiper circular :indicator-dots="false" indicator-color="rgba(99, 99, 99, 1)"
|
||||||
@ -67,6 +67,11 @@
|
|||||||
// 判断是否可以开始考试,需要视频全部看完
|
// 判断是否可以开始考试,需要视频全部看完
|
||||||
that.videoList[index].isVideoOver = true;
|
that.videoList[index].isVideoOver = true;
|
||||||
that.videoList[index].controlsBool = true;
|
that.videoList[index].controlsBool = true;
|
||||||
|
// 尝试多次刷新视图
|
||||||
|
that.$forceUpdate();
|
||||||
|
setTimeout(function(){
|
||||||
|
that.$forceUpdate();
|
||||||
|
},500)
|
||||||
let startExamBool = true;
|
let startExamBool = true;
|
||||||
that.videoList.map(item => {
|
that.videoList.map(item => {
|
||||||
if (!item.isVideoOver) {
|
if (!item.isVideoOver) {
|
||||||
|
|||||||
@ -2,18 +2,18 @@
|
|||||||
<view class="index">
|
<view class="index">
|
||||||
<image class="loginLogo" src="@/static/personLocation/bg.jpg"></image>
|
<image class="loginLogo" src="@/static/personLocation/bg.jpg"></image>
|
||||||
<view class="index-items">
|
<view class="index-items">
|
||||||
<view class="index-item" @click="goNavigateTo('/pages/personLocation/home/home')">
|
<!-- <view class="index-item" @click="goNavigateTo('/pages/personLocation/home/home')">
|
||||||
<image src="@/static/personLocation/train.png" mode="heightFix"></image>
|
<image src="@/static/personLocation/train.png" mode="heightFix"></image>
|
||||||
人员定位
|
人员定位
|
||||||
</view>
|
</view> -->
|
||||||
<view class="index-item" @click="goNavigateTo('/pages/personLocation/exam/index/index')">
|
<view class="index-item" @click="goNavigateTo('/pages/personLocation/exam/index/index')">
|
||||||
<image src="@/static/personLocation/book.png" mode="heightFix"></image>
|
<image src="@/static/personLocation/book.png" mode="heightFix"></image>
|
||||||
培训考试
|
培训考试
|
||||||
</view>
|
</view>
|
||||||
<view class="index-item">
|
<!-- <view class="index-item">
|
||||||
<image src="@/static/personLocation/qrcode.png" mode="heightFix"></image>
|
<image src="@/static/personLocation/qrcode.png" mode="heightFix"></image>
|
||||||
人员二维码
|
人员二维码
|
||||||
</view>
|
</view> -->
|
||||||
<view class="index-item" @click="goNavigateTo('/pages/personLocation/emergencyalarm/emergencyalarm',1)">
|
<view class="index-item" @click="goNavigateTo('/pages/personLocation/emergencyalarm/emergencyalarm',1)">
|
||||||
<image src="@/static/personLocation/alarm.png" mode="heightFix"></image>
|
<image src="@/static/personLocation/alarm.png" mode="heightFix"></image>
|
||||||
一键报警
|
一键报警
|
||||||
|
|||||||
@ -129,7 +129,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<image v-if="type !== 'supplier'" v-show="tabIndex==1" src="/static/addImg.png" class="addImg"
|
<image v-permission="{key: 'clgl_blackWhiteList', menuPath: '/project/carManage/carManage'}" v-if="type !== 'supplier'" v-show="tabIndex==1" src="/static/addImg.png" class="addImg"
|
||||||
@click="goAdd('')"></image>
|
@click="goAdd('')"></image>
|
||||||
<levitatedsphere :x="100" :y="80"></levitatedsphere>
|
<levitatedsphere :x="100" :y="80"></levitatedsphere>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@ -164,8 +164,8 @@
|
|||||||
if(res.code == 200){
|
if(res.code == 200){
|
||||||
that.listData = res.result;
|
that.listData = res.result;
|
||||||
that.listData.map(item => {
|
that.listData.map(item => {
|
||||||
let str = "***************"
|
let str = "*************"
|
||||||
item.workerCard = item.workerCard.substring(0,3)+str+item.workerCard.substring(16)
|
item.workerCard = item.workerCard.substring(0,3)+str+item.workerCard.substring(14)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
培训计划
|
培训计划
|
||||||
</view>
|
</view>
|
||||||
</headers>
|
</headers>
|
||||||
<view class="list-box">
|
<view class="list-box" v-if="dataList.length">
|
||||||
<view class="list-box-item" @click="toDetail(item)" v-for="(item,index) in dataList" :key="index">
|
<view class="list-box-item" @click="toDetail(item)" v-for="(item,index) in dataList" :key="index">
|
||||||
<view class="item-flex">
|
<view class="item-flex">
|
||||||
<text>培训计划名称: </text>
|
<text>培训计划名称: </text>
|
||||||
@ -33,6 +33,12 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="placeholderBox" v-else>
|
||||||
|
<image src="/static/exam/noCourseData.png" class="noDataImg" style="width: 180rpx; height: 160rpx;"></image>
|
||||||
|
<!-- <view class="text">
|
||||||
|
暂无数据
|
||||||
|
</view> -->
|
||||||
|
</view>
|
||||||
<view class="btn-operate" @click="toAdd">
|
<view class="btn-operate" @click="toAdd">
|
||||||
<button type="primary"
|
<button type="primary"
|
||||||
>创建培训计划</button>
|
>创建培训计划</button>
|
||||||
|
|||||||
@ -4,6 +4,13 @@
|
|||||||
<view class="headerName">
|
<view class="headerName">
|
||||||
人员列表
|
人员列表
|
||||||
</view>
|
</view>
|
||||||
|
<!-- <template #right>
|
||||||
|
<checkbox-group @change="selectAll">
|
||||||
|
<label>
|
||||||
|
<checkbox :value="1" />全选
|
||||||
|
</label>
|
||||||
|
</checkbox-group>
|
||||||
|
</template> -->
|
||||||
</headers>
|
</headers>
|
||||||
<!-- <scroll-view scroll-y="true" class="pageContent"> -->
|
<!-- <scroll-view scroll-y="true" class="pageContent"> -->
|
||||||
<view class="personContent">
|
<view class="personContent">
|
||||||
@ -23,7 +30,7 @@
|
|||||||
{{item.sex==2?'女':'男'}} {{item.age}}
|
{{item.sex==2?'女':'男'}} {{item.age}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<checkbox :value="item.checkVal" />
|
<checkbox :value="item.checkVal" :disabled="item.isDisable" :checked="item.isChecked" />
|
||||||
</view>
|
</view>
|
||||||
</checkbox-group>
|
</checkbox-group>
|
||||||
<view class="placeholderBox" v-show="personList.length==0">
|
<view class="placeholderBox" v-show="personList.length==0">
|
||||||
@ -72,6 +79,10 @@
|
|||||||
this.loadData()
|
this.loadData()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 全选
|
||||||
|
// selectAll(){
|
||||||
|
|
||||||
|
// },
|
||||||
addSaveBtn() {
|
addSaveBtn() {
|
||||||
let dealData = [];
|
let dealData = [];
|
||||||
this.personList.map(item => {
|
this.personList.map(item => {
|
||||||
@ -84,7 +95,8 @@
|
|||||||
workerType: item.typeName,
|
workerType: item.typeName,
|
||||||
sex: item.sex,
|
sex: item.sex,
|
||||||
age: item.age,
|
age: item.age,
|
||||||
fieldAcquisitionUrl: item.fieldAcquisitionUrl
|
fieldAcquisitionUrl: item.fieldAcquisitionUrl,
|
||||||
|
enterpriseId: item.enterpriseId
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -129,7 +141,20 @@
|
|||||||
uni.hideLoading() //关闭加载中
|
uni.hideLoading() //关闭加载中
|
||||||
that.personList.map((item, index) => {
|
that.personList.map((item, index) => {
|
||||||
item.checkVal = index + "";
|
item.checkVal = index + "";
|
||||||
|
item.isDisable = false;
|
||||||
|
item.isChecked = false;
|
||||||
})
|
})
|
||||||
|
if (uni.getStorageSync("personInfo")) {
|
||||||
|
let storeArr = JSON.parse(uni.getStorageSync("personInfo"))
|
||||||
|
that.personList.map((item, index) => {
|
||||||
|
let findIndex = storeArr.findIndex(item2 => item2.workerId == item
|
||||||
|
.id)
|
||||||
|
if (findIndex != -1) {
|
||||||
|
item.isDisable = true;
|
||||||
|
item.isChecked = true;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -145,6 +170,7 @@
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.personContent {
|
.personContent {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
|
padding-bottom: 80rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.personItem {
|
.personItem {
|
||||||
@ -181,16 +207,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.addSaveBtn {
|
.addSaveBtn {
|
||||||
width: 60%;
|
width: 100%;
|
||||||
padding: 10px 0;
|
padding: 10px 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
background-color: #4181FE;
|
background-color: #4181FE;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 34rpx;
|
font-size: 34rpx;
|
||||||
border-radius: 30px;
|
|
||||||
letter-spacing: 2px;
|
letter-spacing: 2px;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 3%;
|
bottom: 0%;
|
||||||
left: 20%;
|
left: 0%;
|
||||||
|
z-index: 10
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -13,6 +13,7 @@
|
|||||||
<text>{{item.workerType}}</text>
|
<text>{{item.workerType}}</text>
|
||||||
<text>{{item.sex == 1?'男':'女'}} {{item.age}}</text>
|
<text>{{item.sex == 1?'男':'女'}} {{item.age}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
<u-icon name="minus-circle" color="#FF1212" size="36" @click="deletePersonFn(index)"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="placeholderBox" v-else>
|
<view class="placeholderBox" v-else>
|
||||||
@ -47,13 +48,25 @@
|
|||||||
uni.removeStorageSync("personInfo")
|
uni.removeStorageSync("personInfo")
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
if(uni.getStorageSync("personInfo")){
|
if (uni.getStorageSync("personInfo")) {
|
||||||
this.personList = JSON.parse(uni.getStorageSync("personInfo"))
|
let storeArr = JSON.parse(uni.getStorageSync("personInfo"));
|
||||||
|
let newArr = [];
|
||||||
|
storeArr.map(item => {
|
||||||
|
let findIndex = this.personList.findIndex(item2 => item2.workerId == item.workerId)
|
||||||
|
if(findIndex == -1){
|
||||||
|
newArr.push(item)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.personList = this.personList.concat(newArr)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
addForm(){
|
deletePersonFn(index) {
|
||||||
if(!this.personList.length){
|
this.personList.splice(index, 1)
|
||||||
|
uni.setStorageSync("personInfo", JSON.stringify(this.personList))
|
||||||
|
},
|
||||||
|
addForm() {
|
||||||
|
if (!this.personList.length) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请选择人员',
|
title: '请选择人员',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@ -71,20 +84,20 @@
|
|||||||
header: {},
|
header: {},
|
||||||
method: 'post',
|
method: 'post',
|
||||||
success(res) {
|
success(res) {
|
||||||
if(res.code == 200){
|
if (res.code == 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "添加成功"
|
title: "添加成功"
|
||||||
})
|
})
|
||||||
setTimeout(function(){
|
setTimeout(function() {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: './list'
|
url: './list'
|
||||||
})
|
})
|
||||||
},500)
|
}, 500)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
toSelectPerson(){
|
toSelectPerson() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: './searchTeam/teamList'
|
url: './searchTeam/teamList'
|
||||||
})
|
})
|
||||||
@ -118,11 +131,13 @@
|
|||||||
.main-content {
|
.main-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
.index-boxs {
|
.index-boxs {
|
||||||
height: calc(100vh - 200rpx);
|
height: calc(100vh - 200rpx);
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
padding: 58rpx 35rpx;
|
padding: 58rpx 35rpx;
|
||||||
padding-bottom: 10rpx;
|
padding-bottom: 10rpx;
|
||||||
|
|
||||||
.index-box {
|
.index-box {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
@ -144,6 +159,7 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
margin: 8rpx 20rpx 0rpx 20rpx;
|
margin: 8rpx 20rpx 0rpx 20rpx;
|
||||||
|
margin-right: auto;
|
||||||
|
|
||||||
text:nth-child(1) {
|
text:nth-child(1) {
|
||||||
color: #303030;
|
color: #303030;
|
||||||
@ -173,6 +189,7 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
z-index: 99;
|
z-index: 99;
|
||||||
|
|
||||||
.btn-select {
|
.btn-select {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
@ -181,7 +198,8 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
}
|
}
|
||||||
.btn-resubmit{
|
|
||||||
|
.btn-resubmit {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
background-color: #5382F6;
|
background-color: #5382F6;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user