You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1549 lines
78 KiB

1 month ago
from dash import dcc, html
import feffery_antd_components as fac
from flask import session
from api.sscf import get_sscf_list_api
from api.dasset import get_dasset_tree_api
from config.global_config import ApiBaseUrlConfig
import callbacks.dataint_c.sscf_c as cddc
def render(*args, **kwargs):
button_perms = kwargs.get('button_perms')
dasset_params = dict(dasset_name='')
sscf_params = dict(page_num=1, page_size=15)
table_info = get_sscf_list_api(sscf_params)
tree_info = get_dasset_tree_api(dasset_params)
# 定义转换后的数据
tree_data = []
# 遍历 A 中的第一层数据
for item in tree_info['data']:
# 创建新的字典,只保留 title 和 key
new_item = {
'title': item['title'],
'key': item['key'],
'children': []
}
# 遍历 children 列表
for child in item['children']:
# 创建新的子项字典,只保留 title 和 key
new_child = {
'title': child['title'],
'key': child['key']
}
new_item['children'].append(new_child)
# 将新项添加到 tree_data 中
tree_data.append(new_item)
# tree_data = [
# {
# 'title': '公司总资产',
# 'key': '100',
# 'children': [
# {'title': '资讯数据资产', 'key': '101'},
# {'title': '财务数据资产', 'key': '102'},
# {'title': '其他数据资产', 'key': '121'},
# ],
# },
# ]
table_data = []
page_num = 1
page_size = 15
total = 0
if table_info['code'] == 200:
table_data = table_info['data']['rows']
page_num = table_info['data']['page_num']
page_size = table_info['data']['page_size']
total = table_info['data']['total']
for item in table_data:
if item['status'] == '0':
item['status'] = dict(checked=True)
else:
item['status'] = dict(checked=False)
item['key'] = str(item['onum'])
item['operation'] = [
{
'title': '修改',
'type': 'link',
'icon': 'antd-edit'
} if 'dataint:sscf:edit' in button_perms else None,
{
'title': '删除',
'type': 'link',
'icon': 'antd-delete'
} if 'dataint:sscf:delete' in button_perms else None,
]
return [
dcc.Store(id='sscf-button-perms-container', data=button_perms),
# 用于导出成功后重置dcc.Download的状态,防止多次下载文件
dcc.Store(id='sscf-export-complete-judge-container'),
# 绑定的导出组件
dcc.Download(id='sscf-export-container'),
# 字段管理模块操作类型存储容器
dcc.Store(id='sscf-operations-store'),
# 字段管理模块修改操作行key存储容器
dcc.Store(id='sscf-edit-id-store'),
# 字段管理模块删除操作行key存储容器
dcc.Store(id='sscf-delete-ids-store'),
fac.AntdRow(
[
fac.AntdCol(
[
fac.AntdInput(
id='vdasset-input-search',
placeholder='请输入数据资产名称',
autoComplete='off',
allowClear=True,
prefix=fac.AntdIcon(
icon='antd-search'
),
style={
'width': '85%'
}
),
fac.AntdTree(
id='vdasset-tree1',
treeData=tree_data,
defaultExpandAll=True,
showLine=False,
style={
'margin-top': '10px',
'font-size': '14px', # 内联样式中设置字体大小
'color': 'black', # 内联样式中设置字体颜色
}
)
],
span=4
),
fac.AntdCol(
[
fac.AntdRow(
[
fac.AntdCol(
html.Div(
[
fac.AntdForm(
[
fac.AntdSpace(
[
fac.AntdFormItem(
fac.AntdInput(
id='sscf-keyword-input',
placeholder='请输入关键词',
autoComplete='off',
allowClear=True,
style={
'width': 240
}
),
label='关键词'
),
# fac.AntdFormItem(
# fac.AntdInput(
# id='sscf-supp_expl-input',
# placeholder='请输入补充说明',
# autoComplete='off',
# allowClear=True,
# style={
# 'width': 240
# }
# ),
# label='补充说明'
# ),
# fac.AntdFormItem(
# fac.AntdInput(
# id='sscf-keywords-input',
# placeholder='请输入关键词字符',
# autoComplete='off',
# allowClear=True,
# style={
# 'width': 240
# }
# ),
# label='关键词字符'
# ),
fac.AntdFormItem(
fac.AntdInput(
id='sscf-type-input',
placeholder='请输入类型',
autoComplete='off',
allowClear=True,
style={
'width': 240
}
),
label='类型'
),
fac.AntdFormItem(
fac.AntdSelect(
id='sscf-status-select',
placeholder='字段状态',
options=[
{
'label': '正常',
'value': '0'
},
{
'label': '停用',
'value': '1'
}
],
style={
'width': 240
}
),
label='字段状态'
),
],
style={
'paddingBottom': '10px'
}
),
fac.AntdSpace(
[
# fac.AntdFormItem(
# fac.AntdDateRangePicker(
# id='sscf-create_time-range',
# style={
# 'width': '240px'
# }
# ),
# label='创建时间'
# ),
fac.AntdFormItem(
fac.AntdButton(
'搜索',
id='sscf-search',
type='primary',
icon=fac.AntdIcon(
icon='antd-search'
)
)
),
fac.AntdFormItem(
fac.AntdButton(
'重置',
id='sscf-reset',
icon=fac.AntdIcon(
icon='antd-sync'
)
)
)
],
style={
'paddingBottom': '10px'
}
),
],
layout='inline',
)
],
id='sscf-search-form-container',
hidden=False
),
)
]
),
fac.AntdRow(
[
fac.AntdCol(
fac.AntdSpace(
[
fac.AntdButton(
[
fac.AntdIcon(
icon='antd-plus'
),
'新增',
],
id='sscf-add',
style={
'color': '#1890ff',
'background': '#e8f4ff',
'border-color': '#a3d3ff'
}
) if 'dataint:sscf:add' in button_perms else [],
fac.AntdButton(
[
fac.AntdIcon(
icon='antd-edit'
),
'修改',
],
id={
'type': 'sscf-operation-button',
'index': 'edit'
},
#disabled=True,
style={
'color': '#71e2a3',
'background': '#e7faf0',
'border-color': '#d0f5e0'
}
) if 'dataint:sscf:edit' in button_perms else [],
fac.AntdButton(
[
fac.AntdIcon(
icon='antd-minus'
),
'删除',
],
id={
'type': 'sscf-operation-button',
'index': 'delete'
},
#disabled=True,
style={
'color': '#ff9292',
'background': '#ffeded',
'border-color': '#ffdbdb'
}
) if 'dataint:sscf:delete' in button_perms else [],
fac.AntdButton(
[
fac.AntdIcon(
icon='antd-arrow-up'
),
'导入',
],
id='sscf-import',
style={
'color': '#909399',
'background': '#f4f4f5',
'border-color': '#d3d4d6'
}
) if 'dataint:sscf:import' in button_perms else [],
fac.AntdButton(
[
fac.AntdIcon(
icon='antd-arrow-down'
),
'导出',
],
id='sscf-export',
style={
'color': '#ffba00',
'background': '#fff8e6',
'border-color': '#ffe399'
}
) if 'dataint:sscf:export' in button_perms else [],
],
style={
'paddingBottom': '10px'
}
),
span=16
),
fac.AntdCol(
fac.AntdSpace(
[
html.Div(
fac.AntdTooltip(
fac.AntdButton(
[
fac.AntdIcon(
icon='antd-search'
),
],
id='sscf-hidden',
shape='circle'
),
id='sscf-hidden-tooltip',
title='隐藏搜索'
)
),
html.Div(
fac.AntdTooltip(
fac.AntdButton(
[
fac.AntdIcon(
icon='antd-sync'
),
],
id='sscf-refresh',
shape='circle'
),
title='刷新'
)
),
],
style={
'float': 'right',
'paddingBottom': '10px'
}
),
span=8,
style={
'paddingRight': '10px'
}
)
],
gutter=5
),
fac.AntdRow(
[
fac.AntdCol(
fac.AntdSpin(
fac.AntdTable(
id='sscf-list-table',
data=table_data,
columns=[
{
'dataIndex': 'onum',
'title': '序号',
'width': 80,
'renderOptions': {
'renderType': 'ellipsis'
},
},
{
'dataIndex': 'keyword',
'title': '关键词',
#'width': 100,
#'align': 'left', # 左对齐
'renderOptions': {
'renderType': 'ellipsis'
},
},
{
'dataIndex': 'algorithm',
'title': '算法',
#'width': 120,
#'align': 'left', # 左对齐
'renderOptions': {
'renderType': 'ellipsis'
},
},
{
'dataIndex': 'order',
'title': '按顺序匹配标志',
#'width': 80,
'renderOptions': {
'renderType': 'ellipsis'
},
},
{
'dataIndex': 'whole_sentence',
'title': '整句',
#'width': 120,
'renderOptions': {
'renderType': 'ellipsis'
},
},
{
'dataIndex': 'type',
'title': '类型',
'width': 260,
'renderOptions': {
'renderType': 'ellipsis'
},
},
{
'dataIndex': 'supp_expl',
'title': '补充说明',
#'width': 120,
'renderOptions': {
'renderType': 'ellipsis'
},
},
# {
# 'dataIndex': 'keywords',
# 'title': '关键词字符',
# #'width': 100,
# #'align': 'left', # 左对齐
# 'renderOptions': {
# 'renderType': 'ellipsis'
# },
# },
{
'dataIndex': 'status',
'title': '状态',
#'width': 70,
'renderOptions': {
'renderType': 'switch'
},
},
{
'dataIndex': 'update_by',
'title': '负责人',
#'width': 100,
'renderOptions': {
'renderType': 'ellipsis'
},
},
{
'dataIndex': 'update_time',
'title': '更新时间',
#'width': 100,
'renderOptions': {
'renderType': 'ellipsis'
},
},
{
'title': '操作',
'dataIndex': 'operation',
'renderOptions': {
'renderType': 'dropdown',
'dropdownProps': {
'title': '更多'
}
},
}
],
rowSelectionType='checkbox',
rowSelectionWidth=50,
bordered=True,
maxWidth=1800,
maxHeight=500,
style={'width': '100%','text-align': 'center','paddingRight': '10px'},
pagination={
'pageSize': page_size,
'current': page_num,
'showSizeChanger': True,
'pageSizeOptions': [15, 30, 50],
'showQuickJumper': True,
'total': total
},
mode='server-side'
),
text='数据加载中'
),
)
]
),
],
span=20
)
],
gutter=5
),
# 新增短句配置表单modal
fac.AntdModal(
[
fac.AntdForm(
[
fac.AntdRow(
[
fac.AntdCol(
fac.AntdFormItem(
fac.AntdTreeSelect(
id={
'type': 'sscf_add-form-value',
'index': 'dasset_id'
},
placeholder='请选择资产名',
treeData=[],
treeNodeFilterProp='title',
style={
'width': '100%'
#'width': '495px'
}
),
label='归属资产名',
required=True,
id={
'type': 'sscf_add-form-label',
'index': 'dasset_id',
'required': True
},
labelCol={
'offset': 1
}
),
span=12
),
fac.AntdCol(
fac.AntdFormItem(
fac.AntdSelect(
id={
'type': 'sscf_add-form-value',
'index': 'status'
},
placeholder='请选择字段状态',
options=[
{
'label': '正常',
'value': '0'
},
{
'label': '停用',
'value': '1'
},
],
style={
'width': '100%'
}
),
label='字段状态',
required=True,
id={
'type': 'sscf_add-form-label',
'index': 'status',
'required': True
},
),
span=12
)
# fac.AntdCol(
# fac.AntdFormItem(
# fac.AntdInput(
# id={
# 'type': 'sscf_add-form-value',
# 'index': 'keywords'
# },
# placeholder='请输入关键词字符',
# allowClear=True,
# style={
# 'width': '100%'
# }
# ),
# label='关键词字符',
# required=False,
# id={
# 'type': 'sscf_add-form-label',
# 'index': 'keywords',
# 'required': True
# }
# ),
# span=12
# )
],
gutter=5
),
fac.AntdRow(
[
fac.AntdCol(
fac.AntdFormItem(
fac.AntdInput(
id={
'type': 'sscf_add-form-value',
'index': 'keyword'
},
placeholder='请输入关键词',
allowClear=True,
style={
'width': '100%'
}
),
label='关键词',
required=True,
id={
'type': 'sscf_add-form-label',
'index': 'keyword',
'required': True
}
),
span=12
),
fac.AntdCol(
fac.AntdFormItem(
fac.AntdSelect(
id={
'type': 'sscf_add-form-value',
'index': 'algorithm'
},
placeholder='请输入算法',
allowClear=True,
options=[
{
'label': '包含',
'value': '包含'
},
{
'label': '相等',
'value': '相等'
},
],
style={
'width': '100%'
}
),
label='算法',
id={
'type': 'sscf_add-form-label',
'index': 'algorithm',
'required': False
},
),
span=12
)
],
gutter=5
),
fac.AntdRow(
[
fac.AntdCol(
fac.AntdFormItem(
fac.AntdSelect(
id={
'type': 'sscf_add-form-value',
'index': 'order'
},
placeholder='请输入按顺序匹配标志',
allowClear=True,
options=[
{
'label': 'True',
'value': 'True'
},
{
'label': 'False',
'value': 'False'
},
],
style={
'width': '100%'
}
),
label='按顺序匹配标志',
id={
'type': 'sscf_add-form-label',
'index': 'order',
'required': False
},
),
span=12
),
fac.AntdCol(
fac.AntdFormItem(
fac.AntdSelect(
id={
'type': 'sscf_add-form-value',
'index': 'whole_sentence'
},
placeholder='请输入整句',
allowClear=True,
options=[
{
'label': 'True',
'value': 'True'
},
{
'label': 'False',
'value': 'False'
},
],
style={
'width': '100%'
}
),
label='整句',
id={
'type': 'sscf_add-form-label',
'index': 'whole_sentence',
'required': False
},
),
span=12
)
],
gutter=5
),
fac.AntdRow(
[
fac.AntdCol(
fac.AntdFormItem(
fac.AntdSelect(
id={
'type': 'sscf_add-form-value',
'index': 'type'
},
placeholder='请输入类型',
allowClear=True,
options=[
{
'label': '补充',
'value': '补充'
},
{
'label': '替换',
'value': '替换'
},
],
style={
'width': '100%'
}
),
label='类型',
id={
'type': 'sscf_add-form-label',
'index': 'type',
'required': False
},
),
span=12
),
fac.AntdCol(
fac.AntdFormItem(
fac.AntdInput(
id={
'type': 'sscf_add-form-value',
'index': 'supp_expl'
},
placeholder='请输入补充说明',
allowClear=True,
style={
'width': '100%'
}
),
label='补充说明',
id={
'type': 'sscf_add-form-label',
'index': 'supp_expl',
'required': False
},
),
span=12
)
],
gutter=5
),
# fac.AntdRow(
# [
# fac.AntdCol(
# fac.AntdFormItem(
# fac.AntdInput(
# id={
# 'type': 'sscf_add-form-value',
# 'index': 'bak1'
# },
# placeholder='请输入备注1',
# allowClear=True,
# style={
# 'width': '100%'
# }
# ),
# label='备注1',
# id={
# 'type': 'sscf_add-form-label',
# 'index': 'bak1',
# 'required': False
# },
# ),
# span=12
# ),
# fac.AntdCol(
# fac.AntdFormItem(
# fac.AntdInput(
# id={
# 'type': 'sscf_add-form-value',
# 'index': 'bak2'
# },
# placeholder='请输入备注2',
# allowClear=True,
# style={
# 'width': '100%'
# }
# ),
# label='备注2',
# id={
# 'type': 'sscf_add-form-label',
# 'index': 'bak2',
# 'required': False
# },
# ),
# span=12
# )
# ],
# gutter=5
# ),
# fac.AntdRow(
# [
# fac.AntdCol(
# fac.AntdFormItem(
# fac.AntdInput(
# id={
# 'type': 'sscf_add-form-value',
# 'index': 'bak3'
# },
# placeholder='请输入备注3',
# allowClear=True,
# style={
# 'width': '100%'
# }
# ),
# label='备注3',
# id={
# 'type': 'sscf_add-form-label',
# 'index': 'bak3',
# 'required': False
# },
# ),
# span=12
# ),
# fac.AntdCol(
# fac.AntdFormItem(
# fac.AntdInput(
# id={
# 'type': 'sscf_add-form-value',
# 'index': 'bak4'
# },
# placeholder='请输入备注4',
# allowClear=True,
# style={
# 'width': '100%'
# }
# ),
# label='备注4',
# id={
# 'type': 'sscf_add-form-label',
# 'index': 'bak4',
# 'required': False
# },
# ),
# span=12
# )
# ],
# gutter=5
# ),
# fac.AntdRow(
# [
# fac.AntdCol(
# fac.AntdFormItem(
# fac.AntdInput(
# id={
# 'type': 'sscf_add-form-value',
# 'index': 'bak5'
# },
# placeholder='请输入备注5',
# allowClear=True,
# style={
# 'width': '100%'
# }
# ),
# label='备注5',
# id={
# 'type': 'sscf_add-form-label',
# 'index': 'bak5',
# 'required': False
# },
# ),
# span=12
# ),
# fac.AntdCol(
# fac.AntdFormItem(
# fac.AntdSelect(
# id={
# 'type': 'sscf_add-form-value',
# 'index': 'status'
# },
# placeholder='请选择字段状态',
# options=[
# {
# 'label': '正常',
# 'value': '0'
# },
# {
# 'label': '停用',
# 'value': '1'
# },
# ],
# style={
# 'width': '100%'
# }
# ),
# label='字段状态',
# id={
# 'type': 'sscf_add-form-label',
# 'index': 'status',
# 'required': False
# },
# ),
# span=12
# )
# ],
# gutter=5
# )
],
labelCol={
'span': 8
},
wrapperCol={
'span': 16
},
style={
'marginRight': '10px'
}
)
],
id='sscf-add-modal',
title='新增字段',
mask=False,
width=650,
renderFooter=True,
okClickClose=False
),
# 编辑表单modal
fac.AntdModal(
[
fac.AntdForm(
[
fac.AntdRow(
[
fac.AntdCol(
fac.AntdFormItem(
fac.AntdTreeSelect(
id={
'type': 'sscf_edit-form-value',
'index': 'dasset_id'
},
placeholder='请选择资产名',
treeData=[],
treeNodeFilterProp='title',
style={
'width': '100%'
#'width': '495px'
}
),
label='归属资产名',
required=True,
id={
'type': 'sscf_edit-form-label',
'index': 'dasset_id',
'required': True
},
labelCol={
'offset': 1
}
),
span=12
),
fac.AntdCol(
fac.AntdFormItem(
fac.AntdSelect(
id={
'type': 'sscf_edit-form-value',
'index': 'status'
},
placeholder='请选择字段状态',
options=[
{
'label': '正常',
'value': '0'
},
{
'label': '停用',
'value': '1'
},
],
style={
'width': '100%'
}
),
label='字段状态',
required=True,
id={
'type': 'sscf_edit-form-label',
'index': 'status',
'required': False
},
),
span=12
)
# fac.AntdCol(
# fac.AntdFormItem(
# fac.AntdInput(
# id={
# 'type': 'sscf_edit-form-value',
# 'index': 'keywords'
# },
# placeholder='请输入关键词字符',
# allowClear=True,
# style={
# 'width': '100%'
# }
# ),
# label='关键词字符',
# required=False,
# id={
# 'type': 'sscf_edit-form-label',
# 'index': 'keywords',
# 'required': True
# }
# ),
# span=12
# )
],
gutter=5
),
fac.AntdRow(
[
fac.AntdCol(
fac.AntdFormItem(
fac.AntdInput(
id={
'type': 'sscf_edit-form-value',
'index': 'keyword'
},
placeholder='请输入关键词',
allowClear=True,
style={
'width': '100%'
}
),
label='关键词',
required=True,
id={
'type': 'sscf_edit-form-label',
'index': 'keyword',
'required': True
}
),
span=12
),
fac.AntdCol(
fac.AntdFormItem(
fac.AntdSelect(
id={
'type': 'sscf_edit-form-value',
'index': 'algorithm'
},
placeholder='请输入算法',
allowClear=True,
options=[
{
'label': '包含',
'value': '包含'
},
{
'label': '相等',
'value': '相等'
},
],
style={
'width': '100%'
}
),
label='算法',
id={
'type': 'sscf_edit-form-label',
'index': 'algorithm',
'required': False
},
),
span=12
)
],
gutter=5
),
fac.AntdRow(
[
fac.AntdCol(
fac.AntdFormItem(
fac.AntdSelect(
id={
'type': 'sscf_edit-form-value',
'index': 'order'
},
placeholder='请输入按顺序匹配标志',
allowClear=True,
options=[
{
'label': 'True',
'value': 'True'
},
{
'label': 'False',
'value': 'False'
},
],
style={
'width': '100%'
}
),
label='按顺序匹配标志',
id={
'type': 'sscf_edit-form-label',
'index': 'order',
'required': False
},
),
span=12
),
fac.AntdCol(
fac.AntdFormItem(
fac.AntdSelect(
id={
'type': 'sscf_edit-form-value',
'index': 'whole_sentence'
},
placeholder='请输入整句',
allowClear=True,
options=[
{
'label': 'True',
'value': 'True'
},
{
'label': 'False',
'value': 'False'
},
],
style={
'width': '100%'
}
),
label='整句',
id={
'type': 'sscf_edit-form-label',
'index': 'whole_sentence',
'required': False
},
),
span=12
)
],
gutter=5
),
fac.AntdRow(
[
fac.AntdCol(
fac.AntdFormItem(
fac.AntdSelect(
id={
'type': 'sscf_edit-form-value',
'index': 'type'
},
placeholder='请输入类型',
allowClear=True,
options=[
{
'label': '补充',
'value': '补充'
},
{
'label': '替换',
'value': '替换'
},
],
style={
'width': '100%'
}
),
label='类型',
id={
'type': 'sscf_edit-form-label',
'index': 'type',
'required': False
},
),
span=12
),
fac.AntdCol(
fac.AntdFormItem(
fac.AntdInput(
id={
'type': 'sscf_edit-form-value',
'index': 'supp_expl'
},
placeholder='请输入补充说明',
allowClear=True,
style={
'width': '100%'
}
),
label='补充说明',
id={
'type': 'sscf_edit-form-label',
'index': 'supp_expl',
'required': False
},
),
span=12
)
],
gutter=5
),
# fac.AntdRow(
# [
# fac.AntdCol(
# fac.AntdFormItem(
# fac.AntdInput(
# id={
# 'type': 'sscf_edit-form-value',
# 'index': 'bak1'
# },
# placeholder='请输入备注1',
# allowClear=True,
# style={
# 'width': '100%'
# }
# ),
# label='备注1',
# id={
# 'type': 'sscf_edit-form-label',
# 'index': 'bak1',
# 'required': False
# },
# ),
# span=12
# ),
# fac.AntdCol(
# fac.AntdFormItem(
# fac.AntdInput(
# id={
# 'type': 'sscf_edit-form-value',
# 'index': 'bak2'
# },
# placeholder='请输入备注2',
# allowClear=True,
# style={
# 'width': '100%'
# }
# ),
# label='备注2',
# id={
# 'type': 'sscf_edit-form-label',
# 'index': 'bak2',
# 'required': False
# },
# ),
# span=12
# )
# ],
# gutter=5
# ),
# fac.AntdRow(
# [
# fac.AntdCol(
# fac.AntdFormItem(
# fac.AntdInput(
# id={
# 'type': 'sscf_edit-form-value',
# 'index': 'bak3'
# },
# placeholder='请输入备注3',
# allowClear=True,
# style={
# 'width': '100%'
# }
# ),
# label='备注3',
# id={
# 'type': 'sscf_edit-form-label',
# 'index': 'bak3',
# 'required': False
# },
# ),
# span=12
# ),
# fac.AntdCol(
# fac.AntdFormItem(
# fac.AntdInput(
# id={
# 'type': 'sscf_edit-form-value',
# 'index': 'bak4'
# },
# placeholder='请输入备注4',
# allowClear=True,
# style={
# 'width': '100%'
# }
# ),
# label='备注4',
# id={
# 'type': 'sscf_edit-form-label',
# 'index': 'bak4',
# 'required': False
# },
# ),
# span=12
# )
# ],
# gutter=5
# ),
# fac.AntdRow(
# [
# fac.AntdCol(
# fac.AntdFormItem(
# fac.AntdInput(
# id={
# 'type': 'sscf_edit-form-value',
# 'index': 'bak5'
# },
# placeholder='请输入备注5',
# allowClear=True,
# style={
# 'width': '100%'
# }
# ),
# label='备注5',
# id={
# 'type': 'sscf_edit-form-label',
# 'index': 'bak5',
# 'required': False
# },
# ),
# span=12
# ),
# fac.AntdCol(
# fac.AntdFormItem(
# fac.AntdSelect(
# id={
# 'type': 'sscf_edit-form-value',
# 'index': 'status'
# },
# placeholder='请选择字段状态',
# options=[
# {
# 'label': '正常',
# 'value': '0'
# },
# {
# 'label': '停用',
# 'value': '1'
# },
# ],
# style={
# 'width': '100%'
# }
# ),
# label='字段状态',
# id={
# 'type': 'sscf_edit-form-label',
# 'index': 'status',
# 'required': False
# },
# ),
# span=12
# )
# ],
# gutter=5
# )
],
labelCol={
'span': 8
},
wrapperCol={
'span': 16
},
style={
'marginRight': '10px'
}
)
],
id='sscf-edit-modal',
title='编辑字段',
mask=False,
width=650,
renderFooter=True,
okClickClose=False
),
# 删除用户二次确认modal
fac.AntdModal(
fac.AntdText('是否确认删除?', id='sscf-delete-text'),
id='sscf-delete-confirm-modal',
visible=False,
title='提示',
renderFooter=True,
centered=True
),
# ]
# 短句配置导入modal
fac.AntdModal(
[
html.Div(
fac.AntdDraggerUpload(
id='sscf-upload-choose',
apiUrl=f'{ApiBaseUrlConfig.BaseUrl}/common/upload',
apiUrlExtraParams={'taskPath': 'sscfUpload'},
downloadUrl=f'{ApiBaseUrlConfig.BaseUrl}/common/caches',
downloadUrlExtraParams={'taskPath': 'sscfUpload', 'token': session.get('Authorization')},
headers={'Authorization': 'Bearer ' + session.get('Authorization')},
fileTypes=['xls', 'xlsx'],
fileListMaxLength=1,
text='短句配置导入',
hint='点击或拖拽文件至此处进行上传'
),
style={
'marginTop': '10px'
}
),
html.Div(
[
fac.AntdCheckbox(
id='sscf-import-update-check',
checked=False
),
fac.AntdText(
'是否更新已经存在的短句配置数据',
style={
'marginLeft': '5px'
}
)
],
style={
'textAlign': 'center',
'marginTop': '10px'
}
),
html.Div(
[
fac.AntdText('仅允许导入xls、xlsx格式文件。'),
fac.AntdButton(
'下载模板',
id='download-sscf-import-template',
type='link'
)
],
style={
'textAlign': 'center',
'marginTop': '10px'
}
)
],
id='sscf-import-confirm-modal',
visible=False,
title='短句配置导入',
width=600,
renderFooter=True,
centered=True,
okText='导入',
confirmAutoSpin=True,
loadingOkText='导入中',
okClickClose=False
),
fac.AntdModal(
fac.AntdText(
id='batch-result-content',
className={
'whiteSpace': 'break-spaces'
}
),
id='batch-result-modal',
visible=False,
title='短句配置导入结果',
renderFooter=False,
centered=True
),
]