diff --git a/main.js b/main.js
index 408665a0..924e5f13 100644
--- a/main.js
+++ b/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({
...App
})
diff --git a/manifest.json b/manifest.json
index 03d8acc8..e971f119 100644
--- a/manifest.json
+++ b/manifest.json
@@ -2,8 +2,8 @@
"name" : "智慧安全", //中建四局
"appid" : "__UNI__4AA4101",
"description" : "",
- "versionName" : "1.5.6",
- "versionCode" : 156,
+ "versionName" : "1.5.7",
+ "versionCode" : 157,
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
diff --git a/pages.json b/pages.json
index 659e6cbb..22b642a4 100644
--- a/pages.json
+++ b/pages.json
@@ -2464,7 +2464,6 @@
"path": "pages/personLocation/exam/rules/rules",
"style": {
"navigationBarTitleText": "规章",
- "enablePullDownRefresh": true,
"onReachBottomDistance": 100
}
},
@@ -2580,7 +2579,7 @@
// }]
// }],
"globalStyle": {
- "navigationBarBackgroundColor": "#F0AD4E",
+ // "navigationBarBackgroundColor": "#F0AD4E",
"navigationStyle": "custom",
"app-plus": {
"bounce": "none"
diff --git a/pages/personLocation/exam/beginexam/beginexam.vue b/pages/personLocation/exam/beginexam/beginexam.vue
index 017f5f4f..1fa76899 100644
--- a/pages/personLocation/exam/beginexam/beginexam.vue
+++ b/pages/personLocation/exam/beginexam/beginexam.vue
@@ -5,37 +5,45 @@
开始考试
-
-
- {{index + 1}}、{{item.questionName}}({{item.score||0}}分)
- 剩余时间:{{ timeLeft }}
+
+ 剩余时间:{{ timeLeft }}
+
+
+ {{index + 1}}、
+ {{item.questionName}}({{item.score||0}}分)
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
@@ -58,16 +66,20 @@
this.getDataFn();
},
onLoad(options) {
+ console.log(options, 123456)
this.pageData = JSON.parse(options.transportData)
console.log(this.pageData.examDuration)
- this.totalTime = +this.pageData.examDuration * 60;
},
onShow() {
+ this.totalTime = +this.pageData.examDuration * 60;
this.startTimer();
},
onHide() {
this.stopTimer();
},
+ onUnload() {
+ this.stopTimer();
+ },
computed: {
timeLeft() {
let hours = Math.floor(this.totalTime / 3600);
@@ -132,6 +144,7 @@
}, 1000);
},
stopTimer() {
+ console.log('我计时器已卸载')
clearInterval(this.timer);
this.timer = null;
},
@@ -207,15 +220,15 @@
goFront(index) {
let that = this;
that.stIndex--;
- var progressTip = document.querySelector('.uni-progress-info');
- progressTip.innerText = (((that.stIndex + 1) * 100) / that.stList.length).toFixed(0) + '%'
+ // var progressTip = document.querySelector('.uni-progress-info');
+ // progressTip.innerText = (((that.stIndex + 1) * 100) / that.stList.length).toFixed(0) + '%'
},
// 去下一题
goNext(index) {
let that = this;
that.stIndex++;
- var progressTip = document.querySelector('.uni-progress-info');
- progressTip.innerText = (((that.stIndex + 1) * 100) / that.stList.length).toFixed(0) + '%'
+ // var progressTip = document.querySelector('.uni-progress-info');
+ // progressTip.innerText = (((that.stIndex + 1) * 100) / that.stList.length).toFixed(0) + '%'
// uni.hideLoading()
},
goHiidden() {
@@ -260,32 +273,63 @@
\ No newline at end of file
diff --git a/pages/projectEnd/trainPlan/selectPerson.vue b/pages/projectEnd/trainPlan/selectPerson.vue
index 90c650dd..0d3a3b82 100644
--- a/pages/projectEnd/trainPlan/selectPerson.vue
+++ b/pages/projectEnd/trainPlan/selectPerson.vue
@@ -13,6 +13,7 @@
{{item.workerType}}
{{item.sex == 1?'男':'女'}} {{item.age}}
+
@@ -47,13 +48,25 @@
uni.removeStorageSync("personInfo")
},
onShow() {
- if(uni.getStorageSync("personInfo")){
- this.personList = JSON.parse(uni.getStorageSync("personInfo"))
+ if (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: {
- addForm(){
- if(!this.personList.length){
+ deletePersonFn(index) {
+ this.personList.splice(index, 1)
+ uni.setStorageSync("personInfo", JSON.stringify(this.personList))
+ },
+ addForm() {
+ if (!this.personList.length) {
uni.showToast({
title: '请选择人员',
icon: 'none'
@@ -71,20 +84,20 @@
header: {},
method: 'post',
success(res) {
- if(res.code == 200){
+ if (res.code == 200) {
uni.showToast({
title: "添加成功"
})
- setTimeout(function(){
+ setTimeout(function() {
uni.redirectTo({
url: './list'
})
- },500)
+ }, 500)
}
}
})
},
- toSelectPerson(){
+ toSelectPerson() {
uni.navigateTo({
url: './searchTeam/teamList'
})
@@ -118,11 +131,13 @@
.main-content {
display: flex;
flex-direction: column;
+
.index-boxs {
height: calc(100vh - 200rpx);
overflow-y: scroll;
padding: 58rpx 35rpx;
padding-bottom: 10rpx;
+
.index-box {
width: 100%;
background-color: white;
@@ -144,6 +159,7 @@
flex-direction: column;
justify-content: space-around;
margin: 8rpx 20rpx 0rpx 20rpx;
+ margin-right: auto;
text:nth-child(1) {
color: #303030;
@@ -173,6 +189,7 @@
align-items: center;
box-sizing: border-box;
z-index: 99;
+
.btn-select {
width: 50%;
line-height: 40px;
@@ -181,7 +198,8 @@
text-align: center;
border-radius: 10rpx;
}
- .btn-resubmit{
+
+ .btn-resubmit {
width: 50%;
line-height: 40px;
background-color: #5382F6;