Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
f0d23696
提交
f0d23696
authored
4月 14, 2020
作者:
wanyielin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
判断必选
上级
9130b850
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
362 行增加
和
374 行删除
+362
-374
index.jsx
one_stop_public/Table/index.jsx
+151
-149
TableSelect.js
one_stop_public/libs/TableSelect.js
+48
-57
index.jsx
one_stop_public/tableCompon/index.jsx
+163
-168
没有找到文件。
one_stop_public/Table/index.jsx
浏览文件 @
f0d23696
...
@@ -5,14 +5,14 @@
...
@@ -5,14 +5,14 @@
*/
*/
import
React
,
{
Component
}
from
'react'
import
React
,
{
Component
}
from
'react'
import
{
Form
}
from
'antd'
;
import
{
Form
}
from
'antd'
;
import
{
Row
,
Col
,
Input
,
message
}
from
'antd'
import
{
Row
,
Col
,
Input
,
message
}
from
'antd'
import
TableCom
from
'../tableCompon'
import
TableCom
from
'../tableCompon'
import
{
Toast
}
from
'antd-mobile'
import
{
Toast
}
from
'antd-mobile'
import
router
from
'umi/router'
import
router
from
'umi/router'
import
{
formulaList
}
from
'../excelInitFuc/functionList'
;
import
{
formulaList
}
from
'../excelInitFuc/functionList'
;
import
IsNewTable
from
'./isNewTable'
;
import
IsNewTable
from
'./isNewTable'
;
export
default
class
ZdyTable
extends
Component
{
export
default
class
ZdyTable
extends
Component
{
constructor
(
props
){
constructor
(
props
)
{
super
(
props
)
super
(
props
)
this
.
state
=
{
this
.
state
=
{
...
@@ -20,32 +20,32 @@ export default class ZdyTable extends Component {
...
@@ -20,32 +20,32 @@ export default class ZdyTable extends Component {
left
:
0
,
left
:
0
,
top
:
0
,
top
:
0
,
max
:
4
,
max
:
4
,
formId
:
null
,
formId
:
null
,
formCode
:
null
,
formCode
:
null
,
width
:
100
,
width
:
100
,
mapData
:{},
mapData
:
{},
defaultBinds
:{},
defaultBinds
:
{},
sqlData
:{},
sqlData
:
{},
defaultValues
:{},
defaultValues
:
{},
currentFormKey
:
null
,
currentFormKey
:
null
,
items
:[],
items
:
[],
init
:
this
.
props
.
init
||
{},
init
:
this
.
props
.
init
||
{},
datas
:{},
datas
:
{},
isEdit
:
true
,
isEdit
:
true
,
isReady
:
false
,
isReady
:
false
,
formConfig
:{},
formConfig
:
{},
}
}
}
}
componentDidMount
(){
componentDidMount
()
{
if
(
!
window
.
functionObj
)
{
// 检查是否注册
if
(
!
window
.
functionObj
)
{
// 检查是否注册
/**
/**
* 注册全局函数集
* 注册全局函数集
* 动态生成表单配置函数所使用
* 动态生成表单配置函数所使用
*/
*/
let
functionObj
=
{}
let
functionObj
=
{}
formulaList
.
map
(
item
=>
{
formulaList
.
map
(
item
=>
{
item
.
children
.
map
(
arr
=>
{
item
.
children
.
map
(
arr
=>
{
functionObj
[
arr
.
callKey
]
=
arr
.
function
functionObj
[
arr
.
callKey
]
=
arr
.
function
})
})
})
})
...
@@ -57,25 +57,25 @@ export default class ZdyTable extends Component {
...
@@ -57,25 +57,25 @@ export default class ZdyTable extends Component {
isForm
,
isForm
,
isPreview
,
// 是否为预览模式
isPreview
,
// 是否为预览模式
isChild
,
// 是否为子表单
isChild
,
// 是否为子表单
isQRCode
=
false
,
// 是否为二维码快捷发起
isQRCode
=
false
,
// 是否为二维码快捷发起
formDeafault
=
''
,
// 为二维码快捷发起默认值
formDeafault
=
''
,
// 为二维码快捷发起默认值
}
=
this
.
props
}
=
this
.
props
if
(
isPreview
||
isChild
)
{
if
(
isPreview
||
isChild
)
{
this
.
setState
({
...
this
.
state
,...
this
.
props
,
isReady
:
true
})
this
.
setState
({
...
this
.
state
,
...
this
.
props
,
isReady
:
true
})
return
return
}
}
let
val
=
postData
let
val
=
postData
try
{
try
{
/**
/**
* 数据源不同进行以下区别处理
* 数据源不同进行以下区别处理
* this.props.table有传入值表明需要渲染流程中最新表单
* this.props.table有传入值表明需要渲染流程中最新表单
*/
*/
if
(
isForm
)
{
// 由表格的操作按钮进入
if
(
isForm
)
{
// 由表格的操作按钮进入
const
mapData
=
{};
const
mapData
=
{};
const
sqlData
=
{}
const
sqlData
=
{}
const
dataObjs
=
val
.
form
.
dataObjModels
;
const
dataObjs
=
val
.
form
.
dataObjModels
;
for
(
var
i
=
0
;
i
<
dataObjs
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
dataObjs
.
length
;
i
++
)
{
const
dob
=
dataObjs
[
i
];
const
dob
=
dataObjs
[
i
];
...
@@ -93,26 +93,26 @@ export default class ZdyTable extends Component {
...
@@ -93,26 +93,26 @@ export default class ZdyTable extends Component {
const
obj
=
JSON
.
parse
(
val
.
form
.
content
);
const
obj
=
JSON
.
parse
(
val
.
form
.
content
);
const
xxx
=
obj
.
datas
[
obj
.
init
];
const
xxx
=
obj
.
datas
[
obj
.
init
];
this
.
setState
({
this
.
setState
({
datas
:
obj
.
datas
,
datas
:
obj
.
datas
,
width
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
width
:
xxx
.
width
,
width
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
width
:
xxx
.
width
,
isBorder
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
isBorder
:
xxx
.
isBorder
,
isBorder
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
isBorder
:
xxx
.
isBorder
,
mapData
,
mapData
,
currentFormKey
:
this
.
props
.
table
?
val
.
formKey
:
obj
.
init
,
currentFormKey
:
this
.
props
.
table
?
val
.
formKey
:
obj
.
init
,
sqlData
,
sqlData
,
isEdit
:
this
.
props
.
formKey
?
false
:
true
,
isEdit
:
this
.
props
.
formKey
?
false
:
true
,
items
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
items
:
xxx
.
items
,
items
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
items
:
xxx
.
items
,
defaultValues
:
val
.
form
.
defaultValues
,
defaultValues
:
val
.
form
.
defaultValues
,
appId
:
val
.
appId
,
appId
:
val
.
appId
,
isReady
:
true
,
isReady
:
true
,
formConfig
:
xxx
formConfig
:
xxx
});
});
return
return
}
}
if
(
isCg
===
'yes'
)
{
// 用户从编辑按钮进入
if
(
isCg
===
'yes'
)
{
// 用户从编辑按钮进入
if
(
val
.
unifiedServicePatternModel
.
isDefaultError
!=
null
&&
val
.
unifiedServicePatternModel
.
isDefaultError
)
{
if
(
val
.
unifiedServicePatternModel
.
isDefaultError
!=
null
&&
val
.
unifiedServicePatternModel
.
isDefaultError
)
{
if
(
this
.
props
.
get
==
"web"
)
{
if
(
this
.
props
.
get
==
"web"
)
{
message
.
error
(
"当前办理人数较多,服务繁忙,请稍后再试!"
)
message
.
error
(
"当前办理人数较多,服务繁忙,请稍后再试!"
)
}
else
{
}
else
{
Toast
.
fail
(
"当前办理人数较多,服务繁忙,请稍后再试!"
)
Toast
.
fail
(
"当前办理人数较多,服务繁忙,请稍后再试!"
)
}
}
...
@@ -120,7 +120,7 @@ export default class ZdyTable extends Component {
...
@@ -120,7 +120,7 @@ export default class ZdyTable extends Component {
return
;
return
;
}
}
const
mapData
=
{};
const
mapData
=
{};
const
sqlData
=
{};
const
sqlData
=
{};
const
sqls
=
val
.
unifiedServicePatternModel
.
sqlModels
const
sqls
=
val
.
unifiedServicePatternModel
.
sqlModels
for
(
var
i
=
0
;
i
<
sqls
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
sqls
.
length
;
i
++
)
{
const
dob
=
sqls
[
i
].
dataObjModel
;
const
dob
=
sqls
[
i
].
dataObjModel
;
...
@@ -141,26 +141,26 @@ export default class ZdyTable extends Component {
...
@@ -141,26 +141,26 @@ export default class ZdyTable extends Component {
const
xxx
=
obj
.
datas
[
obj
.
init
];
const
xxx
=
obj
.
datas
[
obj
.
init
];
this
.
setState
({
this
.
setState
({
items
:
xxx
.
items
,
items
:
xxx
.
items
,
init
:
{...
this
.
state
.
init
,...
JSON
.
parse
(
val
.
content
)
},
init
:
{
...
this
.
state
.
init
,
...
JSON
.
parse
(
val
.
content
)
},
datas
:
obj
.
datas
,
datas
:
obj
.
datas
,
isEdit
:
this
.
props
.
formKey
?
false
:
true
,
isEdit
:
this
.
props
.
formKey
?
false
:
true
,
currentFormKey
:
obj
.
init
,
currentFormKey
:
obj
.
init
,
width
:
xxx
.
width
,
width
:
xxx
.
width
,
isBorder
:
xxx
.
isBorder
,
isBorder
:
xxx
.
isBorder
,
mapData
,
sqlData
,
mapData
,
sqlData
,
defaultValues
:
val
.
unifiedServicePatternModel
.
defaultValues
,
defaultValues
:
val
.
unifiedServicePatternModel
.
defaultValues
,
appId
:
val
.
appId
,
appId
:
val
.
appId
,
isReady
:
true
,
isReady
:
true
,
formConfig
:
xxx
,
formConfig
:
xxx
,
defaultBinds
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
defaultBinds
:
xxx
.
defaultBinds
,
defaultBinds
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
defaultBinds
:
xxx
.
defaultBinds
,
});
});
return
return
}
}
if
(
val
.
unifiedServicePatternModel
.
isDefaultError
!=
null
&&
val
.
unifiedServicePatternModel
.
isDefaultError
)
{
if
(
val
.
unifiedServicePatternModel
.
isDefaultError
!=
null
&&
val
.
unifiedServicePatternModel
.
isDefaultError
)
{
if
(
this
.
props
.
get
==
"web"
)
{
if
(
this
.
props
.
get
==
"web"
)
{
message
.
error
(
"当前办理人数较多,服务繁忙,请稍后再试!"
)
message
.
error
(
"当前办理人数较多,服务繁忙,请稍后再试!"
)
}
else
{
}
else
{
Toast
.
fail
(
"当前办理人数较多,服务繁忙,请稍后再试!"
)
Toast
.
fail
(
"当前办理人数较多,服务繁忙,请稍后再试!"
)
}
}
...
@@ -168,7 +168,7 @@ export default class ZdyTable extends Component {
...
@@ -168,7 +168,7 @@ export default class ZdyTable extends Component {
return
;
return
;
}
}
const
mapData
=
{};
const
mapData
=
{};
const
sqlData
=
{};
const
sqlData
=
{};
const
sqls
=
val
.
unifiedServicePatternModel
.
sqlModels
const
sqls
=
val
.
unifiedServicePatternModel
.
sqlModels
for
(
var
i
=
0
;
i
<
sqls
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
sqls
.
length
;
i
++
)
{
const
dob
=
sqls
[
i
].
dataObjModel
;
const
dob
=
sqls
[
i
].
dataObjModel
;
...
@@ -189,34 +189,34 @@ export default class ZdyTable extends Component {
...
@@ -189,34 +189,34 @@ export default class ZdyTable extends Component {
const
xxx
=
obj
.
datas
[
this
.
props
.
formKey
?
this
.
props
.
formKey
:
obj
.
init
];
// 是否是存在历史表单传入值
const
xxx
=
obj
.
datas
[
this
.
props
.
formKey
?
this
.
props
.
formKey
:
obj
.
init
];
// 是否是存在历史表单传入值
this
.
setState
({
this
.
setState
({
appId
:
val
.
id
,
appId
:
val
.
id
,
formId
:
val
.
id
,
formId
:
val
.
id
,
formCode
:
val
.
code
,
formCode
:
val
.
code
,
datas
:
obj
.
datas
,
datas
:
obj
.
datas
,
mapData
,
sqlData
,
mapData
,
sqlData
,
defaultValues
:
val
.
unifiedServicePatternModel
.
defaultValues
,
defaultValues
:
val
.
unifiedServicePatternModel
.
defaultValues
,
isEdit
:
this
.
props
.
formKey
?
false
:
true
,
isEdit
:
this
.
props
.
formKey
?
false
:
true
,
currentFormKey
:
this
.
props
.
formKey
?
this
.
props
.
formKey
:
val
.
taskFormKey
?
val
.
taskFormKey
:
obj
.
init
,
currentFormKey
:
this
.
props
.
formKey
?
this
.
props
.
formKey
:
val
.
taskFormKey
?
val
.
taskFormKey
:
obj
.
init
,
defaultBinds
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
defaultBinds
:
xxx
.
defaultBinds
,
defaultBinds
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
defaultBinds
:
xxx
.
defaultBinds
,
width
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
width
:
xxx
.
width
,
width
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
width
:
xxx
.
width
,
isBorder
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
isBorder
:
xxx
.
isBorder
,
isBorder
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
isBorder
:
xxx
.
isBorder
,
items
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
items
:
xxx
.
items
,
items
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
items
:
xxx
.
items
,
isReady
:
true
,
isReady
:
true
,
init
:
{...
this
.
state
.
init
,...
val
.
isSecond
?
this
.
props
.
obj
:{}
},
init
:
{
...
this
.
state
.
init
,
...
val
.
isSecond
?
this
.
props
.
obj
:
{}
},
formConfig
:
xxx
formConfig
:
xxx
// init:this.props.get==="mobile"?!!val.content?JSON.parse(val.content):'':{},// 移动端默认值设置
// init:this.props.get==="mobile"?!!val.content?JSON.parse(val.content):'':{},// 移动端默认值设置
},()
=>
{
},
()
=>
{
/**
/**
* 为二维码快捷发起时自动设置新默认值
* 为二维码快捷发起时自动设置新默认值
*/
*/
if
(
isQRCode
)
{
if
(
isQRCode
)
{
this
.
props
.
form
.
setFieldsValue
(
formDeafault
)
this
.
props
.
form
.
setFieldsValue
(
formDeafault
)
}
}
});
});
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
`公式配置有误`
,
e
)
console
.
log
(
`公式配置有误`
,
e
)
}
}
}
}
componentWillReceiveProps
(
nextProps
){
componentWillReceiveProps
(
nextProps
)
{
let
{
let
{
postData
,
// 数据源
postData
,
// 数据源
isCg
,
// 用户点击草稿页面进入
isCg
,
// 用户点击草稿页面进入
...
@@ -224,21 +224,21 @@ export default class ZdyTable extends Component {
...
@@ -224,21 +224,21 @@ export default class ZdyTable extends Component {
isPreview
,
// 是否为预览模式
isPreview
,
// 是否为预览模式
isChild
,
// 是否为子表单
isChild
,
// 是否为子表单
}
=
nextProps
}
=
nextProps
if
(
isPreview
||
isChild
)
{
if
(
isPreview
||
isChild
)
{
this
.
setState
({
...
this
.
state
,...
this
.
props
,
isReady
:
true
})
this
.
setState
({
...
this
.
state
,
...
this
.
props
,
isReady
:
true
})
return
return
}
}
try
{
try
{
let
val
=
postData
let
val
=
postData
/**
/**
* 数据源不同进行以下区别处理
* 数据源不同进行以下区别处理
* this.props.table有传入值表明需要渲染流程中最新表单
* this.props.table有传入值表明需要渲染流程中最新表单
*/
*/
if
(
isForm
)
{
// 由表格的操作按钮进入
if
(
isForm
)
{
// 由表格的操作按钮进入
const
mapData
=
{};
const
mapData
=
{};
const
sqlData
=
{}
const
sqlData
=
{}
const
dataObjs
=
val
.
form
.
dataObjModels
;
const
dataObjs
=
val
.
form
.
dataObjModels
;
for
(
var
i
=
0
;
i
<
dataObjs
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
dataObjs
.
length
;
i
++
)
{
const
dob
=
dataObjs
[
i
];
const
dob
=
dataObjs
[
i
];
...
@@ -256,24 +256,24 @@ export default class ZdyTable extends Component {
...
@@ -256,24 +256,24 @@ export default class ZdyTable extends Component {
const
obj
=
JSON
.
parse
(
val
.
form
.
content
);
const
obj
=
JSON
.
parse
(
val
.
form
.
content
);
const
xxx
=
obj
.
datas
[
obj
.
init
];
const
xxx
=
obj
.
datas
[
obj
.
init
];
this
.
setState
({
this
.
setState
({
datas
:
obj
.
datas
,
datas
:
obj
.
datas
,
width
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
width
:
xxx
.
width
,
width
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
width
:
xxx
.
width
,
isBorder
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
isBorder
:
xxx
.
isBorder
,
isBorder
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
isBorder
:
xxx
.
isBorder
,
mapData
,
mapData
,
currentFormKey
:
this
.
props
.
table
?
val
.
formKey
:
obj
.
init
,
currentFormKey
:
this
.
props
.
table
?
val
.
formKey
:
obj
.
init
,
sqlData
,
sqlData
,
isEdit
:
this
.
props
.
formKey
?
false
:
true
,
isEdit
:
this
.
props
.
formKey
?
false
:
true
,
items
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
items
:
xxx
.
items
,
items
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
items
:
xxx
.
items
,
defaultValues
:
val
.
form
.
defaultValues
,
defaultValues
:
val
.
form
.
defaultValues
,
appId
:
val
.
appId
,
appId
:
val
.
appId
,
isReady
:
true
,
isReady
:
true
,
formConfig
:
xxx
formConfig
:
xxx
});
});
return
return
}
}
if
(
isCg
===
'yes'
)
{
// 用户从编辑按钮进入
if
(
isCg
===
'yes'
)
{
// 用户从编辑按钮进入
const
mapData
=
{};
const
mapData
=
{};
const
sqlData
=
{};
const
sqlData
=
{};
const
sqls
=
val
.
unifiedServicePatternModel
.
sqlModels
const
sqls
=
val
.
unifiedServicePatternModel
.
sqlModels
for
(
var
i
=
0
;
i
<
sqls
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
sqls
.
length
;
i
++
)
{
const
dob
=
sqls
[
i
].
dataObjModel
;
const
dob
=
sqls
[
i
].
dataObjModel
;
...
@@ -294,23 +294,23 @@ export default class ZdyTable extends Component {
...
@@ -294,23 +294,23 @@ export default class ZdyTable extends Component {
const
xxx
=
obj
.
datas
[
obj
.
init
];
const
xxx
=
obj
.
datas
[
obj
.
init
];
this
.
setState
({
this
.
setState
({
items
:
xxx
.
items
,
items
:
xxx
.
items
,
init
:
{...
this
.
state
.
init
,...
JSON
.
parse
(
val
.
content
)
},
init
:
{
...
this
.
state
.
init
,
...
JSON
.
parse
(
val
.
content
)
},
datas
:
obj
.
datas
,
datas
:
obj
.
datas
,
isEdit
:
this
.
props
.
formKey
?
false
:
true
,
isEdit
:
this
.
props
.
formKey
?
false
:
true
,
currentFormKey
:
obj
.
init
,
currentFormKey
:
obj
.
init
,
width
:
xxx
.
width
,
width
:
xxx
.
width
,
isBorder
:
xxx
.
isBorder
,
isBorder
:
xxx
.
isBorder
,
mapData
,
sqlData
,
defaultValues
:
val
.
unifiedServicePatternModel
.
defaultValues
,
mapData
,
sqlData
,
defaultValues
:
val
.
unifiedServicePatternModel
.
defaultValues
,
appId
:
val
.
appId
,
appId
:
val
.
appId
,
isReady
:
true
,
isReady
:
true
,
formConfig
:
xxx
,
formConfig
:
xxx
,
defaultBinds
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
defaultBinds
:
xxx
.
defaultBinds
,
defaultBinds
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
defaultBinds
:
xxx
.
defaultBinds
,
});
});
return
return
}
}
const
mapData
=
{};
const
mapData
=
{};
const
sqlData
=
{};
const
sqlData
=
{};
const
sqls
=
val
.
unifiedServicePatternModel
.
sqlModels
const
sqls
=
val
.
unifiedServicePatternModel
.
sqlModels
for
(
var
i
=
0
;
i
<
sqls
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
sqls
.
length
;
i
++
)
{
const
dob
=
sqls
[
i
].
dataObjModel
;
const
dob
=
sqls
[
i
].
dataObjModel
;
...
@@ -328,23 +328,23 @@ export default class ZdyTable extends Component {
...
@@ -328,23 +328,23 @@ export default class ZdyTable extends Component {
}
}
}
}
const
obj
=
JSON
.
parse
(
val
.
unifiedServicePatternModel
.
content
);
const
obj
=
JSON
.
parse
(
val
.
unifiedServicePatternModel
.
content
);
const
xxx
=
obj
.
datas
[
this
.
props
.
formKey
?
this
.
props
.
formKey
:
obj
.
init
];
// 是否是存在历史表单传入值
const
xxx
=
obj
.
datas
[
this
.
props
.
formKey
?
this
.
props
.
formKey
:
obj
.
init
];
// 是否是存在历史表单传入值
this
.
setState
({
this
.
setState
({
appId
:
val
.
id
,
appId
:
val
.
id
,
datas
:
obj
.
datas
,
datas
:
obj
.
datas
,
mapData
,
sqlData
,
defaultValues
:
val
.
unifiedServicePatternModel
.
defaultValues
,
mapData
,
sqlData
,
defaultValues
:
val
.
unifiedServicePatternModel
.
defaultValues
,
isEdit
:
this
.
props
.
formKey
?
false
:
true
,
isEdit
:
this
.
props
.
formKey
?
false
:
true
,
currentFormKey
:
this
.
props
.
formKey
?
this
.
props
.
formKey
:
val
.
taskFormKey
?
val
.
taskFormKey
:
obj
.
init
,
currentFormKey
:
this
.
props
.
formKey
?
this
.
props
.
formKey
:
val
.
taskFormKey
?
val
.
taskFormKey
:
obj
.
init
,
defaultBinds
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
defaultBinds
:
xxx
.
defaultBinds
,
defaultBinds
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
defaultBinds
:
xxx
.
defaultBinds
,
width
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
width
:
xxx
.
width
,
width
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
width
:
xxx
.
width
,
isBorder
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
isBorder
:
xxx
.
isBorder
,
isBorder
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
isBorder
:
xxx
.
isBorder
,
items
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
items
:
xxx
.
items
,
items
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
items
:
xxx
.
items
,
isReady
:
true
,
isReady
:
true
,
init
:
{
...
this
.
state
.
init
,...
val
.
isSecond
?
this
.
props
.
obj
:{}
},
init
:
{
...
this
.
state
.
init
,
...
val
.
isSecond
?
this
.
props
.
obj
:
{}
},
formConfig
:
xxx
formConfig
:
xxx
// init:this.props.get==="mobile"?!!val.content?JSON.parse(val.content):'':{},// 移动端默认值设置
// init:this.props.get==="mobile"?!!val.content?JSON.parse(val.content):'':{},// 移动端默认值设置
});
});
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
`公式配置有误`
,
e
)
console
.
log
(
`公式配置有误`
,
e
)
}
}
}
}
...
@@ -371,16 +371,16 @@ export default class ZdyTable extends Component {
...
@@ -371,16 +371,16 @@ export default class ZdyTable extends Component {
}
}
render
()
{
render
()
{
let
{
width
,
isBorder
,
sqlData
,
mapData
,
defaultBinds
,
defaultValues
,
items
,
init
,
currentFormKey
,
isEdit
,
datas
,
isReady
,
formConfig
,
formCode
,
formId
}
=
this
.
state
let
{
width
,
isBorder
,
sqlData
,
mapData
,
defaultBinds
,
defaultValues
,
items
,
init
,
currentFormKey
,
isEdit
,
datas
,
isReady
,
formConfig
,
formCode
,
formId
}
=
this
.
state
let
{
border
,
get
,
obj
,
index
,
fatherCode
}
=
this
.
props
let
{
border
,
get
,
obj
,
index
,
fatherCode
}
=
this
.
props
let
style
=
{}
let
style
=
{}
if
(
formConfig
.
style
!=
null
)
{
if
(
formConfig
.
style
!=
null
)
{
try
{
try
{
style
=
JSON
.
parse
(
formConfig
.
style
)
style
=
JSON
.
parse
(
formConfig
.
style
)
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
e
)
console
.
log
(
e
)
style
=
{}
style
=
{}
}
}
}
}
...
@@ -395,22 +395,21 @@ export default class ZdyTable extends Component {
...
@@ -395,22 +395,21 @@ export default class ZdyTable extends Component {
},
},
};
};
const
max
=
this
.
countMax
(
items
)
const
max
=
this
.
countMax
(
items
)
const
borderStyle
=
{
const
borderStyle
=
{
borderRight
:
"1px solid gray"
,
borderTop
:
"1px solid gray"
,
borderLeft
:
"1px solid gray"
,
borderBottom
:
"1px solid gray"
borderRight
:
"1px solid gray"
,
borderTop
:
"1px solid gray"
,
borderLeft
:
"1px solid gray"
,
borderBottom
:
"1px solid gray"
}
}
const
borderStyleTwo
=
{
// 处理隐藏组件边框样式问题
const
borderStyleTwo
=
{
// 处理隐藏组件边框样式问题
borderRight
:
"1px solid gray"
,
borderLeft
:
"1px solid gray"
borderRight
:
"1px solid gray"
,
borderLeft
:
"1px solid gray"
}
}
const
styleDiv
=
this
.
props
.
height
?{
overflow
:
"auto"
,
width
:
"100%"
,
height
:
this
.
props
.
height
}:{
overflow
:
"auto"
,
width
:
"100%"
}
const
styleDiv
=
this
.
props
.
height
?
{
overflow
:
"auto"
,
width
:
"100%"
,
height
:
this
.
props
.
height
}
:
{
overflow
:
"auto"
,
width
:
"100%"
}
if
(
!
isReady
)
return
<></>
if
(
!
isReady
)
return
<></>
switch
(
get
)
{
switch
(
get
)
{
case
'web'
:
case
'web'
:
return
(
return
(
<
Form
<
Form
className=
"login-form"
>
className=
"login-form"
>
{
isEdit
&&
defaultBinds
?
Object
.
keys
(
defaultBinds
).
map
((
k
)
=>
{
{
isEdit
&&
defaultBinds
?
Object
.
keys
(
defaultBinds
).
map
((
k
)
=>
{
const
r
=
defaultBinds
[
k
]
const
r
=
defaultBinds
[
k
]
if
(
r
.
columnIds
==
null
||
r
.
columnIds
.
length
<
2
||
r
.
sqls
==
null
||
r
.
sqls
.
length
<
2
)
{
if
(
r
.
columnIds
==
null
||
r
.
columnIds
.
length
<
2
||
r
.
sqls
==
null
||
r
.
sqls
.
length
<
2
)
{
return
""
return
""
...
@@ -426,7 +425,7 @@ export default class ZdyTable extends Component {
...
@@ -426,7 +425,7 @@ export default class ZdyTable extends Component {
return
this
.
props
.
form
.
getFieldDecorator
(
name
,
{
return
this
.
props
.
form
.
getFieldDecorator
(
name
,
{
initialValue
:
value
initialValue
:
value
})(<
Input
type=
"hidden"
/>);
})(<
Input
type=
"hidden"
/>);
})
:
""
}
})
:
""
}
...
@@ -440,7 +439,8 @@ export default class ZdyTable extends Component {
...
@@ -440,7 +439,8 @@ export default class ZdyTable extends Component {
style=
{
{
style=
{
{
overflow
:
"auto"
,
overflow
:
"auto"
,
margin
:
max
*
width
>
550
?
"auto"
:
''
,
margin
:
max
*
width
>
550
?
"auto"
:
''
,
...
style
}
}
...
style
}
}
border=
{
border
}
border=
{
border
}
cellSpacing=
"0"
cellSpacing=
"0"
cellPadding=
"0"
>
cellPadding=
"0"
>
...
@@ -450,11 +450,11 @@ export default class ZdyTable extends Component {
...
@@ -450,11 +450,11 @@ export default class ZdyTable extends Component {
return
<
tr
key=
{
i
}
>
return
<
tr
key=
{
i
}
>
{
row
.
map
((
cell
,
j
)
=>
{
{
row
.
map
((
cell
,
j
)
=>
{
let
styles
=
{}
let
styles
=
{}
if
(
cell
.
content
&&
cell
.
content
.
styles
)
{
if
(
cell
.
content
&&
cell
.
content
.
styles
)
{
try
{
try
{
styles
=
JSON
.
parse
(
cell
.
content
.
styles
)
styles
=
JSON
.
parse
(
cell
.
content
.
styles
)
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
`第${i}行第${j}列样式配置有误,${e}`
)
console
.
log
(
`第${i}行第${j}列样式配置有误,${e}`
)
}
}
}
}
...
@@ -462,16 +462,16 @@ export default class ZdyTable extends Component {
...
@@ -462,16 +462,16 @@ export default class ZdyTable extends Component {
""
""
:
<
td
:
<
td
width=
{
width=
{
i
==
0
?
i
==
0
?
((
cell
.
content
!=
null
&&
cell
.
content
.
cwidth
!=
null
?
cell
.
content
.
cwidth
:
width
)
*
(
cell
.
col
?
cell
.
col
:
1
))
((
cell
.
content
!=
null
&&
cell
.
content
.
cwidth
!=
null
?
cell
.
content
.
cwidth
:
width
)
*
(
cell
.
col
?
cell
.
col
:
1
))
:
width
*
(
cell
.
col
?
cell
.
col
:
1
)
}
:
width
*
(
cell
.
col
?
cell
.
col
:
1
)
}
rowSpan=
{
cell
.
row
}
rowSpan=
{
cell
.
row
}
colSpan=
{
cell
.
col
}
colSpan=
{
cell
.
col
}
key=
{
j
}
key=
{
j
}
style=
{
{
style=
{
{
overflow
:
"auto"
,
overflow
:
"auto"
,
textAlign
:
cell
.
content
&&
cell
.
content
.
calign
?
cell
.
content
.
calign
:
"left"
,
textAlign
:
cell
.
content
&&
cell
.
content
.
calign
?
cell
.
content
.
calign
:
"left"
,
...
isBorder
?(
cell
?.
content
?.
comName
==
"InputHidden"
||!
cell
?.
content
?.
comName
?{}:
borderStyle
):
{},
...
isBorder
?
(
cell
?.
content
?.
comName
==
"InputHidden"
||
!
cell
?.
content
?.
comName
?
{}
:
borderStyle
)
:
{},
...
styles
...
styles
}
}
>
}
}
>
...
@@ -490,13 +490,14 @@ export default class ZdyTable extends Component {
...
@@ -490,13 +490,14 @@ export default class ZdyTable extends Component {
init=
{
init
}
init=
{
init
}
get=
{
get
}
// 区分移动端或wen端
get=
{
get
}
// 区分移动端或wen端
json=
{
cell
.
content
}
json=
{
cell
.
content
}
obj=
{
obj
||
{}
}
// 是否存在默认值
obj=
{
obj
||
{}
}
// 是否存在默认值
mapData=
{
mapData
}
mapData=
{
mapData
}
form=
{
this
.
props
.
form
}
// antd form控件
form=
{
this
.
props
.
form
}
// antd form控件
sqlData=
{
sqlData
}
sqlData=
{
sqlData
}
defaultValues=
{
defaultValues
||
{}
}
// 接口中的默认值
defaultValues=
{
defaultValues
||
{}
}
// 接口中的默认值
/>
/>
</
td
>}
</
td
>
}
)
)
...
@@ -508,7 +509,7 @@ export default class ZdyTable extends Component {
...
@@ -508,7 +509,7 @@ export default class ZdyTable extends Component {
</
tbody
>
</
tbody
>
</
table
>
</
table
>
{
style
.
pageBreakAfter
!=
null
?<
div
style=
{
{
pageBreakAfter
:
style
.
pageBreakAfter
}
}
></
div
>:
""
}
{
style
.
pageBreakAfter
!=
null
?
<
div
style=
{
{
pageBreakAfter
:
style
.
pageBreakAfter
}
}
></
div
>
:
""
}
</
div
>
</
div
>
</
Col
>
</
Col
>
</
Row
>
</
Row
>
...
@@ -534,7 +535,7 @@ export default class ZdyTable extends Component {
...
@@ -534,7 +535,7 @@ export default class ZdyTable extends Component {
return
this
.
props
.
form
.
getFieldDecorator
(
name
,
{
return
this
.
props
.
form
.
getFieldDecorator
(
name
,
{
initialValue
:
value
initialValue
:
value
})(<
Input
type=
"hidden"
/>);
})(<
Input
type=
"hidden"
/>);
})
:
""
}
})
:
""
}
{
{
...
@@ -545,10 +546,11 @@ export default class ZdyTable extends Component {
...
@@ -545,10 +546,11 @@ export default class ZdyTable extends Component {
style=
{
{
style=
{
{
marginTop
:
0
,
marginTop
:
0
,
background
:
'#ffffff'
,
background
:
'#ffffff'
,
paddingLeft
:
12
,
paddingLeft
:
12
,
width
:
'100%'
,
width
:
'100%'
,
flexWrap
:
'wrap'
,
flexWrap
:
'wrap'
,
...
style
}
}
>
...
style
}
}
>
{
{
item
.
map
((
ary
,
j
)
=>
{
item
.
map
((
ary
,
j
)
=>
{
return
!
allhidden
&&
ary
.
hidden
?
""
return
!
allhidden
&&
ary
.
hidden
?
""
...
@@ -567,7 +569,7 @@ export default class ZdyTable extends Component {
...
@@ -567,7 +569,7 @@ export default class ZdyTable extends Component {
get=
{
get
}
get=
{
get
}
key=
{
j
}
key=
{
j
}
sqlData=
{
sqlData
}
sqlData=
{
sqlData
}
obj=
{
obj
||
{}
}
obj=
{
obj
||
{}
}
form=
{
this
.
props
.
form
}
form=
{
this
.
props
.
form
}
mapData=
{
mapData
}
mapData=
{
mapData
}
json=
{
ary
.
content
}
json=
{
ary
.
content
}
...
...
one_stop_public/libs/TableSelect.js
浏览文件 @
f0d23696
...
@@ -16,16 +16,11 @@ export default class TableSelect extends React.Component {
...
@@ -16,16 +16,11 @@ export default class TableSelect extends React.Component {
const
value
=
props
.
value
||
{};
const
value
=
props
.
value
||
{};
this
.
state
=
{
this
.
state
=
{
selects
:
value
.
selects
||
{},
selects
:
value
.
selects
||
{},
visiable
:
value
.
visiable
,
visiable
:
value
.
visiable
,
isAll
:
value
.
isAll
!=
null
?
value
.
isAll
:
false
,
isAll
:
value
.
isAll
!=
null
?
value
.
isAll
:
false
,
querys
:
value
.
querys
||
[],
querys
:
value
.
querys
||
[],
sql
:
value
.
sql
,
sql
:
value
.
sql
,
}
}
}
}
...
@@ -33,6 +28,7 @@ export default class TableSelect extends React.Component {
...
@@ -33,6 +28,7 @@ export default class TableSelect extends React.Component {
// Should provide an event to pass value to Form.
// Should provide an event to pass value to Form.
const
onChange
=
this
.
props
.
onChange
;
const
onChange
=
this
.
props
.
onChange
;
if
(
onChange
)
{
if
(
onChange
)
{
console
.
log
(
"changedValue"
,
changedValue
)
onChange
(
Object
.
assign
({},
this
.
state
,
changedValue
));
onChange
(
Object
.
assign
({},
this
.
state
,
changedValue
));
}
}
}
}
...
@@ -41,30 +37,30 @@ export default class TableSelect extends React.Component {
...
@@ -41,30 +37,30 @@ export default class TableSelect extends React.Component {
if
(
'value'
in
nextProps
)
{
if
(
'value'
in
nextProps
)
{
const
value
=
nextProps
.
value
;
const
value
=
nextProps
.
value
;
if
(
value
!=
null
&&
value
instanceof
Object
)
{
if
(
value
!=
null
&&
value
instanceof
Object
)
{
this
.
setState
(
value
);
this
.
setState
(
value
);
}
}
//
//
}
}
}
}
remove
=
(
rowKey
)
=>
{
remove
=
(
rowKey
)
=>
{
console
.
log
(
rowKey
)
const
{
selects
}
=
this
.
state
const
{
selects
}
=
this
.
state
delete
selects
[
rowKey
]
delete
selects
[
rowKey
]
console
.
log
(
selects
)
if
(
!
(
'value'
in
this
.
props
))
{
if
(
!
(
'value'
in
this
.
props
))
{
this
.
setState
({
selects
});
this
.
setState
({
selects
});
}
}
this
.
triggerChange
({
selects
});
this
.
triggerChange
({
selects
});
}
}
select
=
(
obj
)
=>
{
select
=
(
obj
)
=>
{
var
{
selects
}
=
this
.
state
var
{
selects
}
=
this
.
state
const
{
json
:
{
isMultiple
,
optionType
}
}
=
this
.
props
const
{
json
:
{
isMultiple
,
optionType
}
}
=
this
.
props
let
valueName
=
this
.
props
.
json
.
valueName
let
valueName
=
this
.
props
.
json
.
valueName
if
(
optionType
==
"reference"
&&
this
.
props
.
dataColumn
.
referenceObjId
)
{
if
(
optionType
==
"reference"
&&
this
.
props
.
dataColumn
.
referenceObjId
)
{
valueName
=
this
.
props
.
dataColumn
.
referenceCodeName
valueName
=
this
.
props
.
dataColumn
.
referenceCodeName
}
}
...
@@ -74,16 +70,16 @@ export default class TableSelect extends React.Component {
...
@@ -74,16 +70,16 @@ export default class TableSelect extends React.Component {
return
return
}
}
if
(
!
isMultiple
)
{
if
(
!
isMultiple
)
{
selects
=
{
[
kk
]:
{
...
obj
,
selectKey
:
kk
}
}
selects
=
{
[
kk
]:
{
...
obj
,
selectKey
:
kk
}
}
}
else
{
}
else
{
selects
[
kk
]
=
obj
;
selects
[
kk
]
=
obj
;
selects
[
kk
].
selectKey
=
kk
selects
[
kk
].
selectKey
=
kk
}
}
if
(
!
(
'value'
in
this
.
props
))
{
if
(
!
(
'value'
in
this
.
props
))
{
this
.
setState
({
selects
});
this
.
setState
({
selects
});
}
}
this
.
triggerChange
({
selects
});
this
.
triggerChange
({
selects
});
...
@@ -96,7 +92,7 @@ export default class TableSelect extends React.Component {
...
@@ -96,7 +92,7 @@ export default class TableSelect extends React.Component {
values
.
splice
(
i
,
1
)
values
.
splice
(
i
,
1
)
labels
.
splice
(
i
,
1
)
labels
.
splice
(
i
,
1
)
if
(
!
(
'value'
in
this
.
props
))
{
if
(
!
(
'value'
in
this
.
props
))
{
this
.
setState
({
values
,
labels
});
this
.
setState
({
values
,
labels
});
}
}
this
.
triggerChange
({
values
,
labels
});
this
.
triggerChange
({
values
,
labels
});
...
@@ -106,27 +102,25 @@ export default class TableSelect extends React.Component {
...
@@ -106,27 +102,25 @@ export default class TableSelect extends React.Component {
open
=
()
=>
{
open
=
()
=>
{
if
(
!
(
'value'
in
this
.
props
))
{
if
(
!
(
'value'
in
this
.
props
))
{
this
.
setState
({
visiable
:
true
});
this
.
setState
({
visiable
:
true
});
}
}
this
.
triggerChange
({
visiable
:
true
});
this
.
triggerChange
({
visiable
:
true
});
}
}
closeModal
=
()
=>
{
closeModal
=
()
=>
{
if
(
!
(
'value'
in
this
.
props
))
{
if
(
!
(
'value'
in
this
.
props
))
{
this
.
setState
({
visiable
:
false
});
this
.
setState
({
visiable
:
false
});
}
}
this
.
triggerChange
({
visiable
:
false
});
this
.
triggerChange
({
visiable
:
false
});
}
}
render
()
{
render
()
{
const
{
json
:
{
isMultiple
,
sql
,
optionType
,
showTable
},
dataColumn
:
{
referenceObjId
},
sqlModel
,
columns
,
dataSource
}
=
this
.
props
const
{
json
:
{
isMultiple
,
sql
,
optionType
,
showTable
},
dataColumn
:
{
referenceObjId
},
sqlModel
,
columns
,
dataSource
}
=
this
.
props
let
{
valueName
,
labelName
}
=
this
.
props
.
json
let
{
valueName
,
labelName
}
=
this
.
props
.
json
if
(
optionType
==
"reference"
&&
referenceObjId
)
{
valueName
=
this
.
props
.
dataColumn
.
referenceCodeName
if
(
optionType
==
"reference"
&&
referenceObjId
){
labelName
=
this
.
props
.
dataColumn
.
referenceNameName
valueName
=
this
.
props
.
dataColumn
.
referenceCodeName
labelName
=
this
.
props
.
dataColumn
.
referenceNameName
}
}
...
@@ -134,45 +128,44 @@ export default class TableSelect extends React.Component {
...
@@ -134,45 +128,44 @@ export default class TableSelect extends React.Component {
if
(
valueName
==
null
||
valueName
==
""
)
{
if
(
valueName
==
null
||
valueName
==
""
)
{
return
<>
请指定取值的列名
<
/
>
return
<>
请指定取值的列名
<
/
>
}
}
const
{
selects
,
visiable
,
labels
}
=
this
.
state
const
{
selects
,
visiable
,
labels
}
=
this
.
state
const
keys
=
[]
const
keys
=
[]
for
(
let
i
in
selects
)
{
for
(
let
i
in
selects
)
{
keys
.
push
(
selects
[
i
][
valueName
])
keys
.
push
(
selects
[
i
][
valueName
])
}
}
const
columns2
=
[...
columns
,
{
const
columns2
=
[...
columns
,
{
title
:
"操作"
,
title
:
"操作"
,
render
:
(
val
,
record
)
=><
a
onClick
=
{
this
.
remove
.
bind
(
this
,
record
.
selectKey
)}
>
移除
<
/a
>
render
:
(
val
,
record
)
=>
<
a
onClick
=
{
this
.
remove
.
bind
(
this
,
record
.
selectKey
)}
>
移除
<
/a
>
}]
}]
const
columns3
=
[...
columns
,{
const
columns3
=
[...
columns
,
{
title
:
"操作"
,
title
:
"操作"
,
render
:
(
val
,
record
)
=>
render
:(
val
,
record
)
=>
keys
.
includes
(
record
[
valueName
])
?
<
span
>
已选择
<
/span> : <a onClick={this.select.bind
(
this, record
)
}>选择</
a
>
keys
.
includes
(
record
[
valueName
])?
<
span
>
已选择
<
/span>:<a onClick={this.select.bind
(
this,record
)
}>选择</
a
>
}]
}]
const
custom
=
{
const
custom
=
{
isAll
:
this
.
state
.
isAll
,
isAll
:
this
.
state
.
isAll
,
querys
:
this
.
state
.
querys
,
querys
:
this
.
state
.
querys
,
sql
:
this
.
state
.
sql
,
sql
:
this
.
state
.
sql
,
}
}
console
.
log
(
columns3
)
//
console.log(columns3)
let
allWidth
=
0
let
allWidth
=
0
if
(
columns3
)
{
if
(
columns3
)
{
columns3
.
map
((
item
,
index
)
=>
{
columns3
.
map
((
item
,
index
)
=>
{
if
(
index
===
columns3
.
length
-
1
)
{
if
(
index
===
columns3
.
length
-
1
)
{
item
.
fixed
=
'right'
item
.
fixed
=
'right'
item
.
width
=
50
item
.
width
=
50
allWidth
+=
50
allWidth
+=
50
return
item
return
item
}
}
if
(
index
===
columns3
.
length
-
2
)
{
if
(
index
===
columns3
.
length
-
2
)
{
allWidth
+=
150
allWidth
+=
150
}
else
{
}
else
{
if
(
item
.
width
)
{
if
(
item
.
width
)
{
allWidth
+=
item
.
width
allWidth
+=
item
.
width
}
else
{
}
else
{
item
.
width
=
180
item
.
width
=
180
...
@@ -182,23 +175,20 @@ export default class TableSelect extends React.Component {
...
@@ -182,23 +175,20 @@ export default class TableSelect extends React.Component {
return
item
return
item
})
})
}
}
console
.
log
(
selects
,
Object
.
keys
(
selects
).
length
)
return
(
return
(
<
div
>
<
div
>
{
Object
.
keys
(
selects
).
length
>
0
?
{
Object
.
keys
(
selects
).
length
>
0
?
showTable
?
<
Table
rowKey
=
{
valueName
}
size
=
"small"
dataSource
=
{
Object
.
values
(
selects
)}
columns
=
{
columns2
}
pagination
=
{
false
}
/>
:
showTable
?
<
Table
rowKey
=
{
valueName
}
size
=
"small"
dataSource
=
{
Object
.
values
(
selects
)}
columns
=
{
columns2
}
pagination
=
{
false
}
/>
:
Object
.
keys
(
selects
).
map
((
k
)
=>
<
Tag
key
=
{
k
}
closable
onClose
=
{
this
.
remove
.
bind
(
this
,
k
)}
>
{
selects
[
k
][
labelName
]}
<
/Tag>
)
Object
.
keys
(
selects
).
map
((
k
)
=>
<
Tag
key
=
{
k
}
closable
onClose
=
{
this
.
remove
.
bind
(
this
,
k
)}
>
{
selects
[
k
][
labelName
]}
<
/Tag>
)
:
""
:
""
}
}
<
Button
type
=
"primary"
onClick
=
{
this
.
open
}
>
选择
<
/Button
>
<
Button
type
=
"primary"
onClick
=
{
this
.
open
}
>
选择
<
/Button
>
<
Modal
<
Modal
width
=
"
1200px
"
width
=
"
60%
"
maskClosable
=
{
false
}
maskClosable
=
{
false
}
title
=
{
`请选择`
}
title
=
{
`请选择`
}
visible
=
{
visiable
}
visible
=
{
visiable
}
onOk
=
{
this
.
closeModal
}
onOk
=
{
this
.
closeModal
}
...
@@ -206,7 +196,8 @@ export default class TableSelect extends React.Component {
...
@@ -206,7 +196,8 @@ export default class TableSelect extends React.Component {
>
>
{
optionType
==
"reference"
?
referenceObjId
?
{
optionType
==
"reference"
?
referenceObjId
?
<
FormList
rights
=
{
this
.
props
.
rights
||
[]}
notShowBack
=
{
true
}
value
=
{
custom
}
objId
=
{
referenceObjId
}
isFormCom
=
{
true
}
isSelect
=
{
true
}
selects
=
{
keys
}
valueName
=
{
valueName
}
callback
=
{
this
.
select
}
sql
=
{
sql
}
/> : "未关联数据对象
"
<
FormList
rights
=
{
this
.
props
.
rights
||
[]}
notShowBack
=
{
true
}
value
=
{
custom
}
objId
=
{
referenceObjId
}
isFormCom
=
{
true
}
isSelect
=
{
true
}
selects
=
{
keys
}
valueName
=
{
valueName
}
callback
=
{
this
.
select
}
sql
=
{
sql
}
/
>
:
"未关联数据对象"
:
sqlModel
.
dataObjId
?
:
sqlModel
.
dataObjId
?
<
FormList
rights
=
{
this
.
props
.
rights
||
[]}
notShowBack
=
{
true
}
value
=
{
custom
}
objId
=
{
sqlModel
.
dataObjId
}
isFormCom
=
{
true
}
isSelect
=
{
true
}
selects
=
{
keys
}
valueName
=
{
valueName
}
callback
=
{
this
.
select
}
sql
=
{
sql
}
/
>
<
FormList
rights
=
{
this
.
props
.
rights
||
[]}
notShowBack
=
{
true
}
value
=
{
custom
}
objId
=
{
sqlModel
.
dataObjId
}
isFormCom
=
{
true
}
isSelect
=
{
true
}
selects
=
{
keys
}
valueName
=
{
valueName
}
callback
=
{
this
.
select
}
sql
=
{
sql
}
/
>
:
<
Table
rowKey
=
{
valueName
}
size
=
"small"
dataSource
=
{
dataSource
.
list
}
columns
=
{
columns3
}
scroll
=
{{
x
:
allWidth
}}
/>
}
:
<
Table
rowKey
=
{
valueName
}
size
=
"small"
dataSource
=
{
dataSource
.
list
}
columns
=
{
columns3
}
scroll
=
{{
x
:
allWidth
}}
/>
}
...
...
one_stop_public/tableCompon/index.jsx
浏览文件 @
f0d23696
...
@@ -62,13 +62,13 @@ import Signature from '../Signature';
...
@@ -62,13 +62,13 @@ import Signature from '../Signature';
import
baseX
from
'base-x'
import
baseX
from
'base-x'
const
Bs64
=
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
const
Bs64
=
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
const
base64
=
baseX
(
Bs64
)
const
base64
=
baseX
(
Bs64
)
import
{
Base16Encode
}
from
"../Base16/index"
import
{
Base16Encode
}
from
"../Base16/index"
import
{
getToken
}
from
'../utils/token'
;
import
{
getToken
}
from
'../utils/token'
;
// import FilePreview from '../filePreview';
// import FilePreview from '../filePreview';
const
Item
=
MobileList
.
Item
;
const
Item
=
MobileList
.
Item
;
const
Brief
=
Item
.
Brief
;
const
Brief
=
Item
.
Brief
;
function
getBase64
(
value
){
function
getBase64
(
value
)
{
return
value
?
base64
.
encode
(
new
Buffer
(
value
)):
null
;
return
value
?
base64
.
encode
(
new
Buffer
(
value
))
:
null
;
}
}
const
codeMessage
=
{
const
codeMessage
=
{
...
@@ -120,9 +120,9 @@ const normFile = (e) => {
...
@@ -120,9 +120,9 @@ const normFile = (e) => {
}
}
return
e
&&
e
.
fileList
[
0
];
return
e
&&
e
.
fileList
[
0
];
}
}
@
connect
(({
DataColumn
,
SqlManageEntity
,
formList
,
loading
})
=>
({
@
connect
(({
DataColumn
,
SqlManageEntity
,
formList
,
loading
})
=>
({
DataColumn
,
SqlManageEntity
,
formList
,
DataColumn
,
SqlManageEntity
,
formList
,
loading
:
loading
.
models
.
DataColumn
||
loading
.
models
.
SqlManageEntity
||
loading
.
models
.
formList
loading
:
loading
.
models
.
DataColumn
||
loading
.
models
.
SqlManageEntity
||
loading
.
models
.
formList
}))
}))
export
default
class
tableCom
extends
Component
{
export
default
class
tableCom
extends
Component
{
state
=
{
state
=
{
...
@@ -211,8 +211,8 @@ export default class tableCom extends Component {
...
@@ -211,8 +211,8 @@ export default class tableCom extends Component {
break
;
break
;
}
}
if
(
depth
==
1
&&
((
this
.
props
.
json
.
sqlKey
==
null
&&
sqlContent
==
null
&&
json
.
formula
==
null
&&
json
.
funcs
==
null
)
||
(
sqlContent
!=
null
&&
sqlContent
.
indexOf
(
key
)
==
-
1
)
if
(
depth
==
1
&&
((
this
.
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
))
||
((
json
.
formula
!=
null
&&
json
.
formula
.
indexOf
(
key
)
==
-
1
)
&&
(
json
.
funcs
!=
null
&&
json
.
funcs
.
indexOf
(
key
)
==
-
1
))
))
{
))
{
this
.
excludeKeys
.
push
(
key
)
this
.
excludeKeys
.
push
(
key
)
...
@@ -294,16 +294,16 @@ export default class tableCom extends Component {
...
@@ -294,16 +294,16 @@ export default class tableCom extends Component {
return
res
;
return
res
;
};
};
getRender
=
(
com
,
props
)
=>
{
getRender
=
(
com
,
props
)
=>
{
if
(
com
==
"span"
)
return
<
span
{
...
props
}
/>
if
(
com
==
"span"
)
return
<
span
{
...
props
}
/>
if
(
com
==
"a"
)
return
<
a
{
...
props
}
/>
if
(
com
==
"a"
)
return
<
a
{
...
props
}
/>
if
(
com
==
"div"
)
return
<
div
{
...
props
}
/>
if
(
com
==
"div"
)
return
<
div
{
...
props
}
/>
if
(
com
==
"canvas"
)
return
<
canvas
{
...
props
}
/>
if
(
com
==
"canvas"
)
return
<
canvas
{
...
props
}
/>
if
(
com
==
"iframe"
)
return
<
iframe
{
...
props
}
/>
if
(
com
==
"iframe"
)
return
<
iframe
{
...
props
}
/>
if
(
com
==
"img"
)
{
if
(
com
==
"img"
)
{
const
src
=
props
.
src
!=
null
?(
props
.
src
.
indexOf
(
"http"
)
>-
1
?
props
.
src
:
config
.
httpServer
+
props
.
src
):
null
const
src
=
props
.
src
!=
null
?
(
props
.
src
.
indexOf
(
"http"
)
>
-
1
?
props
.
src
:
config
.
httpServer
+
props
.
src
)
:
null
const
pp
=
{...
props
,
src
:
src
}
const
pp
=
{
...
props
,
src
:
src
}
return
<
img
{
...
pp
}
/>
return
<
img
{
...
pp
}
/>
}
}
}
}
...
@@ -422,7 +422,7 @@ export default class tableCom extends Component {
...
@@ -422,7 +422,7 @@ export default class tableCom extends Component {
if
(
json
==
null
)
{
if
(
json
==
null
)
{
return
;
return
;
}
}
if
(
!
(
this
.
dataFilter
.
includes
(
json
.
comName
)
||
json
.
comName
==
"TableSelect"
)
&&
json
.
isFormulaOnce
)
{
if
(
!
(
this
.
dataFilter
.
includes
(
json
.
comName
)
||
json
.
comName
==
"TableSelect"
)
&&
json
.
isFormulaOnce
)
{
return
;
return
;
}
}
if
(
!
(
this
.
dataFilter
.
includes
(
json
.
comName
)
||
json
.
comName
==
"TableSelect"
||
(
json
.
formula
!=
null
&&
json
.
formula
!=
""
)))
{
if
(
!
(
this
.
dataFilter
.
includes
(
json
.
comName
)
||
json
.
comName
==
"TableSelect"
||
(
json
.
formula
!=
null
&&
json
.
formula
!=
""
)))
{
...
@@ -481,15 +481,15 @@ export default class tableCom extends Component {
...
@@ -481,15 +481,15 @@ export default class tableCom extends Component {
return
return
}
}
const
bindObj
=
this
.
getColumn
(
'c1'
);
const
bindObj
=
this
.
getColumn
(
'c1'
);
let
dataColumn
=
this
.
props
.
fatherCode
!=
null
?
(
bindObj
?{...
bindObj
,
base52
:
`
${
this
.
props
.
fatherCode
}
.[
${
this
.
props
.
index
}
].
${
bindObj
.
base52
}
`
}
:
let
dataColumn
=
this
.
props
.
fatherCode
!=
null
?
(
bindObj
?
{
...
bindObj
,
base52
:
`
${
this
.
props
.
fatherCode
}
.[
${
this
.
props
.
index
}
].
${
bindObj
.
base52
}
`
}
:
{
base52
:
`
${
this
.
props
.
fatherCode
}
.[
${
this
.
props
.
index
}
].
${
this
.
props
.
uuid
}
`
})
{
base52
:
`
${
this
.
props
.
fatherCode
}
.[
${
this
.
props
.
index
}
].
${
this
.
props
.
uuid
}
`
})
:
bindObj
;
:
bindObj
;
if
(
this
.
props
.
fatherCode
==
null
&&
dataColumn
==
null
)
dataColumn
=
{
base52
:
this
.
props
.
uuid
}
if
(
this
.
props
.
fatherCode
==
null
&&
dataColumn
==
null
)
dataColumn
=
{
base52
:
this
.
props
.
uuid
}
/* if (this.props.fatherCode != null) {
/* if (this.props.fatherCode != null) {
dataColumn = { base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}` }
dataColumn = { base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}` }
} else {
} else {
dataColumn = { base52: this.props.uuid }
dataColumn = { base52: this.props.uuid }
...
@@ -504,11 +504,11 @@ export default class tableCom extends Component {
...
@@ -504,11 +504,11 @@ export default class tableCom extends Component {
}
}
}
}
} */
} */
if
(
!
this
.
props
.
isEdit
&&
this
.
props
.
fatherCode
)
{
if
(
!
this
.
props
.
isEdit
&&
this
.
props
.
fatherCode
)
{
if
(
bindObj
!=
null
)
{
if
(
bindObj
!=
null
)
{
dataColumn
.
base52
=
bindObj
.
base52
dataColumn
.
base52
=
bindObj
.
base52
}
else
{
}
else
{
dataColumn
.
base52
=
this
.
props
.
uuid
dataColumn
.
base52
=
this
.
props
.
uuid
}
}
...
@@ -518,7 +518,7 @@ export default class tableCom extends Component {
...
@@ -518,7 +518,7 @@ export default class tableCom extends Component {
const
obj2
=
{
...
obj
,
...
props
.
form
.
getFieldsValue
(),
...
props
.
defaultValues
[
this
.
props
.
formKey
]
}
const
obj2
=
{
...
obj
,
...
props
.
form
.
getFieldsValue
(),
...
props
.
defaultValues
[
this
.
props
.
formKey
]
}
this
.
getData
(
json
,
dataColumn
,
obj2
)
this
.
getData
(
json
,
dataColumn
,
obj2
)
}
}
if
(
json
.
formula
!=
null
&&
json
.
formula
!=
""
&&
!
json
.
isFormulaOnce
)
{
if
(
json
.
formula
!=
null
&&
json
.
formula
!=
""
&&
!
json
.
isFormulaOnce
)
{
this
.
getFunctionValue
(
json
.
formula
,
dataColumn
,
json
)
this
.
getFunctionValue
(
json
.
formula
,
dataColumn
,
json
)
}
}
}
}
...
@@ -527,8 +527,6 @@ export default class tableCom extends Component {
...
@@ -527,8 +527,6 @@ export default class tableCom extends Component {
getData
=
(
json
,
dataColumn
,
obj
,
init
)
=>
{
getData
=
(
json
,
dataColumn
,
obj
,
init
)
=>
{
const
allValues
=
JSON
.
stringify
(
obj
)
const
allValues
=
JSON
.
stringify
(
obj
)
if
(
json
.
comName
==
"TableSelect"
)
{
if
(
json
.
comName
==
"TableSelect"
)
{
const
{
dispatch
}
=
this
.
props
const
{
dispatch
}
=
this
.
props
const
{
sqlKey
,
optionType
}
=
json
const
{
sqlKey
,
optionType
}
=
json
...
@@ -612,10 +610,10 @@ export default class tableCom extends Component {
...
@@ -612,10 +610,10 @@ export default class tableCom extends Component {
}
}
}
}
})
})
}
else
if
(
optionType
==
"reference"
&&
dataColumn
.
referenceObjId
)
{
}
else
if
(
optionType
==
"reference"
&&
dataColumn
.
referenceObjId
)
{
dispatch
({
dispatch
({
type
:
'formList/getHead'
,
type
:
'formList/getHead'
,
payload
:
{
dataObjId
:
dataColumn
.
referenceObjId
},
payload
:
{
dataObjId
:
dataColumn
.
referenceObjId
},
callback
:
datas
=>
{
callback
:
datas
=>
{
if
(
datas
)
{
if
(
datas
)
{
...
@@ -681,59 +679,59 @@ export default class tableCom extends Component {
...
@@ -681,59 +679,59 @@ export default class tableCom extends Component {
let
enu
;
let
enu
;
try
{
try
{
this
.
getFunctionValue
(
json
.
funcs
,
{
base52
:
this
.
props
.
uuid
},
json
,
()
=>
{
this
.
getFunctionValue
(
json
.
funcs
,
{
base52
:
this
.
props
.
uuid
},
json
,
()
=>
{
if
(
init
!=
null
&&
Object
.
keys
(
init
).
length
>
0
)
{
if
(
init
!=
null
&&
Object
.
keys
(
init
).
length
>
0
)
{
let
base52
=
dataColumn
.
base52
let
base52
=
dataColumn
.
base52
let
vlu
=
this
.
props
.
form
.
getFieldValue
(
base52
)
let
vlu
=
this
.
props
.
form
.
getFieldValue
(
base52
)
if
(
vlu
instanceof
Array
)
{
if
(
vlu
instanceof
Array
)
{
for
(
var
i
=
0
;
i
<
this
.
state
.
options
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
this
.
state
.
options
.
length
;
i
++
)
{
if
(
vlu
.
includes
(
this
.
state
.
options
[
i
].
value
))
{
if
(
vlu
.
includes
(
this
.
state
.
options
[
i
].
value
))
{
labs
.
push
(
this
.
state
.
options
[
i
].
label
)
labs
.
push
(
this
.
state
.
options
[
i
].
label
)
}
}
}
}
}
else
{
}
else
{
for
(
var
i
=
0
;
i
<
this
.
state
.
options
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
this
.
state
.
options
.
length
;
i
++
)
{
if
(
vlu
==
this
.
state
.
options
[
i
].
value
)
{
if
(
vlu
==
this
.
state
.
options
[
i
].
value
)
{
labs
.
push
(
this
.
state
.
options
[
i
].
label
)
labs
.
push
(
this
.
state
.
options
[
i
].
label
)
break
;
break
;
}
}
}
}
}
}
this
.
setState
({
labels
:
labs
})
this
.
setState
({
labels
:
labs
})
}
else
if
(
!
this
.
props
.
isEdit
&&
Object
.
keys
(
obj
).
length
>
0
)
{
}
else
if
(
!
this
.
props
.
isEdit
&&
Object
.
keys
(
obj
).
length
>
0
)
{
let
base52
=
dataColumn
.
base52
let
base52
=
dataColumn
.
base52
const
vlu
=
obj
[
base52
]
const
vlu
=
obj
[
base52
]
const
labs
=
[]
const
labs
=
[]
if
(
vlu
instanceof
Array
)
{
if
(
vlu
instanceof
Array
)
{
for
(
var
i
=
0
;
i
<
this
.
state
.
options
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
this
.
state
.
options
.
length
;
i
++
)
{
if
(
vlu
.
includes
(
this
.
state
.
options
[
i
].
value
))
{
if
(
vlu
.
includes
(
this
.
state
.
options
[
i
].
value
))
{
labs
.
push
(
this
.
state
.
options
[
i
].
label
)
labs
.
push
(
this
.
state
.
options
[
i
].
label
)
}
}
}
}
}
else
{
}
else
{
for
(
var
i
=
0
;
i
<
this
.
state
.
options
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
this
.
state
.
options
.
length
;
i
++
)
{
if
(
vlu
==
this
.
state
.
options
[
i
].
value
)
{
if
(
vlu
==
this
.
state
.
options
[
i
].
value
)
{
labs
.
push
(
this
.
state
.
options
[
i
].
label
)
labs
.
push
(
this
.
state
.
options
[
i
].
label
)
break
;
break
;
}
}
}
}
}
}
this
.
setState
({
labels
:
labs
})
this
.
setState
({
labels
:
labs
})
}
}
})
;
});
}
catch
(
e
)
{
}
catch
(
e
)
{
message
.
error
(
"公式选项配置存在问题"
)
message
.
error
(
"公式选项配置存在问题"
)
...
@@ -759,11 +757,11 @@ export default class tableCom extends Component {
...
@@ -759,11 +757,11 @@ export default class tableCom extends Component {
}
}
}
}
reqUtil
=
(
base52
,
json
,
orgCallback
,
url
,
method
,
params
,
callback
,
options
=
{})
=>
{
reqUtil
=
(
base52
,
json
,
orgCallback
,
url
,
method
,
params
,
callback
,
options
=
{})
=>
{
//查缓存
//查缓存
var
isChange
=
false
;
var
isChange
=
false
;
if
(
url
.
indexOf
(
"http"
)
===-
1
)
{
if
(
url
.
indexOf
(
"http"
)
===
-
1
)
{
url
=
config
.
httpServer
+
url
url
=
config
.
httpServer
+
url
}
}
const
{
reqUrls
}
=
this
.
state
const
{
reqUrls
}
=
this
.
state
if
(
reqUrls
[
url
]
!=
null
)
{
if
(
reqUrls
[
url
]
!=
null
)
{
...
@@ -797,17 +795,17 @@ export default class tableCom extends Component {
...
@@ -797,17 +795,17 @@ export default class tableCom extends Component {
if
(
callback
)
{
if
(
callback
)
{
const
data
=
reqUrls
[
url
].
data
const
data
=
reqUrls
[
url
].
data
if
(
json
.
optionType
&&
json
.
optionType
==
"func"
)
{
if
(
json
.
optionType
&&
json
.
optionType
==
"func"
)
{
const
res
=
callback
(
data
)
const
res
=
callback
(
data
)
if
(
res
!=
null
&&!
(
typeof
res
===
"function"
))
{
if
(
res
!=
null
&&
!
(
typeof
res
===
"function"
))
{
this
.
setState
({
options
:
res
,
selectDis
:
false
},()
=>
{
this
.
setState
({
options
:
res
,
selectDis
:
false
},
()
=>
{
if
(
orgCallback
)
orgCallback
()
if
(
orgCallback
)
orgCallback
()
});
});
}
}
}
else
if
(
json
.
comName
==
"Button"
)
{
}
else
if
(
json
.
comName
==
"Button"
)
{
try
{
try
{
callback
(
data
)
callback
(
data
)
...
@@ -848,13 +846,13 @@ export default class tableCom extends Component {
...
@@ -848,13 +846,13 @@ export default class tableCom extends Component {
return
"norefeshxxxxxxxxxxxxxxxxxxxx"
return
"norefeshxxxxxxxxxxxxxxxxxxxx"
}
}
this
.
setState
({
reqUrls
},
()
=>
{
this
.
setState
({
reqUrls
},
()
=>
{
for
(
let
i
in
params
)
{
for
(
let
i
in
params
)
{
if
(
params
[
i
]
==
null
)
{
if
(
params
[
i
]
==
null
)
{
delete
params
[
i
]
delete
params
[
i
]
}
}
}
}
if
(
getToken
()
!=
null
)
{
if
(
getToken
()
!=
null
)
{
params
.
token
=
getToken
()
params
.
token
=
getToken
()
}
}
const
requestParams
=
params
const
requestParams
=
params
...
@@ -876,17 +874,17 @@ export default class tableCom extends Component {
...
@@ -876,17 +874,17 @@ export default class tableCom extends Component {
reqUrls
[
url
].
data
=
data
reqUrls
[
url
].
data
=
data
this
.
setState
({
reqUrls
})
this
.
setState
({
reqUrls
})
if
(
callback
)
{
if
(
callback
)
{
if
(
json
.
optionType
&&
json
.
optionType
==
"func"
)
{
if
(
json
.
optionType
&&
json
.
optionType
==
"func"
)
{
const
res
=
callback
(
data
)
const
res
=
callback
(
data
)
if
(
res
!=
null
&&!
(
typeof
res
===
"function"
))
{
if
(
res
!=
null
&&
!
(
typeof
res
===
"function"
))
{
this
.
setState
({
options
:
res
,
selectDis
:
false
},()
=>
{
this
.
setState
({
options
:
res
,
selectDis
:
false
},
()
=>
{
if
(
orgCallback
)
orgCallback
()
if
(
orgCallback
)
orgCallback
()
});
});
}
}
}
else
if
(
json
.
comName
==
"Button"
)
{
}
else
if
(
json
.
comName
==
"Button"
)
{
try
{
try
{
callback
(
data
)
callback
(
data
)
...
@@ -939,7 +937,7 @@ export default class tableCom extends Component {
...
@@ -939,7 +937,7 @@ export default class tableCom extends Component {
}
}
sqlUtil
=
(
base52
,
json
,
orgCallback
,
sqlKey
,
params
,
callback
,
options
=
{})
=>
{
sqlUtil
=
(
base52
,
json
,
orgCallback
,
sqlKey
,
params
,
callback
,
options
=
{})
=>
{
//查缓存
//查缓存
var
isChange
=
false
;
var
isChange
=
false
;
...
@@ -967,14 +965,14 @@ export default class tableCom extends Component {
...
@@ -967,14 +965,14 @@ export default class tableCom extends Component {
if
(
callback
)
{
if
(
callback
)
{
const
data
=
sqlKeys
[
sqlKey
].
data
const
data
=
sqlKeys
[
sqlKey
].
data
if
(
json
.
optionType
&&
json
.
optionType
==
"func"
)
{
if
(
json
.
optionType
&&
json
.
optionType
==
"func"
)
{
const
res
=
callback
(
data
)
const
res
=
callback
(
data
)
if
(
res
!=
null
&&!
(
typeof
res
===
"function"
))
{
if
(
res
!=
null
&&
!
(
typeof
res
===
"function"
))
{
this
.
setState
({
options
:
res
,
selectDis
:
false
},()
=>
{
this
.
setState
({
options
:
res
,
selectDis
:
false
},
()
=>
{
if
(
orgCallback
)
orgCallback
()
if
(
orgCallback
)
orgCallback
()
});
});
}
}
}
else
if
(
json
.
comName
==
"Button"
)
{
}
else
if
(
json
.
comName
==
"Button"
)
{
try
{
try
{
callback
(
data
)
callback
(
data
)
...
@@ -1022,9 +1020,9 @@ export default class tableCom extends Component {
...
@@ -1022,9 +1020,9 @@ export default class tableCom extends Component {
const
pp
=
{
sqlKey
:
Base16Encode
(
sqlKey
),
params
,
allValues
:
Base16Encode
(
allValues
)
}
const
pp
=
{
sqlKey
:
Base16Encode
(
sqlKey
),
params
,
allValues
:
Base16Encode
(
allValues
)
}
if
(
getToken
()
!=
null
)
{
if
(
getToken
()
!=
null
)
{
pp
.
token
=
getToken
()
pp
.
token
=
getToken
()
}
}
const
umiRequest
=
extend
({
const
umiRequest
=
extend
({
errorHandler
,
// 默认错误处理
errorHandler
,
// 默认错误处理
...
@@ -1034,7 +1032,7 @@ export default class tableCom extends Component {
...
@@ -1034,7 +1032,7 @@ export default class tableCom extends Component {
});
});
umiRequest
(
url
,
{
umiRequest
(
url
,
{
data
:
pp
,
data
:
pp
,
method
:
'POST'
,
method
:
'POST'
,
requestType
:
"form"
requestType
:
"form"
}).
then
(
data
=>
{
}).
then
(
data
=>
{
...
@@ -1046,17 +1044,17 @@ export default class tableCom extends Component {
...
@@ -1046,17 +1044,17 @@ export default class tableCom extends Component {
}
}
if
(
callback
)
{
if
(
callback
)
{
if
(
json
.
optionType
&&
json
.
optionType
==
"func"
)
{
if
(
json
.
optionType
&&
json
.
optionType
==
"func"
)
{
const
res
=
callback
(
data
)
const
res
=
callback
(
data
)
if
(
res
!=
null
&&!
(
typeof
res
===
"function"
))
{
if
(
res
!=
null
&&
!
(
typeof
res
===
"function"
))
{
this
.
setState
({
options
:
res
,
selectDis
:
false
},()
=>
{
this
.
setState
({
options
:
res
,
selectDis
:
false
},
()
=>
{
if
(
orgCallback
)
orgCallback
()
if
(
orgCallback
)
orgCallback
()
});
});
}
}
}
else
if
(
json
.
comName
==
"Button"
)
{
}
else
if
(
json
.
comName
==
"Button"
)
{
try
{
try
{
callback
(
data
)
callback
(
data
)
...
@@ -1109,7 +1107,7 @@ export default class tableCom extends Component {
...
@@ -1109,7 +1107,7 @@ export default class tableCom extends Component {
return
"norefeshxxxxxxxxxxxxxxxxxxxx"
return
"norefeshxxxxxxxxxxxxxxxxxxxx"
}
}
getFunctionValue
=
(
fun
,
column
,
json
,
callback
)
=>
{
getFunctionValue
=
(
fun
,
column
,
json
,
callback
)
=>
{
/* if (!this.props.isEdit) {
/* if (!this.props.isEdit) {
return
return
...
@@ -1117,27 +1115,27 @@ export default class tableCom extends Component {
...
@@ -1117,27 +1115,27 @@ export default class tableCom extends Component {
const
base52
=
column
.
base52
const
base52
=
column
.
base52
try
{
try
{
var
fun1
=
new
Function
(
"obj"
,
"init"
,
"defaultValues"
,
"env"
,
"index"
,
"fatherCode"
,
"utils"
,
fun
);
var
fun1
=
new
Function
(
"obj"
,
"init"
,
"defaultValues"
,
"env"
,
"index"
,
"fatherCode"
,
"utils"
,
fun
);
let
obj
let
obj
if
(
!
this
.
props
.
isEdit
&&
this
.
props
.
fatherCode
)
{
if
(
!
this
.
props
.
isEdit
&&
this
.
props
.
fatherCode
)
{
obj
=
{
...
this
.
props
.
fatherObj
,
...
this
.
props
.
form
.
getFieldsValue
(),
...
this
.
props
.
defaultValues
[
this
.
props
.
formKey
]
}
obj
=
{
...
this
.
props
.
fatherObj
,
...
this
.
props
.
form
.
getFieldsValue
(),
...
this
.
props
.
defaultValues
[
this
.
props
.
formKey
]
}
}
else
{
}
else
{
obj
=
{
...
this
.
props
.
obj
,
...
this
.
props
.
form
.
getFieldsValue
(),
...
this
.
props
.
defaultValues
[
this
.
props
.
formKey
]
}
obj
=
{
...
this
.
props
.
obj
,
...
this
.
props
.
form
.
getFieldsValue
(),
...
this
.
props
.
defaultValues
[
this
.
props
.
formKey
]
}
}
}
const
value
=
fun1
(
obj
,
this
.
props
.
init
,
this
.
props
.
defaultValues
,
{
clientType
:
this
.
props
.
get
,
formCode
:
this
.
props
.
formCode
,
formId
:
this
.
props
.
formId
},
this
.
props
.
index
,
this
.
props
.
fatherCode
,
const
value
=
fun1
(
obj
,
this
.
props
.
init
,
this
.
props
.
defaultValues
,
{
clientType
:
this
.
props
.
get
,
formCode
:
this
.
props
.
formCode
,
formId
:
this
.
props
.
formId
},
this
.
props
.
index
,
this
.
props
.
fatherCode
,
{
{
moment
:
moment
,
moment
:
moment
,
sql
:
this
.
sqlUtil
.
bind
(
this
,
base52
,
json
,
callback
),
sql
:
this
.
sqlUtil
.
bind
(
this
,
base52
,
json
,
callback
),
message
:
message
,
router
:
router
,
message
:
message
,
router
:
router
,
setValues
:
this
.
setValues
.
bind
(
this
,
base52
,
json
),
setValues
:
this
.
setValues
.
bind
(
this
,
base52
,
json
),
req
:
this
.
reqUtil
.
bind
(
this
,
base52
,
json
,
callback
),
req
:
this
.
reqUtil
.
bind
(
this
,
base52
,
json
,
callback
),
md5
:
md5
,
md5
:
md5
,
render
:
this
.
getRender
,
base64
:
getBase64
render
:
this
.
getRender
,
base64
:
getBase64
},
},
)
)
...
@@ -1155,12 +1153,12 @@ export default class tableCom extends Component {
...
@@ -1155,12 +1153,12 @@ export default class tableCom extends Component {
if
(
json
.
comName
==
"Button"
)
{
if
(
json
.
comName
==
"Button"
)
{
return
value
return
value
}
else
if
(
json
.
optionType
&&
json
.
optionType
==
"func"
)
{
}
else
if
(
json
.
optionType
&&
json
.
optionType
==
"func"
)
{
if
(
value
!=
null
&&!
(
typeof
value
===
"function"
))
{
if
(
value
!=
null
&&
!
(
typeof
value
===
"function"
))
{
this
.
setState
({
options
:
value
,
selectDis
:
false
},()
=>
{
this
.
setState
({
options
:
value
,
selectDis
:
false
},
()
=>
{
if
(
callback
)
callback
()
if
(
callback
)
callback
()
});
});
}
}
...
@@ -1206,14 +1204,14 @@ export default class tableCom extends Component {
...
@@ -1206,14 +1204,14 @@ export default class tableCom extends Component {
})
})
}
}
const
bindObj
=
this
.
getColumn
(
'c1'
);
const
bindObj
=
this
.
getColumn
(
'c1'
);
let
dataColumn
=
this
.
props
.
fatherCode
!=
null
?
(
bindObj
?{...
bindObj
,
base52
:
`
${
this
.
props
.
fatherCode
}
.[
${
this
.
props
.
index
}
].
${
bindObj
.
base52
}
`
}
:
let
dataColumn
=
this
.
props
.
fatherCode
!=
null
?
(
bindObj
?
{
...
bindObj
,
base52
:
`
${
this
.
props
.
fatherCode
}
.[
${
this
.
props
.
index
}
].
${
bindObj
.
base52
}
`
}
:
{
base52
:
`
${
this
.
props
.
fatherCode
}
.[
${
this
.
props
.
index
}
].
${
this
.
props
.
uuid
}
`
})
{
base52
:
`
${
this
.
props
.
fatherCode
}
.[
${
this
.
props
.
index
}
].
${
this
.
props
.
uuid
}
`
})
:
bindObj
;
:
bindObj
;
if
(
this
.
props
.
fatherCode
==
null
&&
dataColumn
==
null
)
dataColumn
=
{
base52
:
this
.
props
.
uuid
}
if
(
this
.
props
.
fatherCode
==
null
&&
dataColumn
==
null
)
dataColumn
=
{
base52
:
this
.
props
.
uuid
}
/* if (this.props.fatherCode != null) {
/* if (this.props.fatherCode != null) {
dataColumn = { base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}` }
dataColumn = { base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}` }
} else {
} else {
...
@@ -1229,11 +1227,11 @@ export default class tableCom extends Component {
...
@@ -1229,11 +1227,11 @@ export default class tableCom extends Component {
}
}
}
}
} */
} */
if
(
!
this
.
props
.
isEdit
&&
this
.
props
.
fatherCode
)
{
if
(
!
this
.
props
.
isEdit
&&
this
.
props
.
fatherCode
)
{
if
(
bindObj
!=
null
)
{
if
(
bindObj
!=
null
)
{
dataColumn
.
base52
=
bindObj
.
base52
dataColumn
.
base52
=
bindObj
.
base52
}
else
{
}
else
{
dataColumn
.
base52
=
this
.
props
.
uuid
dataColumn
.
base52
=
this
.
props
.
uuid
}
}
...
@@ -1257,11 +1255,11 @@ export default class tableCom extends Component {
...
@@ -1257,11 +1255,11 @@ export default class tableCom extends Component {
callback
:
options
=>
{
callback
:
options
=>
{
const
optionsx
=
[];
const
optionsx
=
[];
let
base52
=
dataColumn
.
base52
let
base52
=
dataColumn
.
base52
let
vl
=
this
.
props
.
form
.
getFieldValue
(
base52
)
let
vl
=
this
.
props
.
form
.
getFieldValue
(
base52
)
let
isExist
=
false
;
let
isExist
=
false
;
for
(
var
i
=
0
;
i
<
options
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
options
.
length
;
i
++
)
{
if
(
vl
==
options
[
i
][
valueName
]
&&!
isExist
)
{
if
(
vl
==
options
[
i
][
valueName
]
&&
!
isExist
)
{
isExist
=
true
;
isExist
=
true
;
}
}
optionsx
.
push
({
optionsx
.
push
({
label
:
options
[
i
][
labelName
],
label
:
options
[
i
][
labelName
],
...
@@ -1269,8 +1267,8 @@ export default class tableCom extends Component {
...
@@ -1269,8 +1267,8 @@ export default class tableCom extends Component {
});
});
}
}
if
(
!
isExist
&&
vl
!=
null
&&
options
.
length
>
0
)
{
if
(
!
isExist
&&
vl
!=
null
&&
options
.
length
>
0
)
{
this
.
props
.
form
.
setFieldsValue
({
[
base52
]:
null
})
this
.
props
.
form
.
setFieldsValue
({
[
base52
]:
null
})
}
}
this
.
setState
({
options
:
optionsx
,
selectDis
:
false
});
this
.
setState
({
options
:
optionsx
,
selectDis
:
false
});
},
},
...
@@ -1297,12 +1295,12 @@ export default class tableCom extends Component {
...
@@ -1297,12 +1295,12 @@ export default class tableCom extends Component {
payload
:
{
sqlKey
,
allValues
},
payload
:
{
sqlKey
,
allValues
},
callback
:
options
=>
{
callback
:
options
=>
{
let
base52
=
dataColumn
.
base52
let
base52
=
dataColumn
.
base52
let
vl
=
this
.
props
.
form
.
getFieldValue
(
base52
)
let
vl
=
this
.
props
.
form
.
getFieldValue
(
base52
)
const
optionsx
=
[];
const
optionsx
=
[];
let
isExist
=
false
;
let
isExist
=
false
;
for
(
var
i
=
0
;
i
<
options
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
options
.
length
;
i
++
)
{
if
(
vl
==
options
[
i
][
valueName
]
&&!
isExist
)
{
if
(
vl
==
options
[
i
][
valueName
]
&&
!
isExist
)
{
isExist
=
true
;
isExist
=
true
;
}
}
optionsx
.
push
({
optionsx
.
push
({
label
:
options
[
i
][
labelName
],
label
:
options
[
i
][
labelName
],
...
@@ -1310,9 +1308,9 @@ export default class tableCom extends Component {
...
@@ -1310,9 +1308,9 @@ export default class tableCom extends Component {
});
});
}
}
if
(
!
isExist
&&
vl
!=
null
&&
options
.
length
>
0
)
{
if
(
!
isExist
&&
vl
!=
null
&&
options
.
length
>
0
)
{
//console.log("isExist",optionsx,vl,isExist)
//console.log("isExist",optionsx,vl,isExist)
this
.
props
.
form
.
setFieldsValue
({[
base52
]:
null
})
this
.
props
.
form
.
setFieldsValue
({
[
base52
]:
null
})
}
}
this
.
setState
({
options
:
optionsx
,
selectDis
:
false
});
this
.
setState
({
options
:
optionsx
,
selectDis
:
false
});
...
@@ -1439,7 +1437,6 @@ export default class tableCom extends Component {
...
@@ -1439,7 +1437,6 @@ export default class tableCom extends Component {
const
{
options
,
labels
,
selectDis
}
=
this
.
state
;
const
{
options
,
labels
,
selectDis
}
=
this
.
state
;
const
{
getFieldDecorator
,
getFieldError
,
getFieldProps
}
=
this
.
props
.
form
;
const
{
getFieldDecorator
,
getFieldError
,
getFieldProps
}
=
this
.
props
.
form
;
const
disabled
=
json
!=
null
?
json
.
disabled
:
false
const
disabled
=
json
!=
null
?
json
.
disabled
:
false
if
(
json
==
null
)
{
if
(
json
==
null
)
{
return
<></>;
return
<></>;
}
}
...
@@ -1478,9 +1475,9 @@ export default class tableCom extends Component {
...
@@ -1478,9 +1475,9 @@ export default class tableCom extends Component {
if
(
json
.
comName
==
'Label'
)
{
if
(
json
.
comName
==
'Label'
)
{
let
uid
let
uid
if
(
this
.
props
.
fatherCode
!=
null
)
{
if
(
this
.
props
.
fatherCode
!=
null
)
{
uid
=
`
${
this
.
props
.
fatherCode
}
.[
${
this
.
props
.
index
}
].
${
this
.
props
.
uuid
}
`
uid
=
`
${
this
.
props
.
fatherCode
}
.[
${
this
.
props
.
index
}
].
${
this
.
props
.
uuid
}
`
}
else
{
}
else
{
uid
=
this
.
props
.
uuid
uid
=
this
.
props
.
uuid
}
}
if
(
!
isEdit
)
{
if
(
!
isEdit
)
{
...
@@ -1489,13 +1486,13 @@ export default class tableCom extends Component {
...
@@ -1489,13 +1486,13 @@ export default class tableCom extends Component {
if
(
this
.
props
.
fatherCode
!=
null
)
{
if
(
this
.
props
.
fatherCode
!=
null
)
{
return
<>
{
this
.
props
.
form
.
getFieldDecorator
(
uid
,
{
return
<>
{
this
.
props
.
form
.
getFieldDecorator
(
uid
,
{
initialValue
:
obj
[
this
.
props
.
uuid
]
||
json
.
initialValue
initialValue
:
obj
[
this
.
props
.
uuid
]
||
json
.
initialValue
})(<
Input
type=
"hidden"
/>)
}
<
span
style=
{
{
fontWeight
:
get
==
'mobile'
?
'bold'
:
''
,
marginRight
:
get
==
'mobile'
?
12
:
''
}
}
{
...
json
.
props
}
>
{
obj
[
this
.
props
.
uuid
]
||
json
.
initialValue
}
</
span
></>
})(<
Input
type=
"hidden"
/>)
}
<
span
style=
{
{
fontWeight
:
get
==
'mobile'
?
'bold'
:
''
,
marginRight
:
get
==
'mobile'
?
12
:
''
}
}
{
...
json
.
props
}
>
{
obj
[
this
.
props
.
uuid
]
||
json
.
initialValue
}
</
span
></>
}
else
{
}
else
{
return
<>
{
this
.
props
.
form
.
getFieldDecorator
(
uid
,
{
return
<>
{
this
.
props
.
form
.
getFieldDecorator
(
uid
,
{
initialValue
:
this
.
props
.
form
.
getFieldValue
(
uid
)
||
json
.
initialValue
initialValue
:
this
.
props
.
form
.
getFieldValue
(
uid
)
||
json
.
initialValue
})(<
Input
type=
"hidden"
/>)
}
<
span
style=
{
{
fontWeight
:
get
==
'mobile'
?
'bold'
:
''
,
marginRight
:
get
==
'mobile'
?
12
:
''
}
}
{
...
json
.
props
}
>
{
this
.
props
.
form
.
getFieldValue
(
uid
)
}
</
span
></>
})(<
Input
type=
"hidden"
/>)
}
<
span
style=
{
{
fontWeight
:
get
==
'mobile'
?
'bold'
:
''
,
marginRight
:
get
==
'mobile'
?
12
:
''
}
}
{
...
json
.
props
}
>
{
this
.
props
.
form
.
getFieldValue
(
uid
)
}
</
span
></>
...
@@ -1608,9 +1605,9 @@ export default class tableCom extends Component {
...
@@ -1608,9 +1605,9 @@ export default class tableCom extends Component {
break
;
break
;
case
'ImgUploadCom'
:
case
'ImgUploadCom'
:
if
(
value
==
null
||
value
==
""
)
{
if
(
value
==
null
||
value
==
""
)
{
cm
=
<
div
style=
{
{
width
:
json
.
width
,
height
:
json
.
height
}
}
></
div
>
cm
=
<
div
style=
{
{
width
:
json
.
width
,
height
:
json
.
height
}
}
></
div
>
}
else
{
}
else
{
cm
=
<>
cm
=
<>
<
img
src=
{
config
.
httpServer
+
value
}
style=
{
{
width
:
json
.
width
,
height
:
json
.
height
}
}
/>
<
img
src=
{
config
.
httpServer
+
value
}
style=
{
{
width
:
json
.
width
,
height
:
json
.
height
}
}
/>
{
{
...
@@ -1691,9 +1688,9 @@ export default class tableCom extends Component {
...
@@ -1691,9 +1688,9 @@ export default class tableCom extends Component {
var
cm
;
var
cm
;
var
required
=
false
;
var
required
=
false
;
const
bindObj
=
this
.
getColumn
(
'c1'
);
const
bindObj
=
this
.
getColumn
(
'c1'
);
let
dataColumn
=
this
.
props
.
fatherCode
!=
null
?
(
bindObj
?{...
bindObj
,
base52
:
`
${
this
.
props
.
fatherCode
}
.[
${
this
.
props
.
index
}
].
${
bindObj
.
base52
}
`
}
:
let
dataColumn
=
this
.
props
.
fatherCode
!=
null
?
(
bindObj
?
{
...
bindObj
,
base52
:
`
${
this
.
props
.
fatherCode
}
.[
${
this
.
props
.
index
}
].
${
bindObj
.
base52
}
`
}
:
{
base52
:
`
${
this
.
props
.
fatherCode
}
.[
${
this
.
props
.
index
}
].
${
this
.
props
.
uuid
}
`
})
{
base52
:
`
${
this
.
props
.
fatherCode
}
.[
${
this
.
props
.
index
}
].
${
this
.
props
.
uuid
}
`
})
...
@@ -1701,7 +1698,7 @@ export default class tableCom extends Component {
...
@@ -1701,7 +1698,7 @@ export default class tableCom extends Component {
if
(
this
.
props
.
fatherCode
==
null
&&
dataColumn
==
null
)
{
if
(
this
.
props
.
fatherCode
==
null
&&
dataColumn
==
null
)
{
dataColumn
=
{
base52
:
this
.
props
.
uuid
}
dataColumn
=
{
base52
:
this
.
props
.
uuid
}
}
}
if
(
!
dataColumn
.
isNull
)
{
if
(
!
dataColumn
.
isNull
)
{
...
@@ -1712,7 +1709,7 @@ export default class tableCom extends Component {
...
@@ -1712,7 +1709,7 @@ export default class tableCom extends Component {
var
initValue
;
var
initValue
;
if
(
init
!=
null
)
{
if
(
init
!=
null
)
{
if
(
this
.
props
.
fatherCode
!=
null
)
{
if
(
this
.
props
.
fatherCode
!=
null
)
{
initValue
=
init
[
this
.
props
.
index
]
!=
null
?
init
[
this
.
props
.
index
][
bindObj
?
bindObj
.
base52
:
this
.
props
.
uuid
]
:
null
;
initValue
=
init
[
this
.
props
.
index
]
!=
null
?
init
[
this
.
props
.
index
][
bindObj
?
bindObj
.
base52
:
this
.
props
.
uuid
]
:
null
;
}
else
{
}
else
{
initValue
=
init
[
dataColumn
.
base52
];
initValue
=
init
[
dataColumn
.
base52
];
...
@@ -1732,9 +1729,9 @@ export default class tableCom extends Component {
...
@@ -1732,9 +1729,9 @@ export default class tableCom extends Component {
if
(
!
isEdit
)
{
if
(
!
isEdit
)
{
if
(
this
.
props
.
fatherCode
)
{
if
(
this
.
props
.
fatherCode
)
{
if
(
bindObj
!=
null
)
{
if
(
bindObj
!=
null
)
{
dataColumn
.
base52
=
bindObj
.
base52
dataColumn
.
base52
=
bindObj
.
base52
}
else
{
}
else
{
dataColumn
.
base52
=
this
.
props
.
uuid
dataColumn
.
base52
=
this
.
props
.
uuid
}
}
...
@@ -1792,7 +1789,6 @@ export default class tableCom extends Component {
...
@@ -1792,7 +1789,6 @@ export default class tableCom extends Component {
break
;
break
;
case
'TableSelect'
:
case
'TableSelect'
:
const
ds
=
obj
[
dataColumn
.
base52
]
&&
obj
[
dataColumn
.
base52
].
selects
?
Object
.
values
(
obj
[
dataColumn
.
base52
].
selects
)
:
[]
const
ds
=
obj
[
dataColumn
.
base52
]
&&
obj
[
dataColumn
.
base52
].
selects
?
Object
.
values
(
obj
[
dataColumn
.
base52
].
selects
)
:
[]
if
(
json
.
showTable
)
{
if
(
json
.
showTable
)
{
cm
=
<
Table
columns=
{
this
.
state
.
columns
}
size=
"small"
dataSource=
{
ds
}
pagination=
{
false
}
/>;
cm
=
<
Table
columns=
{
this
.
state
.
columns
}
size=
"small"
dataSource=
{
ds
}
pagination=
{
false
}
/>;
...
@@ -1902,7 +1898,7 @@ export default class tableCom extends Component {
...
@@ -1902,7 +1898,7 @@ export default class tableCom extends Component {
);
);
}
}
}
else
{
}
else
{
cm
=
<
span
style=
{
{
display
:
'inline-block'
,
width
:
'100%'
,
textAlign
:
'center'
}
}
>
暂无附件
</
span
>
cm
=
<
span
style=
{
{
display
:
'inline-block'
,
width
:
'100%'
,
textAlign
:
'center'
}
}
>
暂无附件
</
span
>
}
}
...
@@ -1910,9 +1906,9 @@ export default class tableCom extends Component {
...
@@ -1910,9 +1906,9 @@ export default class tableCom extends Component {
case
'ImgUploadCom'
:
case
'ImgUploadCom'
:
if
(
obj
[
dataColumn
.
base52
]
==
null
||
obj
[
dataColumn
.
base52
]
==
""
)
{
if
(
obj
[
dataColumn
.
base52
]
==
null
||
obj
[
dataColumn
.
base52
]
==
""
)
{
cm
=
<
div
style=
{
{
width
:
json
.
width
,
height
:
json
.
height
}
}
></
div
>
cm
=
<
div
style=
{
{
width
:
json
.
width
,
height
:
json
.
height
}
}
></
div
>
}
else
{
}
else
{
cm
=
<
img
src=
{
config
.
httpServer
+
obj
[
dataColumn
.
base52
]
}
style=
{
{
width
:
json
.
width
,
height
:
json
.
height
}
}
/>;
cm
=
<
img
src=
{
config
.
httpServer
+
obj
[
dataColumn
.
base52
]
}
style=
{
{
width
:
json
.
width
,
height
:
json
.
height
}
}
/>;
}
}
...
@@ -1943,17 +1939,17 @@ export default class tableCom extends Component {
...
@@ -1943,17 +1939,17 @@ export default class tableCom extends Component {
if
(
json
.
events
!=
null
)
{
if
(
json
.
events
!=
null
)
{
events
=
this
.
getFunctionValue
(
json
.
events
,
{
base52
:
this
.
props
.
uuid
},
json
)
events
=
this
.
getFunctionValue
(
json
.
events
,
{
base52
:
this
.
props
.
uuid
},
json
)
}
}
if
(
events
&&
events
.
dom
)
{
if
(
events
&&
events
.
dom
)
{
cm
=
events
.
dom
cm
=
events
.
dom
}
else
{
}
else
{
const
ev
=
{
const
ev
=
{
children
:
json
.
initialValue
,
children
:
json
.
initialValue
,
...
events
...
events
}
}
if
(
json
.
isLink
)
{
if
(
json
.
isLink
)
{
cm
=
<
a
{
...
ev
}
/>
cm
=
<
a
{
...
ev
}
/>
}
else
{
}
else
{
cm
=
<
Button
loading=
{
this
.
props
.
loading
}
type=
"primary"
{
...
ev
}
/>
cm
=
<
Button
loading=
{
this
.
props
.
loading
}
type=
"primary"
{
...
ev
}
/>
}
}
}
}
...
@@ -2006,17 +2002,17 @@ export default class tableCom extends Component {
...
@@ -2006,17 +2002,17 @@ export default class tableCom extends Component {
if
(
json
.
events
!=
null
)
{
if
(
json
.
events
!=
null
)
{
events
=
this
.
getFunctionValue
(
json
.
events
,
{
base52
:
this
.
props
.
uuid
},
json
)
events
=
this
.
getFunctionValue
(
json
.
events
,
{
base52
:
this
.
props
.
uuid
},
json
)
}
}
if
(
events
&&
events
.
dom
)
{
if
(
events
&&
events
.
dom
)
{
cm
=
events
.
dom
cm
=
events
.
dom
}
else
{
}
else
{
const
ev
=
{
const
ev
=
{
children
:
json
.
initialValue
,
children
:
json
.
initialValue
,
...
events
...
events
}
}
if
(
json
.
isLink
)
{
if
(
json
.
isLink
)
{
cm
=
<
a
{
...
ev
}
/>
cm
=
<
a
{
...
ev
}
/>
}
else
{
}
else
{
cm
=
<
Button
loading=
{
this
.
props
.
loading
}
type=
"primary"
{
...
ev
}
/>
cm
=
<
Button
loading=
{
this
.
props
.
loading
}
type=
"primary"
{
...
ev
}
/>
}
}
}
}
...
@@ -2119,7 +2115,7 @@ export default class tableCom extends Component {
...
@@ -2119,7 +2115,7 @@ export default class tableCom extends Component {
cm
=
(
cm
=
(
<
MobileList
<
MobileList
>
>
<
Item
arrow=
"empty"
multipleLine
onClick=
{
()
=>
{}
}
>
<
Item
arrow=
"empty"
multipleLine
onClick=
{
()
=>
{
}
}
>
{
json
.
isLabel
?
{
json
.
isLabel
?
title
?
title
?
<
span
className=
{
styles
.
text
}
>
<
span
className=
{
styles
.
text
}
>
...
@@ -2303,10 +2299,10 @@ export default class tableCom extends Component {
...
@@ -2303,10 +2299,10 @@ export default class tableCom extends Component {
placeholder=
{
json
.
placeholder
}
placeholder=
{
json
.
placeholder
}
style=
{
{
width
:
json
.
width
}
}
style=
{
{
width
:
json
.
width
}
}
optionFilterProp=
"children"
optionFilterProp=
"children"
onFocus=
{
()
=>
{
onFocus=
{
()
=>
{
get
===
'mobile'
?
// 移动端取消输入键盘弹出
get
===
'mobile'
?
// 移动端取消输入键盘弹出
setTimeout
(()
=>
{
setTimeout
(()
=>
{
if
(
document
.
querySelectorAll
(
`.ant-select-search__field`
).
length
>
0
)
{
if
(
document
.
querySelectorAll
(
`.ant-select-search__field`
).
length
>
0
)
{
let
ary
=
[...
document
.
querySelectorAll
(
`.ant-select-search__field`
)]
let
ary
=
[...
document
.
querySelectorAll
(
`.ant-select-search__field`
)]
ary
.
map
(
item
=>
{
ary
.
map
(
item
=>
{
item
.
setAttribute
(
'readonly'
,
'readonly'
);
item
.
setAttribute
(
'readonly'
,
'readonly'
);
...
@@ -2319,7 +2315,7 @@ export default class tableCom extends Component {
...
@@ -2319,7 +2315,7 @@ export default class tableCom extends Component {
})
})
}
}
})
})
:
null
:
null
}
}
}
}
filterOption=
{
(
input
,
option
)
=>
filterOption=
{
(
input
,
option
)
=>
option
?
option
.
props
.
children
.
toLowerCase
().
indexOf
(
input
.
toLowerCase
())
>=
0
:
false
option
?
option
.
props
.
children
.
toLowerCase
().
indexOf
(
input
.
toLowerCase
())
>=
0
:
false
...
@@ -2346,13 +2342,12 @@ export default class tableCom extends Component {
...
@@ -2346,13 +2342,12 @@ export default class tableCom extends Component {
break;
break;
case 'TableSelect':
case 'TableSelect':
cm = getFieldDecorator(dataColumn.base52,
{
cm = getFieldDecorator(dataColumn.base52,
{
initialValue
:
initValue
||
{},
initialValue
:
initValue
||
{},
rules
:
[{
rules
:
json
.
vlds
&&
json
.
vlds
.
length
>
0
?
json
.
vlds
:
[{
validator
:
(
rule
,
value
,
callback
)
=>
{
validator
:
(
rule
,
value
,
callback
)
=>
{
if
(
Object
.
keys
(
value
).
length
==
0
&&
required
!=
null
&&
required
)
{
if
(
(
Object
.
keys
(
value
).
length
==
0
||
Object
.
keys
(
value
.
selects
).
length
==
0
)
&&
required
!=
null
&&
required
)
{
var
errors
=
[]
var
errors
=
[]
errors
.
push
(
new
Error
(
'请选择至少一个'
,
rule
.
field
))
errors
.
push
(
new
Error
(
'请选择至少一个'
,
rule
.
field
))
}
}
...
@@ -2460,7 +2455,7 @@ export default class tableCom extends Component {
...
@@ -2460,7 +2455,7 @@ export default class tableCom extends Component {
//
}
//
}
var iv = null;
var iv = null;
if (initValue != null)
{
if (initValue != null)
{
iv
=
moment
(
typeof
initValue
===
'string'
?
+
initValue
:
initValue
);
iv
=
moment
(
typeof
initValue
===
'string'
?
+
initValue
:
initValue
);
}
}
// console.log(iv,json.format)
// console.log(iv,json.format)
cm = getFieldDecorator(dataColumn.base52,
{
cm = getFieldDecorator(dataColumn.base52,
{
...
@@ -2469,16 +2464,16 @@ export default class tableCom extends Component {
...
@@ -2469,16 +2464,16 @@ export default class tableCom extends Component {
}
)(
<
DatePicker
}
)(
<
DatePicker
disabled=
{
disabled
}
disabled=
{
disabled
}
showTime
showTime
onOpenChange
=
{
get
===
'
mobile
'?
()
=
>
{
// 取消唤起移动端小键盘
onOpenChange=
{
get
===
'mobile'
?
()
=>
{
// 取消唤起移动端小键盘
setTimeout
(()
=>
{
setTimeout
(()
=>
{
if
(
document
.
querySelector
(
'.ant-calendar-input '
))
{
if
(
document
.
querySelector
(
'.ant-calendar-input '
))
{
document
.
querySelector
(
'.ant-calendar-input '
).
setAttribute
(
'readonly'
,
'readonly'
);
document
.
querySelector
(
'.ant-calendar-input '
).
setAttribute
(
'readonly'
,
'readonly'
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
document
.
querySelector
(
'.ant-calendar-input '
).
removeAttribute
(
'readonly'
);
document
.
querySelector
(
'.ant-calendar-input '
).
removeAttribute
(
'readonly'
);
});
});
}
}
});
});
}
:()=
>
{
}
}
}
:
()
=>
{
}
}
format=
{
json
.
format
?
json
.
format
:
'YYYY-MM-DD HH:mm:ss'
}
/>
);
format=
{
json
.
format
?
json
.
format
:
'YYYY-MM-DD HH:mm:ss'
}
/>
);
if (get === 'mobile'
&&
json.isLabel
&&
title)
{
if (get === 'mobile'
&&
json.isLabel
&&
title)
{
cm
=
<
Form
.
Item
cm
=
<
Form
.
Item
...
@@ -2595,7 +2590,7 @@ export default class tableCom extends Component {
...
@@ -2595,7 +2590,7 @@ export default class tableCom extends Component {
cm
=
<></>
cm
=
<></>
}
else
{
}
else
{
cm
=
<>
{
getFieldDecorator
(
dataColumn
.
base52
||
this
.
props
.
uuid
,
{
cm
=
<>
{
getFieldDecorator
(
dataColumn
.
base52
||
this
.
props
.
uuid
,
{
initialValue
:
initValue
||
{}
initialValue
:
initValue
||
{}
})(<
TableList
isHiddenPage=
{
json
.
isHiddenPage
}
showHeader=
{
json
.
showHeader
}
loading=
{
this
.
props
.
loading
}
pageSize=
{
json
.
pageSize
}
objCode=
{
json
.
objCode
}
sql=
{
json
.
filterSql
}
rights=
{
json
.
rights
}
/>)
}
</>
})(<
TableList
isHiddenPage=
{
json
.
isHiddenPage
}
showHeader=
{
json
.
showHeader
}
loading=
{
this
.
props
.
loading
}
pageSize=
{
json
.
pageSize
}
objCode=
{
json
.
objCode
}
sql=
{
json
.
filterSql
}
rights=
{
json
.
rights
}
/>)
}
</>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论