liujd 6 år sedan
förälder
incheckning
3d6d3a098b

+ 3 - 0
admin-code/src/main.js

@@ -17,6 +17,9 @@ import './assets/css/element-variables.scss';
 
 import '@/assets/iconfont/iconfont.css';
 
+import util from '@/utils/util';
+Vue.prototype.$util = util;
+
 Vue.use(ElementUI);
 
 Vue.use(crud, {

+ 142 - 21
admin-code/src/mock/userInfo.js

@@ -170,31 +170,57 @@ let menu = {
 		// 	viewPath: 'https://docs.cool-admin.com/#/',
 		// 	keepAlive: 1
 		// },
+		// 工作台
 		{
 			id: '1',
 			parentId: null,
 			name: '工作台',
 			type: 0,
-			icon: 'icon-gongzuotai',
+			icon: 'icongongzuotai',
 			orderNum: 1,
 			router: '/',
 			viewPath: null,
 			keepAlive: 1
 		},
+		// 客户管理
 		{
-			id: '10',
-			parentId: '8',
-			name: '新增',
-			type: 2,
-			icon: null,
-			orderNum: 1,
-			router: null,
-			viewPath: null,
-			keepAlive: 0
+			id: '2',
+			parentId: null,
+			name: '客户管理',
+			type: 0,
+			icon: 'iconkehuguanli',
+			orderNum: 2,
+			router: '/member/list',
+			viewPath: 'views/member/list.vue',
+			keepAlive: 1
 		},
+		// 订单管理
 		{
-			id: '203',
-			parentId: '27',
+			id: '3',
+			parentId: null,
+			name: '订单管理',
+			type: 0,
+			icon: 'iconkehuguanli',
+			orderNum: 2,
+			router: '/order/list',
+			viewPath: 'views/order/list.vue',
+			keepAlive: 1
+		},
+		// 商品管理
+		{
+			id: '4',
+			parentId: null,
+			name: '商品管理',
+			type: 0,
+			icon: 'iconkehuguanli',
+			orderNum: 2,
+			router: '/goods/list',
+			viewPath: 'views/goods/goods-list.vue',
+			keepAlive: 1
+		},
+		{
+			id: '401',
+			parentId: '4',
 			name: '商品列表',
 			type: 1,
 			icon: 'icon-user',
@@ -204,8 +230,19 @@ let menu = {
 			keepAlive: 1
 		},
 		{
-			id: '204',
-			parentId: '27',
+			id: '402',
+			parentId: '4',
+			name: '图库管理',
+			type: 1,
+			icon: 'icon-user',
+			orderNum: 1,
+			router: '/goods/img-store',
+			viewPath: 'views/goods/img-store.vue',
+			keepAlive: 1
+		},
+		{
+			id: '403',
+			parentId: '4',
 			name: '添加商品',
 			type: 1,
 			icon: 'icon-user',
@@ -214,15 +251,99 @@ let menu = {
 			viewPath: 'views/goods/goods-add.vue',
 			keepAlive: 1
 		},
+		// 邀请有礼
+		{
+			id: '5',
+			parentId: null,
+			name: '邀请有礼',
+			type: 0,
+			icon: 'iconkehuguanli',
+			orderNum: 2,
+			router: '/goods/list',
+			viewPath: 'views/goods/goods-list.vue',
+			keepAlive: 1
+		},
+		// 优惠券
+		{
+			id: '6',
+			parentId: null,
+			name: '优惠券',
+			type: 0,
+			icon: 'iconkehuguanli',
+			orderNum: 2,
+			router: '/goods/list',
+			viewPath: 'views/goods/goods-list.vue',
+			keepAlive: 1
+		},
+		// 促销
 		{
-			id: '205',
+			id: '7',
+			parentId: null,
+			name: '促销',
+			type: 0,
+			icon: 'iconkehuguanli',
+			orderNum: 2,
+			router: '/goods/list',
+			viewPath: 'views/goods/goods-list.vue',
+			keepAlive: 1
+		},
+		// 广告管理
+		{
+			id: '8',
+			parentId: null,
+			name: '广告管理',
+			type: 0,
+			icon: 'iconkehuguanli',
+			orderNum: 2,
+			router: '/goods/list',
+			viewPath: 'views/goods/goods-list.vue',
+			keepAlive: 1
+		},
+		// 员工管理
+		{
+			id: '9',
+			parentId: null,
+			name: '员工管理',
+			type: 0,
+			icon: 'iconkehuguanli',
+			orderNum: 2,
+			router: '/goods/list',
+			viewPath: 'views/goods/goods-list.vue',
+			keepAlive: 1
+		},
+		// 设置
+		{
+			id: '10',
+			parentId: null,
+			name: '设置',
+			type: 0,
+			icon: 'iconkehuguanli',
+			orderNum: 2,
+			router: '/goods/list',
+			viewPath: 'views/goods/goods-list.vue',
+			keepAlive: 1
+		},
+		// ========================================================
+		{
+			id: '12',
+			parentId: '8',
+			name: '新增',
+			type: 2,
+			icon: null,
+			orderNum: 1,
+			router: null,
+			viewPath: null,
+			keepAlive: 0
+		},
+		{
+			id: '203',
 			parentId: '27',
-			name: '图库管理',
+			name: '商品列表',
 			type: 1,
 			icon: 'icon-user',
 			orderNum: 1,
-			router: '/goods/img-store',
-			viewPath: 'views/goods/img-store.vue',
+			router: '/goods/list',
+			viewPath: 'views/goods/goods-list.vue',
 			keepAlive: 1
 		},
 		{
@@ -347,7 +468,7 @@ let menu = {
 			keepAlive: 1
 		},
 		{
-			id: '2',
+			id: '11',
 			parentId: null,
 			name: '系统',
 			type: 0,
@@ -403,7 +524,7 @@ let menu = {
 		},
 		{
 			id: '28',
-			parentId: '2',
+			parentId: '10',
 			name: '系统监控',
 			type: 0,
 			icon: 'icon-monitor',
@@ -535,7 +656,7 @@ let menu = {
 		},
 		{
 			id: '51',
-			parentId: '2',
+			parentId: '10',
 			name: '测试404页面',
 			type: 1,
 			icon: 'icon-newfill',

+ 96 - 237
admin-code/src/pages/layout/slider/index.vue

@@ -1,275 +1,134 @@
 <template>
 	<div class="scope-slider">
-		<div class="logo">
-			<a href="javascript:;">
-				<!-- <icon-svg class="lr" name="logo-lr" v-if="!menuCollapse"></icon-svg> -->
-				<!-- <icon-svg class="z" name="logo" v-else></icon-svg> -->
-				<h3>国兰花尚</h3>
-			</a>
+		<!-- 主菜单 -->
+		<div class="main-list">
+			<div
+				class="list"
+				:class="[mainIndex == index ? 'active' : '']"
+				v-for="(item, index) in menuGroup"
+				:key="index"
+				@click="pageMianTo(item, index)"
+			>
+				<i class="iconfont" :class="[item.icon]"></i>
+				<div class="list-name">{{ item.name }}</div>
+				<i v-if="!$util.isEmpty(item)" class="iconfont icontriangle-right"></i>
+			</div>
 		</div>
-
-		<!-- <div class="user" v-if="userInfo && !menuCollapse">
-			<img :src="userInfo.headImg | default_avatar" alt="" class="avatar" />
-
-			<div class="det">
-				<p class="name">{{ userInfo.name }}</p>
-				<p class="post">{{ userInfo.nickName | default_name }}</p>
+		<!-- 子菜单 -->
+		<div class="sub-list" v-show="!$util.isEmpty(subData)">
+			<div
+				class="list"
+				v-for="(item, index) in subData"
+				:key="index"
+				:class="[subIndex == index ? 'active' : '']"
+				@click="pageSubTo(item, index)"
+			>
+				{{ item.name }}
 			</div>
-		</div> -->
-
-		<div class="menu" v-if="visible">
-			<deep-menu></deep-menu>
 		</div>
 	</div>
 </template>
 
 <script>
 import { mapGetters, mapMutations } from 'vuex';
-import { setTimeout } from 'timers';
-
 export default {
+	name: 'scope-slide',
 	data() {
 		return {
-			visible: true
+			mainIndex: 0,
+			subIndex: 0
 		};
 	},
-
 	computed: {
-		...mapGetters(['menuGroup', 'menuCollapse', 'userInfo'])
-	},
-
-	watch: {
-		menuGroup() {
-			this.visible = false;
-
-			setTimeout(() => {
-				this.visible = true;
-			}, 0);
-		}
-	},
-
-	components: {
-		DeepMenu: {
-			computed: {
-				// ...mapGetters(['menuGroup', 'menuCollapse', 'menuBg'])
-				...mapGetters(['menuGroup', 'menuBg'])
-			},
-
-			methods: {
-				toView(url) {
-					if (url != this.$route.path) {
-						this.$router.push(url);
-					}
-				}
-			},
-
-			render() {
-				const fn = list => {
-					return list.map(e => {
-						let html = null;
-
-						if (e.type == 0) {
-							html = (
-								<el-submenu index={String(e.id)} key={e.id}>
-									<template slot="title">
-										<icon-svg name={e.icon}></icon-svg>
-										<span slot="title">{e.name}</span>
-									</template>
-									{fn(e.children)}
-								</el-submenu>
-							);
-						} else {
-							html = (
-								<el-menu-item index={e.path} key={e.path}>
-									<icon-svg name={e.icon}></icon-svg>
-									<span slot="title">{e.name}</span>
-								</el-menu-item>
-							);
-						}
-
-						return html;
-					});
-				};
-
-				let el = fn(this.menuGroup);
-
-				return (
-					<el-menu
-						default-active={this.$route.path}
-						collapse-transition={false}
-						collapse={this.menuCollapse}
-						on-select={this.toView}>
-						{el}
-					</el-menu>
-				);
+		...mapGetters(['menuGroup']),
+		subData() {
+			console.log('children', this.menuGroup[this.mainIndex]);
+			let arr = this.menuGroup[this.mainIndex].children;
+			if (this.$util.isEmpty(arr)) {
+				return [];
 			}
+			return arr;
 		}
 	},
-
+	mounted() {
+		console.log('menuGroup', this.menuGroup);
+	},
 	methods: {
-		...mapMutations(['COLLAPSE_MENU'])
+		pageMianTo(item, index) {
+			this.mainIndex = index;
+			if (this.$util.isEmpty(item.children)) {
+				this.$router.push(item.path);
+			} else {
+				this.subIndex = 0;
+			}
+		},
+		pageSubTo(item, index) {
+			this.subIndex = index;
+			this.$router.push(item.path);
+		}
 	}
 };
 </script>
 
-<style lang="stylus" scoped>
-@import '../../../assets/css/theme.styl';
-
+<style lang="scss" scoped>
 .scope-slider {
+	width: 100%;
 	height: 100%;
-	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
-
-	.logo {
-		height: 50px;
-		display: flex;
-		align-items: center;
-		justify-content: center;
-		letter-spacing: 1px;
-
-		p {
-			background: linear-gradient(120deg, $color, $color2);
-			-webkit-background-clip: text;
-			-webkit-text-fill-color: transparent;
-			font-size: 20px;
-		}
-
-		.lr {
-			height: 45px;
-			width: 180px;
-		}
-
-		.z {
-			height: 30px;
-			width: 30px;
-		}
-	}
-
-	.user {
-		display: flex;
-		height: 40px;
-		position: relative;
-		margin: 20px 20px 30px 25px;
-
-		.avatar {
-			height: 40px;
-			width: 40px;
-			border-radius: 40px;
-			background-color: #eee;
-		}
-
-		.det {
-			margin-left: 15px;
-		}
-
-		p {
-			font-size: 13px;
-			line-height: 20px;
-			margin-bottom: 3px;
-
-			&.post {
-				font-size: 12px;
-				color: #c2c2c2;
-			}
-		}
-
-		.collapse {
-			position: absolute;
-			right: 10px;
-			top: 10px;
+	@include disFlex(flex-start, flex-start);
+	.main-list {
+		height: 100%;
+		width: 130px;
+		background-color: #3d3f42;
+		box-shadow: 6px 6px 20px #ccc;
+		.list {
+			@include disFlex(center, flex-start);
+			padding-left: 10px;
+			padding-top: 16px;
+			padding-bottom: 16px;
+			color: #fff;
+			font-size: 14px;
 			cursor: pointer;
-			font-size: 18px;
-
-			&:hover {
-				color: $color;
-			}
-		}
-	}
-
-	.menu {
-		overflow-y: auto;
-		// height: calc(100% - 150px);
-		height: calc(100% - 50px);
-
-		&::-webkit-scrollbar {
-			width: 0;
-			height: 0;
-		}
-
-		&::-webkit-scrollbar-thumb {
-			background: linear-gradient(to bottom, $color2, $color);
-		}
-
-		&::-webkit-scrollbar-track {
-			background: #ccc;
-		}
-
-		.el-menu {
-			border-right: 0;
-			animation-duration: 0.3s;
-			animation-fill-mode: both;
-			animation-name: fadeInLeft;
-
-			@keyframes fadeInLeft {
-				from {
-					opacity: 0;
-					transform: translate3d(-100%, 0, 0);
-				}
-
-				to {
-					opacity: 1;
-					transform: translate3d(0, 0, 0);
-				}
+			.list-name {
+				margin-left: 10px;
+				margin-right: 16px;
 			}
-
-			>>>.el-menu-item, >>>.el-submenu__title {
-				color: #000;
-				letter-spacing: 0.5px;
-
-				.icon-svg {
-					height: 17px;
-					width: 17px;
-					margin: 0 15px 0 5px;
-					position: relative;
-					top: 1px;
-				}
-
-				span {
-					font-size: 13px;
-					display: inline-block;
-				}
+			.iconfont {
+				color: #a1aab5;
+				font-size: 14px;
 			}
-
-			&.el-menu--collapse {
-				>>>.el-submenu__title {
-					.icon-svg {
-						margin-left: 2px;
-						height: 19px;
-						width: 19px;
-					}
+			&.active {
+				color: $mainColor;
+				background-color: #fff;
+				.iconfont {
+					color: $mainColor;
 				}
 			}
-
-			>>>.el-menu-item {
-				&.is-active {
-					color: $color2;
-					background-color: #E5F1FB;
+			&:hover {
+				color: $mainColor;
+				background-color: #fff;
+				.iconfont {
+					color: $mainColor;
 				}
 			}
 		}
 	}
-}
-</style>
-
-<style lang="stylus">
-.el-menu--popup-right-start {
-	.el-menu-item {
-		display: flex;
-		align-items: center;
-
-		.icon-svg {
-			height: 18px;
-			width: 18px;
-			margin: 0 15px 0 5px;
+	.sub-list {
+		width: calc(100% - 126px);
+		background-color: #fff;
+		.list {
+			height: 40px;
+			line-height: 40px;
+			padding-left: 10px;
+			font-size: 14px;
+			color: $fontColor2;
+			&.active {
+				color: $mainColor;
+				background-color: #f0f2f6;
+			}
+			&:hover {
+				color: $mainColor;
+				background-color: #f0f2f6;
+			}
 		}
 	}
 }

+ 276 - 0
admin-code/src/pages/layout/slider/index111.vue

@@ -0,0 +1,276 @@
+<template>
+	<div class="scope-slider">
+		<div class="logo">
+			<a href="javascript:;">
+				<!-- <icon-svg class="lr" name="logo-lr" v-if="!menuCollapse"></icon-svg> -->
+				<!-- <icon-svg class="z" name="logo" v-else></icon-svg> -->
+				<h3>国兰花尚</h3>
+			</a>
+		</div>
+
+		<!-- <div class="user" v-if="userInfo && !menuCollapse">
+			<img :src="userInfo.headImg | default_avatar" alt="" class="avatar" />
+
+			<div class="det">
+				<p class="name">{{ userInfo.name }}</p>
+				<p class="post">{{ userInfo.nickName | default_name }}</p>
+			</div>
+		</div> -->
+
+		<div class="menu" v-if="visible">
+			<deep-menu></deep-menu>
+		</div>
+	</div>
+</template>
+
+<script>
+import { mapGetters, mapMutations } from 'vuex';
+import { setTimeout } from 'timers';
+
+export default {
+	data() {
+		return {
+			visible: true
+		};
+	},
+
+	computed: {
+		...mapGetters(['menuGroup', 'menuCollapse', 'userInfo'])
+	},
+
+	watch: {
+		menuGroup() {
+			this.visible = false;
+
+			setTimeout(() => {
+				this.visible = true;
+			}, 0);
+		}
+	},
+
+	components: {
+		DeepMenu: {
+			computed: {
+				// ...mapGetters(['menuGroup', 'menuCollapse', 'menuBg'])
+				...mapGetters(['menuGroup', 'menuBg'])
+			},
+
+			methods: {
+				toView(url) {
+					if (url != this.$route.path) {
+						this.$router.push(url);
+					}
+				}
+			},
+
+			render() {
+				const fn = list => {
+					return list.map(e => {
+						let html = null;
+
+						if (e.type == 0) {
+							html = (
+								<el-submenu index={String(e.id)} key={e.id}>
+									<template slot="title">
+										<icon-svg name={e.icon}></icon-svg>
+										<span slot="title">{e.name}</span>
+									</template>
+									{fn(e.children)}
+								</el-submenu>
+							);
+						} else {
+							html = (
+								<el-menu-item index={e.path} key={e.path}>
+									<icon-svg name={e.icon}></icon-svg>
+									<span slot="title">{e.name}</span>
+								</el-menu-item>
+							);
+						}
+
+						return html;
+					});
+				};
+
+				let el = fn(this.menuGroup);
+
+				return (
+					<el-menu
+						default-active={this.$route.path}
+						collapse-transition={false}
+						collapse={this.menuCollapse}
+						on-select={this.toView}>
+						{el}
+					</el-menu>
+				);
+			}
+		}
+	},
+
+	methods: {
+		...mapMutations(['COLLAPSE_MENU'])
+	}
+};
+</script>
+
+<style lang="stylus" scoped>
+@import '../../../assets/css/theme.styl';
+
+.scope-slider {
+	height: 100%;
+	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
+
+	.logo {
+		height: 50px;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		letter-spacing: 1px;
+
+		p {
+			background: linear-gradient(120deg, $color, $color2);
+			-webkit-background-clip: text;
+			-webkit-text-fill-color: transparent;
+			font-size: 20px;
+		}
+
+		.lr {
+			height: 45px;
+			width: 180px;
+		}
+
+		.z {
+			height: 30px;
+			width: 30px;
+		}
+	}
+
+	.user {
+		display: flex;
+		height: 40px;
+		position: relative;
+		margin: 20px 20px 30px 25px;
+
+		.avatar {
+			height: 40px;
+			width: 40px;
+			border-radius: 40px;
+			background-color: #eee;
+		}
+
+		.det {
+			margin-left: 15px;
+		}
+
+		p {
+			font-size: 13px;
+			line-height: 20px;
+			margin-bottom: 3px;
+
+			&.post {
+				font-size: 12px;
+				color: #c2c2c2;
+			}
+		}
+
+		.collapse {
+			position: absolute;
+			right: 10px;
+			top: 10px;
+			cursor: pointer;
+			font-size: 18px;
+
+			&:hover {
+				color: $color;
+			}
+		}
+	}
+
+	.menu {
+		overflow-y: auto;
+		// height: calc(100% - 150px);
+		height: calc(100% - 50px);
+
+		&::-webkit-scrollbar {
+			width: 0;
+			height: 0;
+		}
+
+		&::-webkit-scrollbar-thumb {
+			background: linear-gradient(to bottom, $color2, $color);
+		}
+
+		&::-webkit-scrollbar-track {
+			background: #ccc;
+		}
+
+		.el-menu {
+			border-right: 0;
+			animation-duration: 0.3s;
+			animation-fill-mode: both;
+			animation-name: fadeInLeft;
+
+			@keyframes fadeInLeft {
+				from {
+					opacity: 0;
+					transform: translate3d(-100%, 0, 0);
+				}
+
+				to {
+					opacity: 1;
+					transform: translate3d(0, 0, 0);
+				}
+			}
+
+			>>>.el-menu-item, >>>.el-submenu__title {
+				color: #000;
+				letter-spacing: 0.5px;
+
+				.icon-svg {
+					height: 17px;
+					width: 17px;
+					margin: 0 15px 0 5px;
+					position: relative;
+					top: 1px;
+				}
+
+				span {
+					font-size: 13px;
+					display: inline-block;
+				}
+			}
+
+			&.el-menu--collapse {
+				>>>.el-submenu__title {
+					.icon-svg {
+						margin-left: 2px;
+						height: 19px;
+						width: 19px;
+					}
+				}
+			}
+
+			>>>.el-menu-item {
+				&.is-active {
+					color: $color2;
+					background-color: #E5F1FB;
+				}
+			}
+		}
+	}
+}
+</style>
+
+<style lang="stylus">
+.el-menu--popup-right-start {
+	.el-menu-item {
+		display: flex;
+		align-items: center;
+
+		.icon-svg {
+			height: 18px;
+			width: 18px;
+			margin: 0 15px 0 5px;
+		}
+	}
+}
+</style>

+ 1 - 1
admin-code/src/pages/layout/topbar/index.vue

@@ -2,7 +2,7 @@
 	<div class="scope-topbar">
 		<div class="collapse">
 			<img class="avatar" :src="userInfo.headImg | default_avatar" alt="" />
-			<div>国兰花尚后台业务管理系统</div>
+			<div>后台业务管理系统</div>
 			<!-- <icon-svg name="icon-menu"></icon-svg> -->
 		</div>
 

+ 138 - 0
admin-code/src/utils/util.js

@@ -0,0 +1,138 @@
+// 是否为空
+const isEmpty = val => {
+	if (val instanceof Array) {
+		if (val.length === 0) return true;
+	} else if (val instanceof Object) {
+		if (!Object.keys(val).length) return true;
+	} else {
+		if (
+			val === 'null' ||
+			val === null ||
+			val === 'undefined' ||
+			val === undefined ||
+			val === ''
+		)
+			return true;
+		return false;
+	}
+	return false;
+};
+
+// 是否为数组
+const isArray = arr => {
+	return typeof arr == 'object' && arr.constructor == Array;
+};
+
+// 是否为字符串
+const isString = str => {
+	return typeof str == 'string' && str.constructor == String;
+};
+
+// 是否为对象
+const isObject = obj => {
+	return typeof obj == 'object' && obj.constructor == Object;
+};
+
+// 是否为数字
+const isNumber = num => {
+	return typeof num == 'number' && num.constructor == Number;
+};
+
+// 是否为日期类型
+const isDate = date => {
+	return typeof date == 'object' && date.constructor == Date;
+};
+
+// 是否为函数
+const isFunction = obj => {
+	return typeof obj == 'object' && obj.constructor == Function;
+};
+
+/** *
+ * 对象参数转为url参数
+ * @parmas query 拼接得参数对象
+ * @parmas isFrist 为true时开头为&
+ */
+export const parse = (query, isFrist = false) => {
+	let str = Object.keys(query)
+		.filter(key => !isEmpty(query[key]))
+		.reduce((result, key) => {
+			const value = query[key];
+			// in查询特殊处理
+			if (Array.isArray(value) && !isEmpty(value)) {
+				return `${result}&${value.reduce(
+					(val, cVal) => `${val ? `${val}&` : val}${key}=${cVal}`,
+					''
+				)}`;
+			}
+
+			// between查询做特殊处理
+			if (typeof value === 'object' && !isEmpty(value)) {
+				const [start, end] = value;
+				return `${result}&${key}[]=${start}&${key}[]=${end}`;
+			}
+
+			return `${result}&${key}=${value}`;
+		}, '');
+	return isFrist ? str : str.replace(/^&/, '?');
+};
+
+const $checkName = str => {
+	return /^[\u4E00-\u9FA5A-Za-z\s]+(·[\u4E00-\u9FA5A-Za-z]+)*$/.test(str);
+};
+
+/** *
+ * 全局时间转换
+ * @parmas num 时间戳默认为11位时间戳
+ * @parmas fmt 默认转换的时间格式
+ * @parmas all 为true时time为13位时间戳
+ */
+export const $formatDate = (num, fmt = 'YYYY-MM-DD HH:mm', all) => {
+	num = all ? num : num * 1000;
+	let date = new Date();
+	date.setTime(num);
+	let o = {
+		'M+': date.getMonth() + 1,
+		'D+': date.getDate(),
+		'h+': date.getHours() % 12 === 0 ? 12 : date.getHours() % 12,
+		'H+': date.getHours(),
+		'm+': date.getMinutes(),
+		's+': date.getSeconds(),
+		'q+': Math.floor((date.getMonth() + 3) / 3),
+		S: date.getMilliseconds()
+	};
+	let week = {
+		'0': '\u65e5',
+		'1': '\u4e00',
+		'2': '\u4e8c',
+		'3': '\u4e09',
+		'4': '\u56db',
+		'5': '\u4e94',
+		'6': '\u516d'
+	};
+	if (/(Y+)/.test(fmt)) {
+		fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
+	}
+	if (/(E+)/.test(fmt)) {
+		fmt = fmt.replace(
+			RegExp.$1,
+			(RegExp.$1.length > 1 ? (RegExp.$1.length > 2 ? '\u661f\u671f' : '\u5468') : '') +
+				week[date.getDay() + '']
+		);
+	}
+	for (let k in o) {
+		if (new RegExp('(' + k + ')').test(fmt)) {
+			fmt = fmt.replace(
+				RegExp.$1,
+				RegExp.$1.length === 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)
+			);
+		}
+	}
+	return fmt;
+};
+export default {
+	isEmpty,
+	parse,
+	$checkName,
+	$formatDate
+};