Commit e04b5ad1 authored by WangXu's avatar WangXu

删除没用的文件

删除console
parent 255f6b5b
...@@ -33,43 +33,18 @@ ...@@ -33,43 +33,18 @@
}; };
}, },
methods: { methods: {
// getUserInfoFromServer() {
// const userCode = GetQueryString('userCode');
// const corpId = GetQueryString('corpId');
// // const userId = GetQueryString('userId');
// this.$ls.set('corpId', corpId)
// // this.$ls.set('userId', userId)
// console.log(userCode, corpId);
// const data = {
// code: userCode
// };
// getToken(data).then((res) => {
// this.$ls.set('accessToken', res.data.access_token)
// })
// return sendUserCodeAndCorpId(data).then(res => {
// if (res.code === 'M0000') {
// const userId = res.data.corpUsers[0].id;
// this.$ls.set('userId', userId)
// alert(userId);
// } else {
// alert('获取失败');
// }
// });
// }
}, },
async beforeCreate() { async beforeCreate() {
// await this.getUserInfoFromServer(); // await this.getUserInfoFromServer();
const userCode = GetQueryString("userCode") const userCode = GetQueryString("userCode")
const corpId = GetQueryString("corpId") const corpId = GetQueryString("corpId")
this.$ls.set('corpId', corpId) this.$ls.set('corpId', corpId)
console.log(userCode, corpId);
const data = { const data = {
code: userCode code: userCode
} }
//获取 //获取
await new Promise((resolve, reject) => { await new Promise((resolve, reject) => {
axios.get('/api/oauth/getTokenByCode', { params: data, headers: { 'clientType': 'app' } }).then(res => { axios.get('/api/oauth/getTokenByCode', { params: data, headers: { 'clientType': 'app' } }).then(res => {
console.log('/api/oauth/getTokenByCode', res);
if (res.data.code === 'M0000') { if (res.data.code === 'M0000') {
this.$ls.set('accessToken', res.data.data.access_token) this.$ls.set('accessToken', res.data.data.access_token)
sendUserCodeAndCorpId(data).then(res => { sendUserCodeAndCorpId(data).then(res => {
......
...@@ -31,7 +31,6 @@ export default { ...@@ -31,7 +31,6 @@ export default {
}, },
methods: { methods: {
handleIconChange (icon) { handleIconChange (icon) {
console.log('change Icon', icon)
} }
} }
} }
......
...@@ -79,7 +79,6 @@ export default { ...@@ -79,7 +79,6 @@ export default {
const subItem = [h('span', { slot: 'title' }, [this.renderIcon(h, menu.meta.icon), h('span', [menu.meta.title])])] const subItem = [h('span', { slot: 'title' }, [this.renderIcon(h, menu.meta.icon), h('span', [menu.meta.title])])]
const itemArr = [] const itemArr = []
const pIndex_ = pIndex + '_' + index const pIndex_ = pIndex + '_' + index
console.log('menu', menu)
if (!menu.hideChildrenInMenu) { if (!menu.hideChildrenInMenu) {
menu.children.forEach(function (item, i) { menu.children.forEach(function (item, i) {
itemArr.push(this2_.renderItem(h, item, pIndex_, i)) itemArr.push(this2_.renderItem(h, item, pIndex_, i))
......
...@@ -249,10 +249,8 @@ export default { ...@@ -249,10 +249,8 @@ export default {
} }
}` }`
this.$copyText(text).then(message => { this.$copyText(text).then(message => {
console.log('copy', message)
this.$message.success('复制完毕') this.$message.success('复制完毕')
}).catch(err => { }).catch(err => {
console.log('copy.err', err)
this.$message.error('复制失败') this.$message.error('复制失败')
}) })
}, },
......
...@@ -59,7 +59,6 @@ ...@@ -59,7 +59,6 @@
methods: { methods: {
toggleInputType(e) { toggleInputType(e) {
this.isEdit = !this.isEdit this.isEdit = !this.isEdit
console.log('toggleInputType', e)
if (e.type === 'blur') { if (e.type === 'blur') {
this.$emit('blur') this.$emit('blur')
} }
...@@ -81,7 +80,6 @@ ...@@ -81,7 +80,6 @@
} }
}, },
mounted() { mounted() {
console.log('mt-show-input', this.$scopedSlots, this.$slots)
} }
} }
</script> </script>
......
...@@ -59,7 +59,6 @@ export default { ...@@ -59,7 +59,6 @@ export default {
this.stepLoading = true this.stepLoading = true
this.form.validateFields((err, values) => { this.form.validateFields((err, values) => {
if (!err) { if (!err) {
console.log('values', values)
setTimeout(() => { setTimeout(() => {
vm.stepLoading = false vm.stepLoading = false
vm.$emit('success', { values }) vm.$emit('success', { values })
......
// eslint-disable-next-line // eslint-disable-next-line
import { UserLayout, BasicLayout, BasicLayoutWithoutTopnav, RouteView, BlankLayout, PageView } from '@/layouts' import { BasicLayoutWithoutTopnav } from '@/layouts'
import { bxAnaalyse } from '@/core/icons'
export const asyncRouterMap = [ export const asyncRouterMap = [
...@@ -59,51 +58,5 @@ export const asyncRouterMap = [ ...@@ -59,51 +58,5 @@ export const asyncRouterMap = [
* @type { *[] } * @type { *[] }
*/ */
export const constantRouterMap = [ export const constantRouterMap = [
{
path: '/user',
component: UserLayout,
redirect: '/user/login',
hidden: true,
children: [
{
path: 'login',
name: 'login',
component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
},
{
path: 'register',
name: 'register',
component: () => import(/* webpackChunkName: "user" */ '@/views/user/Register')
},
{
path: 'register-result',
name: 'registerResult',
component: () => import(/* webpackChunkName: "user" */ '@/views/user/RegisterResult')
}
]
},
{
path: '/test',
component: BlankLayout,
redirect: '/test/home',
children: [
{
path: 'home',
name: 'TestHome',
component: () => import('@/views/Home')
},
{
path: 'test',
name: 'test',
component: () => import('@/views/testComponents')
}
]
},
{
path: '/404',
component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
}
] ]
This diff is collapsed.
...@@ -26,7 +26,7 @@ export default function Initializer () { ...@@ -26,7 +26,7 @@ export default function Initializer () {
store.commit('TOGGLE_WEAK', Vue.ls.get(DEFAULT_COLOR_WEAK, config.colorWeak)) store.commit('TOGGLE_WEAK', Vue.ls.get(DEFAULT_COLOR_WEAK, config.colorWeak))
store.commit('TOGGLE_COLOR', Vue.ls.get(DEFAULT_COLOR, config.primaryColor)) store.commit('TOGGLE_COLOR', Vue.ls.get(DEFAULT_COLOR, config.primaryColor))
store.commit('TOGGLE_MULTI_TAB', Vue.ls.get(DEFAULT_MULTI_TAB, config.multiTab)) store.commit('TOGGLE_MULTI_TAB', Vue.ls.get(DEFAULT_MULTI_TAB, config.multiTab))
store.commit('SET_TOKEN', Vue.ls.get(ACCESS_TOKEN)) // store.commit('SET_TOKEN', Vue.ls.get(ACCESS_TOKEN))
// last step // last step
} }
...@@ -10,7 +10,6 @@ import 'ant-design-vue/dist/antd.less' ...@@ -10,7 +10,6 @@ import 'ant-design-vue/dist/antd.less'
// ext library // ext library
import VueClipboard from 'vue-clipboard2' import VueClipboard from 'vue-clipboard2'
import PermissionHelper from '@/utils/helper/permission'
// import '@/components/use' // import '@/components/use'
import './directives/action' import './directives/action'
...@@ -24,5 +23,4 @@ Vue.use(Viser) ...@@ -24,5 +23,4 @@ Vue.use(Viser)
Vue.use(VueStorage, config.storageOptions) Vue.use(VueStorage, config.storageOptions)
Vue.use(VueClipboard) Vue.use(VueClipboard)
Vue.use(PermissionHelper)
Vue.use(VueCropper) Vue.use(VueCropper)
<template>
<a-layout :class="['layout', device]">
<!-- SideMenu -->
<a-drawer
v-if="isMobile()"
placement="left"
:wrapClassName="`drawer-sider ${navTheme}`"
:closable="false"
:visible="collapsed"
@close="drawerClose"
>
<side-menu
mode="inline"
:menus="menus"
:theme="navTheme"
:collapsed="false"
:collapsible="true"
@menuSelect="menuSelect"
></side-menu>
</a-drawer>
<side-menu
v-else-if="isSideMenu()"
mode="inline"
:menus="menus"
:theme="navTheme"
:collapsed="collapsed"
:collapsible="true"
></side-menu>
<a-layout :class="[layoutMode, `content-width-${contentWidth}`]" :style="{ paddingLeft: contentPaddingLeft, minHeight: '100vh' }">
<!-- layout header -->
<global-header
:mode="layoutMode"
:menus="menus"
:theme="navTheme"
:collapsed="collapsed"
:device="device"
@toggle="toggle"
/>
<!-- layout content -->
<a-layout-content :style="{ height: '100%', margin: multiTab ? '24px 24px 0' : '24px 24px 0', paddingTop: fixedHeader ? '64px' : '0' }">
<multi-tab v-if="multiTab"></multi-tab>
<transition name="page-transition">
<route-view />
</transition>
</a-layout-content>
<!-- layout footer -->
<a-layout-footer>
<global-footer />
</a-layout-footer>
<!-- Setting Drawer (show in development mode) -->
<setting-drawer v-if="!production"></setting-drawer>
</a-layout>
</a-layout>
</template>
<script>
import { triggerWindowResizeEvent } from '@/utils/util'
import { mapState, mapActions } from 'vuex'
import { mixin, mixinDevice } from '@/utils/mixin'
import config from '@/config/defaultSettings'
import RouteView from './RouteView'
import MultiTab from '@/components/MultiTab'
import SideMenu from '@/components/Menu/SideMenu'
import GlobalHeader from '@/components/GlobalHeader'
import GlobalFooter from '@/components/GlobalFooter'
import SettingDrawer from '@/components/SettingDrawer'
export default {
name: 'BasicLayout',
mixins: [mixin, mixinDevice],
components: {
RouteView,
MultiTab,
SideMenu,
GlobalHeader,
GlobalFooter,
SettingDrawer
},
data () {
return {
production: config.production,
collapsed: false,
menus: []
}
},
computed: {
...mapState({
// 动态主路由
mainMenu: state => state.permission.addRouters
}),
contentPaddingLeft () {
if (!this.fixSidebar || this.isMobile()) {
return '0'
}
if (this.sidebarOpened) {
return '256px'
}
return '80px'
}
},
watch: {
sidebarOpened (val) {
this.collapsed = !val
}
},
created () {
this.menus = this.mainMenu.find(item => item.path === '/').children
this.collapsed = !this.sidebarOpened
},
mounted () {
const userAgent = navigator.userAgent
if (userAgent.indexOf('Edge') > -1) {
this.$nextTick(() => {
this.collapsed = !this.collapsed
setTimeout(() => {
this.collapsed = !this.collapsed
}, 16)
})
}
},
methods: {
...mapActions(['setSidebar']),
toggle () {
this.collapsed = !this.collapsed
this.setSidebar(!this.collapsed)
triggerWindowResizeEvent()
},
paddingCalc () {
let left = ''
if (this.sidebarOpened) {
left = this.isDesktop() ? '256px' : '80px'
} else {
left = (this.isMobile() && '0') || ((this.fixSidebar && '80px') || '0')
}
return left
},
menuSelect () {
if (!this.isDesktop()) {
this.collapsed = false
}
},
drawerClose () {
this.collapsed = false
}
}
}
</script>
<style lang="less">
@import url('../components/global.less');
/*
* The following styles are auto-applied to elements with
* transition="page-transition" when their visibility is toggled
* by Vue.js.
*
* You can easily play with the page transition by editing
* these styles.
*/
.page-transition-enter {
opacity: 0;
}
.page-transition-leave-active {
opacity: 0;
}
.page-transition-enter .page-transition-container,
.page-transition-leave-active .page-transition-container {
-webkit-transform: scale(1.1);
transform: scale(1.1);
}
</style>
<template>
<div>
<router-view />
</div>
</template>
<script>
export default {
name: 'BlankLayout'
}
</script>
<style scoped>
</style>
...@@ -72,7 +72,6 @@ ...@@ -72,7 +72,6 @@
} }
}) })
.catch(err => { .catch(err => {
console.log('校验失败!!!!', err)
this.showErrorModal(err) this.showErrorModal(err)
}) })
}) })
......
<template>
<div id="userLayout" :class="['user-layout-wrapper', device]">
<div class="container">
<div class="top">
<div class="header">
<a href="/">
<img src="~@/assets/logo.svg" class="logo" alt="logo">
<span class="title">Ant Design</span>
</a>
</div>
<div class="desc">
Ant Design 是西湖区最具影响力的 Web 设计规范
</div>
</div>
<route-view></route-view>
<div class="footer">
<div class="links">
<a href="_self">帮助</a>
<a href="_self">隐私</a>
<a href="_self">条款</a>
</div>
<div class="copyright">
Copyright &copy; 2018 白鹭学园技术组出品
</div>
</div>
</div>
</div>
</template>
<script>
import RouteView from './RouteView'
import { mixinDevice } from '@/utils/mixin'
export default {
name: 'UserLayout',
components: { RouteView },
mixins: [mixinDevice],
data () {
return {}
},
mounted () {
document.body.classList.add('userLayout')
},
beforeDestroy () {
document.body.classList.remove('userLayout')
}
}
</script>
<style lang="less" scoped>
#userLayout.user-layout-wrapper {
height: 100%;
&.mobile {
.container {
.main {
max-width: 368px;
width: 98%;
}
}
}
.container {
width: 100%;
min-height: 100%;
background: #f0f2f5 url(~@/assets/background.svg) no-repeat 50%;
background-size: 100%;
padding: 110px 0 144px;
position: relative;
a {
text-decoration: none;
}
.top {
text-align: center;
.header {
height: 44px;
line-height: 44px;
.badge {
position: absolute;
display: inline-block;
line-height: 1;
vertical-align: middle;
margin-left: -12px;
margin-top: -10px;
opacity: 0.8;
}
.logo {
height: 44px;
vertical-align: top;
margin-right: 16px;
border-style: none;
}
.title {
font-size: 33px;
color: rgba(0, 0, 0, .85);
font-family: Avenir, 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-weight: 600;
position: relative;
top: 2px;
}
}
.desc {
font-size: 14px;
color: rgba(0, 0, 0, 0.45);
margin-top: 12px;
margin-bottom: 40px;
}
}
.main {
min-width: 260px;
width: 368px;
margin: 0 auto;
}
.footer {
position: absolute;
width: 100%;
bottom: 0;
padding: 0 16px;
margin: 48px 0 24px;
text-align: center;
.links {
margin-bottom: 8px;
font-size: 14px;
a {
color: rgba(0, 0, 0, 0.45);
transition: all 0.3s;
&:not(:last-child) {
margin-right: 40px;
}
}
}
.copyright {
color: rgba(0, 0, 0, 0.45);
font-size: 14px;
}
}
}
}
</style>
import UserLayout from './UserLayout'
import BlankLayout from './BlankLayout'
import BasicLayout from './BasicLayout'
import RouteView from './RouteView' import RouteView from './RouteView'
import TaskDesignView from './TaskDesignView' import TaskDesignView from './TaskDesignView'
import PageView from './PageView' import PageView from './PageView'
import BasicLayoutWithoutTopnav from './BasicLayoutWithoutTopnav' import BasicLayoutWithoutTopnav from './BasicLayoutWithoutTopnav'
export { UserLayout, BasicLayout, BlankLayout, RouteView, PageView, BasicLayoutWithoutTopnav, TaskDesignView } export { RouteView, PageView, BasicLayoutWithoutTopnav, TaskDesignView }
import Mock from 'mockjs2'
// 判断环境不是 prod 或者 preview 是 true 时,加载 mock 服务
if (process.env.NODE_ENV !== 'production' || process.env.VUE_APP_PREVIEW === 'true') {
// 使用同步加载依赖
// 防止 vuex 中的 GetInfo 早于 mock 运行,导致无法 mock 请求返回结果
console.log('mock mounting')
// require('./services/auth')
// require('./services/user')
// require('./services/manage')
// require('./services/other')
// require('./services/tagCloud')
// require('./services/article')
require('./services/test')
Mock.setup({
timeout: 800 // setter delay time
})
console.log('mock mounted')
}
import Mock from 'mockjs2'
import { builder, getQueryParameters } from '../util'
const titles = [
'Alipay',
'Angular',
'Ant Design',
'Ant Design Pro',
'Bootstrap',
'React',
'Vue',
'Webpack'
]
const avatar = ['https://gw.alipayobjects.com/zos/rmsportal/WdGqmHpayyMjiEhcKoVE.png',
'https://gw.alipayobjects.com/zos/rmsportal/zOsKZmFRdUtvpqCImOVY.png',
'https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png',
'https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png',
'https://gw.alipayobjects.com/zos/rmsportal/siCrBXXhmvTQGWPNLBow.png'
]
const covers = [
'https://gw.alipayobjects.com/zos/rmsportal/uMfMFlvUuceEyPpotzlq.png',
'https://gw.alipayobjects.com/zos/rmsportal/iZBVOIhGJiAnhplqjvZW.png',
'https://gw.alipayobjects.com/zos/rmsportal/iXjVmWVHbCJAyqvDxdtx.png',
'https://gw.alipayobjects.com/zos/rmsportal/gLaIAoVWTtLbBWZNYEMg.png'
]
const owner = [
'付小小',
'吴加好',
'周星星',
'林东东',
'曲丽丽'
]
const content = '段落示意:蚂蚁金服设计平台 ant.design,用最小的工作量,无缝接入蚂蚁金服生态,提供跨越设计与开发的体验解决方案。蚂蚁金服设计平台 ant.design,用最小的工作量,无缝接入蚂蚁金服生态,提供跨越设计与开发的体验解决方案。'
const description = '在中台产品的研发过程中,会出现不同的设计规范和实现方式,但其中往往存在很多类似的页面和组件,这些类似的组件会被抽离成一套标准规范。'
const href = 'https://ant.design'
const article = (options) => {
const queryParameters = getQueryParameters(options)
console.log('queryParameters', queryParameters)
if (queryParameters && !queryParameters.count) {
queryParameters.count = 5
}
const data = []
for (let i = 0; i < queryParameters.count; i++) {
const tmpKey = i + 1
const num = parseInt(Math.random() * (4 + 1), 10)
data.push({
id: tmpKey,
avatar: avatar[num],
owner: owner[num],
content: content,
star: Mock.mock('@integer(1, 999)'),
percent: Mock.mock('@integer(1, 999)'),
like: Mock.mock('@integer(1, 999)'),
message: Mock.mock('@integer(1, 999)'),
description: description,
href: href,
title: titles[ i % 8 ],
updatedAt: Mock.mock('@datetime'),
members: [
{
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ZiESqWwCXBRQoaPONSJe.png',
name: '曲丽丽',
id: 'member1'
},
{
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/tBOxZPlITHqwlGjsJWaF.png',
name: '王昭君',
id: 'member2'
},
{
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/sBxjgqiuHMGRkIjqlQCd.png',
name: '董娜娜',
id: 'member3'
}
],
activeUser: Math.ceil(Math.random() * 100000) + 100000,
newUser: Math.ceil(Math.random() * 1000) + 1000,
cover: parseInt(i / 4, 10) % 2 === 0 ? covers[i % 4] : covers[3 - (i % 4)]
})
}
return builder(data)
}
Mock.mock(/\/list\/article/, 'get', article)
import Mock from 'mockjs2'
import { builder, getBody } from '../util'
const username = ['admin', 'user', 'super']
const password = ['21232f297a57a5a743894a0e4a801fc3', '8914de686ab28dc22f30d3d8e107ff6c'] // admin, ant.design
const login = (options) => {
const body = getBody(options)
console.log('mock: body', body)
if (!username.includes(body.username) || !password.includes(body.password)) {
return builder({ isLogin: true }, '账户或密码错误', 401)
}
return builder({
'id': Mock.mock('@guid'),
'name': Mock.mock('@name'),
'username': 'admin',
'password': '',
'avatar': 'https://gw.alipayobjects.com/zos/rmsportal/jZUIxmJycoymBprLOUbT.png',
'status': 1,
'telephone': '',
'lastLoginIp': '27.154.74.117',
'lastLoginTime': 1534837621348,
'creatorId': 'admin',
'createTime': 1497160610259,
'deleted': 0,
'roleId': 'admin',
'lang': 'zh-CN',
'token': '4291d7da9005377ec9aec4a71ea837f'
}, '', 200, { 'Custom-Header': Mock.mock('@guid') })
}
const logout = () => {
return builder({}, '[测试接口] 注销成功')
}
const smsCaptcha = () => {
return builder({ captcha: Mock.mock('@integer(10000, 99999)') })
}
const twofactor = () => {
return builder({ stepCode: Mock.mock('@integer(0, 1)') })
}
Mock.mock(/\/auth\/login/, 'post', login)
Mock.mock(/\/auth\/logout/, 'post', logout)
Mock.mock(/\/account\/sms/, 'post', smsCaptcha)
Mock.mock(/\/auth\/2step-code/, 'post', twofactor)
import Mock from 'mockjs2'
import { builder, getQueryParameters } from '../util'
const totalCount = 5701
const serverList = (options) => {
const parameters = getQueryParameters(options)
const result = []
const pageNo = parseInt(parameters.pageNo)
const pageSize = parseInt(parameters.pageSize)
const totalPage = Math.ceil(totalCount / pageSize)
const key = (pageNo - 1) * pageSize
const next = (pageNo >= totalPage ? (totalCount % pageSize) : pageSize) + 1
for (let i = 1; i < next; i++) {
const tmpKey = key + i
result.push({
key: tmpKey,
id: tmpKey,
no: 'No ' + tmpKey,
description: '这是一段描述',
callNo: Mock.mock('@integer(1, 999)'),
status: Mock.mock('@integer(0, 3)'),
updatedAt: Mock.mock('@datetime'),
editable: false
})
}
return builder({
pageSize: pageSize,
pageNo: pageNo,
totalCount: totalCount,
totalPage: totalPage,
data: result
})
}
const projects = () => {
return builder({
'data': [{
id: 1,
cover: 'https://gw.alipayobjects.com/zos/rmsportal/WdGqmHpayyMjiEhcKoVE.png',
title: 'Alipay',
description: '那是一种内在的东西, 他们到达不了,也无法触及的',
status: 1,
updatedAt: '2018-07-26 00:00:00'
},
{
id: 2,
cover: 'https://gw.alipayobjects.com/zos/rmsportal/zOsKZmFRdUtvpqCImOVY.png',
title: 'Angular',
description: '希望是一个好东西,也许是最好的,好东西是不会消亡的',
status: 1,
updatedAt: '2018-07-26 00:00:00'
},
{
id: 3,
cover: 'https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png',
title: 'Ant Design',
description: '城镇中有那么多的酒馆,她却偏偏走进了我的酒馆',
status: 1,
updatedAt: '2018-07-26 00:00:00'
},
{
id: 4,
cover: 'https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png',
title: 'Ant Design Pro',
description: '那时候我只会想自己想要什么,从不想自己拥有什么',
status: 1,
updatedAt: '2018-07-26 00:00:00'
},
{
id: 5,
cover: 'https://gw.alipayobjects.com/zos/rmsportal/siCrBXXhmvTQGWPNLBow.png',
title: 'Bootstrap',
description: '凛冬将至',
status: 1,
updatedAt: '2018-07-26 00:00:00'
},
{
id: 6,
cover: 'https://gw.alipayobjects.com/zos/rmsportal/ComBAopevLwENQdKWiIn.png',
title: 'Vue',
description: '生命就像一盒巧克力,结果往往出人意料',
status: 1,
updatedAt: '2018-07-26 00:00:00'
}
],
'pageSize': 10,
'pageNo': 0,
'totalPage': 6,
'totalCount': 57
})
}
const activity = () => {
return builder([{
id: 1,
user: {
nickname: '@name',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png'
},
project: {
name: '白鹭酱油开发组',
action: '更新',
event: '番组计划'
},
time: '2018-08-23 14:47:00'
},
{
id: 1,
user: {
nickname: '蓝莓酱',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/jZUIxmJycoymBprLOUbT.png'
},
project: {
name: '白鹭酱油开发组',
action: '更新',
event: '番组计划'
},
time: '2018-08-23 09:35:37'
},
{
id: 1,
user: {
nickname: '@name',
avatar: '@image(64x64)'
},
project: {
name: '白鹭酱油开发组',
action: '创建',
event: '番组计划'
},
time: '2017-05-27 00:00:00'
},
{
id: 1,
user: {
nickname: '曲丽丽',
avatar: '@image(64x64)'
},
project: {
name: '高逼格设计天团',
action: '更新',
event: '六月迭代'
},
time: '2018-08-23 14:47:00'
},
{
id: 1,
user: {
nickname: '@name',
avatar: '@image(64x64)'
},
project: {
name: '高逼格设计天团',
action: 'created',
event: '六月迭代'
},
time: '2018-08-23 14:47:00'
},
{
id: 1,
user: {
nickname: '曲丽丽',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png'
},
project: {
name: '高逼格设计天团',
action: 'created',
event: '六月迭代'
},
time: '2018-08-23 14:47:00'
}
])
}
const teams = () => {
return builder([{
id: 1,
name: '科学搬砖组',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png'
},
{
id: 2,
name: '程序员日常',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/cnrhVkzwxjPwAaCfPbdc.png'
},
{
id: 1,
name: '设计天团',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/gaOngJwsRYRaVAuXXcmB.png'
},
{
id: 1,
name: '中二少女团',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ubnKSIfAJTxIgXOKlciN.png'
},
{
id: 1,
name: '骗你学计算机',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/WhxKECPNujWoWEFNdnJE.png'
}
])
}
const radar = () => {
return builder([{
item: '引用',
'个人': 70,
'团队': 30,
'部门': 40
},
{
item: '口碑',
'个人': 60,
'团队': 70,
'部门': 40
},
{
item: '产量',
'个人': 50,
'团队': 60,
'部门': 40
},
{
item: '贡献',
'个人': 40,
'团队': 50,
'部门': 40
},
{
item: '热度',
'个人': 60,
'团队': 70,
'部门': 40
},
{
item: '引用',
'个人': 70,
'团队': 50,
'部门': 40
}
])
}
Mock.mock(/\/service/, 'get', serverList)
Mock.mock(/\/list\/search\/projects/, 'get', projects)
Mock.mock(/\/workplace\/activity/, 'get', activity)
Mock.mock(/\/workplace\/teams/, 'get', teams)
Mock.mock(/\/workplace\/radar/, 'get', radar)
This diff is collapsed.
import Mock from 'mockjs2'
import { builder } from '../util'
//
const tagCloudData = () => {
return builder([{ 'value': 9, 'name': 'AntV' }, { 'value': 8, 'name': 'F2' }, { 'value': 8, 'name': 'G2' }, { 'value': 8, 'name': 'G6' }, { 'value': 8, 'name': 'DataSet' }, { 'value': 8, 'name': '墨者学院' }, { 'value': 6, 'name': 'Analysis' }, { 'value': 6, 'name': 'Data Mining' }, { 'value': 6, 'name': 'Data Vis' }, { 'value': 6, 'name': 'Design' }, { 'value': 6, 'name': 'Grammar' }, { 'value': 6, 'name': 'Graphics' }, { 'value': 6, 'name': 'Graph' }, { 'value': 6, 'name': 'Hierarchy' }, { 'value': 6, 'name': 'Labeling' }, { 'value': 6, 'name': 'Layout' }, { 'value': 6, 'name': 'Quantitative' }, { 'value': 6, 'name': 'Relation' }, { 'value': 6, 'name': 'Statistics' }, { 'value': 6, 'name': '可视化' }, { 'value': 6, 'name': '数据' }, { 'value': 6, 'name': '数据可视化' }, { 'value': 4, 'name': 'Arc Diagram' }, { 'value': 4, 'name': 'Bar Chart' }, { 'value': 4, 'name': 'Canvas' }, { 'value': 4, 'name': 'Chart' }, { 'value': 4, 'name': 'DAG' }, { 'value': 4, 'name': 'DG' }, { 'value': 4, 'name': 'Facet' }, { 'value': 4, 'name': 'Geo' }, { 'value': 4, 'name': 'Line' }, { 'value': 4, 'name': 'MindMap' }, { 'value': 4, 'name': 'Pie' }, { 'value': 4, 'name': 'Pizza Chart' }, { 'value': 4, 'name': 'Punch Card' }, { 'value': 4, 'name': 'SVG' }, { 'value': 4, 'name': 'Sunburst' }, { 'value': 4, 'name': 'Tree' }, { 'value': 4, 'name': 'UML' }, { 'value': 3, 'name': 'Chart' }, { 'value': 3, 'name': 'View' }, { 'value': 3, 'name': 'Geom' }, { 'value': 3, 'name': 'Shape' }, { 'value': 3, 'name': 'Scale' }, { 'value': 3, 'name': 'Animate' }, { 'value': 3, 'name': 'Global' }, { 'value': 3, 'name': 'Slider' }, { 'value': 3, 'name': 'Connector' }, { 'value': 3, 'name': 'Transform' }, { 'value': 3, 'name': 'Util' }, { 'value': 3, 'name': 'DomUtil' }, { 'value': 3, 'name': 'MatrixUtil' }, { 'value': 3, 'name': 'PathUtil' }, { 'value': 3, 'name': 'G' }, { 'value': 3, 'name': '2D' }, { 'value': 3, 'name': '3D' }, { 'value': 3, 'name': 'Line' }, { 'value': 3, 'name': 'Area' }, { 'value': 3, 'name': 'Interval' }, { 'value': 3, 'name': 'Schema' }, { 'value': 3, 'name': 'Edge' }, { 'value': 3, 'name': 'Polygon' }, { 'value': 3, 'name': 'Heatmap' }, { 'value': 3, 'name': 'Render' }, { 'value': 3, 'name': 'Tooltip' }, { 'value': 3, 'name': 'Axis' }, { 'value': 3, 'name': 'Guide' }, { 'value': 3, 'name': 'Coord' }, { 'value': 3, 'name': 'Legend' }, { 'value': 3, 'name': 'Path' }, { 'value': 3, 'name': 'Helix' }, { 'value': 3, 'name': 'Theta' }, { 'value': 3, 'name': 'Rect' }, { 'value': 3, 'name': 'Polar' }, { 'value': 3, 'name': 'Dsv' }, { 'value': 3, 'name': 'Csv' }, { 'value': 3, 'name': 'Tsv' }, { 'value': 3, 'name': 'GeoJSON' }, { 'value': 3, 'name': 'TopoJSON' }, { 'value': 3, 'name': 'Filter' }, { 'value': 3, 'name': 'Map' }, { 'value': 3, 'name': 'Pick' }, { 'value': 3, 'name': 'Rename' }, { 'value': 3, 'name': 'Filter' }, { 'value': 3, 'name': 'Map' }, { 'value': 3, 'name': 'Pick' }, { 'value': 3, 'name': 'Rename' }, { 'value': 3, 'name': 'Reverse' }, { 'value': 3, 'name': 'sort' }, { 'value': 3, 'name': 'Subset' }, { 'value': 3, 'name': 'Partition' }, { 'value': 3, 'name': 'Imputation' }, { 'value': 3, 'name': 'Fold' }, { 'value': 3, 'name': 'Aggregate' }, { 'value': 3, 'name': 'Proportion' }, { 'value': 3, 'name': 'Histogram' }, { 'value': 3, 'name': 'Quantile' }, { 'value': 3, 'name': 'Treemap' }, { 'value': 3, 'name': 'Hexagon' }, { 'value': 3, 'name': 'Binning' }, { 'value': 3, 'name': 'kernel' }, { 'value': 3, 'name': 'Regression' }, { 'value': 3, 'name': 'Density' }, { 'value': 3, 'name': 'Sankey' }, { 'value': 3, 'name': 'Voronoi' }, { 'value': 3, 'name': 'Projection' }, { 'value': 3, 'name': 'Centroid' }, { 'value': 3, 'name': 'H5' }, { 'value': 3, 'name': 'Mobile' }, { 'value': 3, 'name': 'K线图' }, { 'value': 3, 'name': '关系图' }, { 'value': 3, 'name': '烛形图' }, { 'value': 3, 'name': '股票图' }, { 'value': 3, 'name': '直方图' }, { 'value': 3, 'name': '金字塔图' }, { 'value': 3, 'name': '分面' }, { 'value': 3, 'name': '南丁格尔玫瑰图' }, { 'value': 3, 'name': '饼图' }, { 'value': 3, 'name': '线图' }, { 'value': 3, 'name': '点图' }, { 'value': 3, 'name': '散点图' }, { 'value': 3, 'name': '子弹图' }, { 'value': 3, 'name': '柱状图' }, { 'value': 3, 'name': '仪表盘' }, { 'value': 3, 'name': '气泡图' }, { 'value': 3, 'name': '漏斗图' }, { 'value': 3, 'name': '热力图' }, { 'value': 3, 'name': '玉玦图' }, { 'value': 3, 'name': '直方图' }, { 'value': 3, 'name': '矩形树图' }, { 'value': 3, 'name': '箱形图' }, { 'value': 3, 'name': '色块图' }, { 'value': 3, 'name': '螺旋图' }, { 'value': 3, 'name': '词云' }, { 'value': 3, 'name': '词云图' }, { 'value': 3, 'name': '雷达图' }, { 'value': 3, 'name': '面积图' }, { 'value': 3, 'name': '马赛克图' }, { 'value': 3, 'name': '盒须图' }, { 'value': 3, 'name': '坐标轴' }, { 'value': 3, 'name': '' }, { 'value': 3, 'name': 'Jacques Bertin' }, { 'value': 3, 'name': 'Leland Wilkinson' }, { 'value': 3, 'name': 'William Playfair' }, { 'value': 3, 'name': '关联' }, { 'value': 3, 'name': '分布' }, { 'value': 3, 'name': '区间' }, { 'value': 3, 'name': '占比' }, { 'value': 3, 'name': '地图' }, { 'value': 3, 'name': '时间' }, { 'value': 3, 'name': '比较' }, { 'value': 3, 'name': '流程' }, { 'value': 3, 'name': '趋势' }, { 'value': 2, 'name': '亦叶' }, { 'value': 2, 'name': '再飞' }, { 'value': 2, 'name': '完白' }, { 'value': 2, 'name': '巴思' }, { 'value': 2, 'name': '张初尘' }, { 'value': 2, 'name': '御术' }, { 'value': 2, 'name': '有田' }, { 'value': 2, 'name': '沉鱼' }, { 'value': 2, 'name': '玉伯' }, { 'value': 2, 'name': '画康' }, { 'value': 2, 'name': '祯逸' }, { 'value': 2, 'name': '绝云' }, { 'value': 2, 'name': '罗宪' }, { 'value': 2, 'name': '萧庆' }, { 'value': 2, 'name': '董珊珊' }, { 'value': 2, 'name': '陆沉' }, { 'value': 2, 'name': '顾倾' }, { 'value': 2, 'name': 'Domo' }, { 'value': 2, 'name': 'GPL' }, { 'value': 2, 'name': 'PAI' }, { 'value': 2, 'name': 'SPSS' }, { 'value': 2, 'name': 'SYSTAT' }, { 'value': 2, 'name': 'Tableau' }, { 'value': 2, 'name': 'D3' }, { 'value': 2, 'name': 'Vega' }, { 'value': 2, 'name': '统计图表' }])
}
Mock.mock(/\/data\/antv\/tag-cloud/, 'get', tagCloudData)
This diff is collapsed.
This diff is collapsed.
const responseBody = {
'code': 'M0000',
'msg': 'ok',
'ctime': 1560499805992,
'requestID': '1139444888657797122'
};
export const builder = (data, message, code = 0, headers = {}) => {
responseBody.data = data;
if (message !== undefined && message !== null) {
responseBody.message = message;
}
if (code !== undefined && code !== 0) {
responseBody.code = code;
responseBody._status = code;
}
if (headers !== null && typeof headers === 'object' && Object.keys(headers).length > 0) {
responseBody._headers = headers;
}
responseBody.timestamp = new Date().getTime();
return responseBody;
};
export const getQueryParameters = (options) => {
const url = options.url;
const search = url.split('?')[1];
if (!search) {
return {};
}
return JSON.parse('{"' + decodeURIComponent(search)
.replace(/"/g, '\\"')
.replace(/&/g, '","')
.replace(/=/g, '":"') + '"}');
};
export const getBody = (options) => {
return options.body && JSON.parse(options.body);
};
import Vue from 'vue'
import router from './router'
import store from './store'
import NProgress from 'nprogress' // progress bar
import 'nprogress/nprogress.css' // progress bar style
import notification from 'ant-design-vue/es/notification'
import { setDocumentTitle, domTitle } from '@/utils/domUtil'
import { ACCESS_TOKEN } from '@/store/mutation-types'
NProgress.configure({ showSpinner: false }) // NProgress Configuration
const whiteList = ['login', 'register', 'registerResult'] // no redirect whitelist
router.beforeEach((to, from, next) => {
NProgress.start() // start progress bar
to.meta && (typeof to.meta.title !== 'undefined' && setDocumentTitle(`${to.meta.title} - ${domTitle}`))
if (Vue.ls.get(ACCESS_TOKEN)) {
/* has token */
if (to.path === '/user/login') {
next({ path: '/dashboard/workplace' })
NProgress.done()
} else {
if (store.getters.roles.length === 0) {
store
.dispatch('GetInfo')
.then(res => {
const roles = res.result && res.result.role
store.dispatch('GenerateRoutes', { roles }).then(() => {
// 根据roles权限生成可访问的路由表
// 动态添加可访问路由表
router.addRoutes(store.getters.addRouters)
const redirect = decodeURIComponent(from.query.redirect || to.path)
if (to.path === redirect) {
// hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record
next({ ...to, replace: true })
} else {
// 跳转到目的路由
next({ path: redirect })
}
})
})
.catch(() => {
notification.error({
message: '错误',
description: '请求用户信息失败,请重试'
})
store.dispatch('Logout').then(() => {
next({ path: '/user/login', query: { redirect: to.fullPath } })
})
})
} else {
next()
}
}
} else {
if (whiteList.includes(to.name)) {
// 在免登录白名单,直接进入
next()
} else {
next({ path: '/user/login', query: { redirect: to.fullPath } })
NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it
}
}
})
router.afterEach(() => {
NProgress.done() // finish progress bar
})
...@@ -131,10 +131,9 @@ const asyncRouterMap = [ ...@@ -131,10 +131,9 @@ const asyncRouterMap = [
> 1. 请注意 `component: () => import('..') ` 方式引入路由的页面组件为 懒加载模式。具体可以看 [Vue 官方文档](https://router.vuejs.org/zh/guide/advanced/lazy-loading.html) > 1. 请注意 `component: () => import('..') ` 方式引入路由的页面组件为 懒加载模式。具体可以看 [Vue 官方文档](https://router.vuejs.org/zh/guide/advanced/lazy-loading.html)
> 2. 增加新的路由应该增加在 '/' (index) 路由的 `children` 内 > 2. 增加新的路由应该增加在 '/' (index) 路由的 `children` 内
> 3. `permission` 可以进行自定义修改,只需要对这个模块进行自定义修改即可 [src/store/modules/permission.js#L10](https://github.com/sendya/ant-design-pro-vue/blob/master/src/store/modules/permission.js#L10)
附权限路由结构: 附权限路由结构:
![权限结构](https://static-2.loacg.com/open/static/github/permissions.png) ![权限结构](https://static-2.loacg.com/open/static/github/permissions.png)
\ No newline at end of file
...@@ -2,8 +2,6 @@ import Vue from 'vue' ...@@ -2,8 +2,6 @@ import Vue from 'vue'
import Vuex from 'vuex' import Vuex from 'vuex'
import app from './modules/app' import app from './modules/app'
import user from './modules/user'
import permission from './modules/permission'
import taskTemplate from './modules/task-template' import taskTemplate from './modules/task-template'
import getters from './getters' import getters from './getters'
...@@ -12,8 +10,6 @@ Vue.use(Vuex) ...@@ -12,8 +10,6 @@ Vue.use(Vuex)
export default new Vuex.Store({ export default new Vuex.Store({
modules: { modules: {
app, app,
user,
permission,
taskTemplate taskTemplate
}, },
state: { state: {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
export function actionToObject (json) {
try {
return JSON.parse(json)
} catch (e) {
console.log('err', e.message)
}
return []
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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