Commit ddf98c81 by nlp97

init

parents
ENV = 'development'
VUE_APP_BASE_API = ''
VUE_APP_USER_NAME = ''
VUE_APP_PASS_WORD=''
\ No newline at end of file
ENV = 'production'
VUE_APP_BASE_API = ''
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# suvalue-cli
## src
> * assets 存放静态文件
>> * icons 字体文件
>> * scss scss公共文件
>> * images 图片文件夹(可在此目录下根据不同模块创建不同文件下存放图片)
> * components 存放公共组件
>> * 待分区
> * http axios请求过滤
>> * index.js
> * router 路由文件夹 (可根据不同模块创建不同名称路由文件,引入到index.js中)
>> * index.js (内置路由拦截)
> * store vuex存取公共状态文件夹
>> * modules文件夹 内可根据模块来创建存储store的文件
>> * getters.js
>> * index.js
>* utils 文件夹存放公共方法函数
>> filters 文件夹 存放公共过滤器函数
>>待完善ing...
>* views 文件夹存放视图文件
>> 根据项目需求 划分目录结构,创建文件
>* main.js
`development 模式用于 vue-cli-service serve
production 模式用于 vue-cli-service build 和 vue-cli-service test:e2e`
\ No newline at end of file
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "suvalue-cli",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "vue-cli-service serve --open ",
"build": "vue-cli-service build ",
"lint": "vue-cli-service lint"
},
"dependencies": {
"@vue/composition-api": "^1.6.2",
"core-js": "^3.6.5",
"element-ui": "^2.15.6",
"jquery": "^3.6.0",
"js-cookie": "^3.0.1",
"vue": "^2.6.11"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.4.0",
"@vue/cli-plugin-eslint": "~4.4.0",
"@vue/cli-service": "~4.4.0",
"axios": "^0.19.2",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"sass": "^1.18.0",
"sass-loader": "^7.1.0",
"sessionstorage": "^0.1.0",
"vue-router": "^3.3.2",
"vue-template-compiler": "^2.6.11",
"vuex": "^3.4.0"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
<template>
<div id="app">
<router-view/>
</div>
</template>
<script>
export default {
name: 'App',
}
</script>
<style>
</style>
$bgColor: #f3f3f3; //
$mainColor: #4194e7; //主色
$mainhoverColor: #1ba9fc; //hover状态主色
$subColor: #8fc6fd;
$pageColor: #fff;
$patientFontColor: #666; //病人页面主要字体
$timelineColor: #e3e1e1; //时间轴边框线颜色
$tableBorderColor: #ebeef5; //表格边框颜色
$tableActiveColor: #f5f7fa; //表格高亮颜色
$imgDomain: "/assets/img";
$upColor: #FF6100;
$downColor: #8CC220;
//菜单
$menuBgColor: #252a2f; //菜单颜色
$subMenuBgColor: #ededed; //菜单辅颜色
$leftMenuWidth: 200px;
$logoWidth: 50px; //logo宽度
//顶栏
$headerHeight: 50px;
//医院概况
$surveyBgColor1: #00a0e9;
$surveyBgColor2: #8cc220;
$surveyBgColor3: #ffb97f;
$surveyBgColor4: #b7a2de;
$surveyBgColor5: #2ec7c9;
$surveyBgColor6: #d87a80;
$surveyBgColor7: #5ab1ef;
<template>
<div class="http404_page">
<div class="content_404">
<div class="content_404_left">
<img src="../assets/img/404/img404.png" class="img404" alt />
<div class="icon_404">
<img src="../assets/img/404/Icon404.png" class="icon404" alt />
地址错误,请重新输入
</div>
<div class="message404">您可以先查网址,然后重新输入或给我们反馈问题!</div>
<router-link to="/" class="backHome">返回首页</router-link>
</div>
<div class="content_404_right">
<img src="../assets/img/404/rig404.png" alt />
</div>
</div>
</div>
</template>
<script>
</script>
<style lang="scss">
@import "@/styles/mixin.scss";
.http404_page {
background-color: #ffffff;
@include wh(100%, 100%);
@include flexLayout();
.content_404 {
height: 293px;
&_left {
float: left;
display: flex;
flex-direction: column;
justify-content: space-between;
height: 100%;
.img404 {
@include wh(283.1px, 113px);
}
.icon_404 {
font-size: 23px;
font-family: PingFang SC;
font-weight: 400;
color: #abafb3;
line-height: 49px;
display: flex;
flex-direction: row;
align-items: center;
.icon404 {
@include wh(30.5px, 27px);
margin-right: 10px;
}
}
.message404 {
font-size: 14px;
font-family: PingFang SC;
font-weight: 400;
color: #abafb3;
line-height: 22px;
}
.backHome {
width: 170px;
height: 44px;
background: #2cabe3;
font-size: 16px;
font-family: PingFang SC;
font-weight: 400;
color: #ffffff;
line-height: 44px;
}
}
&_right {
float: right;
margin-left: 48px;
@include wh(302px, 293px);
img {
@include wh(100%, 100%);
}
}
}
}
</style>
/*
* @Author: ninglupeng
* @Date: 2022-06-07 00:31:25
* @LastEditors: ninglupeng
* @LastEditTime: 2022-06-07 00:37:54
* @Description:
*/
import Vue from 'vue'
import App from './App.vue'
import store from './store'
import router from '@/router/index'
Vue.config.productionTip = false;
import http from '@/utils/http.js'
Vue.prototype.$http = http;
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);
import VueCompositionApi from '@vue/composition-api'
Vue.use(VueCompositionApi)
new Vue({
store,
router,
render: h => h(App),
}).$mount('#app')
\ No newline at end of file
import Vue from "vue";
import Router from "vue-router";
import store from "@/store";
import { getItem, clear } from "@/utils/auth";
import HelloWorld from "@/views/HelloWorld.vue";
import login from "@/views/login.vue";
Vue.use(Router);
const router = new Router({
routes: [
{
path: "*",
component: (resolve) => require(["@/components/404.vue"], resolve),
},
{
path: "/login",
name: "login",
component: login,
},
{
path: "/",
name: "home",
component: HelloWorld,
},
],
});
//路由跳转前判断(登录权限)
router.beforeEach((to, from, next) => {
//console.log(to, from, next);
const token = getItem("svToken"); //获取用户id
console.log(token);
if (token) {
//有登录权限
if (to.path == "/login") {
next("/");
} else {
//console.log(to);
next();
}
} else {
//没有登录权限
if (to.path == "/login") {
next();
} else {
//不然就跳转到登录;
next("/login");
}
}
});
// router.beforeEach(async(to, from, next) => {
// const hasToken = getToken()
// if (hasToken) {
// if (to.path === '/login') {
// next({ path: '/' })
// } else {
// const hasGetUserInfo = store.getters.token
// if (hasGetUserInfo) {
// next()
// } else {
// try {
// // get user info
// await store.dispatch('user/getInfo')
// next()
// } catch (error) {
// await store.dispatch('user/resetToken')
// next(`/login?redirect=${encodeURIComponent(to.fullPath)}`)
// }
// }
// }
// } else {
// if (to.matched.some(rocode => rocode.meta.requireAuth)) {
// next(`/login?redirect=${encodeURIComponent(to.fullPath)}`)
// } else {
// next()
// }
// }
// })
export default router;
const getters = {
}
export default getters
\ No newline at end of file
import Vue from 'vue'
import Vuex from 'vuex'
import user from './modules/user'
import getters from './getters'
Vue.use(Vuex)
const store = new Vuex.Store({
modules: {
user
},
getters
})
export default store;
\ No newline at end of file
import { setItem, removeToken } from '@/utils/auth';
import http from '@/utils/http';
const state = {
token: '',
userInfo: {},
username: '',
routerData: [],
}
const mutations = {
SET_TOKEN: (state, token) => {
state.token = token;
},
SET_USERINFO: (state, userInfo) => {
state.userInfo = userInfo;
},
SET_NAME: (state, name) => {
state.username = name;
},
SET_ROUTERDATA: (state, list) => {
state.routerData = list;
},
}
const actions = {
login({ commit, dispatch }, userInfo) {
return new Promise((resolve, reject) => {
http
.post('/account/login', userInfo, {})
.then((response) => {
const data = response;
if (data.state === 2) {
ElMessage.error(data.message);
} else {
commit('SET_TOKEN', data.access_token);
setItem('svToken', data.access_token);
setItem('startTime', new Date().getTime());
setItem('refreshtoken', data.refresh_token);
dispatch('getInfo');
resolve(data);
}
})
.catch((error) => {
reject(error);
});
});
},
getInfo({ commit, state }) {
return new Promise((resolve, reject) => {
http
.get('/account/selfinfo')
.then((response) => {
let data = response;
if (!data) {
reject('验证失败,请重新登录。');
}
commit('SET_NAME', data.realName);
setItem('username', data.realName);
commit('SET_USERINFO', data);
setItem('userinfo', JSON.stringify(data));
resolve(data);
})
.catch((error) => {
reject(error);
});
});
},
getRouteList({ commit, state }) {
return new Promise((resolve, reject) => {
http
.get('/account/menu')
.then((response) => {
let data = response;
if (!data) {
reject('验证失败,请重新登录。');
}
commit('SET_ROUTERDATA', data);
setItem('routerData', data);
resolve(data);
})
.catch((error) => {
reject(error);
});
});
},
};
export default {
namespaced: true,
state,
mutations,
actions
}
\ No newline at end of file
@import "./mixin.scss";
@import "./variables.module.scss";
@import "./sidebar.scss";
// 编写全局样式
body {
height: 100%;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB,
Microsoft YaHei, Arial, sans-serif;
margin: 0;
}
label {
font-weight: 700;
}
html {
height: 100%;
box-sizing: border-box;
}
#app {
height: 100%;
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
}
*,
*:before,
*:after {
box-sizing: inherit;
}
a:focus,
a:active {
outline: none;
}
a,
a:focus,
a:hover {
cursor: pointer;
color: inherit;
text-decoration: none;
}
div:focus {
outline: none;
}
.clearfix {
&:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
}
// main-container global css
.app-container {
padding: 20px;
}
\ No newline at end of file
//清除浮动
@use "sass:math";
@mixin clearfix {
&:after {
content: "";
display: table;
clear: both;
}
}
@mixin scrollBar {
// &::-webkit-scrollbar-track-piece {
// background: #d3dce6;
// }
// &::-webkit-scrollbar {
// width: 6px;
// }
// &::-webkit-scrollbar-thumb {
// background: #99a9bf;
// border-radius: 20px;
// }
&::-webkit-scrollbar {
/*滚动条整体样式*/
width: 10px;
/*高宽分别对应横竖滚动条的尺寸*/
height: 10px;
}
&::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
// border: 3px solid transparent;
// border-radius: 3px;
// background-clip: content-box;
// background: #27AAE2;
background-color: #27AAE2;
border: 3px solid transparent;
border-radius: 9px;
background-clip: content-box;
}
&::-webkit-scrollbar-track {
/*滚动条里面轨道*/
border-radius: 10px;
background: #F4F4F4;
width: 10px;
}
}
@mixin relative {
position: relative;
width: 100%;
height: 100%;
}
// 宽高
@mixin wh($width, $height) {
width: $width;
height: $height;
}
// flex布局 默认居中
@mixin flexLayout($center1: center, $center2: center) {
display: flex;
justify-content: $center1; // flex-start | flex-end | center | space-between | space-around
align-items: $center2; // flex-start | flex-end | center | baseline | stretch
}
// 文本超出隐藏 ...隐藏文本
@mixin ellipsis($width: 100%) {
width: $width;
overflow: hidden;
-ms-text-overflow: ellipsis;
text-overflow: ellipsis;
white-space: nowrap;
}
@mixin MedicalService {
&_header {
display: flex;
flex-direction: row;
align-content: center;
justify-content: space-between;
align-items: center;
&_Cmi {
font-size: 14px;
font-family: PingFang SC;
font-weight: bold;
color: #ff7e00;
line-height: 29px;
}
&_Ratio {
font-size: 10px;
font-family: PingFang SC;
font-weight: 400;
color: #54657e;
line-height: 15px;
opacity: 0.6;
}
}
#serviceLeft {
width: 100%;
height: 60%;
}
#serviceRight {
width: 100%;
height: 60%;
}
&_message {
display: flex;
flex-direction: row;
align-content: center;
justify-content: space-between;
align-items: center;
margin-top: 2%;
&_left {
span {
display: inline-block;
width: 4px;
height: 10px;
}
font-size: 12px;
font-family: PingFang SC;
font-weight: 400;
color: #464a53;
line-height: 11px;
}
&_right {
font-size: 10px;
font-family: PingFang SC;
font-weight: 400;
color: #54657e;
line-height: 15px;
opacity: 0.6;
}
}
}
$Boxwidth:1024;
@function r($px, $Boxwidth:$Boxwidth) {
@if $px==0 {
@return 0;
}
@return math.div($px, $Boxwidth) * 100vw;
}
\ No newline at end of file
#app {
background-color: #f0f0f0;
.main-container {
min-height: 100%;
transition: margin-left .28s;
position: relative;
}
.sidebar-container {
transition: width 0.28s;
width: $sideBarWidth !important;
background-color: $menuBg;
height: calc(100vh - 50px);
position: fixed;
font-size: 0px;
top: 50px;
bottom: 0;
left: 0;
z-index: 1001;
overflow: hidden;
margin-right: 6px;
// reset element-ui css
.horizontal-collapse-transition {
transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
}
.scrollbar-wrapper {
overflow-x: hidden !important;
}
.el-scrollbar__bar.is-vertical {
right: 0px;
}
.el-scrollbar {
height: 100%;
}
&.has-logo {
.el-scrollbar {
height: calc(100% - 50px);
}
}
.is-horizontal {
display: none;
}
a {
display: inline-block;
width: 100%;
overflow: hidden;
}
.svg-icon {
margin-right: 16px;
}
.sub-el-icon {
margin-right: 12px;
margin-left: -2px;
}
.el-menu {
border: none;
height: 100%;
width: 100% !important;
}
// menu hover
.submenu-title-noDropdown,
.el-submenu__title {
&:hover {
background-color: $menuHover !important;
}
}
.is-active>.el-submenu__title {
color: $subMenuActiveText !important;
}
& .nest-menu .el-submenu>.el-submenu__title,
& .el-submenu .el-menu-item {
min-width: $sideBarWidth !important;
background-color: $subMenuBg !important;
&:hover {
background-color: $subMenuHover !important;
}
}
}
.hideSidebar {
.sidebar-container {
width: 50px !important;
}
.main-container {
margin-left: 54px;
}
.submenu-title-noDropdown {
padding: 0 !important;
position: relative;
.el-tooltip {
padding: 0 !important;
.svg-icon {
margin-left: 20px;
}
.sub-el-icon {
margin-left: 19px;
}
}
}
.el-submenu {
overflow: hidden;
&>.el-submenu__title {
padding: 0 !important;
.svg-icon {
margin-left: 20px;
}
.sub-el-icon {
margin-left: 19px;
}
.el-submenu__icon-arrow {
display: none;
}
}
}
.el-menu--collapse {
.el-submenu {
&>.el-submenu__title {
&>span {
height: 0;
width: 0;
overflow: hidden;
visibility: hidden;
display: inline-block;
}
}
}
}
}
.el-menu--collapse .el-menu .el-submenu {
min-width: $sideBarWidth !important;
}
// mobile responsive
.mobile {
.main-container {
margin-left: 0px;
}
.sidebar-container {
transition: transform .28s;
width: $sideBarWidth !important;
}
&.hideSidebar {
.sidebar-container {
pointer-events: none;
transition-duration: 0.3s;
transform: translate3d(-$sideBarWidth, 0, 0);
}
}
}
.withoutAnimation {
.main-container,
.sidebar-container {
transition: none;
}
}
}
// when menu collapsed
.el-menu--vertical {
&>.el-menu {
.svg-icon {
margin-right: 16px;
}
.sub-el-icon {
margin-right: 12px;
margin-left: -2px;
}
}
.nest-menu .el-submenu>.el-submenu__title,
.el-menu-item {
&:hover {
// you can use $subMenuHover
background-color: $menuHover !important;
}
}
// the scroll bar appears when the subMenu is too long
>.el-menu--popup {
max-height: 100vh;
overflow-y: auto;
&::-webkit-scrollbar-track-piece {
background: #d3dce6;
}
&::-webkit-scrollbar {
width: 6px;
}
&::-webkit-scrollbar-thumb {
background: #99a9bf;
border-radius: 20px;
}
}
}
\ No newline at end of file
// sidebar
$menuText:#6A707E;
$menuActiveText:#2CABE3;
$subMenuActiveText:#f4f4f5; //https://github.com/ElemeFE/element/issues/12951
$menuBg:#ffffff;
$menuHover:#2CABE3;
$subMenuBg:#2CABE3;
$subMenuHover:#001528;
$sideBarWidth:175px;
$sideBarWidthBak: 180px;
// the :export directive is the magic sauce for webpack
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
:export {
menuText: $menuText;
menuActiveText: $menuActiveText;
subMenuActiveText: $subMenuActiveText;
menuBg: $menuBg;
menuHover: $menuHover;
subMenuBg: $subMenuBg;
subMenuHover: $subMenuHover;
}
\ No newline at end of file
// import Cookies from 'js-cookie';
// // import sessionstorage from 'sessionstorage'
// const TokenKey = '我是token'
// export function getToken() {
// return Cookies.get(TokenKey)
// }
// export function setToken(token) {
// return Cookies.set(TokenKey, token)
// }
// export function removeToken() {
// return Cookies.remove(TokenKey)
// }
export function getItem(key) {
return window.sessionStorage.getItem(key);
}
export function setItem(key,value) {
return window.sessionStorage.setItem(key, value);
}
export function removeItem(key) {
return window.sessionStorage.removeItem(key);
}
export function clear() {
return window.sessionStorage.clear();
}
\ No newline at end of file
/*
* @Author: ninglupeng
* @Date: 2022-06-07 01:16:57
* @LastEditors: ninglupeng
* @LastEditTime: 2022-06-07 01:17:18
* @Description:
*/
export function decimal(num) {
var result = parseFloat(num);
if (isNaN(result)) {
return num;
} else {
result = Math.round(num * 100) / 100;
var s_x = result.toString();
var pos_decimal = s_x.indexOf('.');
if (pos_decimal < 0) {
//不是小数
pos_decimal = s_x.length;
s_x += '.';
}
while (s_x.length <= pos_decimal + 2) {
s_x += '0';
}
return s_x;
}
}
export function toPercent(point) {
var str = Number(point * 100).toFixed(2);
str += '%';
return str;
}
export function keepTwoDecimalFull(num) {
var result = parseFloat(num);
result = Math.round(num * 100) / 100;
var s_x = result.toString();
var pos_decimal = s_x.indexOf('.');
if (pos_decimal < 0) {
pos_decimal = s_x.length;
s_x += '.';
}
while (s_x.length <= pos_decimal + 2) {
s_x += '0';
}
return s_x;
}
export function changeArr(
data
) {
let arr = data.map((o) => [
o.cmi,
o.feeConsumeIndex,
o.source,
o.totalRw,
o.num,
o.stUnitFee,
o.actUnitFee,
o.drugPercent,
o.materialsPercent,
o.deptId,
o.doctorId,
o.targetConsumeIndex,
o.hosId,
o.tagDrugPercent, //目标药占比
o.tagActUnitFee, //目标指数单价
o.tagMaterialsPercent, //目标材料占比
o.coreid, //病组id
]);
return arr;
}
import Vue from 'vue'
import axios from 'axios'
import 'element-ui/lib/theme-chalk/index.css';
import { getItem } from '@/utils/auth'
axios.defaults.timeout = 120000
axios.defaults.headers.post['Content-Type'] = 'application/json;charset=utf-8'
var domain = '/api/api'
function createHeader() {
const token = getItem('svToken');
return token ? { Authorization: `Bearer ${token}` } : {};
}
function errorMsg(d) {
if (d.response.status == '401') {
Vue.prototype.$message.error('登录信息失效,重新登录!');
sessionStorage.clear();
this.$router.push("/login").catch((err) => {
console.log("输出报错", err);
}); //改变路由
}
if (d.response) {
// 请求已发出,但服务器响应的状态码不在 2xx 范围内
console.log(d.response.data.message);
}
if (Vue.prototype.$notify) {
Vue.prototype.$message.error(d ? d.response.data.message : '服务器端错误');
} else {
alert(d ? d.response.data.message : '服务器端错误')
}
}
let loadingInstance;
let loadingOption = { //加载loading
fullscreen: true,
text: '正在加载...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.5)'
}
axios.interceptors.response.use(
(response) => {
if (response.status === 200) {
return Promise.resolve(response);
} else {
return Promise.reject(response);
}
},
(error) => {
if (error.response.status == 401) {
window.sessionStorage.clear();
window.location.href = '/';
}
return Promise.reject(error);
}
);
export default {
post(url, params, option) {
if (getItem('svtoken')) {
loadingInstance = Vue.prototype.$loading(loadingOption);
}
return new Promise((resolve, reject) => {
axios
.post(domain + url, params, { ...{ headers: createHeader() }, ...option })
.then((res) => {
if (res.status !== 200) {
errorMsg(res.data);
reject(res.data);
return;
}
if (getItem('token')) {
loadingInstance.close();
}
resolve(res.data.data || res.data);
})
.catch((error) => {
if (getItem('token')) {
loadingInstance.close();
}
errorMsg(error);
reject(error);
});
});
},
get(url, option) {
loadingInstance = Vue.prototype.$loading(loadingOption);
return new Promise((resolve, reject) => {
axios
.get(domain + url, { ...{ headers: createHeader() }, ...option })
.then((res) => {
if (res.status !== 200) {
errorMsg(res.data);
reject(res.data);
return;
}
loadingInstance.close();
resolve(res.data.data || res.data);
})
.catch((error) => {
loadingInstance.close();
errorMsg(error);
reject(error);
});
});
},
}
\ No newline at end of file
<template>
<div id="login">
<div class="login_form">
<div class="login_form_box">
<div class="login_title">基于病种精细化医院管理系统</div>
<el-form :model="ruleForm" ref="ruleForm" :rules="rules">
<el-form-item prop="userName">
<el-input class="login_username" v-model="ruleForm.userName" autocomplete="off"></el-input>
</el-form-item>
<el-form-item prop="passWord">
<el-input
class="login_password"
type="password"
v-model="ruleForm.passWord"
autocomplete="off"
auto-complete="new-password"
@keyup.enter="submitForm()"
></el-input>
</el-form-item>
<el-form-item>
<el-button @click="submitForm('ruleForm')" class="login_btn">{{ loginContent }}</el-button>
</el-form-item>
</el-form>
</div>
</div>
</div>
</template>
<script>
import { mapState, mapMutations } from "vuex";
export default {
name:'login',
data(){
return{
ruleForm: {
userName: '',
passWord: '',
},
rules: {
userName: [{ required: true, message: '用户名不能为空', trigger: 'blur' }],
passWord: [{ required: true, message: '密码不能为空', trigger: 'blur' }],
},
loginContent: '登录',
}
},
computed:{
},
methods:{
submitForm(formName) {
const params = {
userName: this.ruleForm.userName,
password: this.ruleForm.passWord,
};
// 校验
this.$refs[formName].validate((valid) => {
if (valid) {
this.loginContent = '登录中...';
this.$store
.dispatch('user/login', params)
.then(() => {
this.$store.dispatch('user/getRouteList').then((routeList) => {
// routeList.map((item) => {
// if (item.menuName == '数据驾驶舱') {
// router.push({ path: item.menuUrl });
// }
// });
this.$router.push('*')
});
})
.catch((e) => {
console.log(e);
});
}
});
}
},
mounted(){
}
}
</script>
<style lang="scss">
@import '../styles/index.scss';
#login {
display: flex;
background: url(../assets/img/login/login1920.png) no-repeat;
background-size: cover !important;
@include flexLayout;
@include wh(100%, 100%);
.login_form {
width: 552px;
height: 100%;
position: absolute;
right: 0;
top: 0;
background-color: white;
display: flex;
@include flexLayout;
.login_form_box {
padding: 80px;
.login_title {
font-size: 24px;
color: #5faee3;
margin-bottom: 58px;
font-family: PingFang SC;
font-weight: bold;
}
.login_username {
border: 1px solid #dddfe1;
width: 100%;
height: 42px;
background: url(../assets/img/login/userlogo.png) no-repeat 30px 9px;
background-size: 17px 28px;
padding: 0px 0px 0px 80px; /*输入内容左右边距控制*/
position: relative;
&::before {
position: absolute;
height: calc(100% - 16px);
margin: 8px 0px;
width: 1px;
background: #f1ecf5;
content: '';
}
}
.login_password {
border: 1px solid #dddfe1;
width: 100%;
height: 42px;
background: url(../assets/img/login/passlogo.png) no-repeat 30px 9px;
background-size: 17px 22px;
padding: 0px 0px 0px 80px; /*输入内容左右边距控制*/
position: relative;
&::before {
position: absolute;
height: calc(100% - 16px);
margin: 8px 0px;
width: 1px;
background: #f1ecf5;
content: '';
}
}
.login_username .el-input__inner,
.login_password .el-input__inner {
border: none !important;
outline: none !important;
background-color: transparent !important;
height: 40px;
}
.login_btn {
background-color: #5faee3;
border-radius: 0px;
width: 100%;
outline: none;
color: white;
font-family: PingFang SC;
font-weight: bold;
}
}
}
}
</style>
\ No newline at end of file
/*
* @Author: ninglupeng
* @Date: 2022-06-07 00:31:25
* @LastEditors: ninglupeng
* @LastEditTime: 2022-06-07 00:40:32
* @Description:
*/
const path = require('path');
function resolve(dir) {
return path.join(__dirname, dir)
}
module.exports = {
productionSourceMap: false,
devServer: { //测试环境代理
port: 8066, //测试端口
proxy: {
'/api': {
target: 'https://testjx.suvalue.com/',
changeOrigin: true,
pathRewrite: {
'^/': '/'
}
}
}
},
configureWebpack: {
resolve: {
alias: {
'@': resolve('src')
}
}
},
lintOnSave: false, //取消eslint
css: {
loaderOptions: {
// sass: {
// data: `
// @import "@/assets/color.scss";
// @import "@/assets/mixin.scss";
// `
// }
}
}
}
\ No newline at end of file
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