Commit c70f5844 by cwq0219

合并

2 parents 3474f96a 5dc13f86
......@@ -9,8 +9,9 @@
<router-link to="/user">user</router-link> |
<router-link to="/role">role</router-link> |
<router-link to="/orginizaManage">orginizaManage</router-link> |
<router-link to="/dictionaryManage">dictionaryManage</router-link>
<router-link to="/dictionaryManage">dictionaryManage</router-link> |
<router-link to="/dictionaryData">dictionaryData</router-link> |
<router-link to="/workLog">workLog</router-link>
<!-- <p>a链接跳转到主项目/其他子项目的页面,页面会刷新,效果不好<a href="/about">parent About</a></p> -->
<p v-if="isQiankun">
主项目把router传给子项目,子项目用这个router来跳转
......
......@@ -13,13 +13,21 @@ const API = {
getMockConfig() {
return MOCK_CONFIG_URL + '/test_config'
},
LOGIN_ACTION: BASE_URL + '/login_action',
LOGIN_ACTION: BASE_URL + '/login_action'
}
const USER_API = {
USER_SEARCH: {
apiUrl: BASE_URL + '/usercenter/user/search'
// method: 'post'
},
USER_SUPER: BASE_URL + '/usercenter/user/suitableSuperUsers',
USER_ADD: BASE_URL + '/usercenter/user/add'
}
const ORGINIZA_API = {
ORGINIZA_SEARCH: BASE_URL + '/usercenter/organization/rootList',
ORGINIZA_CHILDREN: BASE_URL + '/usercenter/organization/children'
ORGINIZA_CHILDREN: BASE_URL + '/usercenter/organization/children',
ORGINIZA_SIMPLElIST: BASE_URL + '/usercenter/organization/simpleList',
ORGINIZA_TREEORY: BASE_URL + '/usercenter/organization/treeOrg'
}
export { API }
export { API, USER_API, ORGINIZA_API }
......@@ -37,6 +37,16 @@ const routes = [
path: '/dictionaryManage',
name: 'DictionaryManage',
component: () => import('../views/dictionaryManage/index.vue')
},
{
path: '/dictionaryData',
name: 'dictionaryData',
component: () => import('../views/dictionaryManage/dictionaryData/index.vue')
},
{
path: '/workLog',
name: 'workLog',
component: () => import('../views/workLog/index.vue')
}
]
......
import HTTP from '@/utils/http'
import { API } from '@/config/config'
import { ORGINIZA_API } from '@/config/config'
export default class OrginizaService extends HTTP {
// 获取组织列表
getTableList () {
return new Promise((resolve, reject) => {
this.axiosGet({
url: API.ORGINIZA_SEARCH,
url: ORGINIZA_API.ORGINIZA_SEARCH,
data: {},
success(data) {
resolve(data)
......@@ -13,15 +14,15 @@ export default class OrginizaService extends HTTP {
error(error) {
// 网络请求失败
console.log('网络请求失败')
// window.location.reload()
}
})
})
}
// 根据根节点,获取子节点列表
getChildren (id) {
return new Promise((resolve, reject) => {
this.axiosGet({
url: API.ORGINIZA_CHILDREN,
url: ORGINIZA_API.ORGINIZA_CHILDREN,
data: {
rootId: id
},
......@@ -31,7 +32,38 @@ export default class OrginizaService extends HTTP {
error(error) {
// 网络请求失败
console.log('网络请求失败')
// window.location.reload()
}
})
})
}
// 获取组织列表树
getSimpleList () {
return new Promise((resolve, reject) => {
this.axiosGet({
url: ORGINIZA_API.ORGINIZA_SIMPLElIST,
data: {},
success(data) {
resolve(data)
},
error(error) {
// 网络请求失败
console.log('网络请求失败')
}
})
})
}
// 组织架构
getTreeOrg () {
return new Promise((resolve, reject) => {
this.axiosGet({
url: ORGINIZA_API.ORGINIZA_TREEORY,
data: {},
success(data) {
resolve(data)
},
error(error) {
// 网络请求失败
console.log('网络请求失败')
}
})
})
......
// import HTTP from '@/utils/http'
// import request from './request.js'
// import {
// API
// } from '@/config/config'
// // const aa = new HTTP()
// function getUserList(data) {
// request(API.USER_SEARCH, 'get', data)
// // return new Promise((resolve, reject) => {
// // aa.axiosGet({
// // url: API.USER_SEARCH,
// // data: {aa: 1},
// // success(data) {
// // console.log(data)
// // resolve(data)
// // },
// // error(error) {
// // // 网络请求失败
// // console.log('网络请求失败')
// // // window.location.reload()
// // }
// // })
// // })
import HTTP from '@/utils/http'
import { USER_API } from '@/config/config'
// }
// export {
// getUserList
// }
\ No newline at end of file
export default class UserService extends HTTP {
// 获取用户列表
getUserList () {
return new Promise((resolve, reject) => {
this.axiosGet({
url: USER_API.USER_SEARCH,
data: {},
success(data) {
resolve(data)
},
error(error) {
// 网络请求失败
console.log('网络请求失败')
// window.location.reload()
}
})
})
}
// 获取上级树
getSuperUser (params) {
return new Promise((resolve, reject) => {
this.axiosGet({
url: USER_API.USER_SUPER,
data: {params},
success(data) {
resolve(data)
},
error(error) {
// 网络请求失败
console.log('网络请求失败')
}
})
})
}
// 新增用户
addUser (params) {
return new Promise((resolve, reject) => {
this.axiosGet({
url: USER_API.USER_SUPER,
data: {params},
success(data) {
resolve(data)
},
error(error) {
// 网络请求失败
console.log('网络请求失败')
}
})
})
}
}
......@@ -17,6 +17,31 @@
rgba(232, 237, 250, 0.5) 0px 2px 4px 0px;
}
.system-container {
padding: 0 0 0 10px;
margin: 20px 24px;
background-color: #ffffff;
overflow: hidden;
.user-tree {
margin-top: 20px;
padding: 20px;
float: left;
width: 18%;
.user-tree-top {
height: 30px;
}
}
.user-container {
padding: 20px 10px 0px 20px;
float: left;
width: 82%;
}
}
.el-tree {
margin-top: 20px;
}
// 状态
.dot {
display: inline-block;
......
<template>
<div class="system-container">
<div class="user-container">
<search-form
class="searchTop border-shadow"
:formModel="searchForm"
:formList="dictionaryFormList"
>
<slot name="form-slot">
<el-button
type="primary"
:size="btn_size"
icon="el-icon-search"
:id="tableParams.btnId"
>搜索</el-button>
<el-button
type="primary"
:size="btn_size"
icon="el-icon-refresh"
>重置</el-button>
</slot>
</search-form>
<div class="table-btn">
<el-button
type="primary"
:size="btn_size"
icon="el-icon-plus"
@click="handleClose"
>新增</el-button>
</div>
<basic-table
:tableParams="tableParams"
:getListApi="getListApi"
:searchForm="searchForm"
:hasNum="false"
>
<span
slot="status"
slot-scope="scope"
>
<span class="dot green"></span><span class="statusText">正常</span>
</span>
<span
slot="table-button"
slot-scope="scope"
>
<el-button
v-for="(j, idx) in tableParams.tableOption.btnList"
:key="idx"
:type="j.type"
size="mini"
plain
@click="btnClick(j.pType, scope.scope)"
>{{j.name}}</el-button>
</span>
</basic-table>
<basic-dialog
:title="dictionaryDialogTitle"
:isVisible="dictionaryVisible"
@confirmDialog="handleConfirm"
@closeDialog="handleClose"
>
<slot>
<rule-form
:ruleForm="dictionaryForm"
:rules="dictionaryRules"
:ruleData="dictionaryData"
ref='dictionaryForm'
></rule-form>
</slot>
</basic-dialog>
</div>
</div>
</template>
<script>
export default {
data() {
return {
searchForm: {},
dictionaryFormList: [
{
type: 'input',
inputType: 'text',
prop: 'name',
placeholder: '请输入字典名称'
},
{
type: 'input',
inputType: 'text',
prop: 'type',
placeholder: '请输入字典标签'
},
{
type: 'select',
prop: 'status',
placeholder: '请选择字典状态',
options: [
{
label: '正常',
value: 1
}, {
label: '停用',
value: 2
}
]
}
],
tableParams: {
mutiSelectName: 'dictionaryData',
mutiSelectUniqueKey: 'id',
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableColumns: [
{
label: '字典编码',
prop: 'id'
}, {
label: '字典标签',
prop: 'dictName'
}, {
label: '字典键值',
prop: 'dictType'
}, {
label: '字典排序',
prop: 'remark'
}, {
label: '备注',
prop: 'remark'
}, {
label: '字典状态',
prop: 'enableStatus',
addHtml: 'status'
}, {
label: '创建时间',
prop: 'createdDate'
}
],
tableOption: {
width: 300,
btnList: [
{
type: 'primary',
name: '编辑',
pType: 'edit'
},
{
type: 'danger',
name: '删除',
pType: 'delete'
}
]
}
},
getListApi: null,
// 弹窗
dictionaryDialogTitle: '新增字典',
dictionaryVisible: false,
dictionaryForm: {},
dictionaryData: [
{ label: '字典类型:', prop: 'dictType', type: 'input' },
{ label: '字典标签:', prop: 'dictName', type: 'input' },
{ label: '字典编码:', prop: 'dictName', type: 'input' },
{ label: '字典键值:', prop: 'dictName', type: 'input' },
{ label: '字典顺序:', prop: 'dictName', type: 'input' },
{ label: '状态', prop: 'enableStatus', type: 'switch' },
{ label: '备注', prop: 'remark', type: 'input', inputText: 'textarea' }
],
dictionaryRules: {}
}
},
methods: {
// 按钮事件
btnClick(pType, scope) {
console.log(pType, scope)
switch (pType) {
case 'edit':
this.handleClose(scope)
break
case 'delete':
this.deleteEvent(scope.id)
break
case 'list':
console.log('list')
break
}
},
// 确定
handleConfirm() {
console.log(this.$refs.dictionaryForm)
this.$refs.dictionaryForm.$children[0].validate((valid) => {
if (valid) {
this.handleClose()
} else {
console.log('error')
}
})
},
// 取消
handleClose(row) {
console.log(row)
if (!this.dictionaryVisible && this.$refs.dictionaryForm) {
this.$refs.dictionaryForm.$children[0].resetFields()
}
this.dictionaryVisible = !this.dictionaryVisible
},
// 删除触发事件
deleteEvent(id) {
const that = this
const tipData = {
that: that,
tipText: '是否删除当前记录',
tipTitle: '提示',
type: 'error',
callBack: () => {
this.$message({
type: 'success',
message: '删除成功!'
})
}
}
this.$Common.confirmDialog(tipData)
}
}
}
</script>
\ No newline at end of file
<template>
<div>
<search-form
class="searchTop border-shadow"
:formModel="searchForm"
:formList="dictionaryFormList"
>
<slot name="form-slot">
<el-button
type="primary"
:size="btn_size"
icon="el-icon-search"
:id="tableParams.btnId"
>搜索</el-button>
<div class="system-container">
<div class="user-container">
<search-form
class="searchTop border-shadow"
:formModel="searchForm"
:formList="dictionaryFormList"
>
<slot name="form-slot">
<el-button
type="primary"
:size="btn_size"
icon="el-icon-search"
:id="tableParams.btnId"
>搜索</el-button>
<el-button
type="primary"
:size="btn_size"
icon="el-icon-refresh"
>重置</el-button>
</slot>
</search-form>
<div class="table-btn">
<el-button
type="primary"
:size="btn_size"
icon="el-icon-refresh"
>重置</el-button>
</slot>
</search-form>
<div class="table-btn">
<el-button
type="primary"
:size="btn_size"
icon="el-icon-plus"
@click="handleClose"
>新增</el-button>
</div>
<basic-table
:tableParams="tableParams"
:getListApi="getListApi"
:searchForm="searchForm"
:hasNum="false"
>
<span
slot="status"
slot-scope="scope"
icon="el-icon-plus"
@click="handleClose"
>新增</el-button>
</div>
<basic-table
:tableParams="tableParams"
:getListApi="getListApi"
:searchForm="searchForm"
:hasNum="false"
>
<span class="dot green"></span><span class="statusText">正常</span>
</span>
<span
slot="table-button"
slot-scope="scope"
<span
slot="status"
slot-scope="scope"
>
<span class="dot green"></span><span class="statusText">正常</span>
</span>
<span
slot="table-button"
slot-scope="scope"
>
<el-button
v-for="(j, idx) in tableParams.tableOption.btnList"
:key="idx"
:type="j.type"
size="mini"
plain
@click="btnClick(j.pType, scope.scope)"
>{{j.name}}</el-button>
</span>
</basic-table>
<basic-dialog
:title="dictionaryDialogTitle"
:isVisible="dictionaryVisible"
@confirmDialog="handleConfirm"
@closeDialog="handleClose"
>
<el-button
v-for="(j, idx) in tableParams.tableOption.btnList"
:key="idx"
:type="j.type"
size="mini"
plain
@click="btnClick(j.pType, scope.scope)"
>{{j.name}}</el-button>
</span>
</basic-table>
<basic-dialog
:title="dictionaryDialogTitle"
:isVisible="dictionaryVisible"
@confirmDialog="handleConfirm"
@closeDialog="handleClose"
>
<slot>
<rule-form
:ruleForm="dictionaryForm"
:rules="dictionaryRules"
:ruleData="dictionaryData"
ref='dictionaryForm'
></rule-form>
</slot>
</basic-dialog>
<slot>
<rule-form
:ruleForm="dictionaryForm"
:rules="dictionaryRules"
:ruleData="dictionaryData"
ref='dictionaryForm'
></rule-form>
</slot>
</basic-dialog>
</div>
</div>
</template>
......
......@@ -388,24 +388,4 @@ export default {
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.system-container {
padding: 0 0 0 10px;
margin: 20px 24px;
background-color: #ffffff;
overflow: hidden;
.user-tree {
margin-top: 20px;
padding: 20px;
float: left;
width: 18%;
.user-tree-top {
height: 30px;
}
}
.user-container {
padding: 20px 10px 0px 20px;
float: left;
width: 82%;
}
}
</style>
\ No newline at end of file
<template>
<div>
<div>
<div class="system-container">
<div class="user-container">
<search-form
class="searchTop border-shadow"
:formModel="searchForm"
......
......@@ -8,7 +8,6 @@
<el-tree
:data="data"
accordion
:props="props"
node-key="id"
@node-click="handleNodeClick"
:render-content="renderContent"
......@@ -94,14 +93,15 @@
<el-input
placeholder="输入关键字进行过滤"
v-model="filterText"
size="small"
>
</el-input>
<el-tree
class="filter-tree"
:data="filterTextData"
:props="defaultProps"
:filter-node-method="filterNode"
highlight-current
ref="tree"
node-key="id"
check-on-click-node
......@@ -115,10 +115,12 @@
<script>
import {
API
USER_API
} from '@/config/config'
// import { getUserList } from '@/services/user';
// const userService = new UserService();
import UserService from 'services/user';
import OrginizaService from 'services/orginizaManage';
const userService = new UserService();
const orginizaService = new OrginizaService();
export default {
data() {
return {
......@@ -191,72 +193,23 @@ export default {
]
}
},
apiParame: API.USER_SEARCH,
apiParame: USER_API.USER_SEARCH,
// getListApi: getUserList,
// 折叠菜单数据
props: {
label: 'departmentName',
children: 'list',
isLeaf: 'hasChildren'
},
data: [{
id: 1,
userNumber: 200,
departmentName: '一级 1',
hasChildren: true,
list: [{
id: 10,
userNumber: 200,
departmentName: '二级 1-1',
hasChildren: true,
list: [{
id: 100,
userNumber: 200,
departmentName: '三级 1-1-1'
}]
}]
}, {
userNumber: 10,
departmentName: '一级 2',
list: [{
departmentName: '二级 2-1',
list: [{
departmentName: '三级 2-1-1'
}]
}, {
departmentName: '二级 2-2',
list: [{
departmentName: '三级 2-2-1'
}]
}]
}, {
userNumber: 0,
departmentName: '一级 3',
list: [{
departmentName: '二级 3-1',
list: [{
departmentName: '三级 3-1-1'
}]
}, {
departmentName: '二级 3-2',
list: [{
departmentName: '三级 3-2-1'
}]
}]
}],
data: [],
// 弹窗数据
userDialogTitle: '新增用户',
userVisible: false,
userForm: {
account: '',
departmentId: '',
superiorId: '',
departmentName: '',
superiorName: '',
enableStatus: true
},
userData: [
{ label: '登录名称:', prop: 'account', type: 'input' },
{ label: '部门名称:', prop: 'departmentId', type: 'input', readonly: true, clickFunc: this.selectDepart },
{ label: '直接上级:', prop: 'superiorId', type: 'input', readonly: true, clickFunc: this.selectSuperior },
{ label: '部门名称:', prop: 'departmentName', type: 'input', readonly: true, clickFunc: this.selectDepart },
{ label: '直接上级:', prop: 'superiorName', type: 'input', readonly: true, clickFunc: this.selectSuperior },
{ label: '用户名称:', prop: 'username', type: 'input' },
{ label: '密码:', prop: 'password', type: 'input', inputText: 'password' },
{ label: '角色:', prop: 'roleId', type: 'select', options: [] },
......@@ -268,7 +221,7 @@ export default {
],
userRules: {
account: [{ required: true, message: '请输入登录名称', trigger: blur }],
departmentId: [{ required: true, message: '请选择部门名称', trigger: blur }],
departmentName: [{ required: true, message: '请选择部门名称', trigger: blur }],
username: [{ required: true, message: '请输入用户名称', trigger: blur }],
password: [{ required: true, message: '请输入密码', trigger: blur }],
roleId: [{ required: true, message: '请选择角色', trigger: blur }],
......@@ -341,12 +294,7 @@ export default {
}
]
}
],
defaultProps: {
children: 'children',
label: 'label'
}
]
}
},
watch: {
......@@ -360,6 +308,7 @@ export default {
// }, (err) => {
// });
this.getTreeOrg()
},
methods: {
// 确定,新增用户、编辑用户
......@@ -374,7 +323,12 @@ export default {
})
},
// 取消
handleClose() {
handleClose(row) {
if (row && row.id) {
this.userDialogTitle = '编辑用户'
} else {
this.userDialogTitle = '新增用户'
}
if (!this.userVisible && this.$refs.userForm) {
this.$refs.userForm.$children[0].resetFields()
}
......@@ -406,7 +360,10 @@ export default {
},
// 编辑触发事件
editEvent(row) {
this.handleClose()
console.log(row)
this.userDialogTitle = '编辑用户'
this.userForm = row
this.handleClose(row)
},
// 删除触发事件
deleteEvent(id) {
......@@ -428,47 +385,59 @@ export default {
// 部门弹窗
selectDepart() {
this.filterDialogTitle = '选择组织'
this.getSimpleList()
this.closeFilter()
},
// 上级弹窗
selectSuperior() {
this.filterDialogTitle = '选择直接上级'
this.getSuperUser()
this.closeFilter()
},
closeFilter() {
this.filterVisible = !this.filterVisible
},
filterConfirm() {
console.log(this.$refs.tree.getCheckedKeys(false, true))
// this.closeFilter()
console.log(this.$refs.tree.getCheckedKeys(false, true), this.$refs.tree.getCurrentNode())
if (this.filterDialogTitle == '选择直接上级') {
this.userForm.superiorId = this.$refs.tree.getCurrentNode().id
this.userForm.superiorName = this.$refs.tree.getCurrentNode().label
} else {
this.userForm.departmentId = this.$refs.tree.getCurrentNode().id
this.userForm.departmentName = this.$refs.tree.getCurrentNode().label
}
this.closeFilter()
},
filterNode(value, data) {
console.log(value, data)
if (!value) return true
return data.label.indexOf(value) !== -1
},
// 获取上级树
getSuperUser(params) {
userService.getSuperUser(params).then(res => {
console.log(res)
this.filterTextData = res.data.list
})
},
// 获取组织树
getSimpleList() {
orginizaService.getSimpleList().then(res => {
console.log(res)
this.filterTextData = res.data.list
})
},
// 获取组织架构
getTreeOrg() {
orginizaService.getTreeOrg().then(res => {
console.log(res)
this.data = res.data.list
})
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.system-container {
padding: 0 0 0 10px;
margin: 20px 24px;
background-color: #ffffff;
overflow: hidden;
.user-tree {
margin-top: 20px;
padding: 20px;
float: left;
width: 18%;
.user-tree-top {
height: 30px;
}
}
.user-container {
padding: 20px 10px 0px 20px;
float: left;
width: 82%;
}
}
</style>
\ No newline at end of file
<template>
<div class="system-container">
<div class="user-container">
<search-form
class="searchTop border-shadow"
:formModel="searchForm"
:formList="dictionaryFormList"
>
<slot name="form-slot">
<el-button
type="primary"
:size="btn_size"
icon="el-icon-search"
:id="tableParams.btnId"
>搜索</el-button>
<el-button
type="primary"
:size="btn_size"
icon="el-icon-refresh"
>重置</el-button>
</slot>
</search-form>
<div class="table-btn">
<el-button
type="primary"
:size="btn_size"
icon="el-icon-plus"
@click="handleClose"
>新增</el-button>
</div>
<basic-table
:tableParams="tableParams"
:getListApi="getListApi"
:searchForm="searchForm"
:hasNum="false"
>
<span
slot="status"
slot-scope="scope"
>
<span class="dot green"></span><span class="statusText">正常</span>
</span>
</basic-table>
<basic-dialog
:title="dictionaryDialogTitle"
:isVisible="dictionaryVisible"
@confirmDialog="handleConfirm"
@closeDialog="handleClose"
>
<slot>
<rule-form
:ruleForm="dictionaryForm"
:rules="dictionaryRules"
:ruleData="dictionaryData"
ref='dictionaryForm'
></rule-form>
</slot>
</basic-dialog>
</div>
</div>
</template>
<script>
export default {
data() {
return {
searchForm: {},
dictionaryFormList: [
{
type: 'input',
inputType: 'text',
prop: 'name',
placeholder: '请输入字典名称'
}
],
tableParams: {
mutiSelectName: 'worklog',
mutiSelectUniqueKey: 'id',
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableColumns: [
{
label: '日志编号',
prop: 'id'
}, {
label: '系统菜单',
prop: 'dictName'
}, {
label: '操作类型',
prop: 'dictType'
}, {
label: '操作账号',
prop: 'remark'
}, {
label: '所属组织',
prop: 'enableStatus',
addHtml: 'status'
}, {
label: '主机IP',
prop: 'enableStatus',
addHtml: 'status'
}, {
label: '操作状态',
prop: 'enableStatus',
addHtml: 'status'
}, {
label: '创建时间',
prop: 'createdDate'
}
]
},
getListApi: null,
// 弹窗
dictionaryDialogTitle: '新增字典',
dictionaryVisible: false,
dictionaryForm: {},
dictionaryData: [
{ label: '字典名称:', prop: 'dictName', type: 'input' },
{ label: '字典类型', prop: 'dictType', type: 'input' },
{ label: '状态', prop: 'enableStatus', type: 'switch' },
{ label: '备注', prop: 'remark', type: 'input', inputText: 'textarea' }
],
dictionaryRules: {}
}
},
methods: {
// 按钮事件
btnClick(pType, scope) {
console.log(pType, scope)
switch (pType) {
case 'edit':
this.handleClose(scope)
break
case 'delete':
this.deleteEvent(scope.id)
break
case 'list':
console.log('list')
break
}
},
// 确定
handleConfirm() {
console.log(this.$refs.dictionaryForm)
this.$refs.dictionaryForm.$children[0].validate((valid) => {
if (valid) {
this.handleClose()
} else {
console.log('error')
}
})
},
// 取消
handleClose(row) {
console.log(row)
if (!this.dictionaryVisible && this.$refs.dictionaryForm) {
this.$refs.dictionaryForm.$children[0].resetFields()
}
this.dictionaryVisible = !this.dictionaryVisible
},
// 删除触发事件
deleteEvent(id) {
const that = this
const tipData = {
that: that,
tipText: '是否删除当前记录',
tipTitle: '提示',
type: 'error',
callBack: () => {
this.$message({
type: 'success',
message: '删除成功!'
})
}
}
this.$Common.confirmDialog(tipData)
}
}
}
</script>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!