合并代码

This commit is contained in:
xiongchengqiang 2020-05-13 10:43:57 +08:00
commit 47cb69677e
86 changed files with 1099 additions and 54 deletions

View File

@ -7,7 +7,7 @@
<!-- <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css"> -->
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>数字化管理系统</title>
<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/echarts-all-3.js"></script>
<script src="./src/assets/js/echarts/echarts.min.js"></script>
</head>
<body>

View File

@ -23,6 +23,11 @@ export const apiSysUserConfirm = (data, type) => {
return http({ url: `/renren-fast-server/sys/user${type}`, method: 'post', data })
}
// 删除用户
export const apiSysUserDelete = (data, type) => {
return http({ url: `/renren-fast-server/sys/user/delete`, method: 'post', data })
}
/**
* 角色管理
*/
@ -41,6 +46,11 @@ export const apiSysRoleConfirm = (data, type) => {
return http({ url: `/renren-fast-server/sys/role${type}`, method: 'post', data })
}
// 删除角色
export const apiSysRoleDelete = (data, type) => {
return http({ url: `/renren-fast-server/sys/role/delete`, method: 'post', data })
}
/**
* 菜单管理
*/
@ -63,3 +73,8 @@ export const apiSysMenuInfo = (params, id) => {
export const apiSysMenuConfirm = (data, type) => {
return http({ url: `/renren-fast-server/sys/menu${type}`, method: 'post', data })
}
// 删除菜单
export const apiSysMenuDelete = (params, id) => {
return http({ url: `/renren-fast-server/sys/menu/delete/${id}`, method: 'get', params })
}

22
src/assets/js/echarts/echarts.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,42 @@
<template>
<el-submenu
v-if="menu.children && menu.children.length >= 1"
:index="menu.id + ''">
<template slot="title">
<icon-svg :name="menu.icon==null?'':menu.icon" class="site-sidebar__menu-icon"></icon-svg>
<span>{{menu.name}} ({{menu.number}})</span>
</template>
<menu-tree
v-for="item in menu.children"
:key="item.id"
:menu="item">
</menu-tree>
</el-submenu>
<el-menu-item v-else :index="menu.id.toString()" @click.native="handleGoRoute(menu)">
<icon-svg :name="menu.icon==null?'':menu.icon" class="site-sidebar__menu-icon"></icon-svg>
<span>{{menu.name}} ({{menu.number}})</span>
</el-menu-item>
</template>
<script>
import menuTree from './index'
export default {
name: 'menu-tree',
props: {
menu: {
type: Object,
required: true
}
},
components: {
menuTree
},
methods: {
// menuId()
handleGoRoute (menu) {
this.$router.push({name: 'staff', query: {id: menu.id}})
}
}
}
</script>

View File

Before

Width:  |  Height:  |  Size: 965 B

After

Width:  |  Height:  |  Size: 965 B

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 872 B

After

Width:  |  Height:  |  Size: 872 B

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 811 B

After

Width:  |  Height:  |  Size: 811 B

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 723 B

After

Width:  |  Height:  |  Size: 723 B

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

3
src/element/index.js Normal file
View File

@ -0,0 +1,3 @@
import '../element/element-ui'
import '../element/element-ui-theme'
import '../element/icons'

View File

@ -1,13 +1,11 @@
import Vue from 'vue'
import App from '@/App'
import router from '@/router' // api: https://github.com/vuejs/vue-router
import store from '@/store' // api: https://github.com/vuejs/vuex
import VueCookie from 'vue-cookie' // api: https://github.com/alfhen/vue-cookie
import '@/element-ui' // api: https://github.com/ElemeFE/element
import '@/icons' // api: http://www.iconfont.cn/
// import '@/element-ui-theme'
import router from '@/router'
import store from '@/store'
import VueCookie from 'vue-cookie'
import '@/element/index'
import '@/assets/scss/index.scss'
import httpRequest from '@/utils/httpRequest' // api: https://github.com/axios/axios
import httpRequest from '@/utils/httpRequest'
import { isAuth } from '@/utils'
// import cloneDeep from 'lodash/cloneDeep'
import echarts from 'echarts'

45
src/mocks/index.js Normal file
View File

@ -0,0 +1,45 @@
import Mock from 'mockjs'
import * as common from './modules/common'
import * as jobSchedule from './modules/job-schedule'
import * as oss from './modules/oss'
import * as sysConfig from './modules/sys-config'
import * as sysLog from './modules/sys-log'
import * as sysMenu from './modules/sys-menu'
import * as sysRole from './modules/sys-role'
import * as sysUser from './modules/sys-user'
// tips
// 1. 开启/关闭[业务模块]拦截, 通过调用fnCreate方法[isOpen参数]设置.
// 2. 开启/关闭[业务模块中某个请求]拦截, 通过函数返回对象中的[isOpen属性]设置.
fnCreate(common, false)
fnCreate(jobSchedule, false)
fnCreate(oss, false)
fnCreate(sysConfig, false)
fnCreate(sysLog, false)
fnCreate(sysMenu, false)
fnCreate(sysRole, false)
fnCreate(sysUser, false)
/**
* 创建mock模拟数据
* @param {*} mod 模块
* @param {*} isOpen 是否开启?
*/
function fnCreate (mod, isOpen = true) {
if (isOpen) {
for (var key in mod) {
((res) => {
if (res.isOpen !== false) {
Mock.mock(new RegExp(res.url), res.type, (opts) => {
opts['data'] = opts.body ? JSON.parse(opts.body) : null
delete opts.body
console.log('\n')
console.log('%cmock拦截, 请求: ', 'color:blue', opts)
console.log('%cmock拦截, 响应: ', 'color:blue', res.data)
return res.data
})
}
})(mod[key]() || {})
}
}
}

View File

@ -0,0 +1,31 @@
import Mock from 'mockjs'
// 生成数据列表
var dataList = []
for (let i = 0; i < Math.floor(Math.random() * 10 + 1); i++) {
dataList.push(Mock.mock({
'id': '@increment',
'paramKey': '@first',
'paramValue': '@last',
'remark': '@csentence'
}))
}
// 获取文件列表
export function list () {
return {
url: '/sys/oss/list',
type: 'get',
data: {
'msg': 'success',
'code': 0,
'page': {
'totalCount': dataList.length,
'pageSize': 10,
'totalPage': 1,
'currPage': 1,
'list': dataList
}
}
}
}

View File

@ -0,0 +1,628 @@
// 生成数据列表
var dataList = [
{
'menuId': 1,
'parentId': 0,
'parentName': null,
'name': '系统管理',
'url': null,
'perms': null,
'type': 0,
'icon': 'system',
'orderNum': 0,
'open': null,
'list': null
},
{
'menuId': 2,
'parentId': 1,
'parentName': '系统管理',
'name': '管理员列表',
'url': 'sys/user',
'perms': null,
'type': 1,
'icon': 'admin',
'orderNum': 1,
'open': null,
'list': null
},
{
'menuId': 3,
'parentId': 1,
'parentName': '系统管理',
'name': '角色管理',
'url': 'sys/role',
'perms': null,
'type': 1,
'icon': 'role',
'orderNum': 2,
'open': null,
'list': null
},
{
'menuId': 4,
'parentId': 1,
'parentName': '系统管理',
'name': '菜单管理',
'url': 'sys/menu',
'perms': null,
'type': 1,
'icon': 'menu',
'orderNum': 3,
'open': null,
'list': null
},
{
'menuId': 5,
'parentId': 1,
'parentName': '系统管理',
'name': 'SQL监控',
'url': 'http://localhost:8080/renren-fast/druid/sql.html',
'perms': null,
'type': 1,
'icon': 'sql',
'orderNum': 4,
'open': null,
'list': null
},
{
'menuId': 6,
'parentId': 1,
'parentName': '系统管理',
'name': '定时任务',
'url': 'job/schedule',
'perms': null,
'type': 1,
'icon': 'job',
'orderNum': 5,
'open': null,
'list': null
},
{
'menuId': 7,
'parentId': 6,
'parentName': '定时任务',
'name': '查看',
'url': null,
'perms': 'sys:schedule:list,sys:schedule:info',
'type': 2,
'icon': null,
'orderNum': 0,
'open': null,
'list': null
},
{
'menuId': 8,
'parentId': 6,
'parentName': '定时任务',
'name': '新增',
'url': null,
'perms': 'sys:schedule:save',
'type': 2,
'icon': null,
'orderNum': 0,
'open': null,
'list': null
},
{
'menuId': 9,
'parentId': 6,
'parentName': '定时任务',
'name': '修改',
'url': null,
'perms': 'sys:schedule:update',
'type': 2,
'icon': null,
'orderNum': 0,
'open': null,
'list': null
},
{
'menuId': 10,
'parentId': 6,
'parentName': '定时任务',
'name': '删除',
'url': null,
'perms': 'sys:schedule:delete',
'type': 2,
'icon': null,
'orderNum': 0,
'open': null,
'list': null
},
{
'menuId': 11,
'parentId': 6,
'parentName': '定时任务',
'name': '暂停',
'url': null,
'perms': 'sys:schedule:pause',
'type': 2,
'icon': null,
'orderNum': 0,
'open': null,
'list': null
},
{
'menuId': 12,
'parentId': 6,
'parentName': '定时任务',
'name': '恢复',
'url': null,
'perms': 'sys:schedule:resume',
'type': 2,
'icon': null,
'orderNum': 0,
'open': null,
'list': null
},
{
'menuId': 13,
'parentId': 6,
'parentName': '定时任务',
'name': '立即执行',
'url': null,
'perms': 'sys:schedule:run',
'type': 2,
'icon': null,
'orderNum': 0,
'open': null,
'list': null
},
{
'menuId': 14,
'parentId': 6,
'parentName': '定时任务',
'name': '日志列表',
'url': null,
'perms': 'sys:schedule:log',
'type': 2,
'icon': null,
'orderNum': 0,
'open': null,
'list': null
},
{
'menuId': 15,
'parentId': 2,
'parentName': '管理员列表',
'name': '查看',
'url': null,
'perms': 'sys:user:list,sys:user:info',
'type': 2,
'icon': null,
'orderNum': 0,
'open': null,
'list': null
},
{
'menuId': 16,
'parentId': 2,
'parentName': '管理员列表',
'name': '新增',
'url': null,
'perms': 'sys:user:save,sys:role:select',
'type': 2,
'icon': null,
'orderNum': 0,
'open': null,
'list': null
},
{
'menuId': 17,
'parentId': 2,
'parentName': '管理员列表',
'name': '修改',
'url': null,
'perms': 'sys:user:update,sys:role:select',
'type': 2,
'icon': null,
'orderNum': 0,
'open': null,
'list': null
},
{
'menuId': 18,
'parentId': 2,
'parentName': '管理员列表',
'name': '删除',
'url': null,
'perms': 'sys:user:delete',
'type': 2,
'icon': null,
'orderNum': 0,
'open': null,
'list': null
},
{
'menuId': 19,
'parentId': 3,
'parentName': '角色管理',
'name': '查看',
'url': null,
'perms': 'sys:role:list,sys:role:info',
'type': 2,
'icon': null,
'orderNum': 0,
'open': null,
'list': null
},
{
'menuId': 20,
'parentId': 3,
'parentName': '角色管理',
'name': '新增',
'url': null,
'perms': 'sys:role:save,sys:menu:list',
'type': 2,
'icon': null,
'orderNum': 0,
'open': null,
'list': null
},
{
'menuId': 21,
'parentId': 3,
'parentName': '角色管理',
'name': '修改',
'url': null,
'perms': 'sys:role:update,sys:menu:list',
'type': 2,
'icon': null,
'orderNum': 0,
'open': null,
'list': null
},
{
'menuId': 22,
'parentId': 3,
'parentName': '角色管理',
'name': '删除',
'url': null,
'perms': 'sys:role:delete',
'type': 2,
'icon': null,
'orderNum': 0,
'open': null,
'list': null
},
{
'menuId': 23,
'parentId': 4,
'parentName': '菜单管理',
'name': '查看',
'url': null,
'perms': 'sys:menu:list,sys:menu:info',
'type': 2,
'icon': null,
'orderNum': 0,
'open': null,
'list': null
},
{
'menuId': 24,
'parentId': 4,
'parentName': '菜单管理',
'name': '新增',
'url': null,
'perms': 'sys:menu:save,sys:menu:select',
'type': 2,
'icon': null,
'orderNum': 0,
'open': null,
'list': null
},
{
'menuId': 25,
'parentId': 4,
'parentName': '菜单管理',
'name': '修改',
'url': null,
'perms': 'sys:menu:update,sys:menu:select',
'type': 2,
'icon': null,
'orderNum': 0,
'open': null,
'list': null
},
{
'menuId': 26,
'parentId': 4,
'parentName': '菜单管理',
'name': '删除',
'url': null,
'perms': 'sys:menu:delete',
'type': 2,
'icon': null,
'orderNum': 0,
'open': null,
'list': null
},
{
'menuId': 27,
'parentId': 1,
'parentName': '系统管理',
'name': '参数管理',
'url': 'sys/config',
'perms': 'sys:config:list,sys:config:info,sys:config:save,sys:config:update,sys:config:delete',
'type': 1,
'icon': 'config',
'orderNum': 6,
'open': null,
'list': null
},
{
'menuId': 29,
'parentId': 1,
'parentName': '系统管理',
'name': '系统日志',
'url': 'sys/log',
'perms': 'sys:log:list',
'type': 1,
'icon': 'log',
'orderNum': 7,
'open': null,
'list': null
},
{
'menuId': 30,
'parentId': 1,
'parentName': '系统管理',
'name': '文件上传',
'url': 'oss/oss',
'perms': 'sys:oss:all',
'type': 1,
'icon': 'oss',
'orderNum': 6,
'open': null,
'list': null
}
]
var navDataList = [
{
'menuId': 1,
'parentId': 0,
'parentName': null,
'name': '系统管理',
'url': null,
'perms': null,
'type': 0,
'icon': 'system',
'orderNum': 0,
'open': null,
'list': [
{
'menuId': 2,
'parentId': 1,
'parentName': null,
'name': '管理员列表',
'url': 'sys/user',
'perms': null,
'type': 1,
'icon': 'admin',
'orderNum': 1,
'open': null,
'list': null
},
{
'menuId': 3,
'parentId': 1,
'parentName': null,
'name': '角色管理',
'url': 'sys/role',
'perms': null,
'type': 1,
'icon': 'role',
'orderNum': 2,
'open': null,
'list': null
},
{
'menuId': 4,
'parentId': 1,
'parentName': null,
'name': '菜单管理',
'url': 'sys/menu',
'perms': null,
'type': 1,
'icon': 'menu',
'orderNum': 3,
'open': null,
'list': null
},
{
'menuId': 5,
'parentId': 1,
'parentName': null,
'name': 'SQL监控',
'url': 'http://localhost:8080/renren-fast/druid/sql.html',
'perms': null,
'type': 1,
'icon': 'sql',
'orderNum': 4,
'open': null,
'list': null
},
{
'menuId': 6,
'parentId': 1,
'parentName': null,
'name': '定时任务',
'url': 'job/schedule',
'perms': null,
'type': 1,
'icon': 'job',
'orderNum': 5,
'open': null,
'list': null
},
{
'menuId': 27,
'parentId': 1,
'parentName': null,
'name': '参数管理',
'url': 'sys/config',
'perms': 'sys:config:list,sys:config:info,sys:config:save,sys:config:update,sys:config:delete',
'type': 1,
'icon': 'config',
'orderNum': 6,
'open': null,
'list': null
},
{
'menuId': 30,
'parentId': 1,
'parentName': null,
'name': '文件上传',
'url': 'oss/oss',
'perms': 'sys:oss:all',
'type': 1,
'icon': 'oss',
'orderNum': 6,
'open': null,
'list': null
},
{
'menuId': 29,
'parentId': 1,
'parentName': null,
'name': '系统日志',
'url': 'sys/log',
'perms': 'sys:log:list',
'type': 1,
'icon': 'log',
'orderNum': 7,
'open': null,
'list': null
}
]
}
]
// 获取导航菜单列表 / 权限
export function nav () {
return {
// isOpen: false,
url: '/sys/menu/nav',
type: 'get',
data: {
'msg': 'success',
'code': 0,
'menuList': navDataList,
'permissions': [
'sys:schedule:info',
'sys:menu:update',
'sys:menu:delete',
'sys:config:info',
'sys:menu:list',
'sys:config:save',
'sys:config:update',
'sys:schedule:resume',
'sys:user:delete',
'sys:config:list',
'sys:user:update',
'sys:role:list',
'sys:menu:info',
'sys:menu:select',
'sys:schedule:update',
'sys:schedule:save',
'sys:role:select',
'sys:user:list',
'sys:menu:save',
'sys:role:save',
'sys:schedule:log',
'sys:role:info',
'sys:schedule:delete',
'sys:role:update',
'sys:schedule:list',
'sys:user:info',
'sys:schedule:run',
'sys:config:delete',
'sys:role:delete',
'sys:user:save',
'sys:schedule:pause',
'sys:log:list',
'sys:oss:all'
]
}
}
}
// 获取菜单列表
export function list () {
return {
// isOpen: false,
url: '/sys/menu/list',
type: 'get',
data: dataList
}
}
// 获取上级菜单
export function select () {
let dataList = JSON.parse(JSON.stringify(navDataList))
dataList = dataList.concat(dataList[0].list)
return {
// isOpen: false,
url: '/sys/menu/select',
type: 'get',
data: {
'msg': 'success',
'code': 0,
'menuList': dataList
}
}
}
// 获取菜单信息
export function info () {
return {
// isOpen: false,
url: '/sys/menu/info',
type: 'get',
data: {
'msg': 'success',
'code': 0,
'menu': dataList[0]
}
}
}
// 添加菜单
export function add () {
return {
// isOpen: false,
url: '/sys/menu/save',
type: 'post',
data: {
'msg': 'success',
'code': 0
}
}
}
// 修改菜单
export function update () {
return {
// isOpen: false,
url: '/sys/menu/update',
type: 'post',
data: {
'msg': 'success',
'code': 0
}
}
}
// 删除菜单
export function del () {
return {
// isOpen: false,
url: '/sys/menu/delete',
type: 'post',
data: {
'msg': 'success',
'code': 0
}
}
}

View File

@ -1,37 +1,251 @@
<template>
<div class="staff-archives">
员工档案
<div id="myChart" :style="{width: '300px', height: '300px'}"></div>
<div class="staff">
<el-card>
<el-row>
<el-col class="menu" :span="6">
<el-menu @open="openMenu" :default-active="current" :collapse-transition="true" :unique-opened="true">
<menu-tree v-for="(item) in menuList" :key="item.id" :menu="item"></menu-tree>
</el-menu>
</el-col>
<el-col :span="18">
<div class="block">
<el-form :inline="true">
<el-form-item label="员工姓名"><el-input v-model="searchParams.staffName"></el-input></el-form-item>
<el-form-item label="人员状态">
<el-select v-model="searchParams.staffState" placeholder="请选择">
<el-option v-for="item in staffStateList" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="getTable()">查询</el-button>
<el-button @click="clear()">重置</el-button>
</el-form-item>
</el-form>
</div>
<div class="table">
<el-table
v-loading="loading"
:data="tableData"
:header-cell-style="{'color': '#909399', 'background-color': '#f5f7fa'}"
style="width: 100%"
height="100%">
<el-table-column header-align="center" align="center" label="工号" prop="jobnumber"></el-table-column>
<el-table-column header-align="center" align="center" label="员工姓名" prop="name"></el-table-column>
<el-table-column header-align="center" align="center" label="职位" prop="position"></el-table-column>
<el-table-column header-align="center" align="center" label="状态" prop="deptName"></el-table-column>
<el-table-column header-align="center" align="center" label="操作">
<template slot-scope="scope">
<el-button type="text" @click="handleView(scope.row)">查看</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
class="bl-form3"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
:page-sizes="[10, 20, 50]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next"
:total="pageTotal">
</el-pagination>
</div>
</el-col>
</el-row>
</el-card>
</div>
</template>
<script>
import menuTree from '@/components/menu-tree'
export default {
components: {
menuTree
},
data () {
return {
menuList: [], //
tableData: [], //
//
searchParams: {
staffName: '',
staffState: ''
},
//
staffStateList: [
{ value: '0', label: '在职' },
{ value: '1', label: '离职' }
],
loading: false,
currentPage: 1,
pageSize: 10,
pageTotal: 0,
deptId: '',
//
showAddDialogForm: false,
activeName: 'first',
form: {
name: '',
region: '',
date1: '',
date2: '',
delivery: false,
type: [],
resource: '',
desc: ''
}
}
},
mounted () {
this.handleDrawLine()
watch: {
$route: function (val) {
if (val.name === 'staff') {
this.clearData()
this.handleGetTableList(val.query.id)
}
}
},
computed: {
current () {
return this.$route.query.hasOwnProperty('id') ? this.$route.query.id ? this.$route.query.id.toString() : '' : ''
}
},
created () {
this.handleGetMenuList()
this.handleGetTableList(this.current)
},
methods: {
handleDrawLine () {
let myChart = this.$echarts.init(document.getElementById('myChart'))
//
myChart.setOption({
title: { text: '在Vue中使用echarts' },
tooltip: {},
xAxis: {
data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
},
yAxis: {},
series: [{
name: '销量',
type: 'bar',
data: [5, 20, 36, 10, 10, 20]
}]
})
//
handleGetMenuList () {
let data = [{
'children': [
{
'children': [],
'id': 70990627,
'name': '结算部',
'parentId': 55969991,
'number': '1'
}
],
'id': 55969991,
'name': '结算中心',
'parentId': 1,
'number': 2
}, {
'children': [
{
'children': [
{
'children': [],
'id': 92131240,
'name': '金融运营团队',
'parentId': 87839336
},
{
'children': [
{
'children': [],
'id': 9213124111,
'name': '2B业务组',
'parentId': 92131239
},
{
'children': [],
'id': 9213124222,
'name': '2C业务组',
'parentId': 92131239
}
],
'id': 92131239,
'name': '电商运营团队',
'parentId': 87839336
}
],
'id': 87839336,
'name': '运营中心',
'parentId': 87839327
}
],
'id': 87839327,
'name': '业务前台',
'parentId': 1
}]
this.menuList = data
},
//
handleGetTableList (id) {
this.tableData = [{
'deptName': '结算中心',
'id': 665,
'jobnumber': '4',
'name': '刘更顺',
'position': 'CPO'
},
{
'deptName': '结算部',
'id': 670,
'jobnumber': '239',
'name': '王文龙',
'position': '数据运营'
}]
this.loading = false
},
openMenu (index, indexPath) {
if (index === '51685041') {
this.handleGetTableList(index)
} else {
this.clearData()
this.loading = false
}
},
clear () {
this.input = ''
this.deptId = ''
this.$router.push({name: 'staff', query: {id: ''}})
},
clearData () {
this.tableData = []
this.currentPage = 1
this.pageTotal = 10
this.loading = true
},
handleCurrentChange (val) {
this.handleGetTableList()
},
handleSizeChange (val) {
this.pageSize = val
this.handleGetTableList()
},
//
handleClick (tab, event) {
console.log(tab, event)
},
handleView () {
this.showAddDialogForm = true
}
}
}
</script>
<style lang="scss" scoped>
.staff .block, .staff .table {
margin-left: 20px;
}
.el-form-item .el-form-item {
margin-bottom: 22px;
}
.add-wrap {
margin-bottom: 22px;
}
.turn-work-list {
background-color: pink;
padding-bottom: 10px;
margin-bottom: 20px;
}
.bl-form3{
&.el-pagination{
margin-top: 16px;
text-align: right;
}
}
</style>

View File

@ -72,7 +72,7 @@
<script>
import { treeDataTranslate } from '@/utils'
import Icon from '@/icons'
import Icon from '@/element/icons'
import { apiSysMenuSelect, apiSysMenuInfo, apiSysMenuConfirm } from '@/api/api_sys'
export default {

View File

@ -38,7 +38,7 @@
<script>
import AddOrUpdate from './menu-add-or-update'
import { treeDataTranslate } from '@/utils'
import { apiSysMenuList } from '@/api/api_sys'
import { apiSysMenuList, apiSysMenuDelete } from '@/api/api_sys'
export default {
data () {
@ -77,12 +77,8 @@
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(`/sys/menu/delete/${id}`),
method: 'post',
data: this.$http.adornData()
}).then(({data}) => {
if (data && data.code === 0) {
apiSysMenuDelete({}, `/${id}`).then(res => {
if (res && res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
@ -92,9 +88,27 @@
}
})
} else {
this.$message.error(data.msg)
this.$message.error(res.msg)
}
})
// this.$http({
// url: this.$http.adornUrl(`/sys/menu/delete/${id}`),
// method: 'post',
// data: this.$http.adornData()
// }).then(({data}) => {
// if (data && data.code === 0) {
// this.$message({
// message: '',
// type: 'success',
// duration: 1500,
// onClose: () => {
// this.handleGetTableList()
// }
// })
// } else {
// this.$message.error(data.msg)
// }
// })
}).catch(() => {})
}
}

