Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
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
shenshaokai
jinfa-platform
Commits
9c8f70e6
Commit
9c8f70e6
authored
Mar 05, 2022
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 恢复合同模板
parent
cb5c861a
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
683 additions
and
0 deletions
+683
-0
add.tsx
src/pages/contract/template/addContract/add.tsx
+16
-0
details.tsx
src/pages/contract/template/addContract/details.tsx
+15
-0
edit.tsx
src/pages/contract/template/addContract/edit.tsx
+16
-0
index.css
src/pages/contract/template/addContract/index.css
+39
-0
index.less
src/pages/contract/template/addContract/index.less
+53
-0
index.tsx
src/pages/contract/template/addContract/index.tsx
+247
-0
index.tsx
src/pages/contract/template/classSearch/index.tsx
+92
-0
index.tsx
src/pages/contract/template/templateList/index.tsx
+205
-0
No files found.
src/pages/contract/template/addContract/add.tsx
0 → 100644
View file @
9c8f70e6
import
React
from
'react'
;
import
{
history
}
from
'umi'
;
import
ContractComponents
from
'./index'
;
const
AddContract
:
React
.
FC
<
{}
>
=
()
=>
{
const
{
id
}
=
history
.
location
.
query
;
return
(
<
ContractComponents
page_type=
{
'add'
}
id=
{
id
}
/>
)
}
export
default
AddContract
;
\ No newline at end of file
src/pages/contract/template/addContract/details.tsx
0 → 100644
View file @
9c8f70e6
import
React
from
'react'
;
import
{
history
}
from
'umi'
;
import
ContractComponents
from
'./index'
;
const
DetailsContract
:
React
.
FC
<
{}
>
=
()
=>
{
const
{
id
}
=
history
.
location
.
query
;
return
(
<
ContractComponents
id=
{
id
}
/>
)
}
export
default
DetailsContract
;
\ No newline at end of file
src/pages/contract/template/addContract/edit.tsx
0 → 100644
View file @
9c8f70e6
import
React
from
'react'
;
import
{
history
}
from
'umi'
;
import
ContractComponents
from
'./index'
;
const
EditContract
:
React
.
FC
<
{}
>
=
()
=>
{
const
{
id
}
=
history
.
location
.
query
;
return
(
<
ContractComponents
page_type=
{
'edit'
}
id=
{
id
}
/>
)
}
export
default
EditContract
;
\ No newline at end of file
src/pages/contract/template/addContract/index.css
0 → 100644
View file @
9c8f70e6
.addcontract_wrap
:global
.ant-form-item
{
width
:
748px
;
}
.addcontract_wrap
:global
.ant-form-item
.ant-form-item-label
{
width
:
172px
;
text-align
:
left
;
}
.addcontract_wrap
:global
.ant-form-item
.ant-form-item-label
>
label
{
color
:
#909399
;
}
.addcontract_wrap
:global
.ant-form-item
.ant-upload-list-item
{
margin-top
:
0px
;
}
.addcontract_wrap
.upload_item
{
padding
:
5px
8px
;
margin-bottom
:
16px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
background-color
:
#fafbfc
;
}
.addcontract_wrap
.upload_item
.upload_left
{
display
:
flex
;
align-items
:
center
;
color
:
#303133
;
}
.addcontract_wrap
.upload_item
.upload_left
:global
.anticon-file-word
{
color
:
#4279df
;
font-size
:
18px
;
margin-right
:
8px
;
}
.addcontract_wrap
.upload_item
.upload_right
{
color
:
#00b37a
;
cursor
:
pointer
;
}
.addcontract_wrap
.upload_item
.upload_right
:global
.anticon-delete
{
margin-left
:
19px
;
color
:
#c0c4cc
;
}
src/pages/contract/template/addContract/index.less
0 → 100644
View file @
9c8f70e6
.addcontract_wrap {
:global {
.ant-form-item {
width: 748px;
.ant-form-item-label {
width: 172px;
text-align: left;
& > label {
color: #909399;
}
}
.ant-upload-list-item {
margin-top: 0px;
}
}
}
.upload_item {
padding: 5px 8px;
margin-bottom: 16px;
display: flex;
align-items: center;
justify-content: space-between;
background-color: #fafbfc;
.upload_left {
display: flex;
align-items: center;
color: #303133;
:global {
.anticon-file-word {
color: #4279df;
font-size: 18px;
margin-right: 8px;
}
}
}
.upload_right {
color: #00b37a;
cursor: pointer;
:global {
.anticon-delete {
margin-left: 19px;
color: #c0c4cc;
}
}
}
}
}
src/pages/contract/template/addContract/index.tsx
0 → 100644
View file @
9c8f70e6
import
React
,
{
useEffect
,
useState
}
from
'react'
import
{
getIntl
,
history
}
from
'umi'
;
import
{
Form
,
Input
,
Upload
,
Card
,
Tooltip
,
Button
,
message
,
Badge
,
Popconfirm
}
from
'antd'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
{
UploadFile
,
UploadChangeParam
}
from
'antd/lib/upload/interface'
;
import
{
UPLOAD_TYPE
}
from
'@/constants'
import
{
QuestionCircleOutlined
,
StarOutlined
,
FileWordFilled
,
UploadOutlined
,
DeleteOutlined
}
from
'@ant-design/icons'
;
import
styles
from
'./index.less'
import
{
getContractContractTemplateExample
,
getContractContractTemplateGet
,
getContractContractTemplatePreview
,
postContractContractTemplateAdd
,
postContractContractTemplateUpdate
}
from
'@/services/ContractV2Api'
export
interface
parmas
{
page_type
?:
string
,
id
?:
any
}
const
intl
=
getIntl
();
const
AddContract
:
React
.
FC
<
parmas
>
=
(
props
)
=>
{
const
{
page_type
,
id
}
=
props
;
const
{
TextArea
}
=
Input
;
const
[
form
]
=
Form
.
useForm
();
const
[
fileExampleUrl
,
setFileExampleUrl
]
=
useState
<
any
>
({});
const
[
uploadFile
,
setUploadFile
]
=
useState
<
any
>
({});
const
[
fileUrl
,
setFileUrl
]
=
useState
<
string
>
(
''
);
const
[
loading
,
setloading
]
=
useState
(
false
);
const
[
data
,
setData
]
=
useState
<
any
>
({});
/**判断文件类型和大小 */
const
beforeDocUpload
=
(
file
:
UploadFile
)
=>
{
const
name
=
file
.
name
.
split
(
'.'
);
const
type
=
name
[
name
.
length
-
1
];
const
isJpgOrPng
=
type
===
'doc'
||
type
===
'docx'
;
const
isLt20M
=
file
.
size
/
1024
/
1024
<
20
;
if
(
!
isJpgOrPng
)
{
message
.
error
(
intl
.
formatMessage
({
id
:
'contract.bushidocdocxwenjian'
}));
}
if
(
!
isLt20M
)
{
message
.
error
(
intl
.
formatMessage
({
id
:
'contract.shangchuanwenjiandaxiaobuchao'
}));
}
return
isJpgOrPng
&&
isLt20M
;
}
/**上传回调 */
const
handleChange
=
({
fileList
})
=>
{
setloading
(
true
);
if
(
fileList
[
0
].
response
)
{
const
file
=
{
name
:
fileList
[
0
].
name
,
file
:
fileList
[
0
].
response
.
data
}
console
.
log
(
file
)
setloading
(
false
);
setFileUrl
(
fileList
[
0
].
response
.
data
);
setUploadFile
(
file
);
}
}
/**合同模板样例查询 */
useEffect
(()
=>
{
getContractContractTemplateExample
().
then
(
res
=>
{
setFileExampleUrl
(
res
.
data
)
}).
catch
((
err
)
=>
{
});
},
[])
/**新增&修改 */
const
sharedFn
=
async
(
parmas
:
any
)
=>
{
if
(
page_type
===
'add'
)
{
await
postContractContractTemplateAdd
(
parmas
).
then
(
res
=>
{
setTimeout
(()
=>
{
history
.
goBack
()
},
1000
)
}).
catch
((
err
)
=>
{
});
}
else
{
parmas
.
id
=
id
;
await
postContractContractTemplateUpdate
(
parmas
).
then
(
res
=>
{
setTimeout
(()
=>
{
history
.
goBack
()
},
1000
)
}).
catch
((
err
)
=>
{
});
}
}
/**提交数据 */
const
onSubmit
=
async
()
=>
{
await
form
.
validateFields
().
then
(
res
=>
{
if
(
uploadFile
.
name
&&
uploadFile
.
file
)
{
const
parmas
=
{
name
:
res
.
name
,
version
:
res
.
version
,
description
:
res
.
description
,
fileExampleUrl
:
fileExampleUrl
.
contractUrl
,
fileExampleName
:
fileExampleUrl
.
contractName
,
fileUrl
,
fileName
:
uploadFile
.
name
}
sharedFn
(
parmas
)
console
.
log
(
parmas
)
}
else
{
message
.
warning
(
intl
.
formatMessage
({
id
:
'contract.qingxianshangchuanhetongwenjian'
}))
}
})
}
/**删除上传的合同 */
const
delectContract
=
()
=>
{
setUploadFile
({});
setFileUrl
(
''
);
}
const
confirm
=
()
=>
{
// message.error(`未保存地址信息`)
setTimeout
(()
=>
{
history
.
goBack
()
},
1000
)
}
/**班级查看数据 */
useEffect
(()
=>
{
if
(
id
)
{
getContractContractTemplateGet
({
id
}).
then
(
res
=>
{
setData
(
res
.
data
);
let
files
=
res
.
data
.
fileName
?
{
name
:
res
.
data
.
fileName
,
file
:
res
.
data
.
fileUrl
}
:
{}
setUploadFile
(
files
)
if
(
page_type
===
'edit'
)
{
form
.
setFieldsValue
(
res
.
data
)
}
}).
catch
((
err
)
=>
{
});
}
},
[
id
])
/**下载 */
const
onDownload
=
(
file
:
any
)
=>
{
// contract/contractTemplate/downloadContract
window
.
location
.
href
=
`/api/contract/contractTemplate/downloadContract?contractName=
${
file
.
contractName
}
&contractUrl=
${
file
.
contractUrl
}
`
}
/**预览 */
const
onView
=
async
(
file
:
any
)
=>
{
await
getContractContractTemplatePreview
({
contractName
:
file
.
name
,
contractUrl
:
file
.
file
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
window
.
open
(
res
.
data
.
contractUrl
)
}
}).
catch
((
err
)
=>
{
});
}
return
(
<
PageHeaderWrapper
onBack=
{
()
=>
history
.
goBack
()
}
backIcon=
{
<
ReutrnEle
description=
{
intl
.
formatMessage
({
id
:
'contract.fanhui'
})
}
/>
}
>
<
Card
>
<
div
className=
{
styles
.
addcontract_wrap
}
>
<
Form
form=
{
form
}
>
<
Form
.
Item
label=
{
intl
.
formatMessage
({
id
:
'contract.hetongmubanmingcheng'
})
}
colon=
{
false
}
name=
'name'
rules=
{
[{
required
:
page_type
&&
true
,
message
:
intl
.
formatMessage
({
id
:
'contract.qingshuruhetongmubanming'
})
}]
}
>
{
page_type
?
<
Input
/>
:
<
span
>
{
data
.
name
}
</
span
>
}
</
Form
.
Item
>
<
Form
.
Item
label=
{
intl
.
formatMessage
({
id
:
'contract.banbenhao'
})
}
colon=
{
false
}
name=
'version'
rules=
{
[{
required
:
page_type
&&
true
,
message
:
intl
.
formatMessage
({
id
:
'contract.qingshurubanbenhao'
})
}]
}
>
{
page_type
?
<
Input
/>
:
<
span
>
{
data
.
version
}
</
span
>
}
</
Form
.
Item
>
{
!
page_type
&&
<
Form
.
Item
label=
{
intl
.
formatMessage
({
id
:
'contract.zhuangtai'
})
}
colon=
{
false
}
name=
'status'
>
<
span
>
{
data
.
state
===
1
?
<><
Badge
status=
"success"
/>
{
intl
.
formatMessage
({
id
:
'contract.youxiao'
})
}
</>
:
<><
Badge
status=
"error"
/>
{
intl
.
formatMessage
({
id
:
'contract.shixiao'
})
}
</>
}
</
span
>
</
Form
.
Item
>
}
<
Form
.
Item
label=
{
intl
.
formatMessage
({
id
:
'contract.hetongmubanshuoming'
})
}
colon=
{
false
}
name=
'description'
>
{
page_type
?
<
TextArea
rows=
{
4
}
/>
:
<
span
>
{
data
.
description
}
</
span
>
}
</
Form
.
Item
>
<
Form
.
Item
label=
{
<
div
>
{
intl
.
formatMessage
({
id
:
'contract.hetongwenjianmubanyangli'
})
}
<
Tooltip
placement=
"top"
title=
{
intl
.
formatMessage
({
id
:
'contract.zhizuohetongmubanqian'
})
}
><
QuestionCircleOutlined
/></
Tooltip
></
div
>
}
colon=
{
false
}
>
<
div
className=
{
styles
.
upload_item
}
>
<
div
className=
{
styles
.
upload_left
}
>
<
FileWordFilled
/>
<
span
>
{
fileExampleUrl
.
contractName
}
</
span
>
</
div
>
<
div
className=
{
styles
.
upload_right
}
>
<
span
onClick=
{
()
=>
onDownload
(
fileExampleUrl
)
}
>
{
intl
.
formatMessage
({
id
:
'contract.xiazai'
})
}
</
span
>
</
div
>
</
div
>
</
Form
.
Item
>
<
Form
.
Item
name=
"uploadFile"
rules=
{
[{
required
:
Object
.
keys
(
uploadFile
).
length
===
0
,
message
:
intl
.
formatMessage
({
id
:
'contract.qingxianshangchuanhetongxinxi'
})
}]
}
label=
{
<
div
>
{
intl
.
formatMessage
({
id
:
'contract.hetongwenjianmuban'
})
}
<
Tooltip
placement=
"top"
title=
{
intl
.
formatMessage
({
id
:
'contract.zhizuowanchengdehetongmu'
})
}
><
QuestionCircleOutlined
/></
Tooltip
></
div
>
}
colon=
{
false
}
>
<
div
className=
{
styles
.
upload_data
}
>
{
Object
.
keys
(
uploadFile
).
length
>
0
&&
<
div
className=
{
styles
.
upload_item
}
>
<
div
className=
{
styles
.
upload_left
}
>
<
FileWordFilled
/>
<
span
>
{
uploadFile
.
name
}
</
span
>
</
div
>
<
div
className=
{
styles
.
upload_right
}
>
<
span
onClick=
{
()
=>
onView
(
uploadFile
)
}
>
{
intl
.
formatMessage
({
id
:
'contract.yulan'
})
}
</
span
>
{
page_type
&&
<
DeleteOutlined
onClick=
{
delectContract
}
/>
}
</
div
>
</
div
>
}
</
div
>
{
(
Object
.
keys
(
uploadFile
).
length
===
0
&&
page_type
)
&&
<
Upload
action=
"/api/file/file/upload"
data=
{
{
fileType
:
UPLOAD_TYPE
}
}
showUploadList=
{
false
}
beforeUpload=
{
beforeDocUpload
}
onChange=
{
handleChange
}
accept=
'.doc,.docx'
>
<
Button
loading=
{
loading
}
disabled=
{
loading
}
icon=
{
<
UploadOutlined
/>
}
>
{
intl
.
formatMessage
({
id
:
'contract.shangchuanwenjian'
})
}
</
Button
>
<
div
style=
{
{
marginTop
:
'8px'
}
}
>
{
intl
.
formatMessage
({
id
:
'contract.zhichikuozhanmingdocwenjian'
})
}
</
div
>
</
Upload
>
}
</
Form
.
Item
>
{
page_type
&&
<
Form
.
Item
style=
{
{
marginLeft
:
'174px'
}
}
>
<
Button
type=
"primary"
style=
{
{
marginRight
:
'24px'
}
}
onClick=
{
onSubmit
}
>
{
intl
.
formatMessage
({
id
:
'contract.baocun'
})
}
</
Button
>
<
Popconfirm
title=
"
{
intl
.
formatMessage
({
id
:
'contract.weibaocunshifouqueding'
})
}
"
onConfirm=
{
confirm
}
okText=
{
intl
.
formatMessage
({
id
:
'contract.shi'
})
}
cancelText=
{
intl
.
formatMessage
({
id
:
'contract.fou'
})
}
>
<
Button
>
{
intl
.
formatMessage
({
id
:
'contract.quxiao'
})
}
</
Button
>
</
Popconfirm
>
</
Form
.
Item
>
}
</
Form
>
</
div
>
</
Card
>
</
PageHeaderWrapper
>
)
}
export
default
AddContract
src/pages/contract/template/classSearch/index.tsx
0 → 100644
View file @
9c8f70e6
import
React
,
{
useState
,
useRef
,
ReactNode
}
from
'react'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
Card
,
Row
,
Col
,
Input
,
Button
}
from
'antd'
;
import
statuStyle
from
'../../common/colorTag'
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
StandardTable
from
'@/components/StandardTable'
;
import
{
getContractContractParamPage
}
from
'@/services/ContractV2Api'
import
{
getIntl
}
from
'umi'
;
const
intl
=
getIntl
();
const
ClassSearch
=
()
=>
{
const
ref
=
useRef
<
any
>
({});
const
[
filterParams
,
setFilterParams
]
=
useState
<
any
>
({})
//表头
const
columns
:
ColumnType
<
any
>
[]
=
[{
title
:
'ID'
,
dataIndex
:
'id'
,
width
:
'128px'
},
{
title
:
intl
.
formatMessage
({
id
:
'contract.canshumingcheng'
}),
dataIndex
:
'name'
,
},
{
title
:
intl
.
formatMessage
({
id
:
'contract.canshumiaoshu'
}),
dataIndex
:
'description'
,
},
{
title
:
intl
.
formatMessage
({
id
:
'contract.zhuangtai'
}),
dataIndex
:
'state'
,
render
:
(
text
:
any
,
reconds
:
any
)
=>
{
let
component
:
ReactNode
=
null
;
if
(
text
===
1
)
{
component
=
<><
span
style=
{
statuStyle
.
success
}
>
{
intl
.
formatMessage
({
id
:
'contract.youxiao'
})
}
</
span
></>
}
return
component
}
}]
// 列表数据
const
fetchData
=
(
params
?:
any
)
=>
{
console
.
log
(
params
)
//可以直接打印参数
return
new
Promise
((
resolve
,
reject
)
=>
{
getContractContractParamPage
({
...
filterParams
,
...
params
}).
then
(
res
=>
{
resolve
(
res
.
data
)
}).
catch
(()
=>
{
reject
();
});
})
}
// 搜索
const
handleSearch
=
(
val
:
string
)
=>
{
let
obj
=
{
...
filterParams
,
name
:
val
}
setFilterParams
(
obj
)
ref
.
current
.
reload
(
obj
)
}
// 重置
const
handleReset
=
()
=>
{
setFilterParams
({})
setTimeout
(()
=>
{
ref
.
current
.
reload
()
},
500
)
}
return
(
<
PageHeaderWrapper
>
<
Card
>
<
StandardTable
tableProps=
{
{
rowKey
:
'id'
,
}
}
columns=
{
columns
}
currentRef=
{
ref
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
controlRender=
{
<
Row
>
<
Col
span=
{
12
}
>
<
Input
.
Search
style=
{
{
width
:
'256px'
,
marginRight
:
'24px'
,
marginBottom
:
'24px'
}
}
placeholder=
{
intl
.
formatMessage
({
id
:
'contract.sousuo'
})
}
value=
{
filterParams
.
name
}
onChange=
{
(
e
)
=>
setFilterParams
({
...
filterParams
,
name
:
e
.
target
.
value
})
}
onSearch=
{
(
val
)
=>
handleSearch
(
val
)
}
/>
<
Button
onClick=
{
handleReset
}
>
{
intl
.
formatMessage
({
id
:
'contract.zhongzhi'
})
}
</
Button
>
</
Col
>
</
Row
>
}
/>
</
Card
>
</
PageHeaderWrapper
>
)
}
export
default
ClassSearch
src/pages/contract/template/templateList/index.tsx
0 → 100644
View file @
9c8f70e6
import
React
,
{
useRef
,
ReactNode
}
from
'react'
import
{
getIntl
,
history
,
Link
}
from
'umi'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
Card
,
Button
,
Space
,
Popconfirm
}
from
'antd'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
StandardTable
from
'@/components/StandardTable'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
createFormActions
}
from
'@formily/antd'
;
import
EyePreview
from
'@/components/EyePreview'
;
import
{
PlusOutlined
,
PlayCircleOutlined
,
PauseCircleOutlined
}
from
'@ant-design/icons'
;
import
{
getContractContractTemplatePage
,
postContractContractTemplateDelete
,
postContractContractTemplateEnable
}
from
'@/services/ContractV2Api'
;
const
formActions
=
createFormActions
();
const
intl
=
getIntl
();
const
Template
:
React
.
FC
<
{}
>
=
()
=>
{
const
ref
=
useRef
<
any
>
({});
//表头
const
columns
:
ColumnType
<
any
>
[]
=
[{
title
:
'ID'
,
dataIndex
:
'id'
,
width
:
'5%'
},
{
title
:
intl
.
formatMessage
({
id
:
'contract.hetongmubanmingcheng'
}),
dataIndex
:
'name'
,
width
:
'15%'
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
return
(
<
EyePreview
url=
{
`/memberCenter/contract/template/detail?id=${record.id}`
}
>
{
text
}
</
EyePreview
>
);
},
},
{
title
:
intl
.
formatMessage
({
id
:
'contract.banbenhao'
}),
dataIndex
:
'version'
,
width
:
'10%'
,
},
{
title
:
intl
.
formatMessage
({
id
:
'contract.mubanshuoming'
}),
dataIndex
:
'description'
,
width
:
'35%'
,
},
{
title
:
intl
.
formatMessage
({
id
:
'contract.zhuangtai'
}),
dataIndex
:
'state'
,
width
:
'20%'
,
sorter
:
(
a
,
b
)
=>
a
.
state
-
b
.
state
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
let
component
:
ReactNode
=
null
component
=
(
<
Popconfirm
title=
{
intl
.
formatMessage
({
id
:
'contract.quedingyaozhixingzhegecao'
})
}
onConfirm=
{
()
=>
confirm
(
record
)
}
okText=
{
intl
.
formatMessage
({
id
:
'contract.shi'
})
}
cancelText=
{
intl
.
formatMessage
({
id
:
'contract.fou'
})
}
>
<
Button
type=
"link"
style=
{
record
.
state
?
{
color
:
'#00B37A'
}
:
{
color
:
'red'
}
}
>
{
record
.
state
?
<>
{
intl
.
formatMessage
({
id
:
'contract.youxiao'
})
}
<
PlayCircleOutlined
/></>
:
<>
{
intl
.
formatMessage
({
id
:
'contract.wuxiao'
})
}
<
PauseCircleOutlined
/></>
}
</
Button
>
</
Popconfirm
>
)
return
component
}
},
{
title
:
intl
.
formatMessage
({
id
:
'contract.caozuo'
}),
dataIndex
:
'action'
,
width
:
'20%'
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
let
component
:
ReactNode
=
null
component
=
(
<>
{
record
.
state
===
0
&&
<>
<
Button
disabled=
{
record
.
state
===
1
}
style=
{
{
padding
:
'0px'
,
marginRight
:
'24px'
}
}
type=
'link'
><
Link
to=
{
`/memberCenter/contract/template/edit?id=${record.id}`
}
>
{
intl
.
formatMessage
({
id
:
'contract.bianji'
})
}
</
Link
></
Button
>
<
Popconfirm
title=
{
intl
.
formatMessage
({
id
:
'contract.quedingyaozhixingzhegecao'
})
}
onConfirm=
{
()
=>
confirmDel
(
record
)
}
okText=
{
intl
.
formatMessage
({
id
:
'contract.shi'
})
}
cancelText=
{
intl
.
formatMessage
({
id
:
'contract.fou'
})
}
disabled=
{
record
.
state
===
1
}
>
<
Button
disabled=
{
record
.
state
===
1
}
style=
{
{
padding
:
'0px'
}
}
type=
"link"
>
{
intl
.
formatMessage
({
id
:
'contract.shanchu'
})
}
</
Button
>
</
Popconfirm
>
</>
}
</>
)
return
component
}
}]
// 模拟请求
const
fetchData
=
(
params
?:
any
)
=>
{
console
.
log
(
params
)
//可以直接打印参数
return
new
Promise
((
resolve
,
reject
)
=>
{
getContractContractTemplatePage
({
...
params
}).
then
(
res
=>
{
resolve
(
res
.
data
)
}).
catch
(()
=>
{
reject
();
});
})
}
const
handleJumpAdd
=
()
=>
{
history
.
push
({
pathname
:
'/memberCenter/contract/template/add'
});
};
const
Actions
=
(
<
Space
>
<
Button
type=
"primary"
icon=
{
<
PlusOutlined
/>
}
onClick=
{
handleJumpAdd
}
>
{
intl
.
formatMessage
({
id
:
'contract.xinjian'
})
}
</
Button
>
</
Space
>
);
/**合同模板停用/启用 */
const
confirm
=
(
recode
:
any
)
=>
{
postContractContractTemplateEnable
({
id
:
recode
.
id
,
state
:
recode
.
state
===
1
?
0
:
1
,
}).
then
(
res
=>
{
ref
.
current
.
reload
()
})
}
/**删除 */
const
confirmDel
=
(
recode
:
any
)
=>
{
postContractContractTemplateDelete
({
id
:
recode
.
id
}).
then
(
res
=>
{
ref
.
current
.
reload
()
})
}
return
(
<
PageHeaderWrapper
>
<
Card
>
<
StandardTable
tableProps=
{
{
rowKey
:
'id'
,
}
}
columns=
{
columns
}
currentRef=
{
ref
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
controlRender=
{
<
NiceForm
actions=
{
formActions
}
expressionScope=
{
{
Actions
,
}
}
effects=
{
(
$
,
actions
)
=>
{
}
}
schema=
{
{
type
:
'object'
,
properties
:
{
searchWrap
:
{
type
:
'object'
,
'x-component'
:
'Mega-Layout'
,
'x-component-props'
:
{
grid
:
true
,
},
properties
:
{
actions
:
{
type
:
'object'
,
'x-component'
:
'Children'
,
'x-component-props'
:
{
children
:
'{{Actions}}'
,
},
},
name
:
{
type
:
'string'
,
'x-component'
:
'Search'
,
'x-component-props'
:
{
placeholder
:
intl
.
formatMessage
({
id
:
'contract.hetongmubanmingcheng'
}),
advanced
:
false
,
},
},
},
},
},
}
}
onSubmit=
{
values
=>
ref
.
current
.
reload
(
values
)
}
/>
}
/>
</
Card
>
</
PageHeaderWrapper
>
)
}
export
default
Template
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