Commit f4855297 by fengzhaoyu

新建分支

parent 88beb353
NODE_ENV = 'development'
VUE_APP_API_URL = '/api/'
\ No newline at end of file
VUE_APP_API_URL = '/api/'
......@@ -36,10 +36,10 @@ const config = {
})
},
// dd.ready参数为回调函数,在环境准备就绪时触发,jsapi的调用需要保证在该回调函数触发后调用,否则无效。
ddready: (item) => {
ddready: (item, hasSelect) => {
return new Promise((resolve, reject) => {
dd.ready(function () {
return resolve(config[item]())
return resolve(config[item](hasSelect))
})
})
},
......@@ -115,6 +115,34 @@ const config = {
}
})
})
},
ddchooseTen: (hasSelect) => {
console.log(hasSelect.userHasRoles, 'hasSelect')
return new Promise((resolve, reject) => {
dd.biz.contact.complexPicker({
title: '人员选择', // 标题
corpId: localStorage.getItem('orgId'), // 企业的corpId
multiple: true, // 是否多选
limitTips: '超出了', // 超过限定人数返回提示
maxUsers: 10, // 最大可选人数
pickedUsers: hasSelect, // 已选用户
pickedDepartments: [], // 已选部门
disabledUsers: [], // 不可选用户
disabledDepartments: [], // 不可选部门
requiredUsers: [], // 必选用户(不可取消选中状态)
requiredDepartments: [], // 必选部门(不可取消选中状态)
appId: localStorage.getItem('agentId'), // 微应用的Id
permissionType: 'GLOBAL', // 可添加权限校验,选人权限,目前只有GLOBAL这个参数
responseUserOnly: false, // 返回人,或者返回人和部门
startWithDepartmentId: -1, // 仅支持0和-1
onSuccess: function (result) {
return resolve(result)
},
onFail: function (err) {
return reject(err)
}
})
})
}
}
......
......@@ -15,7 +15,8 @@
<a-menu-item key="accountManagement">支付管理</a-menu-item>
<a-menu-item key="classificationOfDishes">食堂管理</a-menu-item>
<a-menu-item key="historicalVisitors">访客管理</a-menu-item>
<!-- <a-menu-item key="5">权限管理</a-menu-item> -->
<a-menu-item key="rightsManagement">权限管理</a-menu-item>
<!-- <a-menu-item key="5">权限管理</a-menu-item> -->
</a-menu>
</a-layout-header>
<a-layout-content style="padding: 16px 50px 0px 50px">
......
......@@ -80,20 +80,8 @@
v-decorator="['orderPrice',{rules: [{required: true, message: '充值金额不能为空'}, {validator: rechargeNum}]}]"
/>
</a-form-item>
<a-form-item
v-bind="formItemLayout"
label="截止日期"
>
<a-date-picker
placeholder="请选择截止日期"
:disabledDate="disabledDate"
:showToday="false"
v-decorator="['date-picker', config]"
/>
</a-form-item>
<a-form-item label="选择成员" v-bind="formItemLayout">
<div class="peopleBox" @click="choosePeople()">
{{ peopleListStr() }}
</div>
</a-form-item>
<a-form-item label="备注" v-bind="formItemLayout" >
......
<template>
<div class="addOrRights">
<a-button type="primary" @click="back()"><img style="margin-top:-4px;margin-right: 6px;width: 14px" src="../../../assets/back.png"/>返回</a-button>
<div class="title">查看津贴</div>
<a-form :form="form">
<a-form-item label="角色名称" v-bind="formItemLayout" >
<a-input
placeholder="请填写角色名称"
v-decorator="['roleName',{rules: [{required: true, message: '角色名称不能为空'}]}]"
/>
</a-form-item>
<a-form-item label="角色描述" v-bind="formItemLayout" >
<a-input
placeholder="请填写角色描述"
v-decorator="['roleDec',{rules: [{required: false, message: '角色描述不能为空'}]}]"
/>
</a-form-item>
<a-form-item label="选择成员" v-bind="formItemLayout" >
<a-input
placeholder="选择成员"
@click="selectPeople"
v-decorator="['roleName',{rules: [{required: true, message: '成员不能为空'}]}]"
/>
</a-form-item>
<div class="permisson">
<div class="permissonLeft">分配权限:</div>
<div class="permissonRight">
<div>
<div class="permissonTitle">
<a-checkbox>
支付管理
</a-checkbox>
</div>
<a-row :style="{border: '1px solid #F8F8F8',display: 'flex',padding:'0 20px'}">
<a-col :span="4" :style="{borderRight: '1px solid #f8f8f8', padding:'22px 0'}"><a-checkbox>账户中心</a-checkbox></a-col>
<a-col :span="20" :style="{padding:'0px 0 22px 8px'}">
<a-col :span="6" :style="{paddingTop:'22px'}"><a-checkbox>查看1</a-checkbox></a-col>
<a-col :span="6" :style="{paddingTop:'22px'}"><a-checkbox>充值</a-checkbox></a-col>
<a-col :span="6" :style="{paddingTop:'22px'}"><a-checkbox>绑定卡片</a-checkbox></a-col>
<a-col :span="6" :style="{paddingTop:'22px'}"><a-checkbox>注销并界限</a-checkbox></a-col>
<a-col :span="6" :style="{paddingTop:'22px'}"><a-checkbox>查看津贴</a-checkbox></a-col>
<a-col :span="6" :style="{paddingTop:'22px'}"><a-checkbox>查看详情</a-checkbox></a-col>
</a-col>
</a-row>
<a-row :style="{border: '1px solid #F8F8F8',display: 'flex',padding:'0 20px'}">
<a-col :span="4" :style="{borderRight: '1px solid #f8f8f8', padding:'22px 0'}"><a-checkbox>充值记录</a-checkbox></a-col>
<a-col :span="20" :style="{padding:'0px 0 22px 8px'}">
<a-col :span="6" :style="{paddingTop:'22px'}"><a-checkbox>查看1</a-checkbox></a-col>
<a-col :span="6" :style="{paddingTop:'22px'}"><a-checkbox>充值</a-checkbox></a-col>
<a-col :span="6" :style="{paddingTop:'22px'}"><a-checkbox>绑定卡片</a-checkbox></a-col>
<a-col :span="6" :style="{paddingTop:'22px'}"><a-checkbox>查看详情</a-checkbox></a-col>
</a-col>
</a-row>
</div>
<div>
<div class="permissonTitle">
<a-checkbox>
支付管理
</a-checkbox>
</div>
<a-row :style="{border: '1px solid #F8F8F8',display: 'flex',padding:'0 20px'}">
<a-col :span="4" :style="{borderRight: '1px solid #f8f8f8', padding:'22px 0'}"><a-checkbox>账户中心</a-checkbox></a-col>
<a-col :span="20" :style="{padding:'0px 0 22px 8px'}">
<a-col :span="6" :style="{paddingTop:'22px'}"><a-checkbox>查看1</a-checkbox></a-col>
<a-col :span="6" :style="{paddingTop:'22px'}"><a-checkbox>充值</a-checkbox></a-col>
<a-col :span="6" :style="{paddingTop:'22px'}"><a-checkbox>绑定卡片</a-checkbox></a-col>
<a-col :span="6" :style="{paddingTop:'22px'}"><a-checkbox>注销并界限</a-checkbox></a-col>
<a-col :span="6" :style="{paddingTop:'22px'}"><a-checkbox>查看津贴</a-checkbox></a-col>
<a-col :span="6" :style="{paddingTop:'22px'}"><a-checkbox>查看详情</a-checkbox></a-col>
</a-col>
</a-row>
<a-row :style="{border: '1px solid #F8F8F8',display: 'flex',padding:'0 20px'}">
<a-col :span="4" :style="{borderRight: '1px solid #f8f8f8', padding:'22px 0'}"><a-checkbox>充值记录</a-checkbox></a-col>
<a-col :span="20" :style="{padding:'0px 0 22px 8px'}">
<a-col :span="6" :style="{paddingTop:'22px'}"><a-checkbox>查看1</a-checkbox></a-col>
<a-col :span="6" :style="{paddingTop:'22px'}"><a-checkbox>充值</a-checkbox></a-col>
<a-col :span="6" :style="{paddingTop:'22px'}"><a-checkbox>绑定卡片</a-checkbox></a-col>
<a-col :span="6" :style="{paddingTop:'22px'}"><a-checkbox>查看详情</a-checkbox></a-col>
</a-col>
</a-row>
</div>
<a-button type="primary" @click="confirm" class="confirm">确定</a-button>
</div>
</div>
</a-form>
</div>
</template>
<script>
import { $http } from '../../../api/axios'
import { config } from '../../../api/config'
export default {
name: 'addOrRights',
data () {
return {
form: this.$form.createForm(this),
formItemLayout: {
labelCol: {
xs: { span: 24 },
sm: { span: 3 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 8 }
}
}
}
},
methods: {
// 返回上一页
back () {
this.$router.go(-1)
},
// 选人
selectPeople () {
config.ddready('ddchooseOne').then((res) => {
})
},
// 确定 提交表单
confirm () {
}
}
}
</script>
<style scoped>
.title{
font-weight: bolder;
line-height: 22px;
margin:27px 0 18px 0;
}
input {
height: 40px;
}
.addOrRights /deep/ .ant-form-item-label {
width: 9.5% !important;
}
input {
margin-left: 5px;
}
.permisson {
display: flex;
height: 500px;
}
.permissonLeft {
height: 65px;
line-height: 65px;
font-weight: 400;
width: 9.5%;
text-align: right;
font-size: 14px;
color: rgba(0,0,0,0.85);
}
.permissonRight {
font-family: 'PingFangSC-Medium;';
height: 500px;
width: 100%;
font-size: 14px;
color: rgba(0,0,0,0.85);
}
.permissonTitle {
padding: 22px 20px;
background: #FAFAFA;
border: 1px solid #F8F8F8;
border-radius: 4px 4px 0px 0px;
}
.confirm {
margin-top: 40px;
}
</style>
<template>
<div class="rightManagement">
<!-- 超级管理员 -->
<div class="superAdministrator">
<div class="superAdministratorTitle">
1.超级管理员
<span>(该角色拥有系统的所有权限)</span>
</div>
<div class="superAdministratorTable">
<a-table :columns="columns" :dataSource="superAdministratorList" size="default" rowKey="key" :pagination="false">
<span slot="userHasRoles" slot-scope="userHasRoles">
<a-tag v-for="(userHasRole, index) in userHasRoles" :key="index">{{userHasRole}}</a-tag>
</span>
<span slot="action" slot-scope="text, record, index">
<a href="javascript:;" @click="selectSuperAdministrator(record, text, index)">编辑</a>
</span>
</a-table>
</div>
</div>
<!-- 角色 -->
<div class="role">
<div class="roleTitle">2.创建角色</div>
<div class="roleTable">
<a-button type="primary" icon="plus" class="addRole" @click="addRole" key="key">添加</a-button>
<a-table :columns="roleColumns" :dataSource="roleList" size="default" rowKey="id" :pagination="false">
<span slot="userHasRoles" slot-scope="userHasRoles">
<a-tag v-for="(userHasRole, index) in userHasRoles" :key="index">{{userHasRole}}</a-tag>
</span>
<span slot="action" slot-scope="text, record, index">
<a href="javascript:;" @click="selectSuperAdministrator(record, text, index)">编辑</a>
<a href="javascript:;" class="delete" @click="delectRoles(record, text, index)">删除</a>
</span>
</a-table>
</div>
</div>
</div>
</template>
<script>
import { config } from '../../../api/config.js'
import { $http } from '../../../api/axios.js'
export default {
name: 'rightsManagement',
component: {},
data () {
return {
columns: [{
title: '角色名称',
dataIndex: 'administratorName'
}, {
title: '拥有该角色的员工',
dataIndex: 'userHasRoles',
width: '60%',
scopedSlots: { customRender: 'userHasRoles' }
}, {
title: '操作',
dataIndex: 'action',
scopedSlots: { customRender: 'action' }
}],
roleColumns: [{
title: '角色名称',
dataIndex: 'roleName'
}, {
title: '角色描述',
dataIndex: 'roleDes'
}, {
title: '拥有该角色的员工',
dataIndex: 'userHasRoles',
scopedSlots: { customRender: 'userHasRoles' }
}, {
title: '创建时间',
dataIndex: 'creatTime'
}, {
title: '操作',
dataIndex: 'action',
scopedSlots: { customRender: 'action' }
}],
superAdministratorList: [], // 超级管理员列表
roleList: [], // 超级管理员列表
superAdministratorListId: []
}
},
created () {
this.getAllAdminisgtrator()
},
methods: {
// 编辑超级管理员
selectSuperAdministrator (superAdministratorListId) {
config.ddready('ddchooseTen', superAdministratorListId).then((res) => {
console.log(res, 'res')
})
},
// 删除角色
delectRoles (record) {
console.log(record, 1111)
this.$confirm({
title: '确认要删除该角色吗?',
content: '删除后,拥有该角色员工自动接触',
okText: '确定',
cancelText: '取消',
onOk () {
// _that.deleteCashier(record)
}
})
},
// 增加角色
addRole (obj) {
// console.log(obj, 111)
// this.chooseMenuList = obj.key
this.$router.push({ name: 'addOrRights' })
},
// 获取所有管理员列表
getAllAdminisgtrator () {
let data = {
item: 'e-card'
}
$http.post(`/admin/role/page1`, data).then(res => {
res.data.data.forEach((item, index) => {
if (item.roleCode === 'ROLE_SUPER_ADMIN') {
let userHasRoles = []
debugger
item.userList.forEach((userItem, userIndex) => {
userHasRoles.push(userItem.username)
this.superAdministratorListId.push(userItem.ddUserId)
})
this.superAdministratorList.push({
key: item.roleId,
administratorName: item.roleName,
userHasRoles: userHasRoles
})
} else {
this.roleList.push({
key: item.roleId,
roleName: item.roleName,
userHasRoles: ['朱阅悦', '韩佳佳'],
roleDes: item.roleDesc,
creatTime: item.createTime
})
}
})
})
}
},
watch: {
$route (to, from) {
this.defaultSelectedKeys = to.name
this.chooseMenuList = to.name
}
}
}
</script>
<style scoped>
a {
text-decoration: none;
}
.superAdministratorTitle,
.roleTitle {
height: 40px;
width: 100%;
line-height: 40px;
color: rgba(0,0,0,0.85);
font-weight: 500;
}
.superAdministratorTitle>span {
color: #A0A0A0;
}
.superAdministratorTable {
margin-top: 20px;
}
.role {
margin-top: 20px;
}
.addRole {
margin-top: 25px;
margin-bottom: 20px;
}
.delete {
margin-left: 5px;
}
</style>
<template>
<div class="rightsManagementHome">
<a-layout style="padding: 24px 0; background: #fff; min-height: calc(100vh - 149px);min-width:1100px">
<a-layout-sider width="200" style="background: #fff">
<a-menu
mode="inline"
:defaultSelectedKeys="[defaultSelectedKeys]"
:defaultOpenKeys="['sub1']"
style="height: 100%"
@click="routerPush"
>
<a-menu-item class="itemFlex" key="rightsManagement">
<div :class="[chooseMenuList === 'rightsManagement' ? 'menuIcon menuIcon1_2' : 'menuIcon menuIcon1_1']"></div><div>角色管理</div>
</a-menu-item>
</a-menu>
</a-layout-sider>
<a-layout-content :style="{ padding: '0 24px', minHeight: '280px' }">
<router-view/>
</a-layout-content>
</a-layout>
</div>
</template>
<script>
export default {
name: 'rightsManagementHome',
data () {
return {
defaultSelectedKeys: 'defaultSelectedKeys',
chooseMenuList: 'rightsManagement'
}
},
created () {
this.defaultSelectedKeys = this.$route.name
this.chooseMenuList = this.$route.name
},
watch: {
$route (to, from) {
this.defaultSelectedKeys = to.name
this.chooseMenuList = to.name
}
},
methods: {
routerPush (obj) {
this.chooseMenuList = obj.key
this.$router.push({ name: obj.key })
}
}
}
</script>
<style lang="less" scoped>
.itemFlex{
vertical-align:bottom;
display: flex;
align-items: center;
}
.menuIcon{
width: 13px;
height: 13px;
margin-right: 5px;
margin-top: -2px;
background-size: cover;
display: inline-block;
}
.menuIcon1_2{
background-image: url('../../../assets/canteenIcon/classificationOfDishes1.png');
}
.menuIcon1_1{
background-image: url('../../../assets/canteenIcon/classificationOfDishes2.png');
}
.menuIcon2_2{
background-image: url('../../../assets/canteenIcon/menuManagement1.png');
}
.menuIcon2_1{
background-image: url('../../../assets/canteenIcon/menuManagement2.png');
}
.menuIcon3_2{
background-image: url('../../../assets/canteenIcon/consumptionOrder1.png');
}
.menuIcon3_1{
background-image: url('../../../assets/canteenIcon/consumptionOrder2.png');
}
.menuIcon4_2{
background-image: url('../../../assets/canteenIcon/consumptionStatistics1.png');
}
.menuIcon4_1{
background-image: url('../../../assets/canteenIcon/consumptionStatistics2.png');
}
</style>
......@@ -2,12 +2,14 @@ import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import { Upload, Menu, Layout, Checkbox, Breadcrumb, Popover, Icon, Button, DatePicker, Input, Table, Tag, Divider, Dropdown, Modal, Form, Select, message, Pagination, LocaleProvider, Spin, Badge, Switch } from 'ant-design-vue'
import { Row, Col, Upload, Menu, Layout, Checkbox, Breadcrumb, Popover, Icon, Button, DatePicker, Input, Table, Tag, Divider, Dropdown, Modal, Form, Select, message, Pagination, LocaleProvider, Spin, Badge, Switch } from 'ant-design-vue'
import 'ant-design-vue/dist/antd.css'
import { config } from './api/config'
import './assets/css/global.css'
Vue.use(Layout)
Vue.use(Row)
Vue.use(Col)
Vue.use(Upload)
Vue.use(Checkbox)
Vue.use(Popover)
......
......@@ -145,6 +145,25 @@ export default new Router({
component: resolve => require(['./components/pages/VisitorManagement/VisitorSetting.vue'], resolve)
}
]
},
{
path: '/rightsManagementHome',
name: 'rightsManagementHome',
component: resolve => require(['./components/pages/rightsManagement/rightsManagementHome.vue'], resolve),
children: [
{
path: '/rightsManagement',
name: 'rightsManagement',
meta: { title: '权限管理/角色管理' },
component: resolve => require(['./components/pages/rightsManagement/rightsManagement.vue'], resolve)
},
{
path: '/addOrRights',
name: 'addOrRights',
meta: { title: '权限管理/角色管理/增加角色' },
component: resolve => require(['./components/pages/rightsManagement/addOrRights.vue'], resolve)
}
]
}
]
},
......
......@@ -2,7 +2,6 @@ import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
state: {
......
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