Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
szse
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhaochengxiang
szse
Commits
2d9ebf45
Commit
2d9ebf45
authored
Feb 28, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型送审静态页面
parent
549f64e3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
322 additions
and
1 deletion
+322
-1
Table.tsx
src/util/Component/Table.tsx
+2
-1
start-flow.jsx
src/view/Manage/Model/Component/start-flow.jsx
+315
-0
index.jsx
src/view/Manage/Model/index.jsx
+5
-0
No files found.
src/util/Component/Table.tsx
View file @
2d9ebf45
...
@@ -74,7 +74,8 @@ function FC<RowType extends object = any>({ width, maxHeight, pageSize, pageNum,
...
@@ -74,7 +74,8 @@ function FC<RowType extends object = any>({ width, maxHeight, pageSize, pageNum,
const
render
=
getRender
(
col
);
const
render
=
getRender
(
col
);
const
colWidth
=
col
.
width
??
100
;
const
colWidth
=
col
.
width
??
100
;
return
{
return
{
...
col
,
/* colRef: createRef(), */
width
:
colWidth
,
render
,
ellipsis
:
true
,
ellipsis
:
true
,
...
col
,
/* colRef: createRef(), */
width
:
colWidth
,
render
,
onHeaderCell
:
(
column
:
any
)
=>
({
onHeaderCell
:
(
column
:
any
)
=>
({
width
:
column
.
width
,
width
:
column
.
width
,
// colRef: column.colRef,
// colRef: column.colRef,
...
...
src/view/Manage/Model/Component/start-flow.jsx
0 → 100644
View file @
2d9ebf45
import
React
from
'react'
import
{
Modal
,
Button
,
Spin
,
Form
,
Input
,
Select
,
Space
,
Radio
,
Row
,
Col
,
Upload
}
from
'antd'
import
{
UploadOutlined
}
from
'@ant-design/icons'
import
{
isSzseEnv
,
showMessage
}
from
'../../../../util'
import
Table
from
'../../../../util/Component/Table'
import
produce
from
'immer'
const
FC
=
(
props
)
=>
{
const
{
visible
,
items
=
Array
.
from
({
length
:
10
}).
map
((
_
,
i
)
=>
({
name
:
`模型
${
i
}
`
,
remark
:
'很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长的'
,
id
:
i
,
})),
onCancel
}
=
props
const
[
waiting
,
setWaiting
]
=
React
.
useState
(
false
)
const
basicRef
=
React
.
useRef
()
const
listRef
=
React
.
useRef
()
const
close
=
(
refresh
=
false
)
=>
{
setWaiting
(
false
)
onCancel
?.(
refresh
)
}
const
save
=
async
()
=>
{
try
{
const
basicRows
=
await
basicRef
.
current
?.
validate
()
const
tableData
=
listRef
.
current
?.
tableData
console
.
log
(
'basic rows'
,
basicRows
)
console
.
log
(
'table data'
,
tableData
)
}
catch
(
e
)
{
}
}
const
footer
=
React
.
useMemo
(()
=>
{
return
[
<
Button
key=
{
'cancel'
}
onClick=
{
()
=>
close
()
}
>
取消
</
Button
>,
<
Button
key=
{
'save'
}
type=
'primary'
disabled=
{
waiting
}
onClick=
{
()
=>
save
()
}
>
保存
</
Button
>
]
},
[
close
,
save
,
waiting
])
return
(
<
Modal
visible=
{
visible
}
footer=
{
footer
}
width=
'80%'
bodyStyle=
{
{
padding
:
'15px'
,
overflowX
:
'auto'
,
maxHeight
:
'80vh'
}
}
title=
'模型送审'
centered
destroyOnClose
onCancel=
{
()
=>
{
close
()
}
}
>
<
Spin
spinning=
{
waiting
}
>
<
Basic
ref=
{
basicRef
}
/>
<
List
ref=
{
listRef
}
items=
{
items
}
/>
</
Spin
>
</
Modal
>
)
}
export
default
FC
const
Basic
=
React
.
forwardRef
(
function
({},
ref
)
{
const
[
loadingDesignReviewers
,
setLoadingDesignReviewers
]
=
React
.
useState
(
false
)
const
[
designReviewers
,
setDesignReviewers
]
=
React
.
useState
()
const
[
fileList
,
setFileList
]
=
React
.
useState
()
const
[
form
]
=
Form
.
useForm
()
React
.
useImperativeHandle
(
ref
,
()
=>
({
validate
:
async
()
=>
{
const
rows
=
await
form
.
validateFields
()
return
rows
},
}),
[
form
])
React
.
useEffect
(()
=>
{
getDesignReviewers
()
},
[])
const
marginBottom
=
React
.
useMemo
(()
=>
{
return
15
},
[])
const
getDesignReviewers
=
()
=>
{
setLoadingDesignReviewers
(
true
)
setTimeout
(()
=>
{
setLoadingDesignReviewers
(
false
)
setDesignReviewers
(
Array
.
from
({
length
:
10
}).
map
((
_
,
i
)
=>
({
name
:
`user
${
i
}
`
,
id
:
i
,
})))
},
3000
)
}
const
onValuesChange
=
(
changedValues
,
allValues
)
=>
{
}
const
uploadProps
=
{
onRemove
:
file
=>
{
const
index
=
(
fileList
??[]).
indexOf
(
file
)
if
(
index
!==
-
1
)
{
const
newFileList
=
(
fileList
??[]).
slice
()
newFileList
.
splice
(
index
,
1
)
setFileList
(
newFileList
)
}
},
beforeUpload
:
file
=>
{
const
isLt5M
=
file
.
size
/
1024
/
1024
<
5
if
(
!
isLt5M
)
{
showMessage
(
'error'
,
'上传文件必须小于5M'
)
setFileList
([])
return
false
}
setFileList
(
prev
=>
{
return
[...
prev
??[],
file
]
})
return
false
},
fileList
:
fileList
||
[],
}
return
(
<
Form
form=
{
form
}
labelCol=
{
{
span
:
3
}
}
wrapperCol=
{
{
span
:
9
}
}
autoComplete=
"off"
onValuesChange=
{
onValuesChange
}
>
<
Form
.
Item
label=
'送审说明'
name=
"remark"
style=
{
{
marginBottom
}
}
rules=
{
[{
required
:
true
,
message
:
'请填写送审说明!'
}]
}
>
<
Input
placeholder=
'请输入送审说明'
/>
</
Form
.
Item
>
<
Form
.
Item
label=
'设计评审人员'
name=
"designReviewerers"
style=
{
{
marginBottom
}
}
rules=
{
[{
required
:
true
,
message
:
'请选择设计评审人员!'
}]
}
>
<
Select
placeholder=
'请选择设计评审人员'
loading=
{
loadingDesignReviewers
}
allowClear
mode=
'multiple'
>
{
designReviewers
?.
map
(
item
=>
<
Select
.
Option
key=
{
item
.
id
}
value=
{
item
.
id
}
>
{
item
.
name
}
</
Select
.
Option
>)
}
</
Select
>
</
Form
.
Item
>
<
Form
.
Item
label=
'规范评审'
name=
'ruleReview'
wrapperCol=
{
{
span
:
12
}
}
style=
{
{
marginBottom
}
}
rules=
{
[{
required
:
true
,
validator
:
(
_
,
value
)
=>
{
if
(
value
?.
ruleReviewSelected
===
null
||
value
?.
ruleReviewSelected
===
undefined
)
{
return
Promise
.
reject
(
new
Error
(
'请选择是否规范评审!'
))
}
if
(
value
?.
ruleReviewSelected
&&
(
value
?.
ruleReviewers
??[]).
length
===
0
)
{
return
Promise
.
reject
(
new
Error
(
'请选择规范评审人员!'
))
}
return
Promise
.
resolve
();
}
}]
}
>
<
RuleReviewItem
/>
</
Form
.
Item
>
<
Form
.
Item
label=
'附件'
style=
{
{
marginBottom
}
}
>
<
Upload
{
...
uploadProps
}
>
<
Button
icon=
{
<
UploadOutlined
/>
}
>
点击上传
</
Button
>
</
Upload
>
</
Form
.
Item
>
</
Form
>
)
})
const
RuleReviewItem
=
({
value
=
{},
onChange
})
=>
{
const
[
ruleReviewSelected
,
setRuleReviewSelected
]
=
React
.
useState
()
const
[
loadingRuleReviewers
,
setLoadingRuleReviewers
]
=
React
.
useState
(
false
)
const
[
ruleReviewers
,
setRuleReviewers
]
=
React
.
useState
()
React
.
useEffect
(()
=>
{
getRuleReviewers
()
},
[])
const
getRuleReviewers
=
()
=>
{
setLoadingRuleReviewers
(
true
)
setTimeout
(()
=>
{
setLoadingRuleReviewers
(
false
)
setRuleReviewers
(
Array
.
from
({
length
:
10
}).
map
((
_
,
i
)
=>
({
name
:
`user
${
i
}
`
,
id
:
i
,
})))
},
3000
)
}
const
triggerChange
=
(
changedValue
)
=>
{
onChange
?.({
...
value
,
...
changedValue
,
});
}
return
(
<
Row
align=
'middle'
>
<
Radio
.
Group
onChange=
{
(
e
)
=>
{
setRuleReviewSelected
(
e
.
target
.
value
)
triggerChange
({
ruleReviewSelected
:
e
.
target
.
value
})
}
}
>
<
Radio
value=
{
true
}
>
是
</
Radio
>
<
Radio
value=
{
false
}
>
否
</
Radio
>
</
Radio
.
Group
>
{
ruleReviewSelected
&&
<
Col
span=
{
16
}
>
<
Select
placeholder=
'请选择规范评审人员'
loading=
{
loadingRuleReviewers
}
allowClear
mode=
'multiple'
style=
{
{
width
:
'100%'
}
}
onChange=
{
(
val
)
=>
{
triggerChange
({
ruleReviewers
:
val
})
}
}
>
{
ruleReviewers
?.
map
(
item
=>
<
Select
.
Option
key=
{
item
.
id
}
value=
{
item
.
id
}
>
{
item
.
name
}
</
Select
.
Option
>)
}
</
Select
>
</
Col
>
}
</
Row
>
)
}
const
List
=
React
.
forwardRef
(
function
({
items
},
ref
)
{
const
[
tableData
,
setTableData
]
=
React
.
useState
(
items
)
React
.
useImperativeHandle
(
ref
,
()
=>
({
tableData
,
}),
[
tableData
])
const
cols
=
[
{
title
:
'序号'
,
dataIndex
:
'index'
,
width
:
60
,
render
:(
_
,
__
,
index
)
=>
(
index
+
1
)
},
{
title
:
'模型名称'
,
dataIndex
:
'name'
,
width
:
isSzseEnv
?
360
:
160
,
},
{
title
:
'中文名称'
,
dataIndex
:
'cnName'
,
width
:
isSzseEnv
?
420
:
160
,
},
{
title
:
'数据内容'
,
dataIndex
:
'remark'
,
},
{
title
:
'路径'
,
dataIndex
:
'path'
,
width
:
120
,
},
{
title
:
'送审备注'
,
dataIndex
:
'reviewRemark'
,
render
:
(
_
,
__
,
index
)
=>
(
<
Input
onChange=
{
(
e
)
=>
{
setTableData
(
prev
=>
{
return
produce
(
prev
,
(
draft
)
=>
{
draft
[
index
].
reviewRemark
=
e
.
target
.
value
})
})
}
}
/>
)
},
]
return
(
<
Table
columns=
{
cols
??[]
}
dataSource=
{
tableData
??[]
}
pagination=
{
false
}
/>
)
})
\ No newline at end of file
src/view/Manage/Model/index.jsx
View file @
2d9ebf45
...
@@ -23,6 +23,7 @@ import ColSettingModal from './Component/ColSettingModal';
...
@@ -23,6 +23,7 @@ import ColSettingModal from './Component/ColSettingModal';
import
PermissionButton
from
'../../../util/Component/PermissionButton'
;
import
PermissionButton
from
'../../../util/Component/PermissionButton'
;
import
SelectSearchProperties
from
'./Component/select-search-properties'
;
import
SelectSearchProperties
from
'./Component/select-search-properties'
;
import
{
TagSelect
,
TagSelectPopup
}
from
'./Component/tag-help'
;
import
{
TagSelect
,
TagSelectPopup
}
from
'./Component/tag-help'
;
import
StartFlow
from
'./Component/start-flow'
;
import
'./index.less'
;
import
'./index.less'
;
...
@@ -801,6 +802,10 @@ class Model extends React.Component {
...
@@ -801,6 +802,10 @@ class Model extends React.Component {
})
})
}}
}}
/>
/>
{/* <StartFlow
visible={true}
/> */}
</div>
</div>
}
}
</AppContext.Consumer>
</AppContext.Consumer>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment