mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-24 05:46:03 +08:00
支持 数据权限 功能 主要用来 处理楼栋长问题
This commit is contained in:
parent
d7c0b172de
commit
5fbac9e71b
@ -0,0 +1,23 @@
|
||||
<div class="bg-white margin-top-xs padding border-radius">
|
||||
<div class=" ">
|
||||
<button type="button" class="btn btn-white btn-sm" v-on:click="_openAddDataPrivilegeModal()">
|
||||
添加
|
||||
</button>
|
||||
<button type="button" class="btn btn-white btn-sm" v-on:click="_openEditDataPrivilegeModel()">
|
||||
修改
|
||||
</button>
|
||||
<button type="button" class="btn btn-white btn-sm" v-on:click="_openDeleteDataPrivilegeModel()">
|
||||
删除
|
||||
</button>
|
||||
</div>
|
||||
<div class="vc-org margin-top">
|
||||
<ul>
|
||||
<li v-for="(dataPrivilege,index) in dataPrivilegeDivInfo.dataPrivileges" @click="_switchDataPrivilege(dataPrivilege)"
|
||||
:class="{'active':dataPrivilege.dpId == dataPrivilegeDivInfo.curDataPrivilege.dpId}">{{dataPrivilege.name}}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<vc:create path="property/addDataPrivilege" callBackListener="" callBackFunction=""></vc:create>
|
||||
<vc:create path="property/editDataPrivilege"></vc:create>
|
||||
<vc:create path="property/deleteDataPrivilege"></vc:create>
|
||||
</div>
|
||||
64
public/components/frame/dataPrivilegeDiv/dataPrivilegeDiv.js
Normal file
64
public/components/frame/dataPrivilegeDiv/dataPrivilegeDiv.js
Normal file
@ -0,0 +1,64 @@
|
||||
/**
|
||||
入驻小区
|
||||
**/
|
||||
(function (vc) {
|
||||
vc.extends({
|
||||
data: {
|
||||
dataPrivilegeDivInfo: {
|
||||
dataPrivileges: [],
|
||||
dpId: '',
|
||||
curDataPrivilege: {}
|
||||
}
|
||||
},
|
||||
_initMethod: function () {
|
||||
$that._loadDataPrivileges();
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('dataPrivilegeDiv', '_loadDataPrivilege', function (_param) {
|
||||
$that._loadDataPrivileges();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
_loadDataPrivileges: function () {
|
||||
let param = {
|
||||
params: {
|
||||
page:1,
|
||||
row:100,
|
||||
communityId:vc.getCurrentCommunity().communityId
|
||||
}
|
||||
};
|
||||
|
||||
//发送get请求
|
||||
vc.http.apiGet('/dataPrivilege.listDataPrivilege',
|
||||
param,
|
||||
function(json, res) {
|
||||
let _dataPrivilegeManageInfo = JSON.parse(json);
|
||||
vc.component.dataPrivilegeDivInfo.dataPrivileges = _dataPrivilegeManageInfo.data;
|
||||
if (_dataPrivilegeManageInfo.data && _dataPrivilegeManageInfo.data.length > 0) {
|
||||
$that._switchDataPrivilege(_dataPrivilegeManageInfo.data[0])
|
||||
}
|
||||
},
|
||||
function(errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
_switchDataPrivilege: function (_dataPrivilege) {
|
||||
$that.dataPrivilegeDivInfo.curDataPrivilege = _dataPrivilege;
|
||||
vc.emit('dataPrivilege', 'switchDataPrivilege', _dataPrivilege);
|
||||
},
|
||||
|
||||
_openAddDataPrivilegeModal: function() {
|
||||
vc.emit('addDataPrivilege', 'openAddDataPrivilegeModal', {});
|
||||
},
|
||||
_openEditDataPrivilegeModel: function() {
|
||||
vc.emit('editDataPrivilege', 'openEditDataPrivilegeModal', $that.dataPrivilegeDivInfo.curDataPrivilege);
|
||||
},
|
||||
_openDeleteDataPrivilegeModel: function() {
|
||||
vc.emit('deleteDataPrivilege', 'openDeleteDataPrivilegeModal', $that.dataPrivilegeDivInfo.curDataPrivilege);
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
})(window.vc);
|
||||
@ -0,0 +1,79 @@
|
||||
<div class=" margin-top">
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
<div class="form-group">
|
||||
<input type="text" :placeholder="vc.i18n('请填写员工名称','org')" v-model="dataPrivilegeStaffInfo.staffName"
|
||||
class="form-control form-control-sm">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<button type="button" class="btn btn-primary btn-sm" v-on:click="_queryDataPrivilegeStaffMethod()">
|
||||
<i class="fa fa-search"></i>
|
||||
<span><vc:i18n name="查询" namespace="room"></vc:i18n></span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary btn-sm" v-on:click="_openAddDataPrivilegeStaffModal()">
|
||||
<i class="fa fa-plus"></i>
|
||||
<span><vc:i18n name="关联员工"></vc:i18n></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="footable table table-stripped toggle-arrow-tiny margin-top" data-page-size="15">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="名称" namespace="staff"></vc:i18n></span>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="手机号" namespace="staff"></vc:i18n></span>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="邮箱" namespace="staff"></vc:i18n></span>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="地址" namespace="staff"></vc:i18n></span>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="性别" namespace="staff"></vc:i18n></span>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="操作" namespace="staff"></vc:i18n></span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="staff in dataPrivilegeStaffInfo.staffs">
|
||||
<td class="text-center">{{staff.name}}</td>
|
||||
<td class="text-center">{{staff.tel}}</td>
|
||||
<td class="text-center">{{staff.email}}</td>
|
||||
<td class="text-center">{{staff.address}}</td>
|
||||
<td class="text-center">{{staff.sex == 0 ? '男' : '女'}}</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<button class="btn-white btn btn-xs" v-on:click="_openDeleteDataPrivilegeStaffModel(staff)"
|
||||
v-if="vc.hasPrivilege('502022082920040010')">
|
||||
<span><vc:i18n name="删除"></vc:i18n></span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button class="btn-white btn btn-xs" v-on:click="_toStaffDetail(staff)">
|
||||
<span><vc:i18n name="详情"></vc:i18n></span>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
<ul class="pagination float-right"></ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<!-- 分页 -->
|
||||
<!-- <vc:create path="frame/pagination"></vc:create> -->
|
||||
<vc:create path="frame/paginationPlus" namespace="dataPrivilegeStaffInfo"></vc:create>
|
||||
<!-- <vc:create path="frame/addDataPrivilegeStaff" emitListener="dataPrivilegeStaffInfo" emitFunction="listDataPrivilegeStaff"></vc:create>
|
||||
<vc:create path="frame/deleteDataPrivilegeStaff"></vc:create> -->
|
||||
</div>
|
||||
@ -0,0 +1,81 @@
|
||||
/**
|
||||
入驻小区
|
||||
**/
|
||||
(function (vc) {
|
||||
var DEFAULT_PAGE = 1;
|
||||
var DEFAULT_ROWS = 10;
|
||||
var ALL_ROWS = 100;
|
||||
vc.extends({
|
||||
data: {
|
||||
dataPrivilegeStaffInfo: {
|
||||
staffs: [],
|
||||
total: 0,
|
||||
records: 1,
|
||||
moreCondition: false,
|
||||
pgId: '',
|
||||
staffName: ''
|
||||
}
|
||||
},
|
||||
_initMethod: function () {
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('dataPrivilegeStaffInfo', 'openDataPrivilegeStaff', function (_param) {
|
||||
vc.copyObject(_param, vc.component.dataPrivilegeStaffInfo);
|
||||
vc.component._listDataPrivilegeStaffs(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
});
|
||||
vc.on('dataPrivilegeStaffInfo', 'listDataPrivilegeStaff', function (_param) {
|
||||
//vc.copyObject(_param, vc.component.dataPrivilegeStaffInfo.conditions);
|
||||
vc.component._listDataPrivilegeStaffs(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
});
|
||||
vc.on('dataPrivilegeStaffInfo', 'paginationPlus', 'page_event', function (_currentPage) {
|
||||
vc.component._listDataPrivilegeStaffs(_currentPage, DEFAULT_ROWS);
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
_listDataPrivilegeStaffs: function (_page, _rows) {
|
||||
let param = {
|
||||
params: {
|
||||
page: _page,
|
||||
row: _rows,
|
||||
roleId: vc.component.dataPrivilegeStaffInfo.pgId,
|
||||
userName: $that.dataPrivilegeStaffInfo.staffName
|
||||
}
|
||||
};
|
||||
//发送get请求
|
||||
vc.http.apiGet('/role.listDataPrivilegeStaff',
|
||||
param,
|
||||
function (json, res) {
|
||||
var _dataPrivilegeStaffInfo = JSON.parse(json);
|
||||
vc.component.dataPrivilegeStaffInfo.total = _dataPrivilegeStaffInfo.total;
|
||||
vc.component.dataPrivilegeStaffInfo.records = _dataPrivilegeStaffInfo.records;
|
||||
vc.component.dataPrivilegeStaffInfo.staffs = _dataPrivilegeStaffInfo.data;
|
||||
vc.emit('dataPrivilegeStaffInfo', 'paginationPlus', 'init', {
|
||||
total: vc.component.dataPrivilegeStaffInfo.records,
|
||||
dataCount: vc.component.dataPrivilegeStaffInfo.total,
|
||||
currentPage: _page
|
||||
});
|
||||
},
|
||||
function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
},
|
||||
_openAddDataPrivilegeStaffModal: function () {
|
||||
vc.emit('addDataPrivilegeStaff', 'openAddDataPrivilegeStaffModal', {
|
||||
roleId: vc.component.dataPrivilegeStaffInfo.pgId,
|
||||
orgName: vc.component.dataPrivilegeStaffInfo.orgName
|
||||
});
|
||||
},
|
||||
_openDeleteDataPrivilegeStaffModel: function (_dataPrivilegeStaff) {
|
||||
_dataPrivilegeStaff.roleId = $that.dataPrivilegeStaffInfo.pgId;
|
||||
vc.emit('deleteDataPrivilegeStaff', 'openDeleteDataPrivilegeStaffModal', _dataPrivilegeStaff);
|
||||
},
|
||||
_queryDataPrivilegeStaffMethod: function () {
|
||||
vc.component._listDataPrivilegeStaffs(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
},
|
||||
_toStaffDetail: function (_dataPrivilegeStaff) {
|
||||
vc.jumpToPage('/#/pages/frame/staffDetail?staffId=' + _dataPrivilegeStaff.userId)
|
||||
}
|
||||
}
|
||||
});
|
||||
})(window.vc);
|
||||
@ -0,0 +1,47 @@
|
||||
<div class=" margin-top">
|
||||
<div class="text-left">
|
||||
<button type="button" class="btn btn-primary btn-sm" v-on:click="_openAddDataPrivilegeUnitModal()">
|
||||
<span><vc:i18n name="关联单元"></vc:i18n></span>
|
||||
</button>
|
||||
</div>
|
||||
<table class="footable table table-stripped toggle-arrow-tiny margin-top" data-page-size="15">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="楼栋" namespace="dataPrivilegeUnit"></vc:i18n></span>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="单元" namespace="dataPrivilegeUnit"></vc:i18n></span>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="操作" namespace="dataPrivilegeUnit"></vc:i18n></span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="dataPrivilegeUnit in dataPrivilegeUnitInfo.dataPrivilegeUnits">
|
||||
<td class="text-center">{{dataPrivilegeUnit.floorNum}}</td>
|
||||
<td class="text-center">{{dataPrivilegeUnit.unitNum}}</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<button class="btn-white btn btn-xs" v-on:click="_openDeleteDataPrivilegeUnitModel(dataPrivilegeUnit)">
|
||||
<span><vc:i18n name="删除"></vc:i18n></span>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
<ul class="pagination float-right"></ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<!-- 分页 -->
|
||||
<vc:create path="frame/paginationPlus" namespace="dataPrivilegeUnitInfo"></vc:create>
|
||||
<!-- <vc:create path="frame/addDataPrivilegeUnit" emitListener="dataPrivilegeUnitInfo" emitFunction="listDataPrivilegeUnit">
|
||||
</vc:create>
|
||||
<vc:create path="frame/deleteDataPrivilegeUnit"></vc:create> -->
|
||||
</div>
|
||||
@ -0,0 +1,86 @@
|
||||
/**
|
||||
入驻小区
|
||||
**/
|
||||
(function (vc) {
|
||||
var DEFAULT_PAGE = 1;
|
||||
var DEFAULT_ROWS = 10;
|
||||
var ALL_ROWS = 100;
|
||||
vc.extends({
|
||||
data: {
|
||||
dataPrivilegeUnitInfo: {
|
||||
dataPrivilegeUnits: [],
|
||||
total: 0,
|
||||
records: 1,
|
||||
moreCondition: false,
|
||||
pgId: ''
|
||||
}
|
||||
},
|
||||
_initMethod: function () {
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('dataPrivilegeUnitInfo', 'openDataPrivilegeUnit', function (_param) {
|
||||
vc.copyObject(_param, vc.component.dataPrivilegeUnitInfo);
|
||||
vc.component._listDataPrivilegeUnits(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
});
|
||||
vc.on('dataPrivilegeUnitInfo', 'listDataPrivilegeUnit', function (_param) {
|
||||
//vc.copyObject(_param, vc.component.dataPrivilegeUnitInfo.conditions);
|
||||
vc.component._listDataPrivilegeUnits(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
});
|
||||
vc.on('dataPrivilegeUnitInfo', 'paginationPlus', 'page_event', function (_currentPage) {
|
||||
vc.component._listDataPrivilegeUnits(_currentPage, DEFAULT_ROWS);
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
_listDataPrivilegeUnits: function (_page, _rows) {
|
||||
var param = {
|
||||
params: {
|
||||
page: _page,
|
||||
row: _rows,
|
||||
roleId: vc.component.dataPrivilegeUnitInfo.pgId
|
||||
}
|
||||
};
|
||||
//发送get请求
|
||||
vc.http.apiGet('/dataPrivilegeUnit.listDataPrivilegeUnit',
|
||||
param,
|
||||
function (json, res) {
|
||||
var _dataPrivilegeUnitInfo = JSON.parse(json);
|
||||
vc.component.dataPrivilegeUnitInfo.total = _dataPrivilegeUnitInfo.total;
|
||||
vc.component.dataPrivilegeUnitInfo.records = _dataPrivilegeUnitInfo.records;
|
||||
vc.component.dataPrivilegeUnitInfo.dataPrivilegeUnits = _dataPrivilegeUnitInfo.data;
|
||||
vc.emit('dataPrivilegeUnitInfo', 'paginationPlus', 'init', {
|
||||
total: vc.component.dataPrivilegeUnitInfo.records,
|
||||
dataCount: vc.component.dataPrivilegeUnitInfo.total,
|
||||
currentPage: _page
|
||||
});
|
||||
}, function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
},
|
||||
_openAddDataPrivilegeUnitModal: function () {
|
||||
vc.emit('addDataPrivilegeUnit', 'openAddDataPrivilegeUnitModal', {
|
||||
roleId: vc.component.dataPrivilegeUnitInfo.pgId,
|
||||
orgName: vc.component.dataPrivilegeUnitInfo.orgName
|
||||
});
|
||||
},
|
||||
_openDeleteDataPrivilegeUnitModel: function (_dataPrivilegeUnit) {
|
||||
vc.emit('deleteDataPrivilegeUnit', 'openDeleteDataPrivilegeUnitModal', _dataPrivilegeUnit);
|
||||
},
|
||||
_openBeyondDataPrivilegeUnit: function (_dataPrivilegeUnit) {
|
||||
},
|
||||
_queryDataPrivilegeUnitMethod: function () {
|
||||
vc.component._listDataPrivilegeUnits(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
},
|
||||
_moreCondition: function () {
|
||||
if (vc.component.dataPrivilegeUnitInfo.moreCondition) {
|
||||
vc.component.dataPrivilegeUnitInfo.moreCondition = false;
|
||||
} else {
|
||||
vc.component.dataPrivilegeUnitInfo.moreCondition = true;
|
||||
}
|
||||
},
|
||||
_goBack: function () {
|
||||
vc.emit('orgManage', 'onBack', {});
|
||||
}
|
||||
}
|
||||
});
|
||||
})(window.vc);
|
||||
@ -105,7 +105,7 @@
|
||||
//关闭model
|
||||
$('#addDataPrivilegeModel').modal('hide');
|
||||
vc.component.clearAddDataPrivilegeInfo();
|
||||
vc.emit('dataPrivilegeManage', 'listDataPrivilege', {});
|
||||
vc.emit('dataPrivilegeDiv', '_loadDataPrivilege', {});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -31,14 +31,15 @@
|
||||
if (_json.code == 0) {
|
||||
//关闭model
|
||||
$('#deleteDataPrivilegeModel').modal('hide');
|
||||
vc.emit('dataPrivilegeManage', 'listDataPrivilege', {});
|
||||
vc.emit('dataPrivilegeDiv', '_loadDataPrivilege', {});
|
||||
|
||||
return;
|
||||
}
|
||||
vc.message(_json.msg);
|
||||
vc.toast(_json.msg);
|
||||
},
|
||||
function(errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
vc.message(json);
|
||||
vc.toast(json);
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
@ -18,12 +18,6 @@
|
||||
<input v-model="editDataPrivilegeInfo.code" type="text" :placeholder="vc.i18n('必填,请填写编号','editDataPrivilege')" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-2"><span><vc:i18n name='communityId' namespace='editDataPrivilege'></vc:i18n></span> </label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="editDataPrivilegeInfo.communityId" type="text" :placeholder="vc.i18n('必填,请填写communityId','editDataPrivilege')" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-2"><span><vc:i18n name='备注' namespace='editDataPrivilege'></vc:i18n></span> </label>
|
||||
<div class="col-sm-10">
|
||||
|
||||
@ -96,7 +96,8 @@
|
||||
if (_json.code == 0) {
|
||||
//关闭model
|
||||
$('#editDataPrivilegeModel').modal('hide');
|
||||
vc.emit('dataPrivilegeManage', 'listDataPrivilege', {});
|
||||
vc.emit('dataPrivilegeDiv', '_loadDataPrivilege', {});
|
||||
|
||||
return;
|
||||
}
|
||||
vc.message(_json.msg);
|
||||
|
||||
@ -1,93 +1,28 @@
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="ibox ">
|
||||
<div class="ibox-title">
|
||||
<h5><span><vc:i18n name="查询条件"></vc:i18n></span></h5>
|
||||
<div class="ibox-tools" style="top:10px;">
|
||||
|
||||
<div class="row ">
|
||||
<div class="col-md-2" style="padding-right:0px">
|
||||
<vc:create path="frame/dataPrivilegeDiv" callBackListener="dataPrivilege"></vc:create>
|
||||
</div>
|
||||
<div class="col-md-10 margin-top-xs vc-org-page">
|
||||
<div class="bg-white border-radius padding">
|
||||
<h5 class="dataPrivilege-title">{{dataPrivilegeManageInfo.curDataPrivilege.name}}</h5>
|
||||
<div class="dataPrivilege-context ">{{dataPrivilegeManageInfo.curDataPrivilege.description}}</div>
|
||||
<div class="line-x margin-top"></div>
|
||||
<div class="dataPrivilege-menu flex justify-start">
|
||||
<div class="item margin-right" :class="{'active':dataPrivilegeManageInfo.tabName == 'unit'}"
|
||||
@click="_changeDataPrivilegeTab('unit')">单元授权
|
||||
</div>
|
||||
<div class="item margin-right" :class="{'active':dataPrivilegeManageInfo.tabName == 'staff'}"
|
||||
@click="_changeDataPrivilegeTab('staff')">员工关联
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="form-group">
|
||||
<input type="text" :placeholder="vc.i18n('请选择名称','dataPrivilegeManage')" v-model="dataPrivilegeManageInfo.conditions.name" class=" form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-1">
|
||||
<button type="button" class="btn btn-primary btn-sm" v-on:click="_queryDataPrivilegeMethod()">
|
||||
<i class="glyphicon glyphicon-search"></i> <span><vc:i18n name="查询"></vc:i18n></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div v-if="dataPrivilegeManageInfo.tabName == 'unit' ">
|
||||
<vc:create path="frame/dataPrivilegeUnit"></vc:create>
|
||||
</div>
|
||||
<div v-if="dataPrivilegeManageInfo.tabName == 'staff'">
|
||||
<vc:create path="frame/dataPrivilegeStaff"></vc:create>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="ibox">
|
||||
<div class="ibox-title">
|
||||
<h5><span><vc:i18n name="数据权限" namespace="dataPrivilegeManage"></vc:i18n></span></h5>
|
||||
<div class="ibox-tools" style="top:10px;">
|
||||
<button type="button" class="btn btn-primary btn-sm" v-on:click="_openAddDataPrivilegeModal()">
|
||||
<i class="glyphicon glyphicon-plus"></i>
|
||||
<span><vc:i18n name="添加" namespace="dataPrivilegeManage"></vc:i18n></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
|
||||
<table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><span><vc:i18n name='名称' namespace='dataPrivilegeManage'></vc:i18n></span></th>
|
||||
<th class="text-center"><span><vc:i18n name='编号' namespace='dataPrivilegeManage'></vc:i18n></span></th>
|
||||
<th class="text-center"><span><vc:i18n name='创建时间' namespace='dataPrivilegeManage'></vc:i18n></span></th>
|
||||
<th class="text-center"><span><vc:i18n name='备注' namespace='dataPrivilegeManage'></vc:i18n></span></th>
|
||||
<th class="text-center"><span><vc:i18n name='操作'></vc:i18n></span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="dataPrivilege in dataPrivilegeManageInfo.dataPrivileges">
|
||||
<td class="text-center">{{dataPrivilege.name}}</td>
|
||||
<td class="text-center">{{dataPrivilege.code}}</td>
|
||||
<td class="text-center">{{dataPrivilege.createTime}}</td>
|
||||
<td class="text-center">{{dataPrivilege.remark}}</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<button class="btn-white btn btn-xs" v-on:click="_openEditDataPrivilegeModel(dataPrivilege)"><span><vc:i18n name='修改'></vc:i18n></span></button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button class="btn-white btn btn-xs" v-on:click="_openDeleteDataPrivilegeModel(dataPrivilege)"><span><vc:i18n name='删除'></vc:i18n></span></button>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
<ul class="pagination float-right"></ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<!-- 分页 -->
|
||||
<vc:create path="frame/pagination"></vc:create>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<vc:create path="property/addDataPrivilege" callBackListener="" callBackFunction=""></vc:create>
|
||||
<vc:create path="property/editDataPrivilege"></vc:create>
|
||||
<vc:create path="property/deleteDataPrivilege"></vc:create>
|
||||
|
||||
</div>
|
||||
@ -7,76 +7,27 @@
|
||||
vc.extends({
|
||||
data: {
|
||||
dataPrivilegeManageInfo: {
|
||||
dataPrivileges: [],
|
||||
total: 0,
|
||||
records: 1,
|
||||
moreCondition: false,
|
||||
dpId: '',
|
||||
conditions: {
|
||||
dpId: '',
|
||||
name: '',
|
||||
communityId: vc.getCurrentCommunity().communityId,
|
||||
|
||||
}
|
||||
curDataPrivilege: {},
|
||||
tabName: 'privilege'
|
||||
}
|
||||
},
|
||||
_initMethod: function() {
|
||||
vc.component._listDataPrivileges(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
},
|
||||
_initEvent: function() {
|
||||
|
||||
vc.on('dataPrivilegeManage', 'listDataPrivilege', function(_param) {
|
||||
vc.component._listDataPrivileges(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
});
|
||||
vc.on('pagination', 'page_event', function(_currentPage) {
|
||||
vc.component._listDataPrivileges(_currentPage, DEFAULT_ROWS);
|
||||
});
|
||||
vc.on('dataPrivilege', 'switchDataPrivilege', function (_param) {
|
||||
$that.dataPrivilegeManageInfo.curDataPrivilege = _param;
|
||||
$that._changeDataPrivilegeTab('unit');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
_listDataPrivileges: function(_page, _rows) {
|
||||
|
||||
vc.component.dataPrivilegeManageInfo.conditions.page = _page;
|
||||
vc.component.dataPrivilegeManageInfo.conditions.row = _rows;
|
||||
let param = {
|
||||
params: vc.component.dataPrivilegeManageInfo.conditions
|
||||
};
|
||||
|
||||
//发送get请求
|
||||
vc.http.apiGet('/dataPrivilege.listDataPrivilege',
|
||||
param,
|
||||
function(json, res) {
|
||||
var _dataPrivilegeManageInfo = JSON.parse(json);
|
||||
vc.component.dataPrivilegeManageInfo.total = _dataPrivilegeManageInfo.total;
|
||||
vc.component.dataPrivilegeManageInfo.records = _dataPrivilegeManageInfo.records;
|
||||
vc.component.dataPrivilegeManageInfo.dataPrivileges = _dataPrivilegeManageInfo.data;
|
||||
vc.emit('pagination', 'init', {
|
||||
total: vc.component.dataPrivilegeManageInfo.records,
|
||||
currentPage: _page
|
||||
});
|
||||
},
|
||||
function(errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
},
|
||||
_openAddDataPrivilegeModal: function() {
|
||||
vc.emit('addDataPrivilege', 'openAddDataPrivilegeModal', {});
|
||||
},
|
||||
_openEditDataPrivilegeModel: function(_dataPrivilege) {
|
||||
vc.emit('editDataPrivilege', 'openEditDataPrivilegeModal', _dataPrivilege);
|
||||
},
|
||||
_openDeleteDataPrivilegeModel: function(_dataPrivilege) {
|
||||
vc.emit('deleteDataPrivilege', 'openDeleteDataPrivilegeModal', _dataPrivilege);
|
||||
},
|
||||
_queryDataPrivilegeMethod: function() {
|
||||
vc.component._listDataPrivileges(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
|
||||
},
|
||||
_moreCondition: function() {
|
||||
if (vc.component.dataPrivilegeManageInfo.moreCondition) {
|
||||
vc.component.dataPrivilegeManageInfo.moreCondition = false;
|
||||
} else {
|
||||
vc.component.dataPrivilegeManageInfo.moreCondition = true;
|
||||
_changeDataPrivilegeTab: function (_tabName) {
|
||||
$that.dataPrivilegeManageInfo.tabName = _tabName;
|
||||
if (_tabName == 'unit') {
|
||||
vc.emit('privilegeTree', 'loadPrivilege', $that.dataPrivilegeManageInfo.curDataPrivilege.pgId);
|
||||
}
|
||||
if (_tabName == 'staff') {
|
||||
vc.emit('dataPrivilegeStaffInfo', 'openDataPrivilegeStaff', {pgId: $that.dataPrivilegeManageInfo.curDataPrivilege.pgId});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user