Commit 4142b8e6 by cwq0219

合并

2 parents 1f358dcd 16c274e4
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<router-link to="/user">user</router-link> | <router-link to="/user">user</router-link> |
<router-link to="/role">role</router-link> | <router-link to="/role">role</router-link> |
<router-link to="/orginizaManage">orginizaManage</router-link> | <router-link to="/orginizaManage">orginizaManage</router-link> |
<router-link to="/menuManage">menuManage</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="/dictionaryData">dictionaryData</router-link> |
<router-link to="/workLog">workLog</router-link> <router-link to="/workLog">workLog</router-link>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
:class="item.class" :class="item.class"
v-show="!item.hidden" v-show="!item.hidden"
> >
<template> <template slot-scope="scope">
<template v-if="item.type === 'input'"> <template v-if="item.type === 'input'">
<el-input <el-input
v-if="item.clickFunc" v-if="item.clickFunc"
...@@ -64,14 +64,28 @@ ...@@ -64,14 +64,28 @@
<el-radio <el-radio
v-for="(child,childIndex) in item.children" v-for="(child,childIndex) in item.children"
:key="childIndex" :key="childIndex"
:label="child.id" :label="child"
>{{child.label}}</el-radio> >{{child}}</el-radio>
</el-radio-group> </el-radio-group>
<el-select
v-if="item.hasSelect"
v-model="ruleForm[item.prop]"
:placeholder="item.placeholder || '请选择'"
@change="selectChange"
>
<el-option
v-for="i in item.options"
:key="i[item.value] || i.value"
:label="i[item.key] || i.label"
:value="i[item.value] || i.value"
:disabled="i.disabled"
>
</el-option>
</el-select>
</template> </template>
<template <template
v-else-if="item.type == 'customize'" v-else-if="item.type == 'customize'"
name="form-slot" name="form-slot"
slot-scope="scope"
> >
<slot :scope="scope"> <slot :scope="scope">
</slot> </slot>
......
...@@ -21,10 +21,15 @@ const USER_API = { ...@@ -21,10 +21,15 @@ const USER_API = {
USER_SUPER: BASE_URL + '/usercenter/user/suitableSuperUsers', USER_SUPER: BASE_URL + '/usercenter/user/suitableSuperUsers',
USER_ADD: BASE_URL + '/usercenter/user/add' USER_ADD: BASE_URL + '/usercenter/user/add'
} }
const ROLE_API = {
ROLE_SEARCH: {
apiUrl: BASE_URL + '/usercenter/role/search'
}
}
const ORGINIZA_API = { const ORGINIZA_API = {
ORGINIZA_SEARCH: BASE_URL + '/usercenter/organization/rootList', 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_SIMPLElIST: BASE_URL + '/usercenter/organization/simpleList',
ORGINIZA_TREEORY: BASE_URL + '/usercenter/organization/treeOrg' ORGINIZA_TREEORY: BASE_URL + '/usercenter/organization/treeOrg'
} }
export { API, USER_API, ORGINIZA_API } export { API, USER_API, ROLE_API, ORGINIZA_API }
...@@ -34,6 +34,11 @@ const routes = [ ...@@ -34,6 +34,11 @@ const routes = [
component: () => import('../views/orginizaManage/index.vue') component: () => import('../views/orginizaManage/index.vue')
}, },
{ {
path: '/menuManage',
name: 'MenuManage',
component: () => import('../views/menuManage/index.vue')
},
{
path: '/dictionaryManage', path: '/dictionaryManage',
name: 'DictionaryManage', name: 'DictionaryManage',
component: () => import('../views/dictionaryManage/index.vue') component: () => import('../views/dictionaryManage/index.vue')
......
import HTTP from '@/utils/http'
import { ROLE_API } from '@/config/config'
export default class RoleService extends HTTP {
}
const Constants = { const Constants = {
// 用户状态
USER_STATUS: {
'0': '正常, green',
'-1': '停用, red'
},
// 角色数据权限
ROLE_AUTH: {
'0': '本人',
'1': '本人及下属',
'2': '本人部门',
'3': '本部门及下级部门',
'4': '全部'
},
// 租户可见度
ROLE_VISIBLE: {
'0': '共享',
'1': '仅系统管理员',
'2': '可见租户'
},
// (0:系统管理员,1:服务商,2:门店,3:技工) // (0:系统管理员,1:服务商,2:门店,3:技工)
USERTYPE: { USERTYPE: {
'0': '超级管理员', '0': '超级管理员',
......
<template>
<div class="system-container">
<div class="user-container">
<search-form
class="searchTop border-shadow"
:formModel="searchForm"
:formList="userFormList"
>
<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>
<el-table
v-loading="loading"
align="center"
ref="multipleTable"
:data="listData"
tooltip-effect="dark"
style="width: 100%"
@row-click="rowClick"
:header-cell-style="{background:'#f5f7fa'}"
>
<table-tree-column
ref='OrgiSort'
@table-click="tableClick"
prop="departmentName"
header-align="center"
treeKey="id"
width="300"
label="组织名称"
></table-tree-column>
<el-table-column
v-for="(item,index) in listHeadData"
:key="index"
:prop="item.prop"
:sortable="item.sortable"
:ref="item.ref"
:width="item.width"
:label="item.label"
show-overflow-tooltip
>
<template slot-scope="scope">
<template v-if="item.prop === 'orgStatus'">
dfs
<!-- <span
class="dot"
:class="ORGINIZASTATUS[scope.row[item.prop]].split(',')[1]"
></span>
<span class="statusText">{{ORGINIZASTATUS[scope.row[item.prop]].split(',')[0]}}</span> -->
</template>
<template v-else>
{{scope.row[item.prop]?scope.row[item.prop]:'--'}}
</template>
</template>
</el-table-column>
<el-table-column
align="center"
width="170"
fixed="right"
prop="btn"
label="操作"
>
<template 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>
</template>
</el-table-column>
</el-table>
<basic-dialog
:title="userDialogTitle"
:isVisible="userVisible"
@confirmDialog="handleConfirm"
@closeDialog="handleClose"
>
<slot>
<rule-form
:ruleForm="userForm"
:rules="userRules"
:ruleData="userData"
ref='userForm'
></rule-form>
</slot>
</basic-dialog>
<basic-dialog
:title="filterDialogTitle"
:isVisible="filterVisible"
@confirmDialog="filterConfirm"
@closeDialog="closeFilter"
>
<slot>
<el-input
placeholder="输入关键字进行过滤"
v-model="filterText"
>
</el-input>
<el-tree
class="filter-tree"
:data="filterTextData"
:props="defaultProps"
:filter-node-method="filterNode"
ref="tree"
node-key="id"
check-on-click-node
>
</el-tree>
</slot>
</basic-dialog>
</div>
</div>
</template>
<script>
import OrginizaService from 'services/orginizaManage';
const orginizaService = new OrginizaService();
export default {
data() {
return {
ORGINIZASTATUS: this.$Constants.ORGINIZASTATUS,
searchForm: {},
userFormList: [
{
type: 'input',
inputType: 'text',
prop: 'organizationName',
placeholder: '请输入组织名称'
},
{
type: 'select',
prop: 'enableStatus',
placeholder: '请选择组织状态',
options: [{
value: '0',
label: '正常'
}, {
value: '1',
label: '停用'
}]
}
],
listHeadData: [ // 列表 头部设置 数据
{ prop: 'orderNum', label: '排序' },
{ prop: 'enableStatus', label: '状态' },
{ prop: 'createTime', label: '创建时间' }
],
tableParams: {
tableOption: {
btnList: [
{
type: 'primary',
name: '新增',
pType: 'create'
},
{
type: 'primary',
name: '编辑',
pType: 'edit'
},
{
type: 'danger',
name: '删除',
pType: 'delete'
}
]
}
},
// 弹窗数据
userDialogTitle: '新增用户',
userVisible: false,
userForm: {
account: '',
departmentId: '',
superiorId: '',
enableStatus: true
},
userData: [
{ label: '组织名称', prop: 'account', type: 'input' },
{ label: '显示排序', prop: 'departmentId', type: 'input' },
{ label: '组织状态', prop: 'superiorId', type: 'input' }
],
userRules: {
account: [{ required: true, message: '请输入登录名称', trigger: blur }]
},
// 部门弹窗
filterDialogTitle: '选择组织',
filterVisible: false,
filterText: '',
filterTextData: [
{
id: 1,
label: '广汇集团',
children: [
{
id: 10,
label: '东北大区'
}, {
id: 11,
label: '华南大区'
}, {
id: 12,
label: '西北大区',
children: [
{
id: 100,
label: '新疆',
children: [
{
id: 1000,
label: '新疆克拉玛依华威4S店'
}, {
id: 1001,
label: '新疆克拉玛依华威4S店'
}
]
}, {
id: 101,
label: '陕西'
}
]
}
]
}, {
id: 2,
label: '成都轱辘汽车服务公司',
children: [
{
id: 20,
label: '新疆克拉玛依华威4S店'
}, {
id: 21,
label: '深圳市',
children: [
{
id: 200,
label: '南山区',
children: [
{
id: 2000,
label: '南山科技园片区'
}
]
}, {
id: 201,
label: '福田竹子林金融产业园区'
}
]
}
]
}
],
defaultProps: {
children: 'children',
label: 'label'
},
listData: [
],
loading: false
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
mounted() {
this.getList()
},
methods: {
// 确定,新增用户、编辑用户
handleConfirm() {
console.log(this.$refs.userForm)
this.$refs.userForm.$children[0].validate((valid) => {
if (valid) {
this.handleClose()
} else {
console.log('error')
}
})
},
// 取消
handleClose() {
if (!this.userVisible && this.$refs.userForm) {
this.$refs.userForm.$children[0].resetFields()
}
this.userVisible = !this.userVisible
},
// 按钮事件
btnClick(pType, scope) {
console.log(pType, scope)
switch (pType) {
case 'edit':
this.editEvent(scope)
break
case 'delete':
this.deleteEvent(scope.id)
break
}
},
// 编辑触发事件
editEvent(row) {
this.handleClose()
},
// 删除触发事件
deleteEvent(id) {
const that = this
const tipData = {
that: that,
tipText: '是否删除当前记录',
tipTitle: '提示',
type: 'error',
callBack: () => {
this.$message({
type: 'success',
message: '删除成功!'
})
}
}
this.$Common.confirmDialog(tipData)
},
// 部门弹窗
selectDepart() {
this.filterDialogTitle = '选择组织'
this.closeFilter()
},
// 上级弹窗
selectSuperior() {
this.filterDialogTitle = '选择直接上级'
this.closeFilter()
},
closeFilter() {
this.filterVisible = !this.filterVisible
},
filterConfirm() {
console.log(this.$refs.tree.getCheckedKeys(false, true))
// this.closeFilter()
},
filterNode(value, data) {
console.log(value, data)
if (!value) return true
return data.label.indexOf(value) !== -1
},
// 表格方法
rowClick(row, e, col) {
console.log(row, e, col, 'row cliock data')
orginizaService.getChildren(row.id).then(res => {
console.log(res)
row.children = res.data.list
})
},
// 业务
tableClick(that, index, row, data) {
console.log(that, index, row, data, 'tableClick')
},
getList() {
orginizaService.getTableList().then((res) => {
console.log(res);
this.listData = res.data.list
}, (err) => {
});
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
</style>
\ No newline at end of file \ No newline at end of file
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
type="primary" type="primary"
:size="btn_size" :size="btn_size"
icon="el-icon-refresh" icon="el-icon-refresh"
@click="refresh"
>重置</el-button> >重置</el-button>
</slot> </slot>
</search-form> </search-form>
...@@ -30,17 +31,11 @@ ...@@ -30,17 +31,11 @@
</div> </div>
<basic-table <basic-table
:tableParams="tableParams" :tableParams="tableParams"
:getListApi="getListApi" :apiParame="apiParame"
:searchForm="searchForm" :searchForm="searchForm"
:hasNum="false" :hasNum="false"
> >
<span <span
slot="status"
slot-scope="scope"
>
<span class="dot green"></span><span class="statusText">正常</span>
</span>
<span
slot="table-button" slot="table-button"
slot-scope="scope" slot-scope="scope"
> >
...@@ -89,6 +84,11 @@ ...@@ -89,6 +84,11 @@
</template> </template>
<script> <script>
import {
ROLE_API
} from '@/config/config'
import RoleService from 'services/role';
export default { export default {
data() { data() {
return { return {
...@@ -119,6 +119,7 @@ export default { ...@@ -119,6 +119,7 @@ export default {
} }
], ],
tableOption: { tableOption: {
width: 300,
btnList: [ btnList: [
{ {
type: 'primary', type: 'primary',
...@@ -138,7 +139,7 @@ export default { ...@@ -138,7 +139,7 @@ export default {
] ]
} }
}, },
getListApi: null, apiParame: ROLE_API.ROLE_SEARCH,
// 弹窗数据 // 弹窗数据
roleDialogTitle: '新增用户', roleDialogTitle: '新增用户',
roleVisible: false, roleVisible: false,
...@@ -149,14 +150,18 @@ export default { ...@@ -149,14 +150,18 @@ export default {
enableStatus: true enableStatus: true
}, },
roleData: [ roleData: [
{ label: '角色名称', prop: 'roleName', type: 'input' }, { label: '角色名称:', prop: 'roleName', type: 'input' },
{ label: '备注', prop: 'remark', type: 'input' }, { label: '备注:', prop: 'remark', type: 'input' },
{ label: '状态:', prop: 'enableStatus', type: 'switch' }, { label: '状态:', prop: 'enableStatus', type: 'switch' },
{ label: '数据权限', prop: 'superiorId', type: 'radio', children: [{ id: 1, label: '本人' }, { id: 2, label: '本人及下属' }, { id: 3, label: '本部门' }, { id: 4, label: '本部门&下属' }, { id: 5, label: '全部' }] }, { label: '租户可见度:', prop: 'visibleType', type: 'radio', hasSelect: true, children: this.$Constants.ROLE_VISIBLE },
{ label: '菜单权限', prop: 'rolename', type: 'customize' } { label: '数据权限:', prop: 'permissionType', type: 'radio', children: this.$Constants.ROLE_AUTH },
// [{ id: 1, label: '本人' }, { id: 2, label: '本人及下属' }, { id: 3, label: '本部门' }, { id: 4, label: '本部门&下属' }, { id: 5, label: '全部' }]
{ label: '菜单权限:', prop: 'rolename', type: 'customize' }
], ],
roleRules: { roleRules: {
roleName: [{ required: true, message: '请输入角色名称', trigger: blur }] roleName: [{ required: true, message: '请输入角色名称', trigger: blur }],
enableStatus: [{ required: true }],
}, },
data: [{ data: [{
id: 1, id: 1,
...@@ -196,6 +201,11 @@ export default { ...@@ -196,6 +201,11 @@ export default {
} }
}, },
methods: { methods: {
// 重置搜索条件
refresh() {
console.log('chognzhi ')
this.searchForm = {}
},
// 确定 // 确定
handleConfirm() { handleConfirm() {
console.log(this.$refs.roleForm) console.log(this.$refs.roleForm)
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
type="primary" type="primary"
:size="btn_size" :size="btn_size"
icon="el-icon-refresh" icon="el-icon-refresh"
@click="refresh"
>重置</el-button> >重置</el-button>
</slot> </slot>
</search-form> </search-form>
...@@ -52,7 +53,10 @@ ...@@ -52,7 +53,10 @@
slot="status" slot="status"
slot-scope="scope" slot-scope="scope"
> >
<span class="dot green"></span><span class="statusText">正常</span> <span
class="dot"
:class="scope.scope.enableStatus ? USERSTATUS[scope.scope.enableStatus].split(',')[1] : ''"
></span><span class="statusText">{{ scope.scope.enableStatus ? USERSTATUS[scope.scope.enableStatus].split(',')[0] : '--'}}</span>
</span> </span>
<span <span
slot="table-button" slot="table-button"
...@@ -121,6 +125,7 @@ const orginizaService = new OrginizaService(); ...@@ -121,6 +125,7 @@ const orginizaService = new OrginizaService();
export default { export default {
data() { data() {
return { return {
USERSTATUS: this.$Constants.USER_STATUS,
searchForm: {}, searchForm: {},
userFormList: [ userFormList: [
{ {
...@@ -299,14 +304,14 @@ export default { ...@@ -299,14 +304,14 @@ export default {
} }
}, },
mounted() { mounted() {
// userService.getUserList().then((res) => {
// console.log(res);
// }, (err) => {
// });
this.getTreeOrg() this.getTreeOrg()
}, },
methods: { methods: {
// 重置搜索条件
refresh() {
console.log('chognzhi ')
this.searchForm = {}
},
// 确定,新增用户、编辑用户 // 确定,新增用户、编辑用户
handleConfirm() { handleConfirm() {
console.log(this.$refs.userForm) console.log(this.$refs.userForm)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!