Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
d24d3eaf
提交
d24d3eaf
authored
5月 12, 2021
作者:
钟是志
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
自定义导入bug
上级
ca6a992d
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
88 行增加
和
80 行删除
+88
-80
index.js
one_stop_public/App/StatisticsInfo/index.js
+1
-1
TreeList.js
one_stop_public/libs/formList/TreeList.js
+85
-77
index.js
one_stop_public/libs/formList/config/index.js
+2
-0
index.js
one_stop_public/libs/formList/index.js
+0
-2
没有找到文件。
one_stop_public/App/StatisticsInfo/index.js
浏览文件 @
d24d3eaf
...
@@ -459,7 +459,7 @@ export default class StatisticsInfo extends React.Component {
...
@@ -459,7 +459,7 @@ export default class StatisticsInfo extends React.Component {
};
};
componentDidMount
()
{
componentDidMount
()
{
this
.
open
();
//
this.open();
}
}
pageConfig
=
(
item
=
0
)
=>
{
pageConfig
=
(
item
=
0
)
=>
{
...
...
one_stop_public/libs/formList/TreeList.js
浏览文件 @
d24d3eaf
...
@@ -35,6 +35,7 @@ import { isEmpty } from 'lodash';
...
@@ -35,6 +35,7 @@ import { isEmpty } from 'lodash';
import
FilePreview
from
'@/webPublic/one_stop_public/filePreview'
;
import
FilePreview
from
'@/webPublic/one_stop_public/filePreview'
;
import
{
queryApiActionPath
}
from
'@/webPublic/one_stop_public/utils/queryConfig'
;
import
{
queryApiActionPath
}
from
'@/webPublic/one_stop_public/utils/queryConfig'
;
import
UploadCom
from
'@/webPublic/one_stop_public/libs/UploadCom'
;
import
UploadCom
from
'@/webPublic/one_stop_public/libs/UploadCom'
;
const
FormItem
=
Form
.
Item
;
const
FormItem
=
Form
.
Item
;
let
AllWidth
=
0
;
// 表格总长度
let
AllWidth
=
0
;
// 表格总长度
const
{
RangePicker
}
=
DatePicker
;
const
{
RangePicker
}
=
DatePicker
;
...
@@ -72,7 +73,7 @@ const text = [
...
@@ -72,7 +73,7 @@ const text = [
const
number
=
[
'BIGINT'
,
'DOUBLE'
,
'FLOAT'
,
'INT'
,
'INTEGER'
,
'NUMERIC'
,
'SMALLINT'
,
'TINYINT'
];
const
number
=
[
'BIGINT'
,
'DOUBLE'
,
'FLOAT'
,
'INT'
,
'INTEGER'
,
'NUMERIC'
,
'SMALLINT'
,
'TINYINT'
];
const
data
=
[
'DATE'
,
'DATETIME'
,
'TIME'
,
'TIMESTAMP'
,
'YEAR'
];
const
data
=
[
'DATE'
,
'DATETIME'
,
'TIME'
,
'TIMESTAMP'
,
'YEAR'
];
const
CreateForm
=
Form
.
create
()(
props
=>
{
const
CreateForm
=
Form
.
create
()(
(
props
)
=>
{
const
{
const
{
modalVisible
,
modalVisible
,
form
,
form
,
...
@@ -129,8 +130,7 @@ const CreateForm = Form.create()(props => {
...
@@ -129,8 +130,7 @@ const CreateForm = Form.create()(props => {
]
]
}
}
onOk
=
{
okHandle
}
onOk
=
{
okHandle
}
onCancel
=
{()
=>
handleModalVisible
()}
onCancel
=
{()
=>
handleModalVisible
()}
>
>
{
formItem
.
map
((
item
,
index
)
=>
{
formItem
.
map
((
item
,
index
)
=>
getItem
(
false
,
form
,
item
,
isAdd
,
formData
,
{
span
:
5
},
{
span
:
15
}),
getItem
(
false
,
form
,
item
,
isAdd
,
formData
,
{
span
:
5
},
{
span
:
15
}),
)}
)}
...
@@ -200,16 +200,16 @@ class TreeList extends React.Component {
...
@@ -200,16 +200,16 @@ class TreeList extends React.Component {
dispatch
({
dispatch
({
type
:
'formList/getBatchOptions'
,
type
:
'formList/getBatchOptions'
,
payload
:
{
ids
:
refIds
},
payload
:
{
ids
:
refIds
},
callback
:
options
=>
{
callback
:
(
options
)
=>
{
this
.
setState
({
options
:
{
...
this
.
state
.
options
,
...
options
}
});
this
.
setState
({
options
:
{
...
this
.
state
.
options
,
...
options
}
});
},
},
});
});
}
}
};
};
getList
=
(
values
,
callback
,
isFirst
)
=>
{
getList
=
(
values
,
callback
,
isFirst
)
=>
{
const
{
const
{
dispatch
,
dispatch
,
json
:
{
treeParentIdName
,
ctgFilterSql
},
json
:
{
treeParentIdName
,
ctgFilterSql
},
}
=
this
.
props
;
}
=
this
.
props
;
if
(
!
values
)
{
if
(
!
values
)
{
...
@@ -218,11 +218,16 @@ class TreeList extends React.Component {
...
@@ -218,11 +218,16 @@ class TreeList extends React.Component {
dispatch
({
dispatch
({
type
:
'formList/tree'
,
type
:
'formList/tree'
,
payload
:
{
...
values
,
ctgFilterSql
:
ctgFilterSql
,
parentIdName
:
treeParentIdName
,
dataObjId
:
this
.
state
.
objId
},
payload
:
{
...
values
,
ctgFilterSql
:
ctgFilterSql
,
parentIdName
:
treeParentIdName
,
dataObjId
:
this
.
state
.
objId
,
},
callback
:
callback
,
callback
:
callback
,
});
});
};
};
modify
=
record
=>
{
modify
=
(
record
)
=>
{
// if (this.state.formItem.length < 10) {
// if (this.state.formItem.length < 10) {
this
.
getOptions
();
this
.
getOptions
();
this
.
setState
({
this
.
setState
({
...
@@ -245,7 +250,7 @@ class TreeList extends React.Component {
...
@@ -245,7 +250,7 @@ class TreeList extends React.Component {
// }
// }
};
};
view
=
record
=>
{
view
=
(
record
)
=>
{
// if (this.state.formItem.length < 10) {
// if (this.state.formItem.length < 10) {
this
.
getOptions
();
this
.
getOptions
();
this
.
setState
({
this
.
setState
({
...
@@ -268,7 +273,7 @@ class TreeList extends React.Component {
...
@@ -268,7 +273,7 @@ class TreeList extends React.Component {
// }
// }
};
};
isJSON
=
str
=>
{
isJSON
=
(
str
)
=>
{
if
(
typeof
str
==
'string'
)
{
if
(
typeof
str
==
'string'
)
{
try
{
try
{
var
obj
=
JSON
.
parse
(
str
);
var
obj
=
JSON
.
parse
(
str
);
...
@@ -285,7 +290,7 @@ class TreeList extends React.Component {
...
@@ -285,7 +290,7 @@ class TreeList extends React.Component {
console
.
log
(
'这不是个字符串'
);
console
.
log
(
'这不是个字符串'
);
};
};
delete
=
record
=>
{
delete
=
(
record
)
=>
{
//找出主键
//找出主键
let
Keys
=
{};
let
Keys
=
{};
Keys
[
this
.
state
.
primaryKey
]
=
record
[
this
.
state
.
primaryKey
];
Keys
[
this
.
state
.
primaryKey
]
=
record
[
this
.
state
.
primaryKey
];
...
@@ -296,7 +301,7 @@ class TreeList extends React.Component {
...
@@ -296,7 +301,7 @@ class TreeList extends React.Component {
objId
:
this
.
state
.
objId
,
objId
:
this
.
state
.
objId
,
},
},
callback
:
()
=>
{
callback
:
()
=>
{
this
.
getPage
({
parentId
:
this
.
state
.
parentId
},
null
,
null
,
list
=>
{
this
.
getPage
({
parentId
:
this
.
state
.
parentId
},
null
,
null
,
(
list
)
=>
{
const
treeData
=
this
.
refesh
(
this
.
state
.
parentId
,
list
,
this
.
state
.
treeData
);
const
treeData
=
this
.
refesh
(
this
.
state
.
parentId
,
list
,
this
.
state
.
treeData
);
this
.
setState
({
this
.
setState
({
modalVisible
:
false
,
modalVisible
:
false
,
...
@@ -307,14 +312,14 @@ class TreeList extends React.Component {
...
@@ -307,14 +312,14 @@ class TreeList extends React.Component {
});
});
};
};
viewProcess
=
record
=>
{
viewProcess
=
(
record
)
=>
{
const
{
dispatch
}
=
this
.
props
;
const
{
dispatch
}
=
this
.
props
;
dispatch
({
dispatch
({
type
:
'formList/getAppId'
,
type
:
'formList/getAppId'
,
payload
:
{
payload
:
{
code
:
record
.
process_biz_key
,
code
:
record
.
process_biz_key
,
},
},
callback
:
data
=>
{
callback
:
(
data
)
=>
{
router
.
push
({
pathname
:
'/portal/serviceCentre/getdetail'
,
state
:
{
id
:
data
.
id
}
});
router
.
push
({
pathname
:
'/portal/serviceCentre/getdetail'
,
state
:
{
id
:
data
.
id
}
});
},
},
});
});
...
@@ -323,7 +328,7 @@ class TreeList extends React.Component {
...
@@ -323,7 +328,7 @@ class TreeList extends React.Component {
/**
/**
* 宽度自适应函数
* 宽度自适应函数
*/
*/
resize
=
e
=>
{
resize
=
(
e
)
=>
{
let
scrollWidth
=
document
.
documentElement
.
clientWidth
||
document
.
body
.
clientWidth
;
//可使宽度
let
scrollWidth
=
document
.
documentElement
.
clientWidth
||
document
.
body
.
clientWidth
;
//可使宽度
let
showMobileDiv
=
scrollWidth
-
77
;
let
showMobileDiv
=
scrollWidth
-
77
;
if
(
document
.
querySelector
(
'#previewDiv'
))
{
if
(
document
.
querySelector
(
'#previewDiv'
))
{
...
@@ -337,6 +342,7 @@ class TreeList extends React.Component {
...
@@ -337,6 +342,7 @@ class TreeList extends React.Component {
});
});
}
}
};
};
//渲染值
//渲染值
componentDidMount
()
{
componentDidMount
()
{
const
{
dispatch
,
isFormCom
,
isSelect
,
callback
,
valueName
}
=
this
.
props
;
const
{
dispatch
,
isFormCom
,
isSelect
,
callback
,
valueName
}
=
this
.
props
;
...
@@ -350,19 +356,19 @@ class TreeList extends React.Component {
...
@@ -350,19 +356,19 @@ class TreeList extends React.Component {
dispatch
({
dispatch
({
type
:
'DataObj/findByCode'
,
type
:
'DataObj/findByCode'
,
payload
:
{
objCode
:
this
.
props
.
objCode
},
payload
:
{
objCode
:
this
.
props
.
objCode
},
callback
:
dataObj
=>
{
callback
:
(
dataObj
)
=>
{
this
.
setState
({
objId
:
dataObj
.
id
,
isTable
:
data
.
isTable
},
()
=>
{
this
.
setState
({
objId
:
dataObj
.
id
,
isTable
:
data
.
isTable
},
()
=>
{
dispatch
({
dispatch
({
type
:
'DataRight/getUserRight'
,
type
:
'DataRight/getUserRight'
,
payload
:
{
objId
:
this
.
state
.
objId
},
payload
:
{
objId
:
this
.
state
.
objId
},
callback
:
data
=>
{
callback
:
(
data
)
=>
{
if
(
!
this
.
props
.
rights
)
{
if
(
!
this
.
props
.
rights
)
{
this
.
setState
({
rights
:
data
});
this
.
setState
({
rights
:
data
});
}
}
dispatch
({
dispatch
({
type
:
'DataRight/getUserColumnRight'
,
type
:
'DataRight/getUserColumnRight'
,
payload
:
{
objId
:
this
.
state
.
objId
},
payload
:
{
objId
:
this
.
state
.
objId
},
callback
:
data
=>
{
callback
:
(
data
)
=>
{
this
.
setState
({
columnRights
:
data
});
this
.
setState
({
columnRights
:
data
});
this
.
initColumn
();
this
.
initColumn
();
},
},
...
@@ -377,21 +383,21 @@ class TreeList extends React.Component {
...
@@ -377,21 +383,21 @@ class TreeList extends React.Component {
dispatch
({
dispatch
({
type
:
'formList/getObjDetail'
,
type
:
'formList/getObjDetail'
,
payload
:
{
id
:
this
.
state
.
objId
},
payload
:
{
id
:
this
.
state
.
objId
},
callback
:
data
=>
{
callback
:
(
data
)
=>
{
this
.
setState
({
isTable
:
data
.
isTable
});
this
.
setState
({
isTable
:
data
.
isTable
});
},
},
});
});
dispatch
({
dispatch
({
type
:
'DataRight/getUserRight'
,
type
:
'DataRight/getUserRight'
,
payload
:
{
objId
:
this
.
state
.
objId
},
payload
:
{
objId
:
this
.
state
.
objId
},
callback
:
data
=>
{
callback
:
(
data
)
=>
{
if
(
!
this
.
props
.
rights
)
{
if
(
!
this
.
props
.
rights
)
{
this
.
setState
({
rights
:
data
});
this
.
setState
({
rights
:
data
});
}
}
dispatch
({
dispatch
({
type
:
'DataRight/getUserColumnRight'
,
type
:
'DataRight/getUserColumnRight'
,
payload
:
{
objId
:
this
.
state
.
objId
},
payload
:
{
objId
:
this
.
state
.
objId
},
callback
:
data
=>
{
callback
:
(
data
)
=>
{
this
.
setState
({
columnRights
:
data
});
this
.
setState
({
columnRights
:
data
});
this
.
initColumn
();
this
.
initColumn
();
},
},
...
@@ -400,13 +406,16 @@ class TreeList extends React.Component {
...
@@ -400,13 +406,16 @@ class TreeList extends React.Component {
});
});
}
}
}
}
/**
/**
* 移除监听器
* 移除监听器
*/
*/
componentWillUnmount
()
{
componentWillUnmount
()
{
window
.
removeEventListener
(
'resize'
,
this
.
resize
);
window
.
removeEventListener
(
'resize'
,
this
.
resize
);
}
}
custom
=
this
.
props
.
value
?
Base16Encode
(
JSON
.
stringify
(
this
.
props
.
value
))
:
null
;
custom
=
this
.
props
.
value
?
Base16Encode
(
JSON
.
stringify
(
this
.
props
.
value
))
:
null
;
componentWillReceiveProps
(
nextProps
)
{
componentWillReceiveProps
(
nextProps
)
{
const
b
=
nextProps
.
value
||
{};
const
b
=
nextProps
.
value
||
{};
const
a
=
this
.
props
.
value
||
{};
const
a
=
this
.
props
.
value
||
{};
...
@@ -434,6 +443,7 @@ class TreeList extends React.Component {
...
@@ -434,6 +443,7 @@ class TreeList extends React.Component {
this
.
setState
({
selects
:
x
});
this
.
setState
({
selects
:
x
});
}
}
}
}
initColumn
=
()
=>
{
initColumn
=
()
=>
{
const
{
dispatch
,
isFormCom
,
isSelect
,
callback
,
valueName
}
=
this
.
props
;
const
{
dispatch
,
isFormCom
,
isSelect
,
callback
,
valueName
}
=
this
.
props
;
...
@@ -448,7 +458,7 @@ class TreeList extends React.Component {
...
@@ -448,7 +458,7 @@ class TreeList extends React.Component {
dispatch
({
dispatch
({
type
:
'formList/getHead'
,
type
:
'formList/getHead'
,
payload
:
{
dataObjId
:
this
.
state
.
objId
},
payload
:
{
dataObjId
:
this
.
state
.
objId
},
callback
:
datas
=>
{
callback
:
(
datas
)
=>
{
const
querys
=
[];
const
querys
=
[];
const
refIds
=
[];
const
refIds
=
[];
const
groups
=
{};
const
groups
=
{};
...
@@ -471,7 +481,7 @@ class TreeList extends React.Component {
...
@@ -471,7 +481,7 @@ class TreeList extends React.Component {
continue
;
continue
;
}
}
if
(
data
.
includes
(
datas
[
t
].
type
))
{
if
(
data
.
includes
(
datas
[
t
].
type
))
{
column
.
render
=
val
=>
{
column
.
render
=
(
val
)
=>
{
if
(
val
==
null
)
{
if
(
val
==
null
)
{
return
val
;
return
val
;
}
}
...
@@ -482,10 +492,10 @@ class TreeList extends React.Component {
...
@@ -482,10 +492,10 @@ class TreeList extends React.Component {
}
}
};
};
}
else
if
(
datas
[
t
].
name
.
indexOf
(
'process_status'
)
>
-
1
)
{
}
else
if
(
datas
[
t
].
name
.
indexOf
(
'process_status'
)
>
-
1
)
{
column
.
render
=
val
=>
(
val
?
(
val
===
'0'
?
'审核通过'
:
'审核未通过'
)
:
null
);
column
.
render
=
(
val
)
=>
(
val
?
(
val
===
'0'
?
'审核通过'
:
'审核未通过'
)
:
null
);
}
else
if
(
datas
[
t
].
extendTypeId
&&
datas
[
t
].
extendTypeId
.
indexOf
(
'file'
)
>
-
1
)
{
}
else
if
(
datas
[
t
].
extendTypeId
&&
datas
[
t
].
extendTypeId
.
indexOf
(
'file'
)
>
-
1
)
{
//特殊处理附件
//特殊处理附件
column
.
render
=
val
=>
{
column
.
render
=
(
val
)
=>
{
if
(
this
.
isJSON
(
val
))
{
if
(
this
.
isJSON
(
val
))
{
val
=
JSON
.
parse
(
val
);
val
=
JSON
.
parse
(
val
);
let
files
=
val
.
files
;
let
files
=
val
.
files
;
...
@@ -506,7 +516,7 @@ class TreeList extends React.Component {
...
@@ -506,7 +516,7 @@ class TreeList extends React.Component {
}
}
};
};
}
else
{
}
else
{
column
.
render
=
val
=>
column
.
render
=
(
val
)
=>
val
&&
val
.
length
>
100
?
(
val
&&
val
.
length
>
100
?
(
<
Tooltip
title
=
{
val
}
overlayStyle
=
{{
width
:
1000
}}
>
<
Tooltip
title
=
{
val
}
overlayStyle
=
{{
width
:
1000
}}
>
<
span
<
span
...
@@ -517,8 +527,7 @@ class TreeList extends React.Component {
...
@@ -517,8 +527,7 @@ class TreeList extends React.Component {
whiteSpace
:
'nowrap'
,
whiteSpace
:
'nowrap'
,
overflow
:
'hidden'
,
overflow
:
'hidden'
,
textOverflow
:
'ellipsis'
,
textOverflow
:
'ellipsis'
,
}}
}}
>
>
{
val
}
{
val
}
<
/span
>
<
/span
>
<
/Tooltip
>
<
/Tooltip
>
...
@@ -539,7 +548,7 @@ class TreeList extends React.Component {
...
@@ -539,7 +548,7 @@ class TreeList extends React.Component {
dispatch
({
dispatch
({
type
:
'formList/getGroupList'
,
type
:
'formList/getGroupList'
,
payload
:
{
columnId
:
datas
[
t
].
id
},
payload
:
{
columnId
:
datas
[
t
].
id
},
callback
:
gourp
=>
{
callback
:
(
gourp
)
=>
{
groups
[
datas
[
t
].
id
]
=
gourp
;
groups
[
datas
[
t
].
id
]
=
gourp
;
this
.
setState
({
groups
});
this
.
setState
({
groups
});
},
},
...
@@ -554,7 +563,7 @@ class TreeList extends React.Component {
...
@@ -554,7 +563,7 @@ class TreeList extends React.Component {
dispatch
({
dispatch
({
type
:
'formList/getBatchOptions'
,
type
:
'formList/getBatchOptions'
,
payload
:
{
ids
:
refIds
},
payload
:
{
ids
:
refIds
},
callback
:
options
=>
{
callback
:
(
options
)
=>
{
this
.
setState
({
options
});
this
.
setState
({
options
});
},
},
});
});
...
@@ -588,7 +597,7 @@ class TreeList extends React.Component {
...
@@ -588,7 +597,7 @@ class TreeList extends React.Component {
if
(
this
.
props
.
objCode
&&
(
this
.
props
.
objCode
==
'1'
||
this
.
props
.
objCode
==
1
))
{
if
(
this
.
props
.
objCode
&&
(
this
.
props
.
objCode
==
'1'
||
this
.
props
.
objCode
==
1
))
{
if
(
callPage
)
{
if
(
callPage
)
{
callPage
(
params
,
data
=>
{
callPage
(
params
,
(
data
)
=>
{
if
(
!
this
.
state
.
isReady
)
{
if
(
!
this
.
state
.
isReady
)
{
this
.
setState
({
data
,
isReady
:
true
});
this
.
setState
({
data
,
isReady
:
true
});
}
else
{
}
else
{
...
@@ -596,7 +605,7 @@ class TreeList extends React.Component {
...
@@ -596,7 +605,7 @@ class TreeList extends React.Component {
}
}
});
});
}
else
if
(
this
.
props
.
value
&&
this
.
props
.
value
.
getPage
)
{
}
else
if
(
this
.
props
.
value
&&
this
.
props
.
value
.
getPage
)
{
this
.
props
.
value
.
getPage
(
params
,
data
=>
{
this
.
props
.
value
.
getPage
(
params
,
(
data
)
=>
{
if
(
!
this
.
state
.
isReady
)
{
if
(
!
this
.
state
.
isReady
)
{
this
.
setState
({
data
,
isReady
:
true
});
this
.
setState
({
data
,
isReady
:
true
});
}
else
{
}
else
{
...
@@ -614,7 +623,7 @@ class TreeList extends React.Component {
...
@@ -614,7 +623,7 @@ class TreeList extends React.Component {
sql
:
this
.
sqlBs16
,
sql
:
this
.
sqlBs16
,
dataObjId
:
this
.
state
.
objId
,
dataObjId
:
this
.
state
.
objId
,
},
},
callback
:
list
=>
{
callback
:
(
list
)
=>
{
const
data
=
{
const
data
=
{
list
:
list
,
list
:
list
,
pagination
:
false
,
pagination
:
false
,
...
@@ -673,7 +682,7 @@ class TreeList extends React.Component {
...
@@ -673,7 +682,7 @@ class TreeList extends React.Component {
callback
:
()
=>
{
callback
:
()
=>
{
message
.
success
(
'操作成功'
);
message
.
success
(
'操作成功'
);
this
.
getPage
({
parentId
:
this
.
state
.
parentId
},
null
,
null
,
list
=>
{
this
.
getPage
({
parentId
:
this
.
state
.
parentId
},
null
,
null
,
(
list
)
=>
{
const
treeData
=
this
.
refesh
(
this
.
state
.
parentId
,
list
,
this
.
state
.
treeData
);
const
treeData
=
this
.
refesh
(
this
.
state
.
parentId
,
list
,
this
.
state
.
treeData
);
this
.
setState
({
this
.
setState
({
modalVisible
:
false
,
modalVisible
:
false
,
...
@@ -700,15 +709,9 @@ class TreeList extends React.Component {
...
@@ -700,15 +709,9 @@ class TreeList extends React.Component {
isAdd
:
true
,
isAdd
:
true
,
isView
:
false
,
isView
:
false
,
});
});
// } else {
// router.push({
// pathname: '/admin/ddl/dataObj/formEdit',
// state: { id: this.state.objId,isAdd: true,isView:false }
// });
// }
};
};
handleSelectRows
=
rows
=>
{
handleSelectRows
=
(
rows
)
=>
{
if
(
this
.
props
.
onSelectRow
)
{
if
(
this
.
props
.
onSelectRow
)
{
this
.
props
.
onSelectRow
(
rows
);
this
.
props
.
onSelectRow
(
rows
);
}
}
...
@@ -717,7 +720,7 @@ class TreeList extends React.Component {
...
@@ -717,7 +720,7 @@ class TreeList extends React.Component {
});
});
};
};
batchDelete
=
e
=>
{
batchDelete
=
(
e
)
=>
{
const
{
dispatch
}
=
this
.
props
;
const
{
dispatch
}
=
this
.
props
;
const
{
selectedRows
}
=
this
.
state
;
const
{
selectedRows
}
=
this
.
state
;
...
@@ -729,7 +732,7 @@ class TreeList extends React.Component {
...
@@ -729,7 +732,7 @@ class TreeList extends React.Component {
for
(
let
i
in
columns
)
{
for
(
let
i
in
columns
)
{
if
(
columns
[
i
].
isPrimaryKey
)
{
if
(
columns
[
i
].
isPrimaryKey
)
{
//key
//key
Keys
[
columns
[
i
].
name
]
=
selectedRows
.
map
(
row
=>
row
[
columns
[
i
].
name
]).
join
(
','
);
Keys
[
columns
[
i
].
name
]
=
selectedRows
.
map
((
row
)
=>
row
[
columns
[
i
].
name
]).
join
(
','
);
}
}
}
}
this
.
props
.
dispatch
({
this
.
props
.
dispatch
({
...
@@ -751,7 +754,7 @@ class TreeList extends React.Component {
...
@@ -751,7 +754,7 @@ class TreeList extends React.Component {
goBack
=
()
=>
{
goBack
=
()
=>
{
router
.
goBack
();
router
.
goBack
();
};
};
handleSearch
=
e
=>
{
handleSearch
=
(
e
)
=>
{
e
.
preventDefault
();
e
.
preventDefault
();
const
{
dispatch
,
form
}
=
this
.
props
;
const
{
dispatch
,
form
}
=
this
.
props
;
...
@@ -790,7 +793,7 @@ class TreeList extends React.Component {
...
@@ -790,7 +793,7 @@ class TreeList extends React.Component {
});
});
};
};
hanldeHighSearch
=
e
=>
{
hanldeHighSearch
=
(
e
)
=>
{
const
pagination
=
this
.
props
.
formList
.
data
.
pagination
;
const
pagination
=
this
.
props
.
formList
.
data
.
pagination
;
let
params
=
{
let
params
=
{
pageNo
:
pagination
.
current
?
pagination
.
current
:
1
,
pageNo
:
pagination
.
current
?
pagination
.
current
:
1
,
...
@@ -838,7 +841,7 @@ class TreeList extends React.Component {
...
@@ -838,7 +841,7 @@ class TreeList extends React.Component {
rules
:
[{
required
:
!
item
.
isNull
}],
rules
:
[{
required
:
!
item
.
isNull
}],
})(
})(
<
Select
style
=
{{
width
:
'70%'
}}
placeholder
=
"请选择"
allowClear
>
<
Select
style
=
{{
width
:
'70%'
}}
placeholder
=
"请选择"
allowClear
>
{
ops
.
map
(
r
=>
(
{
ops
.
map
((
r
)
=>
(
<
Option
value
=
{
r
[
item
.
referenceCodeName
]}
key
=
{
r
[
item
.
referenceCodeName
]}
>
<
Option
value
=
{
r
[
item
.
referenceCodeName
]}
key
=
{
r
[
item
.
referenceCodeName
]}
>
{
r
[
item
.
referenceNameName
]}
{
r
[
item
.
referenceNameName
]}
<
/Option
>
<
/Option
>
...
@@ -892,7 +895,7 @@ class TreeList extends React.Component {
...
@@ -892,7 +895,7 @@ class TreeList extends React.Component {
rules
:
[{
required
:
!
item
.
isNull
}],
rules
:
[{
required
:
!
item
.
isNull
}],
})(
})(
<
Select
style
=
{{
width
:
'70%'
}}
placeholder
=
"请选择"
allowClear
>
<
Select
style
=
{{
width
:
'70%'
}}
placeholder
=
"请选择"
allowClear
>
{
ops
.
map
(
r
=>
(
{
ops
.
map
((
r
)
=>
(
<
Option
value
=
{
r
.
value
}
key
=
{
r
.
value
}
>
<
Option
value
=
{
r
.
value
}
key
=
{
r
.
value
}
>
{
r
.
value
}
{
r
.
value
}
<
/Option
>
<
/Option
>
...
@@ -976,7 +979,7 @@ class TreeList extends React.Component {
...
@@ -976,7 +979,7 @@ class TreeList extends React.Component {
return
(
return
(
<
Form
layout
=
"inline"
>
<
Form
layout
=
"inline"
>
<
Row
style
=
{{
padding
:
'15px'
}}
>
<
Row
style
=
{{
padding
:
'15px'
}}
>
{
querys
.
map
(
item
=>
(
{
querys
.
map
((
item
)
=>
(
<
Col
style
=
{{
height
:
58
}}
span
=
{
get
===
'mobile'
?
24
:
8
}
key
=
{
item
.
id
}
>
<
Col
style
=
{{
height
:
58
}}
span
=
{
get
===
'mobile'
?
24
:
8
}
key
=
{
item
.
id
}
>
{
this
.
getItem
(
{
this
.
getItem
(
true
,
true
,
...
@@ -995,8 +998,7 @@ class TreeList extends React.Component {
...
@@ -995,8 +998,7 @@ class TreeList extends React.Component {
style
=
{{
style
=
{{
textAlign
:
get
===
'mobile'
?
'right'
:
''
,
textAlign
:
get
===
'mobile'
?
'right'
:
''
,
paddingRight
:
get
===
'mobile'
?
12
:
''
,
paddingRight
:
get
===
'mobile'
?
12
:
''
,
}}
}}
>
>
<
span
className
=
{
styles
.
submitButtons
}
>
<
span
className
=
{
styles
.
submitButtons
}
>
<
Button
type
=
"primary"
loading
=
{
this
.
props
.
loading
}
onClick
=
{
this
.
handleSearch
}
>
<
Button
type
=
"primary"
loading
=
{
this
.
props
.
loading
}
onClick
=
{
this
.
handleSearch
}
>
查询
查询
...
@@ -1013,6 +1015,7 @@ class TreeList extends React.Component {
...
@@ -1013,6 +1015,7 @@ class TreeList extends React.Component {
<
/Form
>
<
/Form
>
);
);
}
}
onSelect
=
(
selectedKeys
,
info
)
=>
{
onSelect
=
(
selectedKeys
,
info
)
=>
{
if
(
info
.
selectedNodes
.
length
>
0
)
{
if
(
info
.
selectedNodes
.
length
>
0
)
{
const
parentId
=
selectedKeys
[
0
]
!=
'0-0'
?
selectedKeys
[
0
]
:
null
;
const
parentId
=
selectedKeys
[
0
]
!=
'0-0'
?
selectedKeys
[
0
]
:
null
;
...
@@ -1020,29 +1023,33 @@ class TreeList extends React.Component {
...
@@ -1020,29 +1023,33 @@ class TreeList extends React.Component {
this
.
getPage
({
parentId
:
parentId
});
this
.
getPage
({
parentId
:
parentId
});
}
}
};
};
onLoadData
=
treeNode
=>
{
onLoadData
=
(
treeNode
)
=>
{
return
new
Promise
(
resolve
=>
{
return
new
Promise
((
resolve
)
=>
{
if
(
treeNode
.
props
.
childs
)
{
if
(
treeNode
.
props
.
childs
)
{
resolve
();
resolve
();
return
;
return
;
}
}
const
parentId
=
treeNode
.
props
.
eventKey
!=
'0-0'
?
treeNode
.
props
.
eventKey
:
null
;
const
parentId
=
treeNode
.
props
.
eventKey
!=
'0-0'
?
treeNode
.
props
.
eventKey
:
null
;
this
.
getList
({
parentId
:
parentId
},
list
=>
{
this
.
getList
(
{
parentId
:
parentId
},
(
list
)
=>
{
treeNode
.
props
.
dataRef
.
childs
=
list
;
treeNode
.
props
.
dataRef
.
childs
=
list
;
this
.
setState
({
this
.
setState
({
treeData
:
[...
this
.
state
.
treeData
],
treeData
:
[...
this
.
state
.
treeData
],
});
});
resolve
();
resolve
();
},
true
);
},
true
,
);
});
});
};
};
renderTreeNodes
=
list
=>
{
renderTreeNodes
=
(
list
)
=>
{
const
{
const
{
json
:
{
treeTitleName
,
treeKeyName
},
json
:
{
treeTitleName
,
treeKeyName
},
}
=
this
.
props
;
}
=
this
.
props
;
return
list
.
map
(
item
=>
{
return
list
.
map
((
item
)
=>
{
item
.
title
=
item
[
treeTitleName
];
item
.
title
=
item
[
treeTitleName
];
item
.
key
=
item
[
treeKeyName
];
item
.
key
=
item
[
treeKeyName
];
if
(
item
.
childs
)
{
if
(
item
.
childs
)
{
...
@@ -1073,6 +1080,7 @@ class TreeList extends React.Component {
...
@@ -1073,6 +1080,7 @@ class TreeList extends React.Component {
return
data
;
return
data
;
};
};
render
()
{
render
()
{
const
{
modalVisible
,
selectedRows
,
querys
,
tableWidth
,
rights
,
data
,
isReady
}
=
this
.
state
;
const
{
modalVisible
,
selectedRows
,
querys
,
tableWidth
,
rights
,
data
,
isReady
}
=
this
.
state
;
if
(
!
isReady
)
{
if
(
!
isReady
)
{
...
@@ -1191,8 +1199,7 @@ class TreeList extends React.Component {
...
@@ -1191,8 +1199,7 @@ class TreeList extends React.Component {
title
=
"确定删除该数据?"
title
=
"确定删除该数据?"
onConfirm
=
{
this
.
delete
.
bind
(
this
,
record
)}
onConfirm
=
{
this
.
delete
.
bind
(
this
,
record
)}
okText
=
"确定"
okText
=
"确定"
cancelText
=
"取消"
cancelText
=
"取消"
>
>
<
a
>
删除
<
/a
>
<
a
>
删除
<
/a
>
<
/Popconfirm
>
<
/Popconfirm
>
<
/
>
<
/
>
...
@@ -1250,8 +1257,7 @@ class TreeList extends React.Component {
...
@@ -1250,8 +1257,7 @@ class TreeList extends React.Component {
showLine
showLine
defaultExpandedKeys
=
{[
'0-0'
]}
defaultExpandedKeys
=
{[
'0-0'
]}
onSelect
=
{
this
.
onSelect
}
onSelect
=
{
this
.
onSelect
}
loadData
=
{
this
.
onLoadData
}
loadData
=
{
this
.
onLoadData
}
>
>
{
this
.
renderTreeNodes
(
this
.
state
.
treeData
)}
{
this
.
renderTreeNodes
(
this
.
state
.
treeData
)}
<
/Tree
>
<
/Tree
>
<
/Card
>
<
/Card
>
...
@@ -1269,7 +1275,7 @@ class TreeList extends React.Component {
...
@@ -1269,7 +1275,7 @@ class TreeList extends React.Component {
<
/Button
>
<
/Button
>
)}
)}
{
btns
&&
btns
.
before
&&
btns
.
before
.
length
>
0
{
btns
&&
btns
.
before
&&
btns
.
before
.
length
>
0
?
btns
.
before
.
map
(
r
=>
<
Button
{...
r
}
/>
)
?
btns
.
before
.
map
((
r
)
=>
<
Button
{...
r
}
/>
)
:
''
}
:
''
}
{
rights
&&
!
rights
.
includes
(
'add'
)
?
(
{
rights
&&
!
rights
.
includes
(
'add'
)
?
(
''
''
...
@@ -1302,17 +1308,21 @@ class TreeList extends React.Component {
...
@@ -1302,17 +1308,21 @@ class TreeList extends React.Component {
/
>
/
>
)}
)}
{
this
.
props
.
value
&&
this
.
props
.
value
.
exportConfig
?
{
this
.
props
.
value
&&
this
.
props
.
value
.
exportConfig
?
this
.
props
.
value
.
exportConfig
.
map
((
r
,
i
)
=>
(
this
.
props
.
value
.
exportConfig
.
map
((
r
,
i
)
=>
<
ExportCurrentInfo
<
ExportCurrentInfo
objId
=
{
this
.
state
.
objId
}
objId
=
{
this
.
state
.
objId
}
query
=
{
JSON
.
stringify
(
this
.
state
.
formValues
)}
query
=
{
JSON
.
stringify
(
this
.
state
.
formValues
)}
custom
=
{
this
.
props
.
value
?
Base16Encode
(
JSON
.
stringify
(
this
.
props
.
value
))
:
null
}
custom
=
{
index
=
{
i
}
this
.
props
.
value
?
Base16Encode
(
JSON
.
stringify
(
this
.
props
.
value
))
:
null
btn
=
{
r
.
btn
}
}
ext
=
{
r
.
ext
?
r
.
ext
:
"xlsx"
}
index
=
{
i
}
sql
=
{
Base16Encode
(
this
.
props
.
sql
)}
btn
=
{
r
.
btn
}
/>
)
:""
}
ext
=
{
r
.
ext
?
r
.
ext
:
'xlsx'
}
sql
=
{
Base16Encode
(
this
.
props
.
sql
)}
/
>
))
:
''
}
{
rights
&&
!
rights
.
includes
(
'exportData'
)
?
(
{
rights
&&
!
rights
.
includes
(
'exportData'
)
?
(
''
''
)
:
(
)
:
(
...
@@ -1331,14 +1341,13 @@ sql={Base16Encode(this.props.sql)}
...
@@ -1331,14 +1341,13 @@ sql={Base16Encode(this.props.sql)}
title
=
"确定删除该数据?"
title
=
"确定删除该数据?"
onConfirm
=
{
this
.
batchDelete
}
onConfirm
=
{
this
.
batchDelete
}
okText
=
"确定"
okText
=
"确定"
cancelText
=
"取消"
cancelText
=
"取消"
>
>
<
Button
>
批量删除
<
/Button
>
<
Button
>
批量删除
<
/Button
>
<
/Popconfirm
>
<
/Popconfirm
>
<
/span
>
<
/span
>
)}
)}
{
btns
&&
btns
.
after
&&
btns
.
after
.
length
>
0
{
btns
&&
btns
.
after
&&
btns
.
after
.
length
>
0
?
btns
.
after
.
map
(
r
=>
<
Button
{...
r
}
loading
=
{
loading
}
/>
)
?
btns
.
after
.
map
((
r
)
=>
<
Button
{...
r
}
loading
=
{
loading
}
/>
)
:
''
}
:
''
}
<
/div
>
<
/div
>
{
!
istableCom
||
(
this
.
props
.
value
&&
this
.
props
.
value
.
columns
)
?
(
{
!
istableCom
||
(
this
.
props
.
value
&&
this
.
props
.
value
.
columns
)
?
(
...
@@ -1365,8 +1374,7 @@ sql={Base16Encode(this.props.sql)}
...
@@ -1365,8 +1374,7 @@ sql={Base16Encode(this.props.sql)}
overflow
:
'hidden'
,
overflow
:
'hidden'
,
width
:
isMobile
?
showMobileDiv
:
showDiv
,
width
:
isMobile
?
showMobileDiv
:
showDiv
,
height
:
'100%'
,
height
:
'100%'
,
}}
}}
>
>
<
div
>
<
div
>
{
get
===
'mobile'
?
<
div
>
手机端
,
请将手机横屏查看
<
/div> : null
}
{
get
===
'mobile'
?
<
div
>
手机端
,
请将手机横屏查看
<
/div> : null
}
{
showDiv
&&
(
{
showDiv
&&
(
...
...
one_stop_public/libs/formList/config/index.js
浏览文件 @
d24d3eaf
...
@@ -111,4 +111,6 @@ const getFormArrayConfig = (header,isAdd,options) => {
...
@@ -111,4 +111,6 @@ const getFormArrayConfig = (header,isAdd,options) => {
return
config
;
return
config
;
};
};
export
{
text
,
number
,
date
,
getFormArrayConfig
};
export
{
text
,
number
,
date
,
getFormArrayConfig
};
one_stop_public/libs/formList/index.js
浏览文件 @
d24d3eaf
...
@@ -4,12 +4,10 @@ import {
...
@@ -4,12 +4,10 @@ import {
Card
,
Card
,
DatePicker
,
DatePicker
,
Divider
,
Divider
,
Table
,
Form
,
Form
,
Row
,
Row
,
Col
,
Col
,
Input
,
Input
,
InputNumber
,
message
,
message
,
Modal
,
Modal
,
Select
,
Select
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论