View File

@ -39,7 +39,7 @@
<script>
import AddOrUpdate from './role-add-or-update'
import { apiSysRoleList } from '@/api/api_sys'
import { apiSysRoleList, apiSysRoleDelete } from '@/api/api_sys'
export default {
data () {
@ -112,12 +112,10 @@
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/sys/role/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
apiSysRoleDelete({
ids
}).then(res => {
if (res && res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
@ -127,9 +125,27 @@
}
})
} else {
this.$message.error(data.msg)
this.$message.error(res.msg)
}
})
// this.$http({
// url: this.$http.adornUrl('/sys/role/delete'),
// method: 'post',
// data: this.$http.adornData(ids, false)
// }).then(({data}) => {
// if (data && data.code === 0) {
// this.$message({
// message: '',
// type: 'success',
// duration: 1500,
// onClose: () => {
// this.handleGetTableList()
// }
// })
// } else {
// this.$message.error(data.msg)
// }
// })
}).catch(() => {})
}
}

View File

@ -46,7 +46,8 @@
<script>
import AddOrUpdate from './user-add-or-update'
import { apiSysUserList } from '@/api/api_sys'
import { apiSysUserList, apiSysUserDelete } from '@/api/api_sys'
export default {
data () {
return {
@ -118,12 +119,10 @@
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/sys/user/delete'),
method: 'post',
data: this.$http.adornData(userIds, false)
}).then(({data}) => {
if (data && data.code === 0) {
apiSysUserDelete({
userIds
}).then(res => {
if (res && res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
@ -133,9 +132,27 @@
}
})
} else {
this.$message.error(data.msg)
this.$message.error(res.msg)
}
})
// this.$http({
// url: this.$http.adornUrl('/sys/user/delete'),
// method: 'post',
// data: this.$http.adornData(userIds, false)
// }).then(({data}) => {
// if (data && data.code === 0) {
// this.$message({
// message: '',
// type: 'success',
// duration: 1500,
// onClose: () => {
// this.handleGetTableList()
// }
// })
// } else {
// this.$message.error(data.msg)
// }
// })
}).catch(() => {})
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB