Loading src/views/drawCanvas/riskView.vue +20 −10 Original line number Diff line number Diff line Loading @@ -4,8 +4,8 @@ <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" v-if="isView"> <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,12 +101,12 @@ export default { roomName:'', columns: ['办公', '餐饮', '住宅', '超市'], colorList:['#FF4433','#FF9800','#FFFF00','#0091EA'], isView:false,// true:查看页面; false: 添加页面 isViews:false,// true:查看页面; false: 添加页面 showHeader:true } }, props:{ isViews: { isView: { type: Boolean, default: false, }, Loading @@ -117,13 +117,13 @@ export default { // this.rotateBox(); this.initRotate(); }); if (this._props.isViews) { if (this._props.isView) { console.log('作为组件传值==>>',) this.isView = true this.isViews = true this.showHeader = false } if (this.$route.params.isView) { this.isView = true this.isViews = true } this.getRoomInfo() window.addEventListener("onorientationchange" in window ? "orientationchange" : "resize", this.orientationChange, false); Loading Loading @@ -208,7 +208,7 @@ 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)] Loading Loading @@ -269,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 @@ -279,6 +287,8 @@ export default { if (res.code == 200) { Toast.success('提交成功'); this.getRoomInfo() this.roomType = '' this.roomName = '' } }).catch((err) => { console.log('err==>>',err) Loading vue.config.js +2 −1 Original line number Diff line number Diff line Loading @@ -8,9 +8,10 @@ module.exports = { //以上的ip和端口是我们本机的;下面为需要跨域的 proxy: { //配置跨域 '/app-api': { target: 'http://192.168.4.232:8080/', //这里是后台的地址 // target: 'http://192.168.4.232:8080/', //这里是后台的地址 // target: 'http://192.168.15.124:8080/', //这里是杨帆的地址 // target: 'http://192.168.10.137:8080/', //这里是昊哥的地址 target: 'http://192.168.10.36:8080/', //这里是昊哥的地址 // target: 'http://localhost:8080/', //这里是后台的地址 ws: true, changOrigin: true, //允许跨域 Loading Loading
src/views/drawCanvas/riskView.vue +20 −10 Original line number Diff line number Diff line Loading @@ -4,8 +4,8 @@ <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" v-if="isView"> <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,12 +101,12 @@ export default { roomName:'', columns: ['办公', '餐饮', '住宅', '超市'], colorList:['#FF4433','#FF9800','#FFFF00','#0091EA'], isView:false,// true:查看页面; false: 添加页面 isViews:false,// true:查看页面; false: 添加页面 showHeader:true } }, props:{ isViews: { isView: { type: Boolean, default: false, }, Loading @@ -117,13 +117,13 @@ export default { // this.rotateBox(); this.initRotate(); }); if (this._props.isViews) { if (this._props.isView) { console.log('作为组件传值==>>',) this.isView = true this.isViews = true this.showHeader = false } if (this.$route.params.isView) { this.isView = true this.isViews = true } this.getRoomInfo() window.addEventListener("onorientationchange" in window ? "orientationchange" : "resize", this.orientationChange, false); Loading Loading @@ -208,7 +208,7 @@ 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)] Loading Loading @@ -269,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 @@ -279,6 +287,8 @@ export default { if (res.code == 200) { Toast.success('提交成功'); this.getRoomInfo() this.roomType = '' this.roomName = '' } }).catch((err) => { console.log('err==>>',err) Loading
vue.config.js +2 −1 Original line number Diff line number Diff line Loading @@ -8,9 +8,10 @@ module.exports = { //以上的ip和端口是我们本机的;下面为需要跨域的 proxy: { //配置跨域 '/app-api': { target: 'http://192.168.4.232:8080/', //这里是后台的地址 // target: 'http://192.168.4.232:8080/', //这里是后台的地址 // target: 'http://192.168.15.124:8080/', //这里是杨帆的地址 // target: 'http://192.168.10.137:8080/', //这里是昊哥的地址 target: 'http://192.168.10.36:8080/', //这里是昊哥的地址 // target: 'http://localhost:8080/', //这里是后台的地址 ws: true, changOrigin: true, //允许跨域 Loading