|
@@ -1,14 +1,14 @@
|
|
/*
|
|
/*
|
|
* @Author: your name
|
|
* @Author: your name
|
|
* @Date: 2021-09-14 10:22:09
|
|
* @Date: 2021-09-14 10:22:09
|
|
- * @LastEditTime: 2021-09-15 19:12:17
|
|
|
|
|
|
+ * @LastEditTime: 2021-09-16 17:52:55
|
|
* @LastEditors: Please set LastEditors
|
|
* @LastEditors: Please set LastEditors
|
|
* @Description: In User Settings Edit
|
|
* @Description: In User Settings Edit
|
|
* @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/index.tsx
|
|
* @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/index.tsx
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
|
|
-import React, { Key, useRef, useState } from 'react'
|
|
|
|
|
|
+import React, {useRef,useEffect } from 'react'
|
|
import MccsPageContainer from '@/components/MccsPageContainer/index'
|
|
import MccsPageContainer from '@/components/MccsPageContainer/index'
|
|
import MccsProCard from '@/components/MccsProCard/index';
|
|
import MccsProCard from '@/components/MccsProCard/index';
|
|
import { useModel } from 'umi';
|
|
import { useModel } from 'umi';
|
|
@@ -20,7 +20,7 @@ import MccsDrawerForm from '@/components/MccsDrawerForm/index';
|
|
import MccsClickableTabs from '@/components/MccsClickableTabs/index';
|
|
import MccsClickableTabs from '@/components/MccsClickableTabs/index';
|
|
|
|
|
|
|
|
|
|
-import { Form, Table, Space, Row, Col } from 'antd'
|
|
|
|
|
|
+import { Form, Table, Space, Row, Col, Button } from 'antd'
|
|
import {
|
|
import {
|
|
ProFormText,
|
|
ProFormText,
|
|
ProFormSelect,
|
|
ProFormSelect,
|
|
@@ -105,7 +105,6 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
|
|
|
const { articleManagement } = useModel('allModels');
|
|
const { articleManagement } = useModel('allModels');
|
|
const {
|
|
const {
|
|
- getTreeData,
|
|
|
|
isLeaf,
|
|
isLeaf,
|
|
treeData,
|
|
treeData,
|
|
getTableData,
|
|
getTableData,
|
|
@@ -113,14 +112,12 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
setCurrentActivedTree,
|
|
setCurrentActivedTree,
|
|
scoreList,
|
|
scoreList,
|
|
getDepartmentRequest,
|
|
getDepartmentRequest,
|
|
- departmentManagers,
|
|
|
|
|
|
+ departmentManagers,
|
|
getDepartment,//获取责任单位
|
|
getDepartment,//获取责任单位
|
|
- getManagers, //获取责任人
|
|
|
|
...restModelData
|
|
...restModelData
|
|
} = articleManagement();
|
|
} = articleManagement();
|
|
const tableRef = useRef<MccsTable.MccsTableRef>();
|
|
const tableRef = useRef<MccsTable.MccsTableRef>();
|
|
- const [drawerVisible, setDrawerVisible] = useState(false);
|
|
|
|
-
|
|
|
|
|
|
+ const btnRef = useRef<HTMLButtonElement>(); //取消批量按钮
|
|
|
|
|
|
|
|
|
|
const onSelectHandle = (data: MccsFileTree.childTree) => {
|
|
const onSelectHandle = (data: MccsFileTree.childTree) => {
|
|
@@ -130,54 +127,74 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
tableRef?.current?.getTableRef().current?.reload();
|
|
tableRef?.current?.getTableRef().current?.reload();
|
|
}
|
|
}
|
|
|
|
|
|
- const batchSelfAssessment = (selectedRowKeys: Key[]) => {
|
|
|
|
- //批量设置目标
|
|
|
|
|
|
+ const batchSelfAssessment = (rowkeys:number[]|string[]) => {
|
|
|
|
+ //批量设置
|
|
|
|
+
|
|
|
|
+ restModelData.setDrawerFormType('BATCHSETTING');
|
|
|
|
+ restModelData.setSelectedRowKeys(rowkeys);
|
|
|
|
+ restModelData.setDrawerVisible(true);
|
|
}
|
|
}
|
|
|
|
|
|
const articleSetBtnHandle = () => {
|
|
const articleSetBtnHandle = () => {
|
|
//条文设置
|
|
//条文设置
|
|
- setDrawerVisible(true);
|
|
|
|
|
|
+ restModelData.setDrawerVisible(true);
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
const onVisibleChangeHandle = (visible: boolean) => {
|
|
const onVisibleChangeHandle = (visible: boolean) => {
|
|
- setDrawerVisible(visible);
|
|
|
|
|
|
+ restModelData.setDrawerVisible(visible);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ useEffect(() => {
|
|
|
|
+
|
|
|
|
+ if(restModelData.reloadRightContent){
|
|
|
|
+ //重新获取数据
|
|
|
|
+ tableRef?.current?.getTableRef().current?.reload();
|
|
|
|
+ tableRef?.current?.getTableRef().current?.clearSelected();
|
|
|
|
+ }
|
|
|
|
+ }, [restModelData]);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
return (
|
|
return (
|
|
<MccsPageContainer>
|
|
<MccsPageContainer>
|
|
<MccsDrawerForm
|
|
<MccsDrawerForm
|
|
- title='条文设置'
|
|
|
|
- width={600}
|
|
|
|
- visible={drawerVisible}
|
|
|
|
|
|
+ title={restModelData.drawerFormType=='ARTICLE_SET'?'条文设置':'批量设置'}
|
|
|
|
+ width={500}
|
|
|
|
+ visible={restModelData.drawerVisible}
|
|
|
|
+
|
|
|
|
+ onFinish={(values: any) => restModelData.drawerFormType=='ARTICLE_SET'?restModelData.setArticle(values):restModelData.batchSetting(values)}
|
|
onVisibleChange={onVisibleChangeHandle}
|
|
onVisibleChange={onVisibleChangeHandle}
|
|
>
|
|
>
|
|
<div className='formItemTitle'>负责人及单位</div>
|
|
<div className='formItemTitle'>负责人及单位</div>
|
|
<Row gutter={16}>
|
|
<Row gutter={16}>
|
|
<Col className="gutter-row" span={8}>
|
|
<Col className="gutter-row" span={8}>
|
|
<ProFormSelect
|
|
<ProFormSelect
|
|
- name="responsibilityDepartmentId"
|
|
|
|
|
|
+ name="responsibilityDepartment"
|
|
width='sm'
|
|
width='sm'
|
|
request={getDepartmentRequest}
|
|
request={getDepartmentRequest}
|
|
placeholder="选择单位"
|
|
placeholder="选择单位"
|
|
fieldProps={{
|
|
fieldProps={{
|
|
- onChange:(value,option)=>getDepartment(value,option)
|
|
|
|
|
|
+ labelInValue: true,
|
|
|
|
+ onChange: (value, option) => getDepartment(value, option)
|
|
}}
|
|
}}
|
|
rules={[{ required: true, message: '请选择单位!' }]}
|
|
rules={[{ required: true, message: '请选择单位!' }]}
|
|
/>
|
|
/>
|
|
</Col>
|
|
</Col>
|
|
|
|
|
|
<Col className="gutter-row" span={8}>
|
|
<Col className="gutter-row" span={8}>
|
|
- <ProFormDependency name={['responsibilityDepartmentId']}>
|
|
|
|
- {({ responsibilityDepartmentId }) => {
|
|
|
|
|
|
+ <ProFormDependency name={['responsibilityDepartment']}>
|
|
|
|
+ {({ responsibilityDepartment }) => {
|
|
return (
|
|
return (
|
|
<ProFormSelect
|
|
<ProFormSelect
|
|
- name="select2"
|
|
|
|
|
|
+ name="responsibilityUser"
|
|
width='sm'
|
|
width='sm'
|
|
- disabled={!responsibilityDepartmentId}
|
|
|
|
|
|
+ disabled={!responsibilityDepartment}
|
|
options={departmentManagers}
|
|
options={departmentManagers}
|
|
placeholder="选择负责人"
|
|
placeholder="选择负责人"
|
|
fieldProps={{
|
|
fieldProps={{
|
|
- onChange:(value,option)=>getManagers(value,option)
|
|
|
|
|
|
+ labelInValue: true,
|
|
|
|
+ // onChange:(value,option)=>getManagers(value,option)
|
|
}}
|
|
}}
|
|
rules={[{ required: true, message: '请选择负责人!' }]}
|
|
rules={[{ required: true, message: '请选择负责人!' }]}
|
|
/>
|
|
/>
|
|
@@ -187,24 +204,39 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
</Col>
|
|
</Col>
|
|
</Row>
|
|
</Row>
|
|
<div className='formItemTitle'>目标分数</div>
|
|
<div className='formItemTitle'>目标分数</div>
|
|
- <Row>
|
|
|
|
- <MccsClickableTabs
|
|
|
|
- data={restModelData.targetScores}
|
|
|
|
- />
|
|
|
|
- </Row>
|
|
|
|
- <div className='formItemTitle'>条文组别</div>
|
|
|
|
- <Row>
|
|
|
|
- <MccsClickableTabs
|
|
|
|
- data={restModelData.ruleTypes}
|
|
|
|
- />
|
|
|
|
|
|
+ <Row >
|
|
|
|
+ <Col span={24}>
|
|
|
|
+ <Form.Item name='targetScores'>
|
|
|
|
+ <MccsClickableTabs
|
|
|
|
+ data={restModelData.targetScores}
|
|
|
|
+ />
|
|
|
|
+ </Form.Item>
|
|
|
|
+ </Col>
|
|
</Row>
|
|
</Row>
|
|
|
|
+ {
|
|
|
|
+ true && (
|
|
|
|
+ <>
|
|
|
|
+ <div className='formItemTitle'>条文组别</div>
|
|
|
|
+ <Row>
|
|
|
|
+ <Col span={24}>
|
|
|
|
+ <Form.Item name='articleType'>
|
|
|
|
+ <MccsClickableTabs
|
|
|
|
+ data={restModelData.ruleTypes}
|
|
|
|
+ />
|
|
|
|
+ </Form.Item>
|
|
|
|
+ </Col>
|
|
|
|
+ </Row>
|
|
|
|
+ </>
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+
|
|
</MccsDrawerForm>
|
|
</MccsDrawerForm>
|
|
|
|
|
|
<MccsProCard gutter={16} ghost direction='row'>
|
|
<MccsProCard gutter={16} ghost direction='row'>
|
|
<MccsProCard colSpan={6} style={{ height: '78vh' }} bodyStyle={{ padding: '16px' }}>
|
|
<MccsProCard colSpan={6} style={{ height: '78vh' }} bodyStyle={{ padding: '16px' }}>
|
|
<MccsFileTree
|
|
<MccsFileTree
|
|
treeData={treeData}
|
|
treeData={treeData}
|
|
- // defaultSelected={'0-0'}
|
|
|
|
|
|
+ defaultSelected={'9'}
|
|
onSelectHandle={onSelectHandle}
|
|
onSelectHandle={onSelectHandle}
|
|
// actionHandle={actionHandle}
|
|
// actionHandle={actionHandle}
|
|
// searchHandle={searchHandle}
|
|
// searchHandle={searchHandle}
|
|
@@ -223,10 +255,12 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
// 注释该行则默认不显示下拉选项
|
|
// 注释该行则默认不显示下拉选项
|
|
selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
|
|
selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
|
|
}}
|
|
}}
|
|
- tableAlertOptionRender={(selectedRowKeys: Key[], selectedRows: SelectedRowsType[]) => {
|
|
|
|
|
|
+ rowKey="id"
|
|
|
|
+ tableAlertOptionRender={({selectedRowKeys, selectedRows,onCleanSelected}:{selectedRowKeys:number[]|string[],selectedRows:SelectedRowsType[],onCleanSelected:()=>void}) => {
|
|
return (
|
|
return (
|
|
<Space size={16}>
|
|
<Space size={16}>
|
|
- <a onClick={() => batchSelfAssessment(selectedRowKeys)}>批量自评</a>
|
|
|
|
|
|
+ <Button type='primary' onClick={() => batchSelfAssessment(selectedRowKeys)}>批量设置</Button>
|
|
|
|
+ <Button type='ghost' onClick={onCleanSelected}>取消选择</Button>
|
|
</Space>
|
|
</Space>
|
|
);
|
|
);
|
|
}}
|
|
}}
|
|
@@ -241,16 +275,17 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
<div className='leafContentTitle'>{currentActivedTree ? currentActivedTree.title : ''}</div>
|
|
<div className='leafContentTitle'>{currentActivedTree ? currentActivedTree.title : ''}</div>
|
|
<div className='peopleGroup'>
|
|
<div className='peopleGroup'>
|
|
<span>条文组别:</span>
|
|
<span>条文组别:</span>
|
|
- <span>管理</span>
|
|
|
|
|
|
+ <span>{restModelData.leafData?.articleType}</span>
|
|
<span>负责单位:</span>
|
|
<span>负责单位:</span>
|
|
- <span>医务部</span>
|
|
|
|
- <span>负责任:</span>
|
|
|
|
- <span>张国栋</span>
|
|
|
|
|
|
+ <span>{restModelData.leafData?.responsibilityDepartmentName}</span>
|
|
|
|
+ <span>负责人:</span>
|
|
|
|
+ <span>{restModelData.leafData?.responsibilityUserName}</span>
|
|
</div>
|
|
</div>
|
|
<MccsScoreBanner list={scoreList} />
|
|
<MccsScoreBanner list={scoreList} />
|
|
<div className='articleSetBtn'><span onClick={articleSetBtnHandle}>条文设置</span></div>
|
|
<div className='articleSetBtn'><span onClick={articleSetBtnHandle}>条文设置</span></div>
|
|
<MccsRecordList
|
|
<MccsRecordList
|
|
title='台账记录'
|
|
title='台账记录'
|
|
|
|
+ list={[]}
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
)
|
|
)
|