v1.0.7 优化权限的单词命名,以及中文命名

This commit is contained in:
zhuoda
2020-02-05 10:51:31 +08:00
parent f9a4917086
commit 07f4bbf291
28 changed files with 311 additions and 131 deletions

View File

@@ -273,9 +273,9 @@ export const canvasParticle = (function () {
if (i != j) {
dist = Math.round(canvas.points[i].x - canvas.points[j].x) * Math.round(canvas.points[i].x - canvas.points[j].x) +
Math.round(canvas.points[i].y - canvas.points[j].y) * Math.round(canvas.points[i].y - canvas.points[j].y); if (dist <= canvas.config.dist && canvas.points[i].max_conn < canvas.config.max_conn) {
canvas.points[i].max_conn++; context.lineWidth = 0.5 - dist / canvas.config.dist; context.strokeStyle = 'rgba(' + canvas.config.stroke + ',' + (1 - dist / canvas.config.dist) + ')'
context.beginPath(); context.moveTo(canvas.points[i].x, canvas.points[i].y); context.lineTo(canvas.points[j].x, canvas.points[j].y); context.stroke()
}
canvas.points[i].max_conn++; context.lineWidth = 0.5 - dist / canvas.config.dist; context.strokeStyle = 'rgba(' + canvas.config.stroke + ',' + (1 - dist / canvas.config.dist) + ')'
context.beginPath(); context.moveTo(canvas.points[i].x, canvas.points[i].y); context.lineTo(canvas.points[j].x, canvas.points[j].y); context.stroke()
}
}
}
if (mouse) {

View File

@@ -18,7 +18,7 @@
<Button :loading="btnLoading" @click="login" long type="primary">登录</Button>
</FormItem>
<div class="other-way">
<p class="inline" style="float:left">其他方式登陆</p>
<p class="inline" style="float:left">其他方式登陆(账号demo/123456 demo1/123456)</p>
<div class="inline align" style="float:right">
<img alt class="marginLeft" src="../../../assets/images/login-taobao.png" />
<img alt class="marginLeft" src="../../../assets/images/login-alipay.png" />
@@ -63,7 +63,7 @@ export default {
formData: {
code: '',
codeUuid: '',
loginName: 'sa',
loginName: 'demo',
loginPwd: '123456'
},
codeUrl: ''

View File

@@ -28,7 +28,7 @@ export default {
LoginForm
},
data () {
return {};
return {}
},
computed: {},
watch: {},

View File

@@ -0,0 +1,49 @@
<template>
<div>
<Card>
<p slot="title">{{notice.title}}</p>
<p>{{content}}</p>
<p>{{notice.updateTime}}</p>
</Card>
</div>
</template>
<script>
import { noticeApi } from '@/api/notice';
export default {
name: 'NoticeList',
components: {},
props: {},
data() {
//消息信息
return {
notice: {},
content: ''
};
},
mounted() {
this.notice = this.$route.params.notice;
this.getNoticeDetail(this.notice.id);
},
methods: {
// 获取通知详情
async getNoticeDetail(id) {
try {
let result = await noticeApi.getNoticeDetail(id);
this.content = result.data.content;
} catch (e) {
//TODO zhuoda sentry
console.error(e);
}
}
}
};
</script>
<style lang="less" scoped>
.detail {
margin-bottom: 20px;
}
.time {
text-align: right;
color: #999;
}
</style>

View File

@@ -65,22 +65,8 @@
></Input>
</FormItem>
</Form>
</Modal>
<!-- 添加修改消息 -->
<!-- 消息详情 -->
</Modal>
<Modal
:loading="saveLoading"
:title="formData.title"
class="detail-modal"
v-model="detailModal"
>
<div class="detail">{{formData.content}}</div>
<p class="time">{{formData.updateTime}}</p>
<div slot="footer">
<Button @click="cancelSave" size="large" type="primary">知道了</Button>
</div>
</Modal>
<!-- 消息详情 -->
</div>
</template>
@@ -93,7 +79,6 @@ export default {
props: {},
data() {
return {
detailModal: false,
searchData: {
title: ''
},
@@ -158,7 +143,10 @@ export default {
}
],
action: () => {
this.openModal('detail', params.row);
this.$router.push({
name:'NoticeDetail',
params:{notice:params.row}
})
}
},
{
@@ -289,10 +277,6 @@ export default {
this.getNoticeDetail(data.id);
this.editModal = true;
break;
case 'detail':
this.getNoticeDetail(data.id);
this.detailModal = true;
break;
}
},
// 分页
@@ -371,7 +355,6 @@ export default {
// 取消添加/修改
cancelSave() {
this.editModal = false;
this.detailModal = false;
this.$refs['formRef'].resetFields();
},
// 重置
@@ -384,14 +367,3 @@ export default {
};
</script>
<style lang="less" scoped>
.detail-modal {
.detail {
margin-bottom: 20px;
}
.time {
text-align: right;
color: #999;
}
}
</style>

View File

@@ -26,20 +26,39 @@
<template v-for="(item, i) in menuTree">
<Submenu :key="i" :name="item.menuKey">
<template slot="title">
<span>{{item.menuName}}</span>
<span><Icon type="md-menu" />{{item.menuName}}</span>
</template>
<!--遍历得到子模块-->
<template v-for="(children, j) in item.children">
<Submenu :key="j" :name="children.menuKey" v-if="children.children.length > 0">
<template slot="title">
<span>{{children.menuName}}</span>
<template v-if="children.hideInMenu">
<Icon type="md-open" /><i style="font-size:0.85rem"> {{children.menuName}}</i>
</template>
<template v-else>
<Icon type="md-menu" /> {{children.menuName}}
</template>
</template>
<!--遍历得到子模块页面-->
<template v-for="(childrenPages, k) in children.children">
<MenuItem :key="k" :name="childrenPages.menuKey">{{childrenPages.menuName}}</MenuItem>
<MenuItem :key="k" :name="childrenPages.menuKey">
<template v-if="childrenPages.hideInMenu">
<Icon type="md-open" /><i style="font-size:0.85rem"> {{childrenPages.menuName}}</i>
</template>
<template v-else>
<Icon type="md-menu" /> {{childrenPages.menuName}}
</template>
</MenuItem>
</template>
</Submenu>
<MenuItem :key="j" :name="children.menuKey" v-else>{{children.menuName}}</MenuItem>
<MenuItem :key="j" :name="children.menuKey" v-else>
<template v-if="children.hideInMenu">
<Icon type="md-open" /><i style="font-size:0.85rem"> {{children.menuName}}</i>
</template>
<template v-else>
<Icon type="md-menu" /> {{children.menuName}}
</template>
</MenuItem>
</template>
</Submenu>
</template>
@@ -166,17 +185,10 @@ export default {
for (const router of routers) {
//过滤非菜单
if (!router.meta.hideInMenu) {
if (!router.meta.noValidatePrivilege) {
this.routerMap.set(router.name, router);
let menu = {
type: PRIVILEGE_TYPE_ENUM.MENU.value,
menuName: router.meta.title,
menuKey: router.name,
parentKey: null,
url: router.path,
children: [],
sort: 0
};
let menu = this.convert2Menu(router,null);
console.log('change menu : ', JSON.stringify(menu))
privilegeTree.push(menu);
privilegeList.push(menu);
//判断是否有更新菜单
@@ -188,7 +200,7 @@ export default {
}
}
if (privilegeList.length !== serverMenuList.length) {
if (privilegeList.length < serverMenuList.length) {
this.menusChange = true;
this.menusChangeNum =
this.menusChangeNum +
@@ -200,21 +212,26 @@ export default {
this.$Spin.hide();
},
recursion(children, parentMenu, menuList, serverMenuMap) {
for (const router of children) {
//过滤非菜单
if (!router.meta.hideInMenu) {
this.routerMap.set(router.name, router);
let menu = {
convert2Menu(router, parent){
return {
type: PRIVILEGE_TYPE_ENUM.MENU.value,
menuName: router.meta.title,
menuKey: router.name,
parentKey: parentMenu.menuKey,
parentKey: parent,
url: router.path,
children: [],
sort: 0
sort: 0,
hideInMenu:router.meta.hideInMenu
};
},
recursion(children, parentMenu, menuList, serverMenuMap) {
for (const router of children) {
//过滤非需要权限的
if (!router.meta.noValidatePrivilege) {
this.routerMap.set(router.name, router);
let menu = this.convert2Menu(router,parentMenu.menuKey);
parentMenu.children.push(menu);
menuList.push(menu);
//判断是否有更新菜单
@@ -248,6 +265,7 @@ export default {
}
if (isChange) {
console.log('============== change menu : ', menu, serverMenu,' ===================')
this.menusChange = true;
this.menusChangeNum = this.menusChangeNum + 1;
}
@@ -295,8 +313,8 @@ export default {
// 点击菜单事件
loadPrivilegeTableData(name) {
let router = this.routerMap.get(name);
if (!_.isUndefined(router) && router.meta && router.meta.childrenPoints) {
this.privilegeTableData = router.meta.childrenPoints.map(e =>
if (!_.isUndefined(router) && router.meta && router.meta.privilege) {
this.privilegeTableData = router.meta.privilege.map(e =>
Object.assign({}, e, { parentKey: name })
);
}