mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-24 05:46:03 +08:00
优化 组织架构相关 bug
This commit is contained in:
parent
f2174a990d
commit
355205431f
@ -3,19 +3,19 @@
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<h3 class="m-t-none m-b ">
|
||||
<span><vc:i18n name="添加权限组" namespace="addPrivilegeGroup"></vc:i18n></span>
|
||||
<span><vc:i18n name="添加角色" namespace="addPrivilegeGroup"></vc:i18n></span>
|
||||
</h3>
|
||||
<div class="ibox-content">
|
||||
<div>
|
||||
<p style="color:red;">{{addPrivilegeGroupInfo.errorInfo}}</p>
|
||||
<div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"><span><vc:i18n name="权限组名称" namespace="addPrivilegeGroup"></vc:i18n></span></label>
|
||||
<div class="col-sm-10"><input v-model="addPrivilegeGroupInfo.name" type="text" :placeholder="vc.i18n('必填,请填写权限组名称','addPrivilegeGroup')" class="form-control"></div>
|
||||
<label class="col-sm-2 col-form-label"><span><vc:i18n name="角色名称" namespace="addPrivilegeGroup"></vc:i18n></span></label>
|
||||
<div class="col-sm-10"><input v-model="addPrivilegeGroupInfo.name" type="text" :placeholder="vc.i18n('必填,请填写角色名称','addPrivilegeGroup')" class="form-control"></div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"><span><vc:i18n name="权限组描述" namespace="addPrivilegeGroup"></vc:i18n></span></label>
|
||||
<div class="col-sm-10"><input v-model="addPrivilegeGroupInfo.description" type="text" :placeholder="vc.i18n('选填,请填写权限组描述','addPrivilegeGroup')" class="form-control"></div>
|
||||
<label class="col-sm-2 col-form-label"><span><vc:i18n name="描述" namespace="addPrivilegeGroup"></vc:i18n></span></label>
|
||||
<div class="col-sm-10"><input v-model="addPrivilegeGroupInfo.description" type="text" :placeholder="vc.i18n('选填,请填写描述','addPrivilegeGroup')" class="form-control"></div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<button class="btn btn-primary float-right" type="button" v-on:click="saveAddPrivilegeGroup()"><i class="fa fa-check"></i>
|
||||
|
||||
4
public/components/frame/orgTreeShow/orgTreeShow.html
Normal file
4
public/components/frame/orgTreeShow/orgTreeShow.html
Normal file
@ -0,0 +1,4 @@
|
||||
<div class="padding">
|
||||
<div id="jstree_org_show" class="margin-top">
|
||||
</div>
|
||||
</div>
|
||||
87
public/components/frame/orgTreeShow/orgTreeShow.js
Normal file
87
public/components/frame/orgTreeShow/orgTreeShow.js
Normal file
@ -0,0 +1,87 @@
|
||||
/**
|
||||
入驻小区
|
||||
**/
|
||||
(function(vc) {
|
||||
vc.extends({
|
||||
propTypes: {
|
||||
callBackListener: vc.propTypes.string, //父组件名称
|
||||
},
|
||||
data: {
|
||||
orgTreeShowInfo: {
|
||||
orgs: [],
|
||||
orgId: '',
|
||||
curOrg:{}
|
||||
}
|
||||
},
|
||||
_initMethod: function() {
|
||||
$that._loadOrgsShow();
|
||||
|
||||
},
|
||||
_initEvent: function() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
_loadOrgsShow: function() {
|
||||
|
||||
let param = {
|
||||
params: {
|
||||
communityId: vc.getCurrentCommunity().communityId
|
||||
}
|
||||
};
|
||||
//发送get请求
|
||||
vc.http.apiGet('/org.listOrgTree',
|
||||
param,
|
||||
function(json) {
|
||||
let _orgs = JSON.parse(json).data;
|
||||
$that.orgTreeShowInfo.orgs = _orgs;
|
||||
$that._initJsTreeFloorUnitShow();
|
||||
},
|
||||
function() {
|
||||
console.log('请求失败处理');
|
||||
});
|
||||
},
|
||||
_initJsTreeFloorUnitShow: function() {
|
||||
|
||||
let _data = $that.orgTreeShowInfo.orgs;
|
||||
$.jstree.destroy()
|
||||
$("#jstree_org_show").jstree({
|
||||
"checkbox": {
|
||||
"keep_selected_style": false
|
||||
},
|
||||
'state': { //一些初始化状态
|
||||
"opened": true,
|
||||
},
|
||||
// 'plugins': ['contextmenu'],
|
||||
'core': {
|
||||
'data': _data
|
||||
},
|
||||
});
|
||||
$("#jstree_org_show").on("ready.jstree", function(e, data) {
|
||||
data.instance.open_all(); //打开所有节点
|
||||
});
|
||||
|
||||
$('#jstree_org_show').on("changed.jstree", function(e, data) {
|
||||
if (data.action == 'model' || data.action == 'ready') {
|
||||
//默认合并
|
||||
//$("#jstree_org").jstree("close_all");
|
||||
return;
|
||||
}
|
||||
$that.orgTreeShowInfo.curOrg = data.node.original;
|
||||
$that.orgTreeShowInfo.curOrg.orgId = $that.orgTreeShowInfo.curOrg.id;
|
||||
|
||||
vc.emit($props.callBackListener, 'switchOrg', {
|
||||
orgId: data.node.original.id,
|
||||
orgName:$that.orgTreeShowInfo.curOrg.text
|
||||
})
|
||||
|
||||
});
|
||||
// $('#jstree_org')
|
||||
// .on('click', '.jstree-anchor', function(e) {
|
||||
// $(this).jstree(true).toggle_node(e.target);
|
||||
// })
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
})(window.vc);
|
||||
@ -7,39 +7,15 @@
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<div class="row">
|
||||
<div class="col-md-4 border-right padding-0">
|
||||
<div class="col-md-6 border-right padding-0">
|
||||
<div class="text-center">
|
||||
<span><vc:i18n name="公司信息" namespace="selectStaff"></vc:i18n></span>
|
||||
<span><vc:i18n name="组织信息" namespace="selectStaff"></vc:i18n></span>
|
||||
</div>
|
||||
<div class=" staff padding padding-top-xs">
|
||||
<div class=" padding overflow-hidden"
|
||||
:class="{'select':selectStaffInfo.curCompanyId == item.orgId}"
|
||||
v-for="(item,index) in selectStaffInfo.companys" @click="_changeCompany(item)"
|
||||
style="cursor:pointer">
|
||||
<span>
|
||||
<i class="fa fa-building-o margin-right-xs" aria-hidden="true"></i>
|
||||
{{item.orgName}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="staff">
|
||||
<vc:create path="frame/orgTreeShow" callBackListener="selectStaff"></vc:create>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 border-right padding-0">
|
||||
<div class="text-center">
|
||||
<span><vc:i18n name="部门信息" namespace="selectStaff"></vc:i18n></span>
|
||||
</div>
|
||||
<div class="padding-left staff padding padding-top-xs">
|
||||
<div class=" padding overflow-hidden"
|
||||
:class="{'select':selectStaffInfo.curDepartmentId == item.orgId}"
|
||||
v-for="(item,index) in selectStaffInfo.departments" @click="_changeDepartment(item)"
|
||||
style="cursor:pointer">
|
||||
<span>
|
||||
<i class="fa fa-sitemap margin-right-xs" aria-hidden="true"></i>
|
||||
{{item.orgName}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 padding-0">
|
||||
<div class="col-md-6 padding-0">
|
||||
<div class="text-center">
|
||||
<span><vc:i18n name="员工信息" namespace="selectStaff"></vc:i18n></span>
|
||||
</div>
|
||||
|
||||
@ -17,33 +17,21 @@
|
||||
}
|
||||
},
|
||||
_initMethod: function() {
|
||||
$that._initSelectStaffInfo();
|
||||
},
|
||||
_initEvent: function() {
|
||||
vc.on('selectStaff', 'openStaff', function(_staff) {
|
||||
//查询公司信息
|
||||
$that._initOrg(2, '');
|
||||
$('#selectStaffModel').modal('show');
|
||||
$that.selectStaffInfo.staff = _staff;
|
||||
$that.staff = _staff;
|
||||
});
|
||||
|
||||
vc.on('selectStaff','switchOrg',function(_param){
|
||||
$that.loadStaff(_param);
|
||||
})
|
||||
|
||||
},
|
||||
methods: {
|
||||
_initSelectStaffInfo: function() {
|
||||
|
||||
},
|
||||
|
||||
_changeCompany: function(item) {
|
||||
$that.selectStaffInfo.curCompanyId = item.orgId;
|
||||
//查询部门
|
||||
$that._initOrg(3, $that.selectStaffInfo.curCompanyId);
|
||||
},
|
||||
_changeDepartment: function(item) {
|
||||
$that.selectStaffInfo.curDepartmentId = item.orgId;
|
||||
//查询部门
|
||||
$that.loadStaff();
|
||||
},
|
||||
_changeStaff: function(item) {
|
||||
$that.staff.staffId = item.userId;
|
||||
$that.staff.staffName = item.userName;
|
||||
@ -52,54 +40,13 @@
|
||||
$that.staff.call($that.staff);
|
||||
}
|
||||
},
|
||||
_initOrg: function(_orgLevel, _parentOrgId) {
|
||||
var param = {
|
||||
params: {
|
||||
page: 1,
|
||||
row: 100,
|
||||
orgLevel: _orgLevel,
|
||||
parentOrgId: _parentOrgId
|
||||
}
|
||||
};
|
||||
|
||||
//发送get请求
|
||||
vc.http.apiGet('/org.listOrgs',
|
||||
param,
|
||||
function(json, res) {
|
||||
var _orgManageInfo = JSON.parse(json);
|
||||
if (_orgLevel == 2) {
|
||||
$that.selectStaffInfo.companys = _orgManageInfo.orgs;
|
||||
if (_orgManageInfo.orgs.length < 1) {
|
||||
return;
|
||||
}
|
||||
$that.selectStaffInfo.curCompanyId = _orgManageInfo.orgs[0].orgId
|
||||
//查询部门
|
||||
$that._initOrg(3, $that.selectStaffInfo.curCompanyId);
|
||||
} else if (_orgLevel == 3) {
|
||||
$that.selectStaffInfo.departments = _orgManageInfo.orgs;
|
||||
if (_orgManageInfo.orgs.length < 1) {
|
||||
return;
|
||||
}
|
||||
$that.selectStaffInfo.curDepartmentId = _orgManageInfo.orgs[0].orgId
|
||||
//查询部门
|
||||
$that.loadStaff();
|
||||
} else {
|
||||
$that.selectStaffInfo.staffs = _orgManageInfo.orgs;
|
||||
}
|
||||
|
||||
},
|
||||
function(errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
},
|
||||
loadStaff: function() {
|
||||
var param = {
|
||||
loadStaff: function(_org) {
|
||||
let param = {
|
||||
params: {
|
||||
page: 1,
|
||||
rows: default_row,
|
||||
row: default_row,
|
||||
orgId: $that.selectStaffInfo.curDepartmentId
|
||||
orgId: _org.orgId
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user