Explorar o código

解决bug

解决imgUrl报错的bug
Sean hai 4 meses
pai
achega
14a2b2df67
Modificáronse 4 ficheiros con 106 adicións e 9 borrados
  1. 101 0
      src/layout/creatWebsite.vue
  2. 2 1
      src/router/index.js
  3. 2 8
      src/utils/baseUrl.js
  4. 1 0
      src/views/chat/hall.vue

+ 101 - 0
src/layout/creatWebsite.vue

@@ -0,0 +1,101 @@
+<template>
+  <div :class="classObj" class="app-wrapper">
+    <div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside" />
+    <!-- <sidebar class="sidebar-container" /> -->
+    <div :class="{hasTagsView:needTagsView}" class="main-container">
+      <div :class="{'fixed-header':fixedHeader}">
+        <navbar />
+        <breadcrumb id="breadcrumb-container"/>
+      </div>
+      <app-main />
+    </div>
+  </div>
+</template>
+
+<script>
+import RightPanel from '@/components/RightPanel'
+import { AppMain, Navbar, Settings, Sidebar, TagsView } from './components'
+import ResizeMixin from './mixin/ResizeHandler'
+import { mapState } from 'vuex'
+import Breadcrumb from '@/components/Breadcrumb'
+
+export default {
+  name: 'Layout',
+  components: {
+    AppMain,
+    Navbar,
+    RightPanel,
+    Settings,
+    Sidebar,
+    TagsView,
+    Breadcrumb
+  },
+  mixins: [ResizeMixin],
+  computed: {
+    ...mapState({
+      sidebar: state => state.app.sidebar,
+      device: state => state.app.device,
+      showSettings: state => state.settings.showSettings,
+      needTagsView: state => state.settings.tagsView,
+      fixedHeader: state => state.settings.fixedHeader
+    }),
+    classObj() {
+      return {
+        hideSidebar: !this.sidebar.opened,
+        openSidebar: this.sidebar.opened,
+        withoutAnimation: this.sidebar.withoutAnimation,
+        mobile: this.device === 'mobile'
+      }
+    }
+  },
+  methods: {
+    handleClickOutside() {
+      this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+  @import "~@/styles/mixin.scss";
+  @import "~@/styles/variables.scss";
+
+  .app-wrapper {
+    @include clearfix;
+    position: relative;
+    height: 100%;
+    width: 100%;
+
+    &.mobile.openSidebar {
+      position: fixed;
+      top: 0;
+    }
+  }
+
+  .drawer-bg {
+    background: #000;
+    opacity: 0.3;
+    width: 100%;
+    top: 0;
+    height: 100%;
+    position: absolute;
+    z-index: 999;
+  }
+
+  .fixed-header {
+    position: fixed;
+    top: 0;
+    right: 0;
+    z-index: 9;
+    width: calc(100% - #{$sideBarWidth});
+    transition: width 0.28s;
+  }
+
+  .hideSidebar .fixed-header {
+    width: calc(100% - 54px)
+  }
+
+  .mobile .fixed-header {
+    width: 100%;
+  }
+</style>

+ 2 - 1
src/router/index.js

@@ -5,6 +5,7 @@ Vue.use(Router)
 
 /* Layout */
 import Layout from '@/layout'
+import creatWebsite from '@/layout/creatWebsite'
 
 /* Router Modules */
 import componentsRouter from './modules/components'
@@ -301,7 +302,7 @@ export const constantRoutes = [
   },
   {
     path: '/creatWebsite',
-    component: Layout,
+    component: creatWebsite,
     children: [
       {
         name: '',

+ 2 - 8
src/utils/baseUrl.js

@@ -2,18 +2,12 @@ const URL = {
   //baseUrl: 'https://admin.bjzxtw.org.cn/zxtapi',//正式环境
   baseUrl: 'http://183.131.25.186:9501',//测试环境
   //baseUrl: 'http://192.168.1.201:9501',//刘佳伟本地环境
-
+  //baseUrl:'http://192.168.1.115:9501',//冯蕊的本地环境
   //baseUrl: 'http://192.168.1.127:9501',//刘剑的本地环境
   //WebsocketUrl: 'ws://192.168.1.201:9506',//刘佳伟websocket地址
   //WebsocketUrl: 'ws://192.168.1.127:9506'//刘剑websocket地址
-  //WebsocketUrl: 'https://admin.bjzxtw.org.cn:9506'//正式环境websocket地址
+  //WebsocketUrl: 'ws://admin.bjzxtw.org.cn:9506'//正式环境websocket地址
   WebsocketUrl: 'ws://183.131.25.186:9506'//测试服务器websocket地址
-
-  //baseUrl:'http://192.168.1.115:9501',//冯蕊的本地环境
-  //baseUrl: 'http://192.168.1.127:9501',//刘剑的本地环境
-  //WebsocketUrl: 'ws://192.168.1.201:9506',//刘佳伟websocket地址
-  // WebsocketUrl: 'ws://192.168.1.127:9506'//刘剑websocket地址
-
 }
 
 export default URL;

+ 1 - 0
src/views/chat/hall.vue

@@ -1187,6 +1187,7 @@ export default {
       },
       formLabelWidth:'100px',
       imgZoomStatus:false,//图片放大框
+      imgZoomUrl:'',//图片放大框的图片地址
       //1.全局配置 end---------------------------------------->
 
       //2.会话列表 start---------------------------------------->