Browse Source

init

newStyle
lancer 3 years ago
parent
commit
572788c12c
8 changed files with 211 additions and 178 deletions
  1. +17
    -14
      public/index.html
  2. +2
    -18
      src/api/admin/menu.js
  3. +27
    -27
      src/page/check/chose.vue
  4. +21
    -22
      src/page/check/index.vue
  5. +116
    -93
      src/page/index/top/index.vue
  6. +11
    -3
      src/router/axios.js
  7. +1
    -1
      src/store/modules/user.js
  8. +16
    -0
      src/views/Statistics/index.vue

+ 17
- 14
public/index.html View File

@@ -29,6 +29,9 @@
.el-message .el-icon-info {
font-size: 18px;
}
.el-tabs__nav {
font-size: 14px !important;
}
</style>
</head>

@@ -64,20 +67,20 @@
var s = document.getElementsByTagName('script')[0]
s.parentNode.insertBefore(hm, s)
})()
fnResize();
window.onresize = function () {
fnResize();
}
function fnResize() {
var deviceWidth = document.documentElement.clientWidth || window.innerWidth;
if (deviceWidth >= 1920) {
deviceWidth = 1920;
}
if (deviceWidth <= 1200) {
deviceWidth = 1200;
}
document.documentElement.style.fontSize = (deviceWidth / 19.2) + 'px';
}
// fnResize();
// window.onresize = function () {
// fnResize();
// }
// function fnResize() {
// var deviceWidth = document.documentElement.clientWidth || window.innerWidth;
// if (deviceWidth >= 1920) {
// deviceWidth = 1920;
// }
// if (deviceWidth <= 1200) {
// deviceWidth = 1200;
// }
// document.documentElement.style.fontSize = (deviceWidth / 19.2) + 'px';
// }
</script>
</body>



+ 2
- 18
src/api/admin/menu.js View File

@@ -1,26 +1,10 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/

import request from '@/router/axios'

export function getMenu(id) {
return request({
url: '/admin/menu',
params: {parentId: id},
params: {parentId: id,orgType:localStorage.getItem('orgType')},
method: 'get'
})
}
@@ -28,7 +12,7 @@ export function getMenu(id) {
export function getTopMenu() {
return request({
url: '/admin/menu',
params: {type: 'top'},
params: {type: 'top',orgType:localStorage.getItem('orgType')},
method: 'get'
})
}


+ 27
- 27
src/page/check/chose.vue View File

@@ -153,34 +153,34 @@ export default {

<style lang="scss" scoped >
.head {
height: .64rem;
height: 64px;
background: #409eff;
display: flex;
padding: 0 3rem;
padding: 0 20%;
box-sizing: border-box;
justify-content: space-between;
line-height: .64rem;
line-height: 64px;
color: #fff;
font-size: .24rem;
font-size: 24px;
.callback {
font-size: .14rem;
font-size: 14px;
}
}
.hid {
margin-top: .25rem;
height: .50rem;
margin-top: 25px;
height: 50px;
background: #f8f8f8;
border-radius: .04rem;
border-radius: 4px;
text-align: center;
line-height: .50rem;
font-size: .18rem;
line-height: 50px;
font-size: 18px;
color: #32363d;
}
.content {
margin-top: .30rem;
padding: 0 3rem;
margin-top: 30px;
padding: 0 20%;
// height: 680px;
min-height: 5rem;
min-height: 500px;
.con {
display: flex;
flex-wrap: wrap;
@@ -189,28 +189,28 @@ export default {
display: flex;
}
.tab {
width: 2rem;
height: .98rem;
border-radius: .04px;
width: 200px;
height: 98px;
border-radius: 4px;
border: 1px solid #e0e0e0;
box-sizing: border-box;
padding-left: .20rem;
margin-left: .40rem;
margin-top: .30rem;
padding-left: 20px;
margin-left: 40px;
margin-top: 20px;
cursor: pointer;
.text-1 {
font-size: .16rem;
line-height: .30rem;
margin-top: .10rem;
font-size: 16px;
line-height: 30px;
margin-top: 10px;
}
.text-2 {
font-size: .14rem;
line-height: .30rem;
font-size: 14px;
line-height: 30px;
}
.text-3 {
font-size: .14rem;
line-height: .20rem;
margin-bottom: .10rem;
font-size: 14px;
line-height: 20px;
margin-bottom: 10px;
}
}
}


+ 21
- 22
src/page/check/index.vue View File

@@ -45,7 +45,7 @@ export default {
mounted() {
// console.log(123);
this.getTab();
// this.$message.success('123')
},
methods: {
// 获取可选权限对
@@ -108,52 +108,51 @@ export default {

<style lang="scss" scoped >
.head {
height: .64rem;
height: 64px;
background: #409eff;
display: flex;
padding: 0 3rem;
padding: 0 20%;
box-sizing: border-box;
justify-content: space-between;
line-height: .64rem;
line-height: 64px;
color: #fff;
font-size: .24rem;
font-size: 24px;
.callback {
font-size: .14rem;
font-size: 14px;
}
}
.hid {
margin-top: .25rem;
height: .50rem;
margin-top: 25px;
height: 50px;
background: #f8f8f8;
border-radius: 4px;
text-align: center;
line-height: .50rem;
font-size: .18rem;
line-height: 50px;
font-size: 18px;
color: #32363d;
}
.content {
margin-top: .30rem;
padding: 0 3rem;
margin-top: 30px;
padding: 0 20%;
display: flex;
// justify-content: space-around;
justify-content: space-around;
.tab {
width: 2.25rem;
height: 2.25rem;
width: 225px;
height: 225px;
background: #ffffff;
border: 1px solid #e0e0e0;
text-align: center;
cursor: pointer;
margin-right: 1.05rem;
img {
height: .88rem;
width: .88rem;
margin-top: .47rem;
height: 88px;
width: 88px;
margin-top: 47px;
}
.text {
font-size: .20rem;
margin-top: .30rem;
font-size: 20px;
margin-top: 30px;
color: #333333;
line-height: .20rem;
line-height: 20px;
}
}
}


+ 116
- 93
src/page/index/top/index.vue View File

@@ -4,19 +4,19 @@
<div
v-if="showCollapse"
:class="[{ 'avue-breadcrumb--active': isCollapse }]"
class="avue-breadcrumb">
<i
class="icon-navicon"
@click="setCollapse"/>
class="avue-breadcrumb"
>
<i class="icon-navicon" @click="setCollapse" />
</div>
</div>
<div class="top-bar__title">
<div
v-if="showMenu"
class="top-bar__item top-bar__item--show">
<top-menu/>
<div style="margin-top:15px;">
<span style="color:#fff; margin-right:10px;">楼盘选择:</span>
<div v-if="showMenu" class="top-bar__item top-bar__item--show">
<top-menu />
<div style="margin-top: 15px; display: flex;line-height:30px;" @click="goChange">
<div class="daili">代理商</div>
<span style="font-size: 16px; margin-left: 20px;">{{companyName}}</span>
<span class="change">切换</span>
<!-- <span style="color:#fff; margin-right:10px;">楼盘选择:</span>
<el-select v-model="value" placeholder="请选择" @change="selectChange">
<el-option
v-for="item in options"
@@ -24,7 +24,7 @@
:label="item.propertyName"
:value="item.id">
</el-option>
</el-select>
</el-select> -->
</div>
</div>
</div>
@@ -33,62 +33,67 @@
v-if="showColor"
effect="dark"
content="主题色"
placement="bottom">
placement="bottom"
>
<div class="top-bar__item">
<top-color/>
<top-color />
</div>
</el-tooltip>
<el-tooltip
v-if="showDebug"
:content="logsFlag?'没有错误日志':`${logsLen}条错误日志`"
:content="logsFlag ? '没有错误日志' : `${logsLen}条错误日志`"
effect="dark"
placement="bottom">
placement="bottom"
>
<div class="top-bar__item">
<top-logs/>
<top-logs />
</div>
</el-tooltip>
<el-tooltip
v-if="showLock"
effect="dark"
content="锁屏"
placement="bottom">
placement="bottom"
>
<div class="top-bar__item">
<top-lock/>
<top-lock />
</div>
</el-tooltip>
<el-tooltip
v-if="showTheme"
effect="dark"
content="特色主题"
placement="bottom">
placement="bottom"
>
<div class="top-bar__item top-bar__item--show">
<top-theme/>
<top-theme />
</div>
</el-tooltip>
<el-tooltip
v-if="showFullScreen"
:content="isFullScreen?'退出全屏':'全屏'"
:content="isFullScreen ? '退出全屏' : '全屏'"
effect="dark"
placement="bottom">
placement="bottom"
>
<div class="top-bar__item">
<i
:class="isFullScreen?'icon-zuixiaohua':'icon-quanpingzuidahua'"
@click="handleScreen"/>
:class="isFullScreen ? 'icon-zuixiaohua' : 'icon-quanpingzuidahua'"
@click="handleScreen"
/>
</div>
</el-tooltip>
<el-tooltip
v-if="userInfo.avatar"
effect="dark"
content="用户头像"
placement="bottom">
<img
id="thumbnail"
class="top-bar__img">
placement="bottom"
>
<img id="thumbnail" class="top-bar__img" />
</el-tooltip>
<el-dropdown>
<span class="el-dropdown-link">
{{ userInfo.username }}
<i class="el-icon-arrow-down el-icon--right"/>
<i class="el-icon-arrow-down el-icon--right" />
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item divided>
@@ -97,113 +102,131 @@
<el-dropdown-item divided>
<router-link to="/info/index">个人信息</router-link>
</el-dropdown-item>
<el-dropdown-item
divided
@click.native="$refs.seting.open()">界面设置
<el-dropdown-item divided @click.native="$refs.seting.open()"
>界面设置
</el-dropdown-item>
<el-dropdown-item
divided
@click.native="logout">退出系统
<el-dropdown-item divided @click.native="logout"
>退出系统
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<top-setting ref="seting"/>
<top-setting ref="seting" />
</div>
</div>
</template>
<script>
import { mapGetters, mapState } from 'vuex'
import { fullscreenToggel, handleImg, listenfullscreen } from '@/util/util'
import topLock from './top-lock'
import topMenu from './top-menu'
import topTheme from './top-theme'
import topLogs from './top-logs'
import topColor from './top-color'
import topSetting from './top-setting'
import { mapGetters, mapState } from "vuex";
import { fullscreenToggel, handleImg, listenfullscreen } from "@/util/util";
import topLock from "./top-lock";
import topMenu from "./top-menu";
import topTheme from "./top-theme";
import topLogs from "./top-logs";
import topColor from "./top-color";
import topSetting from "./top-setting";

export default {
name: 'Top',
name: "Top",
components: {
topLock,
topMenu,
topTheme,
topLogs,
topColor,
topSetting
topSetting,
},
filters: {},
data() {
return {
options:[],
value:'',
}
options: [],
value: "",
companyName:'齐横三'
};
},
computed: {
...mapState({
showDebug: state => state.common.showDebug,
showTheme: state => state.common.showTheme,
showLock: state => state.common.showLock,
showFullScreen: state => state.common.showFullScreen,
showCollapse: state => state.common.showCollapse,
showMenu: state => state.common.showMenu,
showColor: state => state.common.showColor
showDebug: (state) => state.common.showDebug,
showTheme: (state) => state.common.showTheme,
showLock: (state) => state.common.showLock,
showFullScreen: (state) => state.common.showFullScreen,
showCollapse: (state) => state.common.showCollapse,
showMenu: (state) => state.common.showMenu,
showColor: (state) => state.common.showColor,
}),
...mapGetters([
'userInfo',
'isFullScreen',
'tagWel',
'tagList',
'isCollapse',
'tag',
'logsLen',
'logsFlag'
])
"userInfo",
"isFullScreen",
"tagWel",
"tagList",
"isCollapse",
"tag",
"logsLen",
"logsFlag",
]),
},
created() {
handleImg(this.userInfo.avatar, 'thumbnail')
this.getHouseList() //获取当前人的所有楼盘
handleImg(this.userInfo.avatar, "thumbnail");
// this.getHouseList() //获取当前人的所有楼盘
},
mounted() {
listenfullscreen(this.setScreen)
listenfullscreen(this.setScreen);
},
methods: {
handleScreen() {
fullscreenToggel()
fullscreenToggel();
},
selectChange(e){
selectChange(e) {
console.log(e);
this.$emit('selectChange') //关闭所有
localStorage.setItem('houseId',e)
this.$emit("selectChange"); //关闭所有
localStorage.setItem("houseId", e);
},
getHouseList(){
this.$api.api.queryHouseByUsername()
.then(res=>{
// console.log(res);
this.options=res.data
this.value=res.data[0].id
localStorage.setItem('houseId',this.value)
})
// getHouseList(){
// this.$api.api.queryHouseByUsername()
// .then(res=>{
// // console.log(res);
// this.options=res.data
// this.value=res.data[0].id
// localStorage.setItem('houseId',this.value)
// })
// },
goChange(){

},
setCollapse() {
this.$store.commit('SET_COLLAPSE')
this.$store.commit("SET_COLLAPSE");
},
setScreen() {
this.$store.commit('SET_FULLSCREEN')
this.$store.commit("SET_FULLSCREEN");
},
logout() {
this.$confirm('是否退出系统, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
this.$confirm("是否退出系统, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
this.$store.dispatch('LogOut').then(() => {
this.$router.push({ path: '/login' })
})
})
}
}
}
this.$store.dispatch("LogOut").then(() => {
this.$router.push({ path: "/login" });
});
});
},
},
};
</script>

<style lang="scss" scoped>
.daili {
width: 68px;
height: 30px;
background: #2671e2;
border-radius: 4px;
line-height: 30px;
text-align: center;
color: #FFFFFF;
font-size: 14px;

}
.change{
font-size: 16px;
color: #2671e2;
margin-left: 10px;
}
</style>

+ 11
- 3
src/router/axios.js View File

@@ -32,19 +32,27 @@ axios.interceptors.request.use(config => {
if (TENANT_ID) {
config.headers['TENANT-ID'] = TENANT_ID // 租户ID
}

// 白单验证
// let arr=['/auth/oauth/token','/auth/token/logout','/code/check','/admin/tenant/list','/code','/admin/menu']
// if(arr.indexOf(config.url)==-1){
// Object.assign(config.params,{orgType:localStorage.getItem('orgType')||''})
// }
// console.log(config.params,'data')
// headers中配置serialize为true开启序列化
if (config.method === 'post' && config.headers.serialize) {
// console.log(config.data,'data')
config.data = serialize(config.data)
delete config.data.serialize
}

if (config.method === 'get') {
config.paramsSerializer = function (params) {
// console.log(params,'get')
// console.log(Object.assign(params,{orgType:localStorage.getItem('orgType')}))
return qs.stringify(params, { arrayFormat: 'repeat' })
}
}
// console.log(config,'config')
return config
}, error => {
return Promise.reject(error)
@@ -73,7 +81,7 @@ axios.interceptors.response.use(res => {
})
return Promise.reject(new Error(message))
}
return res.data
}, error => {
NProgress.done()


+ 1
- 1
src/store/modules/user.js View File

@@ -128,7 +128,7 @@ const user = {
// 查询用户信息
GetUserInfo({commit}) {
return new Promise((resolve, reject) => {
getUserInfo({orgType:0}).then((res) => {
getUserInfo({orgType:localStorage.getItem('orgType')}).then((res) => {
const data = res.data || {}
commit('SET_USER_INFO', data.sysUser)
commit('SET_ROLES', data.roles || [])


+ 16
- 0
src/views/Statistics/index.vue View File

@@ -0,0 +1,16 @@
<template>
<div>
这是统计
</div>
</template>

<script>
export default {

}
</script>

<style lang="" scoped >


</style>

Loading…
Cancel
Save