Commit 70e8278c authored by zhangrui123's avatar zhangrui123

系统管理的用户管理,角色管理整个操作功能和日志管理的功能

parent db209b23
......@@ -78,7 +78,6 @@
</a-layout-content>
</a-layout>
</a-layout>
</a-locale-provider>
</template>
<script>
......@@ -87,7 +86,11 @@ import SideMenu from './sidemenu'
import NavBar from './navbar'
import zh_CN from 'ant-design-vue/lib/locale-provider/zh_CN'
import ChangePassword from '@/views/personal/changePassword'
import { permission, } from '@/util/mixins'
export default {
mixins: [ permission, ],
name: 'Layout',
components: {
SideMenu,
......@@ -160,30 +163,32 @@ export default {
methods: {
showChangePwdModal(){
this.isShowChangePwd = true
},
closeChangePwdModal(){
this.isShowChangePwd = false
},
getInfo() {
this.$ajax.get({
url: this.$api.GET_USER_INFO,
}).then(res => {
// 本地存储用户基本信息
// getInfo() {
// this.$ajax.get({
// url: this.$api.GET_USER_INFO,
// }).then(res => {
// // 本地存储用户基本信息
let userInfo = res.data.content, name
if(!res.data || !res.data.content){
userInfo = {}
name = ''
}else{
userInfo = res.data.content
name = userInfo.username = res.data.content.name||res.data.content.phone
this.$store.commit('SET_USERINFO', userInfo)
this.$cookie.set('userName', name)
this.$store.commit('SET_USERNAME', name)
}
// let userInfo = res.data.content, name
// if(!res.data || !res.data.content){
// userInfo = {}
// name = ''
// }else{
// userInfo = res.data.content
// name = userInfo.username = res.data.content.name||res.data.content.phone
// this.$store.commit('SET_USERINFO', userInfo)
// this.$cookie.set('userName', name)
// this.$store.commit('SET_USERNAME', name)
// }
})
},
// })
// },
getLogo(){
this.$ajax.get({
url: this.$api.GET_PROJECT,
......
......@@ -69,7 +69,6 @@
<a-modal :visible="previewVisible" style="text-align:center" :width="600" :footer="null" @cancel="previewVisible = false">
<img alt="项目logo" style="width: 80%;height:auto" :src="logoConfigDatas.previewImage" />
</a-modal>
</a-layout>
</a-locale-provider>
</template>
......
......@@ -16,7 +16,7 @@
<span>{{menu.meta.title}}</span>
</span>
<template v-for="child in menu.children">
<a-menu-item :key="child.key" @click="onclick(child.path)">
<a-menu-item :key="child.key" @click="onclick(child.name)">
<a-icon :type="child.meta.menuIcon?child.meta.menuIcon:'bars'" />
{{child.meta.title}}
</a-menu-item>
......@@ -24,7 +24,7 @@
</a-sub-menu>
</template>
<template v-else>
<a-menu-item :key="menu.name" @click="onclick(menu.path)">
<a-menu-item :key="menu.name" @click="onclick(menu.name)">
<a-icon :type="menu.meta.menuIcon?menu.meta.menuIcon:'bars'" />
{{menu.meta.title}}
</a-menu-item>
......@@ -42,7 +42,7 @@ export default {
return {
openKeys: [],
selectedKeys: [],
menus: [],
// menus: [],
isAllPerm: false
}
},
......@@ -91,7 +91,7 @@ export default {
}
} else if(!this.isAllPerm) { // 非超管访问
if(routes[i].children[j].meta.requirePerm == false) {
if(routes[i].children[j].meta.isAllPerm == false) {
if(!!routes[i].children[j].meta.menuIcon && routes[i].children[j].name == 'systemManagement' && isLoadExtendMenu == 'false'){
let target = routes[i].children[j].children
if(target.length > 0) {
......@@ -121,6 +121,12 @@ export default {
}
})
},
computed: {
menus(){
// console.log(this.$store.state.menuList)
return this.$store.state.menuList
}
},
methods: {
// 点击菜单,收起其他展开的菜单
onOpenChange(keys) {
......@@ -132,7 +138,7 @@ export default {
},
onclick(key) {
this.$router.push({
path: key,
name: key,
})
}
},
......
[
{
"level":1,
"levelName":"第一级"
},{
"level":2,
"levelName":"第二级"
},{
"level":3,
"levelName":"第三级"
},{
"level":4,
"levelName":"第四级"
},{
"level":5,
"levelName":"第五级"
},{
"level":6,
"levelName":"第六级"
},{
"level":7,
"levelName":"第七级"
},{
"level":8,
"levelName":"第八级"
},{
"level":9,
"levelName":"第九级"
},{
"level":10,
"levelName":"第十级"
}
]
\ No newline at end of file
......@@ -2,15 +2,15 @@
"Layout": [
{
"path": "/documents/repair", "name": "repairList",
"meta": { "title": "应急报修", "menuIcon": "profile", "menuPath": true, "hideInBread": false },
"meta": { "title": "应急报修","authCode":"0005", "menuIcon": "profile", "menuPath": true, "hideInBread": false },
"children": [
{
"path": "/documents/repair/repairList", "name": "repairInnerList",
"meta": { "title": "应急报修列表", "menuIcon": "profile", "menuPath": true, "hideInBread": false },
"meta": { "title": "应急报修列表","authCode":"000501", "menuIcon": "profile", "menuPath": true, "hideInBread": false },
"children": [
{
"path": "/documents/repair/repairInfo", "name": "repairInfo",
"meta": { "title": "报修详情", "menuPath": false, "hideInBread": false }
"meta": { "title": "报修详情","authCode":"000501", "menuPath": false, "hideInBread": false }
}
]
}
......@@ -18,90 +18,90 @@
},
{
"path": "/documents/tousu", "name": "tousu",
"meta": { "title": "投诉信息", "menuPath": true, "menuIcon": "profile", "hideInBread": true },
"meta": { "title": "投诉信息","authCode":"0006", "menuPath": true, "menuIcon": "profile", "hideInBread": true },
"children": [
{
"path": "/documents/tousu/tousuQuestion", "name": "tousuQuestion",
"meta": { "title": "投诉问题排行", "menuIcon": "profile", "menuPath": true, "hideInBread": false },
"meta": { "title": "投诉问题排行","authCode":"000601", "menuIcon": "profile", "menuPath": true, "hideInBread": false },
"children": [
{
"path": "/documents/tousu/tousuQuestion/questionInfo", "name": "questionInfo",
"meta": { "title": "投诉问题列表", "menuPath": false, "hideInBread": false }
"meta": { "title": "投诉问题列表","authCode":"000601", "menuPath": false, "hideInBread": false }
},
{
"path": "/documents/tousu/tousuQuestion/tousuDetails", "name": "tousuDetails",
"meta": { "title": "投诉问题详情", "menuPath": false, "hideInBread": false }
"meta": { "title": "投诉问题详情","authCode":"00060101", "menuPath": false, "hideInBread": false }
}
]
},
{
"path": "/documents/tousu/tousuDensity", "name": "tousuDensity",
"meta": { "title": "投诉密度排行", "menuIcon": "profile", "menuPath": true, "hideInBread": false }
"meta": { "title": "投诉密度排行","authCode":"000602", "menuIcon": "profile", "menuPath": true, "hideInBread": false }
}
]
},
{
"path": "/documents/fiveSearch", "name": "fiveSearch",
"meta": { "title": "物业五查", "menuPath": true, "menuIcon": "profile", "hideInBread": true },
"meta": { "title": "物业五查", "menuPath": true,"authCode":"0007", "menuIcon": "profile", "hideInBread": true },
"children": [
{
"path": "/documents/fiveSearch/managerSelfCheckList", "name": "managerSelfCheckList",
"meta": { "title": "小区经理自查", "menuPath": true, "hideInBread": false},
"meta": { "title": "小区经理自查", "menuPath": true,"authCode":"000701", "hideInBread": false},
"children": [
{
"path": "/documents/fiveSearch/managerSelfCheckList/managerCheckList", "name": "managerCheckList",
"meta": { "title": "小区经理自查检查单列表", "menuPath": false, "hideInBread": false }
"meta": { "title": "小区经理自查检查单列表","authCode":"000701", "menuPath": false, "hideInBread": false }
},
{
"path": "/documents/fiveSearch/managerSelfCheckList/managerCheckInfo", "name": "managerCheckInfo",
"meta": { "title": "小区经理自查检查单详情", "menuPath": false, "hideInBread": false }
"meta": { "title": "小区经理自查检查单详情","authCode":"00070101", "menuPath": false, "hideInBread": false }
},
{
"path": "/documents/fiveSearch/managerSelfCheckList/managerAllIn", "name": "allIn",
"meta": { "title": "街道检查情况汇总", "menuPath": false, "hideInBread": false }
"meta": { "title": "街道检查情况汇总","authCode":"00070102", "menuPath": false, "hideInBread": false }
}
]
},
{
"path": "/documents/fiveSearch/doubleWeekCheckList", "name": "doubleWeekCheckList",
"meta": { "title": "物企双周查", "menuPath": true, "hideInBread": false },
"meta": { "title": "物企双周查","authCode":"000702", "menuPath": true, "hideInBread": false },
"children": [
{
"path": "/documents/fiveSearch/doubleWeekCheckList/doubleCheckList", "name": "doubleCheckList",
"meta": { "title": "物企双周查列表", "menuPath": false, "hideInBread": false }
"meta": { "title": "物企双周查列表","authCode":"000702" ,"menuPath": false, "hideInBread": false }
},
{
"path": "/documents/fiveSearch/doubleWeekCheckList/doubleCheckInfo", "name": "doubleCheckInfo",
"meta": { "title": "物企双周查详情", "menuPath": false, "hideInBread": false }
"meta": { "title": "物企双周查详情","authCode":"00070201", "menuPath": false, "hideInBread": false }
},
{
"path": "/documents/fiveSearch/doubleWeekCheckList/doubleAllIn", "name": "allIn",
"meta": { "title": "街道检查情况汇总", "menuPath": false, "hideInBread": false}
"meta": { "title": "街道检查情况汇总","authCode":"00070202", "menuPath": false, "hideInBread": false}
}
]
},
{
"path": "/documents/fiveSearch/mutableList", "name": "mutableList",
"meta": { "title": "整改单列表", "menuPath": true, "hideInBread": false },
"meta": { "title": "整改单列表","authCode":"000703", "menuPath": true, "hideInBread": false },
"children": [
{
"path": "/documents/fiveSearch/mutableList/info", "name": "mutableInfo",
"meta": { "title": "整改单详情", "menuPath": false, "hideInBread": false }
"meta": { "title": "整改单详情","authCode":"00070301", "menuPath": false, "hideInBread": false }
}
]
},
{
"path": "/documents/fiveSearch/monthList", "name": "month",
"meta": { "title": "房办月查", "menuIcon": "profile", "menuPath": true, "hideInBread": false },
"meta": { "title": "房办月查","authCode":"0006", "menuIcon": "profile", "menuPath": true, "hideInBread": false },
"children": [
{
"path": "/documents/fiveSearch/monthList/monthListSect", "name": "monthListSect",
"meta": { "title": "房办月查小区列表", "menuPath": false, "hideInBread": false },
"meta": { "title": "房办月查小区列表","authCode":"000704", "menuPath": false, "hideInBread": false },
"children": [
{
"path": "/documents/fiveSearch/monthList/monthListSect/monthInfo", "name": "monthInfo",
"meta": { "title": "检查详情", "menuPath": false, "hideInBread": false }
"meta": { "title": "检查详情","authCode":"00070401", "menuPath": false, "hideInBread": false }
}
]
}
......@@ -111,37 +111,37 @@
},
{
"path": "/documents/ledger", "name": "ledger",
"meta": { "title": "区房屋台账", "menuIcon": "profile", "menuPath": true, "hideInBread": false },
"meta": { "title": "区房屋台账","authCode":"0008", "menuIcon": "profile", "menuPath": true, "hideInBread": false },
"children": [
{
"path": "/documents/ledger/community", "name": "communityList",
"meta": { "title": "住宅房屋", "menuIcon": "profile", "menuPath": true, "hideInBread": false },
"meta": { "title": "住宅房屋","authCode":"000801", "menuIcon": "profile", "menuPath": true, "hideInBread": false },
"children": [
{
"path": "/documents/ledger/community/info", "name": "communityInfo",
"meta": { "title": "详情", "menuIcon": "profile", "menuPath": false, "hideInBread": false }
"meta": { "title": "详情","authCode":"00080101", "menuIcon": "profile", "menuPath": false, "hideInBread": false }
},
{
"path": "/documents/ledger/community/equipment", "name": "equipment",
"meta": { "title": "设备信息", "menuIcon": "profile", "menuPath": false, "hideInBread": false }
"meta": { "title": "设备信息","authCode":"000801010102", "menuIcon": "profile", "menuPath": false, "hideInBread": false }
},
{
"path": "/documents/ledger/community/building", "name": "communityBuilding",
"meta": { "title": "门牌幢列表", "menuIcon": "profile", "menuPath": false, "hideInBread": false }
"meta": { "title": "门牌幢列表","authCode":"0008010101", "menuIcon": "profile", "menuPath": false, "hideInBread": false }
}
]
},
{
"path": "/documents/ledger/NonResident", "name": "NonResident",
"meta": { "title": "非居房屋", "menuIcon": "profile", "menuPath": true, "hideInBread": false },
"meta": { "title": "非居房屋","authCode":"000802", "menuIcon": "profile", "menuPath": true, "hideInBread": false },
"children": [
{
"path": "/documents/ledger/NonResident/info", "name": "NonResidentInfo",
"meta": { "title": "非居详情", "menuIcon": "profile", "menuPath": false, "hideInBread": false }
"meta": { "title": "非居详情","authCode":"000802", "menuIcon": "profile", "menuPath": false, "hideInBread": false }
},
{
"path": "/documents/ledger/NonResident/building", "name": "NonResidentBuilding",
"meta": { "title": "非居门牌幢列表", "menuIcon": "profile", "menuPath": false, "hideInBread": false }
"meta": { "title": "非居门牌幢列表","authCode":"00080202", "menuIcon": "profile", "menuPath": false, "hideInBread": false }
}
]
}
......
......@@ -99,8 +99,6 @@ async function GetRoutes(router) {
}
}
// console.log(router)
for(let key in documents) {
for (let i = 0; i < documents[key].length; i++) {
let firstRouter = Object.assign({}, documents[key][i])
......@@ -114,6 +112,9 @@ async function GetRoutes(router) {
router.addRoutes([ parent ])
}
}
// console.log(router)
}
export default GetRoutes
......@@ -39,39 +39,92 @@ const appRoutes = [
},
{
path: '/systemManagement', name: 'systemManagement', component: resolve => require(['@/components/Layout/content-wrapper'], resolve), //ContentWrapper,
meta: { title: '系统管理', menuPath: true, menuIcon: 'profile', hideInBread: true },
meta: { title: '系统管理', menuPath: true, menuIcon: 'profile', authCode: '0000', hideInBread: true },
children: [
{ // 系统信息配置
path: '/systemManagement/sysInfoSetting', name: 'sysInfoSetting', component: resolve => require(['@/views/personal/sysInfoSetting'], resolve), //NonResidents,
meta: { title: '系统信息配置', menuPath: true, menuIcon: 'setting', hideInBread: false, },
meta: { title: '系统信息配置', menuPath: true, menuIcon: 'setting', authCode: '000001', hideInBread: false, },
// children: [
// ]
},
{ // 拓展信息管理
path: '/systemManagement/tbls', name: 'tbls', component: resolve => require(['@/views/houseData/tbls'], resolve), //Tbls,
meta: { title: '拓展信息管理', menuPath: true, menuIcon: 'setting', hideInBread: false, },
meta: { title: '拓展信息管理', menuPath: true, menuIcon: 'setting', authCode: '000002', hideInBread: false, },
},
{ // 角色管理
path: '/systemManagement/role', name: 'role', component: resolve => require(['@/views/personal/role/list'], resolve), //role,
meta: { title: '角色管理', authCode: '000903', menuPath: true, menuIcon: 'cluster', hideInBread: false, },
children: [
{
path: '/systemManagement/role/add', name: 'add', component: resolve => require(['@/views/personal/role/add'], resolve), //add,
meta: { title: '角色创建', hideInBread: false, authCode: '00090302', openMode: 'normal', menuPath: false, },
},
{
path: '/systemManagement/role/edit', name: 'edit', component: resolve => require(['@/views/personal/role/add'], resolve), //edit,
meta: { title: '角色修改', hideInBread: false, authCode: '00090304', openMode: 'normal', menuPath: false, },
children: [
{
path: '/systemManagement/role/look', name: 'look', component: resolve => require(['@/views/personal/role/add'], resolve), //look,
meta: { title: '角色查看', hideInBread: false, authCode: '00090301', openMode: 'normal', menuPath: false, }
}
]
},
]
},
{ // 用户管理
path: '/systemManagement/people', name: 'people', component: resolve => require(['@/views/personal/InternalStaff/index'], resolve), //people,
meta: { title: '用户管理', authCode: '000904', menuPath: true, menuIcon: 'setting', hideInBread: false, },
children: [
{
path: '/systemManagement/people/info', name: 'staffInfo', component: resolve => require(['@/views/personal/InternalStaff/info'], resolve), //staffInfo,
meta: { title: '账号详情', hideInBread: false, authCode: '00090401' },
},
{
path: '/systemManagement/people/createStaff', name: 'createStaff', component: resolve => require(['@/views/personal/InternalStaff/edit'], resolve), //createStaff,
meta: { title: '新增账号', hideInBread: false, authCode: '00090403'},
},
{
path: '/systemManagement/people/editStaff', name: 'editStaff', component: resolve => require(['@/views/personal/InternalStaff/edit'], resolve), //editStaff,
meta: { title: '修改账号', menuPath: true, hideInBread: false, authCode: '00090402'},
children: [
]
},
]
},
{ // 日志管理
path: '/systemManagement/rizhi', name: 'rizhi', component: resolve => require(['@/views/personal/rizhi/rizhiList'], resolve), //people,
meta: { title: '日志管理', authCode: '', menuPath: true, menuIcon: 'setting', hideInBread: false, },
children: [
{
path: '/systemManagement/rizhi/info', name: 'rizhiInfo', component: resolve => require(['@/views/personal/rizhi/info'], resolve), //staffInfo,
meta: { title: '日志管理详情', hideInBread: false, authCode: '' },
},
]
},
]
},
{
path: '/house', name: 'house', component: resolve => require(['@/components/Layout/content-wrapper'], resolve), // ContentWrapper,
meta: { title: '住宅信息', menuPath: true, menuIcon: 'profile', hideInBread: true, requirePerm: false, },
meta: { title: '住宅信息', menuPath: true, menuIcon: 'profile', hideInBread: true, requirePerm: false, authCode: '0001' },
children: [
{ // 小区列表
path: '/houseData/basicInfo', name: 'basicInfo', component: resolve => require(['@/views/houseData/basicInfo'], resolve), //basicInfo,
meta: { title: '小区列表', menuPath: true, hideInBread: false, },
meta: { title: '小区列表', menuPath: true, hideInBread: false, authCode: '000101' },
children: [
{
path: '/houseData/basicInfo/:id', name: 'basicView', component: resolve => require(['@/views/houseData/basicView'], resolve), //BasicView,
meta: { title: '小区详细情况', hideInBread: false, },
meta: { title: '小区详细情况', hideInBread: false, authCode: '00010101' },
},
{
path: '/houseData/buildings', name: 'buildings', component: resolve => require(['@/views/houseData/buildings'], resolve), //Buildings,
meta: { title: '门牌栋', hideInBread: false, },
meta: { title: '门牌栋', hideInBread: false, authCode: '00010103'},
children: [
{
path: '/houseData/buildings/:id', name: 'buildingView', component: resolve => require(['@/views/houseData/propertyInfoView'], resolve), //PropertyInfoView,
meta: { title: '门牌栋详情', hideInBread: false, }
meta: { title: '门牌栋详情', hideInBread: false, authCode: '00010103'}
}
]
},
......@@ -82,36 +135,32 @@ const appRoutes = [
{
path: '/houseData/shebei/:id', name: 'shebei', component: resolve => require(['@/views/houseData/shebei'], resolve), //Shebei,
meta: { title: '设施设备', menuPath: true, hideInBread: false, },
children: [
]
meta: { title: '设施设备', menuPath: true, hideInBread: false, authCode: '00010101' },
},
{
path: '/houseData/shebeikanyan/:id', name: 'shebeiKanyan', component: resolve => require(['@/views/xuhui/shebeiKanyan'], resolve), //Shebei,
meta: { title: '设施设备(勘验)', menuPath: true, hideInBread: false, },
children: [
]
meta: { title: '设施设备(勘验)', menuPath: true, hideInBread: false, authCode: '00010101' },
},
]
},
{//业委会列表
path: '/houseData/indCous', name: 'indCous', component: resolve => require(['@/views/houseData/indCous'], resolve), //IndCous,
meta: { title: '业委会信息列表', menuPath: true, hideInBread: false, },
meta: { title: '业委会信息列表', menuPath: true, hideInBread: false, authCode: '000102' },
children: [
{
path: '/houseData/indCou/:id', name: 'indCouView', component: resolve => require(['@/views/houseData/propertyInfoView'], resolve), //PropertyInfoView,
meta: { title: '业委会详细情况', menuPath: false, hideInBread: false, },
meta: { title: '业委会详细情况', menuPath: false, hideInBread: false, authCode: '00010201'},
},
{
path: '/houseData/members', name: 'members', component: resolve => require(['@/views/houseData/members'], resolve), //Members,
meta: { title: '业委会成员列表', hideInBread: false, },
meta: { title: '业委会成员列表', hideInBread: false, authCode: '00010202'},
children: [
{
path: '/houseData/member/:id', name: 'memberView', component: resolve => require(['@/views/houseData/propertyInfoView'], resolve), //PropertyInfoView,
meta: { title: '业委会成员详情', hideInBread: false, }
meta: { title: '业委会成员详情', hideInBread: false, authCode: '00010202'}
}
]
},
......@@ -119,41 +168,41 @@ const appRoutes = [
},
{//物业列表
path: '/houseData/propertyInfo', name: 'propertyInfo', component: resolve => require(['@/views/houseData/propertyInfo'], resolve), //PropertyInfo,
meta: { title: '物业企业列表', menuPath: true, hideInBread: false, },
meta: { title: '物业企业列表', menuPath: true, hideInBread: false, authCode: '000103' },
children: [
{
path: '/houseData/propertyInfo/:id', name: 'propertyInfoView', component: resolve => require(['@/views/houseData/propertyInfoView'], resolve), //PropertyInfoView,
meta: { title: '物业服务企业详细情况', hideInBread: false, }
meta: { title: '物业服务企业详细情况', hideInBread: false, authCode: '00010301' }
}
]
},
{ // 小区管理处
path: '/houseData/cmDivision', name: 'cmDivision', component: resolve => require(['@/views/houseData/cmDivision'], resolve), //CmDivision,
meta: { title: '小区管理处列表', menuPath: true, hideInBread: false, },
meta: { title: '小区管理处列表', menuPath: true, hideInBread: false, authCode: '000104' },
children: [
{
path: '/houseData/cmDivision/:id', name: 'cmDivisionView', component: resolve => require(['@/views/houseData/propertyInfoView'], resolve), //PropertyInfoView,
meta: { title: '小区管理处详细情况', menuPath: true, hideInBread: false, }
meta: { title: '小区管理处详细情况', menuPath: true, hideInBread: false, authCode: '00010401' }
}
]
},
{ // 小区经理
path: '/houseData/managers', name: 'managers', component: resolve => require(['@/views/houseData/managers'], resolve), //Managers,
meta: { title: '小区经理列表', menuPath: true, hideInBread: false, },
meta: { title: '小区经理列表', menuPath: true, hideInBread: false, authCode: '000105'},
children: [
{
path: '/houseData/managers/:id', name: 'managerView', component: resolve => require(['@/views/houseData/propertyInfoView'], resolve), //PropertyInfoView,
meta: { title: '小区经理详细情况', menuPath: false, hideInBread: false, }
meta: { title: '小区经理详细情况', menuPath: false, hideInBread: false, authCode: '00010501'}
},
]
},
{//居委会列表
path: '/houseData/neighborhoodCommittees', name: 'neighborhoodCommittees', component: resolve => require(['@/views/houseData/neighborhoodCommittees'], resolve), //neighborhoodCommittees,
meta: { title: '居委会信息列表', menuPath: true, hideInBread: false, },
meta: { title: '居委会信息列表', menuPath: true, hideInBread: false, authCode: '000106'},
children: [
{
path: '/houseData/neighborhoodCommittees/:id', name: 'neighborhoodCommitteesView', component: resolve => require(['@/views/houseData/propertyInfoView'], resolve), //PropertyInfoView,
meta: { title: '居委会详细情况', menuPath: false, hideInBread: false, },
meta: { title: '居委会详细情况', menuPath: false, hideInBread: false, authCode: '00010601'},
},
]
},
......@@ -161,23 +210,23 @@ const appRoutes = [
},
{
path: '/noN', name: 'feiju', redirect: { name: 'home' }, component: resolve => require(['@/components/Layout/content-wrapper'], resolve), //ContentWrapper,
meta: { title: '非居信息', menuPath: true, menuIcon: 'profile', hideInBread: true },
meta: { title: '非居信息', menuPath: true, menuIcon: 'profile', hideInBread: true, authCode: '0002' },
children: [
{ // 非居列表
path: '/houseData/nonResidents', name: 'nonResidents', component: resolve => require(['@/views/houseData/nonResidents'], resolve), //NonResidents,
meta: { title: '非居项目信息列表', menuPath: true, hideInBread: false, },
meta: { title: '非居项目信息列表', menuPath: true, hideInBread: false, authCode: '000201'},
children: [
{
path: '/houseData/nonResident/:id', name: 'nonResidentsView', component: resolve => require(['@/views/houseData/propertyInfoView'], resolve), //PropertyInfoView,
meta: { title: '非居详细情况', menuPath: false, hideInBread: false, }
meta: { title: '非居详细情况', menuPath: false, hideInBread: false, authCode: '000201' }
},
{
path: '/houseData/nonBuildingList', name: 'nonBuildingList', component: resolve => require(['@/views/houseData/nonBuildingList'], resolve), //PropertyInfoView,
meta: { title: '非居门牌幢列表', menuPath: false, hideInBread: false, },
meta: { title: '非居门牌幢列表', menuPath: false, hideInBread: false, authCode: '000201' },
children: [
{
path: '/houseData/nonBuildingList/nonBuildingInfo/:id', name: 'nonBuildingInfo', component: resolve => require(['@/views/houseData/propertyInfoView'], resolve), //PropertyInfoView,
meta: { title: '非居门牌幢详情', menuPath: false, hideInBread: false, }
meta: { title: '非居门牌幢详情', menuPath: false, hideInBread: false, authCode: '000201' }
}
]
},
......
......@@ -205,5 +205,33 @@ export default {
GET_LABEL_LIST: MOCK_URL + '/service-customkey-ddd/labels', // 获取标签列表
GET_FB_WY_MANAGE_CHECK: '/service-documents-ddd/checkOrder/dahboard/countDatas', //首页-房办月查-物业双周查-经理自查
//角色管理
GET_ROLE_LIST: '/service-permission/roles', //获取角色列表
ROLE_DETAIL: '/service-account/accounts', // 查询角色权限
GET_USER_PEIMISSION: '/service-permission/user/perms', // 当前用户角色权限树 -- 传userId
GET_ALL_PEIMISSION: '/service-permission/perms', // 全部角色权限树
GET_ALL_ROLE: '/service-permission/menu/tree', //获取权限
GET_USER_CODE: '/service-permission/user/menus/code', //获取用户权限
ROLE_DETAIL: '/service-permission/roles/{id}', // 查询角色权限
ADD_ROLE_POST: '/service-permission/role', // 新增角色
PUT_CHARACTER: '/service-permission/role/{id}', //编辑角色
GET_CHARACTER: '/service-permission/role/{id}', //查看角色
DELETE_CHARACTER: '/service-permission/role/{id}', //删除角色
//用户管理
GET_STAFF_LIST: '/service-user-ddd/users', //获取内部人员列表
PUT_STAFF_PWD: '/service-user-ddd/reset/pwd', //内部人员密码修改
GET_USER_DETAIL: '/service-user-ddd/user/{id}', //查询用户账号详情
POST_ADD_USER: '/service-user-ddd/user', //管理员新增用户
// PUT_STAFF_LIST: '/service-user-ddd/user', //修改内部人员列表
GET_USERNAME_EXIST: '/service-user-ddd/public/check/username/exist', //校验用户名是否存在
GET_CHECK_PHONE_EXIST: '/public/check/phone/exist', //判断手机是否存在
GET_REDIS: '/service-user-ddd/user/refresh/{id}', //后台刷新redis
//日志管理
GET_RIZHI: '/service-log/operateRecord', //日志列表
GET_RIZHI_INFO: '/service-log/operateRecord/{id}', //日志详情
}
......@@ -6,6 +6,45 @@ import Vue from 'vue'
/** 公共方法 */
export default {
/**
* 用户状态 0:正常、1:禁用、2:已冻结、3:已注销
* @param {*} 接口返回的状态名称
* @returns 返回tag的颜色类型
*/
checkUserStatusTags(value, status = value.toString()) {
switch (status) {
case '0':
return {
txt: '待分配',
color: 'warning'
}
break
case '1':
return {
txt: '正常',
color: 'processing'
}
break
case '9':
return {
txt: '注销',
color: 'error'
}
break
case '8':
return {
txt: '已注销',
color: 'default'
}
break
default:
return {
txt: '-',
color: 'default'
}
break
}
},
/**
* 在深层数据结构中取值(为了替代类似 res && res.data && res.data.content这种写法)
* @param {Object} obj [必填-需要取值的目标对象(例:res)]
......
import cryptoJs from 'crypto-js'
import Md5 from 'js-md5'
const CBCKEY = Md5('AcquisitHouseInformation')
const CBCIV = CBCKEY.slice(0, 8)
// DES加密 -- CBC模式
export const encryptDes = (message) => {
let keyHex = cryptoJs.enc.Utf8.parse(CBCKEY)
let ivHex = cryptoJs.enc.Utf8.parse(CBCIV)
let option = { iv: ivHex, mode: cryptoJs.mode.CBC, padding: cryptoJs.pad.Pkcs7 }
let encrypted = cryptoJs.DES.encrypt(message, keyHex, option)
return encrypted.ciphertext.toString()
}
// DES解密 -- CBC模式
export const decryptDes = (message) => {
let keyHex = cryptoJs.enc.Utf8.parse(CBCKEY)
let ivHex = cryptoJs.enc.Utf8.parse(CBCIV)
let decrypted = cryptoJs.DES.decrypt(
{
ciphertext: cryptoJs.enc.Hex.parse(message)
},
keyHex,
{
iv: ivHex,
mode: cryptoJs.mode.CBC,
padding: cryptoJs.pad.Pkcs7
}
)
return decrypted.toString(cryptoJs.enc.Utf8)
}
......@@ -10,6 +10,14 @@ export const permission = {
this.$ajax.get({
url: this.$api.GET_USER_INFO
}).then(res => {
//后台刷新redis
this.$ajax.get({
url: this.$api.GET_REDIS.replace('{id}', res.data.content.id),
}).then(res => {
if (res.code == '200') {
console.log(1)
}
})
// 本地存储用户基本信息
let userInfo = res.data.content, name, oldSysAuthCode, isAllPerm = false
if(!res.data || !res.data.content){
......@@ -26,13 +34,13 @@ export const permission = {
// 获取用户是否为超级管理权限
isAllPerm = userInfo.isAllPerm?userInfo.isAllPerm:false
}
// 此处应API获取用户权限信息,先暂写死权限信息
// 预设用户权限菜单
let authCodeList = []
const authMenuAll = []
this.$ajax.get({
url: this.$api.GET_USER_PEIMISSION
url: this.$api.GET_USER_CODE
}).then(res => {
// 当前用户全部权限编码,包含菜单及功能操作
if(res.data!=undefined && res.data!=null && res.data.content!=undefined && res.data.content!=null){
......@@ -58,6 +66,7 @@ export const permission = {
// vuex中不存在,需重新获取
let authMenuAll = [], authCodeList=[]
// console.log(routes, 'routes')
if(isAllPerm){ //有全部权限
authMenuAll = getAllSideMenu(routes)
......@@ -67,12 +76,16 @@ export const permission = {
// 从vuex中取出存入的权限码,若不存在重新声明
authCodeList = this.$store.state.permissionCodeList.length>0 ? this.$store.state.permissionCodeList:[]
// console.log(authCodeList, 'authCodeList')
if(authCodeList.length>0){ //vuex中存有权限码信息
authMenuAll = getSideMenu(routes, authCodeList)
// console.log(authMenuAll)
this.$store.commit('SET_MENU', {authMenuAll, authCodeList, isAllPerm})
}else{ // vuex中不存在权限码信息,需重新调用接口再获取
this.$ajax.get({
url: this.$api.GET_USER_PEIMISSION,
url: this.$api.GET_USER_CODE,
params: {}
}).then(res => {
// 当前用户全部权限编码,包含菜单及功能操作
......@@ -208,13 +221,13 @@ function getAllSideMenu(allRouter) {
*/
function getSideMenu(allRouter, authCodeList) {
let authMenu = []
authCodeList2 = authCodeList ? authCodeList : []
authCodeList = authCodeList ? authCodeList : []
allRouter.forEach((router) => {
let menu = {}
if (router.meta && router.meta.menuPath) {
if (!!router.meta.authCode) {
if (common.oneOf(router.meta.authCode, authCodeList2)) {
if (common.oneOf(router.meta.authCode, authCodeList)) {
// console.log(router.name)
menu = {
name: router.name,
meta: router.meta
......@@ -228,10 +241,10 @@ function getSideMenu(allRouter, authCodeList) {
}
}
if (router.children && router.children.length > 0) {
const children = getSideMenu(router.children, authCodeList2)
let children = getSideMenu(router.children, authCodeList)
if (children.length > 0) {
if (!menu.name) {
authMenu = authMenu.concat(children)
authMenu = authMenu.concat(children)
return authMenu
}else{
menu.children = [].concat(children)
......
......@@ -2,7 +2,7 @@ import store from '@/store'
// import api from '@/server/api'
export const PermissionFilter = (value) => {
value2 = value + ''
value = value + ''
if (store.state.hasAllRight) { // 如果有全部权限则一律通过
return true
}
......@@ -14,7 +14,7 @@ export const PermissionFilter = (value) => {
if (!btnPermissionsArr || btnPermissionsArr.length<=0) {
return false
}
if (btnPermissionsArr.indexOf(value2) >= 0) {
if (btnPermissionsArr.indexOf(value) >= 0) {
isExist = true
}
return isExist
......
<template>
<div>
<!-- <p class="operatorInfo"><span class="label">级别:&nbsp;</span>{{getLv}}</p> -->
<p class="operatorInfo"><span class="label">创建人:&nbsp;</span>{{getCreator}}</p>
<p class="operatorInfo"><span class="label">最后修改人:&nbsp;</span>{{getLastOperator}}</p>
</div>
</template>
<script>
import roleLevels from '@/config/roleLevels.json'
export default {
props: {
creator: {
type: String
},
lastOperator: {
type: String
},
level: {
type: Number
},
},
data(){
return {
roleLevels,
}
},
computed: {
getLv(){
if(!this.level) return '暂无'
for(let i=0;i<this.roleLevels.length;i++){
if(this.level == this.roleLevels[i].level){
return this.roleLevels[i].levelName
}
}
},
getCreator(){
return this.creator || '初始化数据'
},
getLastOperator(){
return this.lastOperator || '暂无'
}
}
}
</script>
<style scoped>
.operatorInfo {font-size:12px; margin:0; }
.operatorInfo .label{ color: rgba(0, 0, 0, 0.4)}
</style>
<template>
<!-- 重置密码表单 -->
<a-modal :maskClosable="false" cancelText="取消" okText="确认" @ok="handleResetOk" @cancel="handleCancel" :width="465"
title="重置密码" :visible="isShow">
<a-form :form="resetData">
<a-row>
<a-col span="24">
<a-form-item label="新密码" v-bind="colSpe">
<a-input :type="pswType" @focus="pswType = 'password'" placeholder="新密码需大于6位且含字母和数字" autocomplete="off"
v-decorator="['newPwd',rules.newPwd]">
</a-input>
</a-form-item>
</a-col>
<a-col offset='6' span="16" v-if="isShow">
<testStrong id="strong" :width="90" :pwd='!resetData.getFieldValue("newPwd")?"":resetData.getFieldValue("newPwd")' v-show='passwordStrength'></testStrong>
</a-col>
<a-col span="24">
<a-form-item label="重复密码" v-bind="colSpe">
<a-input :type="pswType" placeholder="再次输入新密码" @blur="handleConfirmBlur" autocomplete="off" @focus="pswType = 'password'"
v-decorator="[ 'rePassword',rules.rePassword]">
</a-input>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-modal>
</template>
<script>
import testStrong from '@/components/testPwd'
export default {
components: {
testStrong
},
props: [ 'resetPwdShow' ],
beforeCreate() {
this.resetData = this.$form.createForm(this)
},
data() {
return {
passwordStrength: false,
pswType: 'text',
isShow: false,
colSpe: {
labelCol: {
span: 6
},
wrapperCol: {
span: 16
}
},
confirmDirty: false,
rules: {
newPwd: {
validateTrigger: 'blur',
rules: [ {
required: true,
validator: this.validateToNextPassword,
} ]
},
rePassword: {
validateTrigger: 'blur',
rules: [ {
required: true,
whitespace: true,
message: '请再次输入新密码!'
}, {
validator: this.compareToFirstPassword,
} ]
}
}
}
},
watch: {
resetPwdShow() {
this.isShow = this.resetPwdShow
}
},
methods: {
handleResetOk() {
// console.log( this.resetData.getFieldsValue())
this.resetData.validateFields((err, values) => {
if (!err) {
// console.log(values)
this.$emit('on-ok', values)
}else{
this.$com.getFormValidErrTips(this, err)
}
})
},
//密码重复密码校验
validateToNextPassword(rule, value, callback) {
const form = this.resetData
if (!value || value == undefined || value.split(' ').join('').length === 0) {
callback('请输入新密码!')
this.passwordStrength = false
} else {
if (!this.$com.checkPassword(value)) {
callback('请输入6位以上的数字字母组合!')
this.passwordStrength = false
} else {
if (value && this.confirmDirty) {
form.validateFields([ 'rePassword' ], {
force: true
})
}
callback()
this.passwordStrength = true
}
}
},
compareToFirstPassword(rule, value, callback) {
const form = this.resetData
if (value && value !== form.getFieldValue('newPwd')) {
callback('密码输入不一致!')
} else {
callback()
}
},
handleConfirmBlur(e) {
const value = e.target.value
this.confirmDirty = this.confirmDirty || !!value
},
handleCancel() {
this.$emit('on-cancel')
},
resetForm() {
this.confirmDirty=false
this.passwordStrength=false
this.resetData.resetFields()
}
}
}
</script>
<style>
</style>
......@@ -29,24 +29,24 @@
bordered
>
<span slot="action" slot-scope="text, record">
<span class="actionBtn" @click="$parent.toView(record)">查看 </span>
<span class="actionBtn" @click="$parent.toView(record)" v-if="$permission(formatPermission())">查看 </span>
<a-dropdown :trigger="['click']" v-if="customKeyEnable == 'true' || $route.name=='basicInfo' || $route.name=='propertyInfo' || $route.name=='indCous'">
<a class="ant-dropdown-link" href="#">| 更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item key="0" v-if="$route.name == 'basicInfo' || $route.name == 'nonResidents'">
<a @click="$parent.toBul(record)"> 门牌幢 </a>
<a @click="$parent.toBul(record)" v-if="$permission('00010103')"> 门牌幢 </a>
</a-menu-item>
<!-- <a-menu-item key="1" v-if="$route.name == 'basicInfo'">
<a @click="$parent.toShebei(record)"> 设施设备 </a>
</a-menu-item> -->
<a-menu-item key="2" v-if="$route.name == 'indCous'">
<a @click="$parent.toMem(record)"> 成员列表 </a>
<a @click="$parent.toMem(record)" v-if="$permission('00010202')"> 成员列表 </a>
</a-menu-item>
<a-menu-item key="3" v-if="$route.name == 'propertyInfo'">
<a-menu-item key="3" v-if="$route.name == 'propertyInfo'&&$permission('00010302')">
<a @click="$parent.toList(record.cspId)"> 小区列表 </a>
</a-menu-item>
<a-menu-item key="4" v-if="customKeyEnable == 'true'">
<a @click="showModal(record)"> 拓展信息维护</a>
<a @click="showModal(record)" v-if="$permission('00010104')"> 拓展信息维护</a>
</a-menu-item>
</a-menu>
</a-dropdown>
......@@ -117,6 +117,33 @@ export default {
},
},
methods: {
formatPermission(){
let permissionNum = null
switch (this.$route.name) {
case 'basicInfo':
permissionNum = '00010101'
break
case 'indCous':
permissionNum = '00010201'
break
case 'propertyInfo':
permissionNum = '00010301'
break
case 'cmDivision':
permissionNum = '00010401'
break
case 'managers':
permissionNum = '00010501'
break
case 'neighborhoodCommittees':
permissionNum = '00010601'
break
default:
break
}
return permissionNum
},
selKeysNew(val) { //重新赋值选中项数组
this.selKeysList = val
},
......
<template>
<span >
{{roleNames}}
</span>
</template>
<script>
export default {
props: {
userInfo: {
type: Object,
default: null
}
},
data(){
return {
roleNames: ''
}
},
methods: {
getRoleName(){
if (!this.userInfo||!this.userInfo.roleIds) return
this.roleNames = ''
this.userInfo.roleIds.split(',').forEach(ele => {
this.roleList.forEach(item => {
if (item.id == ele) {
this.roleNames = item.roleName
}
})
})
}
},
mounted(){
this.getRoleName()
},
computed: {
roleList(){
return this.$store.state.roleList
}
}
}
</script>
<template>
<span class="user-status">
<a-badge :status="$com.checkUserStatusTags(status).color" :text="$com.checkUserStatusTags(status).txt" />
</span>
</template>
<script>
export default {
props: {
status: {
type: String,
default: null
}
}
}
</script>
<style>
.user-status .ant-badge-status-dot{
width:9px;height:9px;
}
</style>
// 小区列表
<template>
<div class="routerWapper">
<div v-if="$route.path == '/houseData/basicInfo'" class="layoutMargin layoutPadding">
<div v-if="$route.path == '/houseData/basicInfo' && $permission('000101')" class="layoutMargin layoutPadding">
<a-form :form="form" class="protalForm" >
<a-row class="formItem" type="flex" :justify="simpleSearchForm ? 'end' : ''" align="top" :gutter="simpleSearchForm ? 16 : 0">
<a-col span="8">
......@@ -131,7 +131,7 @@
<!-- 功能按钮区 -->
<a-col span="24" class="algin-right">
<a-button v-if="!$store.state.isXuhui && $api.BASE_URL.indexOf('10.220.105.137')!=-1" @click="exportEWM">导出二维码</a-button>
<a-button @click="exportList">导出数据</a-button>
<a-button v-if="$permission('00010102')" @click="exportList">导出数据</a-button>
<a-button @click="reset">重置</a-button>
<a-button type="primary" @click="search">搜索</a-button>
<a-button
......
// 小区详情
<template>
<div class="routerWapper">
<div v-if="$route.name =='basicView' || $route.name =='basicView1'" class="portalDetailWapper">
<div v-if="$route.name =='basicView' || $route.name =='basicView1' && $permission('00010101')" class="portalDetailWapper">
<div class="portalDetailContentWapper">
<div class="portalDetailTitle">
<span class="title">查看小区详情</span>
......
// 门牌幢列表
<template>
<div class="routerWapper">
<div class="portalDetailTitle" v-if="$route.name=='buildings'">
<div class="portalDetailTitle" v-if="$route.name=='buildings'&&$permission('00010103')">
<span class="title">小区门牌栋信息查询</span>
<div class="detailOperations">
<a-button @click="backPage"> 返回 </a-button>
......
// 小区管理处列表
<template>
<div v-if="$route.name == 'cmDivision'" class="layoutMargin layoutPadding">
<div v-if="$route.name == 'cmDivision'&&$permission('000104')" class="layoutMargin layoutPadding">
<a-form :form="form" class="protalForm" >
<a-row class="formItem" type="flex" align='top' :gutter="18">
<a-col span="8">
......@@ -33,7 +33,7 @@
</template>
<!-- 功能按钮区 -->
<a-col span="24" class="algin-right">
<a-button @click="exportList">导出数据</a-button>
<a-button @click="exportList" v-if="$permission('00010403')">导出数据</a-button>
<a-button @click="reset">重置</a-button>
<a-button type="primary" @click="search">搜索</a-button>
</a-col>
......
// 业委会列表
<template>
<div class="routerWapper">
<div v-if="$route.name == 'indCous'" class="layoutMargin layoutPadding">
<div v-if="$route.name == 'indCous' && $permission('000102')" class="layoutMargin layoutPadding">
<a-form :form="form" class="protalForm" >
<a-row class="formItemLine" type="flex" align='top' :gutter="18">
<a-col span="6">
......@@ -68,7 +68,7 @@
</template>
<!-- 功能按钮区 -->
<a-col span="24" class="algin-right">
<a-button @click="exportList">导出数据</a-button>
<a-button @click="exportList" v-if="$permission('00010204')">导出数据</a-button>
<a-button @click="reset">重置</a-button>
<a-button type="primary" @click="search">搜索</a-button>
</a-col>
......
// 小区经理列表
<template>
<div class="routerWapper">
<div v-if="$route.name=='managers'||$route.name=='managers1'" class="layoutMargin layoutPadding">
<div v-if="$route.name=='managers'||$route.name=='managers1' && $permission('000105')" class="layoutMargin layoutPadding">
<a-form :form="form" class="houseForm" >
<a-row class="formItemLine" type="flex" align='top' :gutter="18">
<a-col span="8">
......@@ -37,7 +37,7 @@
</a-col>
</template>
<a-col span="24" class="algin-right">
<a-button @click="exportList">导出数据</a-button>
<a-button @click="exportList" v-if="$permission('00010503')">导出数据</a-button>
<a-button @click="reset">重置</a-button>
<a-button type="primary" @click="search">搜索</a-button>
</a-col>
......
// 业委会成员列表
<template>
<div class="routerWapper">
<div class="portalDetailTitle" v-if="$route.name=='members'">
<div class="portalDetailTitle" v-if="$route.name=='members'&&$permission('00010202')">
<span class="title"> 业委会成员列表 </span>
<div class="detailOperations">
<a-button @click="backPage"> 返回 </a-button>
......
// 居委委会列表
<template>
<div class="routerWapper">
<div v-if="$route.name == 'neighborhoodCommittees'" class="layoutMargin layoutPadding">
<div v-if="$route.name == 'neighborhoodCommittees'&&$permission('000106')" class="layoutMargin layoutPadding">
<a-form :form="form" class="protalForm" >
<a-row class="formItemLine" type="flex" align='top' :gutter="18">
<a-col span="8" >
......@@ -27,7 +27,7 @@
</template>
<!-- 功能按钮区 -->
<a-col span="24" class="algin-right">
<!-- <a-button @click="exportList">导出数据</a-button> -->
<!-- <a-button @click="exportList" v-if="$permission('00010603')">导出数据</a-button> -->
<a-button @click="reset">重置</a-button>
<a-button type="primary" @click="search">搜索</a-button>
</a-col>
......
// 非居门牌幢列表
<template>
<div class="routerWapper">
<div v-if="$route.name == 'nonBuildingList'" >
<div v-if="$route.name == 'nonBuildingList'&&$permission('000201')" >
<div class="portalDetailContentWapper">
<div class="portalDetailTitle">
<span class="title">{{$route.query.stName}} 门牌幢</span>
......
// 非居列表
<template>
<div class="routerWapper">
<div v-if="$route.name == 'nonResidents'" class="layoutMargin layoutPadding">
<div v-if="$route.name == 'nonResidents'&&$permission('000201')" class="layoutMargin layoutPadding">
<a-form :form="form" class="protalForm" >
<a-row class="formItemLine" type="flex" align='top' :gutter="18">
<a-col span="8">
......@@ -37,7 +37,7 @@
</a-col>
</template>
<a-col span="24" class="algin-right">
<a-button @click="exportList">导出数据</a-button>
<a-button @click="exportList" v-if="$permission('000203')">导出数据</a-button>
<a-button @click="reset">重置</a-button>
<a-button type="primary" @click="search">搜索</a-button>
</a-col>
......
// 物企列表
<template>
<div class="routerWapper">
<div v-if="$route.name == 'propertyInfo'" class="layoutMargin layoutPadding">
<div v-if="$route.name == 'propertyInfo' && $permission('000103')" class="layoutMargin layoutPadding">
<a-form :form="form" class="protalForm" >
<a-row class="formItem" type="flex" align='top' :gutter="18">
<!-- <a-col span="10">
......@@ -40,7 +40,7 @@
</template>
<!-- 功能按钮区 -->
<a-col span="24" class="algin-right">
<a-button @click="exportList">导出数据</a-button>
<a-button @click="exportList" v-if="$permission('00010304')">导出数据</a-button>
<a-button @click="reset">重置</a-button>
<a-button type="primary" @click="search">搜索</a-button>
</a-col>
......
<template>
<div class="routerWapper">
<div class="layoutMargin layoutPadding" v-if="$route.name == 'tbls'">
<div class="layoutMargin layoutPadding" v-if="$route.name == 'tbls'&& $permission('000002')">
<a-row>
<a-col :span="3" style="border-right:1px solid #ccc;height:100%; position:relative">
<span class="menu_header">拓展信息管理列表</span>
<a-menu mode="vertical" :selectedKeys="selectedKeys">
<a-menu-item :key="k" v-for="(item,k) in tblsLists" @click="clickMenu(k)">
<a-menu-item :key="k" v-show="$permission(formatPermission(item))" v-for="(item,k) in tblsLists" @click="clickMenu(k)">
{{item}}
</a-menu-item>
</a-menu>
......@@ -15,7 +15,7 @@
<a-form class="protalForm" :form="searchForm" >
<a-row type="flex" justify="space-between" align="middle">
<a-col span="6" >
<a-button class="addZiduan" type="primary" @click="showModal()" ghost >新增字段</a-button>
<a-button class="addZiduan" v-if="$permission(formatDeletePermission())" type="primary" @click="showModal()" ghost >新增字段</a-button>
<div >
<a-modal :title="!isChangeZdy ? '新增字段':'修改字段'" v-model="visible" @cancel="handleCancel" @ok="handleOk">
<a-form class="protalForm" :form="form" >
......@@ -86,11 +86,11 @@
<!-- table -->
<a-table bordered class="portalTable" :dataSource="taskCollectList" :columns="columns" size="small" :pagination="pagination">
<span slot="action" slot-scope="text, record">
<span class="actionBtn" @click="showDelModal(record)">删除<a-divider type="vertical" /></span>
<span class="actionBtn" v-if="$permission(formatDeletePermission())" @click="showDelModal(record)">删除<a-divider type="vertical" /></span>
<a-modal title="警告" v-model="visibleDel" @ok="del(record)">
<p>该字段可能已被使用,是否确定删除?</p>
</a-modal>
<span class="actionBtn" @click="setKey(record)">修改</span>
<span class="actionBtn" v-if="$permission(formatDeletePermission())" @click="setKey(record)">修改</span>
</span>
</a-table>
......@@ -200,6 +200,90 @@ export default {
}
},
methods: {
formatPermission(item){
let permissionNum = null
switch (item) {
case '小区':
permissionNum = '00000201'
break
case '门牌幢':
permissionNum = '00000202'
break
case '设施设备':
permissionNum = '00000203'
break
case '物业企业':
permissionNum = '00000204'
break
case '业主大会':
permissionNum = '00000205'
break
case '业委会成员':
permissionNum = '00000206'
break
case '小区管理处':
permissionNum = '00000209'
break
case '小区经理':
permissionNum = '00000210'
break
case '居委会信息':
permissionNum = '00000211'
break
case '非居信息':
permissionNum = '00000212'
break
case '非居门牌幢信息':
permissionNum = '00000213'
break
default:
break
}
return permissionNum
},
formatDeletePermission(){
let deletePermissionNum = null
switch (this.selectedKeys[0]) {
case 'tbl_community':
deletePermissionNum = '0000020102'
break
case 'tbl_building':
deletePermissionNum = '0000020202'
break
case 'tbl_facilities_equipment':
deletePermissionNum = '0000020302'
break
case 'tbl_prop_company':
deletePermissionNum = '0000020402'
break
case 'tbl_industry_council':
deletePermissionNum = '0000020502'
break
case 'tbl_ic_member':
deletePermissionNum = '0000020602'
break
case 'tbl_community_amst_office':
deletePermissionNum = '0000020902'
break
case 'tbl_community_manager':
deletePermissionNum = '0000021002'
break
case 'tbl_residents_committees':
deletePermissionNum = '0000021102'
break
case 'tbl_non_resident':
deletePermissionNum = '0000021202'
break
case 'tbl_non_resident_building':
deletePermissionNum = '0000021302'
break
default:
break
}
return deletePermissionNum
},
//默认时间框
chooseDate(date, dateString) {
},
......
......@@ -84,7 +84,7 @@ export default {
this.$ajax.post({
url: this.$api.POST_LOGIN,
params,
}).then(res => {
}).then(res => {
const store = JSON.parse(sessionStorage.getItem('VuexStore'))
if (store) store.content = ''
sessionStorage.setItem('VuexStore', JSON.stringify(store))
......
<template>
<div class="portalDetailWapper">
<div class="portalDetailTitle">
<span class="title">{{fromCenter ? '账户基本信息修改' : $route.meta.title}}</span>
<div class="detailOperations">
<a-button @click='handleReturn'>返回</a-button>
<a-button type="primary" @click='handleAdd' html-type="submit">保存</a-button>
</div>
</div>
<div class="portalDetailContentWapper">
<a-form class="protalForm portalDetailContentBody" :form="searchForm">
<div class="layoutMargin layoutPadding detailsPartSection">
<a-row class="formItemLine">
<a-col span="8">
<a-form-item class="formItem" label="姓名" v-bind="colSpe">
<a-input placeholder="请输入" v-decorator="['name',{
validateTrigger: 'blur', rules: [ { required: true, message : '请输入姓名' } ]
}]" />
</a-form-item>
</a-col>
<a-col span="8">
<a-form-item class="formItem" label="手机" v-bind="colSpe">
<a-input placeholder="请输入手机号" :disabled="fromCenter" v-decorator="['phone',{
validateTrigger: 'blur', rules: [ { required : true, validator: this.validatePhone } ]
}]" />
</a-form-item>
</a-col>
<a-col span="8">
<a-form-item class="formItem" label="邮箱" v-bind="colSpe">
<a-input placeholder="请输入" v-decorator="['mail',{
validateTrigger: 'blur'
}]" />
</a-form-item>
</a-col>
</a-row>
<a-row class="formItemLine">
<a-col span="8">
<a-form-item label="机构类型" v-bind="colSpe">
<a-select placeholder="请选择" allowClear mode="multip" v-decorator="['orgType', {initialValue:'房办',
validateTrigger: 'change', rules: [ { required: true, message: '请选择机构类型!' } ]
}]">
<a-select-option value="2">房办</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col span="8">
<a-form-item label="机构名称" v-bind="colSpe">
<a-select placeholder="请选择" allowClear mode="multi" v-decorator="['DorgId', {
validateTrigger: 'change', rules: [ { required: true, message: '请选择机构名称!' } ]
}]">
<a-select-option v-for="(item,index) in orgnazation" :key="index" :value="item.id+'#'+item.hoName">{{item.hoName}}</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row class="formItemLine">
<a-col span="8" >
<a-form-item label="角色名称" v-bind="colSpe">
<a-select placeholder="请选择" @change="roleChange" allowClear mode="multiple" labelInValue v-decorator="['notes']
">
<a-select-option v-for="(item,index) in roleList" :key="index" :value="item.id">{{item.roleName}}</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<div class="layoutMargin detailsPartLine">
<a-tree class="portalRoleTree" checkable disabled :treeData="treeData" v-model="checkedKeys" />
</div>
</div>
</a-form>
</div>
</div>
</template>
<script>
export default {
beforeCreate() {
this.searchForm = this.$form.createForm(this)
},
data() {
return {
exclusionRoleIds: [ '999999', ],
userRoldIDsOrg: [],
orgnazation: [],
colSpe: {
labelCol: {
span: 6
},
wrapperCol: {
span: 15
}
},
checkedKeys: [],
treeData: [],
administrativeRegions: [],
roleList: [],
roles: [],
// 是否从个人中心-账户信息跳转过来的
fromCenter: true,
}
},
created(){
// 从个人中心-账户信息跳过来的不能修改手机号
this.fromCenter = !!this.$route.query.id
},
mounted() {
this.$ajax.get({
url: this.$api.GET_HOS_LIST,
params: {
pageSize: 1000,
sectType_in: 1
}
}).then(res => {
if (res.code == '200') {
this.orgnazation = res.data.content
console.log(this.orgnazation)
}
})
this.getTree()
this.getRoleLists()
},
methods: {
// 查询权限树
getTree() {
this.$ajax.get({
url: this.$api.GET_ALL_ROLE + '?isTree=true'
}).then(res => {
const data = res.data.content
data.forEach((item, index) => {
this.treeData.push(this.getTreeData(item, index))
})
})
},
// 整理权限树
getTreeData(item, index) {
const childrenNode = {
title: item.permName,
key: item.id,
value: item.id
}
if (item.childList && item.childList.length) {
childrenNode.children = []
item.childList.forEach((subItem, subIndex) => {
const subkey = subItem.id
childrenNode.children.push(this.getTreeData(subItem, subkey))
})
}
return childrenNode
},
handleReturn() {
this.$router.back()
},
//添加账户
handleAdd() {
this.searchForm.validateFields((err, values) => {
values={...values, status: 1, roleIds: ''} // 直接启用账户
console.log(values)
if (values.phone1 ) {
values.phone+=','+ values.phone1 +','
}
if (values.phone2) {
values.phone+= values.phone2
}
values.orgId = this.searchForm.getFieldValue('DorgId').split('#')[0]
values.orgName = this.searchForm.getFieldValue('DorgId').split('#')[1]
values.notes.forEach((item, index) => {
if (index == 0) {
values.roleIds += item.key
return
}
values.roleIds += ','+ item.key
})
values.roleNames = ''
values.notes.forEach((ele, index) => {
if (index == 0) {
values.roleNames += ele.label
}else{
values.roleNames += ','+ ele.label
}
})
if (!err) {
if (!this.$route.query.id) {
this.$ajax.post({
url: this.$api.POST_ADD_USER,
params: {...values, type: this.$route.query.personType}
}).then(res => {
if (res.code == '200') {
this.$message.success('新增成功!')
this.$router.push({
name: 'people'
})
}
})
} else {
this.$ajax.put({
url: this.$api.GET_USER_DETAIL.replace('{id}', this.$route.query.id),
params: {...values, id: this.$route.query.id}
}).then(res => {
if (res.code == '200') {
this.$message.success('修改成功!')
this.$router.push({
name: 'people'
})
}
})
}
} else {
this.$com.getFormValidErrTips(this, err)
}
})
},
//获取当前登录账号可操作的角色列表 供多选框选择
getRoleLists() {
const curUserRoles = this.$store.state.userInfos.roleIds
console.log(this.$store.state)
const sparams = {
pageNo: 1,
pageSize: 10000
}
if (!this.$store.state.userInfos.isAllPerm ) {
if(!!curUserRoles){
sparams.id_in = curUserRoles
}
}
this.$ajax.get({
url: this.$api.GET_ROLE_LIST,
params: sparams
}).then(res => {
this.roleList = this.$com.confirm(res, 'data.content', []) // 得到当前账号可支配全部角色 供多选框选择
//如果路由有id则为修改数据-- 去获取对应数据渲染
if (this.$route.query.id) {
this.getDetail()
}
})
},
// 角色切换
roleChange(item) {
let treeRoles = []
this.userRoldIDsOrg.forEach((userRoldId) => {
if(this.$com.oneOf(userRoldId.key, this.exclusionRoleIds)){
treeRoles.push(userRoldId)
}
})
this.roles = item
treeRoles = item.concat(treeRoles)
if (treeRoles.length != 0) {
const params = treeRoles.map((it) => {
return it.key
})
this.checkedKeys = []
this.$ajax.get({
url: this.$api.ROLE_DETAIL.replace('{id}', params)
}).then(res => {
if (res.code === '200') {
const data = res.data.content
for(let i=0;i<data.length;i++){
this.checkedKeys.push(data[i].id)
}
} else {
this.$message.error(res.msg)
}
})
}
},
//获取机构名称的下拉框
changeOrg(){
},
//获取id 对应的账户信息
getDetail() {
this.$ajax.get({
url: this.$api.GET_USER_DETAIL.replace('{id}', this.$route.query.id)
}).then(res => {
this.detail = res.data.content
let {
mail,
name,
username,
dept,
phone,
phone1,
phone2,
orgId,
addr,
zipCode,
orgName
} = this.detail
if(res.code === '200'){
const data = res.data.content
this.$nextTick(() => {
this.searchForm.setFieldsValue({
DorgId: data.orgId+'#'+data.orgName
})
})
console.log(data.orgId+'#'+data.orgName)
}
if (phone.indexOf(',') != -1 ) {
phone.split(',').forEach((ele, index) => {
if (index == 0) {
phone = ele
} else if (index == 1) {
phone1 = ele
}else if (index == 2) {
phone2 = ele
}
})
}
// 整理当前用户详情中的角色ID数据,去除重复
const userRoldIdsOrg = this.detail.roleIds != null ? this.detail.roleIds.split(',') : []
// if(userRoldIdsOrg.length>0 && userRoldIdsOrg[0]=='999999'){
// userRoldIdsOrg.shift()
// }
const userRoleIDs = []
for(let i=0;i<userRoldIdsOrg.length;i++){
if(!this.$com.oneOf(userRoldIdsOrg[i], userRoleIDs) && !this.$com.oneOf(userRoldIdsOrg[i], this.exclusionRoleIds)){
userRoleIDs.push(userRoldIdsOrg[i])
}
}
// 整理当前用户详情中的角色名称数据,去除重复
const userRoldNamesOrg = this.detail.roleNames != null ? this.detail.roleNames.split(',') : []
const userRoleNames = []
for(let i=0;i<userRoldNamesOrg.length;i++){
if(userRoleNames.indexOf(userRoldNamesOrg[i]) == -1){
userRoleNames.push(userRoldNamesOrg[i])
}
}
// 组装需要展示在用户信息表单“角色名称”项的初始数据
userRoleIDs.forEach((ele, index) => {
userRoleIDs[index] = {
'key': ele,
'label': userRoleNames[index]
}
})
let _this = this
this.userRoldIDsOrg = []
userRoldIdsOrg.forEach((ele, index) => {
this.userRoldIDsOrg.push({
'key': ele,
'label': userRoldNamesOrg[index]
})
})
const setDatas = {
mail,
name,
dept,
phone,
phone1,
phone2,
addr,
zipCode,
username,
DorgId
}
setDatas.notes = userRoleIDs
this.roles = userRoleIDs
this.searchForm.setFieldsValue(setDatas)
this.roleChange(this.userRoldIDsOrg)
})
},
validateUserName(rule, value, callback){
if(this.fromCenter){
callback()
}else{
if (!value) {
callback('必填(6-8位数字字母)!')
}else{
const filter = /^[A-Za-z0-9]{6,8}$/
if(!filter.test(value)){
callback('用户名为6-8位数字字母!')
}else {
this.$ajax.get({
url: this.$api.GET_USERNAME_EXIST,
PublicApiSign: this.sign,
params: {
username: value,
}
}).then(res => {
if (res.code == '200') {
if(!res.data){
callback()
}else{
callback('用户名已存在!')
}
} else{
callback(res.msg)
}
})
}
}
}
},
validatePhone(rule, value, callback){
if (!value) {
callback('必填!')
}else {
const filter = /^1[3-9][0-9]{9}$/
if(!filter.test(value)){
callback('请输入正确手机号!')
}else {
console.log(value)
if(value==this.searchForm.getFieldValue('phone1')){
callback('手机号不能重复')
}else if(value==this.searchForm.getFieldValue('phone2')){
callback('手机号不能重复')
}else{
if (this.fromCenter&&this.detail.phone&&this.detail.phone.indexOf(value) != -1) {
callback()
}else{
this.$ajax.get({
url: this.$api.GET_CHECK_PHONE_EXIST + '?phone=' + value+'&userType=0'
}).then(res => {
if (!res.data.content) {
callback()
} else {
callback('已存在该账号!')
}
})
}
}
}
}
},
validatePhoneBY(rule, value, callback){
if (!value) {
callback()
}else {
const filter = /^1[3-9][0-9]{9}$/
if(!filter.test(value)){
callback('请输入正确手机号!')
}else {
if(this.searchForm.getFieldValue('phone1')==this.searchForm.getFieldValue('phone')){
callback('手机号不能重复')
}else if(this.searchForm.getFieldValue('phone1')==this.searchForm.getFieldValue('phone2')){
callback('手机号不能重复')
} else{
if(this.fromCenter&&this.detail.phone&&this.detail.phone.indexOf(value)!=-1){
callback()
}else{
this.$ajax.get({
url: this.$api.GET_CHECK_PHONE_EXIST + '?phone=' + value
}).then(res => {
if (!res.data) {
callback()
} else {
callback('已存在该账号!')
}
})
}
}
}
}
},
validatePhoneBY2(rule, value, callback){
if (!value) {
callback()
}else {
const filter = /^1[3-9][0-9]{9}$/
if(!filter.test(value)){
callback('请输入正确手机号!')
}else {
if(this.searchForm.getFieldValue('phone2')==this.searchForm.getFieldValue('phone')){
callback('手机号不能重复')
}else if(this.searchForm.getFieldValue('phone2')==this.searchForm.getFieldValue('phone1')){
callback('手机号不能重复')
} else{
if(this.fromCenter&&this.detail.phone&&this.detail.phone.indexOf(value)!=-1){
callback()
}else{
this.$ajax.get({
url: this.$api.GET_CHECK_PHONE_EXIST + '?phone=' + value
}).then(res => {
if (!res.data) {
callback()
} else {
callback('已存在该账号!')
}
})
}
}
}
}
},
}
}
</script>
<style scoped>
.position {
margin-left: 5px;
color: #1890ff;
cursor: pointer;
display: inline;
}
</style>
<style>
</style>
<template>
<div class="routerWapper">
<div v-if="$route.name == 'people'&& $permission('000904')" class="layoutMargin layoutPadding" >
<a-form class="protalForm" :form="searchForm">
<a-row type="flex" class="formItemLine" :justify="simpleSearchForm?'end':'space-between'" align='middle' :gutter="simpleSearchForm?16:0">
<a-col span="6" v-if="!simpleSearchForm">
<a-form-item class='formItem' label="手机号" :label-col="formItemLabelCol" :wrapper-col="formItemWrapperCol">
<a-input placeholder="请输入手机号" v-decorator="['phone_l']" />
</a-form-item>
</a-col>
<a-col span="6" v-if="!simpleSearchForm">
<a-form-item label="角色名称" :label-col="formItemLabelCol" :wrapper-col="formItemWrapperCol">
<a-select mode="multiple" placeholder="请选择" allowClear v-decorator="['roleIds_in']" >
<a-select-option
v-for="option in roleList"
:key="option.id"
:value="option.id">
{{option.roleName}}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-col span="24" class="algin-right">
<a-button @click="reset" html-type="submit">重置</a-button>
<a-button type="primary" @click="search" html-type="submit">搜索</a-button>
<!-- <a-button type="primary" v-if='simpleSearchForm' @click="showMoreSearch">更多搜索</a-button>
<a-button type="primary" v-if='!simpleSearchForm' @click="closeMoreSearch">简单搜索</a-button> -->
</a-col>
</a-form>
<p class="gayLine noline"></p>
<div class='portalTableOperates'>
<a-button icon='plus' v-if="$permission('00090403')" type="primary" @click='handleAdd'>添加账户</a-button>
</div>
<a-table size='small' class="portalTable" :columns="columns" :dataSource="dataTable" rowKey='id' :pagination='pagination'>
<span slot="action" slot-scope="text, record">
<span class="actionBtn" v-if="$permission('00090401')" @click="viewBtn(record)">查看<a-divider type="vertical" /></span>
<!-- <span class="actionBtn" v-if="record.status==0 && $permission('P03102')" @click="$router.push({name: '/systemManagement/administrator/distribution',query:{id:record.id}})">权限分配</span> -->
<a-dropdown >
<span class="actionBtn" v-if="record.status!=8" > 更多
<a-icon type="down" />
</span>
<a-menu slot="overlay">
<!-- <a-menu-item v-if="$permission('00090401')" class="actionBtn" key="4"> 重置密码
</a-menu-item> -->
<!-- <a-menu-item class="actionBtn" key="2" v-if="$permission('S00011416')"> 禁用 </a-menu-item> -->
<a-menu-item class="actionBtn" v-if="$permission('00090405')" key="1" @click='(event)=>{showOpeations(event.key,record)}'> 启用 </a-menu-item>
<a-menu-item class="actionBtn" v-if="$permission('00090406')" key="3" @click='(event)=>{showOpeations(event.key,record)}'> 注销
</a-menu-item>
<a-menu-item class="actionBtn" v-if="$permission('00090402')" @click="handleEdit(record)"> 修改
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
<span slot="userType" slot-scope="text" align="center">
{{getUserType(text)}}
</span>
<span slot="status" slot-scope="text, record">
<userStatus :status="record.status||'0'" />
</span>
<span slot="phone" slot-scope="text, record">
<span>{{record.phone}}</span>
</span>
</a-table>
<resetPassword :resetPwdShow="resetPwdShow" @on-cancel="handleCancel" ref="reset" @on-ok="handleResetOk"></resetPassword>
</div>
<RouterWapper v-else></RouterWapper>
</div>
</template>
<script>
import userStatus from '@/views/components/user-status'
import userRole from '@/views/components/user-role'
import resetPassword from '@/views/components/resetPassword'
import { encryptDes } from '@/util/des-cryptojs'
export default {
components: {
userStatus,
resetPassword,
userRole,
},
props: {
personType: {
type: String,
}
},
data() {
return {
roleList: [],
// 展示、收取简单搜索开关,true为简单搜索
simpleSearchForm: false,
colSpe: {
labelCol: {
span: 8
},
wrapperCol: {
span: 16
},
},
pagination: {
pageSize: 10,
total: 0,
current: 1,
defaultCurrent: 1,
showQuickJumper: true,
onChange: this.pageChange
},
statusList: [0],
searchForm: this.$form.createForm(this),
defaultValue: '',
dataTable: [],
plainOptions: [
{
text: '正常',
value: '1'
},
{
text: '已注销',
value: '9'
}
],
opeation: {
title: '',
tips: '',
type: '',
item: null
},
treeData: [],
resetPwdShow: false
}
},
computed: {
formItemLabelCol(){
let labelCol = {}
if(this.simpleSearchForm){
labelCol = { span: 0 }
}else{
labelCol = { span: 8 }
}
return labelCol
},
formItemWrapperCol(){
let wrapperCol = {}
if(this.simpleSearchForm){
wrapperCol = { span: 24 }
}else{
wrapperCol = { span: 16 }
}
return wrapperCol
},
columns(){
return [
{
title: '账号',
dataIndex: '',
align: 'center',
key: '',
width: '10%',
scopedSlots: {
customRender: 'phone',
},
},
{
title: '身份',
align: 'center',
dataIndex: 'type',
key: 'type',
width: '10%',
scopedSlots: {
customRender: 'userType',
},
},
{
title: '角色',
dataIndex: 'roleNames',
align: 'center',
key: 'roleNames',
width: '13%',
scopedSlots: {
customRender: 'roleIds',
},
},
{
title: '状态',
align: 'center',
dataIndex: 'status',
key: 'status',
width: '13%',
scopedSlots: {
customRender: 'status',
},
},
{
title: '手机号',
align: 'center',
dataIndex: 'phone',
key: 'phone',
width: '20%',
},
{
title: '操作',
dataIndex: 'action',
key: 'action',
width: '12%',
scopedSlots: {
customRender: 'action',
},
}
]
}
},
mounted() {
if(this.$route.name == 'people'){
this.$nextTick(function () {
this.getSearchParams()
this.getRoleList()
})
}
},
methods: {
// 查询角色列表
getRoleList(){
this.$ajax.get({
url: this.$api.GET_ROLE_LIST,
params: {
pageSize: 10000,
}
}).then(res => {
if(res.code === '200'){
this.roleList= this.$com.confirm(res, 'data.content', [])
}else{
this.$message.error(res.msg)
}
})
},
/**
* 从vuex中或已存储的搜索条件,判断此条件是否为当前路由的 。如果是则使用
*/
getSearchParams(){
const searchParams = !this.$store.state.listSearchParams?null:this.$store.state.listSearchParams[this.$route.name]
if(!!searchParams && !!searchParams.routeName && (this.$route.name == searchParams.routeName)){
if(!!searchParams.params){
Object.keys(searchParams.params).forEach(elem => {
switch (elem) {
case 'phone_l':
this.searchForm.setFieldsValue({ 'phone_l': searchParams.params[elem] })
break
// case 'roleIds_in':
// console.log(searchParams.params[elem])
// this.searchForm.setFieldsValue({ 'roleIds_in': searchParams.params[elem].split(',') })
// break
case 'username_l':
this.searchForm.setFieldsValue({ 'username_l': searchParams.params[elem] })
break
case 'status_in':
this.searchForm.setFieldsValue({ 'status_in': searchParams.params[elem].split(',') })
break
default:
break
}
})
}
if(!!searchParams.pagination){
if(!!searchParams.pagination.current){
if (searchParams.params.tabName == this.personType) {
this.pagination.current = searchParams.pagination.current
}
this.pagination.pageSize = searchParams.pagination.pageSize
}
}
}
this.getList()
},
/**
* 处理列表展示的身份类型
*/
getUserType(UserType){
let userTypeList =[
{
key: '0',
value: '管理员',
}, {
key: '1',
value: '决策人员',
}, {
key: '2',
value: '机构',
}, {
key: '3',
value: '机构人员',
}, {
key: '4',
value: '中介',
}, {
key: '5',
value: '中介人员',
},
]
for(let i=0;i<userTypeList.length;i++){
if(!!UserType){
if(UserType == userTypeList[i].key){
return userTypeList[i].value
}
}else{
return '暂无'
}
}
},
//关闭更多搜索
closeMoreSearch(){
this.simpleSearchForm = true
},
//展示更多搜索
showMoreSearch(){
this.simpleSearchForm = false
},
//分页
pageChange(current) {
this.pagination.current = current
this.getList()
},
// 查询按钮
search() {
this.pagination.current = 1
this.getList()
},
// 重置按钮
reset() {
this.pagination.current = 1
this.searchForm.resetFields()
this.getList()
},
// 查询列表
getList(){
let searchParms = {
pageNo: this.pagination.current,
pageSize: this.pagination.pageSize,
}
searchParms = Object.assign({}, searchParms, this.searchForm.getFieldsValue())
if (searchParms.roleIds_in && searchParms.roleIds_in.length>0) {
searchParms.roleIds_in = searchParms.roleIds_in.join(',')
}
this.$ajax.get({
url: this.$api.GET_STAFF_LIST,
params: searchParms
}).then(res => {
if (res.code == '200') {
this.pagination.current = res.data.page
this.pagination.pageSize = res.data.pageSize
this.pagination.total = res.data.totalRows
this.dataTable = this.$com.confirm(res, 'data.content', [])
//
// 存储当前页面列表的搜索信息
//
this.$com.storeSearchParams(
this.$route.name,
this.pagination,
Object.assign({}, searchParms, {tabName: this.personType})
)
} else {
this.$message.info(res.msg, 10)
}
})
},
handleAdd() {
this.$router.push({
name: 'createStaff',
query: {
personType: this.personType
}
})
},
//跳转详情页面
viewBtn(record) {
this.$router.push({
name: 'staffInfo',
query: {
id: record.id,
personType: this.personType
}
})
},
//跳转修改页面
handleEdit(record) {
this.$router.push({
name: 'editStaff',
query: {
id: record.id,
// personType:this.$route.query.personType
}
})
},
showOpeations(key, item) {
this.opeation.type = key
this.opeation.item = item
const vm = this
switch (key) {
case '1':
this.opeation.title = '您确认要启用该账号吗?'
this.opeation.tips = '启用后,该账号将被允许登录平台'
break
case '2':
this.opeation.title = '您确定要禁用吗?'
this.opeation.tips = '禁用后,该账号将不被允许登录平台直到再次启用'
break
case '3':
this.opeation.title = '您确认要注销该账号吗?'
this.opeation.tips = '注销后,该账号将被使用'
break
case '4':
this.opeation.title = '您确认要重置账号密码吗?'
this.opeation.tips = '重置后,需要使用新密码登录'
break
default:
break
}
if (key != 4 && key !=5) {
this.$modal.confirm({
title: this.opeation.title,
content: this.opeation.tips,
okText: '确认',
okType: 'danger',
cancelText: '取消',
onOk() {
vm.handleOk()
},
})
} else if(key == 5){
this.$router.push({ path: '/systemManagement/administrator/distribution',
query: {
id: item.id
}
})
}else if(key == 4){
this.resetPwdShow = true
}
},
handleOk() {
const key = this.opeation.type
let apiUrl = ''
let status = 1
switch (key) {
case '1':
//启用操作
apiUrl = this.$api.PUT_STAFF_INFO
status = 1
break
case '2':
// //禁用操作
// apiUrl = this.$api.PUT_STAFF_INFO
// status= '8'
// break
case '3':
//注销操作
apiUrl = this.$api.PUT_STAFF_INFO
status= '9'
break
default:
break
}
this.$ajax.put({
url: apiUrl,
params: {
id: this.opeation.item.id,
status,
}
}).then(res => {
if (res.code == '200') {
this.$message.success('操作成功!')
this.getList()
}
})
},
handleCancel() {
this.resetPwdShow = false
this.$refs.reset.resetForm()
},
handleResetOk(values) {
this.$ajax.put({
url: this.$api.PUT_STAFF_PWD,
params: {
id: this.opeation.item.id,
pwd: encryptDes(values.newPwd)
}
}).then(res => {
if (res.code === '200') {
this.$message.success('重置密码成功')
this.handleCancel()
this.getList()
}
})
},
}
}
</script>
<style scoped>
.opeationTable {
margin: 10px 0;
}
.roleNames{
width: 120px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
\ No newline at end of file
<template>
<div class="portalDetailWapper">
<div class="portalDetailTitle">
<span :class="'title transparent'"
style="padding:0px;margin-left:32px;">账户信息</span>
<div class="detailOperations">
<a-button type="primary" ghost @click='handleReturn'>返回</a-button>
<a-button type="primary" v-if="$permission('00090402')" @click='handleEdit()'>修改</a-button>
</div>
</div>
<div v-if="!showInfo" class="portalDetailContentWapper">
<div class="portalDetailContentBody">
<div class="layoutMargin layoutPadding detailsPartSection">
<a-row :gutter="1" class="detailsPartLine">
<a-col span="8">
<DetailsItem :labelSpan='8' :textSpan="16" :label='"姓名"' :text='!detail.name?"暂无":detail.name'></DetailsItem>
</a-col>
<a-col span="8">
<DetailsItem :labelSpan='8' :textSpan="16" :label='"账号"' :text='!detail.phone?"暂无":detail.phone'></DetailsItem>
</a-col>
<a-col span="8">
<DetailsItem :labelSpan='8' :textSpan="16" :label='"邮箱"' :text='!detail.mail?"暂无":detail.mail'></DetailsItem>
</a-col>
</a-row>
<a-row :gutter="1" class="detailsPartLine">
<a-col span="8">
<DetailsItem :labelSpan='8' :textSpan="16" :label='"手机"' :text='!detail.phone0?"暂无":detail.phone0'></DetailsItem>
</a-col>
<a-col span="8">
<DetailsItem :labelSpan='8' :textSpan="16" :label='"角色名称"' :text='detail.roleNames||"暂无" '></DetailsItem>
</a-col>
</a-row>
<div class="layoutMargin detailsPartLine" v-if="detailReady==2" >
<a-tree class="portalRoleTree" checkable :treeData="treeData" v-model="checkedKeys" disabled />
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
components: {
},
data() {
return {
showInfo: false,
defaultExpandedKeys: [],
checkedKeys: [],
detail: {},
treeData: [],
detailReady: 0
}
},
mounted() {
this.getDetail()
},
methods: {
changeShow(bool){
if(bool){
this.showInfo=!this.showInfo
}
},
handleReturn() {
this.$router.back()
},
handleEdit(num) {
this.$router.push({
name: 'editStaff',
query: {
id: this.$route.query.id,
// personType:this.$route.query.personType
}
})
},
getDetail() {
this.$ajax.get({
url: this.$api.GET_USER_DETAIL.replace('{id}', this.$route.query.id),
}).then(res => {
this.detail = res.data.content
if (!!this.detail.phone&&this.detail.phone.length>12) {
this.detail.phone0 = this.detail.phone
// console.log( this.detail)
}else{
this.detail.phone0 = this.detail.phone
}
this.getTree()
this.getDefaultRole(this.detail.roleIds)
})
},
// 查询权限树
getTree() {
this.$ajax.get({
url: this.$api.GET_ALL_ROLE + '?isTree=true'
}).then(res => {
const data = res.data.content
data.forEach((item, index) => {
this.treeData.push(this.getTreeData(item, index))
})
this.detailReady ++
})
},
// 整理权限树
getTreeData(item, index) {
const childrenNode = {
title: item.permName,
key: item.id,
value: item.id
}
if (item.childList && item.childList.length) {
childrenNode.children = []
item.childList.forEach((subItem, subIndex) => {
const subkey = subItem.id
childrenNode.children.push(this.getTreeData(subItem, subkey))
})
}
return childrenNode
},
getDefaultRole(params) {
console.log(params)
let roleIds = params.split(',')
this.$ajax.get({
url: this.$api.ROLE_DETAIL.replace('{id}', roleIds)
}).then(res => {
if (res.code === '200') {
const data = res.data.content
for(let i=0;i<data.length;i++){
this.checkedKeys.push(data[i].id)
}
this.detailReady ++
}
})
}
}
}
</script>
<style scoped>
.position { margin-left: 5px; color: #1890ff; cursor: pointer; }
.underLine { border-bottom: 2px solid #1890ff;}
.bule { color: #1890ff;}
.transparent { font-weight: normal; color: rgba(0, 0, 0, 0.5); cursor: pointer;}
</style>
<template>
<div>
<div class="routerWapper HC_AccountInfo" v-if="$route.name == 'rizhiInfo'">
<div class="portalDetailTitle">
<span class="title">
日志详情
</span>
<div class="detailOperations">
<a-button @click="$router.back()"> 返回 </a-button>
</div>
</div>
<div class="layoutMargin layoutPadding">
<a-row>
<a-col>
<h3>操作前信息</h3>
<div class="gayLine"/>
</a-col>
</a-row>
<a-row>
<a-col :span="8">
<a-row>
<a-col :span="10" style="text-align:right">
</a-col>
<a-col :span="14">
{{content.companyName}}
</a-col>
</a-row>
</a-col>
<a-col :span="8">
<a-row>
<a-col :span="10" style="text-align:right">
</a-col>
<a-col :span="14">
{{content.parentCompanyName}}
</a-col>
</a-row>
</a-col>
<a-col :span="8">
<a-row>
<a-col :span="10" style="text-align:right">
</a-col>
<a-col :span="14">
{{content.phone?content.phone.slice(0,11):''}}
</a-col>
</a-row>
</a-col>
<a-col :span="8">
<a-row>
<a-col :span="10" style="text-align:right">
</a-col>
<a-col :span="14">
{{content.phone?content.phone.slice(12,23):''}}
</a-col>
</a-row>
</a-col>
<a-col :span="8">
<a-row>
<a-col :span="10" style="text-align:right">
</a-col>
<a-col :span="14">
{{content.phone?content.phone.slice(24,35):''}}
</a-col>
</a-row>
</a-col>
<a-col :span="8">
<a-row>
<a-col :span="10" style="text-align:right">
</a-col>
<a-col :span="14">
{{content.certificationContactName}}
</a-col>
</a-row>
</a-col>
<a-col :span="8">
<a-row>
<a-col :span="10" style="text-align:right">
</a-col>
<a-col :span="14">
{{content.certificationContactEmail}}
</a-col>
</a-row>
</a-col>
<a-col :span="8">
<a-row>
<a-col :span="10" style="text-align:right">
</a-col>
<a-col :span="14">
{{content.companyLegalPerson}}
</a-col>
</a-row>
</a-col>
<a-col :span="8">
<a-row>
<a-col :span="10" style="text-align:right">
</a-col>
<a-col :span="14">
{{content.telephone}}
</a-col>
</a-row>
</a-col>
<a-col :span="8">
<a-row>
<a-col :span="10" style="text-align:right">
</a-col>
<a-col :span="14">
{{content.address}}
</a-col>
</a-row>
</a-col>
<a-col :span="8">
<a-row>
<a-col :span="10" style="text-align:right">
</a-col>
<a-col :span="14">
{{content.personNum}}
</a-col>
</a-row>
</a-col>
<a-col :span="8">
<a-row>
<a-col :span="10" style="text-align:right">
</a-col>
<a-col :span="14">
{{content.companyNo}}
</a-col>
</a-row>
</a-col>
</a-row>
</div>
<div class="layoutMargin layoutPadding">
<a-row>
<a-col>
<h3>操作后信息</h3>
<div class="gayLine"/>
</a-col>
</a-row>
<a-row>
<a-col :span="8">
<a-row>
<a-col :span="10" style="text-align:right">
</a-col>
<a-col :span="14">
{{content.companyName}}
</a-col>
</a-row>
</a-col>
<a-col :span="8">
<a-row>
<a-col :span="10" style="text-align:right">
</a-col>
<a-col :span="14">
{{content.parentCompanyName}}
</a-col>
</a-row>
</a-col>
<a-col :span="8">
<a-row>
<a-col :span="10" style="text-align:right">
</a-col>
<a-col :span="14">
{{content.phone?content.phone.slice(0,11):''}}
</a-col>
</a-row>
</a-col>
<a-col :span="8">
<a-row>
<a-col :span="10" style="text-align:right">
</a-col>
<a-col :span="14">
{{content.phone?content.phone.slice(12,23):''}}
</a-col>
</a-row>
</a-col>
<a-col :span="8">
<a-row>
<a-col :span="10" style="text-align:right">
</a-col>
<a-col :span="14">
{{content.phone?content.phone.slice(24,35):''}}
</a-col>
</a-row>
</a-col>
<a-col :span="8">
<a-row>
<a-col :span="10" style="text-align:right">
</a-col>
<a-col :span="14">
{{content.certificationContactName}}
</a-col>
</a-row>
</a-col>
<a-col :span="8">
<a-row>
<a-col :span="10" style="text-align:right">
</a-col>
<a-col :span="14">
{{content.certificationContactEmail}}
</a-col>
</a-row>
</a-col>
<a-col :span="8">
<a-row>
<a-col :span="10" style="text-align:right">
</a-col>
<a-col :span="14">
{{content.companyLegalPerson}}
</a-col>
</a-row>
</a-col>
<a-col :span="8">
<a-row>
<a-col :span="10" style="text-align:right">
</a-col>
<a-col :span="14">
{{content.telephone}}
</a-col>
</a-row>
</a-col>
<a-col :span="8">
<a-row>
<a-col :span="10" style="text-align:right">
</a-col>
<a-col :span="14">
{{content.address}}
</a-col>
</a-row>
</a-col>
<a-col :span="8">
<a-row>
<a-col :span="10" style="text-align:right">
</a-col>
<a-col :span="14">
{{content.personNum}}
</a-col>
</a-row>
</a-col>
<a-col :span="8">
<a-row>
<a-col :span="10" style="text-align:right">
</a-col>
<a-col :span="14">
{{content.companyNo}}
</a-col>
</a-row>
</a-col>
</a-row>
</div>
</div>
<RouterWapper v-else></RouterWapper>
</div>
</template>
<script>
export default {
data(){
return {
content: {},
}
},
mounted(){
this.$ajax.get({
url: this.$api.GET_RIZHI_INFO.replace('{id}', this.$route.query.id),
}).then(res => {
if (res.code == '200') {
this.content = this.$com.confirm(res, 'data.content', [])
} else {
this.$message.info(res.msg, 10)
}
})
},
methods: {
/**
* 返回对应的企业类型
*/
returnType(type){
for(let i=0;i<this.companyTypeList.length;i++){
if(this.companyTypeList[i].key==type){
return this.companyTypeList[i].value
}
}
},
},
}
</script>
<style>
.HC_AccountInfo .ant-row{
padding: 8px 0px;
}
</style>
\ No newline at end of file
<template>
<div>
<div class="routerWapper AccountManagement" v-if="$route.name == 'rizhi'">
<div class="routerContent layoutMargin layoutPadding">
<!-- 搜索区 -->
<a-form class="protalForm" :form="searchForm" style="padding: 0px 10px;">
<a-row type="flex" align="middle" style="margin-bottom:20px;">
<a-col span="12">
<a-form-item class='formItem' label="日期" :label-col="{span:6}" :wrapper-col="{span:18}">
<a-range-picker v-decorator="['createTime_btw']" :format="timeFormat"/>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col span="12" :offset="12" style="display:flex;justify-content:flex-end;">
<a-button type="primary" ghost @click="resetFrom" style="margin-right:20px;">重置</a-button>
<a-button type="primary" @click="searchTaskCollectList">搜索</a-button>
</a-col>
</a-row>
</a-form>
<!-- table -->
<a-table class="elevator-table portalTable" :dataSource="List" :columns="columns" size="small" :pagination="pagination"
rowKey="id">
<span slot="operation" slot-scope="text, record">
<span class="actionBtn" @click="toNext(record)">查看</span>
</span>
</a-table>
</div>
</div>
<RouterWapper v-else></RouterWapper>
</div>
</template>
<script>
export default {
data(){
return {
ids: '',
info: {},
timeFormat: 'YYYY-MM-DD',
searchForm: this.$form.createForm(this), //表单验证
List: [],
columns: [
{
title: '操作人',
dataIndex: 'creator',
key: 'creator',
width: '100px',
}, {
title: '操作时间',
dataIndex: 'createTime',
key: 'createTime',
width: '100px'
}, {
title: '操作说明',
dataIndex: 'pointName',
key: 'pointName',
width: '100px'
},
{
title: '操作',
dataIndex: 'operation',
key: 'operation',
width: '120px',
scopedSlots: {
customRender: 'operation',
},
}
],
pagination: {//分页
pageNo: 1,
pageSize: 10,
total: 10,
current: 1,
defaultCurrent: 1,
showQuickJumper: true,
onChange: this.pageChange
},
targetNum: {}, //
selectedRowKeys: [],
searchParms: {}
}
},
created(){
},
mounted(){
if(this.$route.name=='rizhi'){
//获取机构列表
this.getSearchParams()
}
},
computed: {
},
methods: {
/**
* 返回对应的企业类型
*/
// getcompanyType(companyType){
// for(let i=0;i<this.companyTypeList.length;i++){
// if(!!companyType){
// if(companyType == this.companyTypeList[i].key){
// return this.companyTypeList[i].value
// }
// }else{
// return '暂无'
// }
// }
// },
onSelectChange(selectedRowKeys) { // 被勾选的数据
this.selectedRowKeys = selectedRowKeys
},
//分页
pageChange(val) {
this.pagination.pageNo = val
this.pagination.current = val
this.getCompanyList()
},
/**
* 搜索符合条件的任务小区
*/
getSearchParams(){
let searchParams = !this.$store.state.listSearchParams?null:this.$store.state.listSearchParams
if(!!searchParams && !!searchParams.routeName && (this.$route.name == searchParams.routeName)){
if(!!searchParams.params){
this.getCompanyList(searchParams.params)
}else{
this.getCompanyList()
}
}else{
this.getCompanyList()
}
},
searchTaskCollectList(){
this.pagination.current = 1
this.getCompanyList()
},
getCompanyList(params){
if(params && params.hasOwnProperty('streetsId')){
var searchParms=params
this.$nextTick(() => {
this.searchForm.setFieldsValue(params)
})
}else{
var searchParms = {
'createTime_btw': !!this.searchForm.getFieldValue('createTime_btw') ? [this.$moment(this.searchForm.getFieldValue('createTime_btw')[0]).format('YYYY-MM-DD'), this.$moment(this.searchForm.getFieldValue('createTime_btw')[1]).format('YYYY-MM-DD')].toString(): '',
pageNo: this.pagination.current,
pageSize: 10,
}
}
this.searchParms=searchParms
this.$ajax.get({
url: this.$api.GET_RIZHI,
params: searchParms
}).then(res => {
if (res.code == '200') {
this.pagination.pageNo = res.data.totalPages
this.pagination.current = res.data.page
this.pagination.pageSize = res.data.pageSize
this.pagination.total = res.data.totalRows
this.List = this.$com.confirm(res, 'data.content', [])
//
// 存储当前页面列表的搜索信息
//
this.$com.storeSearchParams(
this.$route.name,
this.pagination.current,
searchParms,
)
} else {
this.$message.info(res.msg, 10)
}
})
},
/**
* 进入详情页面
* @param {Object} record 当前操作的整条数据对象信息
*/
toNext(record){
// 进入详情
this.$router.push({
name: 'rizhiInfo',
query: {
id: record.id,
type: 'view'
},
})
},
/**
* 清空表单
*/
resetFrom(){
this.searchForm.resetFields()
this.pagination.current = 1
this.getCompanyList()
},
}
}
</script>
<style scoped>
.menu_header{
color:#1890ff;
border-bottom:1px solid #1890ff;
margin-left:16px;
padding-bottom:5px;
}
.ant-menu.ant-menu-vertical.ant-menu-root.ant-menu-light{
border-right: none;
margin-top:8px;
}
.ant-menu.ant-menu-vertical.ant-menu-root.ant-menu-light .ant-menu-item{
margin:0px;
}
</style>
<style>
.elevator-table thead.ant-table-thead th div {
text-align: left;
}
.AccountManagement .elevator-table thead.ant-table-thead th div{
text-align: center;
}
.AccountManagement td{
text-align: center;
word-break: break-all;
}
</style>
<style scoped>
.roleTitleSeation { border-bottom: 1px solid #e0e0e0; padding:10px}
.roleTitleSeation .roleName { font-size: 20px; line-height: 40px; color:#232323; font-weight: bold}
.roleTree { margin-top: 10px;}
</style>
<template>
<div class="portalDetailWapper">
<div class="portalDetailTitle">
<span class="title">{{roleName || '创建新角色'}}</span>
<div class="detailOperations" v-if="$route.query.type === 'view'">
<a-button @click="$router.back();" >返回</a-button>
<a-button @click="edit" >修改</a-button>
<a-button type="danger" @click="deleteBtn" ghost>删除</a-button>
</div>
<div class="detailOperations" v-else>
<a-button @click="$router.back();">取消</a-button>
<a-button v-if="$permission('00090304')" type="primary" @click="save">保存</a-button>
</div>
</div>
<div class="portalDetailContentWapper">
<a-form class="portalDetailContentBody" :form="formData">
<div class="layoutMargin detailsPartSection contentPadding">
<a-row class="formItemLine" v-if="$route.query.type !== 'view'">
<a-col span="8">
<a-form-item label="角色名称" class="formItem" :label-col="labelCol" :wrapper-col="wrapperCol" >
<a-input placeholder="请输入"
v-decorator="[
'roleName',
{rules: [{ required: true, message: '请输入10字以内的角色名称!' ,whitespace:true,max:10 }],validateTrigger:'blur'}
]" />
</a-form-item>
</a-col>
</a-row>
<a-tree class="portalRoleTree" v-if="showTree" checkable :treeData="treeData" :defaultExpandedKeys='expandedKeys' v-model="checkedKeys" :disabled="$route.query.type === 'view'" />
</div>
</a-form>
</div>
</div>
</template>
<script>
//import roleLevels from '@/config/roleLevels.json'
export default {
data() {
return {
title: '新增角色',
labelCol: { span: 8 },
wrapperCol: { span: 16 },
//选择的数组
checkedKeys: [],
treeData: [],
// parentId: '',
// 默认展开的数组
expandedKeys: [],
deleteData: {},
showTree: false,
roleName: null,
userCount: null,
roleIds: [], // 功能点的id数组
// roleLevels,
}
},
mounted() {
this.getRoleIds()
},
beforeCreate() {
this.formData = this.$form.createForm(this)
},
methods: {
/**
* 获取当前用户权限
*/
getRoleIds(){
this.$ajax.get({
url: this.$api.GET_USER_PEIMISSION,
params: {
pageSize: 10000,
userId: this.$store.state.userInfos.id
}
}).then(res => {
if(res.code == '200'){
let arr =res.data.content
for(let i=0;i<arr.length;i++){
this.roleIds.push(arr[i].id)
this.roleIds.push(arr[i].parentId)
}
this.getTree()
}
})
},
// 查询权限树
getTree(){
this.$ajax.get({
url: this.$api.GET_ALL_ROLE + '?isTree=true'
}).then(res => {
const data=res.data.content
// data.forEach((item, index) => {
// this.parentId = item.id
// console.log(this.parentId)
// })
this.parentId = data.id
data.forEach((item, index) => {
this.treeData.push(this.getTreeNode(item, index))
})
if(this.$route.query.type === 'edit'){
this.title='修改角色'
this.getRoleInfo(this.$route.query.id)
}else if(this.$route.query.type === 'view'){
this.title=this.$route.query.roleName
this.getRoleInfo(this.$route.query.id)
}else{
this.title='新增角色'
this.showTree=true
}
})
},
/**
* 整理权限树
*/
getTreeNode(item, index){
if(this.roleIds.length>0 && this.roleIds.indexOf(item.id)<0 && !this.$store.state.userInfos.isAllPerm){
var childrenNode={
title: item.permName,
key: item.id,
disabled: true,
}
}else{
var childrenNode={
title: item.permName,
key: item.id
}
}
if(item.childList && item.childList.length){
childrenNode.children = []
item.childList.forEach((subItem, subIndex) => {
const subkey = subItem.id
childrenNode.children.push(this.getTreeNode(subItem, subkey))
})
}
return childrenNode
},
// 查询角色详情
getRoleInfo(id){
this.$ajax.get({
url: this.$api.GET_CHARACTER.replace('{id}', id)
}).then(res => {
if(res.code === '200'){
const data=res.data.content
this.roleName=data.roleName
this.userCount=data.userCount
if(this.$route.query.type !== 'view'){
setTimeout(() => {
this.formData.setFieldsValue({
roleName: data.roleName,
})
}, 0)
}
this.checkedKeys=data.perm.map((item) => {
return item.id
})
this.expandedKeys=JSON.parse(JSON.stringify(this.checkedKeys))
this.showTree=true
}else{
this.$message.error(res.msg)
}
})
},
// 保存按钮
save(){
this.formData.validateFields((err) => {
if(!err){
let msg, link, methods, params={}
if(this.$route.query.id){
link=this.$api.PUT_CHARACTER.replace('{id}', this.$route.query.id)
methods='put'
msg='修改成功'
params={
id: this.$route.query.id
}
}else{
link=this.$api.ADD_ROLE_POST
methods='post'
msg='新增成功'
}
console.log('onCheck', this.checkedKeys)
this.$ajax[methods]({
url: link,
params: {
roleName: this.formData.getFieldValue('roleName'),
permIds: this.checkedKeys.join(','),
...params
}
}).then(res => {
if(res.code === '200'){
this.$message.success(msg)
this.$router.push({name: 'role'})
}
})
}else{
this.$com.getFormValidErrTips(this, err)
}
})
},
// 修改按钮
edit(){
this.$router.push({
name: 'edit',
query: {
type: 'edit',
id: this.$route.query.id,
roleName: this.$route.query.roleName
}
})
},
// 删除按钮
deleteBtn(){
const vm = this
if(this.userCount !== null && this.userCount !== '' && this.userCount != 0){
this.$modal.warning({
title: '无法删除此角色',
content: '此角色还有员工未被分配,请先处理该角色下所有员工的调岗操作',
okText: '确认',
})
}else{
this.$modal.confirm({
title: '是否确认删除此角色?',
content: '此操作不可撤销',
okText: '确认',
okType: 'danger',
cancelText: '取消',
onOk() {
vm.handleOkDelete()
}
})
}
},
handleOkDelete(){
this.$ajax.delete({
url: this.$api.DELETE_CHARACTER.replace('{id}', this.$route.query.id),
}).then(res => {
if(res.code === '200'){
this.$message.success('删除成功')
this.$router.push({
name: 'role'
})
}
})
},
},
}
</script>
<template>
<div class="routerWapper">
<div v-if="$route.name == 'role' && $permission('000903')" class="layoutMargin layoutPadding">
<a-form class="protalForm" :form="searchForm">
<a-row type="flex" justify="end" align="middle">
<a-col span="6">
<a-form-item class="formItem" label="" :label-col="{span:0}" :wrapper-col="{span:24}" >
<a-input placeholder="请输入角色名称" v-model="searchForm.roleName_l" />
</a-form-item>
</a-col>
<a-col span="5" class="algin-right" style="padding-right:8px">
<a-button @click="reset">重置</a-button>
<a-button type="primary" @click="search">搜索</a-button>
</a-col>
</a-row>
</a-form>
<p class="gayLine noline"></p>
<div class="portalTableOperates">
<a-button type="primary" icon='plus' v-if="$permission('00090302')" @click="addBtn">新增角色</a-button>
</div>
<div class="wrapper-roles">
<div class="box" v-for="(item,index) in roleList" :key="index">
<div class="inner">
<div class="content">
<p class="roleName" :title='item.roleName'>{{item.roleName}} </p>
<p class="roleNum"><img :src="groups" class="group-icon" alt="人数"><span class="name-num">{{item.userCount || '0'}}</span></p>
<DataOperatorInList :level="!item.sort?0:item.sort" :creator='!item.creator?"":item.creator' :lastOperator='!item.operator?"":item.operator'></DataOperatorInList>
</div>
<div class="operate">
<template>
<span @click="view(item)" v-if="$permission('00090301')">查看</span>
<a-divider type="vertical" />
</template>
<template>
<span @click="edit(item)" v-if="$permission('00090304')">修改</span>
<a-divider type="vertical" />
</template>
<span @click="deleteBtn(item)" v-if="$permission('00090304')">删除</span>
</div>
</div>
</div>
</div>
<!-- 分页 -->
<a-row type="flex" justify="end">
<a-col>
<a-pagination size="small" :defaultPageSize="20" showQuickJumper @change="onChange" :current="params.pageNo" :total="total" >
</a-pagination>
</a-col>
</a-row>
</div>
<RouterWapper v-else></RouterWapper>
</div>
</template>
<script>
import DataOperatorInList from '@/views/components/dataOperatorInList'
export default {
components: {
DataOperatorInList
},
data() {
return {
searchForm: {
roleName_l: ''
},
roleList: [],
deleteData: {},
params: {
pageNo: 1,
pageSize: 20,
createTime_desc: '1'
},
total: 0,
groups: require('@/assets/images/group.png'),
}
},
mounted(){
console.log(1)
if(this.$route.name == 'role'){
console.log(3)
this.getSearchParams()
}
},
methods: {
// 查询按钮
search(){
this.params.pageNo=1
this.getList()
},
// 重置按钮
reset(){
this.searchForm={}
this.params.pageNo=1
this.getList()
},
onChange(current) {
this.params.pageNo = current
this.getList()
},
// 查询角色列表
getList(){
this.$ajax.get({
url: this.$api.GET_ROLE_LIST,
params: Object.assign(this.searchForm, this.params)
}).then(res => {
if(res.code === '200'){
this.total=res.data.totalRows
this.roleList= this.$com.confirm(res, 'data.content', [])
}else{
this.$message.error(res.msg)
}
//存储当前列表的展示条件,包括分页信息、搜索条件
this.$com.storeSearchParams(
this.$route.name,
this.params,
{
'roleName_l': !this.searchForm.roleName_l ? '':this.searchForm.roleName_l
}
)
})
},
addBtn(){
this.$router.push({
name: 'add',
})
},
// 删除按钮
deleteBtn(item){
const vm = this
if(item.userCount !== null && item.userCount !== '' && item.userCount != 0){
this.$modal.warning({
title: '无法删除此角色',
content: '此角色还有员工未被分配,请先处理该角色下所有员工的调岗操作'
})
}else{
this.deleteData = item
this.$modal.confirm({
title: '是否确认删除此角色?',
content: '此操作不可撤销',
okText: '确认',
okType: 'danger',
cancelText: '取消',
onOk() {
vm.handleOkDelete()
}
})
}
},
// 修改按钮
edit(item){
this.$router.push({
name: 'edit',
query: {
type: 'edit',
id: item.id,
}
})
},
// 查看按钮
view(item){
this.$router.push({
name: 'look',
query: {
type: 'view',
id: item.id,
}
})
},
/**
* 从vuex中或已存储的搜索条件,判断此条件是否为当前路由的 。如果是则使用
*/
getSearchParams(){
const searchParams = !this.$store.state.listSearchParams?null:this.$store.state.listSearchParams[this.$route.name]
if(!!searchParams && !!searchParams.routeName && (this.$route.name == searchParams.routeName)){
if(!!searchParams.params){
Object.keys(this.searchForm).forEach(elem => {
this.searchForm[elem] = searchParams.params[elem]
})
}
if(!!searchParams.pagination){
if(!!searchParams.pagination.pageNo && searchParams.pagination.pageNo!=1){
this.params.pageNo = searchParams.pagination.pageNo
}
}
}
this.getList()
},
handleOkDelete(){
this.$ajax.delete({
url: this.$api.DELETE_CHARACTER.replace('{id}', this.deleteData.id),
}).then(res => {
if(res.code === '200'){
this.$message.success('删除成功')
this.getList()
}else{
this.$message.error(res.msg)
}
})
},
},
}
</script>
<style scoped>
.wrapper-roles { display: flex; flex-wrap: wrap;}
.box { width: 20%; padding: 0 8px 16px 8px;}
.inner {height: 180px; display: flex; flex-direction: column; border: 1px solid #e8eaec;}
.content { display: flex; flex: 1; flex-direction: column; justify-content: center; align-items: start; padding:0px 20px;}
.content .roleName{ font-weight: bold; margin-bottom: 5px; word-break: break-all; display: inline-block; width: 100%; overflow: hidden; text-overflow:ellipsis; white-space: nowrap;}
.content .roleNum{ width: 100%; margin-bottom: 8px; padding-bottom: 5px; border-bottom: 1px dashed rgba(0,0,0,0.2)}
.content .roleNum .name-num{ margin-left: 5px;font-weight: bold; font-size: 12px}
.operate { border-top: 1px solid #e8eaec; height: 40px; text-align: center; line-height: 40px; }
.operate span { cursor: pointer; color: #1890ff}
.inner.add-btn { background: #e8eaec; border: none; }
.inner.add-btn > button { width: 100%; height: 100%; font-size: 16px; color: #1890ff;}
.center-p{ text-align: center;}
.group-icon{ width: 16px; position: relative; top: -2px;}
</style>
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