最新版

This commit is contained in:
jxjgmj 2022-08-02 15:11:04 +08:00
parent 94cd2217dd
commit 1369c6b7d7
699 changed files with 7125 additions and 1657 deletions

31
App.vue
View File

@ -1,5 +1,4 @@
<script>
export default {
globalData: {
siteUrl: '',
@ -13,11 +12,16 @@
if (uni.getStorageSync('ipPort')) {
this.globalData.siteUrl = uni.getStorageSync('ipPort') + '/'
} else {
// this.globalData.siteUrl = 'http://124.71.178.44:100/' //
// this.globalData.siteUrl = 'http://124.71.178.44:8012/' //
this.globalData.siteUrl = 'http://182.90.224.237:7000/' //广西
// this.globalData.siteUrl = 'http://192.168.34.148:6023/' //广西/
// this.globalData.siteUrl = 'http://8.142.139.165:7080/' //
// this.globalData.siteUrl = "http://58.34.63.88:9090/"
// this.globalData.siteUrl = 'http://192.168.34.125:6023/'
// this.globalData.siteUrl = 'http://223.82.100.80:9000/'
// this.globalData.siteUrl = 'http://120.236.247.200:9000/'
this.globalData.siteUrl = 'http://zhgd.loganwy.com/'
// this.globalData.siteUrl = 'http://zhgd.loganwy.com/'
// this.globalData.siteUrl = 'http://183.60.227.61:30249/'
// this.globalData.siteUrl = 'http://124.71.178.44:9000/'
// this.globalData.siteUrl = "http://183.95.84.34:7185/"
@ -33,6 +37,11 @@
if (uni.getStorageSync('ipPort')) {
this.globalData.siteUrl = uni.getStorageSync('ipPort') + '/'
} else {
// this.globalData.siteUrl = 'http://8.142.139.165:7080/' //
// this.globalData.siteUrl = 'http://124.71.178.44:100/' //
// this.globalData.siteUrl = 'http://124.71.178.44:8012/' //
// this.globalData.siteUrl = 'http://192.168.34.148:6023/' //广西/
this.globalData.siteUrl = 'http://182.90.224.237:7000/' //广西
// this.globalData.siteUrl = "http://58.34.63.88:9090/"
// this.globalData.siteUrl = 'http://124.71.178.44:9000/'
// Vue.prototype.url_config = 'http://192.168.34.125:6023/'
@ -41,7 +50,7 @@
// this.globalData.siteUrl = "https://183.95.84.34:6183/"
// this.globalData.siteUrl = "http://36.137.53.203:9090/"
// this.globalData.siteUrl = 'http://183.60.227.61:30249/'
this.globalData.siteUrl = 'http://zhgd.loganwy.com/'
// this.globalData.siteUrl = 'http://zhgd.loganwy.com/'
// this.globalData.siteUrl = "http://36.137.53.203:9090/"
// Vue.prototype.url_config = 'http://124.71.87.250/'
// Vue.prototype.url_config = 'http://58.250.210.4:9090/'
@ -91,6 +100,21 @@
}
})
// #ifdef APP-PLUS
const _self = this;
const _handlePush = function(message) {
// TODO
console.log(message, "====================================")
setTimeout(() => {
uni.navigateTo({
url: message.payload
})
},1000)
};
plus.push.addEventListener('click', _handlePush);
plus.push.addEventListener('receive', _handlePush);
// #endif
},
@ -181,6 +205,7 @@
}
}
}
.headerBox {
height: 44px;
align-items: center;

101
main.js
View File

@ -1,45 +1,57 @@
import Vue from 'vue'
import App from './App'
Vue.config.productionTip = false
Vue.config.productionTip = false
App.mpType = 'app'
//全局变量
// Vue.prototype.mobileTopHeight = uni.getMenuButtonBoundingClientRect()?uni.getMenuButtonBoundingClientRect().top:0;
Vue.prototype.url_config=''
Vue.prototype.COMPANY = "longguang"
// Vue.prototype.COMPANY = "nanchang"
Vue.prototype.url_config = ''
// Vue.prototype.COMPANY = "longguang"
Vue.prototype.COMPANY = "nanchang"
// Vue.prototype.COMPANY = ""
if (process.env.NODE_ENV === 'development') {
// 开发环境
console.log('开发环境')
if(uni.getStorageSync('ipPort')){
Vue.prototype.url_config = uni.getStorageSync('ipPort')+'/'
}else{
// Vue.prototype.url_config = 'http://192.168.34.125:6023/'
// Vue.prototype.url_config = 'http://223.82.100.80:9000/'
// Vue.prototype.url_config = 'http://120.236.247.200:9000/'
Vue.prototype.url_config = 'http://zhgd.loganwy.com/'
// Vue.prototype.url_config = 'http://183.60.227.61:30249/'
// Vue.prototype.url_config = 'http://183.60.227.61:30249/'
// Vue.prototype.url_config = 'http://124.71.178.44:9000/'
// Vue.prototype.url_config = "http://58.34.63.88:9090/"
// Vue.prototype.url_config = "http://183.95.84.34:7185/"
// Vue.prototype.url_config = "http://218.92.215.138:9090/" //新佳城小区 123456
// Vue.prototype.url_config = "http://36.137.53.203:9090/" //南昌地铁 gdjt 123456
// Vue.prototype.url_config = 'http://124.71.178.44:8/'
// Vue.prototype.url_config = 'http://124.71.87.250/'
}
if (uni.getStorageSync('ipPort')) {
Vue.prototype.url_config = uni.getStorageSync('ipPort') + '/'
} else {
// Vue.prototype.url_config = 'http://8.142.139.165:7080/' // 湖里
// Vue.prototype.url_config = 'http://139.9.66.234:8/'
// Vue.prototype.url_config = 'http://192.168.34.125:6023/'
Vue.prototype.url_config = 'http://182.90.224.237:7000/' //广西联通
// Vue.prototype.url_config = 'http://192.168.34.148:6023' //广西联通/本地
// Vue.prototype.url_config = 'http://223.82.100.80:9000/'
// Vue.prototype.url_config = 'http://120.236.247.200:9000/'
// Vue.prototype.url_config = 'http://zhgd.loganwy.com/'
// Vue.prototype.url_config = 'http://183.60.227.61:30249/'
// Vue.prototype.url_config = 'http://183.60.227.61:30249/'
// Vue.prototype.url_config = 'http://124.71.178.44:9000/'
// Vue.prototype.url_config = "http://58.34.63.88:9090/"
// Vue.prototype.url_config = "http://183.95.84.34:7185/"
// Vue.prototype.url_config = "http://218.92.215.138:9090/" //新佳城小区 123456
// Vue.prototype.url_config = "http://36.137.53.203:9090/" //南昌地铁 gdjt 123456
// Vue.prototype.url_config = 'http://124.71.178.44:8/'
// Vue.prototype.url_config = 'http://124.71.87.250/'
// Vue.prototype.url_config = 'http://124.71.178.44:8012' // 河南
// Vue.prototype.url_config = 'http://124.71.178.44:100/' //演示平台
}
} else {
// 生产环境
console.log('生产环境')
if(uni.getStorageSync('ipPort')){
Vue.prototype.url_config = uni.getStorageSync('ipPort')+'/'
}else{
if (uni.getStorageSync('ipPort')) {
Vue.prototype.url_config = uni.getStorageSync('ipPort') + '/'
} else {
// Vue.prototype.url_config = 'http://124.71.178.44:100/' //演示平台
// Vue.prototype.url_config ='http://124.71.178.44:8012/' // 河南
// Vue.prototype.url_config = 'http://8.142.139.165:7080/' //湖里
// Vue.prototype.url_config = 'http://139.9.66.234:8/'
// Vue.prototype.url_config = 'http://192.168.34.125:6023/'
Vue.prototype.url_config = 'http://182.90.224.237:7000/' //广西联通
// Vue.prototype.url_config = 'http://192.168.34.148:6023' //广西联通/本地
// Vue.prototype.url_config = 'http://223.82.100.80:9000/'
// Vue.prototype.url_config = 'http://120.236.247.200:9000/'
// Vue.prototype.url_config = "http://58.34.63.88:9090/"
@ -48,11 +60,11 @@ if (process.env.NODE_ENV === 'development') {
// Vue.prototype.url_config = "http://36.137.53.203:9090/"
// Vue.prototype.url_config = 'http://192.168.34.125:6023/'
// Vue.prototype.url_config = 'http://183.60.227.61:30249/'
Vue.prototype.url_config = 'http://zhgd.loganwy.com/'
// Vue.prototype.url_config = 'http://zhgd.loganwy.com/'
// Vue.prototype.url_config = "http://36.137.53.203:9090/"
// Vue.prototype.url_config = 'http://124.71.87.250/'
}
}
Vue.prototype.sendRequest = function(param) {
@ -67,12 +79,16 @@ Vue.prototype.sendRequest = function(param) {
hideLoading = param.hideLoading || false;
//拼接完整请求地址
var requestUrl = Vue.prototype.url_config + url+'?lang='+uni.getStorageSync('language');
if (uni.getStorageSync('userInfo')&&url!='xmgl/base/login'&&url!='xmgl/wirelessEducationQuestionSubject/getDeviceRandomEducationQuestion'&&url!='xmgl/wirelessEducationQuestionAnswer/add'&&url!='xmgl/safeEducationQuestionAnswer/getAnswerWorkerInfo'&&url!='xmgl/safeEducationQuestionAnswer/add'&&url!='xmgl/safeEducationQuestion/selectSafeEducationQuestionInfo') {
var requestUrl = Vue.prototype.url_config + url + '?lang=' + uni.getStorageSync('language');
if (uni.getStorageSync('userInfo') && url != 'xmgl/base/login' && url !=
'xmgl/wirelessEducationQuestionSubject/getDeviceRandomEducationQuestion' && url !=
'xmgl/wirelessEducationQuestionAnswer/add' && url !=
'xmgl/safeEducationQuestionAnswer/getAnswerWorkerInfo' && url != 'xmgl/safeEducationQuestionAnswer/add' &&
url != 'xmgl/safeEducationQuestion/selectSafeEducationQuestionInfo') {
token = "Bearer " + JSON.parse(uni.getStorageSync('userInfo')).token;
header["Authorization"] = token
}
}
// var timestamp = Date.parse(new Date());//时间戳
// data["timestamp"] = timestamp;
// #ifdef MP-WEIXIN
@ -98,7 +114,7 @@ Vue.prototype.sendRequest = function(param) {
title: '加载中...'
});
}
// console.log("网络请求start");
console.log(requestUrl,"网络请求start");
//网络请求
uni.request({
url: requestUrl,
@ -108,26 +124,26 @@ Vue.prototype.sendRequest = function(param) {
success: res => {
// console.log("网络请求success:" + JSON.stringify(res.data));
if (res.data.code != 200) {
if(res.data.code==401||res.data.code==403){
if (res.data.code == 401 || res.data.code == 403) {
uni.showToast({
title: '登录过期,请重新登录',
icon: "none"
})
setTimeout(function(){
setTimeout(function() {
uni.removeStorageSync('userInfo')
uni.redirectTo({
url:'/pages/login/login.vue'
url: '/pages/login/login.vue'
})
},1000)
}else{
setTimeout(function(){
}, 1000)
} else {
setTimeout(function() {
uni.showToast({
title: res.data.message,
icon: "none"
})
},200)
}, 200)
}
typeof param.error == "function" && param.error(Data);
return;
}
@ -148,7 +164,10 @@ Vue.prototype.sendRequest = function(param) {
// uni.showModal({
// content: "" + e.errMsg
// });
uni.showToast({title: '服务器开小差了呢,请您稍后再试',icon:'none'})
uni.showToast({
title: '服务器开小差了呢,请您稍后再试',
icon: 'none'
})
typeof param.fail == "function" && param.fail(e.data);
},
complete: () => {
@ -163,6 +182,6 @@ Vue.prototype.sendRequest = function(param) {
}
const app = new Vue({
...App
...App
})
app.$mount()

View File

@ -1,9 +1,9 @@
{
"name" : "智慧工地云",
"appid" : "__UNI__5DFB609",
"appid" : "__UNI__98D510E",
"description" : "",
"versionName" : "125",
"versionCode" : 125,
"versionName" : "1.2.4",
"versionCode" : 124,
"transformPx" : false,
/* 5+App */
"app-plus" : {
@ -24,7 +24,10 @@
"Maps" : {},
"VideoPlayer" : {},
"Bluetooth" : {},
"SQLite" : {}
"SQLite" : {},
"Push" : {},
"FaceID" : {},
"Fingerprint" : {}
},
/* */
"distribute" : {
@ -33,27 +36,27 @@
"permissions" : [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_CHECKIN_PROPERTIES\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH_PRIVILEGED\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<uses-permission android:name=\"android.permission.CALL_PRIVILEGED\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.INTERNET\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
"<uses-permission android:name=\"android.permission.USE_FINGERPRINT\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
@ -81,41 +84,41 @@
},
"icons" : {
"android" : {
"hdpi" : "unpackage/res/icons/72x72.png",
"xhdpi" : "unpackage/res/icons/96x96.png",
"xxhdpi" : "unpackage/res/icons/144x144.png",
"xxxhdpi" : "unpackage/res/icons/192x192.png"
"hdpi" : "C:/Users/JXJ-202110SC8/Desktop/new-logo.png",
"xhdpi" : "C:/Users/JXJ-202110SC8/Desktop/new-logo.png",
"xxhdpi" : "C:/Users/JXJ-202110SC8/Desktop/new-logo.png",
"xxxhdpi" : "C:/Users/JXJ-202110SC8/Desktop/new-logo.png"
},
"ios" : {
"appstore" : "unpackage/res/icons/1024x1024.png",
"appstore" : "",
"ipad" : {
"app" : "unpackage/res/icons/76x76.png",
"app@2x" : "unpackage/res/icons/152x152.png",
"notification" : "unpackage/res/icons/20x20.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"proapp@2x" : "unpackage/res/icons/167x167.png",
"settings" : "unpackage/res/icons/29x29.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"spotlight" : "unpackage/res/icons/40x40.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png"
"app" : "",
"app@2x" : "",
"notification" : "",
"notification@2x" : "",
"proapp@2x" : "",
"settings" : "",
"settings@2x" : "",
"spotlight" : "",
"spotlight@2x" : ""
},
"iphone" : {
"app@2x" : "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"notification@3x" : "unpackage/res/icons/60x60.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png"
"app@2x" : "",
"app@3x" : "",
"notification@2x" : "",
"notification@3x" : "",
"settings@2x" : "",
"settings@3x" : "",
"spotlight@2x" : "",
"spotlight@3x" : ""
}
}
},
"splashscreen" : {
"android" : {
"hdpi" : "F:/splash.png",
"xhdpi" : "F:/splash.png",
"xxhdpi" : "F:/splash.png"
"hdpi" : "C:/Users/JXJ-202110SC8/Desktop/图片/3.png",
"xhdpi" : "C:/Users/JXJ-202110SC8/Desktop/图片/3.png",
"xxhdpi" : "C:/Users/JXJ-202110SC8/Desktop/图片/3.png"
},
"iosStyle" : "common",
"ios" : {

1943
pages.json

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,157 @@
<template>
<view>
<button @click="open">打开弹窗</button>
<uni-popup ref="popup" type="bottom">
<view class="uni-list">
<scroll-view scroll-y="true">
<checkbox-group @change="checkboxChange" class="checkbox-group">
<label class="uni-list-cell" v-for="item in items" :key="item.value">
<view class="item">
<checkbox :value="item.value" :checked="item.checked" />
</view>
<view>{{item.name}}</view>
</label>
</checkbox-group>
</scroll-view>
</view>
</uni-popup>
</view>
</template>
<script>
export default {
data () {
return {
items: [{
value: 'USA',
name: '美国'
},
{
value: 'CHN',
name: '中国',
checked: 'true'
},
{
value: 'BRA',
name: '巴西'
},
{
value: 'JPN',
name: '日本'
},
{
value: 'ENG',
name: '英国'
},
{
value: 'FRA',
name: '法国'
},
{
value: 'JPN',
name: '日本'
},
{
value: 'ENG',
name: '英国'
},
{
value: 'FRA',
name: '法国'
},
{
value: 'JPN',
name: '日本'
},
{
value: 'ENG',
name: '英国'
},
{
value: 'FRA',
name: '法国'
},
{
value: 'JPN',
name: '日本'
},
{
value: 'ENG',
name: '英国'
},
{
value: 'FRA',
name: '法国'
}
],
}
},
methods: {
checkboxChange(e){
console.log(e);
var items = this.items,
values = e.detail.value;
for (var i = 0, lenI = items.length; i < lenI; ++i) {
const item = items[i]
if(values.includes(item.value)){
this.$set(item,'checked',true)
}else{
this.$set(item,'checked',false)
}
}
},
open(){
// refuni-popup , type ['top','left','bottom','right','center']
this.$refs.popup.open('top')
this.sendRequest({
url: 'xmgl/systemUser/getProjectChilderSystemUserList',
method: "post",
data: { },
success: res => {
console.log(res, '操');
if (res.code == 200) {
console.log('res', res)
if (this.pageNo == 1) {
this.listData = []
}
// console.log('--------')
// this.listData = res.result.records
this.listData = [...this.listData, ...res.result.records]
uni.hideLoading() //
}
}
})
},
}
}
</script>
<style lang="scss" scoped>
.uni-popup{
position: absolute;
top: 0;
width: 100%;
height: 667px;
}
.uni-list{
position: absolute;
bottom: -667px;
padding-top: 20px;
width: 100%;
height: 300px;
background-color: #fff;
.checkbox-group{
height: 300px;
// overflow: auto;
}
}
.uni-list-cell {
margin-bottom: 10px;
padding-left: 20px;
display: flex;
align-items: center;
}
</style>

300
pages/alarmPage/index.vue Normal file
View File

@ -0,0 +1,300 @@
<template>
<view>
<view class="barBox">
<headers :themeType="'white'" :showBack="true">
<view class="title">
<view class="backBtn">
<view>
<!-- <span class="back" @click="goBack()">返回</span> -->
<span class="tip">告警提示</span>
</view>
</view>
</view>
</headers>
</view>
<view v-if="typeState.length>0" class="flex evenly typeState">
<view :class="status==item.val?'this_class':''" v-for="(item,index) in typeState" :key="index" @click="typeStateEve(item.val)">
{{item.txt}}
</view>
</view>
<view class="">
<view class="alarm-item" v-for="(item,index) in listData" :key="item.id" @click="goHiidden(item)">
<view>报警类型: {{alarmType[item.alarmType]}}报警</view>
<view>报警设备: {{item.hardwareName}}</view>
<view>报警时间: {{item.createTime}}</view>
<view>报警地址: {{item.location}}</view>
<!-- <image @click="saveImage(url_config+'image/'+item.imageUrl,index)" class="accessoryImg"
:src="url_config+'image/'+item.imageUrl"></image> -->
<!-- <image class="accessoryImg"
:src="url_config+'image/'+item.imageUrl"></image> -->
</view>
</view>
<view class="noData" v-if="listData.length==0">
暂无数据~
</view>
<!-- <Select/> -->
</view>
</template>
<script>
import Select from "./components/Select.vue";
export default {
components:{ Select },
data() {
return {
listData: [],
projectSn: '',
pageNo: 1,
pageSize: 7,
systemInfo: {
statusBarHeight: 0
},
alarmType: {
1: "烟感",
2: "明火",
3: "人员倒地",
4: "未戴安全帽",
5: "区域入侵",
6: "越界入侵",
7: "人员聚集衣",
8: "反光衣",
9: "裸土覆盖",
13: "口罩识别",
14: "徘徊预警",
15: "物体滞留监测",
16: "绊线监测"
},
userInfo:{},
typeState:[{txt:'待发起',val:1},{txt:'已整改',val:3}],//status 1: ,2: 3
status:1
}
},
onLoad() {
},
onShow() {
if(JSON.parse(uni.getStorageSync('projectDetail'))){
this.projectSn = JSON.parse(uni.getStorageSync('projectDetail')).projectSn;
}else{
this.projectSn = JSON.parse(uni.getStorageSync('userInfo')).projectSn;
}
this.userInfo=JSON.parse(uni.getStorageSync('userInfo'));
if(this.userInfo.accountType==6){//
this.typeState=[];
this.status=2;
}else{
this.typeState=[{txt:'待发起',val:1},{txt:'已整改',val:3}]
}
this.listData=[];
this.pageNo=1;
this.getListData();
},
mounted() {
this.systemInfo = uni.getStorageSync('systemInfo')
},
onPullDownRefresh() {
this.getListData()
setTimeout(function() {
uni.stopPullDownRefresh()
}, 1000)
},
onReachBottom() {
// console.log("============================")
this.pageNo++;
uni.showLoading({
title: '加载中'
})
this.getListData()
},
methods: {
typeStateEve(v){
this.status=v;
this.pageNo = 1;
this.listData =[];
this.getListData();
},
//
getListData() {
console.log(this.userInfo,"=======================================================")
this.sendRequest({
url: 'xmgl/aiAnalyseHardWareAlarmRecord/selectPageList',
method: "post",
data: {
projectSn: this.projectSn,
pageNo: this.pageNo,
pageSize: this.pageSize,
accountType:this.userInfo.accountType,
status:this.status
},
success: res => {
if (res.code == 200) {
console.log('res', res)
if (this.pageNo == 1) {
this.listData = []
}
// console.log('--------')
// this.listData = res.result.records
this.listData = [...this.listData, ...res.result.records]
uni.hideLoading() //
}
}
})
},
// goBack() {
// uni.reLaunch({
// url: "/pages/projectEnd/projectIndex/projectIndex"
// });
// },
//
goHiidden(item) {
// uni.navigateTo({
// url: "/pages/projectEnd/safeManage/addExamine"
// });
// uni.navigateTo({
// url: "/pages/potentialRisk/potentialRisk?dangerInfo="+ encodeURIComponent(JSON.stringify(item))
// });
uni.navigateTo({
url: "/pages/potentialRisk/potentialRisk?id="+item.id
});
},
saveImage(url) {
uni.showLoading({
title: "保存中..."
})
uni.downloadFile({
url: url, //
success: (res) => {
if (res.statusCode === 200) {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath, //
success: res => { //
uni.hideLoading()
uni.showToast({
title: "保存成功!"
})
uni.navigateTo({
url: "/pages/projectEnd/safeManage/addExamine"
});
}
})
}
}
});
},
}
}
</script>
<style lang="scss" scoped>
.noData{
text-align: center;
padding: 120rpx 0;
color: #999;
}
.this_class{
color: #007AFF;
}
.typeState{
height: 80rpx;
background-color: #fff;
font-size: 28rpx;
width: 100%;
}
.barBox {
background-color: #5181F6;
}
.title {
height: 44px;
line-height: 44px;
font-size: 20px;
width: 750rpx;
background-color: #5181F6;
color: #fff;
text-align: center;
position: relative;
}
.accessoryImg {
margin-top: 5px;
width: 100%;
}
.backBtn {
font-size: 16px;
position: absolute;
left: 10px;
}
.back {
font-size: 12px;
}
.tip {
margin-left: 125px;
}
.contain2 {
width: 750rpx;
content: " ";
// background-color: #f8f8f8;
// height: calc(100vh - 44px);
// overflow: auto;
}
.alarm-item {
width: 650rpx;
margin: 20rpx auto;
background-color: #fff;
padding: 20px;
box-sizing: border-box;
border-radius: 5px;
box-shadow: 0 0 5px #ccc;
}
.alarm-lable {
display: flex;
}
.alarm-lable-1 {
width: 200rpx;
}
.alarm-lable-2 {
flex: 1;
text-align: right;
color: #888;
}
.flex {
display: flex;
align-items: center;
}
.center {
justify-content: center;
}
.between {
justify-content: space-between;
}
.warp {
flex-wrap: wrap;
}
.evenly {
justify-content: space-evenly;
}
</style>

View File

@ -0,0 +1,231 @@
<template>
<view>
<view class="barBox">
<headers :themeType="'white'" >
<view class="title">
<view class="backBtn">
<view >
<span class="back" @click="goBack()">返回</span>
<span class="tip">告警提示</span>
</view>
</view>
</view>
</headers>
</view>
<view class="">
<view class="alarm-item" v-for="(item,index) in listData" :key="index" @click="goHiidden()">
<view>报警类型: {{item.alarmType}}</view>
<view>报警设备: {{item.hardwareName}}</view>
<view>报警时间: {{item.createTime}}</view>
<view>报警地址: {{item.location}}</view>
<view>报警抓拍:</view>
<image @click="saveImage(url_config+'image/'+item.imageUrl,index)" class="accessoryImg"
:src="url_config+'image/'+item.imageUrl"></image>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
listData: [],
projectSn: '',
pageNo: 1,
pageSize: 7,
systemInfo: {
statusBarHeight: 0
},
showType: [{
id: 1,
value: '安全帽报警',
},
{
id: 2,
vlaue: '明火报警'
},
{
id: 3,
value: '聚众报警'
},
{
id: 4,
value: '未戴安全帽报警'
},
{
id: 5,
value: '越界报警'
},
{
id: 6,
value: '闯入报警'
},
{
id: 7,
value: '反光衣报警'
},
{
id: 8,
value: '未穿反光衣'
},
]
}
},
mounted() {
this.systemInfo = uni.getStorageSync('systemInfo')
this.projectSn = JSON.parse(uni.getStorageSync('projectDetail')).projectSn;
this.getListData()
},
onPullDownRefresh() {
this.getListData()
setTimeout(function() {
uni.stopPullDownRefresh()
}, 1000)
},
onReachBottom() {
// console.log("============================")
this.pageNo++;
uni.showLoading({
title: '加载中'
})
this.getListData()
},
methods: {
//
getListData() {
this.sendRequest({
url: 'xmgl/aiAnalyseHardWareAlarmRecord/selectPageList',
method: "post",
data: {
projectSn: this.projectSn,
pageNo: this.pageNo,
pageSize: this.pageSize,
},
success: res => {
if (res.code == 200) {
console.log('res', res)
res.result.records.forEach((item) => {
const result = this.showType.find((item2) => {
return item2.id == item.alarmType
})
item.alarmType = result.value
})
if (this.pageNo == 1) {
this.listData = []
}
// console.log('--------')
// this.listData = res.result.records
this.listData = [...this.listData, ...res.result.records]
uni.hideLoading() //
}
}
})
},
goBack() {
uni.reLaunch({
url: "/pages/projectEnd/projectIndex/projectIndex"
});
},
//
goHiidden(url) {
uni.navigateTo({
url: "/pages/projectEnd/safeManage/addExamine"
});
},
saveImage(url) {
uni.showLoading({
title: "保存中..."
})
uni.downloadFile({
url: url, //
success: (res) => {
if (res.statusCode === 200) {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath, //
success: res => { //
uni.hideLoading()
uni.showToast({
title: "保存成功!"
})
uni.navigateTo({
url: "/pages/projectEnd/safeManage/addExamine"
});
}
})
}
}
});
}
}
}
</script>
<style lang="scss" scoped>
.barBox {
background-color: #5181F6;
}
.title {
height: 44px;
line-height: 44px;
font-size: 20px;
width: 750rpx;
background-color: #5181F6;
color: #fff;
text-align: center;
position: relative;
}
.accessoryImg {
margin-top: 5px;
width: 100%;
}
.backBtn {
font-size: 16px;
position: absolute;
left: 10px;
}
.back {
font-size: 12px;
}
.tip{
margin-left: 125px;
}
.contain2 {
width: 750rpx;
content: " ";
// background-color: #f8f8f8;
// height: calc(100vh - 44px);
// overflow: auto;
}
.alarm-item {
width: 650rpx;
margin: 20rpx auto;
background-color: #fff;
padding: 20px;
box-sizing: border-box;
border-radius: 5px;
box-shadow: 0 0 5px #ccc;
}
.alarm-lable {
display: flex;
}
.alarm-lable-1 {
width: 200rpx;
}
.alarm-lable-2 {
flex: 1;
text-align: right;
color: #888;
}
</style>

View File

@ -0,0 +1,512 @@
<template>
<view style="background: #f6f6f6;">
<headers :showBack="true">
<view class="headerName">
升降机整改
</view>
</headers>
<view class="form_box">
<view class="flex between form_item" style="height: 60rpx;font-size: 24rpx;">
<view class="letBox flex">
<view class="xian">
</view>
<view class="" style="margin-left: 20rpx;">
上报安全隐患
</view>
</view>
</view>
<view class="flex between form_item">
<view class="letBox">
检查类型
</view>
<view class="rigBox">
安全检查
</view>
</view>
<view class="form_item2">
<view class="letBox">
报警类型
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
人数报警<text :style="{color:dangerInfo.peopleCntAlarm==0?'#44AB47':'#FF3F33'}">{{dangerInfo.peopleCntAlarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
载重报警<text :style="{color:dangerInfo.weightAlarm==0?'#44AB47':'#FF3F33'}">{{dangerInfo.weightAlarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
速度报警<text :style="{color:dangerInfo.speedAlarm==0?'#44AB47':'#FF3F33'}">{{dangerInfo.speedAlarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
高度报警<text :style="{color:dangerInfo.heightAlarm==0?'#44AB47':'#FF3F33'}">{{dangerInfo.heightAlarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
倾角X报警<text :style="{color:dangerInfo.obliguityXAlarm==0?'#44AB47':'#FF3F33'}">{{dangerInfo.obliguityXAlarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
倾角Y报警<text :style="{color:dangerInfo.obliguityYAlarm==0?'#44AB47':'#FF3F33'}">{{dangerInfo.obliguityYAlarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
风速报警<text :style="{color:dangerInfo.windSpeedAlarm==0?'#44AB47':'#FF3F33'}">{{dangerInfo.windSpeedAlarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
1号电机报警<text :style="{color:dangerInfo.motor1Alarm==0?'#44AB47':'#FF3F33'}">{{dangerInfo.motor1Alarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
2号电机报警<text :style="{color:dangerInfo.motor2Alarm==0?'#44AB47':'#FF3F33'}">{{dangerInfo.motor2Alarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
3号电机报警<text :style="{color:dangerInfo.motor3Alarm==0?'#44AB47':'#FF3F33'}">{{dangerInfo.motor3Alarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
防冲顶报警<text :style="{color:dangerInfo.topAlarm==0?'#44AB47':'#FF3F33'}">{{dangerInfo.topAlarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
防坠器报警<text :style="{color:dangerInfo.fallAlarm==0?'#44AB47':'#FF3F33'}">{{dangerInfo.fallAlarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
下限位报警<text :style="{color:dangerInfo.bottomAlarm==0?'#44AB47':'#FF3F33'}">{{dangerInfo.bottomAlarm==0?'正常':'报警'}}</text>
</view>
</view>
<view class="flex between form_item">
<view class="letBox">
报警设备
</view>
<view class="rigBox">
{{dangerInfo.devName}}
</view>
</view>
<!-- <view class="flex between form_item">
<view class="letBox">
报警地址
</view>
<view class="rigBox">
{{dangerInfo.location}}
</view>
</view> -->
<view class="flex between form_item">
<view class="letBox">
整改负责人
</view>
<view class="rigBox">
<text v-for="(item,index) in changeUser" :key="index">
{{item.realName}}
</text>
</view>
</view>
<view class="flex between form_item">
<view class="letBox">
整改部门
</view>
<view class="rigBox">
安全部
</view>
</view>
<view class="flex between form_item">
<view class="letBox">
要求完成时间
</view>
<view class="rigBox">
{{dangerInfo.addTime}}
</view>
</view>
<!-- <view class="" style="margin: 40rpx 0;">
报警抓拍
</view>
<view class="">
<image class="imgbox" @click="seeImg" :src="url_config+'image/'+dangerInfo.imageUrl" mode=""></image>
</view>
-->
<view class="" v-if="userInfo.accountType==6&&dangerInfo.status!=3">
<view class="form-lable" style="margin-top: 30rpx;">
上传整改图片
</view>
<view class="form-item flex f-column a-start">
<view class="uni-form-input imgBox_wrap">
<view class="addImgBox" @click="uploadImg" v-show="imgFileList.length<3">
<image src="/static/safeMange/upload_image.png" class="icon-add" color="#F56C6C">
</image>
</view>
<view class="imgBox" v-show="imgFileList.length>0" v-for="(item,index) in imgFileList"
:key="index">
<image :src="url_config+'image/'+item.url" class="img"
@click="previewImage(url_config+'image/'+item.url)"></image>
<view v-if="!isDisabled" @click="deleteImg(item,1)" class="deleteImg">
<image src="/static/safeMange/close_icon.png" color="#F56C6C"></image>
</view>
</view>
</view>
</view>
<view class="form-lable" style="margin-top: 30rpx;">
整改说明
</view>
<textarea class="explain" v-model="explain" placeholder="选填" />
</view>
<view class="" style="margin-top: 20rpx;" v-if="dangerInfo.status==3">
<view class="" style="margin: 40rpx 0;">
整改图片
</view>
<view class="uni-form-input imgBox_wrap">
<view class="imgBox" v-for="(item,index) in dangerInfo.correctImage" :key="index">
<image :src="url_config+'image/'+item.url" class="imgBox"
@click="previewImage(url_config+'image/'+item.url)"></image>
</view>
</view>
<view class="form-lable" style="margin-top: 30rpx;">
整改说明
</view>
<textarea class="explain" :disabled="true" v-model="dangerInfo.correctRemark" />
</view>
</view>
<view class="" style="height:200rpx;" v-if="userInfo.accountType==6">
</view>
<view v-if="dangerInfo.status!=3" class="svanbtn" @click="saveBtn">
{{userInfo.accountType==5?'提交':'提交整改'}}
</view>
</view>
</template>
<script>
import headers from "@/components/headers/headers.vue"
import {
dateformat
} from "@/utils/tool.js"
export default {
data() {
return {
dangerInfo: {},
userId: "",
userInfo: {},
isDisabled: false,
imgFileList: [],
explain: "",
detailsId: '',
changeUser: {},
}
},
onLoad(op) {
// this.dangerInfo = JSON.parse(decodeURIComponent(op.dangerInfo));
this.detailsId = op.id;
console.log(this.dangerInfo, "url_config")
this.queryTypeList();
this.queryUserData();
this.userInfo = JSON.parse(uni.getStorageSync('userInfo'));
this.userId = this.userInfo.userId;
this.getDeatils();
console.log(this.userInfo);
},
methods: {
//
getDeatils() {
let _this = this;
this.sendRequest({
url: 'xmgl/lifterAlarm/getDetails',
method: 'post',
data: {
id: _this.detailsId
},
success: res => {
_this.dangerInfo = res.result;
_this.dangerInfo.addTime = dateformat(_this.dangerInfo.addTime, 'yyyy-MM-dd');
if (_this.dangerInfo.correctImage) {
_this.dangerInfo.correctImage = JSON.parse(_this.dangerInfo.correctImage)
} else {
_this.dangerInfo.correctImage = []
}
}
})
},
//
deleteImg(val, type) {
let that = this;
uni.showModal({
title: '提示',
content: '确定删除该附件吗?',
success: function(res) {
if (res.confirm) {
let fileArr = JSON.parse(JSON.stringify(that.imgFileList));
fileArr.forEach((item, index) => {
if (item.url == val.url) {
fileArr.splice(index, 1)
}
})
that.imgFileList = fileArr;
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
//
previewImage(url) {
uni.previewImage({
urls: [url]
})
},
//
uploadImg() {
var that = this
uni.chooseImage({
count: 3 - that.imgFileList.length,
success(res) {
const tempFilePaths = res.tempFilePaths;
console.log(tempFilePaths, "tempFilePaths")
for (let i in tempFilePaths) {
uni.uploadFile({
url: that.url_config + 'upload/image', //
filePath: tempFilePaths[i],
name: 'files',
success: (uploadFileRes) => {
let data = {
name: JSON.parse(uploadFileRes.data).data[0].filename,
url: JSON.parse(uploadFileRes.data).data[0].imageUrl
};
console.log(uploadFileRes)
that.imgFileList.push(data)
},
fail(e) {
console.log(e)
}
});
}
}
})
},
seeImg() {
uni.previewImage({
urls: `${this.url_config}+'image/'+${this.dangerInfo.imageUrl}`
})
},
//
queryTypeList() {
let sn = JSON.parse(uni.getStorageSync('userInfo')).headquartersSn
let _this = this
this.sendRequest({
url: 'xmgl/inspectType/list',
method: 'post',
data: {
sn: sn
},
success: res => {
let typeList = res.result
_this.inspectTypeId = typeList.find(item => item.inspectTypeName == "安全检查").id;
console.log(_this.inspectTypeId, '-----检查类型')
}
})
},
queryUserData() {
let _this = this
this.sendRequest({
url: 'xmgl/systemUser/getProjectChilderSystemUserList',
method: 'post',
data: {
projectSn: JSON.parse(uni.getStorageSync('userInfo')).sn
},
success: res => {
_this.changeUser = res.result
console.log(res.result, '-----检查人')
}
})
},
saveBtn() {
let data = {
...this.dangerInfo
};
if (this.userInfo.accountType == 5) {
data.reType = 1;
} else if (this.userInfo.accountType == 6) { //
data.correctImage = JSON.stringify(this.imgFileList);
data.correctRemark = this.explain;
data.reType = 2;
}
this.sendRequest({
url: 'xmgl/lifterAlarm/rectification',
method: 'post',
data: data,
success: (res) => {
if (res.code == 200) {
uni.showToast({
title: '提交成功'
})
let routes = getCurrentPages();
if(routes.length>1){
uni.navigateBack({})
}else{
uni.redirectTo({
url:'/pages/projectEnd/projectIndex/projectIndex'
})
}
}
console.log(res.result)
}
})
}
}
}
</script>
<style lang="less" scoped>
.explain {
padding: 12rpx;
font-size: 28rpx;
background-color: #F7F7F7;
margin-top: 20rpx;
border-radius: 20rpx;
height: 120rpx;
}
.imgBox_wrap {
display: flex;
flex-wrap: wrap;
margin-top: 20rpx;
width: 75%;
min-height: 120rpx;
}
.imgBox {
width: 120rpx;
height: 120rpx;
display: inline-flex;
position: relative;
margin-right: 30rpx;
margin-bottom: 16rpx;
.img {
width: 120rpx;
height: 120rpx;
border-radius: 12rpx;
}
.deleteImg {
position: absolute;
right: -12rpx;
top: -18rpx;
uni-image {
width: 20rpx;
height: 20rpx;
}
}
}
.addImgBox {
border: 1px solid rgba(42, 43, 91, 0.1);
background-color: #f6f5f8;
width: 120rpx;
height: 120rpx;
display: inline-flex;
align-items: center;
justify-content: center;
border-radius: 20rpx;
font-size: 24rpx;
margin-right: 12rpx;
uni-image {
width: 120rpx;
height: 120rpx;
}
}
page {
background-color: #f6f6f6;
}
.imgbox {
width: 176rpx;
height: 176rpx;
border-radius: 20rpx;
}
.svanbtn {
width: 100%;
background-color: #007AFF;
color: #fff;
text-align: center;
font-size: 28rxp;
line-height: 80rpx;
height: 80rpx;
position: fixed;
bottom: 0;
left: 0;
}
.xian {
height: 30rpx;
width: 6rpx;
background-color: #007AFF;
}
.form_box {
padding: 20rpx;
background-color: #fff;
margin: 20rpx;
border-radius: 8rpx;
.form_item {
width: 100%;
font-size: 28rpx;
height: 80rpx;
border-bottom: 2rpx solid #F7F7F7;
}
.form_item2 {
padding: 20rpx 0;
width: 100%;
font-size: 28rpx;
border-bottom: 2rpx solid #F7F7F7;
}
}
.flex {
display: flex;
align-items: center;
}
.center {
justify-content: center;
}
.between {
justify-content: space-between;
}
.warp {
flex-wrap: wrap;
}
.evenly {
justify-content: space-evenly;
}
</style>

View File

@ -17,9 +17,9 @@
<button form-type="submit" type="primary" class="btn">登录</button>
</form>
</view>
<!-- <view class="bottomTitle" @click="showModal=true">
<view class="bottomTitle" @click="showModal=true">
云服务器设置
</view> -->
</view>
<view class="modalBox" v-show="showModal">
<view class="modalContent">
<view class="modalTitle">
@ -53,22 +53,48 @@
showModal: false,
systemInfo: {
statusBarHeight: 0
}
},
clientid:''
}
},
onLoad() {
let _this=this;
// #ifdef APP-PLUS
// add:CID 2022420 10:47:41 // add:CID 2022420 10:47:41
plus.push.getClientInfoAsync((info) => {
const clientid = info["clientid"];
console.log(clientid,"cidcidcidcidcid")
_this.clientid=clientid
});
// #endif
},
mounted() {
this.systemInfo = uni.getStorageSync('systemInfo')
uni.setStorageSync('language', 'zh_CN')
if (uni.getStorageSync('account')) {
this.account = uni.getStorageSync('account')
this.password = uni.getStorageSync('password')
}
if (uni.getStorageSync('ipPort')) {
this.ipPort = uni.getStorageSync('ipPort')
this.ipPort = uni.getStorageSync('ipPort');
// let val={
// detail:{
// value:{
// account:this.account,
// password:this.password
// }
// }
// }
// this.formSubmit(val);
} else {
// this.ipPort='183.95.84.54:9500'
// uni.setStorageSync('ipPort',this.ipPort)
}
this.systemInfo = uni.getStorageSync('systemInfo')
},
methods: {
saveServerData(e) {
@ -81,17 +107,41 @@
// console.log(e)
var json = {
account: e.detail.value.account,
password: e.detail.value.password
password: e.detail.value.password,
clientId:this.clientid
}
this.sendRequest({
url: "xmgl/base/login",
data: json,
method: "POST",
success(res) {
uni.setStorageSync('account', e.detail.value.account)
uni.setStorageSync('password', e.detail.value.password)
uni.setStorageSync('userInfo', JSON.stringify(res.result))
if (res.result.accountType == 5 || res.result.accountType == 6) {
success: (res) => {
// #ifdef APP-PLUS
// add:CID 2022420 10:47:41 // add:CID 2022420 10:47:41
plus.push.getClientInfoAsync((info) => {
const cid = info["clientid"];
// console.log(cid,"cidcidcidcidcid")
// const cid = "f4b3246189fc051c5875a35e198ca223";
const userId = res.result.userId;
const jsonParams = {
clientId: cid,
alias: userId
}
//
this.sendRequest({
url: "xmgl/push/bindAlias", //
data: jsonParams,
method: "POST",
})
});
// #endif
uni.setStorageSync('account', e.detail.value.account);
uni.setStorageSync('password', e.detail.value.password);
uni.setStorageSync('userInfo', JSON.stringify(res.result));
if (res.result.accountType == 5 || res.result
.accountType ==
6) {
if (res.result.styleType == 1) {
uni.redirectTo({
url: '/pages/projectEnd/projectIndex/projectIndex'
@ -109,7 +159,6 @@
url: '/pages/projectManage/projectManage'
})
}
}
})
}

View File

@ -12,7 +12,7 @@
</view>
</view>
<!-- v-if="COMPANY != 'nanchang'" -->
<view class="operateBar" @click="viewFileFn" >
<view class="operateBar" @click="viewFileFn">
<view class="left">
<image class="operateIcon" src="/static/file.png" mode="widthFix"></image>
工地资料
@ -126,7 +126,7 @@
.convertLocalFileSystemURL(res
.tempFilePath);
plus.runtime.openFile(res
.tempFilePath); //
.tempFilePath); //
}
}
});
@ -155,16 +155,31 @@
url: '../fileList/fileList'
})
},
toMessageCenter(){
toMessageCenter() {
uni.navigateTo({
url: '../messageCenter/messageCenter'
})
},
logout() {
uni.removeStorageSync('userInfo')
uni.redirectTo({
url: '/pages/login/login'
this.sendRequest({
url: "xmgl/base/logout",
data: {
id:this.userInfo.userId
},
method: "POST",
success(res) {
uni.removeStorageSync('userInfo');
uni.removeStorageSync('projectDetail');
uni.redirectTo({
url: '/pages/login/login'
})
}
})
}
}
}

View File

@ -0,0 +1,628 @@
<template>
<view style="background: #f6f6f6;">
<headers :showBack="true">
<view class="headerName">
预警上报
</view>
</headers>
<view class="form_box">
<view class="flex between form_item" style="height: 60rpx;font-size: 24rpx;">
<view class="letBox flex">
<view class="xian">
</view>
<view class="" style="margin-left: 20rpx;">
上报安全隐患
</view>
</view>
</view>
<view class="flex between form_item">
<view class="letBox">
检查类型
</view>
<view class="rigBox">
安全检查
</view>
</view>
<view class="flex between form_item">
<view class="letBox">
报警类型
</view>
<view class="rigBox">
{{alarmType[dangerInfo.alarmType]}}报警
</view>
</view>
<view class="flex between form_item">
<view class="letBox">
报警设备
</view>
<view class="rigBox">
{{dangerInfo.hardwareName}}
</view>
</view>
<view class="flex between form_item">
<view class="letBox">
报警地址
</view>
<view class="rigBox">
{{dangerInfo.location}}
</view>
</view>
<view class="flex between form_item">
<view class="letBox">
整改负责人
</view>
<view class="rigBox" @click="$refs.popup.open()">
{{getUsernames()}}
<image src="../../static/icon-down-black.png" style="width: 30rpx;height: 30rpx;margin-left: 6rpx;" mode=""></image>
</view>
</view>
<view class="flex between form_item">
<view class="letBox">
整改部门
</view>
<view class="rigBox">
安全部
</view>
</view>
<view class="flex between form_item">
<view class="letBox">
要求完成时间
</view>
<picker v-if="userInfo.accountType==5&&dangerInfo.status!=3" mode="date" :start="dangerInfo.createTime" @change="selectDate">
<view>
{{dangerInfo.createTime}}
<image src="../../static/icon-down-black.png" style="width: 30rpx;height: 30rpx;margin-left: 6rpx;" mode=""></image>
</view>
</picker>
<view v-else class="rigBox">
{{dangerInfo.createTime}}
</view>
</view>
<view class="" style="margin: 40rpx 0;">
报警抓拍
</view>
<view class="">
<image class="imgbox" @click="previewImage(url_config+'image/'+dangerInfo.imageUrl)"
:src="url_config+'image/'+dangerInfo.imageUrl" mode=""></image>
</view>
<view class="" v-if="userInfo.accountType==6&&dangerInfo.status!=3">
<view class="form-lable" style="margin-top: 30rpx;">
上传整改图片
</view>
<view class="form-item flex f-column a-start">
<view class="uni-form-input imgBox_wrap">
<view class="addImgBox" @click="uploadImg" v-show="imgFileList.length<3">
<image src="/static/safeMange/upload_image.png" class="icon-add" color="#F56C6C">
</image>
</view>
<view class="imgBox" v-show="imgFileList.length>0" v-for="(item,index) in imgFileList"
:key="index">
<image :src="url_config+'image/'+item.url" class="img"
@click="previewImage(url_config+'image/'+item.url)"></image>
<view v-if="!isDisabled" @click="deleteImg(item,1)" class="deleteImg">
<image src="/static/safeMange/close_icon.png" color="#F56C6C"></image>
</view>
</view>
</view>
</view>
<view class="form-lable" style="margin-top: 30rpx;">
整改说明
</view>
<textarea class="explain" v-model="explain" placeholder="选填" />
</view>
<view class="" style="margin-top: 20rpx;" v-if="dangerInfo.status==3">
<view class="" style="margin: 40rpx 0;">
整改图片
</view>
<view class="uni-form-input imgBox_wrap">
<view class="imgBox" v-for="(item,index) in dangerInfo.correctImage" :key="index">
<image :src="url_config+'image/'+item.url" class="imgBox"
@click="previewImage(url_config+'image/'+item.url)"></image>
</view>
</view>
<view class="form-lable" style="margin-top: 30rpx;">
整改说明
</view>
<textarea class="explain" :disabled="true" v-model="dangerInfo.correctRemark" />
</view>
</view>
<view class="" style="height:200rpx;" v-if="userInfo.accountType==6">
</view>
<view v-if="dangerInfo.status!=3" class="svanbtn" @click="saveBtn">
{{userInfo.accountType==5?'提交':'提交整改'}}
</view>
<uni-popup ref="popup" type="bottom">
<view class="uni-list">
<view class="flex between control">
<view class="">
<text style="font-size: 28rpx;margin-right: 12rpx;">全选</text>
<checkbox :checked="selectAll" @click="selectAllEve" />
</view>
<view class="colse" @click="colse">
关闭
</view>
</view>
<scroll-view scroll-y="true" style="margin-top: 30rpx;height: 320rpx;">
<checkbox-group @change="checkUser" class="checkbox-group">
<label class="uni-list-cell" v-for="user in changeUsers" :key="user.value">
<view class="item">
<checkbox :value="user.userId" :checked="userIds.includes(user.userId)" />
</view>
<view>{{user.realName}}</view>
</label>
</checkbox-group>
</scroll-view>
</view>
</uni-popup>
</view>
</template>
<script>
import headers from "@/components/headers/headers.vue"
import {
dateformat
} from "@/utils/tool.js"
export default {
data() {
return {
dangerInfo: {},
selectAll:false,
alarmType: {
1: "烟感",
2: "明火",
3: "人员倒地",
4: "未戴安全帽",
5: "区域入侵",
6: "越界入侵",
7: "人员聚集衣",
8: "反光衣",
9: "裸土覆盖",
13: "口罩识别",
14: "徘徊预警",
15: "物体滞留监测",
16: "绊线监测"
},
userId: "",
userInfo: {},
isDisabled: false,
imgFileList: [],
explain: "",
detailsId: '',
changeUsers: [],
userIds: [],
backupsUserIds:[]
}
},
watch:{
userIds(n,o){
console.log(n,"=====")
if(n.length==this.backupsUserIds.length){
this.selectAll=true
}else{
this.selectAll=false;
}
}
},
onLoad(op) {
// this.dangerInfo = JSON.parse(decodeURIComponent(op.dangerInfo));
this.detailsId = op.id;
console.log(this.dangerInfo, "url_config")
this.queryTypeList();
this.queryUserData();
this.userInfo = JSON.parse(uni.getStorageSync('userInfo'));
this.userId = this.userInfo.userId;
this.getDeatils();
console.log(this.userInfo);
},
methods: {
selectAllEve(){
this.selectAll=!this.selectAll;
if(this.selectAll){
this.userIds=this.changeUsers.map((item)=>{
return item.userId
})
console.log(this.userIds,"==this.userIds")
}else{
this.userIds=[]
}
},
selectDate(e){
console.log(e,'date=====')
this.dangerInfo.createTime=e.detail.value;
},
colse(){
this.$refs.popup.close()
},
//
checkUser(e) {
const values = e.detail.value;
this.userIds = values
console.log(e, this.userIds);
},
getUsernames() {
const names = this.changeUsers
.filter(user => this.userIds.includes(user.userId))
.map(user => user.realName)
// return names.toString()
console.log(names.toString(), '操cao ');
return names.toString() || '请选择'
},
//
getDeatils() {
let _this = this;
this.sendRequest({
url: 'xmgl/aiAnalyseHardWareAlarmRecord/getDetails',
method: 'post',
data: {
id: _this.detailsId
},
success: res => {
_this.dangerInfo = res.result;
_this.dangerInfo.createTime = dateformat(_this.dangerInfo.createTime, 'yyyy-MM-dd');
if (_this.dangerInfo.correctImage) {
_this.dangerInfo.correctImage = JSON.parse(_this.dangerInfo.correctImage)
} else {
_this.dangerInfo.correctImage = []
}
}
})
},
//
deleteImg(val, type) {
let that = this;
uni.showModal({
title: '提示',
content: '确定删除该附件吗?',
success: function(res) {
if (res.confirm) {
let fileArr = JSON.parse(JSON.stringify(that.imgFileList));
fileArr.forEach((item, index) => {
if (item.url == val.url) {
fileArr.splice(index, 1)
}
})
that.imgFileList = fileArr;
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
//
previewImage(url) {
uni.previewImage({
urls: [url]
})
},
//
uploadImg() {
var that = this
uni.chooseImage({
count: 3 - that.imgFileList.length,
success(res) {
const tempFilePaths = res.tempFilePaths;
console.log(tempFilePaths, "tempFilePaths")
for (let i in tempFilePaths) {
uni.uploadFile({
url: that.url_config + 'upload/image', //
filePath: tempFilePaths[i],
name: 'files',
success: (uploadFileRes) => {
let data = {
name: JSON.parse(uploadFileRes.data).data[0].filename,
url: JSON.parse(uploadFileRes.data).data[0].imageUrl
};
console.log(uploadFileRes)
that.imgFileList.push(data)
},
fail(e) {
console.log(e)
}
});
}
}
})
},
seeImg() {
uni.previewImage({
urls: `${this.url_config}+'image/'+${this.dangerInfo.imageUrl}`
})
},
//
queryTypeList() {
let sn = JSON.parse(uni.getStorageSync('userInfo')).headquartersSn
let _this = this
this.sendRequest({
url: 'xmgl/inspectType/list',
method: 'post',
data: {
sn: sn
},
success: res => {
let typeList = res.result
let tres= typeList.find(item => item.inspectTypeName == "安全检查");
if(tres){
_this.inspectTypeId=tres.id
}
console.log(_this.inspectTypeId, '-----检查类型')
}
})
},
queryUserData() {
let _this = this
this.sendRequest({
url: 'xmgl/systemUser/getProjectChilderSystemUserList',
method: 'post',
data: {
projectSn: JSON.parse(uni.getStorageSync('userInfo')).sn
},
success: res => {
_this.changeUsers = res.result
_this.userIds = res.result[0].userId;
_this.backupsUserIds=_this.changeUsers.map((item)=>{
return item.userId
})
console.log(res.result, '-----检查人')
}
})
},
saveBtn() {
let imageUrl = `${this.url_config}+'image/'+${this.dangerInfo.imageUrl}`
// let data = {
// projectSn: this.dangerInfo.projectSn, //
// reviewId: this.userId, //ID--
// createUser: this.userId, //
// dangerDesc: this.alarmType[this.dangerInfo.alarmType], //
// status: 2, // 12345
// dutyRegion: this.dangerInfo.location, //
// engineeringId: "", //id
// inspectTypeId: this.inspectTypeId, //
// imageUrl: imageUrl,
// recordType: 1,
// changeLimitTime: dateformat(this.dangerInfo.createTime, 'yyyy-MM-dd'), //
// checkItem: "", //
// checkSubitem: "",
// // changeUser: "1541226669983522817",
// changeUser: this.changeUser.userId,
// faultLevel: 1,
// hiddenDangerLevel: "",
// checkContent: this.alarmType[this.dangerInfo.alarmType],
// enterpriseSn: '',
// rectifyRequire: ""
// };
// this.dangerInfo.correctImage=JSON.stringify(this.dangerInfo.correctImage);
let data = {
...this.dangerInfo
};
if (this.userInfo.accountType == 5) {
data.reType = 1;
data.rectification_person_id = this.userIds
} else if (this.userInfo.accountType == 6) { //
data.correctImage = JSON.stringify(this.imgFileList);
data.correctRemark = this.explain;
data.reType = 2;
}
this.sendRequest({
url: 'xmgl/aiAnalyseHardWareAlarmRecord/rectification',
method: 'post',
data: data,
success: (res) => {
if (res.code == 200) {
uni.showToast({
title: '提交成功'
}), uni.navigateBack({})
}
console.log(res.result)
}
})
}
}
}
</script>
<style lang="less" scoped>
.flex{
display: flex;
}
.flex_end{
justify-content: flex-end;
}
.between{
justify-content: space-between;
}
.control{
padding:0 30rpx;
}
.colse{
font-size: 28rpx;
}
.explain {
padding: 12rpx;
font-size: 28rpx;
background-color: #F7F7F7;
margin-top: 20rpx;
border-radius: 20rpx;
height: 120rpx;
}
.imgBox_wrap {
display: flex;
flex-wrap: wrap;
margin-top: 20rpx;
width: 75%;
min-height: 120rpx;
}
.imgBox {
width: 120rpx;
height: 120rpx;
display: inline-flex;
position: relative;
margin-right: 30rpx;
margin-bottom: 16rpx;
.img {
width: 120rpx;
height: 120rpx;
border-radius: 12rpx;
}
.deleteImg {
position: absolute;
right: -12rpx;
top: -18rpx;
uni-image {
width: 20rpx;
height: 20rpx;
}
}
}
.addImgBox {
border: 1px solid rgba(42, 43, 91, 0.1);
background-color: #f6f5f8;
width: 120rpx;
height: 120rpx;
display: inline-flex;
align-items: center;
justify-content: center;
border-radius: 20rpx;
font-size: 24rpx;
margin-right: 12rpx;
uni-image {
width: 120rpx;
height: 120rpx;
}
}
page {
background-color: #f6f6f6;
}
.imgbox {
width: 176rpx;
height: 176rpx;
border-radius: 20rpx;
}
.svanbtn {
width: 100%;
background-color: #007AFF;
color: #fff;
text-align: center;
font-size: 28rxp;
line-height: 80rpx;
height: 80rpx;
position: fixed;
bottom: 0;
left: 0;
}
.xian {
height: 30rpx;
width: 6rpx;
background-color: #007AFF;
}
.form_box {
padding: 20rpx;
background-color: #fff;
margin: 20rpx;
border-radius: 8rpx;
.form_item {
width: 100%;
font-size: 28rpx;
height: 80rpx;
border-bottom: 2rpx solid #F7F7F7;
}
}
.flex {
display: flex;
align-items: center;
}
.center {
justify-content: center;
}
.between {
justify-content: space-between;
}
.warp {
flex-wrap: wrap;
}
.evenly {
justify-content: space-evenly;
}
.uni-popup {
position: absolute;
top: 0;
width: 100%;
height: 667px;
}
.uni-list {
// position: absolute;
// bottom: -667px;
padding-top: 20px;
width: 100%;
height: 420px;
background-color: #fff;
.checkbox-group {
// height: 260px;
}
}
.uni-list-cell {
margin-bottom: 10px;
padding-left: 20px;
display: flex;
align-items: center;
}
</style>

View File

@ -25,8 +25,8 @@
<view class="type">
<view>附件</view>
<view class="accessory">
<image v-if="fileList.length>0" v-for="(item,index) in fileList" :key="index" :src="url_config+'image/'+item.url"
class="accessoryImg"></image>
<image class="accessoryImg" v-if="fileList.length>0" v-for="(item,index) in fileList" :key="index" :src="url_config+'image/'+item.url"
@click="bigImg(url_config+'image/'+item.url,index)"></image>
</view>
</view>
<view class="type flex2">
@ -161,9 +161,18 @@
uni.navigateTo({
url: './reply?id=' + this.id + '&type=' + type + '&stateId=' + stateId
})
},
//
bigImg(img,index){
console.log('val',img)
let arr =[]
arr.push(img)
uni.previewImage({
current:index,
urls:arr
})
}
}
}
}
</script>

View File

@ -211,8 +211,64 @@
</view>
</picker>
</view>
<view class="blockBox" v-for="(item,index) in alarmList" :key="index">
<view class="blockBox" v-for="(item,index) in alarmList" :key="index" @click="toDetails(item.id)">
<view class="" style="position: absolute;right: 40rpx;top:40rpx;color: #ff0000;font-size:28rpx;">
{{status[item.status]}}
</view>
<view class="alarmItem">
<text class="label">设备名称</text><text class="value">{{item.devName}}</text>
</view>
<view class="alarmItem">
<text class="label">设备编号</text><text class="value">{{item.devSn}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
人数报警<text :style="{color:item.peopleCntAlarm==0?'#44AB47':'#FF3F33'}">{{item.peopleCntAlarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
载重报警<text :style="{color:item.weightAlarm==0?'#44AB47':'#FF3F33'}">{{item.weightAlarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
速度报警<text :style="{color:item.speedAlarm==0?'#44AB47':'#FF3F33'}">{{item.speedAlarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
高度报警<text :style="{color:item.heightAlarm==0?'#44AB47':'#FF3F33'}">{{item.heightAlarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
倾角X报警<text :style="{color:item.obliguityXAlarm==0?'#44AB47':'#FF3F33'}">{{item.obliguityXAlarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
倾角Y报警<text :style="{color:item.obliguityYAlarm==0?'#44AB47':'#FF3F33'}">{{item.obliguityYAlarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
风速报警<text :style="{color:item.windSpeedAlarm==0?'#44AB47':'#FF3F33'}">{{item.windSpeedAlarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
1号电机报警<text :style="{color:item.motor1Alarm==0?'#44AB47':'#FF3F33'}">{{item.motor1Alarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
2号电机报警<text :style="{color:item.motor2Alarm==0?'#44AB47':'#FF3F33'}">{{item.motor2Alarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
3号电机报警<text :style="{color:item.motor3Alarm==0?'#44AB47':'#FF3F33'}">{{item.motor3Alarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
防冲顶报警<text :style="{color:item.topAlarm==0?'#44AB47':'#FF3F33'}">{{item.topAlarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
防坠器报警<text :style="{color:item.fallAlarm==0?'#44AB47':'#FF3F33'}">{{item.fallAlarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
下限位报警<text :style="{color:item.bottomAlarm==0?'#44AB47':'#FF3F33'}">{{item.bottomAlarm==0?'正常':'报警'}}</text>
</view>
<view class="alarmItem">
<text class="label">报警时间</text><text class="value">{{item.startTime}}</text>
</view>
<!-- <view class="alarmItem">
<text class="label">准载</text><text class="value">{{item.maxLoad}}</text>
</view>
<view class="alarmItem">
@ -232,7 +288,7 @@
</view>
<view class="alarmItem">
<text class="label">状态</text><text class="value">{{ item.status == 0?'正常': item.status == 1?'预警':item.status == 2?'报警':item.status == 3?'违章':'其他' }}</text>
</view>
</view> -->
</view>
<view class="placeholderBox" v-if="alarmList.length==0">
<image src="/static/noData.png" mode="" class="noDataImg"></image>
@ -256,6 +312,12 @@
},
data() {
return {
status: {
1: "待发起",
2: "待整改",
3: "已整改"
},
userInfo:{},
projectDetail: '',
environmentDevList: [],
devIndex: 0,
@ -310,11 +372,26 @@
};
},
mounted() {
this.userInfo=JSON.parse(uni.getStorageSync('userInfo'));
this.projectDetail = JSON.parse(uni.getStorageSync('projectDetail'))
this.searchDate = GetDateStr(0, '-')
this.getEnvironmentDev()
},
methods: {
filterAlarm(val) {
if (val == '0') {
return "正常"
} else if (val == 1) {
return "报警"
} else if (val == 2) {
return "预警"
}
},
toDetails(id){
uni.navigateTo({
url:'/pages/elevatorEscalation/elevatorEscalation?id='+id
})
},
previewImg(url){
uni.previewImage({
urls:[url]
@ -403,6 +480,7 @@
method: "POST",
success(res) {
var DATA = res.result
console.log('实时数据',res)
var xdata = [],
ydata1 = [],
ydata2 = [],
@ -447,7 +525,8 @@
pageSize: 100,
startTime: this.searchDate,
endTime: this.searchDate,
devSn: this.currentDevDetail.devSn
devSn: this.currentDevDetail.devSn,
accountType:this.userInfo.accountType
},
method: "POST",
success(res) {
@ -553,6 +632,7 @@
}
.blockBox {
position: relative;
box-shadow: 0 4px 24px 0px rgba(212, 220, 236, 0.69);
border-radius: 8px;
margin: 15px;

View File

@ -38,7 +38,7 @@
<view class="dateBox">
<view class="item">
<view class="">
{{projectDetail.contractPeriodStartTime?projectDetail.contractPeriodStartTime:'—.—.—'}}
{{projectDetail.contractPeriodStartTime !=null ? projectDetail.contractPeriodStartTime :'—.—.—'}}
</view>
<view class="">
项目开工日期
@ -46,7 +46,7 @@
</view>
<view class="item item2">
<view class="">
{{projectDetail.contractPeriodEndTime?projectDetail.contractPeriodEndTime:'—.—.—'}}
{{projectDetail.contractPeriodEndTime !=null ? projectDetail.contractPeriodEndTime :'—.—.—'}}
</view>
<view class="">
要求完成日期
@ -107,8 +107,8 @@
import headers from "../../../components/headers/headers.vue"
import footers from '../../../components/footers/footers.vue'
import {
closeBle
} from '@/static/js/BLEConn.js';
closeBle
} from '@/static/js/BLEConn.js';
export default {
components: {
headers,
@ -118,8 +118,8 @@
return {
projectDetail: {
projectName: '',
contractPeriodEndTime: '-.-.-',
contractPeriodStartTime: '-.-.-',
contractPeriodEndTime: '',
contractPeriodStartTime: '',//-.-.-
contractPeriodType: 1, //1 2
periodRatio: 0,
},
@ -151,10 +151,10 @@
// uni.hideLoading()
console.log('断开蓝牙失败')
})
if(uni.getStorageSync('oldObj')){
if (uni.getStorageSync('oldObj')) {
uni.removeStorageSync('oldObj');
}
if(uni.getStorageSync('buildObj')){
if (uni.getStorageSync('buildObj')) {
uni.removeStorageSync('buildObj');
}
},
@ -162,6 +162,7 @@
var userInfo = JSON.parse(uni.getStorageSync('userInfo'))
this.accountType = userInfo.accountType
var arr = userInfo.menuAuthority.moduleList
console.log('上面的',arr)
this.systemInfo = uni.getStorageSync('systemInfo')
this.getSystemLogoConfig()
this.getAllModule(arr)
@ -169,23 +170,24 @@
this.searchsn = userInfo.sn
this.getProjectDetail()
} else {
let data = JSON.parse(uni.getStorageSync('projectDetail'))
this.searchsn = data.projectSn;
this.getProjectDetail()
this.projectDetail = JSON.parse(uni.getStorageSync('projectDetail'))
this.loadWeather()
}
this.viewVersionInfo()
},
methods: {
viewVersionInfo() {
//fix
return false;
var that = this
// console.log('viewVersionInfo',that.url_config)
// uni.navigateTo({
// url:'versionInfo'
// })
if (this.systemInfo.platform.indexOf('android') != -1 && typeof plus !== "undefined") {
//
that.sendRequest({
@ -224,7 +226,7 @@
.convertLocalFileSystemURL(res
.tempFilePath);
plus.runtime.openFile(res
.tempFilePath); //
.tempFilePath); //
}
}
});
@ -262,11 +264,11 @@
return "w_sun";
}
},
getSystemLogoConfig(){
getSystemLogoConfig() {
var that = this
this.sendRequest({
url: "xmgl/systemLogoConfig/selectSystemLogoConfig",
data:{},
data: {},
method: "GET",
success(res) {
console.log(res.result.iconType)
@ -301,7 +303,14 @@
});
},
goMoudleFn(item) {
console.log('item.plugin', item.plugin)
//
// if(item.moduleName==""){
// uni.navigateTo({
// url: '/pages/alarmPage/index'
// })
// return false;
// }
// console.log('item.plugin', item.plugin)
switch (item.plugin) {
case 'markRoom':
uni.navigateTo({
@ -401,7 +410,7 @@
url: '../dangerBigProject/index'
})
break;
case 'fileManage':
case 'fileManage':
uni.navigateTo({
url: '../../fileManage/fileManage'
})
@ -411,6 +420,11 @@
url: '../betonManage/index'
})
break;
case 'dangerBroadcast':
uni.navigateTo({
url:'../../alarmPage/index'
})
break;
default:
uni.showToast({
icon: 'none',
@ -441,6 +455,7 @@
data: {},
method: "POST",
success(res) {
console.log('打印0',res)
var all = res.result
all.forEach((element, index) => {
all[index].operation = false
@ -451,7 +466,29 @@
}
});
});
that.list = all
that.list = all;
//
// console.log("", all)
// that.list.push({
// operation:true,
// appName: "",
// appShow: 1,
// bigModuleIcon: "log_active2",
// disableModuleIcon: null,
// labelName: "",
// labelSortNum: "7",
// menuList: null,
// moduleDesc: "",
// moduleEquipment: 0,
// moduleIcon: "log_active",
// moduleIcon2: "log",
// moduleId: "41",
// moduleName: "",
// modulePath: "",
// moduleType: 2,
// plugin: "constructionLog",
// styleType: 1
// });
}
})
}

File diff suppressed because it is too large Load Diff

View File

@ -88,6 +88,7 @@
name: JSON.parse(uploadFileRes.data).data[0].filename,
url: JSON.parse(uploadFileRes.data).data[0].imageUrl
};
console.log('data',data)
that.fileList.push(data)
}
});

View File

@ -22,8 +22,10 @@
<view class="warningText">{{warningText}}</view>
<view class="towerRunBox">
<image src="../../../static/towerCrane/towerBG.png" alt="" ref="towerBG" class="towerBG" />
<image src="../../../static/towerCrane/1.png" alt="" v-show="hideGoods" class="xMove" id="xMove" :style="{ top: '50px', left: coordData.coordX + 'px',height:'12px',width:'26px' }" />
<image src="../../../static/towerCrane/line.png" alt="" class="lines" id="line" v-show="hideGoods" :style="{
<image src="../../../static/towerCrane/1.png" alt="" v-show="hideGoods" class="xMove" id="xMove"
:style="{ top: '50px', left: coordData.coordX + 'px',height:'12px',width:'26px' }" />
<image src="../../../static/towerCrane/line.png" alt="" class="lines" id="line" v-show="hideGoods"
:style="{
'top': '58px',
'width':'10px',
'height': lineHeight,
@ -34,7 +36,7 @@
</view>
</view>
</view>
<view class="blockBox">
<view class="realTimeBox">
<view class="item">
@ -185,10 +187,12 @@
<view class="item">{{item.workerName}}</view>
<view class="item">{{item.phoneNumber}}</view>
<view class="item">
<image :src="url_config+'image/'+item.fieldAcquisitionUrl" class="profile_photo" @click="previewImg(url_config+'image/'+item.fieldAcquisitionUrl)"></image>
<image :src="url_config+'image/'+item.fieldAcquisitionUrl" class="profile_photo"
@click="previewImg(url_config+'image/'+item.fieldAcquisitionUrl)"></image>
</view>
</view>
<view v-if="driverList.length==0" style="text-align: center; margin-top: 8px; color: #999;">暂无数据</view>
<view v-if="driverList.length==0" style="text-align: center; margin-top: 8px; color: #999;">暂无数据
</view>
</view>
</view>
</view>
@ -196,17 +200,17 @@
<view class="" v-if="tabIndex==1">
<view class="blockBox">
<view class="chartTitle">
吊重 (t)
吊重 (kg)
</view>
<u-charts canvas-id="lineChartLoad" chartType="line" :opts="lineChartData1" ref="lineChartLoad" :cWidth="315"
:cHeight="200" :legends="false" />
<u-charts canvas-id="lineChartLoad" chartType="line" :opts="lineChartData1" ref="lineChartLoad"
:cWidth="315" :cHeight="200" :legends="false" />
</view>
<view class="blockBox">
<view class="chartTitle">
幅度 (m)
</view>
<u-charts canvas-id="lineChartRange" chartType="line" :opts="lineChartData2" ref="lineChartRange" :cWidth="315"
:cHeight="200" :legends="false" />
<u-charts canvas-id="lineChartRange" chartType="line" :opts="lineChartData2" ref="lineChartRange"
:cWidth="315" :cHeight="200" :legends="false" />
</view>
</view>
<view class="" v-if="tabIndex==2">
@ -218,7 +222,10 @@
</view>
</picker>
</view>
<view class="blockBox" v-for="(item,index) in alarmList" :key="index">
<view class="blockBox" v-for="(item,index) in alarmList" :key="index" @click="toDetail(item.id)">
<view class="" style="position: absolute;right: 40rpx;top:40rpx;color: #ff0000;font-size:28rpx;">
{{status[item.status]}}
</view>
<view class="alarmItem">
<text class="label">设备名称</text><text class="value">{{item.devName}}</text>
</view>
@ -297,10 +304,16 @@
},
data() {
return {
status: {
1: "待发起",
2: "待整改",
3: "已整改"
},
userInfo: "",
devSn: "",
devId: "",
hockTop: 0,
hockLeft:0,
hockLeft: 0,
lineHeight: 0,
lineLeft: 0,
moveLeft: 0,
@ -346,8 +359,8 @@
lineLength: 0,
},
hideGoods: true,
warningText:'',
warningText: '',
};
},
onLoad(options) {
@ -357,9 +370,11 @@
realHeight = options.towerHeight;
this.getRealTimeData();
this.getDevDetail();
this.userInfo = JSON.parse(uni.getStorageSync('userInfo'));
},
mounted() {
this.projectDetail = JSON.parse(uni.getStorageSync('projectDetail'))
this.searchDate = GetDateStr(0, '-');
this.$nextTick(() => {
@ -367,16 +382,21 @@
// $xMove = document.getElementById('xMove')
// $line = document.getElementById('line')
})
// frontArmLength = document.getElementsByClassName('towerBG')[0].offsetWidth;
// height = document.getElementsByClassName('towerBG')[0].offsetHeight;
// frontArmLength = document.getElementsByClassName('towerBG')[0].offsetWidth;
// height = document.getElementsByClassName('towerBG')[0].offsetHeight;
},
methods: {
filterAlarm(val){
if(val == '0'){
toDetail(id) {
uni.navigateTo({
url: '/pages/towerCrane/towerCrane?id=' + id
})
},
filterAlarm(val) {
if (val == '0') {
return "正常"
} else if(val == 1){
} else if (val == 1) {
return "报警"
} else if(val == 2){
} else if (val == 2) {
return "预警"
}
},
@ -403,12 +423,13 @@
},
//
getPlayUrl() {
console.log(this.videoIndex)
var that = this
var videoInfo = that.videoList[this.videoIndex]
var json = {
itemId: that.videoList[this.videoIndex].itemId
itemId: that.videoList[this.videoIndex].itemId || that.videoList[this.videoIndex].id
}
if (videoInfo.videoType == 3) {
json.streamType = 1
json.type = 'rtsp' //rtsphls
@ -507,7 +528,8 @@
pageSize: 100,
startTime: this.searchDate,
endTime: this.searchDate,
devSn: this.devSn
devSn: this.devSn,
accountType: this.userInfo.accountType
},
method: "POST",
success(res) {
@ -527,17 +549,17 @@
method: "POST",
success(res) {
// that.videoList = res.result.videoList
if(res.result.enableVideoUrl==1){
if (res.result.enableVideoUrl == 1) {
that.videoList = res.result.videoList;
that.isHasVideo()
}else{
if(res.result.videoUrl&&res.result.videoUrl!='null'){
that.videoList = JSON.parse(res.result.videoUrl);
that.videoUrl = that.videoList.url
}else{
that.videoList = []
} else {
if (res.result.videoUrl && res.result.videoUrl != 'null') {
that.videoList = JSON.parse(res.result.videoUrl);
that.videoUrl = that.videoList.url
} else {
that.videoList = []
}
}
}
that.driverList = res.result.driverList
that.detailData = res.result
}
@ -559,13 +581,13 @@
console.log(res.result)
var y = 0
var x = 0
if(res.result.ranger){
if (res.result.ranger) {
x = parseFloat(res.result.ranger)
}
if(res.result.height){
if (res.result.height) {
y = parseFloat(res.result.height)
}
that.move(x, y);
// that.move(100, 200);
that.hideGoods = true;
@ -588,78 +610,78 @@
}
})
},
//
move(x, y) {
console.log((x/realWidth)* frontArmLength - imgLeftWidth)
console.log(x)
console.log(y)
console.log(realWidth)
console.log(frontArmLength)
console.log(imgLeftWidth)
var xImg, yImg;
// if (x <= realWidth) {
// xImg = ((x / realWidth) * frontArmLength + imgLeftWidth);
// this.warningText=''
// if (y <= realHeight) {
// yImg = (y / realHeight) * height + imgLeftHeight;
// this.warningText=''
// } else {
// yImg = height + imgLeftHeight
// this.warningText=''
// }
// } else {
// xImg = frontArmLength + imgLeftWidth;
// this.warningText=''
// if (y <= realHeight) {
// yImg = (y / realHeight) * height + imgLeftHeight;
// } else {
// yImg = height + imgLeftHeight
// this.warningText=','
// }
// }
if (x <= realWidth) {
// console.log(frontArmLength, realWidth)
xImg = ((x/realWidth)*frontArmLength) + 38
// xImg = (x / realWidth) * (frontArmLength - imgLeftWidth) + imgLeftWidth;
this.warningText = "";
} else {
// xImg = frontArmLength-imgLeftWidth;
xImg = 38
this.warningText = "当前设备前臂长参数错误";
}
// if(x==""){
// }
if (y <= realHeight) {
yImg = ((y/realHeight)*height) + 48
// yImg = ((realHeight-y) / realHeight) * (height-imgLeftHeight) + imgLeftHeight;
// this.warningText = "";
} else {
// yImg = height-imgLeftHeight;
yImg = 48
this.warningText = "当前设备高度参数错误";
}
// console.log(xImg)
// console.log(yImg)
// xImg = xImg*$ratioW;
// yImg = yImg*$ratioW;
console.log(xImg)
console.log(yImg)
this.hockLeft = xImg - 6 + 'px';
this.hockTop = (yImg - 74) + 'px';
this.coordData.coordX = xImg ;
this.lineLeft = xImg + 8 + 'px';
this.lineHeight = (yImg - 48 - 74) + 'px';
// this.lineHeight = yImg + 'px';
console.log(this.lineHeight)
// if($line.height==undefined){
// $line.style.height = 0 +'px'
// }
// console.log(this.hockLeft,this.hockTop,this.coordData.coordX,this.lineHeight)
},
move(x, y) {
console.log((x / realWidth) * frontArmLength - imgLeftWidth)
console.log(x)
console.log(y)
console.log(realWidth)
console.log(frontArmLength)
console.log(imgLeftWidth)
var xImg, yImg;
// if (x <= realWidth) {
// xImg = ((x / realWidth) * frontArmLength + imgLeftWidth);
// this.warningText=''
// if (y <= realHeight) {
// yImg = (y / realHeight) * height + imgLeftHeight;
// this.warningText=''
// } else {
// yImg = height + imgLeftHeight
// this.warningText=''
// }
// } else {
// xImg = frontArmLength + imgLeftWidth;
// this.warningText=''
// if (y <= realHeight) {
// yImg = (y / realHeight) * height + imgLeftHeight;
// } else {
// yImg = height + imgLeftHeight
// this.warningText=','
// }
// }
if (x <= realWidth) {
// console.log(frontArmLength, realWidth)
xImg = ((x / realWidth) * frontArmLength) + 38
// xImg = (x / realWidth) * (frontArmLength - imgLeftWidth) + imgLeftWidth;
this.warningText = "";
} else {
// xImg = frontArmLength-imgLeftWidth;
xImg = 38
this.warningText = "当前设备前臂长参数错误";
}
// if(x==""){
// }
if (y <= realHeight) {
yImg = ((y / realHeight) * height) + 48
// yImg = ((realHeight-y) / realHeight) * (height-imgLeftHeight) + imgLeftHeight;
// this.warningText = "";
} else {
// yImg = height-imgLeftHeight;
yImg = 48
this.warningText = "当前设备高度参数错误";
}
// console.log(xImg)
// console.log(yImg)
// xImg = xImg*$ratioW;
// yImg = yImg*$ratioW;
console.log(xImg)
console.log(yImg)
this.hockLeft = xImg - 6 + 'px';
this.hockTop = (yImg - 74) + 'px';
this.coordData.coordX = xImg;
this.lineLeft = xImg + 8 + 'px';
this.lineHeight = (yImg - 48 - 74) + 'px';
// this.lineHeight = yImg + 'px';
console.log(this.lineHeight)
// if($line.height==undefined){
// $line.style.height = 0 +'px'
// }
// console.log(this.hockLeft,this.hockTop,this.coordData.coordX,this.lineHeight)
},
}
}
</script>
@ -687,6 +709,7 @@
}
.blockBox {
position: relative;
box-shadow: 0 4px 24px 0px rgba(212, 220, 236, 0.69);
border-radius: 8px;
margin: 15px;
@ -862,10 +885,12 @@
display: inline-block;
// margin: 15px auto;
}
.towerBG{
.towerBG {
width: 345px;
height: 337px;
}
.moveBox,
.xMove,
.lines {
@ -884,7 +909,8 @@
.lines {
width: 10px;
}
.warningText{
.warningText {
width: 100%;
font-size: 14px;
color: red;

View File

@ -0,0 +1,523 @@
<template>
<view style="background: #f6f6f6;">
<headers :showBack="true">
<view class="headerName">
塔吊整改
</view>
</headers>
<view class="form_box">
<view class="flex between form_item" style="height: 60rpx;font-size: 24rpx;">
<view class="letBox flex">
<view class="xian">
</view>
<view class="" style="margin-left: 20rpx;">
上报安全隐患
</view>
</view>
</view>
<view class="flex between form_item">
<view class="letBox">
检查类型
</view>
<view class="rigBox">
安全检查
</view>
</view>
<view class="form_item2">
<view class="letBox">
报警类型
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
人数报警<text :style="{color:dangerInfo.peopleCntAlarm==0?'#44AB47':'#FF3F33'}">{{dangerInfo.peopleCntAlarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
载重报警<text :style="{color:dangerInfo.weightAlarm==0?'#44AB47':'#FF3F33'}">{{dangerInfo.weightAlarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
速度报警<text :style="{color:dangerInfo.speedAlarm==0?'#44AB47':'#FF3F33'}">{{dangerInfo.speedAlarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
高度报警<text :style="{color:dangerInfo.heightAlarm==0?'#44AB47':'#FF3F33'}">{{dangerInfo.heightAlarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
倾角X报警<text :style="{color:dangerInfo.obliguityXAlarm==0?'#44AB47':'#FF3F33'}">{{dangerInfo.obliguityXAlarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
倾角Y报警<text :style="{color:dangerInfo.obliguityYAlarm==0?'#44AB47':'#FF3F33'}">{{dangerInfo.obliguityYAlarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
风速报警<text :style="{color:dangerInfo.windSpeedAlarm==0?'#44AB47':'#FF3F33'}">{{dangerInfo.windSpeedAlarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
1号电机报警<text :style="{color:dangerInfo.motor1Alarm==0?'#44AB47':'#FF3F33'}">{{dangerInfo.motor1Alarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
2号电机报警<text :style="{color:dangerInfo.motor2Alarm==0?'#44AB47':'#FF3F33'}">{{dangerInfo.motor2Alarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
3号电机报警<text :style="{color:dangerInfo.motor3Alarm==0?'#44AB47':'#FF3F33'}">{{dangerInfo.motor3Alarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
防冲顶报警<text :style="{color:dangerInfo.topAlarm==0?'#44AB47':'#FF3F33'}">{{dangerInfo.topAlarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
防坠器报警<text :style="{color:dangerInfo.fallAlarm==0?'#44AB47':'#FF3F33'}">{{dangerInfo.fallAlarm==0?'正常':'报警'}}</text>
</view>
<view style="margin:12rpx 0;font-size: 24rpx;" class="rigBox">
下限位报警<text :style="{color:dangerInfo.bottomAlarm==0?'#44AB47':'#FF3F33'}">{{dangerInfo.bottomAlarm==0?'正常':'报警'}}</text>
</view>
</view>
<view class="flex between form_item">
<view class="letBox">
报警设备
</view>
<view class="rigBox">
{{dangerInfo.devName}}
</view>
</view>
<!-- <view class="flex between form_item">
<view class="letBox">
报警地址
</view>
<view class="rigBox">
{{dangerInfo.location}}
</view>
</view> -->
<view class="flex between form_item">
<view class="letBox">
整改负责人
</view>
<view class="rigBox">
<!-- 梅钱真 -->
<text v-for="(item,index) in changeUser" :key="index">
{{item.realName}}
</text>
</view>
</view>
<view class="flex between form_item">
<view class="letBox">
整改部门
</view>
<view class="rigBox">
安全部
</view>
</view>
<view class="flex between form_item">
<view class="letBox">
要求完成时间
</view>
<view class="rigBox">
{{dangerInfo.addTime}}
</view>
</view>
<!-- <view class="" style="margin: 40rpx 0;">
报警抓拍
</view>
<view class="">
<image class="imgbox" @click="seeImg" :src="url_config+'image/'+dangerInfo.imageUrl" mode=""></image>
</view> -->
<view class="" v-if="userInfo.accountType==6&&dangerInfo.status!=3">
<view class="form-lable" style="margin-top: 30rpx;">
上传整改图片
</view>
<view class="form-item flex f-column a-start">
<view class="uni-form-input imgBox_wrap">
<view class="addImgBox" @click="uploadImg" v-show="imgFileList.length<3">
<image src="/static/safeMange/upload_image.png" class="icon-add" color="#F56C6C">
</image>
</view>
<view class="imgBox" v-show="imgFileList.length>0" v-for="(item,index) in imgFileList"
:key="index">
<image :src="url_config+'image/'+item.url" class="img"
@click="previewImage(url_config+'image/'+item.url)"></image>
<view v-if="!isDisabled" @click="deleteImg(item,1)" class="deleteImg">
<image src="/static/safeMange/close_icon.png" color="#F56C6C"></image>
</view>
</view>
</view>
</view>
<view class="form-lable" style="margin-top: 30rpx;">
整改说明
</view>
<textarea class="explain" v-model="explain" placeholder="选填" />
</view>
<view class="" style="margin-top: 20rpx;" v-if="dangerInfo.status==3">
<view class="" style="margin: 40rpx 0;">
整改图片
</view>
<view class="uni-form-input imgBox_wrap">
<view class="imgBox" v-for="(item,index) in dangerInfo.correctImage"
:key="index">
<image :src="url_config+'image/'+item.url" class="imgBox"
@click="previewImage(url_config+'image/'+item.url)"></image>
</view>
</view>
<view class="form-lable" style="margin-top: 30rpx;">
整改说明
</view>
<textarea class="explain" :disabled="true" v-model="dangerInfo.correctRemark" />
</view>
</view>
<view class="" style="height:200rpx;">
</view>
<view v-if="dangerInfo.status!=3" class="svanbtn" @click="saveBtn">
{{userInfo.accountType==5?'提交':'提交整改'}}
</view>
</view>
</template>
<script>
import headers from "@/components/headers/headers.vue"
import {
dateformat
} from "@/utils/tool.js"
export default {
data() {
return {
dangerInfo: {},
alarmType: {
1: "烟感",
2: "明火",
3: "人员倒地",
4: "未戴安全帽",
5: "区域入侵",
6: "越界入侵",
7: "人员聚集衣",
8: "反光衣",
9: "裸土覆盖",
13: "口罩识别",
14: "徘徊预警",
15: "物体滞留监测",
16: "绊线监测"
},
userId: "",
userInfo: {},
isDisabled: false,
imgFileList: [],
explain: "",
detailsId: '',
changeUser: [],
}
},
onLoad(op) {
// this.dangerInfo = JSON.parse(decodeURIComponent(op.dangerInfo));
this.detailsId = op.id;
console.log(this.dangerInfo, "url_config")
this.queryTypeList();
this.queryUserData();
this.userInfo = JSON.parse(uni.getStorageSync('userInfo'));
this.userId = this.userInfo.userId;
this.getDeatils();
console.log(this.userInfo);
},
methods: {
//
getDeatils() {
let _this = this;
this.sendRequest({
url: 'xmgl/towerAlarm/getDetails',
method: 'post',
data: {
id: _this.detailsId
},
success: res => {
_this.dangerInfo = res.result;
_this.dangerInfo.addTime = dateformat(_this.dangerInfo.addTime, 'yyyy-MM-dd');
if (_this.dangerInfo.correctImage) {
_this.dangerInfo.correctImage = JSON.parse(_this.dangerInfo.correctImage)
} else {
_this.dangerInfo.correctImage = []
}
}
})
},
//
deleteImg(val, type) {
let that = this;
uni.showModal({
title: '提示',
content: '确定删除该附件吗?',
success: function(res) {
if (res.confirm) {
let fileArr = JSON.parse(JSON.stringify(that.imgFileList));
fileArr.forEach((item, index) => {
if (item.url == val.url) {
fileArr.splice(index, 1)
}
})
that.imgFileList = fileArr;
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
//
previewImage(url) {
uni.previewImage({
urls: [url]
})
},
//
uploadImg() {
var that = this
uni.chooseImage({
count: 3 - that.imgFileList.length,
success(res) {
const tempFilePaths = res.tempFilePaths;
console.log(tempFilePaths,"tempFilePaths")
for(let i in tempFilePaths){
uni.uploadFile({
url: that.url_config + 'upload/image', //
filePath: tempFilePaths[i],
name: 'files',
success: (uploadFileRes) => {
let data = {
name: JSON.parse(uploadFileRes.data).data[0].filename,
url: JSON.parse(uploadFileRes.data).data[0].imageUrl
};
console.log(uploadFileRes)
that.imgFileList.push(data)
},fail(e) {
console.log(e)
}
});
}
}
})
},
seeImg() {
uni.previewImage({
urls: `${this.url_config}+'image/'+${this.dangerInfo.imageUrl}`
})
},
//
queryTypeList() {
let sn = JSON.parse(uni.getStorageSync('userInfo')).headquartersSn
let _this = this
this.sendRequest({
url: 'xmgl/inspectType/list',
method: 'post',
data: {
sn: sn
},
success: res => {
let typeList = res.result
_this.inspectTypeId = typeList.find(item => item.inspectTypeName == "安全检查").id;
console.log(_this.inspectTypeId, '-----检查类型')
}
})
},
queryUserData() {
let _this = this
this.sendRequest({
url: 'xmgl/systemUser/getProjectChilderSystemUserList',
method: 'post',
data: {
projectSn: JSON.parse(uni.getStorageSync('userInfo')).sn
},
success: res => {
_this.changeUser = res.result
console.log(res.result, '-----检查人')
}
})
},
saveBtn() {
let data={...this.dangerInfo};
if(this.userInfo.accountType == 5){
data.reType=1;
}else if (this.userInfo.accountType == 6) { //
data.correctImage = JSON.stringify(this.imgFileList);
data.correctRemark = this.explain;
data.reType=2;
}
this.sendRequest({
url: 'xmgl/towerAlarm/rectification',
method: 'post',
data: data,
success: (res) => {
if (res.code == 200) {
uni.showToast({
title: '提交成功'
})
let routes = getCurrentPages();
if(routes.length>1){
uni.navigateBack({})
}else{
uni.redirectTo({
url:'/pages/projectEnd/projectIndex/projectIndex'
})
}
}
console.log(res.result)
}
})
}
}
}
</script>
<style lang="less" scoped>
.explain {
padding: 12rpx;
font-size: 28rpx;
background-color: #F7F7F7;
margin-top: 20rpx;
border-radius: 20rpx;
height: 120rpx;
}
.imgBox_wrap {
display: flex;
flex-wrap: wrap;
margin-top: 20rpx;
width: 75%;
min-height: 120rpx;
}
.imgBox {
width: 120rpx;
height: 120rpx;
display: inline-flex;
position: relative;
margin-right: 30rpx;
margin-bottom: 16rpx;
.img {
width: 120rpx;
height: 120rpx;
border-radius: 12rpx;
}
.deleteImg {
position: absolute;
right: -12rpx;
top: -18rpx;
uni-image {
width: 20rpx;
height: 20rpx;
}
}
}
.addImgBox {
border: 1px solid rgba(42, 43, 91, 0.1);
background-color: #f6f5f8;
width: 120rpx;
height: 120rpx;
display: inline-flex;
align-items: center;
justify-content: center;
border-radius: 20rpx;
font-size: 24rpx;
margin-right: 12rpx;
uni-image {
width: 120rpx;
height: 120rpx;
}
}
page {
background-color: #f6f6f6;
}
.imgbox {
width: 176rpx;
height: 176rpx;
border-radius: 20rpx;
}
.svanbtn {
width: 100%;
background-color: #007AFF;
color: #fff;
text-align: center;
font-size: 28rxp;
line-height: 80rpx;
height: 80rpx;
position: fixed;
bottom: 0;
left: 0;
}
.xian {
height: 30rpx;
width: 6rpx;
background-color: #007AFF;
}
.form_box {
padding: 20rpx;
background-color: #fff;
margin: 20rpx;
border-radius: 8rpx;
.form_item {
width: 100%;
font-size: 28rpx;
height: 80rpx;
border-bottom: 2rpx solid #F7F7F7;
}
.form_item2 {
padding: 20rpx 0;
width: 100%;
font-size: 28rpx;
border-bottom: 2rpx solid #F7F7F7;
}
}
.flex {
display: flex;
align-items: center;
}
.center {
justify-content: center;
}
.between {
justify-content: space-between;
}
.warp {
flex-wrap: wrap;
}
.evenly {
justify-content: space-evenly;
}
</style>

View File

@ -65,6 +65,7 @@
data: {sn: sn,videoType:1},
method: "POST",
success(res){
console.log('找封面',res)
that.videoList = res.result.videoList
}
})

View File

@ -0,0 +1,60 @@
## 1.7.92022-04-02
- 修复 弹出层内部无法滚动的bug
## 1.7.82022-03-28
- 修复 小程序中高度错误的bug
## 1.7.72022-03-17
- 修复 快速调用open出现问题的Bug
## 1.7.62022-02-14
- 修复 safeArea 属性不能设置为false的bug
## 1.7.52022-01-19
- 修复 isMaskClick 失效的bug
## 1.7.42022-01-19
- 新增 cancelText \ confirmText 属性 ,可自定义文本
- 新增 maskBackgroundColor 属性 ,可以修改蒙版颜色
- 优化 maskClick属性 更新为 isMaskClick ,解决微信小程序警告的问题
## 1.7.32022-01-13
- 修复 设置 safeArea 属性不生效的bug
## 1.7.22021-11-26
- 优化 组件示例
## 1.7.12021-11-26
- 修复 vuedoc 文字错误
## 1.7.02021-11-19
- 优化 组件UI并提供设计资源详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-popup](https://uniapp.dcloud.io/component/uniui/uni-popup)
## 1.6.22021-08-24
- 新增 支持国际化
## 1.6.12021-07-30
- 优化 vue3下事件警告的问题
## 1.6.02021-07-13
- 组件兼容 vue3如何创建vue3项目详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
## 1.5.02021-06-23
- 新增 mask-click 遮罩层点击事件
## 1.4.52021-06-22
- 修复 nvue 平台中间弹出后点击内容再点击遮罩无法关闭的Bug
## 1.4.42021-06-18
- 修复 H5平台中间弹出后点击内容再点击遮罩无法关闭的Bug
## 1.4.32021-06-08
- 修复 错误的 watch 字段
- 修复 safeArea 属性不生效的问题
- 修复 点击内容再点击遮罩无法关闭的Bug
## 1.4.22021-05-12
- 新增 组件示例地址
## 1.4.12021-04-29
- 修复 组件内放置 input 、textarea 组件,无法聚焦的问题
## 1.4.0 2021-04-29
- 新增 type 属性的 left\right 值,支持左右弹出
- 新增 open(String:type) 方法参数 ,可以省略 type 属性 ,直接传入类型打开指定弹窗
- 新增 backgroundColor 属性,可定义主窗口背景色,默认不显示背景色
- 新增 safeArea 属性,是否适配底部安全区
- 修复 App\h5\微信小程序底部安全区占位不对的Bug
- 修复 App 端弹出等待的Bug
- 优化 提升低配设备性能,优化动画卡顿问题
- 优化 更简单的组件自定义方式
## 1.2.92021-02-05
- 优化 组件引用关系通过uni_modules引用组件
## 1.2.82021-02-05
- 调整为uni_modules目录规范
## 1.2.72021-02-05
- 调整为uni_modules目录规范
- 新增 支持 PC 端
- 新增 uni-popup-message 、uni-popup-dialog扩展组件支持 PC 端

View File

@ -0,0 +1,45 @@
// #ifdef H5
export default {
name: 'Keypress',
props: {
disable: {
type: Boolean,
default: false
}
},
mounted () {
const keyNames = {
esc: ['Esc', 'Escape'],
tab: 'Tab',
enter: 'Enter',
space: [' ', 'Spacebar'],
up: ['Up', 'ArrowUp'],
left: ['Left', 'ArrowLeft'],
right: ['Right', 'ArrowRight'],
down: ['Down', 'ArrowDown'],
delete: ['Backspace', 'Delete', 'Del']
}
const listener = ($event) => {
if (this.disable) {
return
}
const keyName = Object.keys(keyNames).find(key => {
const keyName = $event.key
const value = keyNames[key]
return value === keyName || (Array.isArray(value) && value.includes(keyName))
})
if (keyName) {
// 避免和其他按键事件冲突
setTimeout(() => {
this.$emit(keyName, {})
}, 0)
}
}
document.addEventListener('keyup', listener)
this.$once('hook:beforeDestroy', () => {
document.removeEventListener('keyup', listener)
})
},
render: () => {}
}
// #endif

View File

@ -0,0 +1,271 @@
<template>
<view class="uni-popup-dialog">
<view class="uni-dialog-title">
<text class="uni-dialog-title-text" :class="['uni-popup__'+dialogType]">{{titleText}}</text>
</view>
<view v-if="mode === 'base'" class="uni-dialog-content">
<slot>
<text class="uni-dialog-content-text">{{content}}</text>
</slot>
</view>
<view v-else class="uni-dialog-content">
<slot>
<input class="uni-dialog-input" v-model="val" type="text" :placeholder="placeholderText" :focus="focus" >
</slot>
</view>
<view class="uni-dialog-button-group">
<view class="uni-dialog-button" @click="closeDialog">
<text class="uni-dialog-button-text">{{closeText}}</text>
</view>
<view class="uni-dialog-button uni-border-left" @click="onOk">
<text class="uni-dialog-button-text uni-button-color">{{okText}}</text>
</view>
</view>
</view>
</template>
<script>
import popup from '../uni-popup/popup.js'
import {
initVueI18n
} from '@dcloudio/uni-i18n'
import messages from '../uni-popup/i18n/index.js'
const { t } = initVueI18n(messages)
/**
* PopUp 弹出层-对话框样式
* @description 弹出层-对话框样式
* @tutorial https://ext.dcloud.net.cn/plugin?id=329
* @property {String} value input 模式下的默认值
* @property {String} placeholder input 模式下输入提示
* @property {String} type = [success|warning|info|error] 主题样式
* @value success 成功
* @value warning 提示
* @value info 消息
* @value error 错误
* @property {String} mode = [base|input] 模式
* @value base 基础对话框
* @value input 可输入对话框
* @property {String} content 对话框内容
* @property {Boolean} beforeClose 是否拦截取消事件
* @event {Function} confirm 点击确认按钮触发
* @event {Function} close 点击取消按钮触发
*/
export default {
name: "uniPopupDialog",
mixins: [popup],
emits:['confirm','close'],
props: {
value: {
type: [String, Number],
default: ''
},
placeholder: {
type: [String, Number],
default: ''
},
type: {
type: String,
default: 'error'
},
mode: {
type: String,
default: 'base'
},
title: {
type: String,
default: ''
},
content: {
type: String,
default: ''
},
beforeClose: {
type: Boolean,
default: false
},
cancelText:{
type: String,
default: ''
},
confirmText:{
type: String,
default: ''
}
},
data() {
return {
dialogType: 'error',
focus: false,
val: ""
}
},
computed: {
okText() {
return this.confirmText || t("uni-popup.ok")
},
closeText() {
return this.cancelText || t("uni-popup.cancel")
},
placeholderText() {
return this.placeholder || t("uni-popup.placeholder")
},
titleText() {
return this.title || t("uni-popup.title")
}
},
watch: {
type(val) {
this.dialogType = val
},
mode(val) {
if (val === 'input') {
this.dialogType = 'info'
}
},
value(val) {
this.val = val
}
},
created() {
//
this.popup.disableMask()
// this.popup.closeMask()
if (this.mode === 'input') {
this.dialogType = 'info'
this.val = this.value
} else {
this.dialogType = this.type
}
},
mounted() {
this.focus = true
},
methods: {
/**
* 点击确认按钮
*/
onOk() {
if (this.mode === 'input'){
this.$emit('confirm', this.val)
}else{
this.$emit('confirm')
}
if(this.beforeClose) return
this.popup.close()
},
/**
* 点击取消按钮
*/
closeDialog() {
this.$emit('close')
if(this.beforeClose) return
this.popup.close()
},
close(){
this.popup.close()
}
}
}
</script>
<style lang="scss" >
.uni-popup-dialog {
width: 300px;
border-radius: 11px;
background-color: #fff;
}
.uni-dialog-title {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
justify-content: center;
padding-top: 25px;
}
.uni-dialog-title-text {
font-size: 16px;
font-weight: 500;
}
.uni-dialog-content {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
justify-content: center;
align-items: center;
padding: 20px;
}
.uni-dialog-content-text {
font-size: 14px;
color: #6C6C6C;
}
.uni-dialog-button-group {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
border-top-color: #f5f5f5;
border-top-style: solid;
border-top-width: 1px;
}
.uni-dialog-button {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex: 1;
flex-direction: row;
justify-content: center;
align-items: center;
height: 45px;
}
.uni-border-left {
border-left-color: #f0f0f0;
border-left-style: solid;
border-left-width: 1px;
}
.uni-dialog-button-text {
font-size: 16px;
color: #333;
}
.uni-button-color {
color: #007aff;
}
.uni-dialog-input {
flex: 1;
font-size: 14px;
border: 1px #eee solid;
height: 40px;
padding: 0 10px;
border-radius: 5px;
color: #555;
}
.uni-popup__success {
color: #4cd964;
}
.uni-popup__warn {
color: #f0ad4e;
}
.uni-popup__error {
color: #dd524d;
}
.uni-popup__info {
color: #909399;
}
</style>

View File

@ -0,0 +1,143 @@
<template>
<view class="uni-popup-message">
<view class="uni-popup-message__box fixforpc-width" :class="'uni-popup__'+type">
<slot>
<text class="uni-popup-message-text" :class="'uni-popup__'+type+'-text'">{{message}}</text>
</slot>
</view>
</view>
</template>
<script>
import popup from '../uni-popup/popup.js'
/**
* PopUp 弹出层-消息提示
* @description 弹出层-消息提示
* @tutorial https://ext.dcloud.net.cn/plugin?id=329
* @property {String} type = [success|warning|info|error] 主题样式
* @value success 成功
* @value warning 提示
* @value info 消息
* @value error 错误
* @property {String} message 消息提示文字
* @property {String} duration 显示时间设置为 0 则不会自动关闭
*/
export default {
name: 'uniPopupMessage',
mixins:[popup],
props: {
/**
* 主题 success/warning/info/error 默认 success
*/
type: {
type: String,
default: 'success'
},
/**
* 消息文字
*/
message: {
type: String,
default: ''
},
/**
* 显示时间设置为 0 则不会自动关闭
*/
duration: {
type: Number,
default: 3000
},
maskShow:{
type:Boolean,
default:false
}
},
data() {
return {}
},
created() {
this.popup.maskShow = this.maskShow
this.popup.messageChild = this
},
methods: {
timerClose(){
if(this.duration === 0) return
clearTimeout(this.timer)
this.timer = setTimeout(()=>{
this.popup.close()
},this.duration)
}
}
}
</script>
<style lang="scss" >
.uni-popup-message {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
justify-content: center;
}
.uni-popup-message__box {
background-color: #e1f3d8;
padding: 10px 15px;
border-color: #eee;
border-style: solid;
border-width: 1px;
flex: 1;
}
@media screen and (min-width: 500px) {
.fixforpc-width {
margin-top: 20px;
border-radius: 4px;
flex: none;
min-width: 380px;
/* #ifndef APP-NVUE */
max-width: 50%;
/* #endif */
/* #ifdef APP-NVUE */
max-width: 500px;
/* #endif */
}
}
.uni-popup-message-text {
font-size: 14px;
padding: 0;
}
.uni-popup__success {
background-color: #e1f3d8;
}
.uni-popup__success-text {
color: #67C23A;
}
.uni-popup__warn {
background-color: #faecd8;
}
.uni-popup__warn-text {
color: #E6A23C;
}
.uni-popup__error {
background-color: #fde2e2;
}
.uni-popup__error-text {
color: #F56C6C;
}
.uni-popup__info {
background-color: #F2F6FC;
}
.uni-popup__info-text {
color: #909399;
}
</style>

View File

@ -0,0 +1,187 @@
<template>
<view class="uni-popup-share">
<view class="uni-share-title"><text class="uni-share-title-text">{{shareTitleText}}</text></view>
<view class="uni-share-content">
<view class="uni-share-content-box">
<view class="uni-share-content-item" v-for="(item,index) in bottomData" :key="index" @click.stop="select(item,index)">
<image class="uni-share-image" :src="item.icon" mode="aspectFill"></image>
<text class="uni-share-text">{{item.text}}</text>
</view>
</view>
</view>
<view class="uni-share-button-box">
<button class="uni-share-button" @click="close">{{cancelText}}</button>
</view>
</view>
</template>
<script>
import popup from '../uni-popup/popup.js'
import {
initVueI18n
} from '@dcloudio/uni-i18n'
import messages from '../uni-popup/i18n/index.js'
const { t } = initVueI18n(messages)
export default {
name: 'UniPopupShare',
mixins:[popup],
emits:['select'],
props: {
title: {
type: String,
default: ''
},
beforeClose: {
type: Boolean,
default: false
}
},
data() {
return {
bottomData: [{
text: '微信',
icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/c2b17470-50be-11eb-b680-7980c8a877b8.png',
name: 'wx'
},
{
text: '支付宝',
icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/d684ae40-50be-11eb-8ff1-d5dcf8779628.png',
name: 'wx'
},
{
text: 'QQ',
icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/e7a79520-50be-11eb-b997-9918a5dda011.png',
name: 'qq'
},
{
text: '新浪',
icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/0dacdbe0-50bf-11eb-8ff1-d5dcf8779628.png',
name: 'sina'
},
// {
// text: '',
// icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/1ec6e920-50bf-11eb-8a36-ebb87efcf8c0.png',
// name: 'copy'
// },
// {
// text: '',
// icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/2e0fdfe0-50bf-11eb-b997-9918a5dda011.png',
// name: 'more'
// }
]
}
},
created() {},
computed: {
cancelText() {
return t("uni-popup.cancel")
},
shareTitleText() {
return this.title || t("uni-popup.shareTitle")
}
},
methods: {
/**
* 选择内容
*/
select(item, index) {
this.$emit('select', {
item,
index
})
this.close()
},
/**
* 关闭窗口
*/
close() {
if(this.beforeClose) return
this.popup.close()
}
}
}
</script>
<style lang="scss" >
.uni-popup-share {
background-color: #fff;
border-top-left-radius: 11px;
border-top-right-radius: 11px;
}
.uni-share-title {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
align-items: center;
justify-content: center;
height: 40px;
}
.uni-share-title-text {
font-size: 14px;
color: #666;
}
.uni-share-content {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
justify-content: center;
padding-top: 10px;
}
.uni-share-content-box {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
flex-wrap: wrap;
width: 360px;
}
.uni-share-content-item {
width: 90px;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
justify-content: center;
padding: 10px 0;
align-items: center;
}
.uni-share-content-item:active {
background-color: #f5f5f5;
}
.uni-share-image {
width: 30px;
height: 30px;
}
.uni-share-text {
margin-top: 10px;
font-size: 14px;
color: #3B4144;
}
.uni-share-button-box {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
padding: 10px 15px;
}
.uni-share-button {
flex: 1;
border-radius: 50px;
color: #666;
font-size: 16px;
}
.uni-share-button::after {
border-radius: 50px;
}
</style>

View File

@ -0,0 +1,7 @@
{
"uni-popup.cancel": "cancel",
"uni-popup.ok": "ok",
"uni-popup.placeholder": "pleace enter",
"uni-popup.title": "Hint",
"uni-popup.shareTitle": "Share to"
}

View File

@ -0,0 +1,8 @@
import en from './en.json'
import zhHans from './zh-Hans.json'
import zhHant from './zh-Hant.json'
export default {
en,
'zh-Hans': zhHans,
'zh-Hant': zhHant
}

View File

@ -0,0 +1,7 @@
{
"uni-popup.cancel": "取消",
"uni-popup.ok": "确定",
"uni-popup.placeholder": "请输入",
"uni-popup.title": "提示",
"uni-popup.shareTitle": "分享到"
}

View File

@ -0,0 +1,7 @@
{
"uni-popup.cancel": "取消",
"uni-popup.ok": "確定",
"uni-popup.placeholder": "請輸入",
"uni-popup.title": "提示",
"uni-popup.shareTitle": "分享到"
}

View File

@ -0,0 +1,45 @@
// #ifdef H5
export default {
name: 'Keypress',
props: {
disable: {
type: Boolean,
default: false
}
},
mounted () {
const keyNames = {
esc: ['Esc', 'Escape'],
tab: 'Tab',
enter: 'Enter',
space: [' ', 'Spacebar'],
up: ['Up', 'ArrowUp'],
left: ['Left', 'ArrowLeft'],
right: ['Right', 'ArrowRight'],
down: ['Down', 'ArrowDown'],
delete: ['Backspace', 'Delete', 'Del']
}
const listener = ($event) => {
if (this.disable) {
return
}
const keyName = Object.keys(keyNames).find(key => {
const keyName = $event.key
const value = keyNames[key]
return value === keyName || (Array.isArray(value) && value.includes(keyName))
})
if (keyName) {
// 避免和其他按键事件冲突
setTimeout(() => {
this.$emit(keyName, {})
}, 0)
}
}
document.addEventListener('keyup', listener)
// this.$once('hook:beforeDestroy', () => {
// document.removeEventListener('keyup', listener)
// })
},
render: () => {}
}
// #endif

View File

@ -0,0 +1,26 @@
export default {
data() {
return {
}
},
created(){
this.popup = this.getParent()
},
methods:{
/**
* 获取父元素实例
*/
getParent(name = 'uniPopup') {
let parent = this.$parent;
let parentName = parent.$options.name;
while (parentName !== name) {
parent = parent.$parent;
if (!parent) return false
parentName = parent.$options.name;
}
return parent;
},
}
}

View File

@ -0,0 +1,474 @@
<template>
<view v-if="showPopup" class="uni-popup" :class="[popupstyle, isDesktop ? 'fixforpc-z-index' : '']">
<view @touchstart="touchstart">
<uni-transition key="1" v-if="maskShow" name="mask" mode-class="fade" :styles="maskClass"
:duration="duration" :show="showTrans" @click="onTap" />
<uni-transition key="2" :mode-class="ani" name="content" :styles="transClass" :duration="duration"
:show="showTrans" @click="onTap">
<view class="uni-popup__wrapper" :style="{ backgroundColor: bg }" :class="[popupstyle]" @click="clear">
<slot />
</view>
</uni-transition>
</view>
<!-- #ifdef H5 -->
<keypress v-if="maskShow" @esc="onTap" />
<!-- #endif -->
</view>
</template>
<script>
// #ifdef H5
import keypress from './keypress.js'
// #endif
/**
* PopUp 弹出层
* @description 弹出层组件为了解决遮罩弹层的问题
* @tutorial https://ext.dcloud.net.cn/plugin?id=329
* @property {String} type = [top|center|bottom|left|right|message|dialog|share] 弹出方式
* @value top 顶部弹出
* @value center 中间弹出
* @value bottom 底部弹出
* @value left 左侧弹出
* @value right 右侧弹出
* @value message 消息提示
* @value dialog 对话框
* @value share 底部分享示例
* @property {Boolean} animation = [true|false] 是否开启动画
* @property {Boolean} maskClick = [true|false] 蒙版点击是否关闭弹窗(废弃)
* @property {Boolean} isMaskClick = [true|false] 蒙版点击是否关闭弹窗
* @property {String} backgroundColor 主窗口背景色
* @property {String} maskBackgroundColor 蒙版颜色
* @property {Boolean} safeArea 是否适配底部安全区
* @event {Function} change 打开关闭弹窗触发e={show: false}
* @event {Function} maskClick 点击遮罩触发
*/
export default {
name: 'uniPopup',
components: {
// #ifdef H5
keypress
// #endif
},
emits: ['change', 'maskClick'],
props: {
//
animation: {
type: Boolean,
default: true
},
// top: bottomcenter
// message: ; dialog :
type: {
type: String,
default: 'center'
},
// maskClick
isMaskClick: {
type: Boolean,
default: null
},
// TODO 2 使 isMaskClick
maskClick: {
type: Boolean,
default: null
},
backgroundColor: {
type: String,
default: 'none'
},
safeArea: {
type: Boolean,
default: true
},
maskBackgroundColor: {
type: String,
default: 'rgba(0, 0, 0, 0.4)'
},
},
watch: {
/**
* 监听type类型
*/
type: {
handler: function(type) {
if (!this.config[type]) return
this[this.config[type]](true)
},
immediate: true
},
isDesktop: {
handler: function(newVal) {
if (!this.config[newVal]) return
this[this.config[this.type]](true)
},
immediate: true
},
/**
* 监听遮罩是否可点击
* @param {Object} val
*/
maskClick: {
handler: function(val) {
this.mkclick = val
},
immediate: true
},
isMaskClick: {
handler: function(val) {
this.mkclick = val
},
immediate: true
},
// H5
showPopup(show) {
// #ifdef H5
// fix by mehaotian h5 穿
document.getElementsByTagName('body')[0].style.overflow = show ? 'hidden' : 'visible'
// #endif
}
},
data() {
return {
duration: 300,
ani: [],
showPopup: false,
showTrans: false,
popupWidth: 0,
popupHeight: 0,
config: {
top: 'top',
bottom: 'bottom',
center: 'center',
left: 'left',
right: 'right',
message: 'top',
dialog: 'center',
share: 'bottom'
},
maskClass: {
position: 'fixed',
bottom: 0,
top: 0,
left: 0,
right: 0,
backgroundColor: 'rgba(0, 0, 0, 0.4)'
},
transClass: {
position: 'fixed',
left: 0,
right: 0
},
maskShow: true,
mkclick: true,
popupstyle: this.isDesktop ? 'fixforpc-top' : 'top'
}
},
computed: {
isDesktop() {
return this.popupWidth >= 500 && this.popupHeight >= 500
},
bg() {
if (this.backgroundColor === '' || this.backgroundColor === 'none') {
return 'transparent'
}
return this.backgroundColor
}
},
mounted() {
const fixSize = () => {
const {
windowWidth,
windowHeight,
windowTop,
safeArea,
screenHeight,
safeAreaInsets
} = uni.getSystemInfoSync()
this.popupWidth = windowWidth
this.popupHeight = windowHeight + (windowTop || 0)
// TODO fix by mehaotian ,ios app ios
if (safeArea && this.safeArea) {
// #ifdef MP-WEIXIN
this.safeAreaInsets = screenHeight - safeArea.bottom
// #endif
// #ifndef MP-WEIXIN
this.safeAreaInsets = safeAreaInsets.bottom
// #endif
} else {
this.safeAreaInsets = 0
}
}
fixSize()
// #ifdef H5
// window.addEventListener('resize', fixSize)
// this.$once('hook:beforeDestroy', () => {
// window.removeEventListener('resize', fixSize)
// })
// #endif
},
// #ifndef VUE3
// TODO vue2
destroyed() {
this.setH5Visible()
},
// #endif
// #ifdef VUE3
// TODO vue3
unmounted() {
this.setH5Visible()
},
// #endif
created() {
// this.mkclick = this.isMaskClick || this.maskClick
if (this.isMaskClick === null && this.maskClick === null) {
this.mkclick = true
} else {
this.mkclick = this.isMaskClick !== null ? this.isMaskClick : this.maskClick
}
if (this.animation) {
this.duration = 300
} else {
this.duration = 0
}
// TODO message
this.messageChild = null
// TODO
this.clearPropagation = false
this.maskClass.backgroundColor = this.maskBackgroundColor
},
methods: {
setH5Visible() {
// #ifdef H5
// fix by mehaotian h5 穿
document.getElementsByTagName('body')[0].style.overflow = 'visible'
// #endif
},
/**
* 公用方法不显示遮罩层
*/
closeMask() {
this.maskShow = false
},
/**
* 公用方法遮罩层禁止点击
*/
disableMask() {
this.mkclick = false
},
// TODO nvue
clear(e) {
// #ifndef APP-NVUE
e.stopPropagation()
// #endif
this.clearPropagation = true
},
open(direction) {
// fix by mehaotian
if (this.showPopup) {
clearTimeout(this.timer)
this.showPopup = false
}
let innerType = ['top', 'center', 'bottom', 'left', 'right', 'message', 'dialog', 'share']
if (!(direction && innerType.indexOf(direction) !== -1)) {
direction = this.type
}
if (!this.config[direction]) {
console.error('缺少类型:', direction)
return
}
this[this.config[direction]]()
this.$emit('change', {
show: true,
type: direction
})
},
close(type) {
this.showTrans = false
this.$emit('change', {
show: false,
type: this.type
})
clearTimeout(this.timer)
// //
// this.customOpen && this.customClose()
this.timer = setTimeout(() => {
this.showPopup = false
}, 300)
},
// TODO
touchstart() {
this.clearPropagation = false
},
onTap() {
if (this.clearPropagation) {
// fix by mehaotian nvue
this.clearPropagation = false
return
}
this.$emit('maskClick')
if (!this.mkclick) return
this.close()
},
/**
* 顶部弹出样式处理
*/
top(type) {
this.popupstyle = this.isDesktop ? 'fixforpc-top' : 'top'
this.ani = ['slide-top']
this.transClass = {
position: 'fixed',
left: 0,
right: 0,
backgroundColor: this.bg
}
// TODO type
if (type) return
this.showPopup = true
this.showTrans = true
this.$nextTick(() => {
if (this.messageChild && this.type === 'message') {
this.messageChild.timerClose()
}
})
},
/**
* 底部弹出样式处理
*/
bottom(type) {
this.popupstyle = 'bottom'
this.ani = ['slide-bottom']
this.transClass = {
position: 'fixed',
left: 0,
right: 0,
bottom: 0,
paddingBottom: this.safeAreaInsets + 'px',
backgroundColor: this.bg
}
// TODO type
if (type) return
this.showPopup = true
this.showTrans = true
},
/**
* 中间弹出样式处理
*/
center(type) {
this.popupstyle = 'center'
this.ani = ['zoom-out', 'fade']
this.transClass = {
position: 'fixed',
/* #ifndef APP-NVUE */
display: 'flex',
flexDirection: 'column',
/* #endif */
bottom: 0,
left: 0,
right: 0,
top: 0,
justifyContent: 'center',
alignItems: 'center'
}
// TODO type
if (type) return
this.showPopup = true
this.showTrans = true
},
left(type) {
this.popupstyle = 'left'
this.ani = ['slide-left']
this.transClass = {
position: 'fixed',
left: 0,
bottom: 0,
top: 0,
backgroundColor: this.bg,
/* #ifndef APP-NVUE */
display: 'flex',
flexDirection: 'column'
/* #endif */
}
// TODO type
if (type) return
this.showPopup = true
this.showTrans = true
},
right(type) {
this.popupstyle = 'right'
this.ani = ['slide-right']
this.transClass = {
position: 'fixed',
bottom: 0,
right: 0,
top: 0,
backgroundColor: this.bg,
/* #ifndef APP-NVUE */
display: 'flex',
flexDirection: 'column'
/* #endif */
}
// TODO type
if (type) return
this.showPopup = true
this.showTrans = true
}
}
}
</script>
<style lang="scss">
.uni-popup {
position: fixed;
/* #ifndef APP-NVUE */
z-index: 99;
/* #endif */
&.top,
&.left,
&.right {
/* #ifdef H5 */
top: var(--window-top);
/* #endif */
/* #ifndef H5 */
top: 0;
/* #endif */
}
.uni-popup__wrapper {
/* #ifndef APP-NVUE */
display: block;
/* #endif */
position: relative;
/* iphonex 等安全区设置,底部安全区适配 */
/* #ifndef APP-NVUE */
// padding-bottom: constant(safe-area-inset-bottom);
// padding-bottom: env(safe-area-inset-bottom);
/* #endif */
&.left,
&.right {
/* #ifdef H5 */
padding-top: var(--window-top);
/* #endif */
/* #ifndef H5 */
padding-top: 0;
/* #endif */
flex: 1;
}
}
}
.fixforpc-z-index {
/* #ifndef APP-NVUE */
z-index: 999;
/* #endif */
}
.fixforpc-top {
top: 0;
}
</style>

View File

@ -0,0 +1,90 @@
{
"id": "uni-popup",
"displayName": "uni-popup 弹出层",
"version": "1.7.9",
"description": " Popup 组件,提供常用的弹层",
"keywords": [
"uni-ui",
"弹出层",
"弹窗",
"popup",
"弹框"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": ""
},
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
},
"uni_modules": {
"dependencies": [
"uni-scss",
"uni-transition"
],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y"
},
"快应用": {
"华为": "u",
"联盟": "u"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}

View File

@ -0,0 +1,17 @@
## Popup 弹出层
> **组件名uni-popup**
> 代码块: `uPopup`
> 关联组件:`uni-transition`
弹出层组件,在应用中弹出一个消息提示窗口、提示框等
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-popup)
#### 如使用过程中有任何问题或者您对uni-ui有一些好的建议欢迎加入 uni-ui 交流群871950839

Binary file not shown.

1
unpackage/cache/apk/apkurl vendored Normal file
View File

@ -0,0 +1 @@
https://ide.dcloud.net.cn/build/download/21d6f600-0528-11ed-8374-878236aca745

File diff suppressed because one or more lines are too long

3
unpackage/cache/certdata vendored Normal file
View File

@ -0,0 +1,3 @@
andrCertfile=C:/Users/JXJ-202110SC8/Desktop/zhgd2.jks
andrCertAlias=key0
andrCertPass=ep/Tdjka4Y7WYqDB6/S7dw==

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<script>
var __UniViewStartTime__ = Date.now();
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
CSS.supports('top: constant(a)'))
document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script>
<title>View</title>
<link rel="stylesheet" href="view.css" />
</head>
<body>
<div id="app"></div>
<script src="__uniappes6.js"></script>
<script src="view.umd.min.js"></script>
<script src="app-view.js"></script>
</body>
</html>

View File

@ -0,0 +1,3 @@
{
"prompt" : "none"
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
(function(e){function r(r){for(var n,l,i=r[0],p=r[1],a=r[2],c=0,s=[];c<i.length;c++)l=i[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in p)Object.prototype.hasOwnProperty.call(p,n)&&(e[n]=p[n]);f&&f(r);while(s.length)s.shift()();return u.push.apply(u,a||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++){var p=t[i];0!==o[p]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={"app-config":0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"===typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e["default"]}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var i=this["webpackJsonp"]=this["webpackJsonp"]||[],p=i.push.bind(i);i.push=r,i=i.slice();for(var a=0;a<i.length;a++)r(i[a]);var f=p;t()})([]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__98D510E","name":"智慧工地云","version":{"name":"1.2.4","code":124},"description":"","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"Maps":{"coordType":"gcj02"},"VideoPlayer":{},"Bluetooth":{},"SQLite":{},"Push":{},"FaceID":{},"Fingerprint":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":false,"delay":0},"popGesture":"close","launchwebview":{"render":"always","id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"light","background":"#F0AD4E"},"usingComponents":true,"nvueCompiler":"uni-app","compilerVersion":3,"compatible":{"ignoreVersion":true},"distribute":{"icons":{"android":{"hdpi":"icon-android-hdpi.png","xhdpi":"icon-android-xhdpi.png","xxhdpi":"icon-android-xxhdpi.png","xxxhdpi":"icon-android-xxxhdpi.png"},"ios":{"appstore":"","ipad":{"app":"","app@2x":"","proapp@2x":"","spotlight":"","spotlight@2x":"","settings":"","settings@2x":"","notification":"","notification@2x":""},"iphone":{"app@2x":"","app@3x":"","spotlight@2x":"","spotlight@3x":"","settings@2x":"","settings@3x":"","notification@2x":"","notification@3x":""},"prerendered":"false"}},"splashscreen":{"android":{"hdpi":"splash-android-hdpi.png","xhdpi":"splash-android-xhdpi.png","xxhdpi":"splash-android-xxhdpi.png"},"iosStyle":"common","ios":{"storyboard":"D:/work/JXJ2/unpackage/CustomStoryboard.zip"},"useOriginalMsgbox":false,"androidStyle":"default"},"google":{"permissions":["<uses-feature android:name=\"android.hardware.camera\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_CHECKIN_PROPERTIES\"/>","<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>","<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.BLUETOOTH_PRIVILEGED\"/>","<uses-permission android:name=\"android.permission.CALL_PHONE\"/>","<uses-permission android:name=\"android.permission.CALL_PRIVILEGED\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-permission android:name=\"android.permission.INTERNET\"/>","<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>","<uses-permission android:name=\"android.permission.USE_FINGERPRINT\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"],"packagename":"com.zhgdy","password":"ep/Tdjka4Y7WYqDB6/S7dw==","aliasname":"key0","keystore":"google-keystore.jks","custompermissions":true},"apple":{"idfa":false,"devices":"universal"},"plugins":{"maps":{"amap":{"appkey_ios":"9510eb01b56e6428646b256cc379f695","appkey_android":"fdc95509666dff9deb22e57dedd29550"},"description":"地图插件"},"ad":{},"push":{"unipush":{},"description":"管理消息推送能力"},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}},"orientation":["portrait-primary"]},"nativePlugins":{},"allowsInlineMediaPlayback":true,"uni-app":{"compilerVersion":"3.3.13","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"launch_path":"__uniappview.html","adid":"122043180705"}}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 926 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 938 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 893 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 680 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 736 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 885 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 995 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1020 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1015 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 997 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 707 B

Some files were not shown because too many files have changed in this diff Show More