Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
ffbd331a
提交
ffbd331a
authored
11月 04, 2021
作者:
ch
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加v2版本表单
上级
85c4ecc9
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
1956 行增加
和
0 行删除
+1956
-0
index.jsx
one_stop_public/TableV2/index.jsx
+1034
-0
isNewMobileTable.jsx
one_stop_public/TableV2/isNewMobileTable.jsx
+263
-0
ChildForm.jsx
one_stop_public/libs/ChildForm.jsx
+2
-0
MobileCascader.jsx
one_stop_public/tableComponV2/CascaderDiy/MobileCascader.jsx
+66
-0
styles.less
one_stop_public/tableComponV2/CascaderDiy/styles.less
+109
-0
FormModal.jsx
one_stop_public/tableComponV2/FormModal.jsx
+21
-0
MobileItem.jsx
one_stop_public/tableComponV2/MobileItem.jsx
+19
-0
staticInfo.jsx
one_stop_public/tableComponV2/Split_Index/staticInfo.jsx
+212
-0
index.jsx
one_stop_public/tableComponV2/index.jsx
+0
-0
style.less
one_stop_public/tableComponV2/style.less
+230
-0
没有找到文件。
one_stop_public/TableV2/index.jsx
0 → 100644
浏览文件 @
ffbd331a
/**
* 徐立
* 2019年9月25日
* 自定义表单表格
*/
import
React
,
{
Component
}
from
'react'
;
import
{
Form
,
Row
,
Col
,
Input
,
message
}
from
'antd'
;
import
UUID
from
'react-native-uuid'
;
import
{
Toast
}
from
'antd-mobile'
;
import
router
from
'umi/router'
;
import
moment
from
'moment'
;
import
{
HyperFormula
}
from
'hyperformula'
;
import
TableCom
from
'../tableComponV2'
;
import
IsNewTable
from
'./isNewMobileTable'
;
import
maintain
from
'../assets/maintain.png'
;
import
{
isJSON
}
from
'@/webPublic/one_stop_public/copy'
;
// import moment2 from 'moment-timezone'
export
default
class
ZdyTable
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
objRealTime
:
{},
isChange
:
false
,
selects
:
new
Map
(),
left
:
0
,
top
:
0
,
max
:
4
,
formId
:
null
,
formCode
:
null
,
width
:
100
,
mapData
:
{},
defaultBinds
:
{},
sqlData
:
{},
defaultValues
:
{},
currentFormKey
:
null
,
currentFormTitle
:
null
,
items
:
[],
init
:
this
.
props
.
init
||
{},
datas
:
{},
isEdit
:
true
,
isRowCol
:
false
,
isReady
:
false
,
formConfig
:
{},
};
}
componentDidMount
()
{
const
{
postData
,
// 数据源
isCg
,
// 用户点击草稿页面进入
isForm
,
isPreview
,
// 是否为预览模式
isChild
,
// 是否为子表单
isQRCode
=
false
,
// 是否为二维码快捷发起
formDeafault
=
''
,
// 为二维码快捷发起默认值
}
=
this
.
props
;
// if(this.props.currentFormKey === 'aa20cdbd-2019-45ea-8cdf-715aa46e132e'){
// debugger;
// }
if
(
isPreview
||
isChild
)
{
this
.
initExcel
({
datas
:
this
.
props
.
datas
,
trees
:
this
.
props
.
trees
},
()
=>
{
this
.
setState
({
...
this
.
state
,
...
this
.
props
,
formConfig
:
{
...
this
.
state
.
formConfig
,
style
:
this
.
props
.
style
},
isReady
:
true
,
viewMode
:
this
.
props
.
currentFormKey
&&
this
.
props
.
datas
&&
this
.
props
.
datas
[
this
.
props
.
currentFormKey
]
?
this
.
props
.
datas
[
this
.
props
.
currentFormKey
].
viewMode
:
null
,
});
});
return
;
}
const
val
=
postData
;
try
{
/**
* 数据源不同进行以下区别处理
* this.props.table有传入值表明需要渲染流程中最新表单
*/
if
(
isForm
)
{
// 由表格的操作按钮进入
const
mapData
=
{};
const
sqlData
=
{};
const
dataObjs
=
val
.
form
.
dataObjModels
;
for
(
var
i
=
0
;
i
<
dataObjs
.
length
;
i
++
)
{
const
dob
=
dataObjs
[
i
];
for
(
var
j
=
0
;
j
<
dob
.
columnModels
.
length
;
j
++
)
{
mapData
[
dob
.
columnModels
[
j
].
base52
]
=
dob
.
columnModels
[
j
];
}
}
const
sqls
=
val
.
form
.
sqlModels
;
for
(
var
i
=
0
;
i
<
sqls
.
length
;
i
++
)
{
const
dob
=
sqls
[
i
].
dataObjModel
;
for
(
var
j
=
0
;
j
<
dob
.
columnModels
.
length
;
j
++
)
{
sqlData
[
dob
.
columnModels
[
j
].
base52
]
=
dob
.
columnModels
[
j
];
}
}
const
obj
=
JSON
.
parse
(
val
.
form
.
content
);
const
xxx
=
obj
.
datas
[
obj
.
init
];
const
fk
=
this
.
props
.
table
?
val
.
formKey
:
obj
.
init
;
this
.
initExcel
(
obj
,
()
=>
{
this
.
setState
({
datas
:
obj
.
datas
,
width
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
width
:
xxx
.
width
,
isBorder
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
isBorder
:
xxx
.
isBorder
,
viewMode
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
viewMode
:
xxx
.
viewMode
,
isRowCol
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
isRowCol
:
xxx
.
isRowCol
,
mapData
,
currentFormKey
:
fk
,
currentFormTitle
:
this
.
getCurrentFormTitle
(
obj
,
fk
),
sqlData
,
isEdit
:
!
this
.
props
.
formKey
,
items
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
items
:
xxx
.
items
,
defaultValues
:
val
.
form
.
defaultValues
,
appId
:
val
.
appId
,
isReady
:
true
,
formConfig
:
xxx
,
});
});
return
;
}
if
(
isCg
===
'yes'
)
{
// 用户从编辑按钮进入
if
(
val
.
unifiedServicePatternModel
.
isDefaultError
!=
null
&&
val
.
unifiedServicePatternModel
.
isDefaultError
)
{
if
(
this
.
props
.
get
==
'web'
)
{
message
.
error
(
'当前办理人数较多,服务繁忙,请稍后再试!'
);
}
else
{
Toast
.
fail
(
'当前办理人数较多,服务繁忙,请稍后再试!'
);
}
router
.
goBack
();
return
;
}
const
mapData
=
{};
const
sqlData
=
{};
const
sqls
=
val
.
unifiedServicePatternModel
.
sqlModels
;
for
(
var
i
=
0
;
i
<
sqls
.
length
;
i
++
)
{
const
dob
=
sqls
[
i
].
dataObjModel
;
for
(
var
j
=
0
;
j
<
dob
.
columnModels
.
length
;
j
++
)
{
sqlData
[
dob
.
columnModels
[
j
].
base52
]
=
dob
.
columnModels
[
j
];
}
}
const
dataObjs
=
val
.
unifiedServicePatternModel
.
dataObjModels
;
for
(
var
i
=
0
;
i
<
dataObjs
.
length
;
i
++
)
{
const
dob
=
dataObjs
[
i
];
for
(
var
j
=
0
;
j
<
dob
.
columnModels
.
length
;
j
++
)
{
mapData
[
dob
.
columnModels
[
j
].
base52
]
=
dob
.
columnModels
[
j
];
}
}
const
obj
=
JSON
.
parse
(
val
.
unifiedServicePatternModel
.
content
);
const
xxx
=
obj
.
datas
[
obj
.
init
];
this
.
initExcel
(
obj
,
()
=>
{
this
.
setState
({
items
:
xxx
.
items
,
init
:
{
...
this
.
state
.
init
,
...
JSON
.
parse
(
val
.
content
)
},
datas
:
obj
.
datas
,
isEdit
:
!
this
.
props
.
formKey
,
currentFormKey
:
obj
.
init
,
currentFormTitle
:
this
.
getCurrentFormTitle
(
obj
,
obj
.
init
),
width
:
xxx
.
width
,
isBorder
:
xxx
.
isBorder
,
viewMode
:
xxx
.
viewMode
,
isRowCol
:
xxx
.
isRowCol
,
mapData
,
sqlData
,
defaultValues
:
val
.
unifiedServicePatternModel
.
defaultValues
,
appId
:
val
.
appId
,
isReady
:
true
,
formConfig
:
xxx
,
defaultBinds
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
defaultBinds
:
xxx
.
defaultBinds
,
});
});
return
;
}
if
(
val
.
unifiedServicePatternModel
.
isDefaultError
!=
null
&&
val
.
unifiedServicePatternModel
.
isDefaultError
)
{
if
(
this
.
props
.
get
==
'web'
)
{
message
.
error
(
'当前办理人数较多,服务繁忙,请稍后再试!'
);
}
else
{
Toast
.
fail
(
'当前办理人数较多,服务繁忙,请稍后再试!'
);
}
router
.
goBack
();
return
;
}
const
mapData
=
{};
const
sqlData
=
{};
const
sqls
=
val
.
unifiedServicePatternModel
.
sqlModels
;
for
(
var
i
=
0
;
i
<
sqls
.
length
;
i
++
)
{
const
dob
=
sqls
[
i
].
dataObjModel
;
for
(
var
j
=
0
;
j
<
dob
.
columnModels
.
length
;
j
++
)
{
sqlData
[
dob
.
columnModels
[
j
].
base52
]
=
dob
.
columnModels
[
j
];
}
}
const
dataObjs
=
val
.
unifiedServicePatternModel
.
dataObjModels
;
for
(
var
i
=
0
;
i
<
dataObjs
.
length
;
i
++
)
{
const
dob
=
dataObjs
[
i
];
for
(
var
j
=
0
;
j
<
dob
.
columnModels
.
length
;
j
++
)
{
mapData
[
dob
.
columnModels
[
j
].
base52
]
=
dob
.
columnModels
[
j
];
}
}
if
(
!
isJSON
(
val
.
unifiedServicePatternModel
.
content
))
{
console
.
error
(
'unifiedServicePatternModel.content 不是一个JSON字符串 请查看配置'
);
}
const
obj
=
JSON
.
parse
(
val
.
unifiedServicePatternModel
.
content
);
const
xxx
=
obj
.
datas
[
this
.
props
.
formKey
?
this
.
props
.
formKey
:
obj
.
init
];
// 是否是存在历史表单传入值
const
fk
=
this
.
props
.
formKey
?
this
.
props
.
formKey
:
val
.
taskFormKey
?
val
.
taskFormKey
:
obj
.
init
;
// console.log('231--------');
this
.
initExcel
(
obj
,
()
=>
this
.
setState
(
{
appId
:
val
.
id
,
formId
:
val
.
id
,
formCode
:
val
.
code
,
datas
:
obj
.
datas
,
mapData
,
sqlData
,
defaultValues
:
val
.
unifiedServicePatternModel
.
defaultValues
,
isEdit
:
!
this
.
props
.
formKey
,
currentFormKey
:
fk
,
currentFormTitle
:
this
.
getCurrentFormTitle
(
obj
,
fk
),
defaultBinds
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
defaultBinds
:
xxx
.
defaultBinds
,
width
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
width
:
xxx
.
width
,
isBorder
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
isBorder
:
xxx
.
isBorder
,
isRowCol
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
isRowCol
:
xxx
.
isRowCol
,
viewMode
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
viewMode
:
xxx
.
viewMode
,
items
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
items
:
xxx
.
items
,
isReady
:
true
,
init
:
{
...
this
.
state
.
init
,
...(
val
.
isSecond
?
this
.
props
.
obj
:
{})
},
// 重新发起就拿obj 里面的值给初始值
formConfig
:
xxx
,
// init:this.props.get==="mobile"?!!val.content?JSON.parse(val.content):'':{},// 移动端默认值设置
},
()
=>
{
/**
* 为二维码快捷发起时自动设置新默认值
*/
if
(
isQRCode
)
{
this
.
props
.
form
.
setFieldsValue
(
formDeafault
);
}
this
.
initExcel
(
obj
);
},
),
);
}
catch
(
e
)
{
console
.
log
(
'公式配置有误/Table/index-262'
,
e
);
}
}
importExcel
=
(
res
,
callback
)
=>
{
if
(
this
.
props
.
importExcel
)
{
this
.
props
.
importExcel
(
res
,
callback
);
return
}
const
{
datas
,
trees
}
=
this
.
configs
;
const
sheets
=
res
.
sheets
;
for
(
var
s
=
0
;
s
<
sheets
.
length
;
s
++
)
{
const
uuid
=
sheets
[
s
].
key
;
const
items
=
[];
const
cc
=
sheets
[
s
].
cells
;
for
(
var
i
=
0
;
i
<
cc
.
length
;
i
++
)
{
const
rows
=
[];
const
rr
=
cc
[
i
];
for
(
var
j
=
0
;
j
<
rr
.
length
;
j
++
)
{
const
c
=
rr
[
j
];
if
(
c
.
value
==
null
||
c
.
value
==
''
)
{
rows
.
push
({
uuid
:
'id_'
+
UUID
.
v4
().
replace
(
/-/g
,
'2'
),
row
:
c
.
rowSpan
,
col
:
c
.
colSpan
,
content
:
{
comName
:
'Excel'
,
cwidth
:
c
.
width
,
cheight
:
c
.
height
},
});
}
else
{
rows
.
push
({
uuid
:
'id_'
+
UUID
.
v4
().
replace
(
/-/g
,
'2'
),
row
:
c
.
rowSpan
,
col
:
c
.
colSpan
,
content
:
{
comName
:
'Excel'
,
initialValue
:
c
.
value
,
cwidth
:
c
.
width
,
cheight
:
c
.
height
,
},
});
}
}
items
.
push
(
rows
);
}
const
charts
=
sheets
[
s
].
charts
;
if
(
charts
&&
charts
.
length
>
0
)
{
const
rows
=
[];
for
(
var
j
=
0
;
j
<
charts
.
length
;
j
++
)
{
const
chartModel
=
charts
[
j
];
rows
.
push
({
uuid
:
'id_'
+
UUID
.
v4
().
replace
(
/-/g
,
'2'
),
content
:
{
comName
:
'Echart'
,
columnIds
:
{
c1
:
[]
},
labelSpan
:
24
,
wrapperSpan
:
24
,
isLabel
:
false
,
formula
:
'return '
+
JSON
.
stringify
(
chartModel
.
option
),
},
});
items
.
push
(
rows
);
}
}
if
(
datas
[
uuid
]
==
null
)
{
trees
.
push
({
title
:
sheets
[
s
].
name
,
key
:
uuid
});
}
datas
[
uuid
]
=
{
width
:
400
,
max
:
1
,
isBorder
:
true
,
items
:
items
,
};
}
this
.
initExcel
(
{
datas
,
trees
,
},
()
=>
{
this
.
setState
({
isChange
:
!
this
.
state
.
isChange
},
()
=>
{
if
(
callback
)
callback
();
});
console
.
log
(
'公式导入excel成功'
);
},
);
};
hfInstance
;
childExcel
=
(
sheetData
,
datas
,
tr
)
=>
{
if
(
tr
.
children
==
null
||
tr
.
children
.
length
==
0
)
{
}
else
{
for
(
var
c
=
0
;
c
<
tr
.
children
.
length
;
c
++
)
{
this
.
childExcel
(
sheetData
,
datas
,
tr
.
children
[
c
]);
}
}
const
data
=
datas
[
tr
.
key
];
const
all
=
[];
for
(
var
i
=
0
;
i
<
data
.
items
.
length
;
i
++
)
{
const
row
=
data
.
items
[
i
];
const
r
=
[];
for
(
var
j
=
0
;
j
<
row
.
length
;
j
++
)
{
const
col
=
row
[
j
];
if
(
col
.
content
?.
comName
==
'Excel'
)
{
r
.
push
(
col
.
content
.
initialValue
);
}
else
{
r
.
push
(
''
);
}
}
all
.
push
(
r
);
}
sheetData
[
tr
.
title
]
=
all
;
};
configs
;
initExcel
=
(
configs
,
callback
)
=>
{
this
.
configs
=
configs
;
// console.log(configs);
if
(
configs
==
null
||
configs
.
trees
==
null
)
{
if
(
callback
)
callback
();
return
;
}
const
sheetData
=
{};
for
(
var
key
in
configs
.
trees
)
{
const
tr
=
configs
.
trees
[
key
];
this
.
childExcel
(
sheetData
,
configs
.
datas
,
tr
);
}
const
hfInstance
=
HyperFormula
.
buildFromSheets
(
sheetData
,
{});
this
.
hfInstance
=
hfInstance
;
if
(
callback
)
callback
();
};
getCellValue
=
(
i
,
j
,
currentTitle
)
=>
{
let
hfInstance
=
this
.
props
.
hfInstance
?
this
.
props
.
hfInstance
:
this
.
hfInstance
;
if
(
hfInstance
&&
currentTitle
)
{
let
x
=
hfInstance
.
getCellValue
({
col
:
j
,
row
:
i
,
sheet
:
hfInstance
.
getSheetId
(
currentTitle
),
});
if
(
x
&&
x
.
value
!=
null
)
{
x
=
x
.
value
;
}
return
x
;
}
};
componentWillReceiveProps
(
nextProps
)
{
const
{
postData
,
// 数据源
isCg
,
// 用户点击草稿页面进入
isForm
,
isPreview
,
// 是否为预览模式
isChild
,
// 是否为子表单
}
=
nextProps
;
if
(
isPreview
||
isChild
)
{
this
.
setState
(
{
...
this
.
state
,
...
nextProps
,
isReady
:
true
,
viewMode
:
nextProps
.
currentFormKey
&&
nextProps
.
datas
&&
nextProps
.
datas
[
nextProps
.
currentFormKey
]
?
nextProps
.
datas
[
nextProps
.
currentFormKey
].
viewMode
:
null
,
formConfig
:
{
...
this
.
state
.
formConfig
,
style
:
nextProps
.
style
},
},
()
=>
this
.
initExcel
({
datas
:
nextProps
.
datas
,
trees
:
nextProps
.
trees
}),
);
return
;
}
try
{
const
val
=
postData
;
/**
* 数据源不同进行以下区别处理
* this.props.table有传入值表明需要渲染流程中最新表单
*/
if
(
isForm
)
{
// 由表格的操作按钮进入
const
mapData
=
{};
const
sqlData
=
{};
const
dataObjs
=
val
.
form
.
dataObjModels
;
for
(
var
i
=
0
;
i
<
dataObjs
.
length
;
i
++
)
{
const
dob
=
dataObjs
[
i
];
for
(
var
j
=
0
;
j
<
dob
.
columnModels
.
length
;
j
++
)
{
mapData
[
dob
.
columnModels
[
j
].
base52
]
=
dob
.
columnModels
[
j
];
}
}
const
sqls
=
val
.
form
.
sqlModels
;
for
(
var
i
=
0
;
i
<
sqls
.
length
;
i
++
)
{
const
dob
=
sqls
[
i
].
dataObjModel
;
for
(
var
j
=
0
;
j
<
dob
.
columnModels
.
length
;
j
++
)
{
sqlData
[
dob
.
columnModels
[
j
].
base52
]
=
dob
.
columnModels
[
j
];
}
}
const
obj
=
JSON
.
parse
(
val
.
form
.
content
);
const
xxx
=
obj
.
datas
[
obj
.
init
];
this
.
initExcel
(
obj
,
()
=>
{
this
.
setState
({
datas
:
obj
.
datas
,
width
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
width
:
xxx
.
width
,
isRowCol
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
isRowCol
:
xxx
.
isRowCol
,
isBorder
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
isBorder
:
xxx
.
isBorder
,
mapData
,
currentFormKey
:
this
.
props
.
table
?
val
.
formKey
:
obj
.
init
,
currentFormTitle
:
this
.
getCurrentFormTitle
(
obj
,
fk
),
sqlData
,
isEdit
:
!
this
.
props
.
formKey
,
items
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
items
:
xxx
.
items
,
defaultValues
:
val
.
form
.
defaultValues
,
appId
:
val
.
appId
,
isReady
:
true
,
formConfig
:
xxx
,
});
});
return
;
}
if
(
isCg
===
'yes'
)
{
// 用户从编辑按钮进入
const
mapData
=
{};
const
sqlData
=
{};
const
sqls
=
val
.
unifiedServicePatternModel
.
sqlModels
;
for
(
var
i
=
0
;
i
<
sqls
.
length
;
i
++
)
{
const
dob
=
sqls
[
i
].
dataObjModel
;
for
(
var
j
=
0
;
j
<
dob
.
columnModels
.
length
;
j
++
)
{
sqlData
[
dob
.
columnModels
[
j
].
base52
]
=
dob
.
columnModels
[
j
];
}
}
const
dataObjs
=
val
.
unifiedServicePatternModel
.
dataObjModels
;
for
(
var
i
=
0
;
i
<
dataObjs
.
length
;
i
++
)
{
const
dob
=
dataObjs
[
i
];
for
(
var
j
=
0
;
j
<
dob
.
columnModels
.
length
;
j
++
)
{
mapData
[
dob
.
columnModels
[
j
].
base52
]
=
dob
.
columnModels
[
j
];
}
}
const
obj
=
JSON
.
parse
(
val
.
unifiedServicePatternModel
.
content
);
const
xxx
=
obj
.
datas
[
obj
.
init
];
this
.
initExcel
(
obj
,
()
=>
{
this
.
setState
({
items
:
xxx
.
items
,
init
:
{
...
this
.
state
.
init
,
...
JSON
.
parse
(
val
.
content
)
},
datas
:
obj
.
datas
,
isEdit
:
!
this
.
props
.
formKey
,
currentFormKey
:
obj
.
init
,
currentFormTitle
:
this
.
getCurrentFormTitle
(
obj
,
obj
.
init
),
width
:
xxx
.
width
,
isBorder
:
xxx
.
isBorder
,
isRowCol
:
xxx
.
isRowCol
,
mapData
,
sqlData
,
defaultValues
:
val
.
unifiedServicePatternModel
.
defaultValues
,
appId
:
val
.
appId
,
isReady
:
true
,
formConfig
:
xxx
,
defaultBinds
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
defaultBinds
:
xxx
.
defaultBinds
,
});
});
return
;
}
const
mapData
=
{};
const
sqlData
=
{};
const
sqls
=
val
.
unifiedServicePatternModel
.
sqlModels
;
for
(
var
i
=
0
;
i
<
sqls
.
length
;
i
++
)
{
const
dob
=
sqls
[
i
].
dataObjModel
;
for
(
var
j
=
0
;
j
<
dob
.
columnModels
.
length
;
j
++
)
{
sqlData
[
dob
.
columnModels
[
j
].
base52
]
=
dob
.
columnModels
[
j
];
}
}
const
dataObjs
=
val
.
unifiedServicePatternModel
.
dataObjModels
;
for
(
var
i
=
0
;
i
<
dataObjs
.
length
;
i
++
)
{
const
dob
=
dataObjs
[
i
];
for
(
var
j
=
0
;
j
<
dob
.
columnModels
.
length
;
j
++
)
{
mapData
[
dob
.
columnModels
[
j
].
base52
]
=
dob
.
columnModels
[
j
];
}
}
const
obj
=
JSON
.
parse
(
val
.
unifiedServicePatternModel
.
content
);
const
xxx
=
obj
.
datas
[
this
.
props
.
formKey
?
this
.
props
.
formKey
:
obj
.
init
];
// 是否是存在历史表单传入值
if
(
this
.
props
.
isQuery
)
return
;
const
fk
=
this
.
props
.
formKey
?
this
.
props
.
formKey
:
val
.
taskFormKey
?
val
.
taskFormKey
:
obj
.
init
;
this
.
initExcel
(
obj
,
()
=>
{
this
.
setState
({
appId
:
val
.
id
,
datas
:
obj
.
datas
,
mapData
,
sqlData
,
defaultValues
:
val
.
unifiedServicePatternModel
.
defaultValues
,
isEdit
:
!
this
.
props
.
formKey
,
currentFormKey
:
fk
,
currentFormTitle
:
this
.
getCurrentFormTitle
(
obj
,
fk
),
defaultBinds
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
defaultBinds
:
xxx
.
defaultBinds
,
width
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
width
:
xxx
.
width
,
isBorder
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
isBorder
:
xxx
.
isBorder
,
isRowCol
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
isRowCol
:
xxx
.
isRowCol
,
items
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
items
:
xxx
.
items
,
isReady
:
true
,
init
:
{
...
this
.
state
.
init
,
...(
val
.
isSecond
?
this
.
props
.
obj
:
{}),
},
formConfig
:
xxx
,
// init:this.props.get==="mobile"?!!val.content?JSON.parse(val.content):'':{},// 移动端默认值设置
});
});
}
catch
(
e
)
{
console
.
log
(
'公式配置有误Table/index.jsx/572'
,
e
);
}
}
checkAllHidden
=
(
row
)
=>
{
for
(
var
i
=
0
;
i
<
row
.
length
;
i
++
)
{
if
(
row
[
i
].
hidden
==
null
||
!
row
[
i
].
hidden
)
{
return
false
;
}
}
for
(
var
i
=
0
;
i
<
row
.
length
;
i
++
)
{
delete
row
[
i
].
hidden
;
}
return
true
;
};
countMax
=
(
items
)
=>
{
let
max
=
0
;
items
.
forEach
((
r
)
=>
{
if
(
r
.
length
>
max
)
{
max
=
r
.
length
;
}
});
return
max
;
};
getCurrentFormTitle
=
(
obj
,
key
)
=>
{
if
(
obj
==
null
)
return
;
const
{
trees
}
=
obj
;
if
(
trees
==
null
)
return
;
return
this
.
getT
(
trees
,
key
);
};
getCurrentFormTitle2
=
(
key
)
=>
{
if
(
this
.
configs
==
null
)
return
;
const
trees
=
this
.
configs
&&
this
.
configs
.
trees
?
this
.
configs
.
trees
:
this
.
props
.
trees
;
if
(
trees
==
null
)
return
;
return
this
.
getT
(
trees
,
key
);
};
setRealTimeValues
=
(
obj
)
=>
{
this
.
setState
({
objRealTime
:
obj
});
};
getT
=
(
trees
,
key
)
=>
{
for
(
var
i
in
trees
)
{
if
(
trees
[
i
].
key
==
key
)
{
return
trees
[
i
].
title
;
}
if
(
trees
[
i
].
children
!=
null
&&
trees
[
i
].
children
.
length
>
0
)
{
const
x
=
this
.
getT
(
trees
[
i
].
children
,
key
);
if
(
x
!=
null
)
return
x
}
}
return
null
;
};
render
()
{
const
{
width
,
isRowCol
,
isBorder
,
sqlData
,
mapData
,
defaultBinds
,
defaultValues
,
items
,
init
,
modalTitle
,
currentFormKey
,
currentFormTitle
,
isEdit
,
datas
,
isReady
,
formConfig
,
formCode
,
formId
,
viewMode
,
}
=
this
.
state
;
const
{
border
,
obj
,
index
,
fatherCode
,
routerState
,
// 场景设计器共享路由参数
messageData
,
// 场景设计器共享变量参数 设计器监听到参数发生变化后会重新渲染组件
postData
,
modalInit
,
concealModel
,
// 场景设计器内置跳转函数
paddingBottom
,
taskAssignee
,
userId
,
isDynamic
,
// 是否为大数据页面
isWebPrint
,
// 打印界面
isWebPrintEnd
,
isPreview
,
}
=
this
.
props
;
const
trees
=
this
.
configs
&&
this
.
configs
.
trees
?
this
.
configs
.
trees
:
this
.
props
.
trees
;
let
get
;
if
(
viewMode
!=
null
&&
viewMode
!=
''
)
{
get
=
viewMode
;
}
else
{
get
=
this
.
props
.
get
;
}
let
style
=
{};
if
(
formConfig
.
style
!=
null
)
{
try
{
style
=
JSON
.
parse
(
formConfig
.
style
);
}
catch
(
e
)
{
//console.log(e);
style
=
{};
}
}
const
formItemLayout
=
{
labelCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
24
},
},
wrapperCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
24
},
},
};
const
max
=
this
.
countMax
(
items
);
const
borderStyle
=
{
borderRight
:
'1px solid gray'
,
borderTop
:
'1px solid gray'
,
borderLeft
:
'1px solid gray'
,
borderBottom
:
'1px solid gray'
,
};
const
borderStyleTwo
=
{
// 处理隐藏组件边框样式问题
borderRight
:
'1px solid gray'
,
borderLeft
:
'1px solid gray'
,
borderTop
:
'1px solid gray'
,
};
let
updateTime
;
const
styleDiv
=
this
.
props
.
height
?
{
overflow
:
isDynamic
?
'hidden'
:
'auto'
,
// overflowY: isDynamic && 'auto',
width
:
'100%'
,
height
:
this
.
props
.
height
,
paddingBottom
:
paddingBottom
!=
null
?
paddingBottom
:
isWebPrint
?
0
:
'10px'
,
}
:
{
overflow
:
isDynamic
?
'hidden'
:
'auto'
,
// overflowY: isDynamic && 'auto',
width
:
'100%'
,
paddingBottom
:
paddingBottom
!=
null
?
paddingBottom
:
isWebPrint
?
0
:
'10px'
,
};
if
(
!
isReady
)
return
<></>;
if
(
this
.
props
.
postData
?.
isUpdate
)
{
updateTime
=
moment
(
+
this
.
props
.
postData
?.
updateTime
).
format
(
'llll'
);
}
if
(
this
.
props
.
currentFormKey
===
'aa20cdbd-2019-45ea-8cdf-715aa46e132e'
)
{
console
.
log
(
this
);
}
switch
(
get
)
{
case
'web'
:
return
(
<>
{
this
.
props
.
postData
?.
isUpdate
?
(
<
div
style=
{
{
margin
:
'100px 24px 24px'
}
}
>
<
div
style=
{
{
textAlign
:
'center'
}
}
>
<
img
style=
{
{
marginRight
:
30
}
}
src=
{
maintain
}
/>
</
div
>
<
p
style=
{
{
textAlign
:
'center'
,
width
:
'100%'
,
fontSize
:
'16px'
,
fontWeight
:
'bold'
,
color
:
'#666666'
,
}
}
>
{
updateTime
!==
'Invalid date'
?
`升级维护中,预计${updateTime ?? '一万年'}恢复使用,请耐心等待。`
:
'请耐心等待'
}
</
p
>
</
div
>
)
:
(
<
div
id=
"web_table"
>
<
Form
className=
"login-form"
>
{
isEdit
&&
defaultBinds
?
Object
.
keys
(
defaultBinds
).
map
((
k
)
=>
{
const
r
=
defaultBinds
[
k
];
if
(
r
.
columnIds
==
null
||
r
.
columnIds
.
length
<
2
||
r
.
sqls
==
null
||
r
.
sqls
.
length
<
2
)
{
return
''
;
}
const
name
=
r
.
columnIds
[
r
.
columnIds
.
length
-
1
];
const
key
=
r
.
sqls
[
r
.
sqls
.
length
-
1
];
const
value
=
defaultValues
[
key
];
if
(
value
===
null
||
value
===
undefined
)
{
return
''
;
}
return
this
.
props
.
form
.
getFieldDecorator
(
name
,
{
initialValue
:
value
,
})(<
Input
type=
"hidden"
/>);
})
:
''
}
<
Row
>
<
Col
span=
{
24
}
>
<
div
style=
{
styleDiv
}
ref=
{
(
ref
)
=>
{
this
.
root
=
ref
;
}
}
>
<
table
style=
{
{
overflow
:
'auto'
,
margin
:
max
*
width
>
550
?
'auto'
:
''
,
marginBottom
:
isWebPrint
?
(
isWebPrintEnd
?
'5px'
:
0
)
:
'1px'
,
...
style
,
}
}
border=
{
border
}
cellSpacing=
"0"
cellPadding=
"0"
>
<
tbody
>
{
items
.
map
((
row
,
i
)
=>
{
const
allhidden
=
this
.
checkAllHidden
(
row
);
return
(
<
tr
key=
{
i
}
>
{
row
.
map
((
cell
,
j
)
=>
{
if
(
!
cell
.
content
)
{
return
;
}
let
styles
=
{};
if
(
cell
.
content
&&
cell
.
content
.
styles
)
{
try
{
styles
=
JSON
.
parse
(
cell
.
content
.
styles
);
}
catch
(
e
)
{
console
.
log
(
`第${i}行第${j}列样式配置有误,${e}`
);
}
}
return
!
allhidden
&&
cell
.
hidden
?
(
''
)
:
(
<
td
width=
{
i
==
0
?
(
cell
.
content
!=
null
&&
cell
.
content
.
cwidth
!=
null
?
cell
.
content
.
cwidth
:
width
)
*
(
cell
.
col
?
cell
.
col
:
1
)
:
width
*
(
cell
.
col
?
cell
.
col
:
1
)
}
rowSpan=
{
cell
.
row
}
colSpan=
{
cell
.
col
}
key=
{
j
}
style=
{
{
overflow
:
'auto'
,
textAlign
:
cell
.
content
&&
cell
.
content
.
calign
?
cell
.
content
.
calign
:
'left'
,
...(
isBorder
?
cell
?.
content
?.
comName
==
'InputHidden'
||
!
cell
?.
content
?.
comName
?
{}
:
borderStyle
:
{}),
// position: cell.content&&cell.content.comName ==="InputHidden"&&'absolute',
...
styles
,
display
:
cell
.
content
&&
(
cell
.
content
.
comName
===
'InputHidden'
||
cell
.
content
.
isHidden
)
&&
'none'
,
}
}
>
<
TableCom
changedValues=
{
this
.
props
.
changedValues
}
taskId=
{
this
.
props
.
taskId
}
importExcel=
{
this
.
importExcel
}
getCellValue=
{
this
.
getCellValue
}
getCurrentFormTitle=
{
this
.
getCurrentFormTitle2
}
hfInstance=
{
this
.
hfInstance
}
isWebPrintEnd=
{
isWebPrintEnd
}
isWebPrint=
{
isWebPrint
}
isPrint=
{
this
.
props
.
isPrint
}
formCode=
{
formCode
}
// 当前表单code
modalInit=
{
modalInit
}
taskAssignee=
{
taskAssignee
}
// 提交人
userId=
{
userId
}
formId=
{
formId
}
// 当前表单Id
i=
{
i
}
// 当前组件下标
j=
{
j
}
// 当前行数下班
isPreview=
{
isPreview
}
fatherCode=
{
fatherCode
}
index=
{
index
}
fatherObj=
{
this
.
props
.
fatherObj
}
datas=
{
datas
}
uuid=
{
cell
.
uuid
}
setRealTimeValues=
{
this
.
setRealTimeValues
}
isEdit=
{
isEdit
}
formKey=
{
currentFormKey
}
currentFormTitle=
{
currentFormTitle
}
init=
{
init
}
get=
{
get
}
// 区分移动端或wen端
json=
{
cell
.
content
}
obj=
{
{
...
obj
,
...
this
.
state
.
objRealTime
}
||
{}
}
// 是否存在默认值
mapData=
{
mapData
}
form=
{
this
.
props
.
form
}
// antd form控件
sqlData=
{
sqlData
}
defaultValues=
{
defaultValues
||
{}
}
// 接口中的默认值
routerState=
{
routerState
}
// 兼容表单设计器路由传参
messageData=
{
messageData
}
// 场景设计器共享变量参数
concealModel=
{
concealModel
||
{}
}
// 场景设计器内置路由跳转函数
isDynamic=
{
isDynamic
}
// 是否为场景配置器调用
trees=
{
trees
}
/>
</
td
>
);
})
}
</
tr
>
);
})
}
</
tbody
>
</
table
>
{
style
.
pageBreakAfter
!=
null
?
(
<
div
style=
{
{
pageBreakAfter
:
style
.
pageBreakAfter
}
}
/>
)
:
(
''
)
}
</
div
>
</
Col
>
</
Row
>
</
Form
>
</
div
>
)
}
</>
);
case
'mobile'
:
return
(
<>
{
this
.
props
.
postData
?.
isUpdate
?
(
<
div
style=
{
{
margin
:
'100px 24px 24px'
}
}
>
<
div
style=
{
{
textAlign
:
'center'
}
}
>
<
img
style=
{
{
width
:
'100%'
}
}
src=
{
maintain
}
/>
</
div
>
<
p
style=
{
{
textAlign
:
'center'
,
width
:
'100%'
,
fontSize
:
'16px'
,
fontWeight
:
'bold'
,
color
:
'#666666'
,
}
}
>
{
updateTime
!==
'Invalid date'
?
`升级维护中,预计${updateTime ?? '一万年'}恢复使用,请耐心等待。`
:
'请耐心等待'
}
</
p
>
</
div
>
)
:
(
<
Form
{
...
formItemLayout
}
id=
"mobile_table"
className=
"login-form"
>
{
defaultBinds
?
Object
.
keys
(
defaultBinds
).
map
((
k
)
=>
{
const
r
=
defaultBinds
[
k
];
if
(
r
.
columnIds
==
null
||
r
.
columnIds
.
length
<
2
||
r
.
sqls
==
null
||
r
.
sqls
.
length
<
2
)
{
return
''
;
}
const
name
=
r
.
columnIds
[
r
.
columnIds
.
length
-
1
];
const
key
=
r
.
sqls
[
r
.
sqls
.
length
-
1
];
const
value
=
defaultValues
[
key
];
if
(
value
===
null
||
value
===
undefined
)
{
return
''
;
}
return
this
.
props
.
form
.
getFieldDecorator
(
name
,
{
initialValue
:
value
,
})(<
Input
type=
"hidden"
/>);
})
:
''
}
<
IsNewTable
changedValues=
{
this
.
props
.
changedValues
}
taskId=
{
this
.
props
.
taskId
}
getCellValue=
{
this
.
getCellValue
}
hfInstance=
{
this
.
hfInstance
}
getCurrentFormTitle=
{
this
.
getCurrentFormTitle2
}
taskAssignee=
{
taskAssignee
}
// 提交人
userId=
{
userId
}
importExcel=
{
this
.
importExcel
}
isPreview=
{
isPreview
}
trees=
{
trees
}
setRealTimeValues=
{
this
.
setRealTimeValues
}
isRowCol=
{
isRowCol
}
modalInit=
{
modalInit
}
items=
{
items
}
checkAllHidden=
{
this
.
checkAllHidden
}
isBorder=
{
isBorder
}
borderStyle=
{
borderStyle
}
fatherCode=
{
fatherCode
}
index=
{
index
}
datas=
{
datas
}
isEdit=
{
isEdit
}
currentFormKey=
{
currentFormKey
}
currentFormTitle=
{
currentFormTitle
}
init=
{
init
}
get=
{
get
}
obj=
{
{
...
obj
,
...
this
.
state
.
objRealTime
}
}
mapData=
{
mapData
}
form=
{
this
.
props
.
form
}
sqlData=
{
sqlData
}
defaultValues=
{
defaultValues
}
width=
{
width
}
formCode=
{
formCode
}
style=
{
style
}
routerState=
{
routerState
}
// 兼容表单设计器路由传参
messageData=
{
messageData
}
// 场景设计器共享变量参数
formId=
{
formId
}
fatherObj=
{
this
.
props
.
fatherObj
}
concealModel=
{
concealModel
||
{}
}
// 场景设计器内置路由跳转函数
isDynamic=
{
isDynamic
}
// 是否为场景配置器调用
/>
</
Form
>
)
}
</>
);
}
}
}
one_stop_public/TableV2/isNewMobileTable.jsx
0 → 100644
浏览文件 @
ffbd331a
/**
* 测试新表格
*/
import
React
,
{
Component
}
from
'react'
;
import
{
Row
,
Col
}
from
'antd'
;
import
TableCom
from
'../tableComponV2/index'
;
export
default
class
IsNewTable
extends
Component
{
render
()
{
const
{
items
,
checkAllHidden
,
fatherCode
,
userId
,
index
,
datas
,
isEdit
,
currentFormKey
,
init
,
get
,
obj
,
mapData
,
sqlData
,
defaultValues
,
routerState
,
messageData
,
formCode
,
formId
,
style
,
isPreview
,
modalInit
,
concealModel
,
taskAssignee
,
currentFormTitle
,
getCellValue
,
hfInstance
,
trees
,
getCurrentFormTitle
,
changedValues
}
=
this
.
props
;
if
(
!
isEdit
)
{
// 展示栏 暂不做处理
return
(
<>
{
items
.
map
((
item
,
i
)
=>
{
const
allhidden
=
checkAllHidden
(
items
);
return
(
<
div
key=
{
item
&&
Array
.
isArray
(
item
)
&&
item
.
length
>
0
?
item
[
0
].
uuid
:
i
}
style=
{
{
marginTop
:
0
,
background
:
'#ffffff'
,
width
:
'100%'
,
flexWrap
:
'wrap'
,
...
style
,
}
}
>
{
item
.
map
((
ary
,
j
)
=>
{
let
styles
=
{};
if
(
ary
.
content
&&
ary
.
content
.
styles
)
{
try
{
styles
=
JSON
.
parse
(
ary
.
content
.
styles
);
}
catch
(
e
)
{
console
.
log
(
`第${i}行第${j}列样式配置有误,${e}`
);
}
}
return
!
allhidden
&&
ary
.
hidden
?
(
''
)
:
(
<
div
key=
{
ary
.
uuid
||
j
}
style=
{
{
...
styles
,
textAlign
:
'left'
,
borderBottom
:
'1px solid white'
,
display
:
ary
.
content
&&
(
ary
.
content
.
comName
===
'InputHidden'
||
ary
.
content
.
isMobileHidden
)
&&
'none'
,
}
}
>
<
TableCom
changedValues=
{
changedValues
}
taskAssignee=
{
taskAssignee
}
// 提交人
trees=
{
trees
}
userId=
{
userId
}
modalInit=
{
modalInit
}
formCode=
{
formCode
}
formId=
{
formId
}
isPreview=
{
isPreview
}
i=
{
i
}
j=
{
j
}
taskId=
{
this
.
props
.
taskId
}
setRealTimeValues=
{
this
.
props
.
setRealTimeValues
}
index=
{
index
}
getCurrentFormTitle=
{
getCurrentFormTitle
}
fatherCode=
{
fatherCode
}
datas=
{
datas
}
isEdit=
{
isEdit
}
fatherObj=
{
this
.
props
.
fatherObj
}
formKey=
{
currentFormKey
}
currentFormTitle=
{
currentFormTitle
}
hfInstance=
{
hfInstance
}
getCellValue=
{
getCellValue
}
initExcel=
{
this
.
props
.
initExcel
}
init=
{
init
}
get=
{
get
}
key=
{
j
}
sqlData=
{
sqlData
}
obj=
{
obj
||
{}
}
form=
{
this
.
props
.
form
}
mapData=
{
mapData
}
json=
{
ary
.
content
}
uuid=
{
ary
.
uuid
}
routerState=
{
routerState
}
// 兼容表单设计器路由传参
defaultValues=
{
defaultValues
||
{}
}
messageData=
{
messageData
}
// 场景设计器共享变量参数
concealModel=
{
concealModel
}
// 场景设计器路由跳转参数
/>
</
div
>
);
})
}
</
div
>
);
})
}
</>
);
}
return
items
.
map
((
item
,
i
)
=>
{
const
allhidden
=
checkAllHidden
(
items
);
return
(
<
Row
key=
{
item
&&
Array
.
isArray
(
item
)
&&
item
.
length
>
0
?
item
[
0
].
uuid
:
i
}
style=
{
{
...
style
,
}
}
>
{
item
.
map
((
ary
,
j
)
=>
{
let
styles
=
{};
if
(
ary
.
content
&&
ary
.
content
.
styles
)
{
try
{
styles
=
JSON
.
parse
(
ary
.
content
.
styles
);
}
catch
(
e
)
{
console
.
log
(
`第${i}行第${j}列样式配置有误,${e}`
);
}
}
if
(
ary
.
content
?.
comName
===
'Label'
)
{
return
(
<
Col
key=
{
ary
.
uuid
||
j
}
style=
{
{
display
:
ary
.
content
&&
(
ary
.
content
.
comName
===
'InputHidden'
||
ary
.
content
.
isMobileHidden
)
&&
'none'
,
...
styles
,
}
}
span=
{
ary
.
content
?.
labelSpan
||
24
}
>
{
!
allhidden
&&
ary
.
hidden
?
(
''
)
:
(
<>
<
TableCom
changedValues=
{
changedValues
}
trees=
{
trees
}
formCode=
{
formCode
}
taskAssignee=
{
taskAssignee
}
formId=
{
formId
}
modalInit=
{
modalInit
}
i=
{
i
}
j=
{
j
}
taskId=
{
this
.
props
.
taskId
}
isPreview=
{
isPreview
}
index=
{
index
}
fatherCode=
{
fatherCode
}
datas=
{
datas
}
isEdit=
{
isEdit
}
setRealTimeValues=
{
this
.
props
.
setRealTimeValues
}
getCurrentFormTitle=
{
getCurrentFormTitle
}
importExcel=
{
this
.
props
.
importExcel
}
fatherObj=
{
this
.
props
.
fatherObj
}
formKey=
{
currentFormKey
}
currentFormTitle=
{
currentFormTitle
}
hfInstance=
{
hfInstance
}
getCellValue=
{
getCellValue
}
init=
{
init
}
get=
{
get
}
key=
{
j
}
sqlData=
{
sqlData
}
obj=
{
obj
||
{}
}
form=
{
this
.
props
.
form
}
mapData=
{
mapData
}
json=
{
ary
.
content
}
uuid=
{
ary
.
uuid
}
routerState=
{
routerState
}
// 兼容表单设计器路由传参
defaultValues=
{
defaultValues
||
{}
}
messageData=
{
messageData
}
// 场景设计器共享变量参数
/>
</>
)
}
</
Col
>
);
}
return
(
<
Col
key=
{
ary
.
uuid
||
j
}
span=
{
24
}
style=
{
{
display
:
ary
.
content
&&
(
ary
.
content
.
comName
===
'InputHidden'
||
ary
.
content
.
isMobileHidden
)
&&
'none'
,
...
styles
,
}
}
>
{
!
allhidden
&&
ary
.
hidden
?
(
''
)
:
(
<>
<
TableCom
changedValues=
{
changedValues
}
trees=
{
trees
}
formCode=
{
formCode
}
taskAssignee=
{
taskAssignee
}
formId=
{
formId
}
taskId=
{
this
.
props
.
taskId
}
isPreview=
{
isPreview
}
i=
{
i
}
j=
{
j
}
index=
{
index
}
fatherCode=
{
fatherCode
}
datas=
{
datas
}
modalInit=
{
modalInit
}
isEdit=
{
isEdit
}
getCurrentFormTitle=
{
getCurrentFormTitle
}
fatherObj=
{
this
.
props
.
fatherObj
}
formKey=
{
currentFormKey
}
importExcel=
{
this
.
props
.
importExcel
}
currentFormTitle=
{
currentFormTitle
}
hfInstance=
{
hfInstance
}
getCellValue=
{
getCellValue
}
init=
{
init
}
get=
{
get
}
key=
{
j
}
setRealTimeValues=
{
this
.
props
.
setRealTimeValues
}
sqlData=
{
sqlData
}
obj=
{
obj
||
{}
}
form=
{
this
.
props
.
form
}
mapData=
{
mapData
}
json=
{
ary
.
content
}
uuid=
{
ary
.
uuid
}
routerState=
{
routerState
}
// 兼容表单设计器路由传参
defaultValues=
{
defaultValues
||
{}
}
messageData=
{
messageData
}
// 场景设计器共享变量参数
/>
</>
)
}
</
Col
>
);
})
}
</
Row
>
);
});
}
}
one_stop_public/libs/ChildForm.jsx
浏览文件 @
ffbd331a
...
@@ -147,6 +147,7 @@ export default class ChildForm extends React.Component {
...
@@ -147,6 +147,7 @@ export default class ChildForm extends React.Component {
}
}
}
}
span=
{
isEdit
?
24
:
span
}
>
span=
{
isEdit
?
24
:
span
}
>
<
ZdyTable
<
ZdyTable
changedValues=
{
this
.
props
.
changedValues
}
setRealTimeValues=
{
this
.
props
.
setRealTimeValues
}
setRealTimeValues=
{
this
.
props
.
setRealTimeValues
}
trees=
{
this
.
props
.
trees
}
trees=
{
this
.
props
.
trees
}
key=
{
r
}
key=
{
r
}
...
@@ -231,6 +232,7 @@ export default class ChildForm extends React.Component {
...
@@ -231,6 +232,7 @@ export default class ChildForm extends React.Component {
return
(
return
(
<
Col
span=
{
span
}
key=
{
r
}
>
<
Col
span=
{
span
}
key=
{
r
}
>
<
ZdyTable
<
ZdyTable
changedValues=
{
this
.
props
.
changedValues
}
taskId=
{
taskId
}
taskId=
{
taskId
}
setRealTimeValues=
{
this
.
props
.
setRealTimeValues
}
setRealTimeValues=
{
this
.
props
.
setRealTimeValues
}
modalInit=
{
modalInit
}
modalInit=
{
modalInit
}
...
...
one_stop_public/tableComponV2/CascaderDiy/MobileCascader.jsx
0 → 100644
浏览文件 @
ffbd331a
import
React
,
{
useMemo
,
Component
}
from
'react'
;
import
{
List
,
Picker
}
from
'antd-mobile'
;
import
styles
from
'./styles.less'
;
const
getItemChildren
=
(
childrenList
,
parent
)
=>
{
if
(
!
childrenList
||
!
childrenList
.
length
)
{
return
[];
}
for
(
let
item
of
childrenList
)
{
if
(
item
.
label
.
indexOf
(
parent
.
label
)
>
-
1
)
{
item
.
label
=
item
.
label
.
replace
(
parent
.
label
,
''
);
}
for
(
let
proviceName
of
[
'内蒙古'
,
'广西'
,
'新疆'
,
'香港'
,
'澳门'
,
'西藏'
,
'宁夏'
])
{
item
.
label
=
item
.
label
.
replace
(
proviceName
,
''
);
}
if
(
item
.
children
)
{
item
.
children
=
getItemChildren
(
item
.
children
,
parent
);
}
}
return
childrenList
;
}
export
default
class
MobileCascader
extends
Component
{
constructor
(
props
)
{
super
(
props
);
}
render
()
{
const
{
onChange
,
options
,
label
,
disabled
,
value
,
json
,
otherProps
}
=
this
.
props
;
// console.log(props);
let
opt
=
options
&&
Array
.
isArray
(
options
)
&&
options
.
map
((
x
)
=>
{
return
{
label
:
x
.
label
,
value
:
x
.
value
,
children
:
getItemChildren
(
x
.
children
,
x
),
};
});
return
(
<
div
className=
{
styles
.
mobileFormInput
}
>
<
Picker
data=
{
opt
||
[]
}
cascade=
{
true
}
// cols={1}
disabled=
{
disabled
}
value=
{
value
}
extra=
{
disabled
?
''
:
json
.
placeholder
||
'点击选择'
}
onChange=
{
(
val
)
=>
{
console
.
log
(
val
);
onChange
(
val
||
undefined
);
}
}
{
...
otherProps
?
.
props
}
>
<
List
.
Item
arrow=
{
disabled
?
''
:
'horizontal'
}
>
{
/*{label}*/
}
</
List
.
Item
>
</
Picker
>
</
div
>
);
}
}
//
//
// export default function MobileCascader(props) { // 级联选择
//
// }
one_stop_public/tableComponV2/CascaderDiy/styles.less
0 → 100644
浏览文件 @
ffbd331a
.mobileFormInput {
border-bottom: 1px solid #eee;
:global {
.am-input-label,
.am-textarea-label,
.am-list-content {
white-space: pre-line !important;
font-size: 14px !important;
}
.am-list-item.am-input-item {
height: auto;
}
//.am-list-item .am-list-line .am-list-content{
// padding-left: 15px;
//}
.am-list-item {
padding-left: 0;
}
.am-list-item .am-list-line {
padding-right: 0;
}
.am-list-extra {
flex-basis: 100% !important;
font-size: 14px !important;
}
.am-list-item .am-input-control input {
text-align: right;
}
.am-list-item
.am-input-control
.fake-input-container
.fake-input-placeholder {
font-size: 14px;
}
}
input,
textarea {
font-size: 14px !important;
}
}
.mobileFormItem {
margin-bottom: 0px !important;
:global {
.ant-form-item-label {
/*隐藏手机端 字段的label 使用 antd-mobile 替代*/
display: inline !important;
height: 1px !important;
}
}
}
.viewDetail {
display: grid;
justify-content: start;
align-items: center;
width: 100%;
grid-template-columns: 15% 35% 15% 35%;
.title {
padding: 15px;
margin: -1px;
background-color: #fafafa;
border: 1px solid #eee;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.name {
margin: -1px;
padding: 15px;
background-color: #fff;
border: 1px solid #eee;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
.viewDetailMobile {
display: grid;
justify-content: start;
align-items: center;
width: 100%;
grid-template-columns: 35% 65%;
border: 1px solid #eee;
margin-top: -1px;
.title {
padding: 15px;
margin-bottom: 0;
//margin: -1px;
background-color: #fafafa;
//overflow: hidden;
//white-space: nowrap;
//text-overflow: ellipsis;
}
.name {
//margin: -1px;
padding: 15px;
background-color: #fff;
//overflow: hidden;
//white-space: nowrap;
//text-overflow: ellipsis;
}
}
one_stop_public/tableComponV2/FormModal.jsx
0 → 100644
浏览文件 @
ffbd331a
import
React
,
{
Children
}
from
'react'
;
import
{
Button
,
Form
,
Input
,
InputNumber
,
Modal
,
Select
}
from
'antd'
;
export
default
class
FormModal
extends
React
.
Component
{
render
()
{
// console.log(this.props);
return
(
<
Modal
destroyOnClose
title=
{
this
.
props
.
title
}
maskClosable=
{
false
}
width=
{
this
.
props
.
width
}
height=
{
this
.
props
.
height
}
visible=
{
this
.
props
.
visible
}
footer=
{
null
}
onCancel=
{
this
.
props
.
handleCancel
}
>
{
this
.
props
.
children
}
</
Modal
>
);
}
}
one_stop_public/tableComponV2/MobileItem.jsx
0 → 100644
浏览文件 @
ffbd331a
/**
* @file 移动端 Row,Col二次封装
*/
import
React
,
{
Component
}
from
'react'
;
import
{
Form
}
from
'antd'
;
export
default
class
MobileItem
extends
Component
{
render
()
{
const
{
isPreview
}
=
this
.
props
;
return
(
<
Form
.
Item
{
...
this
.
props
}
className=
{
isPreview
?
'isPreview'
:
null
}
label=
{
isPreview
?
this
.
props
.
label
:
this
.
props
.
label
+
'::'
}
/>
);
}
}
one_stop_public/tableComponV2/Split_Index/staticInfo.jsx
0 → 100644
浏览文件 @
ffbd331a
import
{
message
}
from
"antd"
;
import
baseX
from
"base-x"
;
import
moment
from
"moment"
;
import
{
isNaN
}
from
"lodash"
;
import
React
from
'react'
;
import
config
from
"@/webPublic/one_stop_public/config"
;
const
codeMessage
=
{
200
:
'服务器成功返回请求的数据。'
,
201
:
'新建或修改数据成功。'
,
202
:
'一个请求已经进入后台排队(异步任务)。'
,
204
:
'删除数据成功。'
,
400
:
'发出的请求有错误,服务器没有进行新建或修改数据的操作。'
,
401
:
'登录已过期,请重新登录'
,
403
:
'用户得到授权,但是访问是被禁止的。'
,
404
:
'发出的请求针对的是不存在的记录,服务器没有进行操作。'
,
406
:
'请求的格式不可得。'
,
410
:
'请求的资源被永久删除,且不会再得到的。'
,
422
:
'当创建一个对象时,发生一个验证错误。'
,
500
:
'服务器发生错误,请检查服务器。'
,
502
:
'网关错误。'
,
503
:
'服务不可用,服务器暂时过载或维护。'
,
504
:
'网关超时。'
,
};
const
errorHandler
=
(
error
)
=>
{
const
{
response
}
=
error
;
if
(
response
&&
response
.
status
)
{
const
errorText
=
codeMessage
[
response
.
status
]
||
response
.
statusText
;
message
.
error
(
`请求错误
${
errorText
}
`
);
if
(
response
.
status
===
401
)
{
return
window
.
g_app
.
_store
.
dispatch
({
type
:
'login/loginout'
,
});
}
}
else
{
message
.
error
(
`网络故障,请检查网络链接或联系管理员`
);
}
};
const
Bs64
=
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
;
const
base64
=
baseX
(
Bs64
);
export
function
getBase64
(
value
)
{
return
value
?
base64
.
encode
(
new
Buffer
(
value
))
:
null
;
}
const
equal
=
(
obj1
,
obj2
,
json
,
sqlContent
,
depth
,
props
,
excludeKeys
)
=>
{
if
(
obj1
==
null
&&
obj2
!=
null
)
{
return
false
;
}
if
(
obj1
!=
null
&&
obj2
==
null
)
{
return
false
;
}
if
(
obj1
==
null
&&
obj2
==
null
)
{
return
true
;
}
if
(
obj1
instanceof
Date
)
{
if
(
obj1
.
valueOf
()
!=
obj2
.
valueOf
())
{
return
false
;
}
}
else
if
(
obj1
instanceof
moment
)
{
if
(
obj1
.
valueOf
()
!=
obj2
.
valueOf
())
{
return
false
;
}
}
else
if
(
typeof
obj1
==
'function'
)
{
if
(
obj1
.
toString
()
!=
obj2
.
toString
())
{
return
false
;
}
}
const
keys
=
new
Set
();
if
(
obj2
!=
null
)
{
Object
.
keys
(
obj2
).
forEach
(
k
=>
{
if
(
k
!=
''
)
keys
.
add
(
k
);
});
}
if
(
obj1
!=
null
)
{
Object
.
keys
(
obj1
).
forEach
(
k
=>
{
if
(
k
!=
''
)
keys
.
add
(
k
);
});
}
let
res
=
true
;
for
(
let
key
of
keys
)
{
if
(
key
==
''
)
{
continue
;
}
if
(
excludeKeys
.
includes
(
key
))
{
continue
;
}
if
(
obj1
[
key
]
==
null
&&
obj2
[
key
]
!=
null
)
{
res
=
false
;
break
;
}
if
(
obj1
[
key
]
!=
null
&&
obj2
[
key
]
==
null
)
{
res
=
false
;
break
;
}
if
(
depth
==
1
&&
((
props
.
json
.
sqlKey
==
null
&&
sqlContent
==
null
&&
json
.
formula
==
null
&&
json
.
funcs
==
null
)
||
(
sqlContent
!=
null
&&
sqlContent
.
indexOf
(
key
)
==
-
1
)
||
(
json
.
formula
!=
null
&&
json
.
formula
.
indexOf
(
key
)
==
-
1
&&
json
.
funcs
!=
null
&&
json
.
funcs
.
indexOf
(
key
)
==
-
1
))
)
{
excludeKeys
.
push
(
key
);
continue
;
}
if
(
obj1
[
key
]
==
null
&&
obj2
[
key
]
==
null
)
{
continue
;
}
if
(
isNaN
(
obj1
[
key
])
&&
isNaN
(
obj2
[
key
]))
{
continue
;
}
if
(
obj1
[
key
]
instanceof
Array
)
{
if
(
obj1
[
key
].
length
!=
obj2
[
key
].
length
)
{
res
=
false
;
break
;
}
else
{
var
xx
=
true
;
for
(
var
i
=
0
;
i
<
obj1
[
key
].
length
;
i
++
)
{
if
(
!
equal
(
obj1
[
key
][
i
],
obj2
[
key
][
i
],
json
,
sqlContent
,
depth
+
1
,
props
,
excludeKeys
))
{
xx
=
false
;
break
;
}
}
if
(
!
xx
)
{
res
=
false
;
break
;
}
}
}
else
if
(
obj1
[
key
]
instanceof
Object
)
{
const
x
=
equal
(
obj1
[
key
],
obj2
[
key
],
json
,
sqlContent
,
depth
+
1
,
props
,
excludeKeys
);
if
(
!
x
)
{
res
=
false
;
break
;
}
}
else
if
(
typeof
obj1
[
key
]
==
'function'
)
{
if
(
obj1
[
key
].
toString
()
!=
obj2
[
key
].
toString
())
{
res
=
false
;
break
;
}
}
else
{
if
(
obj1
[
key
]
!=
obj2
[
key
])
{
res
=
false
;
break
;
}
}
}
return
res
;
};
const
getRender
=
(
com
,
props
)
=>
{
if
(
com
==
'p'
)
return
<
p
{
...
props
}
/>;
if
(
com
==
'ul'
)
return
<
ul
{
...
props
}
/>;
if
(
com
==
'li'
)
return
<
li
{
...
props
}
/>;
if
(
com
==
'video'
)
return
<
video
{
...
props
}
/>;
if
(
com
==
'span'
)
return
<
span
{
...
props
}
/>;
if
(
com
==
'a'
)
return
<
a
{
...
props
}
/>;
if
(
com
==
'div'
)
return
<
div
{
...
props
}
/>;
if
(
com
==
'canvas'
)
return
<
canvas
{
...
props
}
/>;
if
(
com
==
'iframe'
)
return
<
iframe
{
...
props
}
/>;
if
(
com
==
'img'
)
{
const
src
=
props
.
src
!=
null
?
props
.
src
.
indexOf
(
'http'
)
>
-
1
?
props
.
src
:
config
.
httpServer
+
props
.
src
:
null
;
const
pp
=
{
...
props
,
src
:
src
};
return
<
img
{
...
pp
}
/>;
}
};
/**
* 判断传入值是否为JSON文本
*/
const
isJSON
=
str
=>
{
if
(
typeof
str
==
'string'
)
{
try
{
var
obj
=
JSON
.
parse
(
str
);
if
(
typeof
obj
==
'object'
&&
obj
)
{
return
true
;
}
else
{
return
false
;
}
}
catch
(
e
)
{
console
.
log
(
'error:'
+
str
+
'!!!'
+
e
);
return
false
;
}
}
};
export
{
errorHandler
,
equal
,
getRender
,
isJSON
};
one_stop_public/tableComponV2/index.jsx
0 → 100644
浏览文件 @
ffbd331a
This source diff could not be displayed because it is too large. You can
view the blob
instead.
one_stop_public/tableComponV2/style.less
0 → 100644
浏览文件 @
ffbd331a
:global {
// table{
// border-collapse:collapse;
// }
#web_table .ant-form-item {
margin-bottom: 2.5px;
margin-top: 2.5px;
}
/*#web_table .ant-form-item-control{
line-height: 20px;
}*/
#mobile_table .am-list-item {
//background-color: rgba(238, 238, 238, 0.801);
border-radius: 4px;
}
// 移动端单选无法换行
#mobile_table .ant-radio-wrapper {
white-space: inherit;
}
#mobile_table .ant-form-item-label.ant-col-0,
#mobile_table .ant-form-item-control-wrapper.ant-col-0 {
width: 0%;
}
#mobile_table .ant-form-item-label.ant-col-1,
#mobile_table .ant-form-item-control-wrapper.ant-col-1 {
width: 4.16666667%;
}
#mobile_table .ant-form-item-label.ant-col-2,
#mobile_table .ant-form-item-control-wrapper.ant-col-2 {
width: 8.33333333%;
}
#mobile_table .ant-form-item-label.ant-col-3,
#mobile_table .ant-form-item-control-wrapper.ant-col-3 {
width: 12.5%;
}
#mobile_table .ant-form-item-label.ant-col-4,
#mobile_table .ant-form-item-control-wrapper.ant-col-4 {
width: 16.66666667%;
}
#mobile_table .ant-form-item-label.ant-col-5,
#mobile_table .ant-form-item-control-wrapper.ant-col-5 {
width: 20.83333333%;
}
#mobile_table .ant-form-item-label.ant-col-6,
#mobile_table .ant-form-item-control-wrapper.ant-col-6 {
width: 25%;
}
#mobile_table .ant-form-item-label.ant-col-7,
#mobile_table .ant-form-item-control-wrapper.ant-col-7 {
width: 29.16666667%;
}
#mobile_table .ant-form-item-label.ant-col-8,
#mobile_table .ant-form-item-control-wrapper.ant-col-8 {
width: 33.33333333%;
}
#mobile_table .ant-form-item-label.ant-col-9,
#mobile_table .ant-form-item-control-wrapper.ant-col-9 {
width: 37.5%;
}
#mobile_table .ant-form-item-label.ant-col-10,
#mobile_table .ant-form-item-control-wrapper.ant-col-10 {
width: 41.66666667%;
}
#mobile_table .ant-form-item-label.ant-col-11,
#mobile_table .ant-form-item-control-wrapper.ant-col-11 {
width: 45.83333333%;
}
#mobile_table .ant-form-item-label.ant-col-12,
#mobile_table .ant-form-item-control-wrapper.ant-col-12 {
width: 50%;
}
#mobile_table .ant-form-item-label.ant-col-13,
#mobile_table .ant-form-item-control-wrapper.ant-col-13 {
width: 54.16666667%;
}
#mobile_table .ant-form-item-label.ant-col-14,
#mobile_table .ant-form-item-control-wrapper.ant-col-14 {
width: 58.33333333%;
}
#mobile_table .ant-form-item-label.ant-col-15,
#mobile_table .ant-form-item-control-wrapper.ant-col-15 {
width: 62.5%;
}
#mobile_table .ant-form-item-label.ant-col-16,
#mobile_table .ant-form-item-control-wrapper.ant-col-16 {
width: 66.66666667%;
}
#mobile_table .ant-form-item-label.ant-col-17,
#mobile_table .ant-form-item-control-wrapper.ant-col-17 {
width: 70.83333333%;
}
#mobile_table .ant-form-item-label.ant-col-18,
#mobile_table .ant-form-item-control-wrapper.ant-col-18 {
width: 75%;
}
#mobile_table .ant-form-item-label.ant-col-19,
#mobile_table .ant-form-item-control-wrapper.ant-col-19 {
width: 79.16666667%;
}
#mobile_table .ant-form-item-label.ant-col-20,
#mobile_table .ant-form-item-control-wrapper.ant-col-20 {
width: 83.33333333%;
}
#mobile_table .ant-form-item-label.ant-col-21,
#mobile_table .ant-form-item-control-wrapper.ant-col-21 {
width: 87.5%;
}
#mobile_table .ant-form-item-label.ant-col-22,
#mobile_table .ant-form-item-control-wrapper.ant-col-22 {
width: 91.66666667%;
}
#mobile_table .ant-form-item-label.ant-col-23,
#mobile_table .ant-form-item-control-wrapper.ant-col-23 {
width: 95.83333333%;
}
#mobile_table .ant-form-item-label.ant-col-24,
#mobile_table .ant-form-item-control-wrapper.ant-col-24 {
width: 100%;
}
#mobile_table .ant-col-24 {
border-bottom: 1px solid white;
}
#mobile_table .am-textarea-control textarea {
background-color: #f5f5f5d3;
}
#mobile_table > .am-card {
min-height: 0;
}
#mobile_table .ant-form-item {
margin-bottom: 0px;
background: white;
overflow: auto;
scrollbar-width: none; /* Firefox */
-ms-overflow-style: none; /* IE 10+ */
&::-webkit-scrollbar {
display: none;
}
}
#mobile_table .am-checkbox-agree .am-checkbox-inner {
left: -30px;
top: 1px;
}
#mobile_table .ant-form-item-label {
padding-top: 9px;
text-align: right;
font-weight: bold;
}
#mobile_table .isPreview > .ant-form-item-label {
padding-top: 0px;
}
#MobileList .am-list-item {
background-color: #fff;
border-radius: 4px;
}
#mobile_table .am-list-item .am-input-label {
overflow: auto;
scrollbar-width: none; /* Firefox */
-ms-overflow-style: none; /* IE 10+ */
&::-webkit-scrollbar {
display: none;
}
}
#mobile_table .ant-form-item-label {
overflow: auto;
// scrollbar-width: none; /* Firefox */
// -ms-overflow-style: none; /* IE 10+ */
// &::-webkit-scrollbar {display:none}
}
#mobile_table .am-flexbox {
padding-left: 25px;
.am-checkbox-agree {
padding-top: 0px;
}
}
#mobile_table .am-list-extra {
flex-basis: 60%;
overflow: auto;
scrollbar-width: none; /* Firefox */
-ms-overflow-style: none; /* IE 10+ */
&::-webkit-scrollbar {
display: none;
}
}
}
.form input {
font-size: 14px !important;
line-height: 28px !important;
padding-left: 29px !important;
background-color: #ccc;
}
.text {
display: inline-block;
font-size: 14px;
line-height: 28px;
text-align: right;
font-family: PingFang-SC-Regular;
}
.placeholder {
font-size: 14px;
}
.text2 {
width: 72px;
display: inline-block;
font-size: 16px;
line-height: 28px;
text-align: left;
font-weight: bold;
font-family: PingFang-SC-Regular;
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论