Ver Fonte

qhj-布局修改

qiaohj há 2 semanas atrás
pai
commit
f1f14e1adb

+ 1 - 1
public/index.html

@@ -14,7 +14,7 @@
     <script src="<%= BASE_URL %>static/ueditor/ueditor.config.js"></script>
     <!-- <script src="<%= BASE_URL %>static/ueditor/ueditor.all.min.js"></script>
   <script src="<%= BASE_URL %>static/ueditor/lang/zh-cn/zh-cn.js"></script> -->
-    <title>业务中台-Manage</title>
+    <title>定价管理系统</title>
     <!--lj 修改-->
     <script type="text/javascript">
       window._AMapSecurityConfig = {

BIN
src/assets/img/bg-home.jpg


BIN
src/assets/img/login-bg.png


BIN
src/assets/img/login-img.png


BIN
src/assets/img/login-logo.png


BIN
src/assets/img/login_bg.png


BIN
src/assets/img/logo.png


+ 5 - 0
src/components/common/HtColumn.vue

@@ -196,6 +196,11 @@ export default {
     load() {
       this.loading = true
       let this_ = this
+      if (this.columnAlias === 'lczxmb') {
+        this.canDisplay = false
+        this.loading = false
+        return
+      }
       portal.getColumnByAlias(this.columnAlias).then(data => {
         this_.column = data
         //计算该栏目是否展示

+ 1 - 1
src/components/lang/LangSelect.vue

@@ -64,7 +64,7 @@ export default {
   width: 52px;
 }
 .lang-text{
-  color: $base-color;
+  color: #fff;
   font-size: 16px;
   padding-left: 8px;
   .triangle-icon{

+ 39 - 7
src/views/Login.vue

@@ -14,9 +14,6 @@
         <!--        <el-divider class="logo-divider" direction="vertical"></el-divider>-->
         <!--        <span class="system-name">{{ name }}</span>-->
       </div>
-      <div style="margin-left: 10%;margin-top: 100px;">
-        <img style="height: 48px;" src="@/assets/img/font_logo.png"/>
-      </div>
       <!--      <div class="logo-container" v-if="showTenant && isShow">-->
       <!--        <a class="logo-link" v-if="showLogo">-->
       <!--          <img :src="logo" style="margin-top: 0; height: 48px" />-->
@@ -35,8 +32,13 @@
       <!--        <span class="system-name">{{ companyName }}</span>-->
       <!--      </div>-->
     </el-header>
+    <div class="top-logo">
+      <img :src="logoImg" class="login-logo" />
+      <div direction="vertical" class="vertical-line"></div>
+      <div class="tenant-name">{{ tenantName }}</div>
+    </div>
     <el-main>
-      <img src="@/assets/img/login_logo_bg.png" style="position: absolute;left: 17%;height:500px;"/>
+      <img src="@/assets/img/login-img.png" style="position: absolute;left: 8%;top: 23%; width: 50%"/>
       <div class="login-card__container fullheight">
         <el-card shadow="always" class="login-card">
           <!--          <div :style="totemStyle" class="totem-div"></div>-->
@@ -210,11 +212,11 @@
         tabIndex:0,
         logo: '',
         name: '业务中台', // lj-修改
+        tenantName: '定价管理系统',
         showTenant: false,
         showLogo: false,
         isShow: false,
         companyName: '',
-        tenantName: '',
         qrcodeUrl:"",
         principal: {
           tenantId: '',
@@ -238,10 +240,13 @@
         },
         responseError: '',
         loading: false,
+        logoImg: require('@/assets/img/login-logo.png'),
         backStyle: {
           width: '100%',
-          background: `url(${require('@/assets/img/login_index_bg.png')}) center / 100% auto no-repeat`,
-          backgroundSize:'cover'
+          height: '100vh',
+          background: `url(${require('@/assets/img/login-bg.png')}) center center fixed no-repeat`,
+          backgroundSize:'cover',
+          overflow: 'hidden'
         },
         totemStyle: {
           width: '300px',
@@ -697,7 +702,34 @@
     -ms-flex-align: center;
     align-items: center;
   }
+// 顶部logo区域
+    .top-logo {
+      display: flex;
+      width: 70%;
+      height: 70px;
+      justify-content: center;
+      align-items: center;
+      position: absolute;
+      top: 10%;
+      left: 13%;
+
+      .tenant-name {
+        font-size: 54px;
+        font-weight: bold;
+        line-height: normal;
+        color: #000000;
+      }
 
+      .vertical-line {
+        height: 100%;
+        margin: 0 10px;
+        background-color: #a7aab0;
+        width: 1px;
+      }
+    }
+    .login-logo {
+      width: 50%;
+    }
   // .logo-container {
   //   margin-top: 10px;
   //   display: inline-block;

+ 17 - 6
src/views/Navigator.vue

@@ -14,7 +14,7 @@
             }"
           />
         </div>
-        <router-link to="home" style="text-decoration: none">
+        <!-- <router-link to="home" style="text-decoration: none">
           <div class="logo-container" v-if="!showLogo">
             <img src="@/assets/img/logo-new.png" />
           </div>
@@ -23,6 +23,11 @@
               <img :src="logo" style="margin-top: 0; height: 48px" />
             </a>
           </div>
+        </router-link> -->
+        <router-link to="" style="text-decoration: none">
+          <div class="logo-container">
+            <img src="@/assets/img/logo.png" class="logo-padding" />
+          </div>
         </router-link>
       </div>
       <div class="flex header-right">
@@ -1019,6 +1024,12 @@ export default {
 .divider-item {
   margin: 0 24px;
 }
+.logo-padding {
+  // padding-left: $base-logo-padding-left;
+  background: transparent !important;
+  //height: var(--calcRatio);
+  width: 400px;
+}
 .optionBtns {
   padding: 0 16px;
 }
@@ -1027,12 +1038,12 @@ export default {
     padding-right: 24px;
     font-size: 16px;
     font-weight: 400;
-    color: $base-color;
+    color: #fff;
   }
   .clear-cache-text {
     font-size: 16px;
     font-weight: 400;
-    color: $base-color;
+    color:  #fff;
   }
   .triangle-icon {
     padding-left: 10px;
@@ -1059,7 +1070,7 @@ export default {
 .navbar-menu-collapse > i {
   font-size: 18px;
   margin: 13px;
-  color: $base-color;
+  color:  #fff;
 }
 
 .logo-container {
@@ -1115,7 +1126,7 @@ export default {
   z-index: 999;
   -webkit-box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.08);
   box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.08);
-  background-color: #fff;
+  background-color: #2563eb;
   width: 100%;
   height: $base-header-height;
   // line-height:$base-header-height ;
@@ -1158,7 +1169,7 @@ export default {
 .top-link-icon {
   font-size: 20px;
   padding-right: 8px;
-  color: $base-color;
+  color:  #fff;
   // font-weight: bold;
 }
 .icon-computer {

+ 316 - 0
src/views/common/Home copy.vue

@@ -0,0 +1,316 @@
+<template>
+  <el-container class="home-container">
+    <el-main class="home-content" :key="gridListState">
+      <el-tabs
+        v-model="currentLayoutIndex"
+        v-if="layoutList && layoutList.length > 0"
+        @tab-click="handleClick"
+      >
+        <el-tab-pane
+          v-for="(item, index) in layoutList"
+          :key="index"
+          :label="item.name"
+          :style="{height: item.type == 'datav' ? '100%' : 'auto'}"
+        >
+          <div v-if="item.layout.main.layoutCol === 'customPage'">
+            <div class="d-home">
+              <img class="d-img" src="@/assets/img/home-d.png" alt="">
+            </div>
+          </div>
+          <div v-else>
+                      <div v-if="item.dataType == 'datav'" class="fullheight">
+                        <DatavDesignPreview
+                          v-if="currentLayoutIndex == index"
+                          ref="datavDesign"
+                          :lessWidth="5"
+                          :lessHeight="45"
+                          :layout="item.layout"
+                        />
+                      </div>
+                      <div v-if="item.dataType == 'column'&& !isNewlayout" class="fullheight">
+                        <template v-if="currentLayoutIndex == index">
+                          <el-row
+                            v-for="(grid, i) in item.layout.list"
+                            :key="i"
+                            :gutter="grid.options.gutter"
+                          >
+                            <div v-if="grid.type == 'grid'">
+                              <el-col
+                                v-for="(columns, j) in grid.columns"
+                                :Key="j"
+                                :span="columns.span"
+                              >
+                                <ht-column
+                                  v-for="(cl, k) in columns.list"
+                                  :key="k"
+                                  :column-alias="cl.alias"
+                                />
+                              </el-col>
+                            </div>
+                            <div v-if="grid.type == 'tab'">
+                              <el-col :span="24">
+                                <ht-tabs-column :grid="grid"></ht-tabs-column>
+                              </el-col>
+                            </div>
+                            <div v-if="!grid.type">
+                              <el-col :span="24">
+                                <ht-column :column-alias="grid.alias" />
+                              </el-col>
+                            </div>
+                          </el-row>
+                        </template>
+                      </div>
+                      <div class="new-layout__content" v-else>
+                        <!--根据layoutList循环,如果有中间部分,则用另一种排版方式,先循环this.newLayout.header,再循环this.mainLayout组成中间部分,最后循环this.newLayout.bottom-->
+                        <div class="header-col" v-if="newLayout.header.length > 0">
+                          <template v-for="(headerItem, index) in newLayout.header">
+                            <ht-column
+                              :key="index"
+                              :column-alias="headerItem.alias"
+                              :fromPreview="true"
+                              :columnObj="item.layout.columnStyles"
+                              :itemConfigure="headerItem.configure ? headerItem.configure : {}"
+                            ></ht-column>
+                          </template>
+                        </div>
+                        <el-row :gutter="20" class="col-layout layout-row">
+                          <el-col
+                            v-for="(col, key) in mainLayout"
+                            :key="key"
+                            :class="key"
+                            :span="colSpan(key)"
+                          >
+                            <template v-for="(colItem, index) in col">
+                              <ht-column
+                                :key="index"
+                                :column-alias="colItem.alias"
+                                :fromPreview="true"
+                                :columnObj="item.layout.columnStyles"
+                              ></ht-column>
+                            </template>
+                          </el-col>
+                        </el-row>
+                        <div class="bottom-col" v-if="newLayout.bottom.length > 0">
+                          <template v-for="(bottomItem, index) in newLayout.bottom">
+                            <ht-column
+                              :key="index"
+                              :column-alias="bottomItem.alias"
+                              :fromPreview="true"
+                              :columnObj="item.layout.columnStyles"
+                            ></ht-column>
+                          </template>
+                        </div>
+                      </div>
+          </div>
+
+
+        </el-tab-pane>
+      </el-tabs>
+    </el-main>
+  </el-container>
+</template>
+<script>
+import req from '@/request.js'
+import portal from '@/api/portal.js'
+let Base64 = require('js-base64').Base64
+import HtColumn from '@/components/common/HtColumn.vue'
+import HtTabsColumn from '@/components/common/HtTabsColumn.vue'
+import DatavDesignPreview from '@/components/portal/DatavDesignPreview.vue'
+import WidgetFormBus from '@/components/form/bus/WidgetFormBus.js'
+import TemplateEdit from '../../components/form/customView/TemplateEdit.vue'
+export default {
+  components: {HtColumn, HtTabsColumn, DatavDesignPreview},
+  data() {
+    return {
+      layout: {},
+      dataType: 'column',
+      gridList: [],
+      gridListState: 'init',
+      layoutList: [],
+      currentLayoutIndex: 0,
+      newLayout: {
+        header: [],
+        main: {
+          left: [],
+          center: [],
+          right: []
+        },
+        bottom: []
+      },
+      mainLayout: {
+        left: [],
+        center: [],
+        right: []
+      },
+      spanMap: {
+        two: {
+          left: 16,
+          right: 8
+        },
+        three: {
+          left: 8,
+          center: 8,
+          right: 8
+        },
+        'equal-two': {
+          left: 12,
+          right: 12
+        },
+        customPage:{
+
+        }
+      },
+      isNewlayout: false
+    }
+  },
+  computed: {
+    colSpan() {
+      const layoutCol = this.newLayout.main.layoutCol || 'two'
+      return key => {
+        return this.spanMap[layoutCol][key]
+      }
+    }
+  },
+  created() {
+    //获取用户可切换布局资源
+    WidgetFormBus.$emit('initLayoutList')
+    this.initLayoutList()
+    //获取用户优先级最高的布局
+    // portal.getHomeLayout().then(data => {
+    //   let designHtml = data.value.designHtml;
+    //   this.dataType = data.value.dataType;
+    //   WidgetFormBus.$emit('changeLayout',data.value.id);
+    //   this.layout = JSON.parse(Base64.decode(designHtml) || "{}");
+    //   if (this.layout && this.layout.list && this.layout.list.length > 0) {
+    //     this.gridList = this.layout.list;
+    //   }
+    //   this.gridListState = 'load';
+    // });
+
+    //监听切换布局
+    WidgetFormBus.$on('switchLayout', obj => {
+      WidgetFormBus.$emit('changeLayout', obj.id)
+      this.dataType = obj.dataType
+      this.layout = JSON.parse(Base64.decode(obj.designHtml) || '{}')
+      if (this.layout && this.layout.list && this.layout.list.length > 0) {
+        this.gridList = this.layout.list
+      }
+      this.gridListState = 'switch'
+      this.cacheUserLayout(obj.type, obj.id)
+    })
+  },
+  methods: {
+    cacheUserLayout(type, layoutId) {
+      req
+        .post('${portal}/portal/main/v1/cacheUserLayout', {
+          type: type,
+          layoutId: layoutId,
+          layoutType: 0
+        })
+        .then(response => {})
+    },
+    initLayoutList() {
+      let _this = this
+      req
+        .get(
+          '${portal}/portal/sysIndexLayoutManage/sysIndexLayoutManage/v1/getCurrentAuthLayout?from=manage'
+        )
+        .then(response => {
+          if (response.data && response.data.length > 0) {
+            response.data.forEach(item => {
+              item.layout = JSON.parse(Base64.decode(item.designHtml) || '{}')
+            })
+            _this.layoutList = response.data
+            _this.layout = response.data[_this.currentLayoutIndex].layout
+            _this.setNewLayoutConfig()
+          }
+        })
+    },
+    handleClick() {
+      this.layout = this.layoutList[this.currentLayoutIndex].layout
+      this.setNewLayoutConfig()
+    },
+    setNewLayoutConfig() {
+      if (this.layout.main && Object.keys(this.layout.main).length > 0) {
+        this.isNewlayout = true
+        const {left, center, right} = this.layout.main || {}
+        this.newLayout = this.layout
+        this.mainLayout = {
+          left: left,
+          center: center,
+          right: right
+        }
+        this.layout.main.layoutCol !== 'three' && delete this.mainLayout.center
+      } else {
+        this.gridList = this.layout.list
+        this.isNewlayout = false
+      }
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+.home-container {
+  height: 100%;
+  width: 100%;
+}
+.home-content {
+  padding: 5px;
+  // height: auto;
+  .d-home{
+    .d-img{
+      width: 100%;
+    }
+  }
+  /deep/ .el-card {
+    margin-bottom: 5px;
+  }
+  /deep/ .el-tabs {
+    height: 100%;
+  }
+  /deep/ .el-tabs__content,
+  .el-tabs__content {
+    height: auto;
+    width: 100%;
+  }
+  /deep/ .el-tabs--border-card > .el-tabs__content {
+    padding: 0px;
+  }
+  /deep/ .el-main {
+    padding: 0px;
+  }
+  /deep/ .el-tabs__header {
+    margin: 0 0 5px;
+  }
+}
+/deep/.el-main,
+/deep/.column-body {
+  // 隐藏滚动条
+  &::-webkit-scrollbar {
+    width: 0;
+    background-color: transparent;
+  }
+}
+@media (max-width: 1152px) {
+  /deep/.flow_item {
+    padding: 0 10px !important;
+    .flow_item__bg {
+      width: 32px !important;
+      height: 32px !important;
+      margin-top: 4px;
+      span {
+        font-size: 22px !important;
+        padding: 6px !important;
+      }
+    }
+    .flow_item__count {
+      font-size: 14px !important;
+      line-height: 26px !important;
+    }
+    .flow_item__text {
+      zoom: 0.9;
+      line-height: 26px !important;
+    }
+  }
+}
+</style>

+ 141 - 76
src/views/common/Home.vue

@@ -14,66 +14,81 @@
         >
           <div v-if="item.layout.main.layoutCol === 'customPage'">
             <div class="d-home">
-              <img class="d-img" src="@/assets/img/home-d.png" alt="">
+              <img class="d-img" src="@/assets/img/home-d.png" alt="" />
             </div>
           </div>
           <div v-else>
-                      <div v-if="item.dataType == 'datav'" class="fullheight">
-                        <DatavDesignPreview
-                          v-if="currentLayoutIndex == index"
-                          ref="datavDesign"
-                          :lessWidth="5"
-                          :lessHeight="45"
-                          :layout="item.layout"
-                        />
-                      </div>
-                      <div v-if="item.dataType == 'column'&& !isNewlayout" class="fullheight">
-                        <template v-if="currentLayoutIndex == index">
-                          <el-row
-                            v-for="(grid, i) in item.layout.list"
-                            :key="i"
-                            :gutter="grid.options.gutter"
-                          >
-                            <div v-if="grid.type == 'grid'">
-                              <el-col
-                                v-for="(columns, j) in grid.columns"
-                                :Key="j"
-                                :span="columns.span"
-                              >
-                                <ht-column
-                                  v-for="(cl, k) in columns.list"
-                                  :key="k"
-                                  :column-alias="cl.alias"
-                                />
-                              </el-col>
-                            </div>
-                            <div v-if="grid.type == 'tab'">
-                              <el-col :span="24">
-                                <ht-tabs-column :grid="grid"></ht-tabs-column>
-                              </el-col>
-                            </div>
-                            <div v-if="!grid.type">
-                              <el-col :span="24">
-                                <ht-column :column-alias="grid.alias" />
-                              </el-col>
-                            </div>
-                          </el-row>
-                        </template>
-                      </div>
-                      <div class="new-layout__content" v-else>
-                        <!--根据layoutList循环,如果有中间部分,则用另一种排版方式,先循环this.newLayout.header,再循环this.mainLayout组成中间部分,最后循环this.newLayout.bottom-->
-                        <div class="header-col" v-if="newLayout.header.length > 0">
-                          <template v-for="(headerItem, index) in newLayout.header">
-                            <ht-column
-                              :key="index"
-                              :column-alias="headerItem.alias"
-                              :fromPreview="true"
-                              :columnObj="item.layout.columnStyles"
-                              :itemConfigure="headerItem.configure ? headerItem.configure : {}"
-                            ></ht-column>
-                          </template>
-                        </div>
-                        <el-row :gutter="20" class="col-layout layout-row">
+            <div v-if="item.dataType == 'datav'" class="fullheight">
+              <DatavDesignPreview
+                v-if="currentLayoutIndex == index"
+                ref="datavDesign"
+                :lessWidth="5"
+                :lessHeight="45"
+                :layout="item.layout"
+              />
+            </div>
+            <div
+              v-if="item.dataType == 'column' && !isNewlayout"
+              class="fullheight"
+            >
+              <template v-if="currentLayoutIndex == index">
+                <el-row
+                  v-for="(grid, i) in item.layout.list"
+                  :key="i"
+                  :gutter="grid.options.gutter"
+                >
+                  <div v-if="grid.type == 'grid'">
+                    <el-col
+                      v-for="(columns, j) in grid.columns"
+                      :Key="j"
+                      :span="columns.span"
+                    >
+                      <ht-column
+                        v-for="(cl, k) in columns.list"
+                        :key="k"
+                        :column-alias="cl.alias"
+                      />
+                    </el-col>
+                  </div>
+                  <div v-if="grid.type == 'tab'">
+                    <el-col :span="24">
+                      <ht-tabs-column :grid="grid"></ht-tabs-column>
+                    </el-col>
+                  </div>
+                  <div v-if="!grid.type">
+                    <el-col :span="24">
+                      <ht-column :column-alias="grid.alias" />
+                    </el-col>
+                  </div>
+                </el-row>
+              </template>
+            </div>
+            <div class="new-layout__content" v-else>
+              <!--根据layoutList循环,如果有中间部分,则用另一种排版方式,先循环this.newLayout.header,再循环this.mainLayout组成中间部分,最后循环this.newLayout.bottom-->
+
+              <div class="header-col" v-if="newLayout.header.length > 0">
+                <template v-for="(headerItem, index) in newLayout.header">
+                  <ht-column
+                    :key="index"
+                    :column-alias="headerItem.alias"
+                    :fromPreview="true"
+                    :columnObj="activeLayout.layout.columnStyles"
+                    :itemConfigure="
+                      headerItem.configure ? headerItem.configure : {}
+                    "
+                  ></ht-column>
+                </template>
+              </div>
+              <!-- 主体:当布局未配置任何栏目时,展示欢迎页(截图风格) -->
+              <div class="home-hero">
+                <div class="home-hero__main">
+                  <div class="home-hero__title">
+                    <span class="line"></span
+                    ><span class="hy">欢迎</span>使用定价管理系统
+                  </div>
+                </div>
+              </div>
+              <!-- <el-row :gutter="20" class="col-layout layout-row">
                           <el-col
                             v-for="(col, key) in mainLayout"
                             :key="key"
@@ -89,21 +104,19 @@
                               ></ht-column>
                             </template>
                           </el-col>
-                        </el-row>
-                        <div class="bottom-col" v-if="newLayout.bottom.length > 0">
-                          <template v-for="(bottomItem, index) in newLayout.bottom">
-                            <ht-column
-                              :key="index"
-                              :column-alias="bottomItem.alias"
-                              :fromPreview="true"
-                              :columnObj="item.layout.columnStyles"
-                            ></ht-column>
-                          </template>
-                        </div>
-                      </div>
+                        </el-row> -->
+              <div class="bottom-col" v-if="newLayout.bottom.length > 0">
+                <template v-for="(bottomItem, index) in newLayout.bottom">
+                  <ht-column
+                    :key="index"
+                    :column-alias="bottomItem.alias"
+                    :fromPreview="true"
+                    :columnObj="activeLayout.layout.columnStyles"
+                  ></ht-column>
+                </template>
+              </div>
+            </div>
           </div>
-
-
         </el-tab-pane>
       </el-tabs>
     </el-main>
@@ -156,14 +169,19 @@ export default {
           left: 12,
           right: 12
         },
-        customPage:{
-
-        }
+        customPage: {}
       },
       isNewlayout: false
     }
   },
   computed: {
+    activeLayout() {
+      // 去掉顶部 tab 后,只取第一个布局展示
+      return (
+        (this.layoutList && this.layoutList.length > 0 && this.layoutList[0]) ||
+        null
+      )
+    },
     colSpan() {
       const layoutCol = this.newLayout.main.layoutCol || 'two'
       return key => {
@@ -257,8 +275,8 @@ export default {
 .home-content {
   padding: 5px;
   // height: auto;
-  .d-home{
-    .d-img{
+  .d-home {
+    .d-img {
       width: 100%;
     }
   }
@@ -313,4 +331,51 @@ export default {
     }
   }
 }
+
+/* 主体欢迎区 */
+.home-hero {
+  grid-template-columns: 1fr 360px;
+  gap: 16px;
+  border-radius: 14px;
+  background: url('~@/assets/img/bg-home.jpg') no-repeat;
+  background-size: cover;
+  width: 100%;
+  height: 100%;
+}
+
+.home-hero__main {
+  min-height: 540px;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: flex-start;
+  padding-top: 120px;
+  text-align: center;
+}
+
+.home-hero__title {
+  font-size: 34px;
+  font-weight: 600;
+  color: #1f2d3d;
+  letter-spacing: 1px;
+  margin-bottom: 10px;
+  position: relative;
+  .hy {
+    position: absolute;
+    bottom: 0px;
+    left: -71px;
+    display: inline-block;
+    z-index: 99;
+  }
+  .line {
+    width: 100px;
+    height: 15px;
+    position: absolute;
+    bottom: 7px;
+    left: -74px;
+    background: linear-gradient(45deg, #409eff, transparent);
+    display: inline-block;
+    z-index: 0;
+  }
+}
 </style>