Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
5e2391ef
提交
5e2391ef
authored
12月 13, 2021
作者:
钟是志
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
流程发起按钮修改 显示条件 通过 isCloseStart 判断
上级
92a611a6
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
305 行增加
和
272 行删除
+305
-272
index.js
FormInsertDiy/AffairPage/ApplyPage/index.js
+305
-272
没有找到文件。
FormInsertDiy/AffairPage/ApplyPage/index.js
浏览文件 @
5e2391ef
...
@@ -19,291 +19,324 @@ import pageSetting from './pageSetting';
...
@@ -19,291 +19,324 @@ import pageSetting from './pageSetting';
import
ButtonDiy
from
'@/baseComponent/ButtonDiy'
;
import
ButtonDiy
from
'@/baseComponent/ButtonDiy'
;
import
Shell
from
'@/baseComponent/Shell'
;
import
Shell
from
'@/baseComponent/Shell'
;
import
config
from
'@/config/config'
;
import
config
from
'@/config/config'
;
import
{
deepCopy
}
from
'@/webPublic/zyd_public/utils/utils'
;
export
default
function
index
(
props
)
{
export
default
function
index
(
props
)
{
const
{
state
=
{}
}
=
props
.
location
;
const
{
state
=
{}
}
=
props
.
location
;
if
(
state
.
justApply
)
{
if
(
state
.
justApply
)
{
return
<
JustApply
{...
props
}
/>
;
return
<
JustApply
{...
props
}
/>
;
}
else
{
}
else
{
return
<
AffairPage
{...
props
}
/>
;
return
<
AffairPage
{...
props
}
/>
;
}
}
}
}
class
AffairPage
extends
React
.
Component
{
class
AffairPage
extends
React
.
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
let
pathname
=
this
.
props
.
location
.
pathname
;
let
pathname
=
this
.
props
.
location
.
pathname
;
const
{
dataBaseId
,
workId
}
=
this
.
props
;
const
{
dataBaseId
,
workId
}
=
this
.
props
;
this
.
state
=
{
this
.
state
=
{
showIframe
:
false
,
showIframe
:
false
,
columns
:
[],
columns
:
[],
pathname
,
pathname
,
workId
:
workId
||
''
,
workId
:
workId
||
''
,
searchCondition
:
[],
searchCondition
:
[],
dataBaseId
:
''
,
dataBaseId
:
''
,
addFields
:
[],
// 新增时填写的字段。
addFields
:
[],
// 新增时填写的字段。
renderIframe
:
true
,
renderIframe
:
true
,
};
allConfigSetInfo
:
null
,
}
};
}
getFormDetail
=
(
workId
)
=>
{
getFormDetail
=
(
workId
)
=>
{
service
.
getFormDetail
(
workId
).
then
((
response
)
=>
{
service
.
getFormDetail
(
workId
).
then
((
response
)
=>
{
if
(
typeof
response
.
unifiedServicePatternModel
===
'undefined'
)
{
if
(
typeof
response
.
unifiedServicePatternModel
===
'undefined'
)
{
return
false
;
return
false
;
}
}
destructionFunc
.
destructionGetDetail
(
response
).
then
((
x
)
=>
{
destructionFunc
.
destructionGetDetail
(
response
).
then
((
x
)
=>
{
const
{
addFields
,
tableInfo
,
allConfigSetInfo
}
=
x
;
const
{
addFields
,
tableInfo
,
allConfigSetInfo
}
=
x
;
this
.
setState
(
this
.
setState
(
{
{
addFields
,
addFields
,
tableInfo
,
tableInfo
,
allConfigSetInfo
,
allConfigSetInfo
,
},
},
()
=>
{
()
=>
{
this
.
giveDetailColumns
();
this
.
giveDetailColumns
();
},
},
);
);
});
});
});
});
};
};
giveDetailColumns
=
()
=>
{
giveDetailColumns
=
()
=>
{
const
{
columns
,
workId
,
dataBaseId
,
addFields
}
=
this
.
state
;
const
{
columns
,
workId
,
dataBaseId
,
addFields
}
=
this
.
state
;
const
process_status
=
columns
.
find
((
x
)
=>
{
const
process_status
=
columns
.
find
((
x
)
=>
{
return
x
.
name
===
'process_status'
;
return
x
.
name
===
'process_status'
;
});
});
if
(
process_status
&&
process_status
.
dataIndex
)
{
if
(
process_status
&&
process_status
.
dataIndex
)
{
process_status
.
render
=
(
text
,
record
)
=>
{
process_status
.
render
=
(
text
,
record
)
=>
{
return
record
.
statusName
||
record
[
process_status
.
dataIndex
];
return
record
.
statusName
||
record
[
process_status
.
dataIndex
];
};
};
}
}
columns
.
push
({
columns
.
push
({
dataIndex
:
'operation'
,
dataIndex
:
'operation'
,
title
:
'操作'
,
title
:
'操作'
,
fixed
:
columns
.
length
>
12
?
'right'
:
false
,
fixed
:
columns
.
length
>
12
?
'right'
:
false
,
render
:
(
text
,
record
)
=>
{
render
:
(
text
,
record
)
=>
{
return
(
return
(
<
Link
<
Link
to
=
{{
to
=
{{
pathname
:
'./Detail'
,
pathname
:
'./Detail'
,
state
:
{
state
:
{
workId
,
workId
,
dataBaseId
,
dataBaseId
,
record
,
record
,
addFields
,
addFields
,
},
},
}}
>
}}
>
详情
详情
<
/Link
>
<
/Link
>
);
);
},
},
});
});
this
.
setState
({
this
.
setState
({
columns
,
columns
,
});
});
};
};
handleButtonSet
=
()
=>
{
handleButtonSet
=
()
=>
{
const
{
canApply
,
otherButtons
=
[]
}
=
this
.
props
;
const
{
canApply
,
otherButtons
=
[]
}
=
this
.
props
;
if
(
canApply
===
false
)
{
const
{
allConfigSetInfo
}
=
this
.
state
;
return
[...
otherButtons
];
if
(
!
allConfigSetInfo
)
{
}
return
[];
return
[
}
{
const
isCloseStart
=
allConfigSetInfo
?.
isCloseStart
;
type
:
'add'
,
// if(isCloseStart){
name
:
'申请'
,
// setTimeout(()=>{
component
:
'Normal'
,
// this.setState({
handleClick
:
()
=>
{
// allConfigSetInfo: {
this
.
setState
(
// ...allConfigSetInfo,
{
// isCloseStart: false,
showIframe
:
true
,
// },
},
// });
()
=>
{},
// }, 3000);
);
// }
},
if
(
canApply
===
false
||
isCloseStart
)
{
},
return
[...
otherButtons
];
...
otherButtons
,
}
];
};
handleSearchSet
=
()
=>
{
const
{
columns
,
searchCondition
}
=
this
.
state
;
const
{
onResponse
}
=
this
.
props
;
const
pageSearch
=
{
search
:
{
field
:
{},
getPageService
:
getApplyPage
,
responseCallBack
:
(
response
)
=>
{
if
(
onResponse
)
{
onResponse
(
response
);
}
return
response
;
},
condition
:
searchCondition
,
nameSpan
:
{
big
:
8
,
small
:
9
},
fileSpan
:
{
big
:
4
,
small
:
4
},
},
tableRowKey
:
'id'
,
columns
,
};
return
pageSearch
;
};
getColumns
=
()
=>
{
return
[
const
{
workId
}
=
this
.
state
;
{
service
.
getColumns
(
workId
).
then
((
response
)
=>
{
type
:
'add'
,
response
=
response
.
filter
((
x
)
=>
{
name
:
'申请'
,
return
x
.
title
!==
'流程进度'
;
component
:
'Normal'
,
});
handleClick
:
()
=>
{
if
(
response
)
{
this
.
setState
(
this
.
setState
(
{
{
showIframe
:
true
,
columns
:
response
,
}
,
},
()
=>
{
()
=>
{
},
this
.
getFormDetail
(
workId
);
);
},
},
);
},
}
...
otherButtons
,
})
;
]
;
};
};
componentDidMount
()
{
handleSearchSet
=
()
=>
{
if
(
!
getToken
())
{
const
{
columns
,
searchCondition
}
=
this
.
state
;
message
.
error
(
'您的数据未同步,请联系管理员!'
);
const
{
onResponse
}
=
this
.
props
;
return
false
;
const
pageSearch
=
{
}
search
:
{
const
{
pathname
}
=
this
.
state
;
field
:
{},
const
{
dataBaseId
,
workId
}
=
this
.
props
;
getPageService
:
getApplyPage
,
if
(
dataBaseId
||
workId
)
{
responseCallBack
:
(
response
)
=>
{
this
.
setState
(
if
(
onResponse
)
{
{
onResponse
(
response
);
workId
,
}
dataBaseId
,
return
response
;
},
},
()
=>
{
condition
:
searchCondition
,
this
.
getColumns
();
nameSpan
:
{
big
:
8
,
small
:
9
},
},
fileSpan
:
{
big
:
4
,
small
:
4
},
);
},
}
else
{
tableRowKey
:
'id'
,
service
.
getId
(
pathname
).
then
((
x
)
=>
{
columns
,
this
.
setState
(
};
{
return
pageSearch
;
workId
:
x
.
workId
,
};
dataBaseId
:
x
.
dataBaseId
,
},
()
=>
{
this
.
getColumns
();
},
);
});
}
window
.
addEventListener
(
getColumns
=
()
=>
{
'message'
,
const
{
workId
}
=
this
.
state
;
(
event
)
=>
{
service
.
getColumns
(
workId
).
then
((
response
)
=>
{
if
(
event
.
data
===
'returnList'
)
{
response
=
response
.
filter
((
x
)
=>
{
this
.
returnList
(
true
);
return
x
.
title
!==
'流程进度'
;
}
});
if
(
event
&&
event
.
data
&&
event
.
data
.
indexOf
&&
event
.
data
.
indexOf
(
'iframeHeight'
)
>
-
1
)
{
if
(
response
)
{
let
height
=
Number
(
event
.
data
.
split
(
'-'
)[
1
]);
this
.
setState
(
const
iframe
=
document
.
getElementById
(
'applyIframeId'
);
{
if
(
iframe
)
{
columns
:
response
,
iframe
.
height
=
height
;
},
}
()
=>
{
}
this
.
getFormDetail
(
workId
);
},
},
false
,
);
);
}
});
};
return
true
;
componentDidMount
()
{
}
if
(
!
getToken
())
{
message
.
error
(
'您的数据未同步,请联系管理员!'
);
return
false
;
}
const
{
pathname
}
=
this
.
state
;
const
{
dataBaseId
,
workId
}
=
this
.
props
;
if
(
dataBaseId
||
workId
)
{
this
.
setState
(
{
workId
,
dataBaseId
,
},
()
=>
{
this
.
getColumns
();
},
);
}
else
{
service
.
getId
(
pathname
).
then
((
x
)
=>
{
this
.
setState
(
{
workId
:
x
.
workId
,
dataBaseId
:
x
.
dataBaseId
,
},
()
=>
{
this
.
getColumns
();
},
);
});
}
returnList
=
(
needSearchList
=
false
)
=>
{
window
.
addEventListener
(
this
.
setState
(
'message'
,
{
(
event
)
=>
{
renderIframe
:
false
,
if
(
event
.
data
===
'returnList'
)
{
},
this
.
returnList
(
true
);
()
=>
{
}
if
(
needSearchList
)
{
if
(
event
&&
event
.
data
&&
event
.
data
.
indexOf
&&
event
.
data
.
indexOf
(
'iframeHeight'
)
>
-
1
)
{
this
.
ListComponent
.
getPage
(
);
let
height
=
Number
(
event
.
data
.
split
(
'-'
)[
1
]
);
}
const
iframe
=
document
.
getElementById
(
'applyIframeId'
);
this
.
setState
(
{
if
(
iframe
)
{
showIframe
:
false
,
iframe
.
height
=
height
;
renderIframe
:
true
,
// 重新挂载IFrame 保证申请数据不会再次显示出来
}
});
}
},
},
);
false
,
}
;
)
;
render
()
{
return
true
;
const
{
workId
,
dataBaseId
,
addFields
,
showIframe
,
renderIframe
}
=
this
.
state
;
}
if
(
!
workId
)
{
return
null
;
returnList
=
(
needSearchList
=
false
)
=>
{
}
console
.
log
(
needSearchList
);
const
url
=
config
.
onestopPC
.
split
(
'/#/'
);
const
{
workId
}
=
this
.
state
;
let
iframeUrl
=
`
${
url
[
0
]}
/#/IFrameForApply?id=
${
workId
}
&token=
${
getToken
()}
`
;
console
.
log
(
iframeUrl
);
this
.
setState
(
// iframeUrl = `http://localhost:8000/onestop/IFrameForApply?id=${workId}&token=${getToken()}`;
{
return
(
renderIframe
:
false
,
<
PageHeaderWrapper
title
=
""
>
},
<
div
()
=>
{
style
=
{{
if
(
needSearchList
)
{
display
:
showIframe
?
'none'
:
'block'
,
this
.
ListComponent
.
getPage
();
}}
>
setTimeout
(()
=>
{
<
List
this
.
getFormDetail
(
workId
);
listConfig
=
{
pageSetting
.
listConfig
}
},
2000
);
pageButton
=
{
this
.
handleButtonSet
({})}
}
pageSearch
=
{
this
.
handleSearchSet
({})}
this
.
setState
({
addFields
=
{
addFields
}
showIframe
:
false
,
ref
=
{(
ListComponent
)
=>
(
this
.
ListComponent
=
ListComponent
)}
renderIframe
:
true
,
// 重新挂载IFrame 保证申请数据不会再次显示出来
workId
=
{
workId
}
});
dataBaseId
=
{
dataBaseId
}
},
/
>
);
<
/div
>
};
<
div
style
=
{{
render
()
{
visibility
:
showIframe
?
'visible'
:
'hidden'
,
const
{
workId
,
dataBaseId
,
addFields
,
showIframe
,
renderIframe
,
allConfigSetInfo
}
=
this
.
state
;
width
:
'100%'
,
if
(
!
workId
||
!
allConfigSetInfo
)
{
backgroundColor
:
'#fff'
,
return
null
;
paddingLeft
:
'24px'
,
}
}}
>
console
.
log
(
allConfigSetInfo
.
isCloseStart
);
<
Shell
>
const
url
=
config
.
onestopPC
.
split
(
'/#/'
);
<
div
let
iframeUrl
=
`
${
url
[
0
]}
/#/IFrameForApply?id=
${
workId
}
&token=
${
getToken
()}
`
;
style
=
{{
console
.
log
(
iframeUrl
);
height
:
'54px'
,
// iframeUrl = `http://localhost:8000/onestop/IFrameForApply?id=${workId}&token=${getToken()}`;
padding
:
'12px 0 12px 12px'
,
let
buttons
=
this
.
handleButtonSet
({});
display
:
showIframe
?
'block'
:
'none'
,
let
listConfig
=
pageSetting
.
listConfig
;
}}
>
if
(
!
buttons
.
length
)
{
<
ButtonDiy
listConfig
=
deepCopy
(
listConfig
);
name
=
"返回"
listConfig
.
buttonArea
=
false
;
className
=
"defaultBlue"
}
handleClick
=
{
this
.
returnList
}
return
(
icon
=
"arrow-left"
<
PageHeaderWrapper
title
=
''
>
/>
<
div
<
/div
>
style
=
{{
<
/Shell
>
display
:
showIframe
?
'none'
:
'block'
,
{
renderIframe
?
(
}}
>
<
iframe
<
List
src
=
{
iframeUrl
}
listConfig
=
{
listConfig
}
frameBorder
=
{
0
}
pageButton
=
{
buttons
}
id
=
"applyIframeId"
pageSearch
=
{
this
.
handleSearchSet
({})}
name
=
"applyIframe"
addFields
=
{
addFields
}
marginWidth
=
"0"
ref
=
{(
ListComponent
)
=>
(
this
.
ListComponent
=
ListComponent
)}
marginHeight
=
"0"
workId
=
{
workId
}
allowtransparency
=
"yes"
dataBaseId
=
{
dataBaseId
}
seamless
/
>
scrolling
=
{
'auto'
}
<
/div
>
style
=
{{
<
div
width
:
'100%'
,
style
=
{{
minHeight
:
'800px'
,
visibility
:
showIframe
?
'visible'
:
'hidden'
,
overflowY
:
'hidden'
,
width
:
'100%'
,
backgroundColor
:
'#fff'
,
backgroundColor
:
'#fff'
,
}}
paddingLeft
:
'24px'
,
/
>
}}
>
)
:
null
}
<
Shell
>
<
/div
>
<
div
<
/PageHeaderWrapper
>
style
=
{{
);
height
:
'54px'
,
}
padding
:
'12px 0 12px 12px'
,
display
:
showIframe
?
'block'
:
'none'
,
}}
>
<
ButtonDiy
name
=
'返回'
className
=
'defaultBlue'
handleClick
=
{
this
.
returnList
}
icon
=
'arrow-left'
/>
<
/div
>
<
/Shell
>
{
renderIframe
?
(
<
iframe
src
=
{
iframeUrl
}
frameBorder
=
{
0
}
id
=
'applyIframeId'
name
=
'applyIframe'
marginWidth
=
'0'
marginHeight
=
'0'
allowtransparency
=
'yes'
seamless
scrolling
=
{
'auto'
}
style
=
{{
width
:
'100%'
,
minHeight
:
'800px'
,
overflowY
:
'hidden'
,
backgroundColor
:
'#fff'
,
}}
/
>
)
:
null
}
<
/div
>
<
/PageHeaderWrapper
>
);
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论