Commit e6fc6631 by zhaochengxiang

任务分配增加查看通知模版

parent 33e1ce9d
......@@ -411,3 +411,7 @@ export function* getOperationPopularDataAssetRanking() {
export function* getOperationLatestDataAssetRanking() {
return yield call(service.getOperationLatestDataAssetRanking)
}
export function* getNoticeTemplate(payload) {
return yield call(service.getNoticeTemplate, payload)
}
\ No newline at end of file
......@@ -399,3 +399,7 @@ export function getPreviewRangeByDirId(payload) {
export function getOperationLatestDataAssetRanking() {
return GetJSON("/dataassetmanager/operationApi/getLatestDataAssetRanking")
}
export function getNoticeTemplate(payload) {
return Get("/baseservice/noticeTemplate/getTemplateContent", payload)
}
\ No newline at end of file
import React from "react"
import { Modal, Button, Form, Select, Spin, Checkbox } from "antd"
import { Modal, Button, Form, Select, Spin, Checkbox, Space, Row } from "antd"
import { debounceTime, Subject } from 'rxjs'
import produce from "immer"
......@@ -75,7 +75,6 @@ const FC = (props) => {
export default FC
export const Basic = React.forwardRef(function ({ items }, ref) {
const [noticeTypes, setNoticeTypes] = React.useState()
const [form] = Form.useForm()
React.useImperativeHandle(ref, () => ({
......@@ -84,28 +83,6 @@ export const Basic = React.forwardRef(function ({ items }, ref) {
},
}), [form])
React.useEffect(() => {
getNoticeTypes()
}, [])
const getNoticeTypes = () => {
dispatch({
type: 'assetmanage.getNoticeTypes',
callback: (data) => {
const newData = produce(data, (draft) => {
draft?.forEach(item => {
item.label = item.desc
item.value = item.type
})
})
setNoticeTypes(newData)
},
error: () => {
}
})
}
const onValuesChange = (changedValues, allValues) => {
console.log('all values', allValues)
}
......@@ -130,7 +107,7 @@ export const Basic = React.forwardRef(function ({ items }, ref) {
name='noticeTypes'
rules={[{ required: true, message: '请选择通知方式!' }]}
>
<Checkbox.Group options={noticeTypes} />
<NoticeItem />
</Form.Item>
</Form>
)
......@@ -206,3 +183,57 @@ export const HandlersItem = ({ value, onChange }) => {
/>
)
}
const NoticeItem = ({ value, onChange }) => {
const [noticeTypes, setNoticeTypes] = React.useState()
const [modal, contextHolder] = Modal.useModal()
React.useEffect(() => {
getNoticeTypes()
}, [])
const getNoticeTypes = () => {
dispatch({
type: 'assetmanage.getNoticeTypes',
callback: (data) => {
setNoticeTypes(data)
}
})
}
return (
<div style={{ lineHeight: '32px' }}>
{
(noticeTypes??[]).map((item, index) => (
<Row key={index}>
<Space>
<Checkbox checked={(value??[]).indexOf(item.type) !== -1} value={item.type} style={{ width: 100 }} onChange={(e) => {
if (e.target.checked) {
onChange?.([...value??[], item.type])
} else {
onChange?.((value??[]).filter(item => item !== e.target.value))
}
}}>{item.desc}</Checkbox>
<a onClick={() => {
dispatch({
type: 'assetmanage.getNoticeTemplate',
payload: {
module: 'dataAsset',
type: item.desc
},
callback: (content) => {
modal.info({
title: '模版信息',
content: content??'',
})
}
})
}}>查看通知模版</a>
</Space>
</Row>
))
}
{contextHolder}
</div>
)
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment