Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
8023831e
提交
8023831e
authored
7月 06, 2021
作者:
钟是志
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
18715 学生提给老师的咨询信息,老师还能编辑,按钮已做限制,但未生效
上级
d90700ef
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
70 行增加
和
20 行删除
+70
-20
TableSelect.js
FormInsertDiy/AffairPage/component/TableSelect.js
+1
-0
TableSelect.js
one_stop_public/libs/TableSelect.js
+38
-5
UploadCom.js
one_stop_public/libs/UploadCom.js
+21
-9
TreeList.js
one_stop_public/libs/formList/TreeList.js
+2
-2
index.jsx
one_stop_public/tableCompon/index.jsx
+8
-4
没有找到文件。
FormInsertDiy/AffairPage/component/TableSelect.js
浏览文件 @
8023831e
...
...
@@ -248,6 +248,7 @@ export default class TableSelect extends Component {
value
:
one
[
valueName
],
});
}
return
(
<
Fragment
>
{
!
showModal
?
(
...
...
one_stop_public/libs/TableSelect.js
浏览文件 @
8023831e
...
...
@@ -85,7 +85,6 @@ export default class TableSelect extends React.Component {
const
{
dataSource
,
json
}
=
this
.
props
;
let
{
valueName
,
optionType
}
=
json
;
const
{
list
}
=
dataSource
;
console
.
log
(
list
);
if
(
optionType
==
'reference'
&&
this
.
props
.
dataColumn
.
referenceObjId
)
{
valueName
=
this
.
props
.
dataColumn
.
referenceCodeName
;
}
...
...
@@ -136,6 +135,30 @@ export default class TableSelect extends React.Component {
this
.
triggerChange
({
visiable
:
false
});
};
cancelOne
=
(
record
)
=>
{
var
{
selects
}
=
this
.
state
;
const
{
json
:
{
isMultiple
,
optionType
},
}
=
this
.
props
;
let
valueName
=
this
.
props
.
json
.
valueName
;
if
(
optionType
==
'reference'
&&
this
.
props
.
dataColumn
.
referenceObjId
)
{
valueName
=
this
.
props
.
dataColumn
.
referenceCodeName
;
}
const
kk
=
record
[
valueName
];
if
(
kk
==
null
)
{
message
.
error
(
'指定的取值字段不存在或者值为空'
);
return
;
}
if
(
selects
[
kk
])
{
delete
selects
[
kk
];
}
if
(
!
(
'value'
in
this
.
props
))
{
this
.
setState
({
selects
});
}
this
.
triggerChange
({
selects
});
};
render
()
{
const
{
...
...
@@ -144,6 +167,7 @@ export default class TableSelect extends React.Component {
sqlModel
,
columns
,
dataSource
,
disabled
,
}
=
this
.
props
;
let
{
valueName
,
labelName
}
=
this
.
props
.
json
;
if
(
optionType
==
'reference'
&&
referenceObjId
)
{
...
...
@@ -171,7 +195,12 @@ export default class TableSelect extends React.Component {
title
:
'操作'
,
render
:
(
val
,
record
)
=>
keys
.
includes
(
record
[
valueName
])
?
(
<
span
>
已选择
<
/span
>
<
a
onClick
=
{()
=>
{
this
.
cancelOne
(
record
);
}}
>
已选择
<
/a
>
)
:
(
<
a
onClick
=
{
this
.
select
.
bind
(
this
,
record
)}
>
选择
<
/a
>
),
...
...
@@ -205,8 +234,9 @@ export default class TableSelect extends React.Component {
});
}
// console.log(this.props);
// console.log(this.state);
console
.
log
(
this
.
props
);
console
.
log
(
this
.
state
);
console
.
log
(
'-0000 TableSelect000'
);
return
(
<
div
>
{
Object
.
keys
(
selects
).
length
>
0
?
(
...
...
@@ -220,7 +250,7 @@ export default class TableSelect extends React.Component {
/
>
)
:
(
Object
.
keys
(
selects
).
map
((
k
)
=>
(
<
Tag
key
=
{
k
}
closable
onClose
=
{
this
.
remove
.
bind
(
this
,
k
)}
>
<
Tag
key
=
{
k
}
closable
=
{
!
disabled
}
onClose
=
{
this
.
remove
.
bind
(
this
,
k
)}
>
{
selects
[
k
][
labelName
]}
<
/Tag
>
))
...
...
@@ -228,9 +258,12 @@ export default class TableSelect extends React.Component {
)
:
(
''
)}
{
!
disabled
&&
(
<
Button
type
=
"primary"
onClick
=
{
this
.
open
}
>
选择
<
/Button
>
)}
{
visiable
&&
(
<
Modal
width
=
{
this
.
props
.
get
===
'mobile'
?
'100%'
:
'60%'
}
...
...
one_stop_public/libs/UploadCom.js
浏览文件 @
8023831e
import
React
from
'react'
;
import
{
Tree
,
Upload
,
Icon
,
Button
,
message
}
from
'antd'
;
import
{
queryApiActionPath
}
from
'../utils/queryConfig'
;
import
config
from
'@/webPublic/one_stop_public/config'
;
import
React
from
"react"
;
import
{
Button
,
Icon
,
message
,
Upload
}
from
"antd"
;
import
{
queryApiActionPath
}
from
"../utils/queryConfig"
;
import
config
from
"@/webPublic/one_stop_public/config"
;
export
default
class
UploadCom
extends
React
.
Component
{
constructor
(
props
)
{
...
...
@@ -19,6 +19,7 @@ export default class UploadCom extends React.Component {
onChange
(
Object
.
assign
({},
this
.
state
,
changedValue
));
}
};
componentWillReceiveProps
(
nextProps
)
{
// Should be a controlled component.
if
(
'value'
in
nextProps
)
{
...
...
@@ -26,6 +27,7 @@ export default class UploadCom extends React.Component {
this
.
setState
(
value
);
}
}
changeUrl
=
(
info
)
=>
{
if
(
info
.
file
.
status
===
'done'
)
{
message
.
success
(
`
${
info
.
file
.
name
}
上传成功`
);
...
...
@@ -52,9 +54,10 @@ export default class UploadCom extends React.Component {
}
this
.
triggerChange
({
files
});
};
render
()
{
const
{
files
}
=
this
.
state
;
const
{
isMultiple
,
accept
,
btnName
}
=
this
.
props
;
const
{
isMultiple
,
accept
,
btnName
,
disabled
}
=
this
.
props
;
const
props
=
{
name
:
'file'
,
multiple
:
isMultiple
,
...
...
@@ -63,27 +66,34 @@ export default class UploadCom extends React.Component {
showUploadList
:
false
,
onChange
:
this
.
changeUrl
,
};
console
.
log
(
'---------asdasd-------'
,
this
.
props
,
this
.
state
);
return
(
<
div
>
{
' '
}
<
Upload
{...
props
}
>
<
Upload
{...
props
}
disabled
=
{
disabled
}
>
{
!
disabled
&&
(
<
Button
>
<
Icon
type
=
"upload"
/>
{
btnName
?
btnName
:
'上传附件'
}
<
/Button
>
)}
<
/Upload
>
<
ul
style
=
{{
paddingLeft
:
8
}}
>
{
files
.
map
((
f
)
=>
{
if
((
f
.
path
&&
f
.
path
.
indexOf
(
'.png'
)
!=
-
1
)
||
f
.
path
.
indexOf
(
'.jpg'
)
!
=
-
1
)
{
{
(
files
||
[])
.
map
((
f
)
=>
{
if
((
f
.
path
&&
f
.
path
.
indexOf
(
'.png'
)
!=
=
-
1
)
||
f
.
path
.
indexOf
(
'.jpg'
)
!=
=
-
1
)
{
return
(
<
li
key
=
{
f
.
path
}
>
<
img
style
=
{{
width
:
100
,
height
:
100
}}
src
=
{
queryApiActionPath
()
+
f
.
path
}
/
>
<
img
style
=
{{
width
:
100
,
height
:
100
}}
src
=
{
queryApiActionPath
()
+
f
.
path
}
onClick
=
{()
=>
{
window
.
open
(
queryApiActionPath
()
+
f
.
path
);
}}
/
>
{
!
disabled
&&
(
<
Icon
style
=
{{
marginLeft
:
10
}}
type
=
"delete"
onClick
=
{
this
.
remove
.
bind
(
this
,
f
.
path
)}
/
>
)}
<
/li
>
);
}
...
...
@@ -92,11 +102,13 @@ export default class UploadCom extends React.Component {
<
a
target
=
"_blank"
key
=
{
f
.
path
}
href
=
{
queryApiActionPath
()
+
f
.
path
}
>
{
f
.
name
}
<
/a>{' '
}
{
!
disabled
&&
(
<
Icon
style
=
{{
marginLeft
:
10
}}
type
=
"delete"
onClick
=
{
this
.
remove
.
bind
(
this
,
f
.
path
)}
/
>
)}
<
/li
>
);
})}
...
...
one_stop_public/libs/formList/TreeList.js
浏览文件 @
8023831e
...
...
@@ -828,7 +828,7 @@ class TreeList extends React.Component {
);
};
getItem
=
(
isQuery
,
form
,
item
,
isAdd
,
formData
,
labelCol
,
wrapperCol
)
=>
{
const
{
groups
}
=
this
.
state
;
const
{
groups
,
isView
}
=
this
.
state
;
if
(
item
.
isPrimaryKey
)
{
if
(
isAdd
)
{
return
<><
/>
;
...
...
@@ -893,7 +893,7 @@ class TreeList extends React.Component {
?
JSON
.
parse
(
formData
[
item
.
name
])
:
null
,
rules
:
[{
required
:
!
item
.
isNull
}],
})(
<
UploadCom
/>
)}
})(
<
UploadCom
disabled
=
{
isView
}
/>
)
}
<
/FormItem
>
);
}
else
if
(
isQuery
&&
item
.
isGroupQuery
!=
null
&&
item
.
isGroupQuery
)
{
...
...
one_stop_public/tableCompon/index.jsx
浏览文件 @
8023831e
...
...
@@ -2868,6 +2868,7 @@ export default class tableCom extends Component {
<
TableSelect
get=
{
get
}
json=
{
json
}
disabled=
{
!
isEdit
}
dataColumn=
{
dataColumn
}
columns=
{
this
.
state
.
columns
}
dataSource=
{
this
.
state
.
dataSource
}
...
...
@@ -3020,6 +3021,8 @@ export default class tableCom extends Component {
if
(
initValue
!=
null
&&
!
isEmpty
(
initValue
.
files
))
{
files
=
initValue
.
files
;
}
cm
=
getFieldDecorator
(
dataColumn
.
base52
,
{
initialValue
:
{
files
:
files
},
rules
:
[
...
...
@@ -3036,7 +3039,11 @@ export default class tableCom extends Component {
},
],
})(
<
UploadCom
isMultiple=
{
json
.
isMultiple
}
accept=
{
json
.
accept
}
btnName=
{
json
.
btnName
}
/>,
<
UploadCom
isMultiple=
{
json
.
isMultiple
}
accept=
{
json
.
accept
}
btnName=
{
json
.
btnName
}
disabled=
{
disabled
||
isPreview
}
/>,
);
if
(
get
===
'mobile'
&&
...
...
@@ -3124,9 +3131,6 @@ export default class tableCom extends Component {
}
break
;
case
'ChildForm'
:
// console.log(dataColumn.base52, '----key-ChildForm--'); // KUSyCzEhdCJ
// console.log(JSON.stringify(this.props.form.getFieldsValue()), '----formValue----');
// console.log(JSON.stringify(initValue)); // undefined
cm
=
getFieldDecorator
(
dataColumn
.
base52
,
{
initialValue
:
initValue
||
{}
})(
<
ChildForm
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论