八项作业流程图
parent
5052eba52a
commit
35bcb78b59
|
@ -87,138 +87,136 @@
|
|||
//权限检测
|
||||
requestPermissions(permissionID) {
|
||||
let _this = this;
|
||||
_this.$emit('changeAuth');
|
||||
//
|
||||
// // #ifdef APP-PLUS
|
||||
// //判断安卓与ios设备
|
||||
// if (plus.os.name == 'Android') {
|
||||
// let _permissionID = 'android.permission.' + permissionID;
|
||||
// plus.android.checkPermission(_permissionID,
|
||||
// granted => {
|
||||
// if (granted.checkResult == -1) {
|
||||
// //还未授权当前查询的权限,打开权限申请目的自定义弹框
|
||||
// _this.showPopup = true;
|
||||
// _this.$nextTick(() => {
|
||||
// setTimeout(() => {
|
||||
// _this.ani = 'uni-' + _this.type
|
||||
// },30)
|
||||
// })
|
||||
// }
|
||||
// },
|
||||
// error => {
|
||||
// console.log(error.message);
|
||||
// }
|
||||
// );
|
||||
// plus.android.requestPermissions([_permissionID],
|
||||
// (e) => {
|
||||
// //关闭权限申请目的自定义弹框
|
||||
// _this.ani = '';
|
||||
// _this.$nextTick(() => {
|
||||
// setTimeout(() => {
|
||||
// _this.showPopup = false
|
||||
// }, 0)
|
||||
// })
|
||||
// console.log(e,'kkkkk')
|
||||
// if (e.granted.length > 0) {
|
||||
// //当前查询权限已授权,此时可以通知页面执行接下来的操作
|
||||
// _this.$emit('changeAuth');
|
||||
// }
|
||||
// if (e.deniedAlways.length > 0) {
|
||||
// //当前查询权限已被永久禁用,此时需要引导用户跳转手机系统设置去开启
|
||||
// uni.showModal({
|
||||
// title: '温馨提示',
|
||||
// content: '还没有该权限,立即去设置开启?',
|
||||
// cancelText: "取消",
|
||||
// confirmText: "去设置",
|
||||
// showCancel: true,
|
||||
// confirmColor: '#000',
|
||||
// cancelColor: '#666',
|
||||
// success: (res) => {
|
||||
// if (res.confirm) {
|
||||
// _this.goSetting();
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// } else {
|
||||
// //IOS不需要添加自定义弹框来描述权限目的,因为在配置文件的隐私信息访问的许可描述里可添加
|
||||
// //正常可以直接调用uni的API调起权限询问弹框使用各种权限,下面的判断使用场景主要是在IOS禁用某权限后,这个可以判断有无权限,进而引导用户跳转设置开启,仅列出了位置、相册、通讯录、相机、录音等权限,其他IOS权限可具体参考 https://ext.dcloud.net.cn/plugin?id=15787
|
||||
// let result = 0;
|
||||
// if (permissionID == 'ACCESS_FINE_LOCATION') {
|
||||
// //IOS检测位置权限
|
||||
// let cLLocationManager = plus.ios.importClass("CLLocationManager"),
|
||||
// authStatus = cLLocationManager.authorizationStatus(),
|
||||
// enable = cLLocationManager.locationServicesEnabled();
|
||||
// if (enable && authStatus != 2) {
|
||||
// result = 1;
|
||||
// } else {
|
||||
// result = 0;
|
||||
// }
|
||||
// plus.ios.deleteObject(cLLocationManager);
|
||||
// } else if (permissionID == 'WRITE_EXTERNAL_STORAGE') {
|
||||
// //IOS检测相册权限
|
||||
// let PHPhotoLibrary = plus.ios.importClass("PHPhotoLibrary"),
|
||||
// authStatus = PHPhotoLibrary.authorizationStatus();
|
||||
// if (authStatus === 3) {
|
||||
// result = 1;
|
||||
// } else {
|
||||
// result = 0;
|
||||
// }
|
||||
// plus.ios.deleteObject(PHPhotoLibrary);
|
||||
// } else if (permissionID == 'CAMERA') {
|
||||
// //IOS检测相机/摄像头权限
|
||||
// let avCaptureDevice = plus.ios.importClass("AVCaptureDevice"),
|
||||
// authStatus = avCaptureDevice.authorizationStatusForMediaType("vide");
|
||||
// if (authStatus === 3) {
|
||||
// result = 1;
|
||||
// } else {
|
||||
// result = 0;
|
||||
// }
|
||||
// plus.ios.deleteObject(avCaptureDevice);
|
||||
// } else if (permissionID == 'CALL_PHONE') {
|
||||
// //IOS检测通讯录权限
|
||||
// let contactStore = plus.ios.importClass("CNContactStore"),
|
||||
// authStatus = contactStore.authorizationStatusForEntityType(0);
|
||||
// if (authStatus === 3) {
|
||||
// result = 1;
|
||||
// } else {
|
||||
// result = 0;
|
||||
// }
|
||||
// plus.ios.deleteObject(contactStore);
|
||||
// }else if(permissionID == 'RECORD_AUDIO'){
|
||||
// //IOS检测麦克风权限
|
||||
// let aVAudioSession = plus.ios.importClass("AVAudioSession"),
|
||||
// aVAudio = aVAudioSession.sharedInstance(),
|
||||
// authStatus = aVAudio.recordPermission();
|
||||
// if ([1684369017, 1970168948].includes(authStatus)) {
|
||||
// result = 0;
|
||||
// } else {
|
||||
// result = 1;
|
||||
// }
|
||||
// plus.ios.deleteObject(aVAudioSession);
|
||||
// }
|
||||
// if (result) {
|
||||
// //当前查询权限已授权,此时可以通知页面执行接下来的操作
|
||||
// that.$emit('changeAuth')
|
||||
// } else {
|
||||
// //当前查询的权限已禁用,引导用户跳转手机系统设置去开启
|
||||
// uni.showModal({
|
||||
// title: '温馨提示',
|
||||
// content: '还没有该权限,立即去设置开启?',
|
||||
// cancelText: "取消",
|
||||
// confirmText: "去设置",
|
||||
// showCancel: true,
|
||||
// confirmColor: '#000',
|
||||
// cancelColor: '#666',
|
||||
// success: (res) => {
|
||||
// if (res.confirm) {
|
||||
// _this.goSetting();
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// #ifdef APP-PLUS
|
||||
//判断安卓与ios设备
|
||||
if (plus.os.name == 'Android') {
|
||||
let _permissionID = 'android.permission.' + permissionID;
|
||||
plus.android.checkPermission(_permissionID,
|
||||
granted => {
|
||||
if (granted.checkResult == -1) {
|
||||
//还未授权当前查询的权限,打开权限申请目的自定义弹框
|
||||
_this.showPopup = true;
|
||||
_this.$nextTick(() => {
|
||||
setTimeout(() => {
|
||||
_this.ani = 'uni-' + _this.type
|
||||
},30)
|
||||
})
|
||||
}
|
||||
},
|
||||
error => {
|
||||
console.log(error.message);
|
||||
}
|
||||
);
|
||||
plus.android.requestPermissions([_permissionID],
|
||||
(e) => {
|
||||
//关闭权限申请目的自定义弹框
|
||||
_this.ani = '';
|
||||
_this.$nextTick(() => {
|
||||
setTimeout(() => {
|
||||
_this.showPopup = false
|
||||
}, 0)
|
||||
})
|
||||
console.log(e,'kkkkk')
|
||||
if (e.granted.length > 0) {
|
||||
//当前查询权限已授权,此时可以通知页面执行接下来的操作
|
||||
_this.$emit('changeAuth');
|
||||
}
|
||||
if (e.deniedAlways.length > 0) {
|
||||
//当前查询权限已被永久禁用,此时需要引导用户跳转手机系统设置去开启
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: '还没有该权限,立即去设置开启?',
|
||||
cancelText: "取消",
|
||||
confirmText: "去设置",
|
||||
showCancel: true,
|
||||
confirmColor: '#000',
|
||||
cancelColor: '#666',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
_this.goSetting();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
//IOS不需要添加自定义弹框来描述权限目的,因为在配置文件的隐私信息访问的许可描述里可添加
|
||||
//正常可以直接调用uni的API调起权限询问弹框使用各种权限,下面的判断使用场景主要是在IOS禁用某权限后,这个可以判断有无权限,进而引导用户跳转设置开启,仅列出了位置、相册、通讯录、相机、录音等权限,其他IOS权限可具体参考 https://ext.dcloud.net.cn/plugin?id=15787
|
||||
let result = 0;
|
||||
if (permissionID == 'ACCESS_FINE_LOCATION') {
|
||||
//IOS检测位置权限
|
||||
let cLLocationManager = plus.ios.importClass("CLLocationManager"),
|
||||
authStatus = cLLocationManager.authorizationStatus(),
|
||||
enable = cLLocationManager.locationServicesEnabled();
|
||||
if (enable && authStatus != 2) {
|
||||
result = 1;
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
plus.ios.deleteObject(cLLocationManager);
|
||||
} else if (permissionID == 'WRITE_EXTERNAL_STORAGE') {
|
||||
//IOS检测相册权限
|
||||
let PHPhotoLibrary = plus.ios.importClass("PHPhotoLibrary"),
|
||||
authStatus = PHPhotoLibrary.authorizationStatus();
|
||||
if (authStatus === 3) {
|
||||
result = 1;
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
plus.ios.deleteObject(PHPhotoLibrary);
|
||||
} else if (permissionID == 'CAMERA') {
|
||||
//IOS检测相机/摄像头权限
|
||||
let avCaptureDevice = plus.ios.importClass("AVCaptureDevice"),
|
||||
authStatus = avCaptureDevice.authorizationStatusForMediaType("vide");
|
||||
if (authStatus === 3) {
|
||||
result = 1;
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
plus.ios.deleteObject(avCaptureDevice);
|
||||
} else if (permissionID == 'CALL_PHONE') {
|
||||
//IOS检测通讯录权限
|
||||
let contactStore = plus.ios.importClass("CNContactStore"),
|
||||
authStatus = contactStore.authorizationStatusForEntityType(0);
|
||||
if (authStatus === 3) {
|
||||
result = 1;
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
plus.ios.deleteObject(contactStore);
|
||||
}else if(permissionID == 'RECORD_AUDIO'){
|
||||
//IOS检测麦克风权限
|
||||
let aVAudioSession = plus.ios.importClass("AVAudioSession"),
|
||||
aVAudio = aVAudioSession.sharedInstance(),
|
||||
authStatus = aVAudio.recordPermission();
|
||||
if ([1684369017, 1970168948].includes(authStatus)) {
|
||||
result = 0;
|
||||
} else {
|
||||
result = 1;
|
||||
}
|
||||
plus.ios.deleteObject(aVAudioSession);
|
||||
}
|
||||
if (result) {
|
||||
//当前查询权限已授权,此时可以通知页面执行接下来的操作
|
||||
that.$emit('changeAuth')
|
||||
} else {
|
||||
//当前查询的权限已禁用,引导用户跳转手机系统设置去开启
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: '还没有该权限,立即去设置开启?',
|
||||
cancelText: "取消",
|
||||
confirmText: "去设置",
|
||||
showCancel: true,
|
||||
confirmColor: '#000',
|
||||
cancelColor: '#666',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
_this.goSetting();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
//跳转手机系统设置
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
</view>
|
||||
<view class="step-item-wrap-right">
|
||||
<view class="step-item-wrap-right-title">{{item.STEP_NAME}}</view>
|
||||
<view class="step-item-wrap-right-title">{{item.ACT_USER_NAME || item.SIGN_USER}}</view>
|
||||
<view class="step-item-wrap-right-title">{{item.SIGN_USER || item.FINISHED_SIGN_USER || item.ACT_USER_NAME }}</view>
|
||||
<view class="step-item-wrap-right-title">{{item.ACT_TIME}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<text>八项作业</text>
|
||||
</view> -->
|
||||
<view class="apps-warp">
|
||||
<navigator v-show="premission.confinedspace" class="apps-item" hover-class="none" url="/pages/application/confinedspace/home">
|
||||
<navigator class="apps-item" hover-class="none" url="/pages/application/confinedspace/home">
|
||||
<view class="imgs action">
|
||||
<image src="../../static/icon-apps/icon-806.png" mode=""></image>
|
||||
<view v-if="eight_work_count.CONFINEDSPACE_COUNT" class="cu-tag badge">{{eight_work_count.CONFINEDSPACE_COUNT}}</view>
|
||||
|
@ -30,7 +30,7 @@
|
|||
<!-- <view>设备检修</view>-->
|
||||
<!-- </view>-->
|
||||
<!-- </navigator>-->
|
||||
<navigator v-show="premission['blind-board']" class="apps-item" hover-class="none" url="/pages/application/blind-board/home">
|
||||
<navigator class="apps-item" hover-class="none" url="/pages/application/blind-board/home">
|
||||
<view class="imgs action">
|
||||
<image src="../../static/icon-apps/icon-801.png" mode=""></image>
|
||||
<view v-if="eight_work_count.BLIND_BOARD_COUNT" class="cu-tag badge">{{eight_work_count.BLIND_BOARD_COUNT}}</view>
|
||||
|
@ -39,7 +39,7 @@
|
|||
<view>盲板抽堵作业</view>
|
||||
</view>
|
||||
</navigator>
|
||||
<navigator v-show="premission['break-ground']" class="apps-item" hover-class="none" url="/pages/application/break-ground/home">
|
||||
<navigator class="apps-item" hover-class="none" url="/pages/application/break-ground/home">
|
||||
<view class="imgs action">
|
||||
<image src="../../static/icon-apps/icon-802.png" mode=""></image>
|
||||
<view v-if="eight_work_count.BREAK_GROUND_COUNT" class="cu-tag badge">{{eight_work_count.BREAK_GROUND_COUNT}}</view>
|
||||
|
@ -48,7 +48,7 @@
|
|||
<view>动土作业</view>
|
||||
</view>
|
||||
</navigator>
|
||||
<navigator v-show="premission['high-work']" class="apps-item" hover-class="none" url="/pages/application/highwork/home">
|
||||
<navigator class="apps-item" hover-class="none" url="/pages/application/highwork/home">
|
||||
<view class="imgs action">
|
||||
<image src="../../static/icon-apps/icon-803.png" mode=""></image>
|
||||
<view v-if="eight_work_count.HIGHWORK_COUNT" class="cu-tag badge">{{eight_work_count.HIGHWORK_COUNT}}</view>
|
||||
|
@ -59,7 +59,7 @@
|
|||
</navigator>
|
||||
<!-- </view>-->
|
||||
<!-- <view class="apps-warp">-->
|
||||
<navigator v-show="premission.hoisting" class="apps-item" hover-class="none" url="/pages/application/hoisting/home">
|
||||
<navigator class="apps-item" hover-class="none" url="/pages/application/hoisting/home">
|
||||
<view class="imgs action">
|
||||
<image src="../../static/icon-apps/icon-804.png" mode=""></image>
|
||||
<view v-if="eight_work_count.HOISTING_COUNT" class="cu-tag badge">{{eight_work_count.HOISTING_COUNT}}</view>
|
||||
|
@ -68,7 +68,6 @@
|
|||
<view>吊装作业</view>
|
||||
</view>
|
||||
</navigator>
|
||||
<!-- v-show="premission.electricity"-->
|
||||
<navigator class="apps-item" hover-class="none" url="/pages/application/electricity/home">
|
||||
<view class="imgs action">
|
||||
<image src="../../static/icon-apps/icon-805.png" mode=""></image>
|
||||
|
@ -78,7 +77,7 @@
|
|||
<view>临时用电作业</view>
|
||||
</view>
|
||||
</navigator>
|
||||
<navigator v-show="premission.hotwork" class="apps-item" hover-class="none" url="/pages/application/hotwork/home">
|
||||
<navigator class="apps-item" hover-class="none" url="/pages/application/hotwork/home">
|
||||
<view class="imgs action">
|
||||
<image src="../../static/icon-apps/icon-807.png" mode=""></image>
|
||||
<view v-if="eight_work_count.HOTWORK_COUNT" class="cu-tag badge">{{eight_work_count.HOTWORK_COUNT}}</view>
|
||||
|
@ -87,7 +86,7 @@
|
|||
<view>动火作业</view>
|
||||
</view>
|
||||
</navigator>
|
||||
<navigator v-show="premission['open-circuit']" class="apps-item" hover-class="none" url="/pages/application/open-circuit/home">
|
||||
<navigator class="apps-item" hover-class="none" url="/pages/application/open-circuit/home">
|
||||
<view class="imgs action">
|
||||
<image src="../../static/icon-apps/open-circuit.png" mode=""></image>
|
||||
<view v-if="eight_work_count.OPEN_CIRCUIT_COUNT" class="cu-tag badge">{{eight_work_count.OPEN_CIRCUIT_COUNT}}</view>
|
||||
|
|
|
@ -624,30 +624,21 @@
|
|||
},
|
||||
|
||||
//图片上传
|
||||
ChooseImage() {
|
||||
ChooseImage() {
|
||||
var _this = this;
|
||||
var ss = 4 - this.hiddenForm.hiddenImgs.length;
|
||||
uni.chooseImage({
|
||||
count: ss, //默认9
|
||||
count: 4, //默认9
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['camera', 'album'], //从相册选择
|
||||
success: (res) => {
|
||||
for (let i = 0; i < res.tempFilePaths.length; i++) {
|
||||
if (e == 0) {
|
||||
let img = {};
|
||||
img.IMGFILES_ID = '';
|
||||
img.FILEPATH = res.tempFilePaths[i];
|
||||
this.hiddenForm.hiddenImgs.push(img)
|
||||
} else {
|
||||
let img = {};
|
||||
img.IMGFILES_ID = '';
|
||||
img.FILEPATH = res.tempFilePaths[i];
|
||||
this.imgList1.push(img)
|
||||
}
|
||||
if (this.imgList.length != 0) {
|
||||
this.imgList = this.imgList.concat(res.tempFilePaths)
|
||||
} else {
|
||||
this.imgList = res.tempFilePaths
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
ViewImage(e) {
|
||||
uni.previewImage({
|
||||
urls: this.imgList,
|
||||
|
@ -672,13 +663,15 @@
|
|||
ChooseImage_fa() {
|
||||
var _this = this;
|
||||
uni.chooseImage({
|
||||
count: 4 - _this.imgList.length, // +++ 确保总数不超过4张
|
||||
sizeType: ['original', 'compressed'],
|
||||
sourceType: ['camera', 'album'],
|
||||
count: 4, //默认9
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['camera', 'album'], //从相册选择
|
||||
success: (res) => {
|
||||
// 将选择的图片路径添加到 imgList 数组
|
||||
_this.imgList = _this.imgList.concat(res.tempFilePaths);
|
||||
_this.$forceUpdate(); // +++ 强制更新视图以显示新图片
|
||||
if (this.imgList_fa.length != 0) {
|
||||
this.imgList_fa = this.imgList_fa.concat(res.tempFilePaths)
|
||||
} else {
|
||||
this.imgList_fa = res.tempFilePaths
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -762,14 +755,14 @@
|
|||
});
|
||||
return;
|
||||
}
|
||||
// if (_this.imgList.length <= 0) {
|
||||
// uni.showToast({
|
||||
// icon: 'none',
|
||||
// title: '请上传整改后照片',
|
||||
// duration: 1500
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
if (_this.imgList.length <= 0) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '请上传整改后照片',
|
||||
duration: 1500
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.HAVESCHEME == 1) {
|
||||
if (this.pd.GOVERNSTANDARDS == '' || this.pd.GOVERNSTANDARDS == undefined) {
|
||||
|
|
|
@ -100,7 +100,7 @@
|
|||
</view>
|
||||
<view class="step-item-wrap-right">
|
||||
<view class="step-item-wrap-right-title">{{item.STEP_NAME}}</view>
|
||||
<view class="step-item-wrap-right-title">{{item.ACT_USER_NAME || item.SIGN_USER}}</view>
|
||||
<view class="step-item-wrap-right-title">{{item.SIGN_USER || item.FINISHED_SIGN_USER || item.ACT_USER_NAME }}</view>
|
||||
<view class="step-item-wrap-right-title">{{item.ACT_TIME}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
@ -104,7 +104,7 @@
|
|||
</view>
|
||||
<view class="home-apps-list">
|
||||
<navigator class="home-apps-item" hover-class="none" url="/pages/application/eight-assignments"
|
||||
v-show="premission.eightWork">
|
||||
>
|
||||
<view class="home-apps-item-img" style="position: relative;">
|
||||
<image src="../../static/icon-apps/home-gw.png" mode=""></image>
|
||||
<view v-if="eight_work_count>0" class="cu-tag badge">{{ eight_work_count }}</view>
|
||||
|
@ -125,7 +125,7 @@
|
|||
<view v-if="keyProjectManagement" class="cu-tag badge">{{ keyProjectManagement }}</view>
|
||||
</navigator>
|
||||
<navigator class="home-apps-item" hover-class="none" url="/pages/application/commitment"
|
||||
v-show="premission.commitment">
|
||||
>
|
||||
<view class="home-apps-item-img">
|
||||
<image src="../../static/icon-apps/home-cns.png" mode=""></image>
|
||||
</view>
|
||||
|
@ -134,7 +134,7 @@
|
|||
</view>
|
||||
</navigator>
|
||||
<navigator class="home-apps-item" hover-class="none" url="/pages/application/onlinexxks/home"
|
||||
v-show="premission.education">
|
||||
>
|
||||
<view class="home-apps-item-img">
|
||||
<image src="../../static/icon-apps/home-study.png" mode=""></image>
|
||||
</view>
|
||||
|
@ -180,7 +180,7 @@
|
|||
<!-- </navigator>-->
|
||||
|
||||
<navigator class="home-apps-item" hover-class="none" url="/pages/application/speEquip/index"
|
||||
v-show="premission.speEquip">
|
||||
>
|
||||
<view class="home-apps-item-img">
|
||||
<image src="../../static/icon-apps/home-speEquip.jpg" mode=""></image>
|
||||
</view>
|
||||
|
@ -657,12 +657,8 @@
|
|||
loginSession()
|
||||
this.getSafetyEnvironmentalInspectionCount();
|
||||
this.getUpdateInfo()
|
||||
this.premission = Object.assign({}, premission)
|
||||
let now = new Date();
|
||||
var today = formatDate(now, 'yyyy-MM-dd');
|
||||
if (!this.premission || JSON.stringify(this.premission) === '{}') {
|
||||
this.getMenu();
|
||||
}
|
||||
this.getIsRest();
|
||||
this.getData();
|
||||
this.getSurveyData();
|
||||
|
@ -765,118 +761,6 @@
|
|||
})
|
||||
},
|
||||
|
||||
getMenu() {
|
||||
var _this = this;
|
||||
uni.showLoading({
|
||||
title: '请稍候'
|
||||
})
|
||||
uni.request({
|
||||
url: basePath + '/app/main/index',
|
||||
method: 'POST',
|
||||
dataType: 'json',
|
||||
header: {
|
||||
'Content-type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: {
|
||||
USER_ID: loginUser.USER_ID,
|
||||
},
|
||||
success: (res) => {
|
||||
console.log(res.data.result)
|
||||
if ("success" == res.data.result) {
|
||||
|
||||
var menuList = res.data.menuList
|
||||
var premissionList = new Map()
|
||||
|
||||
menuList.map(item => {
|
||||
if (item.menu_NAME == '安全承诺' && item.hasMenu) {
|
||||
premissionList.set('commitment', true)
|
||||
if (item.subMenu && item.subMenu.length > 0) {
|
||||
item.subMenu.map(child => {
|
||||
if (child.menu_NAME == '公司级承诺公告' && child
|
||||
.hasMenu) {
|
||||
premissionList.set('commitment-company', true)
|
||||
}
|
||||
if (child.menu_NAME == '车间级承诺公告' && child
|
||||
.hasMenu) {
|
||||
premissionList.set('commitment-workshop', true)
|
||||
}
|
||||
if (child.menu_NAME == '班组级承诺公告' && child
|
||||
.hasMenu) {
|
||||
premissionList.set('commitment-team', true)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if (item.menu_NAME == '受限空间作业管理' && item.hasMenu) {
|
||||
premissionList.set('eightWork', true)
|
||||
premissionList.set('confinedspace', true)
|
||||
}
|
||||
if (item.menu_NAME == '动火作业管理' && item.hasMenu) {
|
||||
premissionList.set('eightWork', true)
|
||||
premissionList.set('hotwork', true)
|
||||
}
|
||||
if (item.menu_NAME == '高处作业管理' && item.hasMenu) {
|
||||
premissionList.set('eightWork', true)
|
||||
premissionList.set('high-work', true)
|
||||
}
|
||||
if (item.menu_NAME == '吊装作业管理' && item.hasMenu) {
|
||||
premissionList.set('eightWork', true)
|
||||
premissionList.set('hoisting', true)
|
||||
}
|
||||
if (item.menu_NAME == '盲板抽堵作业管理' && item.hasMenu) {
|
||||
premissionList.set('eightWork', true)
|
||||
premissionList.set('blind-board', true)
|
||||
}
|
||||
if (item.menu_NAME == '动土作业管理' && item.hasMenu) {
|
||||
premissionList.set('eightWork', true)
|
||||
premissionList.set('break-ground', true)
|
||||
}
|
||||
if (item.menu_NAME == '临时用电作业管理' && item.hasMenu) {
|
||||
premissionList.set('eightWork', true)
|
||||
premissionList.set('electricity', true)
|
||||
}
|
||||
if (item.menu_NAME == '断路作业管理' && item.hasMenu) {
|
||||
premissionList.set('eightWork', true)
|
||||
premissionList.set('open-circuit', true)
|
||||
}
|
||||
if (item.menu_NAME == '在线学习与考试' && item.hasMenu) {
|
||||
premissionList.set('education', true)
|
||||
}
|
||||
// console.info(premissionList)
|
||||
if (item.menu_NAME == '设备设施管理' && item.hasMenu) {
|
||||
premissionList.set('speEquip', true)
|
||||
}
|
||||
})
|
||||
this.premission = (Object.fromEntries(premissionList));
|
||||
setPremission(Object.fromEntries(premissionList));
|
||||
uni.hideLoading();
|
||||
} else {
|
||||
setloginUserId(null);
|
||||
setCorpinfoId(null);
|
||||
setDeptId(null);
|
||||
setloginUser(null);
|
||||
uni.removeStorage({
|
||||
key: 'USER'
|
||||
});
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/home'
|
||||
});
|
||||
// uni.showToast({
|
||||
// title: res.data.message,
|
||||
// duration: 2000
|
||||
// });
|
||||
}
|
||||
},
|
||||
fail: (res) => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: "服务器正在升级,请稍后再试。",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
async downCallback(page) {
|
||||
await this.getWork();
|
||||
await this.getUserData();
|
||||
|
|
|
@ -89,26 +89,12 @@
|
|||
noClick: true,
|
||||
userName: '',
|
||||
userPwd: '',
|
||||
push_clientid: '',
|
||||
radio: ''
|
||||
}
|
||||
},
|
||||
async onLoad() {
|
||||
this.getRemember()
|
||||
uni.getPushClientId({
|
||||
success: (res) => {
|
||||
this.push_clientid = res.cid
|
||||
this.getLoginUser()
|
||||
console.log('客户端推送标识:', res.cid)
|
||||
},
|
||||
fail(err) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: "获取用户标识失败,请重新登录",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
});
|
||||
this.getLoginUser()
|
||||
// this.getLoginUser()
|
||||
//this.getUrlVersion();
|
||||
},
|
||||
|
@ -160,7 +146,6 @@
|
|||
USER_ID: loginUser.USER_ID,
|
||||
},
|
||||
success: (res1) => {
|
||||
this.updatePushCid(USER_ID, this.push_clientid)
|
||||
if ("success" == res1.data.result) {
|
||||
if (res1.data.ISREST != null) {
|
||||
setIsRest(res1.data.ISREST);
|
||||
|
@ -292,8 +277,14 @@
|
|||
key: 'remember',
|
||||
data: remember
|
||||
});
|
||||
this.getMenu()
|
||||
this.updatePushCid(res.data.USER_ID, this.push_clientid)
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: "登录成功",
|
||||
duration: 1000
|
||||
});
|
||||
uni.redirectTo({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
} else if ("usererror" == result) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
|
@ -346,114 +337,6 @@
|
|||
duration: 2000
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
getMenu() {
|
||||
var _this = this;
|
||||
uni.showLoading({
|
||||
title: '请稍候'
|
||||
})
|
||||
uni.request({
|
||||
url: basePath + '/app/main/index',
|
||||
method: 'POST',
|
||||
dataType: 'json',
|
||||
header: {
|
||||
'Content-type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: {
|
||||
USER_ID: loginUser.USER_ID,
|
||||
},
|
||||
success: (res) => {
|
||||
|
||||
if ("success" == res.data.result) {
|
||||
|
||||
var menuList = res.data.menuList
|
||||
var premissionList = new Map()
|
||||
|
||||
menuList.map(item => {
|
||||
if (item.menu_NAME == '安全承诺' && item.hasMenu) {
|
||||
premissionList.set('commitment', true)
|
||||
if (item.subMenu && item.subMenu.length > 0) {
|
||||
item.subMenu.map(child => {
|
||||
if (child.menu_NAME == '公司级承诺公告' && child
|
||||
.hasMenu) {
|
||||
premissionList.set('commitment-company', true)
|
||||
}
|
||||
if (child.menu_NAME == '车间级承诺公告' && child
|
||||
.hasMenu) {
|
||||
premissionList.set('commitment-workshop', true)
|
||||
}
|
||||
if (child.menu_NAME == '班组级承诺公告' && child
|
||||
.hasMenu) {
|
||||
premissionList.set('commitment-team', true)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if (item.menu_NAME == '受限空间作业管理' && item.hasMenu) {
|
||||
premissionList.set('eightWork', true)
|
||||
premissionList.set('confinedspace', true)
|
||||
}
|
||||
if (item.menu_NAME == '动火作业管理' && item.hasMenu) {
|
||||
premissionList.set('eightWork', true)
|
||||
premissionList.set('hotwork', true)
|
||||
}
|
||||
if (item.menu_NAME == '高处作业管理' && item.hasMenu) {
|
||||
premissionList.set('eightWork', true)
|
||||
premissionList.set('high-work', true)
|
||||
}
|
||||
if (item.menu_NAME == '吊装作业管理' && item.hasMenu) {
|
||||
premissionList.set('eightWork', true)
|
||||
premissionList.set('hoisting', true)
|
||||
}
|
||||
if (item.menu_NAME == '盲板抽堵作业管理' && item.hasMenu) {
|
||||
premissionList.set('eightWork', true)
|
||||
premissionList.set('blind-board', true)
|
||||
}
|
||||
if (item.menu_NAME == '动土作业管理' && item.hasMenu) {
|
||||
premissionList.set('eightWork', true)
|
||||
premissionList.set('break-ground', true)
|
||||
}
|
||||
if (item.menu_NAME == '临时用电作业管理' && item.hasMenu) {
|
||||
premissionList.set('eightWork', true)
|
||||
premissionList.set('electricity', true)
|
||||
}
|
||||
if (item.menu_NAME == '断路作业管理' && item.hasMenu) {
|
||||
premissionList.set('eightWork', true)
|
||||
premissionList.set('open-circuit', true)
|
||||
}
|
||||
if (item.menu_NAME == '在线学习与考试' && item.hasMenu) {
|
||||
premissionList.set('education', true)
|
||||
}
|
||||
|
||||
if (item.menu_NAME == '设备设施管理' && item.hasMenu) {
|
||||
premissionList.set('speEquip', true)
|
||||
}
|
||||
})
|
||||
setPremission(Object.fromEntries(premissionList));
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: "登录成功",
|
||||
duration: 1000
|
||||
});
|
||||
uni.redirectTo({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.data.message,
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: (res) => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: "服务器正在升级,请稍后再试。",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
getUrlVersion() {
|
||||
|
@ -486,20 +369,6 @@
|
|||
});
|
||||
});
|
||||
},
|
||||
updatePushCid(userId, pushCid) {
|
||||
uni.request({
|
||||
url: basePath + '/app/user/updatePushCid',
|
||||
method: 'POST',
|
||||
dataType: 'json',
|
||||
header: {
|
||||
'Content-type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: {
|
||||
USER_ID: userId,
|
||||
PUSH_CID: pushCid
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue