Files
SMANAGE/TempLate/GERP/pages/Company/role.html
T

40 lines
2.2 KiB
HTML

<script src="/assets/gerp/CompanyCommon.js?v=20260627c"></script>
<div class="GERPPage">
<div class="cp-page">
<div class="cp-header">
<h1 class="PageTitle">
<i class="fas fa-shield-alt icon-primary icon-left-lg"></i>
<span id="page-title">角色管理</span>
<span id="admin-badge" style="display:none;margin-left:8px;padding:2px 10px;border-radius:4px;background:#1e40af;color:#fff;font-size:12px;font-weight:600;"><i class="fas fa-shield-alt"></i> 特权模式</span>
</h1>
</div>
<div class="cp-container" id="TableContainer"></div>
</div>
</div>
<script>
const page = new CompanyTablePage({
tableName: 'Role',
title: '角色管理',
pkField: 'RoleUUID',
adminBadge: true,
defaultColumns: () => [
{ field: 'RoleUUID', title: '角色UUID', width: 140, primaryKey: true, editable: false, hideInForm: true },
{ field: 'RoleName', title: '角色名称', width: 200, type: 'text' },
{ field: 'RoleType', title: '角色类型', width: 100, type: 'select', options: [{ value: 0, label: '组员' }, { value: 1, label: '组长' }, { value: 2, label: '其他' }] },
{ field: 'RoleStatus', title: '状态', width: 80, type: 'select', options: [{ value: 0, label: '禁用' }, { value: 1, label: '启用' }] },
{ field: 'AssignScope', title: '分配范围', width: 100, type: 'select', options: [{ value: 0, label: '全租户' }, { value: 1, label: '公司' }, { value: 2, label: '部门' }] },
{ field: 'RoleDesc', title: '角色描述', width: 240, type: 'text' },
{ field: 'CreateTime', title: '创建时间', width: 160, type: 'datetime', editable: false },
],
onView: (row) => {
const server = new URLSearchParams(window.location.search).get('server');
let url = `/pages/Company/role-detail.html?RoleUUID=${encodeURIComponent(row.RoleUUID || '')}`;
if (server && server !== 'gvsds-master') url += `&server=${encodeURIComponent(server)}`;
GERP.Navigate(url, row.RoleName || '角色详情');
},
});
page.init();
</script>