Commit 36930614 authored by zhanglw's avatar zhanglw

用户管理

parent 1ea73e42
import request from '@/utils/request' import request from '@/utils/request'
import qs from 'qs' // import qs from 'qs'
export const HttpReq = { export const HttpReq = {
// 后台管理接口列表 // 后台管理接口列表
......
...@@ -71,6 +71,11 @@ export default { ...@@ -71,6 +71,11 @@ export default {
lineChartData: lineChartData.newVisitis lineChartData: lineChartData.newVisitis
} }
}, },
mounted() {
this.$nextTick(() => {
})
},
methods: { methods: {
handleSetLineChartData(type) { handleSetLineChartData(type) {
this.lineChartData = lineChartData[type] this.lineChartData = lineChartData[type]
......
...@@ -140,7 +140,7 @@ export default { ...@@ -140,7 +140,7 @@ export default {
} }
this.$store.dispatch('Login', user).then(() => { this.$store.dispatch('Login', user).then(() => {
this.loading = false this.loading = false
this.$router.push({ path: this.redirect || '/' }) this.$router.push({ path: this.redirect || '/backstage/dashboard' })
}).catch(() => { }).catch(() => {
this.loading = false this.loading = false
this.getCode() this.getCode()
......
...@@ -139,7 +139,7 @@ export default { ...@@ -139,7 +139,7 @@ export default {
} }
this.$store.dispatch('Login', user).then(() => { this.$store.dispatch('Login', user).then(() => {
this.loading = false this.loading = false
this.$router.push({ path: this.redirect || '/' }) this.$router.push({ path: this.redirect || '/backstage/dashboard' })
}).catch(() => { }).catch(() => {
this.loading = false this.loading = false
this.getCode() this.getCode()
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<ul class="user-info"> <ul class="user-info">
<li><div style="height: 100%"><svg-icon icon-class="login" /> 登录账号<div class="user-right">{{ user.username }}</div></div></li> <li><div style="height: 100%"><svg-icon icon-class="login" /> 登录账号<div class="user-right">{{ user.username }}</div></div></li>
<li><svg-icon icon-class="user1" /> 用户昵称 <div class="user-right">{{ user.nickName }}</div></li> <li><svg-icon icon-class="user1" /> 用户昵称 <div class="user-right">{{ user.nickName }}</div></li>
<li><svg-icon icon-class="dept" /> 所属部门 <div class="user-right"> {{ user.dept.name }}</div></li> <!-- <li><svg-icon icon-class="dept" /> 所属部门 <div class="user-right"> {{ user.dept.name }}</div></li>-->
<li><svg-icon icon-class="phone" /> 手机号码 <div class="user-right">{{ user.phone }}</div></li> <li><svg-icon icon-class="phone" /> 手机号码 <div class="user-right">{{ user.phone }}</div></li>
<li><svg-icon icon-class="email" /> 用户邮箱 <div class="user-right">{{ user.email }}</div></li> <li><svg-icon icon-class="email" /> 用户邮箱 <div class="user-right">{{ user.email }}</div></li>
<li> <li>
......
<template> <template>
<div class="app-container"> <div class="app-container">
<el-row :gutter="20"> <el-row :gutter="20">
<!--侧边部门数据--> <el-col :xs="24">
<el-col :xs="9" :sm="6" :md="5" :lg="4" :xl="4">
<div class="head-container">
<el-input
v-model="deptName"
clearable
size="small"
placeholder="输入部门名称搜索"
prefix-icon="el-icon-search"
class="filter-item"
@input="getDeptDatas"
/>
</div>
<el-tree
:data="deptDatas"
:load="getDeptDatas"
:props="defaultProps"
:expand-on-click-node="false"
lazy
@node-click="handleNodeClick"
/>
</el-col>
<!--用户数据-->
<el-col :xs="15" :sm="18" :md="19" :lg="20" :xl="20">
<!--工具栏--> <!--工具栏-->
<div class="head-container"> <div class="head-container">
<div v-if="crud.props.searchToggle"> <div v-if="crud.props.searchToggle">
...@@ -86,32 +63,7 @@ ...@@ -86,32 +63,7 @@
<el-form-item label="邮箱" prop="email"> <el-form-item label="邮箱" prop="email">
<el-input v-model="form.email" /> <el-input v-model="form.email" />
</el-form-item> </el-form-item>
<el-form-item label="部门" prop="dept.id">
<treeselect
v-model="form.dept.id"
:options="depts"
:load-options="loadDepts"
style="width: 178px"
placeholder="选择部门"
/>
</el-form-item>
<el-form-item label="岗位" prop="jobs">
<el-select
v-model="jobDatas"
style="width: 178px"
multiple
placeholder="请选择"
@remove-tag="deleteTag"
@change="changeJob"
>
<el-option
v-for="item in jobs"
:key="item.name"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="性别"> <el-form-item label="性别">
<el-radio-group v-model="form.gender" style="width: 178px"> <el-radio-group v-model="form.gender" style="width: 178px">
<el-radio label="男"></el-radio> <el-radio label="男"></el-radio>
...@@ -159,11 +111,6 @@ ...@@ -159,11 +111,6 @@
<el-table-column prop="gender" label="性别" /> <el-table-column prop="gender" label="性别" />
<el-table-column :show-overflow-tooltip="true" prop="phone" width="100" label="电话" /> <el-table-column :show-overflow-tooltip="true" prop="phone" width="100" label="电话" />
<el-table-column :show-overflow-tooltip="true" width="135" prop="email" label="邮箱" /> <el-table-column :show-overflow-tooltip="true" width="135" prop="email" label="邮箱" />
<el-table-column :show-overflow-tooltip="true" prop="dept" label="部门">
<template slot-scope="scope">
<div>{{ scope.row.dept.name }}</div>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="enabled"> <el-table-column label="状态" align="center" prop="enabled">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
...@@ -211,7 +158,6 @@ import crudOperation from '@crud/CRUD.operation' ...@@ -211,7 +158,6 @@ import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation' import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination' import pagination from '@crud/Pagination'
import DateRangePicker from '@/components/DateRangePicker' import DateRangePicker from '@/components/DateRangePicker'
import Treeselect from '@riophae/vue-treeselect'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect' import { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
...@@ -220,7 +166,7 @@ let userJobs = [] ...@@ -220,7 +166,7 @@ let userJobs = []
const defaultForm = { id: null, username: null, nickName: null, gender: '', email: null, enabled: 'false', roles: [], jobs: [], dept: { id: null }, phone: null } const defaultForm = { id: null, username: null, nickName: null, gender: '', email: null, enabled: 'false', roles: [], jobs: [], dept: { id: null }, phone: null }
export default { export default {
name: 'User', name: 'User',
components: { Treeselect, crudOperation, rrOperation, udOperation, pagination, DateRangePicker }, components: { crudOperation, rrOperation, udOperation, pagination, DateRangePicker },
cruds() { cruds() {
return CRUD({ title: '用户', url: 'api/users', crudMethod: { ...crudUser }}) return CRUD({ title: '用户', url: 'api/users', crudMethod: { ...crudUser }})
}, },
......
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