Commit a0a324a3 authored by 吴志坤's avatar 吴志坤

Merge branch 'newprotect' of http://gitlab.91isoft.com:90/yangshuo/template_vue into newprotect

parents c6ed0616 bce0edfd
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
<script> <script>
// import { getInfo } from '@/api/login' // import { getInfo } from '@/api/login'
import store from '../../store/index' import store from '../../store/index'
import Cookies from 'js-cookie'
export default { export default {
name: 'CoolButton', name: 'CoolButton',
props: {// 调用该组件时需要传递过来的属性 props: {// 调用该组件时需要传递过来的属性
...@@ -69,6 +70,10 @@ export default { ...@@ -69,6 +70,10 @@ export default {
// this.hasper = data // this.hasper = data
// } // }
// }) // })
// var p = Cookies.get('permissions')
// const menuList = p.split(',')
// TODO: clear this log
// console.log(`store.getters.permissions`, store.getters.permissions)
if (store.getters.permissions[0] === '*:*:*') { if (store.getters.permissions[0] === '*:*:*') {
this.isShow = true this.isShow = true
this.hasper = [] this.hasper = []
......
...@@ -38,6 +38,8 @@ router.beforeEach((to, from, next) => { ...@@ -38,6 +38,8 @@ router.beforeEach((to, from, next) => {
if (routers.accessedRoutes && routers.accessedRoutes.length > 0 && routers.getRouters && routers.getRouters.length > 0) { if (routers.accessedRoutes && routers.accessedRoutes.length > 0 && routers.getRouters && routers.getRouters.length > 0) {
// 测试 默认静态页面 // 测试 默认静态页面
// store.dispatch('permission/generateRoutes', { roles }).then(accessRoutes => { // store.dispatch('permission/generateRoutes', { roles }).then(accessRoutes => {
// TODO: clear this log
console.log(`routers.accessedRoutes`, routers.accessedRoutes)
// 根据roles权限生成可访问的路由表 // 根据roles权限生成可访问的路由表
router.addRoutes(routers.accessedRoutes) // 动态添加可访问路由表 router.addRoutes(routers.accessedRoutes) // 动态添加可访问路由表
// TODO: clear this log // TODO: clear this log
......
...@@ -67,10 +67,14 @@ const user = { ...@@ -67,10 +67,14 @@ const user = {
const avatar = user.avatar === null ? require('@/assets/image/profile.jpg') : user.avatar const avatar = user.avatar === null ? require('@/assets/image/profile.jpg') : user.avatar
if (res.data.roles && res.data.roles.length > 0) { // 验证返回的roles是否是一个非空数组 if (res.data.roles && res.data.roles.length > 0) { // 验证返回的roles是否是一个非空数组
commit('SET_ROLES', res.data.roles) commit('SET_ROLES', res.data.roles)
commit('SET_PERMISSIONS', res.data.permissions) // const a = res.data.permissions.join(',')
// // TODO: clear this log
// console.log(`a`, a)
// Cookies.set('permissions', a)
} else { } else {
commit('SET_ROLES', ['ROLE_DEFAULT']) commit('SET_ROLES', ['ROLE_DEFAULT'])
} }
commit('SET_PERMISSIONS', res.data.permissions)
commit('SET_NAME', user.username) commit('SET_NAME', user.username)
commit('SET_SPECIALTAG', user.specialTag) commit('SET_SPECIALTAG', user.specialTag)
commit('SET_AVATAR', avatar) commit('SET_AVATAR', avatar)
......
...@@ -146,7 +146,7 @@ ...@@ -146,7 +146,7 @@
<span>{{ scope.row.operTime | transformDateByFormat('yyyy-MM-DD HH:mm:ss') }}</span> <span>{{ scope.row.operTime | transformDateByFormat('yyyy-MM-DD HH:mm:ss') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
......
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
<span>{{ parseTime(scope.row.loginTime) | transformDateByFormat('YYYY-MM-DD HH:mm:ss') }}</span> <span>{{ parseTime(scope.row.loginTime) | transformDateByFormat('YYYY-MM-DD HH:mm:ss') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作"> <el-table-column label="操作" width="100px">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <coolbutton :type="textPrimary" :name="deleteName" :size="deleteSize" @btn-click="handleDelete(scope.row.businessId)" />--> <!-- <coolbutton :type="textPrimary" :name="deleteName" :size="deleteSize" @btn-click="handleDelete(scope.row.businessId)" />-->
<el-button <el-button
......
...@@ -146,7 +146,7 @@ ...@@ -146,7 +146,7 @@
<span>{{ scope.row.operTime | transformDateByFormat('YYYY-MM') }}</span> <span>{{ scope.row.operTime | transformDateByFormat('YYYY-MM') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
......
This diff is collapsed.
...@@ -61,8 +61,8 @@ ...@@ -61,8 +61,8 @@
<!-- {{ scope.row.businessId }}--> <!-- {{ scope.row.businessId }}-->
<!-- </template>--> <!-- </template>-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<el-table-column :show-overflow-tooltip="true" prop="deptName" label="部门名称" width="260" /> <el-table-column :show-overflow-tooltip="true" prop="deptName" label="部门名称" />
<el-table-column :show-overflow-tooltip="true" prop="orderNum" label="排序" width="200" /> <el-table-column :show-overflow-tooltip="true" prop="orderNum" label="排序" />
<el-table-column label="状态" align="center" width="100"> <el-table-column label="状态" align="center" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
...@@ -73,14 +73,14 @@ ...@@ -73,14 +73,14 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :show-overflow-tooltip="true" prop="leader" label="负责人" width="200" /> <el-table-column :show-overflow-tooltip="true" prop="leader" label="负责人" />
<el-table-column :show-overflow-tooltip="true" prop="phone" label="联系电话" width="200" /> <el-table-column :show-overflow-tooltip="true" prop="phone" label="联系电话" />
<el-table-column :show-overflow-tooltip="true" label="创建时间" align="center" prop="createDate" width="200"> <el-table-column :show-overflow-tooltip="true" label="创建时间" align="center" prop="createDate">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span> <span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180px">
<!-- <template slot-scope="scope">--> <!-- <template slot-scope="scope">-->
<!-- <el-button--> <!-- <el-button-->
<!-- v-hasPermi="['system:dept:edit']"--> <!-- v-hasPermi="['system:dept:edit']"-->
......
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
<span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span> <span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width"> <el-table-column label="操作" class-name="small-padding fixed-width" width="180px">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button--> <!-- <el-button-->
<!-- v-hasPermi="['sys:dictConfig:edit']"--> <!-- v-hasPermi="['sys:dictConfig:edit']"-->
......
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
<span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span> <span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width"> <el-table-column label="操作" class-name="small-padding fixed-width" width="180px">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button--> <!-- <el-button-->
<!-- v-hasPermi="['sys:dict:edit']"--> <!-- v-hasPermi="['sys:dict:edit']"-->
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span> <span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180px">
<!--<template slot-scope="scope"> <!--<template slot-scope="scope">
<el-button <el-button
v-hasPermi="['system:menu:edit']" v-hasPermi="['system:menu:edit']"
......
...@@ -97,16 +97,15 @@ ...@@ -97,16 +97,15 @@
<span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span> <span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" width="240px"> <el-table-column label="操作" class-name="small-padding fixed-width" width="150px">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button--> <el-button
<!-- v-hasPermi="['sys:role:update']"--> size="mini"
<!-- size="mini"--> type="text"
<!-- type="text"--> style="color: #49cec9"
<!-- style="color: #49cec9"--> @click="handleUpdate(scope.row)"
<!-- @click="handleUpdate(scope.row)"--> >修改</el-button>
<!-- >修改</el-button>--> <!-- <coolbutton style="color: #49cec9" :type="typeParent" :name="updataName" :size="size" :haspermi="updateHaspermi" @btn-click="handleUpdate(scope.row)" />-->
<coolbutton style="color: #49cec9" :type="typeParent" :name="updataName" :size="size" :haspermi="updateHaspermi" @btn-click="handleUpdate(scope.row)" />
<!-- <el-button--> <!-- <el-button-->
<!-- v-hasPermi="['sys:role:update']"--> <!-- v-hasPermi="['sys:role:update']"-->
<!-- size="mini"--> <!-- size="mini"-->
......
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