Commit 360b070e by fanyj

tijiao

parent be102c00
......@@ -307,7 +307,7 @@ const List = React.forwardRef(function ({ items }, ref) {
)
})
const AuditUsersItem = ({ value, onChange }) => {
export const AuditUsersItem = ({ value, onChange }) => {
const [loading, setLoading] = React.useState(false)
const [options, setOptions] = React.useState()
......
......@@ -659,7 +659,7 @@ const AssetAction = React.forwardRef(function (props, ref) {
}
});
const tempcolumns = columns.map((item)=>{
const tempcolumns = (columns||[]).map((item)=>{
return {...item,annotation:formdata[item._id]}
})
......
import React,{useState} from "react"
import {Modal,Spin,Button,Form,Row,Col,Upload,Input,Tooltip,Typography,Table} from "antd"
import {UploadOutlined} from "@ant-design/icons"
import { useSetState } from "ahooks"
import { AuditUsersItem,AttachesItem } from "../../AssetDraft/start-flow"
import { showMessage, showNotifaction } from '@/util'
import { dispatch } from '@/model'
import produce from 'immer'
const AssetFlow:React.FC<any>=(props)=>{
const {visible,onCancel,item} = props
const [loading, setLoading] = useState(false)
const [uploading, setUploading] = useState(false)
const [tableData, setTableData] = React.useState()
const [state,setState] = useSetState({
loading:false
})
const [form] = Form.useForm()
const close=()=>{
onCancel?.()
}
const save=()=>{
}
const onValuesChange=()=>{
}
const uploadProps = {
beforeUpload: file => {
const isLt5M = file.size / 1024 / 1024 <= 100
if (!isLt5M) {
showMessage('error', '上传文件限制最大100M')
return false
}
setUploading(true)
dispatch({
type: 'assetmanage.uploadAttachment',
payload: {
fileList: [file],
},
callback: (data) => {
setUploading(false)
const prev = form?.getFieldValue('attachments')
const newFileList = [...prev??[], data]
form?.setFieldsValue({ attachments: newFileList })
},
error: () => {
setUploading(false)
}
})
return false
},
fileList: [],
}
const dprops:any={}
const cols = [
{
title: '序号',
dataIndex: 'index',
width:60,
render:(_, __, index)=> (index+1)
},
{
title: '资产名称',
dataIndex: 'enName',
width: 160,
render: (text, record) => (
<Tooltip title={text}>
<Typography.Text ellipsis={true}>
{text}
</Typography.Text>
</Tooltip>
)
},
{
title: '中文名称',
dataIndex: 'cnName',
width: 160,
render: (text, record) => (
<Tooltip title={text}>
<Typography.Text ellipsis={true}>
{text}
</Typography.Text>
</Tooltip>
)
},
{
title: '编码',
dataIndex: 'code',
width: 160,
render: (text, record) => (
<Tooltip title={text}>
<Typography.Text ellipsis={true}>
{text}
</Typography.Text>
</Tooltip>
)
},
{
title: '路径',
dataIndex: 'path',
width: 120,
render: (text, record) => (
<Tooltip title={text}>
<Typography.Text ellipsis={true}>
{text}
</Typography.Text>
</Tooltip>
)
},
{
title: '送审备注',
dataIndex: 'remarks',
render: (_, __, index) => (
<Input.TextArea rows={1}
autoSize={{ minRows: 1, maxRows: 3 }}
allowClear
onChange={(e) => {
setTableData(prev => {
return produce(prev, (draft) => {
draft[index].remarks = e.target.value
})
})
}}
/>
)
},
]
return(
<Modal
visible={visible}
confirmLoading={state.loading}
width='80%'
bodyStyle={{ padding: '15px', overflowX: 'auto', height: '80vh' }}
title='资产问责'
centered
destroyOnClose
onCancel={() => { close() }}
>
<Spin spinning={state.loading}>
<Form
form={form}
labelCol={{ span: 6 }}
wrapperCol={{ span: 18 }}
autoComplete="off"
onValuesChange={onValuesChange}
>
<Row gutter={10}>
<Col span={12}>
<Form.Item
label='评审人员'
name="nextAuditUsers"
style={{ marginBottom:15 }}
rules={[{ required: true, message: '请选择评审人员!' }]}
>
<AuditUsersItem {...dprops} />
</Form.Item>
<Form.Item
label='附件'
style={{ marginBottom:15 }}
>
<Upload {...uploadProps }>
<Button icon={<UploadOutlined />}>点击上传</Button>
</Upload>
</Form.Item>
<Form.Item
label='已上传附件'
name='attachments'
>
<AttachesItem {...dprops} />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label='送审说明'
name="desc"
style={{ marginBottom:15 }}
rules={[{ required: true, message: '请填写送审说明!' }]}
>
<Input.TextArea rows={4} placeholder='请输入送审说明' />
</Form.Item>
</Col>
</Row>
</Form>
<Table
columns={cols??[]}
dataSource={tableData??[]}
pagination={false}
/>
</Spin>
</Modal>
)
}
export default AssetFlow
\ No newline at end of file
......@@ -33,6 +33,8 @@ import PermissionMenuItem from '../../../../util/Component/PermissionMenuItem'
import "./AssetTable.less";
import 'react-contexify/dist/ReactContexify.css';
import { getTemplateType } from "../../../../util/axios";
import { useGetModalInfoAndAction } from "@/hooks/common";
import AssetFlow from "./AssetFlow"
const { Text } = Typography;
const { Column } = Table;
......@@ -422,6 +424,8 @@ const AssetTable = (props) => {
return newMenuData
}, [contextMenuItem])
const questionModal = useGetModalInfoAndAction()
const storageChange = (e) => {
if (e.key === 'assetRelationOnClickEvent') {
remoteRelationRef.current = e.relation;
......@@ -1058,6 +1062,8 @@ const AssetTable = (props) => {
visible: true,
id: contextMenuItem?.id
})
}else if(key ==='发起问责'){
questionModal.openModal(contextMenuItem)
}
}
......@@ -1139,6 +1145,12 @@ const AssetTable = (props) => {
添加标签
</div>
</PermissionMenuItem>
<Menu.Item key='questionwaring'
>
<div className='text-center'>
发起问责
</div>
</Menu.Item>
<Menu.Item key='visibleColSetting'
>
<div className='text-center'>
......@@ -1186,6 +1198,8 @@ const AssetTable = (props) => {
}
}
console.log('questionModal',questionModal)
return(
<div className={classes}>
<div
......@@ -1381,8 +1395,9 @@ const AssetTable = (props) => {
total={total}
showTotal={total => ` ${total} `}
/>
<AssetFlow visible={questionModal.visible} onCancel={()=>{questionModal.cancelModal()}} item={questionModal.currentItem} />
</div>
<AddAsset
{...addAssetParams}
nodeId={nodeId}
......@@ -1491,14 +1506,17 @@ const AssetTable = (props) => {
<RcMenu id={MENU_ID}>
{
menuData?.map(item => (
<RcItem id={item} onClick={handleItemClick}>
menuData?.map((item,key) => (
<RcItem key={key} id={item} onClick={handleItemClick}>
{item}
</RcItem>
))
}
<RcItem id={'发起问责'} onClick={handleItemClick}>
发起问责
</RcItem>
</RcMenu>
{contextHolder}
</div>
)
......
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