Commit 505a3a30 authored by 李苏's avatar 李苏 💬

首页和登录页调整

parent 4db5fb9f
...@@ -699,22 +699,22 @@ export const constantRoutes = [{ ...@@ -699,22 +699,22 @@ export const constantRoutes = [{
component: () => import('@/views/error/401'), component: () => import('@/views/error/401'),
hidden: true hidden: true
}, },
{ // {
path: '', // path: '',
component: Layout, // component: Layout,
redirect: 'index', // redirect: 'index',
hidden: true, // hidden: true,
children: [{ // children: [{
path: 'index', // path: 'index',
component: () => import('@/views/index'), // component: () => import('@/views/index'),
name: 'Index', // name: 'Index',
meta: { // meta: {
title: '首页', // title: '首页',
icon: 'dashboard', // icon: 'dashboard',
affix: true // affix: true
} // }
}] // }]
}, // },
{ {
path: '/user', path: '/user',
component: Layout, component: Layout,
......
import auth from '@/plugins/auth' import auth from '@/plugins/auth'
import router, { constantRoutes, dynamicRoutes,powerRoutes } from '@/router' import router, {
import { getRouters } from '@/api/menu' constantRoutes,
dynamicRoutes,
powerRoutes
} from '@/router'
import {
getRouters
} from '@/api/menu'
import Layout from '@/layout/index' import Layout from '@/layout/index'
import ParentView from '@/components/ParentView' import ParentView from '@/components/ParentView'
import InnerLink from '@/layout/components/InnerLink' import InnerLink from '@/layout/components/InnerLink'
...@@ -9,6 +15,9 @@ import vue from 'vue' ...@@ -9,6 +15,9 @@ import vue from 'vue'
import commonList from "common/src/commonList" import commonList from "common/src/commonList"
import erpList from "common/src/erpList" import erpList from "common/src/erpList"
import dynamicRouter from 'common/src/utils/router/dynamic.js' import dynamicRouter from 'common/src/utils/router/dynamic.js'
import {
treeToList
} from 'common/src/utils/router/dynamic.js'
/* 过滤mkid相同的定制路由 */ /* 过滤mkid相同的定制路由 */
...@@ -19,40 +28,40 @@ const permission = { ...@@ -19,40 +28,40 @@ const permission = {
defaultRoutes: [], defaultRoutes: [],
topbarRouters: [], topbarRouters: [],
sidebarRouters: [], sidebarRouters: [],
appName:'', appName: '',
customName:'', customName: '',
systemName:'', systemName: '',
systemInfo:[] systemInfo: []
}, },
mutations: { mutations: {
INIT_SIDEBARRPUTERS:(state)=>{ INIT_SIDEBARRPUTERS: (state) => {
state.sidebarRouters=[] state.sidebarRouters = []
}, },
SET_SYSTEMINFO:(state,systemInfo)=>{ SET_SYSTEMINFO: (state, systemInfo) => {
state.systemInfo=systemInfo state.systemInfo = systemInfo
}, },
SET_CUSTOMNAME:(state,customName)=>{ SET_CUSTOMNAME: (state, customName) => {
state.customName=customName state.customName = customName
}, },
SET_SYSTEMNAME:(state,systemName)=>{ SET_SYSTEMNAME: (state, systemName) => {
state.systemName=systemName state.systemName = systemName
}, },
SET_APPNAME:(state,appName)=>{ SET_APPNAME: (state, appName) => {
state.appName=appName state.appName = appName
}, },
SET_SIDEBAR_SHOW:(state, menusBizType)=>{ SET_SIDEBAR_SHOW: (state, menusBizType) => {
state.sidebarRouters.forEach((e,index)=>{ state.sidebarRouters.forEach((e, index) => {
if(menusBizType!='root'&&e.menusBizType&&e.menusBizType==menusBizType){ if (menusBizType != 'root' && e.menusBizType && e.menusBizType == menusBizType) {
state.sidebarRouters[index].hidden=false state.sidebarRouters[index].hidden = false
}else{ } else {
state.sidebarRouters[index].hidden=true state.sidebarRouters[index].hidden = true
} }
if(menusBizType=='root'&&e.mkid){ if (menusBizType == 'root' && e.mkid) {
state.sidebarRouters[index].hidden=false state.sidebarRouters[index].hidden = false
} }
if(e.redirect=='index'){ if (e.redirect == 'index') {
e.hidden=false e.hidden = false
} }
}) })
...@@ -73,49 +82,53 @@ const permission = { ...@@ -73,49 +82,53 @@ const permission = {
}, },
actions: { actions: {
// 生成路由 // 生成路由
GenerateRoutes({ commit }) { GenerateRoutes({
commit
}) {
return new Promise(resolve => { return new Promise(resolve => {
// 向后端请求路由数据 // 向后端请求路由数据
getRouters({}).then(res => { getRouters({}).then(res => {
let appName=res.data.appName||'' localStorage.setItem('homeMkid', res.data.homeMkid)
let customName=res.data.customName||'' localStorage.setItem('homeName', res.data.homeName)
let systemName=res.data.systemName||'' let appName = res.data.appName || ''
let customName = res.data.customName || ''
let systemName = res.data.systemName || ''
commit('SET_APPNAME', appName) commit('SET_APPNAME', appName)
commit('SET_CUSTOMNAME', customName) commit('SET_CUSTOMNAME', customName)
commit('SET_SYSTEMNAME', systemName) commit('SET_SYSTEMNAME', systemName)
/* 构建新list放进列表切换*/ /* 构建新list放进列表切换*/
localStorage.setItem('appName',appName) localStorage.setItem('appName', appName)
/* 存储system id list*/ /* 存储system id list*/
/* 将可切换系统存入store*/ /* 将可切换系统存入store*/
let systemInfo=res.data.systemInfo||[] let systemInfo = res.data.systemInfo || []
if(systemInfo.length!=0){ if (systemInfo.length != 0) {
systemInfo.unshift({ systemInfo.unshift({
id:'', id: '',
name:customName name: customName
}) })
} }
commit('SET_SYSTEMINFO', systemInfo) commit('SET_SYSTEMINFO', systemInfo)
let menus=res.data.menu let menus = res.data.menu
let asymenus=JSON.parse(JSON.stringify(res.data.menu)) let asymenus = JSON.parse(JSON.stringify(res.data.menu))
/* 权限路由*/ /* 权限路由*/
/* */ /* */
function filter (data) { function filter(data) {
var newData = data.filter( var newData = data.filter(
(item)=>{ (item) => {
let hasMkid=false let hasMkid = false
asymenus.forEach(e=>{ asymenus.forEach(e => {
if((e.mkid==item.meta.mkid)||(item.meta.mkid=='test')){ if ((e.mkid == item.meta.mkid) || (item.meta.mkid == 'test')) {
item.meta.icon=e.icon item.meta.icon = e.icon
if(item.meta.mkid!='test'){ if (item.meta.mkid != 'test') {
item.meta.title=e.mkmc item.meta.title = e.mkmc
} }
/* 额外参数*/ /* 额外参数*/
e.mkid&&(item.mkid=e.mkid) e.mkid && (item.mkid = e.mkid)
e.menusBizType&&(item.menusBizType=e.menusBizType) e.menusBizType && (item.menusBizType = e.menusBizType)
e.mkid&&(item.menusBizTypeName=e.menusBizTypeName) e.mkid && (item.menusBizTypeName = e.menusBizTypeName)
hasMkid=true hasMkid = true
} }
}) })
return hasMkid return hasMkid
...@@ -124,26 +137,96 @@ const permission = { ...@@ -124,26 +137,96 @@ const permission = {
newData.forEach(x => x.children && (x.children = filter(x.children))) newData.forEach(x => x.children && (x.children = filter(x.children)))
return newData return newData
} }
let newPowerRoutes=filter(powerRoutes) let newPowerRoutes = filter(powerRoutes)
let newCommonList=filter(commonList.list) let newCommonList = filter(commonList.list)
let newErpList=filter(erpList.list) let newErpList = filter(erpList.list)
/* 转化菜单格式*/ /* 转化菜单格式*/
let delArr=[] let delArr = []
let newmenus=[] let newmenus = []
menus.forEach((mi,i)=>{ menus.forEach((mi, i) => {
let length= Object.keys(mi) let length = Object.keys(mi)
if(length!=0){ if (length != 0) {
newmenus.push(mi) newmenus.push(mi)
} }
}) })
res.data=dynamicRouter([...newCommonList,...newErpList,...newPowerRoutes],asymenus)||[...newCommonList,...newErpList,...newPowerRoutes] res.data = dynamicRouter([...newCommonList, ...newErpList, ...newPowerRoutes], asymenus) || [...
newCommonList, ...newErpList, ...newPowerRoutes
]
/* 重置首页路由*/
// let hompePage = treeToList([...newCommonList,...newErpList,...newPowerRoutes]).filter(item=>item.mkid==localStorage.getItem('homeMkid'))
let ttlist = treeToList([...newCommonList, ...newErpList, ...newPowerRoutes])
let homePage = ttlist.filter(item => item.mkid == localStorage.getItem('homeMkid'))
/* 替换首页*/
if (homePage && homePage[0]) {
if (homePage[0].component) {
// Layout ParentView 组件特殊处理
if (homePage[0].component === 'Layout') {
homePage[0].component = Layout
} else if (homePage[0].component === 'ParentView') {
homePage[0].component = ParentView
} else if (homePage[0].component === 'InnerLink') {
homePage[0].component = InnerLink
} else {
if (homePage[0].commonComponent) {
homePage[0].component = loadCommonView(homePage[0].component)
} else if (homePage[0].erpComponent) {
homePage[0].component = loadErpView(homePage[0].component)
} else {
homePage[0].component = loadView(homePage[0].component)
}
}
}
/* 移除默认路由*/
let newHome = {
path: '',
component: Layout,
redirect: 'index',
hidden: true,
children: [{
path: 'index',
component: homePage[0].component ,
name: 'Index',
meta: {
title: '首页',
icon: 'dashboard',
affix: true
}
}]
}
router.addRoutes([newHome])
}else{
let newHome= {
path: '',
component: Layout,
redirect: 'index',
hidden: true,
children: [{
path: 'index',
component: () => import('@/views/index'),
name: 'Index',
meta: {
title: '首页',
icon: 'dashboard',
affix: true
}
}]
}
router.addRoutes([newHome])
}
// res.data=[...newCommonList,...newErpList,...newPowerRoutes] // res.data=[...newCommonList,...newErpList,...newPowerRoutes]
const sdata = JSON.parse(JSON.stringify(res.data)) const sdata = JSON.parse(JSON.stringify(res.data))
const rdata = JSON.parse(JSON.stringify(res.data)) const rdata = JSON.parse(JSON.stringify(res.data))
const sidebarRoutes = filterAsyncRouter(sdata) const sidebarRoutes = filterAsyncRouter(sdata)
const rewriteRoutes = filterAsyncRouter(rdata, false, true) const rewriteRoutes = filterAsyncRouter(rdata, false, true)
const asyncRoutes = filterDynamicRoutes(dynamicRoutes); const asyncRoutes = filterDynamicRoutes(dynamicRoutes);
rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true }) rewriteRoutes.push({
path: '*',
redirect: '/404',
hidden: true
})
router.addRoutes(asyncRoutes); router.addRoutes(asyncRoutes);
// router.addRoutes(powerRoutes1) // router.addRoutes(powerRoutes1)
...@@ -174,14 +257,13 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) { ...@@ -174,14 +257,13 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
} else if (route.component === 'InnerLink') { } else if (route.component === 'InnerLink') {
route.component = InnerLink route.component = InnerLink
} else { } else {
if(route.commonComponent){ if (route.commonComponent) {
route.component = loadCommonView(route.component) route.component = loadCommonView(route.component)
}else if(route.erpComponent){ } else if (route.erpComponent) {
route.component = loadErpView(route.component) route.component = loadErpView(route.component)
} } else {
else{
route.component = loadView(route.component) route.component = loadView(route.component)
} }
...@@ -196,19 +278,19 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) { ...@@ -196,19 +278,19 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
return true return true
}) })
} }
/* 递归整理*/ /* 递归整理*/
function dgmk(arr,pid){ function dgmk(arr, pid) {
let oldarr = JSON.parse(JSON.stringify(arr)) let oldarr = JSON.parse(JSON.stringify(arr))
let outarr = [] let outarr = []
oldarr.forEach((e,index)=>{ oldarr.forEach((e, index) => {
if(e.fmkid==pid){ if (e.fmkid == pid) {
outarr.push(e) outarr.push(e)
e.children=dgmk(oldarr,e.mkid) e.children = dgmk(oldarr, e.mkid)
} }
}) })
return outarr return outarr
} }
......
...@@ -22,7 +22,14 @@ ...@@ -22,7 +22,14 @@
</editTableForEdit> </editTableForEdit>
</div> </div>
<el-row class="bottomInfo" :gutter="20"> <el-row :gutter="20" :app="this" class="editRow bottomInfo">
<EditColItem :required="item.required||false" :readonly="item.readonly?true:false "
v-for="(item,index) in editColItemList2 " :value="item.value" :span="item.span" :label="item.label"
:prop='item.prop' :key="item.prop" :type="item.type" :typeConfig='item.typeConfig'
:rule="item.rule" />
<!-- 额外数据 -->
</el-row>
<!-- <el-row class="bottomInfo" :gutter="20">
<el-col class="center" :span="12"> <el-col class="center" :span="12">
创建人:{{ 创建人:{{
form.cjr||localUser form.cjr||localUser
...@@ -33,7 +40,7 @@ ...@@ -33,7 +40,7 @@
$moment(form.cjsj).format('YYYY-MM-DD HH:mm:ss')||$moment().format('YYYY-MM-DD HH:mm:ss') $moment(form.cjsj).format('YYYY-MM-DD HH:mm:ss')||$moment().format('YYYY-MM-DD HH:mm:ss')
}} }}
</el-col> </el-col>
</el-row> </el-row> -->
</el-form> </el-form>
<!-- editTab数据 --> <!-- editTab数据 -->
...@@ -72,11 +79,47 @@ ...@@ -72,11 +79,47 @@
} }
}, },
mounted() { mounted() {
this.form.rkrName=this.username this.$nextTick(()=>{
this.form.rkrid=this.userid this.form.whr=this.username
this.form.rkr=this.username
})
}, },
data() { data() {
return { return {
editColItemList2:[
{
"label": "状态",
"prop": "zt",
"span": 8,
"type": "RelSelect",
"value": "",
readonly:true,
"typeConfig": {
"src": "wms/rkgl/rktz/init/zt",
"match": {
"value": "id",
"label": "name"
}
}
},
{
label: '维护人',
prop: 'whr',
type: 'input',
span: 8,
readonly:true,
},
{
label: '维护时间',
prop: 'whsj',
span: 8,
type: 'datetime',
readonly:true,
value:new Date().getTime()
}
],
/* 常规edit数据 */ /* 常规edit数据 */
editColItemList: [{ editColItemList: [{
label: '入库单号', label: '入库单号',
...@@ -139,17 +182,9 @@ ...@@ -139,17 +182,9 @@
}, },
{ {
label: '入库人', label: '入库人',
prop: 'rkrid', prop: 'rkr',
span: 8, span: 8,
type: 'AuxInput', type: 'input',
typeConfig: {
code: 'USER',
label: 'rkrName',
transform: {
value: 'id',
label: 'username'
}
},
"required": true, "required": true,
}, },
{ {
...@@ -173,7 +208,7 @@ ...@@ -173,7 +208,7 @@
{ {
title: "物料编号", title: "物料编号",
field: "code", field: "code",
width: 240, width: 180,
type: 'AuxInput', type: 'AuxInput',
typeConfig: { typeConfig: {
"code": "MATERIAL", "code": "MATERIAL",
...@@ -209,13 +244,7 @@ ...@@ -209,13 +244,7 @@
// }, // },
/* 不可编辑*/ /* 不可编辑*/
{
title: "制令号",
field: "zlh",
type: 'inputText',
width: 100,
allowEdit: true
},
{ {
title: "物料批号", title: "物料批号",
...@@ -225,17 +254,24 @@ ...@@ -225,17 +254,24 @@
// show: JSON.parse(localStorage.getItem('isPhgl')) // show: JSON.parse(localStorage.getItem('isPhgl'))
}, },
{ {
title: "应收数量", title: "制令号",
field: "zlh",
type: 'inputText',
width: 180,
allowEdit: true
},
{
title: "数量",
field: "yssl", field: "yssl",
allowEdit: true, allowEdit: true,
type: 'inputNumber', type: 'inputNumber',
width: 200,
blur: toFixed(null), blur: toFixed(null),
}, },
{ {
title: "入库数量", title: "入库数量",
field: "rksl", field: "rksl",
width: 200,
}, },
// { // {
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
}, },
{ {
title: "入库人", title: "入库人",
field: "rkrName", field: "rkr",
width: 140 width: 140
}, },
{ {
......
...@@ -19,14 +19,18 @@ ...@@ -19,14 +19,18 @@
clickMode="push" clickMode="push"
> >
</vue-particles> </vue-particles>
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" style="position: absolute;right: 5px;background-color:rgba(0, 0, 0, 0.4) ;"> <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" style="position: absolute;right: 5px ;">
<ul class="bg-bubbles" > <ul class="bg-bubbles" >
<li v-for="i in 10" :key="i"></li> <li v-for="i in 10" :key="i"></li>
</ul> </ul>
<!-- --> <!-- -->
<!-- --> <!-- -->
<h3 class="title">{{appName}}</h3> <!-- <h3 class="title">{{appName}}</h3> -->
<div class="iot_title">
<img :src="logo" style="height:40px;width:40px;margin-top:1;"><span style="margin-left: 10px;" > {{appName}}</span>
<!-- <p class="title"></p> -->
</div>
<el-form-item prop="username"> <el-form-item prop="username">
<el-input <el-input
v-model="loginForm.username" v-model="loginForm.username"
...@@ -63,13 +67,13 @@ ...@@ -63,13 +67,13 @@
</div> </div>
</el-form-item> </el-form-item>
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox> <el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>
<el-form-item style="width:100%;"> <el-form-item style="width:100%;margin-bottom: 50px;">
<el-button <el-button
class="btn btn-primary btn-ghost btn-shine" class="btn btn-primary btn-ghost btn-shine"
:loading="loading" :loading="loading"
size="medium" size="medium"
type="primary" type="primary"
style="width:100%;" style="width:100%;background-color:#3A8FFA;color: #fff;"
@click.native.prevent="handleLogin" @click.native.prevent="handleLogin"
> >
<span v-if="!loading">登 录</span> <span v-if="!loading">登 录</span>
...@@ -93,11 +97,13 @@ import Cookies from "js-cookie"; ...@@ -93,11 +97,13 @@ import Cookies from "js-cookie";
import { encrypt, decrypt } from '@/utils/jsencrypt' import { encrypt, decrypt } from '@/utils/jsencrypt'
import md5 from '@/utils/md5.js' import md5 from '@/utils/md5.js'
import {systeminfo} from "@/api/common/common.js" import {systeminfo} from "@/api/common/common.js"
import logo from '@/assets/images/favicon.png'
export default { export default {
name: "Login", name: "Login",
data() { data() {
return { return {
logo:logo,
appName:'', appName:'',
codeUrl: "", codeUrl: "",
loginForm: { loginForm: {
...@@ -234,31 +240,31 @@ export default { ...@@ -234,31 +240,31 @@ export default {
&-shine { &-shine {
color: white; color: white;
&::before { // &::before {
position: absolute; // position: absolute;
content: ""; // content: "";
top: 0; // top: 0;
left: 0; // left: 0;
width: 100%; // width: 100%;
height: 100%; // height: 100%;
background: linear-gradient( // background: linear-gradient(
120deg, // 120deg,
transparent, // transparent,
hsla(var(--hue), 100%, 41%, 0.5), // hsla(var(--hue), 100%, 41%, 0.5),
transparent // transparent
); // );
transform: translateX(-100%); // transform: translateX(-100%);
transition: 0.6s; // transition: 0.6s;
} // }
&:hover { // &:hover {
background: transparent; // background: transparent;
box-shadow: 0 0 20px 10px hsla(var(--hue), 100%, 41%, 0.5); // box-shadow: 0 0 20px 10px hsla(var(--hue), 100%, 41%, 0.5);
} // }
&:hover::before { // &:hover::before {
transform: translateX(100%); // transform: translateX(100%);
} // }
} }
} }
::v-deep .el-input__inner{ ::v-deep .el-input__inner{
...@@ -266,7 +272,7 @@ export default { ...@@ -266,7 +272,7 @@ export default {
border: #014dff 1px solid; border: #014dff 1px solid;
} }
border: #0389ff 1px solid; border: #0389ff 1px solid;
color: #fff; color: #000;
background-color:rgba(0, 0, 0, 0.039) ; background-color:rgba(0, 0, 0, 0.039) ;
} }
.buttonClass { .buttonClass {
...@@ -281,9 +287,9 @@ export default { ...@@ -281,9 +287,9 @@ export default {
border-top-right-radius:3px; border-top-right-radius:3px;
border-bottom-left-radius:3px; border-bottom-left-radius:3px;
border-bottom-right-radius:3px; border-bottom-right-radius:3px;
box-shadow:inset 0px 1px 0px 0px #54a3f7; // box-shadow:inset 0px 1px 0px 0px #54a3f7;
text-shadow:inset 0px 1px 0px #154682; // text-shadow:inset 0px 1px 0px #154682;
background:linear-gradient(#0389ff, #00aaff); // background:linear-gradient(#0389ff, #00aaff);
} }
.buttonClass:hover { .buttonClass:hover {
...@@ -307,14 +313,22 @@ export default { ...@@ -307,14 +313,22 @@ export default {
justify-content: right; justify-content: right;
align-items: center; align-items: center;
height: 100%; height: 100%;
background-image: url("../assets/images/login-rj.jpg"); background-image: url("../assets/images/login_iot.png");
background-size: cover; background-size: 100% 100%;
} }
.title { .iot_title {
font-family: Georgia, 'Times New Roman', Times, serif; color: #666;
margin: 0px auto 30px auto; margin-top: 30px;
text-align: center; text-align: center;
color: #ffffff; font-size: 20px;
font-family: SimHei;
line-height: 40px;
height: 40px;
display: flex;
justify-content: center;
transform: translateY(-20px);
font-weight: 600;
letter-spacing: 1.3px;
} }
.login-form { .login-form {
......
...@@ -39,7 +39,8 @@ module.exports = { ...@@ -39,7 +39,8 @@ module.exports = {
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
// target: `http://192.168.30.254:18080/dmg`, // target: `http://192.168.30.254:18080/dmg`,
// target: `http://192.168.30.254:28084/erp`, // target: `http://192.168.30.254:28084/erp`,
target: `http://192.168.30.103:9080/lxyl`, // target: `http://192.168.30.103:9080/lxyl`,
target: `http://localhost:9080/lxyl`,
// target:'http://192.168.30.105:9081/erp', // target:'http://192.168.30.105:9081/erp',
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment