时间输出格式化
This commit is contained in:
parent
4717eb35d7
commit
d2d987c006
|
@ -3,7 +3,7 @@ from dash.dependencies import Input, Output, State
|
|||
import dash
|
||||
from database.sql_db.dao import dao_user
|
||||
from dash_components import MessageManager
|
||||
from i18n import t__access,t__default
|
||||
from i18n import t__access, t__default
|
||||
|
||||
|
||||
@app.callback(
|
||||
|
@ -73,7 +73,11 @@ def update_group_c(okCounts, group_name, group_status, group_remark, group_roles
|
|||
return [
|
||||
{
|
||||
'key': i.group_name,
|
||||
**i.__dict__,
|
||||
**{
|
||||
**i.__dict__,
|
||||
'update_datetime': f'{i.__dict__["update_datetime"]:%Y-%m-%d %H:%M:%S}',
|
||||
'create_datetime': f'{i.__dict__["create_datetime"]:%Y-%m-%d %H:%M:%S}',
|
||||
},
|
||||
'group_status': {'tag': t__default('启用' if i.group_status else '停用'), 'color': 'cyan' if i.group_status else 'volcano'},
|
||||
'operation': [
|
||||
{
|
||||
|
@ -171,7 +175,11 @@ def add_group(okCounts, group_name, group_status, group_remark, group_roles, gro
|
|||
return [
|
||||
{
|
||||
'key': i.group_name,
|
||||
**i.__dict__,
|
||||
**{
|
||||
**i.__dict__,
|
||||
'update_datetime': f'{i.__dict__["update_datetime"]:%Y-%m-%d %H:%M:%S}',
|
||||
'create_datetime': f'{i.__dict__["create_datetime"]:%Y-%m-%d %H:%M:%S}',
|
||||
},
|
||||
'group_status': {'tag': t__default('启用' if i.group_status else '停用'), 'color': 'cyan' if i.group_status else 'volcano'},
|
||||
'operation': [
|
||||
{
|
||||
|
@ -209,7 +217,11 @@ def delete_role_modal(okCounts, group_name):
|
|||
return [
|
||||
{
|
||||
'key': i.group_name,
|
||||
**i.__dict__,
|
||||
**{
|
||||
**i.__dict__,
|
||||
'update_datetime': f'{i.__dict__["update_datetime"]:%Y-%m-%d %H:%M:%S}',
|
||||
'create_datetime': f'{i.__dict__["create_datetime"]:%Y-%m-%d %H:%M:%S}',
|
||||
},
|
||||
'group_status': {'tag': t__default('启用' if i.group_status else '停用'), 'color': 'cyan' if i.group_status else 'volcano'},
|
||||
'operation': [
|
||||
{
|
||||
|
|
|
@ -74,7 +74,11 @@ def callback_func(okCounts, role_name: str, role_status: bool, role_remark: str,
|
|||
return [
|
||||
{
|
||||
'key': i.role_name,
|
||||
**i.__dict__,
|
||||
**{
|
||||
**i.__dict__,
|
||||
'update_datetime': f'{i.__dict__["update_datetime"]:%Y-%m-%d %H:%M:%S}',
|
||||
'create_datetime': f'{i.__dict__["create_datetime"]:%Y-%m-%d %H:%M:%S}',
|
||||
},
|
||||
'role_status': {'tag': t__default('启用' if i.role_status else '停用'), 'color': 'cyan' if i.role_status else 'volcano'},
|
||||
'operation': [
|
||||
{
|
||||
|
@ -118,7 +122,11 @@ def delete_role_modal(okCounts, role_name):
|
|||
return [
|
||||
{
|
||||
'key': i.role_name,
|
||||
**i.__dict__,
|
||||
**{
|
||||
**i.__dict__,
|
||||
'update_datetime': f'{i.__dict__["update_datetime"]:%Y-%m-%d %H:%M:%S}',
|
||||
'create_datetime': f'{i.__dict__["create_datetime"]:%Y-%m-%d %H:%M:%S}',
|
||||
},
|
||||
'role_status': {'tag': t__default('启用' if i.role_status else '停用'), 'color': 'cyan' if i.role_status else 'volcano'},
|
||||
'operation': [
|
||||
{
|
||||
|
@ -207,7 +215,11 @@ def add_role_c(okCounts, name, role_status, role_remark, access_metas: List[str]
|
|||
return [
|
||||
{
|
||||
'key': i.role_name,
|
||||
**i.__dict__,
|
||||
**{
|
||||
**i.__dict__,
|
||||
'update_datetime': f'{i.__dict__["update_datetime"]:%Y-%m-%d %H:%M:%S}',
|
||||
'create_datetime': f'{i.__dict__["create_datetime"]:%Y-%m-%d %H:%M:%S}',
|
||||
},
|
||||
'role_status': {'tag': t__default('启用' if i.role_status else '停用'), 'color': 'cyan' if i.role_status else 'volcano'},
|
||||
'operation': [
|
||||
{
|
||||
|
|
|
@ -83,7 +83,11 @@ def update_user(okCounts, user_name, user_full_name, user_email, phone_number, u
|
|||
return [
|
||||
{
|
||||
'key': i.user_name,
|
||||
**i.__dict__,
|
||||
**{
|
||||
**i.__dict__,
|
||||
'update_datetime': f'{i.__dict__["update_datetime"]:%Y-%m-%d %H:%M:%S}',
|
||||
'create_datetime': f'{i.__dict__["create_datetime"]:%Y-%m-%d %H:%M:%S}',
|
||||
},
|
||||
'user_status': {'tag': t__default('启用' if i.user_status else '停用'), 'color': 'cyan' if i.user_status else 'volcano'},
|
||||
'operation': [
|
||||
{
|
||||
|
@ -183,7 +187,11 @@ def add_user(okCounts, user_name, user_full_name, user_email, phone_number, user
|
|||
return [
|
||||
{
|
||||
'key': i.user_name,
|
||||
**i.__dict__,
|
||||
**{
|
||||
**i.__dict__,
|
||||
'update_datetime': f'{i.__dict__["update_datetime"]:%Y-%m-%d %H:%M:%S}',
|
||||
'create_datetime': f'{i.__dict__["create_datetime"]:%Y-%m-%d %H:%M:%S}',
|
||||
},
|
||||
'user_status': {'tag': t__default('启用' if i.user_status else '停用'), 'color': 'cyan' if i.user_status else 'volcano'},
|
||||
'operation': [
|
||||
{
|
||||
|
@ -227,7 +235,11 @@ def delete_role_modal(okCounts, user_name):
|
|||
return [
|
||||
{
|
||||
'key': i.user_name,
|
||||
**i.__dict__,
|
||||
**{
|
||||
**i.__dict__,
|
||||
'update_datetime': f'{i.__dict__["update_datetime"]:%Y-%m-%d %H:%M:%S}',
|
||||
'create_datetime': f'{i.__dict__["create_datetime"]:%Y-%m-%d %H:%M:%S}',
|
||||
},
|
||||
'user_status': {'tag': t__default('启用' if i.user_status else '停用'), 'color': 'cyan' if i.user_status else 'volcano'},
|
||||
'operation': [
|
||||
{
|
||||
|
|
|
@ -47,7 +47,11 @@ def render_content(menu_access: MenuAccess, **kwargs):
|
|||
data=[
|
||||
{
|
||||
'key': i.group_name,
|
||||
**i.__dict__,
|
||||
**{
|
||||
**i.__dict__,
|
||||
'update_datetime': f'{i.__dict__["update_datetime"]:%Y-%m-%d %H:%M:%S}',
|
||||
'create_datetime': f'{i.__dict__["create_datetime"]:%Y-%m-%d %H:%M:%S}',
|
||||
},
|
||||
'group_status': {'tag': t__default('启用' if i.group_status else '停用'), 'color': 'cyan' if i.group_status else 'volcano'},
|
||||
'operation': [
|
||||
{
|
||||
|
@ -91,10 +95,16 @@ def render_content(menu_access: MenuAccess, **kwargs):
|
|||
wrapperCol={'flex': '5'},
|
||||
),
|
||||
fac.AntdFormItem(
|
||||
fac.AntdSelect(id='group-mgmt-add-group-roles', mode='multiple'), label=t__access('绑定角色'), labelCol={'flex': '1'}, wrapperCol={'flex': '5'}
|
||||
fac.AntdSelect(id='group-mgmt-add-group-roles', mode='multiple'),
|
||||
label=t__access('绑定角色'),
|
||||
labelCol={'flex': '1'},
|
||||
wrapperCol={'flex': '5'},
|
||||
),
|
||||
fac.AntdFormItem(
|
||||
fac.AntdSelect(id='group-mgmt-add-group-admin-users', mode='multiple'), label=t__access('管理员'), labelCol={'flex': '1'}, wrapperCol={'flex': '5'}
|
||||
fac.AntdSelect(id='group-mgmt-add-group-admin-users', mode='multiple'),
|
||||
label=t__access('管理员'),
|
||||
labelCol={'flex': '1'},
|
||||
wrapperCol={'flex': '5'},
|
||||
),
|
||||
fac.AntdFormItem(
|
||||
fac.AntdSelect(id='group-mgmt-add-group-users', mode='multiple'), label=t__access('成员'), labelCol={'flex': '1'}, wrapperCol={'flex': '5'}
|
||||
|
@ -151,7 +161,10 @@ def render_content(menu_access: MenuAccess, **kwargs):
|
|||
wrapperCol={'flex': '5'},
|
||||
),
|
||||
fac.AntdFormItem(
|
||||
fac.AntdSelect(id='group-mgmt-update-group-roles', mode='multiple'), label=t__access('绑定角色'), labelCol={'flex': '1'}, wrapperCol={'flex': '5'}
|
||||
fac.AntdSelect(id='group-mgmt-update-group-roles', mode='multiple'),
|
||||
label=t__access('绑定角色'),
|
||||
labelCol={'flex': '1'},
|
||||
wrapperCol={'flex': '5'},
|
||||
),
|
||||
fac.AntdFormItem(
|
||||
fac.AntdSelect(id='group-mgmt-update-group-admin-users', mode='multiple'),
|
||||
|
@ -160,7 +173,10 @@ def render_content(menu_access: MenuAccess, **kwargs):
|
|||
wrapperCol={'flex': '5'},
|
||||
),
|
||||
fac.AntdFormItem(
|
||||
fac.AntdSelect(id='group-mgmt-update-group-users', mode='multiple'), label=t__access('成员'), labelCol={'flex': '1'}, wrapperCol={'flex': '5'}
|
||||
fac.AntdSelect(id='group-mgmt-update-group-users', mode='multiple'),
|
||||
label=t__access('成员'),
|
||||
labelCol={'flex': '1'},
|
||||
wrapperCol={'flex': '5'},
|
||||
),
|
||||
],
|
||||
labelAlign='left',
|
||||
|
|
|
@ -47,7 +47,11 @@ def render_content(menu_access: MenuAccess, **kwargs):
|
|||
data=[
|
||||
{
|
||||
'key': i.role_name,
|
||||
**i.__dict__,
|
||||
**{
|
||||
**i.__dict__,
|
||||
'update_datetime': f'{i.__dict__["update_datetime"]:%Y-%m-%d %H:%M:%S}',
|
||||
'create_datetime': f'{i.__dict__["create_datetime"]:%Y-%m-%d %H:%M:%S}',
|
||||
},
|
||||
'role_status': {'tag': t__default('启用' if i.role_status else '停用'), 'color': 'cyan' if i.role_status else 'volcano'},
|
||||
'operation': [
|
||||
{
|
||||
|
@ -118,7 +122,9 @@ def render_content(menu_access: MenuAccess, **kwargs):
|
|||
hasFeedback=True,
|
||||
),
|
||||
fac.AntdFormItem(fac.AntdSwitch(id='role-mgmt-add-role-status', checked=True), label=t__access('角色状态'), required=True),
|
||||
fac.AntdFormItem(fac.AntdInput(id='role-mgmt-add-role-remark', mode='text-area', autoSize={'minRows': 1, 'maxRows': 3}), label=t__access('角色描述')),
|
||||
fac.AntdFormItem(
|
||||
fac.AntdInput(id='role-mgmt-add-role-remark', mode='text-area', autoSize={'minRows': 1, 'maxRows': 3}), label=t__access('角色描述')
|
||||
),
|
||||
fac.AntdFormItem(
|
||||
fac.AntdTree(
|
||||
id='role-menu-access-tree-select-add',
|
||||
|
|
|
@ -51,7 +51,11 @@ def render_content(menu_access: MenuAccess, **kwargs):
|
|||
data=[
|
||||
{
|
||||
'key': i.user_name,
|
||||
**i.__dict__,
|
||||
**{
|
||||
**i.__dict__,
|
||||
'update_datetime': f'{i.__dict__["update_datetime"]:%Y-%m-%d %H:%M:%S}',
|
||||
'create_datetime': f'{i.__dict__["create_datetime"]:%Y-%m-%d %H:%M:%S}',
|
||||
},
|
||||
'user_status': {'tag': t__default('启用' if i.user_status else '停用'), 'color': 'cyan' if i.user_status else 'volcano'},
|
||||
'operation': [
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue