Loading src/assets/workbench/sst.jpg 0 → 100644 +189 KiB Loading image diff... src/views/drawCanvas/riskView.vue +98 −22 Original line number Diff line number Diff line <template> <div class="wrap" ref="mapmidbox"> <van-sticky> <van-sticky v-if="showHeader"> <header class="header"> <span @click="close" class="iconLeft"> 关闭</span> <span>{{text}}</span> <span @click="confim" class="iconRight" v-show="!isView">确定</span> <span class="iconRight" v-show="isView"></span> <span @click="confim" class="iconRight" v-show="!isViews">确定</span> <span class="iconRight" v-show="isViews"></span> </header> </van-sticky> <grid-layout :layout.sync="layout" Loading Loading @@ -35,8 +35,8 @@ </grid-item> </grid-layout> <div class="setBtns"> <van-button @click="addItem" type="info" size="mini" v-if="!isView">添加房间</van-button> <van-grid direction="horizontal" :column-num="2" class="footer"> <van-button @click="addItem" type="info" size="mini" v-if="!isViews">添加房间</van-button> <van-grid direction="horizontal" :column-num="2" class="footer" v-if="isViews"> 风险等级图例: <span class="riskTab type1"></span>重大风险 <span class="riskTab type2"></span>较大风险 Loading Loading @@ -101,44 +101,99 @@ export default { roomName:'', columns: ['办公', '餐饮', '住宅', '超市'], colorList:['#FF4433','#FF9800','#FFFF00','#0091EA'], isView:true,// true:查看页面; false: 添加页面 isViews:false,// true:查看页面; false: 添加页面 showHeader:true } }, props:{ isView: { type: Boolean, default: false, }, }, mounted() { // screenfull.toggle(this.$refs.mapbox); // this.$nextTick(() => { this.$nextTick(() => { // this.rotateBox(); // }); this.isView = this.$route.params.isView? true : false this.initRotate(); }); if (this._props.isView) { console.log('作为组件传值==>>',) this.isViews = true this.showHeader = false } if (this.$route.params.isView) { this.isViews = true } this.getRoomInfo() window.addEventListener("onorientationchange" in window ? "orientationchange" : "resize", this.orientationChange, false); }, methods: { orientationChange(){ if (window.orientation === 180 || window.orientation === 0) { console.log('竖屏状态!'); } if (window.orientation === 90 || window.orientation === -90 ){ console.log('横屏状态!'); } // let width = document.documentElement.clientWidth//页面宽度 // let height = document.documentElement.clientHeight//页面高度 // console.log('width==>>',width) // console.log('height==>>',height) this.rotateBox() }, initRotate(){ let width = document.documentElement.clientWidth,//页面宽度 height = document.documentElement.clientHeight,//页面高度 wrapper = this.$refs.mapmidbox,//需要横屏的块,与全屏的块要区分开,不区分全屏的块无法显示横屏效果 style = "";//样式 console.log('width==>>',width) console.log('height==>>',height) style += "width:" + height + "px;"; style += "height:" + width + "px;"; style += "-webkit-transform: rotate(90deg); transform: rotate(90deg);"; // 注意旋转中点的处理 style += "-webkit-transform-origin: " + width / 2 + "px " + width / 2 + "px;"; style += "transform-origin: " + width / 2 + "px " + width / 2 + "px;"; wrapper.style.cssText = style; }, rotateBox() { this.isScreenFull = !this.isScreenFull;//是否全屏状态 let width = document.documentElement.clientWidth,//页面宽度 height = document.documentElement.clientHeight,//页面高度 wrapper = this.$refs.mapmidbox,//需要横屏的块,与全屏的块要区分开,不区分全屏的块无法显示横屏效果 style = "";//样式 if (height < width) {//注意原来就是宽屏时不用横屏 return; } if (this.isScreenFull) { console.log('width==>>',width) console.log('height==>>',height) // if (height < width) {//注意原来就是宽屏时不用横屏 // return; // } if (height < width) { // 横屏 style += "width:" + height + "px;"; style += "height:" + width + "px;"; style += "-webkit-transform: rotate(90deg); transform: rotate(90deg);"; style += "-webkit-transform: rotate(0deg); transform: rotate(0deg);"; // 注意旋转中点的处理 style += "-webkit-transform-origin: " + width / 2 + "px " + width / 2 + "px;"; style += "transform-origin: " + width / 2 + "px " + width / 2 + "px;"; } else { // 竖屏 // style += "width:" + height + "px;"; // style += "height:" + width + "px;"; // style += "-webkit-transform: rotate(90deg); transform: rotate(90deg);"; // // 注意旋转中点的处理 // style += // "-webkit-transform-origin: " + width / 2 + "px " + width / 2 + "px;"; // style += "transform-origin: " + width / 2 + "px " + width / 2 + "px;"; style += "width:100%"; style += "height:100%;"; style += "-webkit-transform: rotate(0); transform: rotate(0);"; style += "-webkit-transform-origin: 0 0;"; style += "transform-origin: 0 0;"; } console.log('style==>>',style) wrapper.style.cssText = style; }, getRoomInfo(){ Loading @@ -153,14 +208,14 @@ export default { item.position.i = item.id item.position.isDraggable = false item.position.isResizable = false if (!this.isView) { //添加页面不显示颜色 if (!this.isViews) { //添加页面不显示颜色 item.position.c = '#eee' }else{ item.position.c = this.colorList[Math.floor(Math.random()*4)] } this.layout.push(item.position) }) console.log('layout==>>',this.layout) // console.log('layout==>>',this.layout) } }).catch((err) => { console.log('err==>>',err) Loading @@ -182,8 +237,11 @@ export default { }, // 删除 removeItem: function (val) { // const index = this.layout.map(item => item.i).indexOf(val); // this.layout.splice(index, 1); if (val == '') { const index = this.layout.map(item => item.i).indexOf(val); this.layout.splice(index, 1); return } postFun('/ledger/room/delete/'+val).then((res) => { if (res.code == 200) { Toast.success('删除成功'); Loading Loading @@ -211,6 +269,14 @@ export default { }, // 确定 保存房间信息 confim(){ if (this.roomName == '') { Toast.fail({ title: '提示', forbidClick: true, message: '请先添加房间!', }) return } let data = { floorId: this.$route.params.floorId ? this.$route.params.floorId : '18', name:this.roomName, Loading @@ -221,6 +287,8 @@ export default { if (res.code == 200) { Toast.success('提交成功'); this.getRoomInfo() this.roomType = '' this.roomName = '' } }).catch((err) => { console.log('err==>>',err) Loading @@ -235,13 +303,13 @@ export default { h: 3, i: '', name: this.roomName, c: '#eee', c: '#0091EA', type:this.roomType, isDraggable:true, isResizable:true } this.layout.push(this.layOutItem) console.log('layOutItem==>>',this.layOutItem) // console.log('layOutItem==>>',this.layOutItem) }, onConfirm(value) { this.roomType = value; Loading @@ -252,11 +320,15 @@ export default { </script> <style scoped > .router-view{ padding-bottom: 0px !important; } .wrap{ height: 100vh; width: 100vw; /* transform: rotate(90deg); transform-origin: bottom left; */ position: relative; } .footer{ /* position: fixed; */ Loading Loading @@ -298,9 +370,12 @@ export default { /*************************************/ .setBtns{ position: fixed; /* position: fixed; top:auto; right: auto; left: 0; bottom: 0; bottom: 0; */ margin-top: 10px; font-size: 0.3rem; padding: 10px; vertical-align: middle; Loading Loading @@ -342,6 +417,7 @@ export default { .vue-grid-item .text { writing-mode:vertical-rl; -webkit-writing-mode: vertical-rl; font-size: 10cqw; display: flex; align-items: center; Loading src/views/riskProject/add/inherentRisks.vue +38 −26 Original line number Diff line number Diff line Loading @@ -151,18 +151,30 @@ export default { //任务执行结束 endTasks() { //toDo Dialog.confirm({ title: '任务执行结束', message: '是否任务执行结束', }) .then(() => { postFun( `/risk/plan/submit/${this.planId}/${this.buildingId}` ).then(res => { Dialog.alert({ title: '任务执行结束', message: res.msg, }).then(() => { // Dialog.alert({ // title: '任务执行结束', // message: res.msg, // }).then(() => { // resolve(res.data); this.$toast.success(res.msg) this.$router.push({ name: 'riskAssess' }) }); // }); }) }) .catch(() => { // on cancel }); }, handadd() { this.$router.push({ Loading src/views/riskProject/add/resultPage.vue +19 −7 Original line number Diff line number Diff line Loading @@ -3,8 +3,8 @@ <LHeader :text="text"></LHeader> <div class="section"> <p>该次测评风险值为:</p> <div> <p style="font-weight: bold;font-size: 20px;">{{ score }}</p> <div class="resultScore"> <p style="font-weight: bold;font-size: 20px;">{{ this.$route.params.score }}</p> </div> <p>本次评估结果评定为:{{ level }}</p> <van-divider></van-divider> Loading @@ -12,10 +12,11 @@ <van-field readonly label="风险发生可能性:" placeholder="一般情况不会发生" /> <van-field readonly label="后果严重程度" placeholder="轻微影响" /> <van-field readonly label="判定标准:" placeholder="见下图" /> <van-image width="90vw" height="auto" :src="require('@/assets/workbench/sst.jpg')" /> </div> <div style="display: flex;margin: 10px 16px 0px; padding-bottom: 16px"> <van-button block type="info" @click="sureClose">确认本次测评结果</van-button> <van-button block plain type="info" @click="resetClose">取消</van-button> <van-button block type="info" @click="sureClose" style="margin-right: 4px;">确认本次测评结果</van-button> <van-button block plain type="info" @click="resetClose" style="margin-left: 4px;">取消</van-button> </div> </div> Loading Loading @@ -69,6 +70,7 @@ import LHeader from "@/components/header.vue"; .wrapper { width: 100%; height: 100%; .section { width: 100%; height: 100%; Loading @@ -77,5 +79,15 @@ import LHeader from "@/components/header.vue"; background: #fff; font-size: 14px; } .resultScore{ width: 48px; height: 48px; background: #ffc600; text-align: center; line-height: 48px; border-radius: 50%; margin: 0 auto; } } </style> No newline at end of file src/views/riskProject/add/taskList.vue +0 −1 Original line number Diff line number Diff line Loading @@ -743,7 +743,6 @@ export default { }, //风险清单列表点击 toRiskDetail(item) { console.log(item, "LLLL"); this.$router.push({ name: "taskDetail", params: { Loading Loading
src/views/drawCanvas/riskView.vue +98 −22 Original line number Diff line number Diff line <template> <div class="wrap" ref="mapmidbox"> <van-sticky> <van-sticky v-if="showHeader"> <header class="header"> <span @click="close" class="iconLeft"> 关闭</span> <span>{{text}}</span> <span @click="confim" class="iconRight" v-show="!isView">确定</span> <span class="iconRight" v-show="isView"></span> <span @click="confim" class="iconRight" v-show="!isViews">确定</span> <span class="iconRight" v-show="isViews"></span> </header> </van-sticky> <grid-layout :layout.sync="layout" Loading Loading @@ -35,8 +35,8 @@ </grid-item> </grid-layout> <div class="setBtns"> <van-button @click="addItem" type="info" size="mini" v-if="!isView">添加房间</van-button> <van-grid direction="horizontal" :column-num="2" class="footer"> <van-button @click="addItem" type="info" size="mini" v-if="!isViews">添加房间</van-button> <van-grid direction="horizontal" :column-num="2" class="footer" v-if="isViews"> 风险等级图例: <span class="riskTab type1"></span>重大风险 <span class="riskTab type2"></span>较大风险 Loading Loading @@ -101,44 +101,99 @@ export default { roomName:'', columns: ['办公', '餐饮', '住宅', '超市'], colorList:['#FF4433','#FF9800','#FFFF00','#0091EA'], isView:true,// true:查看页面; false: 添加页面 isViews:false,// true:查看页面; false: 添加页面 showHeader:true } }, props:{ isView: { type: Boolean, default: false, }, }, mounted() { // screenfull.toggle(this.$refs.mapbox); // this.$nextTick(() => { this.$nextTick(() => { // this.rotateBox(); // }); this.isView = this.$route.params.isView? true : false this.initRotate(); }); if (this._props.isView) { console.log('作为组件传值==>>',) this.isViews = true this.showHeader = false } if (this.$route.params.isView) { this.isViews = true } this.getRoomInfo() window.addEventListener("onorientationchange" in window ? "orientationchange" : "resize", this.orientationChange, false); }, methods: { orientationChange(){ if (window.orientation === 180 || window.orientation === 0) { console.log('竖屏状态!'); } if (window.orientation === 90 || window.orientation === -90 ){ console.log('横屏状态!'); } // let width = document.documentElement.clientWidth//页面宽度 // let height = document.documentElement.clientHeight//页面高度 // console.log('width==>>',width) // console.log('height==>>',height) this.rotateBox() }, initRotate(){ let width = document.documentElement.clientWidth,//页面宽度 height = document.documentElement.clientHeight,//页面高度 wrapper = this.$refs.mapmidbox,//需要横屏的块,与全屏的块要区分开,不区分全屏的块无法显示横屏效果 style = "";//样式 console.log('width==>>',width) console.log('height==>>',height) style += "width:" + height + "px;"; style += "height:" + width + "px;"; style += "-webkit-transform: rotate(90deg); transform: rotate(90deg);"; // 注意旋转中点的处理 style += "-webkit-transform-origin: " + width / 2 + "px " + width / 2 + "px;"; style += "transform-origin: " + width / 2 + "px " + width / 2 + "px;"; wrapper.style.cssText = style; }, rotateBox() { this.isScreenFull = !this.isScreenFull;//是否全屏状态 let width = document.documentElement.clientWidth,//页面宽度 height = document.documentElement.clientHeight,//页面高度 wrapper = this.$refs.mapmidbox,//需要横屏的块,与全屏的块要区分开,不区分全屏的块无法显示横屏效果 style = "";//样式 if (height < width) {//注意原来就是宽屏时不用横屏 return; } if (this.isScreenFull) { console.log('width==>>',width) console.log('height==>>',height) // if (height < width) {//注意原来就是宽屏时不用横屏 // return; // } if (height < width) { // 横屏 style += "width:" + height + "px;"; style += "height:" + width + "px;"; style += "-webkit-transform: rotate(90deg); transform: rotate(90deg);"; style += "-webkit-transform: rotate(0deg); transform: rotate(0deg);"; // 注意旋转中点的处理 style += "-webkit-transform-origin: " + width / 2 + "px " + width / 2 + "px;"; style += "transform-origin: " + width / 2 + "px " + width / 2 + "px;"; } else { // 竖屏 // style += "width:" + height + "px;"; // style += "height:" + width + "px;"; // style += "-webkit-transform: rotate(90deg); transform: rotate(90deg);"; // // 注意旋转中点的处理 // style += // "-webkit-transform-origin: " + width / 2 + "px " + width / 2 + "px;"; // style += "transform-origin: " + width / 2 + "px " + width / 2 + "px;"; style += "width:100%"; style += "height:100%;"; style += "-webkit-transform: rotate(0); transform: rotate(0);"; style += "-webkit-transform-origin: 0 0;"; style += "transform-origin: 0 0;"; } console.log('style==>>',style) wrapper.style.cssText = style; }, getRoomInfo(){ Loading @@ -153,14 +208,14 @@ export default { item.position.i = item.id item.position.isDraggable = false item.position.isResizable = false if (!this.isView) { //添加页面不显示颜色 if (!this.isViews) { //添加页面不显示颜色 item.position.c = '#eee' }else{ item.position.c = this.colorList[Math.floor(Math.random()*4)] } this.layout.push(item.position) }) console.log('layout==>>',this.layout) // console.log('layout==>>',this.layout) } }).catch((err) => { console.log('err==>>',err) Loading @@ -182,8 +237,11 @@ export default { }, // 删除 removeItem: function (val) { // const index = this.layout.map(item => item.i).indexOf(val); // this.layout.splice(index, 1); if (val == '') { const index = this.layout.map(item => item.i).indexOf(val); this.layout.splice(index, 1); return } postFun('/ledger/room/delete/'+val).then((res) => { if (res.code == 200) { Toast.success('删除成功'); Loading Loading @@ -211,6 +269,14 @@ export default { }, // 确定 保存房间信息 confim(){ if (this.roomName == '') { Toast.fail({ title: '提示', forbidClick: true, message: '请先添加房间!', }) return } let data = { floorId: this.$route.params.floorId ? this.$route.params.floorId : '18', name:this.roomName, Loading @@ -221,6 +287,8 @@ export default { if (res.code == 200) { Toast.success('提交成功'); this.getRoomInfo() this.roomType = '' this.roomName = '' } }).catch((err) => { console.log('err==>>',err) Loading @@ -235,13 +303,13 @@ export default { h: 3, i: '', name: this.roomName, c: '#eee', c: '#0091EA', type:this.roomType, isDraggable:true, isResizable:true } this.layout.push(this.layOutItem) console.log('layOutItem==>>',this.layOutItem) // console.log('layOutItem==>>',this.layOutItem) }, onConfirm(value) { this.roomType = value; Loading @@ -252,11 +320,15 @@ export default { </script> <style scoped > .router-view{ padding-bottom: 0px !important; } .wrap{ height: 100vh; width: 100vw; /* transform: rotate(90deg); transform-origin: bottom left; */ position: relative; } .footer{ /* position: fixed; */ Loading Loading @@ -298,9 +370,12 @@ export default { /*************************************/ .setBtns{ position: fixed; /* position: fixed; top:auto; right: auto; left: 0; bottom: 0; bottom: 0; */ margin-top: 10px; font-size: 0.3rem; padding: 10px; vertical-align: middle; Loading Loading @@ -342,6 +417,7 @@ export default { .vue-grid-item .text { writing-mode:vertical-rl; -webkit-writing-mode: vertical-rl; font-size: 10cqw; display: flex; align-items: center; Loading
src/views/riskProject/add/inherentRisks.vue +38 −26 Original line number Diff line number Diff line Loading @@ -151,18 +151,30 @@ export default { //任务执行结束 endTasks() { //toDo Dialog.confirm({ title: '任务执行结束', message: '是否任务执行结束', }) .then(() => { postFun( `/risk/plan/submit/${this.planId}/${this.buildingId}` ).then(res => { Dialog.alert({ title: '任务执行结束', message: res.msg, }).then(() => { // Dialog.alert({ // title: '任务执行结束', // message: res.msg, // }).then(() => { // resolve(res.data); this.$toast.success(res.msg) this.$router.push({ name: 'riskAssess' }) }); // }); }) }) .catch(() => { // on cancel }); }, handadd() { this.$router.push({ Loading
src/views/riskProject/add/resultPage.vue +19 −7 Original line number Diff line number Diff line Loading @@ -3,8 +3,8 @@ <LHeader :text="text"></LHeader> <div class="section"> <p>该次测评风险值为:</p> <div> <p style="font-weight: bold;font-size: 20px;">{{ score }}</p> <div class="resultScore"> <p style="font-weight: bold;font-size: 20px;">{{ this.$route.params.score }}</p> </div> <p>本次评估结果评定为:{{ level }}</p> <van-divider></van-divider> Loading @@ -12,10 +12,11 @@ <van-field readonly label="风险发生可能性:" placeholder="一般情况不会发生" /> <van-field readonly label="后果严重程度" placeholder="轻微影响" /> <van-field readonly label="判定标准:" placeholder="见下图" /> <van-image width="90vw" height="auto" :src="require('@/assets/workbench/sst.jpg')" /> </div> <div style="display: flex;margin: 10px 16px 0px; padding-bottom: 16px"> <van-button block type="info" @click="sureClose">确认本次测评结果</van-button> <van-button block plain type="info" @click="resetClose">取消</van-button> <van-button block type="info" @click="sureClose" style="margin-right: 4px;">确认本次测评结果</van-button> <van-button block plain type="info" @click="resetClose" style="margin-left: 4px;">取消</van-button> </div> </div> Loading Loading @@ -69,6 +70,7 @@ import LHeader from "@/components/header.vue"; .wrapper { width: 100%; height: 100%; .section { width: 100%; height: 100%; Loading @@ -77,5 +79,15 @@ import LHeader from "@/components/header.vue"; background: #fff; font-size: 14px; } .resultScore{ width: 48px; height: 48px; background: #ffc600; text-align: center; line-height: 48px; border-radius: 50%; margin: 0 auto; } } </style> No newline at end of file
src/views/riskProject/add/taskList.vue +0 −1 Original line number Diff line number Diff line Loading @@ -743,7 +743,6 @@ export default { }, //风险清单列表点击 toRiskDetail(item) { console.log(item, "LLLL"); this.$router.push({ name: "taskDetail", params: { Loading