فهرست منبع

条文管理添加详情操作/抽离部分公共逻辑

code4eat 3 سال پیش
والد
کامیت
b5150f84a5

+ 9 - 9
README.md

@@ -123,17 +123,17 @@ npm run start:dev //开发环境,不使用mock,所有数据通过代理接口
     },[data]);
 ...
 
-//条文管理和台账上传界面是共用页面模块,在编写这两块的逻辑时注意状态区分
+##### 条文管理和台账上传界面是共用页面模块,在编写这两块的逻辑时注意状态区分
 
-//项目数据共享使用的是umi 的model插件,每个page对应一个model.ts文件
-//model文件分布在每个page下面,然后统一在src/models/allModel.ts里引入使用
+##### 项目数据共享使用的是umi 的model插件,每个page对应一个model.ts文件
+##### model文件分布在每个page下面,然后统一在src/models/allModel.ts里引入使用
 
-//在复杂的组件方面都配有readme.md文件,里面提供了相关demo
-//项目引入的绝大多数组件来自antd/antd Pro,在使用这些组件时,多数进行了初步的包装,以便在项目中对一些特性进行统一处理
-
-//项目的平台管理下的多个页面都是从成本核算移植过来的,采用的是react+react hook写法,并没有采用目前的react+react //hook+typescript,考虑到这块将来统一提升至中台,暂时没做处理。
+##### 在复杂的组件方面都配有readme.md文件,里面提供了相关demo
+##### 项目引入的绝大多数组件来自antd/antd Pro,在使用这些组件时,多数进行了初步的包装,以便在项目中对一些特性进行统一处理
 
+##### 项目的平台管理下的多个页面都是从成本核算移植过来的,采用的是react+react hook写法,并没有采用目前的react+react //hook+typescript,考虑到这块将来统一提升至中台,暂时没做处理。
 
+##### 条文管理和台账上传两个页面有数据/组件共享,在处理时需重点注意
 
 ```
 
@@ -141,6 +141,6 @@ npm run start:dev //开发环境,不使用mock,所有数据通过代理接口
 
 #### RoadMap
 
-- 2022-11-25 
-- 
+- 2022-01-25 
+- 2022-03-07
 

BIN
public/arrow.png


BIN
public/arrow_white.png


BIN
public/cycleArrow.png


BIN
public/cycleArrow_white.png


BIN
public/doubleArrow.png


BIN
public/doubleArrow_white.png


+ 2 - 1
src/components/MccsTable/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-14 11:14:06
- * @LastEditTime: 2021-09-24 11:31:12
+ * @LastEditTime: 2022-03-07 11:00:11
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/src/components/MccsTable/index.tsx
@@ -58,6 +58,7 @@ const MccsTable=React.forwardRef<MccsTable.MccsTableRef,MccsTable.MccsTable>((pr
                   formRef={formRef}
                   actionRef={tableRef}
                   request={request}
+                  pagination={{ defaultPageSize: 10 }}
                   {...rest}
             />
             </div>

+ 164 - 0
src/pages/GradeHospitalAccreditation/articleManagement/components/articleDetailModule/drawer/index.tsx

@@ -0,0 +1,164 @@
+/*
+ * @Author: your name
+ * @Date: 2022-03-07 11:05:19
+ * @LastEditTime: 2022-03-08 16:50:46
+ * @LastEditors: Please set LastEditors
+ * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ * @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/drawer/set.tsx
+ */
+
+
+
+import MccsDrawerForm from '@/components/MccsDrawerForm/index';
+import { ProFormDependency, ProFormInstance, ProFormSelect } from '@ant-design/pro-form';
+import MccsClickableTabs from '@/components/MccsClickableTabs/index';
+import { useRef } from 'react'
+
+import { Form, Row, Col } from 'antd'
+import { useModel } from 'umi';
+
+
+
+//条文设置/表格批量设置drawer弹窗
+
+const SetDrawer = () => {
+
+    const { articleManagement } = useModel('allModels');
+
+    const {
+        isLeaf,
+        treeData,
+        getTableData,
+        currentActivedTree,
+        setCurrentActivedTree,
+        scoreList,
+        getDepartmentRequest,
+        departmentManagers,
+        getDepartment,//获取责任单位
+        ...restModelData
+    } = articleManagement;
+
+    const drawerFormRef = useRef<ProFormInstance>();
+
+
+
+    const onVisibleChangeHandle = (visible: boolean) => {
+        //drawer展示控制
+        !visible && articleManagement.setArticleSettingFormInit({});//清空默认值
+        restModelData.setDrawerVisible(visible);
+    }
+    
+    const setTitle = (type:string) => {
+        if (restModelData.drawerFormType == 'ARTICLE_SET') {
+            return '条文设置'
+        }
+        if (restModelData.drawerFormType == 'BATCHSETTING') {
+            return '批量设置'
+        }
+    }
+
+    const onFinishHandle = (values:any)=>{
+        
+        if (restModelData.drawerFormType == 'ARTICLE_SET') {
+            restModelData.setArticle(values)
+        }
+        if (restModelData.drawerFormType == 'BATCHSETTING') {
+            restModelData.batchSetting(values)
+        }
+    }
+
+    return (
+        <MccsDrawerForm
+            title={setTitle(restModelData.drawerFormType)}
+            width={500}
+            formRef={drawerFormRef}
+            visible={restModelData.drawerVisible}
+            initialValues={restModelData.drawerFormType == 'ARTICLE_SET' ? { ...articleManagement.articleSettingFormInit } : {}}
+            onFinish={(values: any) => onFinishHandle(values)}
+            onVisibleChange={onVisibleChangeHandle}
+        >
+                    <div>
+                        <div className='formItemTitle'>负责人及单位</div>
+                        <Row gutter={16}>
+                            <Col className="gutter-row" span={10}>
+                                <ProFormSelect
+                                    name="responsibilityDepartment"
+                                    width='sm'
+                                    showSearch
+                                    request={getDepartmentRequest}
+                                    placeholder="选择单位"
+                                    fieldProps={{
+                                        labelInValue: true,
+                                        onChange: (value, option) => {
+                                            //责任单位修改时清空责任人
+                                            drawerFormRef.current?.setFieldsValue({ ...articleManagement.articleSettingFormInit, responsibilityUser: { label: '', value: '' } });
+                                            getDepartment(value, option)
+                                        }
+                                    }}
+                                    rules={[{ required: true, message: '请选择单位!' }]}
+                                />
+                            </Col>
+
+                            <Col className="gutter-row" span={8}>
+                                <ProFormDependency name={['responsibilityDepartment']}>
+                                    {({ responsibilityDepartment }) => {
+                                        return (
+                                            <ProFormSelect
+                                                name="responsibilityUser"
+                                                width='sm'
+                                                disabled={!responsibilityDepartment || JSON.stringify(responsibilityDepartment) == '{}'}
+                                                options={departmentManagers}
+                                                placeholder="选择负责人"
+                                                fieldProps={{
+                                                    labelInValue: true,
+                                                    // onChange:(value,option)=>getManagers(value,option)
+                                                }}
+                                                rules={[{ required: true, message: '请选择负责人!' }]}
+                                            />
+                                        )
+                                    }}
+                                </ProFormDependency>
+                            </Col>
+                        </Row>
+                        <div className='formItemTitle'>目标分数</div>
+                        <Row >
+                            <Col span={24}>
+                                <Form.Item name='targetScores' rules={[
+                                    {
+                                        required: true,
+                                        message: '请选择目标分数!',
+                                    },
+                                ]}>
+                                    <MccsClickableTabs
+                                        data={restModelData.targetScores}
+                                    />
+                                </Form.Item>
+                            </Col>
+                        </Row>
+                        {
+                            true && (
+                                <>
+                                    <div className='formItemTitle'>条文组别</div>
+                                    <Row>
+                                        <Col span={24}>
+                                            <Form.Item name='articleType' rules={[
+                                                {
+                                                    required: true,
+                                                    message: '请选择条文组别!',
+                                                },
+                                            ]}>
+                                                <MccsClickableTabs
+                                                    data={restModelData.ruleTypes}
+                                                />
+                                            </Form.Item>
+                                        </Col>
+                                    </Row>
+                                </>
+                            )
+                        }
+                    </div>
+        </MccsDrawerForm>
+    )
+}
+
+export default SetDrawer;

+ 503 - 0
src/pages/GradeHospitalAccreditation/articleManagement/components/articleDetailModule/index.tsx

@@ -0,0 +1,503 @@
+/*
+ * @Author: your name
+ * @Date: 2022-03-08 10:41:15
+ * @LastEditTime: 2022-03-08 18:13:30
+ * @LastEditors: Please set LastEditors
+ * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ * @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/components/articleDetailModule/index.tsx
+ */
+
+
+import MccsEditableTable from '@/components/MccsEditableTable';
+import MccsLightTable from '@/components/MccsLightTable';
+import { getScoreColor } from '@/constant';
+import TextArea from 'antd/lib/input/TextArea';
+import React, { useRef, useEffect, useState } from 'react'
+import { useModel } from 'umi';
+import { ActType } from '../..';
+import { getCurrentLevelTable, getTaizhangDirectoryTable } from '../../server';
+
+import { Input, Switch, Select } from 'antd'
+
+import './style.less';
+import SetDrawer from './drawer';
+
+const { Option } = Select;
+
+const myEvent = new Event('resize');
+
+const MccsLightTableColumns = [
+    {
+        key: 'gradeLevel',
+        title: '档次',
+        width: 10
+    },
+    {
+        key: 'directory',
+        title: '名称',
+        width: 60
+    },
+    {
+        key: 'accountType',
+        title: '类型',
+    },
+    {
+        key: 'accountStatus',
+        title: '需要台账',
+        render: (record: any) => {
+            return record.accountStatus == 0 ? '否' : '是'
+        }
+    },
+]
+
+const ArticleDetail = ({ isModeTwo = false }) => {
+
+    const { articleManagement } = useModel('allModels');
+
+    const {
+        isLeaf,
+        treeData,
+        getTableData,
+        currentActivedTree,
+        setCurrentActivedTree,
+        scoreList,
+        getDepartmentRequest,
+        departmentManagers,
+        getDepartment,//获取责任单位
+        currentSelectedActObj,
+        ...restModelData
+    } = articleManagement;
+    
+    console.log({isModeTwo});
+
+    const [scrollAreaH, setScrollAreaH] = useState(100);
+    const leafContentRef = useRef<HTMLDivElement>(null);
+    const scrollContentRef = useRef<HTMLDivElement>(null);
+    const [ifCollapse, setifCollapse] = useState(false);
+
+    const mccsEditableTableColumns = [
+        {
+            title: '名称',
+            dataIndex: 'directory',
+            width: '50%',
+            align: 'center',
+            formItemProps: () => {
+                return {
+                    rules: [{ required: true, message: '此项为必填项' }],
+                };
+            },
+        },
+        {
+            title: '档次',
+            dataIndex: 'grade',
+            width: '15%',
+            align: 'center',
+            formItemProps: () => {
+                return {
+                    rules: [{ required: true, message: '此项为必填项' }],
+                };
+            },
+            renderFormItem: (_: any, config: any, form: any) => {
+
+                const { isEditable } = config;
+
+                return isEditable ? (
+                    <Select
+                        mode='multiple'
+                        placeholder='请选择'
+                    >
+                        {
+                            restModelData.gradeOptions.map((item, index) => (
+                                <Option value={item.value} key={index}>{item.label}</Option>
+                            ))
+                        }
+                    </Select>
+
+                ) : <Input />;
+            },
+            render: (_: any, row: any) => {
+                return typeof _ == 'object' ? _.join(',') : _;
+            },
+        },
+        {
+            title: '类型',
+            dataIndex: 'accountType',
+            align: 'center',
+            width: '15%',
+            formItemProps: () => {
+                return {
+                    rules: [{ required: true, message: '此项为必填项' }],
+                };
+            },
+            renderFormItem: (_: any, { isEditable }: { isEditable: boolean }, form: any) => {
+
+                return isEditable ? (
+                    <Select
+                        placeholder='请选择'
+                    >
+                        {
+                            restModelData.accountTypeOptions.map((item, index) => (
+                                <Option value={item.value} key={index}>{item.label}</Option>
+                            ))
+                        }
+                    </Select>
+                ) : <Input />;
+            },
+
+
+        },
+        {
+            title: '台账上传',
+            align: 'center',
+            dataIndex: 'accountStatus',
+            width: '10%',
+            valueType: 'switch',
+            render: (_: any, row: any) => {
+                return (
+                    <Switch size='small' disabled checked={row.accountStatus} />
+                )
+            },
+        },
+
+    ]
+
+
+    const onTextAreaChange = (e: React.ChangeEvent<HTMLTextAreaElement>, level: string) => {
+        //更改执行情况说明数据
+        //首先找出要更新的项,再进行整体替换
+
+        if (restModelData.selectedSelfEvolution) {
+
+            const editTargetLevel = restModelData.selectedSelfEvolution.label;  //目标等级
+            //找出目标等级下正在更新的level
+            const editImplementationDataItemIndex = restModelData.implementationData[editTargetLevel].findIndex(item => item.level == level);
+            //拷贝旧的目标等级数据
+            let _cpOldImplemetationItem = restModelData.implementationData[editTargetLevel];
+            //将新的编辑内容赋值给正在编辑的目标下的level
+            _cpOldImplemetationItem[editImplementationDataItemIndex].note = e.target.value;
+
+            if (editImplementationDataItemIndex != -1) {
+                restModelData.setImplementationData({
+                    ...restModelData.implementationData,
+                    //插入更新
+                    [editTargetLevel]: _cpOldImplemetationItem
+                }
+                )
+            }
+        }
+
+    }
+
+    const taizhangDataDerectoryEditHandle = (data: any, actType: ActType) => {
+        //台账资料目录编辑回调
+        const version = restModelData.leafData?.reviewArticle.version;
+        let prevData = restModelData.taizhangDataDirectoryCommitList;
+        const numStr = restModelData.leafData?.reviewArticle.numStr;
+
+
+        if (actType == ActType.DEL && (typeof data.id == 'string')) {
+            //如果是删除操作且删除的不是数据库已有数据时,剔除之前暂时保留数据
+            prevData = prevData.filter(item => item.directory != data.directory);
+            restModelData.setTaizhangDataDirectoryCommitList([...prevData]);
+            return;
+        }
+
+        const replaceData = (item: any, index: number) => {
+            prevData[index] = {
+                ...item, dataStatus: actType, version: version ? version : '',
+                grade: data.grade.join(','), numStr: numStr, accountStatus: data.accountStatus ? '1' : '0'
+            };
+            restModelData.setTaizhangDataDirectoryCommitList([...prevData]);
+
+        }
+
+        const findeIndex = prevData.findIndex(item => item.id == data.id);
+
+        if (findeIndex != -1) {
+            //之前已有操作记录的,替换为最新状态
+            replaceData(data, findeIndex);
+            return;
+        }
+
+        restModelData.setTaizhangDataDirectoryCommitList(
+            [...prevData, {
+                ...data, dataStatus: actType, version: version ? version : '',
+                grade: data.grade.join(','), numStr: numStr, accountStatus: data.accountStatus ? '1' : '0'
+            }]
+        )
+    }
+
+
+
+    const followWindowResize = (num?: number, leafContentHeight?: number) => {
+        const _num = num ? num : 0;
+
+        if (leafContentRef.current) {
+            const leafContentH = leafContentHeight ? leafContentHeight : (leafContentRef.current.clientHeight);  //className为leafContent的div
+            const headerH = 48 + 16;
+            const scoreH = isModeTwo ? (60 + 32) : 0;
+            const h = window.innerHeight - (leafContentH + headerH + scoreH);
+            // console.log({leafContentH,headerH,scoreH,h});
+            setScrollAreaH(h - _num);
+        }
+    }
+
+    const telescopicBtnHandle = (e: React.MouseEvent) => {
+        //展开/收起
+        e.preventDefault();
+        
+        setifCollapse(!ifCollapse);
+        if (!ifCollapse) {
+            followWindowResize(0, 55);
+        } else {
+            followWindowResize(0);
+        }
+
+        // window.dispatchEvent(myEvent);
+
+        if (scrollContentRef.current) {
+            scrollContentRef.current.scrollTop = 0
+        }
+
+    }
+
+
+    const articleSetBtnHandle = () => {
+        //条文设置
+        // console.log({ articleSettingFormInit });
+        restModelData.setDrawerFormType('ARTICLE_SET');
+        restModelData.setDrawerVisible(true);
+
+    }
+
+    const setEditPageStatus = () => {
+        //更改页面的编辑状态
+        restModelData.setEditMode(!restModelData.editMode);
+    }
+
+
+    useEffect(() => {
+        if (restModelData.editMode) {
+            followWindowResize(40);
+        } else {
+            followWindowResize(0);
+        }
+    }, [restModelData.editMode]);
+
+    useEffect(() => {
+        // followWindowResize();
+        if (isLeaf) {
+            setTimeout(() => {
+                //首次加载叶子节点内容触发一次
+                window.dispatchEvent(myEvent);
+                document.body.style.overflowY = 'hidden';  //叶子节点下锁住页面滚动
+            }, 500);
+            //获取单位列表
+        }
+
+        if (!isLeaf) {
+            document.body.style.overflowY = 'auto';  //非叶子节点放开
+        }
+    }, [isLeaf]);
+
+
+    useEffect(() => {
+        window.addEventListener("resize", () => followWindowResize());
+        return () => {
+            window.removeEventListener("resize", () => followWindowResize());
+        }
+    }, []);
+
+
+    return (
+        <div className='articleDetailContainer' >
+
+            {
+                //抽屉
+            }
+            <SetDrawer />
+            
+            {
+                isLeaf && (
+                    <div className={ifCollapse ? 'leafContent collapse' : 'leafContent'} ref={leafContentRef}>
+                        <div className='leafContentTitle'>{currentActivedTree ? currentActivedTree.title : ''}</div>
+                        <div className='peopleGroup'>
+                            <span>条文组别:</span>
+                            <span>{restModelData.leafData?.reviewArticle?.accountType}</span>
+                            <span>负责单位:</span>
+                            <span>{restModelData.leafData?.reviewArticle?.responsibilityDepartmentName}</span>
+                            <span>负责人:</span>
+                            <span>{restModelData.leafData?.reviewArticle?.responsibilityUserName}</span>
+                        </div>
+                        {/* <MccsScoreBanner list={scoreList} /> */}
+                        <div className='scoreRow'>
+                            <div className='scoreInfo'>
+                                {
+                                    scoreList.map((item, index) => {
+                                        return (
+                                            <div key={index} className='scoreBlock'>
+                                                {item.label}
+                                                {item.value && item.value != '-' ? (<span style={{ color: getScoreColor(item.value) }}>{item.value}</span>) : ' -'}
+                                            </div>
+                                        )
+                                    })
+                                }
+                            </div>
+                            {
+                                //条文页面
+                                !restModelData.moduleMode && <div className='ruleSettingBtn' onClick={articleSetBtnHandle}>条文设置</div>
+                            }
+                            {
+                                //台账上传页面且非编辑状态下
+                                (restModelData.moduleMode && !restModelData.editMode && restModelData.hasEditAuthority) && <div className='editPageBtn' onClick={() => setEditPageStatus()}>{restModelData.editMode ? '取消编辑' : '开启编辑'}</div>
+                            }
+                        </div>
+                        <div className='scoreGradeDetail'>
+
+                            {
+                                restModelData.leafData?.pfmViewRuleDetailDataVoList.map((item, index) => (
+                                    <div className='scoreGradeDetailList' key={index}>
+                                        <div className='head'>{item.evaluation}</div>
+                                        <div className='detail'>
+                                            {
+                                                item.viewRuleAndLevelVos && item.viewRuleAndLevelVos.map((v, k) => (
+                                                    <div className='textLine' key={k}>{`${v.grade} ${v.detail}`}</div>
+                                                ))
+                                            }
+                                        </div>
+                                    </div>
+                                ))
+                            }
+                        </div>
+
+                        <div className={ifCollapse ? 'telescopicBtn collapse' : 'telescopicBtn'} onClick={e => telescopicBtnHandle(e)}></div>
+                    </div>
+                )
+            }
+
+            {
+                isLeaf && isModeTwo && (
+                    <div className='selfEvaluationWrap'>
+                        <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', width: '100%', }}>
+                            <div className='selfEvaluation'>
+                                自评等级
+                                {!restModelData.editMode && (
+                                    <span style={{ color: getScoreColor(restModelData.leafData ? restModelData.leafData.reviewArticle.selfEvaluation : '') }}>{restModelData.leafData?.reviewArticle.selfEvaluation ? restModelData.leafData?.reviewArticle.selfEvaluation : '-'}</span>
+                                )}
+                            </div>
+                            {
+                                restModelData.editMode && (
+                                    <div className='wrap' style={{ width: '60%', display: 'flex', flexDirection: 'row', justifyContent: 'flex-end' }}>
+                                        {
+                                            (restModelData.targetScores).map((item, index) => (
+                                                <div className={restModelData.selectedSelfEvolution?.label == item.label ? 'tab on' : 'tab'} key={index} onClick={() => restModelData.onSelfEvolutionTabChange(item)}>{item.label}</div>
+                                            ))
+                                        }
+                                    </div>
+                                )
+                            }
+                        </div>
+                    </div>
+                )
+            }
+
+            {
+                isLeaf && restModelData.leafData && (
+                    //台账上传页面时,背景色统一白色,cardWrap提供容器实现上下滑动
+                    <div className={isModeTwo ? 'cardWrap isModeTwo' : 'cardWrap'} style={{ marginTop: '16px', height: `${scrollAreaH - 16}px` }} ref={scrollContentRef}>
+                        <div>
+                            {
+                                //渲染执行情况说明
+                                /**
+                                 * 满足条件:
+                                 * 1.存在自评等级从接口获取或手动点击选择
+                                 * 2.implementationData里有当前等级的数据
+                                 */
+                                (restModelData.selectedSelfEvolution && restModelData.implementationData[restModelData.selectedSelfEvolution.label])
+                                && restModelData.implementationData[restModelData.selectedSelfEvolution.label].map((item, index) => {
+
+                                    return (
+                                        <div className='card' key={index} style={{ marginBottom: isModeTwo ? 0 : '16px', paddingBottom: isModeTwo ? 0 : '16px', paddingTop: isModeTwo ? 0 : '16px' }}>
+                                            <div className='cardTitle' style={{ marginBottom: isModeTwo ? '8px' : '16px' }}>{`执行情况说明(等级${item.level})`}</div>
+
+                                            <TextArea allowClear showCount maxLength={2000}
+                                                autoSize={{
+                                                    minRows: 5,
+                                                    maxRows: 20
+                                                }}
+                                                disabled={!restModelData.editMode} value={item.note}
+                                                onChange={e => onTextAreaChange(e, item.level)}
+                                                style={{ marginBottom: 20 }} />
+
+                                            {
+                                                !isModeTwo && (
+                                                    <MccsLightTable
+                                                        columns={MccsLightTableColumns}
+                                                        request={(current, pageSize) => getCurrentLevelTable({
+                                                            level: item.level,
+                                                            numStr: currentSelectedActObj ? (currentSelectedActObj.numStr?currentSelectedActObj.numStr:currentSelectedActObj.code) : 'null',
+                                                            version: restModelData.leafData ? (restModelData.leafData.reviewArticle.version) : 'null',
+                                                            current,
+                                                            pageSize
+                                                        })}
+                                                    />
+                                                )
+                                            }
+                                        </div>
+                                    )
+                                })
+                            }
+                        </div>
+                        <div>
+                            {
+                                //台帐下展示
+                                (isModeTwo && restModelData.leafData) && (
+                                    <MccsEditableTable
+                                        bordered={true}
+                                        controlled={false}
+                                        edit={restModelData.editMode}
+                                        reload={!restModelData.editMode}
+                                        pagination={true}
+                                        addHandle={
+                                            (data: any) => taizhangDataDerectoryEditHandle(data, ActType.ADD)
+                                        }
+                                        editHandle={
+                                            (data: any) => taizhangDataDerectoryEditHandle(data, ActType.EDIT)
+                                        }
+                                        delHandle={
+                                            (data: any) => taizhangDataDerectoryEditHandle(data, ActType.DEL)
+                                        }
+                                        request={async (current, pageSize) => {
+
+                                            if (restModelData.leafData) {
+
+                                                const { numStr, version } = restModelData.leafData.reviewArticle;
+                                                const resp = await getTaizhangDirectoryTable({ numStr, version, current, pageSize });
+                                                const { list = [] } = resp;
+                                                return {
+                                                    data: list.map(item => ({ ...item, grade: item.grade ? item.grade.split(',') : [], accountStatus: item.accountStatus == '0' ? false : true })), //多选下拉需传数组值
+                                                    total: resp.totalCount,
+                                                    current: resp.current,
+                                                    success: true
+                                                };
+                                            }
+                                            return {
+                                                data: [],
+                                                total: 0,
+                                                success: false
+                                            }
+                                        }}
+                                        columns={mccsEditableTableColumns}
+                                    />
+                                )
+                            }
+                        </div>
+                    </div>
+                )
+            }
+
+        </div>
+    )
+}
+
+export default ArticleDetail;

+ 235 - 0
src/pages/GradeHospitalAccreditation/articleManagement/components/articleDetailModule/style.less

@@ -0,0 +1,235 @@
+
+
+
+.articleDetailContainer {
+      
+    .leafContent {
+  
+        position: relative;
+        background-color: #fff;
+        padding:16px;
+        .telescopicBtn {
+          position: absolute;
+          top:16px;
+          right:16px;
+          z-index: 99;
+          cursor: pointer;
+           margin-left: -15px;
+          width: 25px;
+          height: 25px;
+          border-radius: 50%;
+          background: url('../../../../../../public/arrow.png');
+          background-size: 60%;
+          background-position: center center;
+          transition: all 0.2s ease-in;
+          background-repeat: no-repeat;
+          transform: rotate(0deg);
+          &.collapse {
+              transform: rotate(180deg);
+          }
+          &:hover {
+            background-image: url('../../../../../../public/arrow_white.png');
+            background-color:#A3B1CC;
+          }
+      
+        }
+        .leafContentTitle {
+          font-size: 16px;
+          font-family: SourceHanSansCN-Bold, SourceHanSansCN;
+          font-weight: bold;
+          color: #292C33;
+          line-height: 24px;
+          overflow: hidden; //超出的文本隐藏
+          text-overflow: ellipsis; //溢出用省略号显示
+          white-space: nowrap; //溢出不换行
+          margin-bottom: 16px;
+        }
+      
+        .peopleGroup {
+          display: flex;
+          flex-direction: row;
+          justify-content: flex-start;
+          align-items: center;
+          margin-bottom: 24px;
+      
+          span {
+            font-size: 14px;
+            font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+            font-weight: 400;
+            color: #292C33;
+            line-height: 21px;
+      
+            &:nth-child(2n) {
+              margin-right: 40px;
+            }
+          }
+        }
+      
+        .scoreRow {
+          display: flex;
+          flex-direction: row;
+          justify-content: space-between;
+          align-items: center;
+          height:32px;
+      
+          .scoreInfo {
+            display: flex;
+            flex-direction: row;
+            justify-content: flex-start;
+            align-items: center;
+      
+            .scoreBlock {
+              display: flex;
+              flex-direction: row;
+              justify-content: center;
+              align-items: center;
+              width: 117px;
+              height: 16px;
+              font-size: 12px;
+              font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+              font-weight: 400;
+              color: #525866;
+              border-right: 1px solid #DADEE6;
+      
+              &>span {
+                position: relative;
+                top: -2px;
+                display: inline-block;
+                margin-left: 16px;
+                font-size: 20px;
+                font-family: SourceHanSansCN-Medium, SourceHanSansCN;
+                font-weight: 500;
+              }
+      
+              &:last-child {
+                border: none;
+              }
+      
+              &:first-child {
+                width: 94px;
+              }
+            }
+          }
+      
+          .ruleSettingBtn,
+          .editPageBtn {
+            font-size: 14px;
+            font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+            font-weight: 400;
+            color: #525966;
+            padding-right: 16px;
+            cursor: pointer;
+      
+            &::before {
+              position: relative;
+              top: 3px;
+              display: inline-block;
+              content: '';
+              width: 16px;
+              height: 16px;
+              margin-right: 8px;
+              background: url('../../../../../../public/ruleSettingIcon.png');
+              background-size: contain;
+      
+            }
+          }
+      
+          .editPageBtn {
+            &::before {
+              position: relative;
+              top: 3px;
+              display: inline-block;
+              content: '';
+              width: 16px;
+              height: 16px;
+              margin-right: 8px;
+              background: url('../../../../../../public/pageEditIcon.png');
+              background-size: contain;
+      
+            }
+          }
+        }
+      
+        .scoreGradeDetail {
+          width: 100%;
+          margin-top: 26px;
+          border-radius: 2px;
+          overflow: hidden;
+      
+          .scoreGradeDetailList {
+            position: relative;
+            display: flex;
+            width: 100%;
+            height: 100%;
+            flex-direction: row;
+            justify-content: flex-start;
+            align-items: stretch;
+            padding-left: 40px;
+            margin-bottom: 2px;
+      
+            .head {
+              position: absolute;
+              top: 0;
+              left: 0;
+              display: flex;
+              justify-content: center;
+              align-items: center;
+              width: 40px;
+              height: 100%;
+              background: #A3B1CC;
+              font-size: 16px;
+              font-family: SourceHanSansCN-Bold, SourceHanSansCN;
+              font-weight: bold;
+              color: #FFFFFF;
+            }
+      
+            .detail {
+              width: 100%;
+              background: #F5F7FA;
+              padding: 9px 18px;
+      
+              .textLine {
+                font-size: 12px;
+                font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+                font-weight: 400;
+                color: #5C7099;
+                line-height: 14px;
+                margin-bottom: 5px;
+      
+                &:last-child {
+                  margin-bottom: 0;
+                }
+              }
+            }
+      
+            &:last-child {
+              margin-bottom: 0;
+            }
+          }
+        }
+      
+        .articleSetBtn {
+          height: 50px;
+          text-align: center;
+          line-height: 50px;
+          background: #FFFFFF;
+          border-radius: 25px;
+          border: 1px dashed #DADEE6;
+          margin-top: 40px;
+          margin-bottom: 40px;
+      
+          span {
+            font-size: 16px;
+            font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+            font-weight: 400;
+            cursor: pointer;
+            color: @primary-color;
+          }
+        }
+      
+        &.collapse {
+          height:55px;
+          overflow-y: hidden;
+        }
+      }
+}

+ 2 - 199
src/pages/GradeHospitalAccreditation/articleManagement/index.less

@@ -95,11 +95,7 @@ textarea.ant-input {
 
 }
 .cardWrap {
-  // padding-top: 16px;
-  height: calc(100vh - 364px);
-  // border-bottom: 2px solid red;
   overflow-y: scroll;
-  padding-bottom: 16px;
 
   .card {
     padding: 16px;
@@ -116,7 +112,8 @@ textarea.ant-input {
     }
 
     &:last-child {
-      margin-bottom: 0;
+      margin-bottom: 0 !important;
+    
     }
   }
 
@@ -135,201 +132,7 @@ textarea.ant-input {
   background-color: #FFFFFF;
 }
 
-.leafContent {
-  .leafContentTitle {
-    font-size: 16px;
-    font-family: SourceHanSansCN-Bold, SourceHanSansCN;
-    font-weight: bold;
-    color: #292C33;
-    line-height: 24px;
-    overflow: hidden; //超出的文本隐藏
-    text-overflow: ellipsis; //溢出用省略号显示
-    white-space: nowrap; //溢出不换行
-    margin-bottom: 16px;
-  }
-
-  .peopleGroup {
-    display: flex;
-    flex-direction: row;
-    justify-content: flex-start;
-    align-items: center;
-    margin-bottom: 24px;
-
-    span {
-      font-size: 14px;
-      font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-      font-weight: 400;
-      color: #292C33;
-      line-height: 21px;
-
-      &:nth-child(2n) {
-        margin-right: 40px;
-      }
-    }
-  }
-
-  .scoreRow {
-    display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-    height:32px;
-
-    .scoreInfo {
-      display: flex;
-      flex-direction: row;
-      justify-content: flex-start;
-      align-items: center;
-
-      .scoreBlock {
-        display: flex;
-        flex-direction: row;
-        justify-content: center;
-        align-items: center;
-        width: 117px;
-        height: 16px;
-        font-size: 12px;
-        font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-        font-weight: 400;
-        color: #525866;
-        border-right: 1px solid #DADEE6;
-
-        &>span {
-          position: relative;
-          top: -2px;
-          display: inline-block;
-          margin-left: 16px;
-          font-size: 20px;
-          font-family: SourceHanSansCN-Medium, SourceHanSansCN;
-          font-weight: 500;
-        }
-
-        &:last-child {
-          border: none;
-        }
-
-        &:first-child {
-          width: 94px;
-        }
-      }
-    }
-
-    .ruleSettingBtn,
-    .editPageBtn {
-      font-size: 14px;
-      font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-      font-weight: 400;
-      color: #525966;
-      padding-right: 16px;
-      cursor: pointer;
 
-      &::before {
-        position: relative;
-        top: 3px;
-        display: inline-block;
-        content: '';
-        width: 16px;
-        height: 16px;
-        margin-right: 8px;
-        background: url('../../../../public/ruleSettingIcon.png');
-        background-size: contain;
-
-      }
-    }
-
-    .editPageBtn {
-      &::before {
-        position: relative;
-        top: 3px;
-        display: inline-block;
-        content: '';
-        width: 16px;
-        height: 16px;
-        margin-right: 8px;
-        background: url('../../../../public/pageEditIcon.png');
-        background-size: contain;
-
-      }
-    }
-  }
-
-  .scoreGradeDetail {
-    width: 100%;
-    margin-top: 26px;
-    border-radius: 2px;
-    overflow: hidden;
-
-    .scoreGradeDetailList {
-      position: relative;
-      display: flex;
-      width: 100%;
-      height: 100%;
-      flex-direction: row;
-      justify-content: flex-start;
-      align-items: stretch;
-      padding-left: 40px;
-      margin-bottom: 2px;
-
-      .head {
-        position: absolute;
-        top: 0;
-        left: 0;
-        display: flex;
-        justify-content: center;
-        align-items: center;
-        width: 40px;
-        height: 100%;
-        background: #A3B1CC;
-        font-size: 16px;
-        font-family: SourceHanSansCN-Bold, SourceHanSansCN;
-        font-weight: bold;
-        color: #FFFFFF;
-      }
-
-      .detail {
-        width: 100%;
-        background: #F5F7FA;
-        padding: 9px 18px;
-
-        .textLine {
-          font-size: 12px;
-          font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-          font-weight: 400;
-          color: #5C7099;
-          line-height: 14px;
-          margin-bottom: 5px;
-
-          &:last-child {
-            margin-bottom: 0;
-          }
-        }
-      }
-
-      &:last-child {
-        margin-bottom: 0;
-      }
-    }
-  }
-
-  .articleSetBtn {
-    height: 50px;
-    text-align: center;
-    line-height: 50px;
-    background: #FFFFFF;
-    border-radius: 25px;
-    border: 1px dashed #DADEE6;
-    margin-top: 40px;
-    margin-bottom: 40px;
-
-    span {
-      font-size: 16px;
-      font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-      font-weight: 400;
-      cursor: pointer;
-      color: @primary-color;
-    }
-  }
-}
 
 .selfEvolutionTitle {
   text-align: left;

+ 74 - 587
src/pages/GradeHospitalAccreditation/articleManagement/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-14 10:22:09
- * @LastEditTime: 2022-03-04 18:38:25
+ * @LastEditTime: 2022-03-08 18:12:10
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/index.tsx
@@ -14,24 +14,18 @@ import MccsPageContainer from '@/components/MccsPageContainer/index'
 import { useModel } from 'umi';
 import MccsFileTree from '@/components/MccsFileTree/index';
 import MccsTable from '@/components/MccsTable/index';
-// import MccsSelect from '@/components/MccsProFormSelect';
-import MccsDrawerForm from '@/components/MccsDrawerForm/index';
+
 import MccsClickableTabs from '@/components/MccsClickableTabs/index';
 import MccsUpload from '@/components/MccsUpload/index';
 import { MccsModal } from '@/components/MccsModal';
-import type { ProFormInstance, } from '@ant-design/pro-form';
 
-import { getScoreColor } from '@/constant';
-import MccsLightTable from '@/components/MccsLightTable';
 
-import MccsEditableTable from '@/components/MccsEditableTable/index';
-
-import { getCurrentLevelTable, getDepartmentList, getTaizhangDirectoryTable } from './server';
+import { getDepartmentList } from './server';
 
 import { getScoreLevelData } from '@/pages/PlatformMana/generalSetting/serve';
 
 
-import { Form, Table, Space, Row, Col, Button, Input, Switch, Select } from 'antd'
+import { Form, Table, Space, Button, Switch, Select } from 'antd'
 import {
     ProFormText,
     ProFormSelect,
@@ -39,10 +33,9 @@ import {
 } from '@ant-design/pro-form';
 
 import './index.less';
-import MccsSelect from '@/components/MccsProFormSelect';
-
+import ArticleDetail from './components/articleDetailModule';
+import MccsDrawerForm from '@/components/MccsDrawerForm/index';
 
-const { TextArea } = Input;
 const { Option } = Select;
 
 type ArticleManagementProps = {
@@ -57,38 +50,18 @@ type SelectedRowsType = {
     [propsName: string]: any
 }
 
-
-const MccsLightTableColumns = [
-    {
-        key: 'gradeLevel',
-        title: '档次',
-        width: 10
-    },
-    {
-        key: 'directory',
-        title: '名称',
-        width: 60
-    },
-    {
-        key: 'accountType',
-        title: '类型',
-    },
-    {
-        key: 'accountStatus',
-        title: '需要台账',
-        render: (record: any) => {
-            return record.accountStatus == 0 ? '否' : '是'
-        }
-    },
-]
-
-
+export enum ActType {
+    'NOACT',  //不操作
+    'ADD',
+    'EDIT',
+    'DEL'
+};
 
 //条文管理
 const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
     const { columnsFromProps = [], headerConcig, isModeTwo } = props;
     const { articleManagement } = useModel('allModels');
-    const drawerFormRef = useRef<ProFormInstance>();
+
     const {
         isLeaf,
         treeData,
@@ -99,15 +72,17 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
         getDepartmentRequest,
         departmentManagers,
         getDepartment,//获取责任单位
+        currentSelectedActObj,
+        setdetailDrawerVisible,
+        detailDrawerVisible,
         ...restModelData
     } = articleManagement;
     const tableRef = useRef<MccsTable.MccsTableRef>();
 
-    const [articleSettingFormInit, setArticleSettingFormInit] = useState<{}>({});  //条文设置表单回显默认值
+
     const [defaultOpened, setDefaultOpened] = useState<string>();
-    const [scrollAreaH, setScrollAreaH] = useState(100);
-    const leafContentRef = useRef<HTMLDivElement>(null);
     const [departments, setdepartments] = useState<{ label: string; value: string }[]>([]);
+    
 
     const columns = [
 
@@ -142,10 +117,10 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
                             placeholder="请选择单位"
                         >
                             {
-                                departments.map((item,index)=>{
-                                      return (
+                                departments.map((item, index) => {
+                                    return (
                                         <Option value={item.value} key={index}>{item.label}</Option>
-                                      )
+                                    )
                                 })
                             }
                         </Select>
@@ -256,96 +231,17 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
             dataIndex: 'systemEvaluation',
             hideInSearch: true,
         },
-    ]
-
-
-    const mccsEditableTableColumns = [
-        {
-            title: '名称',
-            dataIndex: 'directory',
-            width: '50%',
-            align: 'center',
-            formItemProps: () => {
-                return {
-                    rules: [{ required: true, message: '此项为必填项' }],
-                };
-            },
-        },
-        {
-            title: '档次',
-            dataIndex: 'grade',
-            width: '15%',
-            align: 'center',
-            formItemProps: () => {
-                return {
-                    rules: [{ required: true, message: '此项为必填项' }],
-                };
-            },
-            renderFormItem: (_: any, config: any, form: any) => {
-
-                const { isEditable } = config;
-
-                return isEditable ? (
-                    <Select
-                        mode='multiple'
-                        placeholder='请选择'
-                    >
-                        {
-                            restModelData.gradeOptions.map((item, index) => (
-                                <Option value={item.value} key={index}>{item.label}</Option>
-                            ))
-                        }
-                    </Select>
-
-                ) : <Input />;
-            },
-            render: (_: any, row: any) => {
-                return typeof _ == 'object' ? _.join(',') : _;
-            },
-        },
         {
-            title: '类型',
-            dataIndex: 'accountType',
-            align: 'center',
-            width: '15%',
-            formItemProps: () => {
-                return {
-                    rules: [{ required: true, message: '此项为必填项' }],
-                };
-            },
-            renderFormItem: (_: any, { isEditable }: { isEditable: boolean }, form: any) => {
+            title: '操作',
+            width: 100,
+            valueType: 'option',
+            render: (_: any, record: any) => {
 
-                return isEditable ? (
-                    <Select
-                        placeholder='请选择'
-                    >
-                        {
-                            restModelData.accountTypeOptions.map((item, index) => (
-                                <Option value={item.value} key={index}>{item.label}</Option>
-                            ))
-                        }
-                    </Select>
-                ) : <Input />;
-            },
-
-
-        },
-        {
-            title: '台账上传',
-            align: 'center',
-            dataIndex: 'accountStatus',
-            width: '10%',
-            valueType: 'switch',
-            render: (_: any, row: any) => {
-                return (
-                    <Switch size='small' disabled checked={row.accountStatus} />
-                )
+                return [<a key="1" onClick={() => openDetailInDrawer(record)}>详情</a>]
             },
         },
-
     ]
 
-
     //左侧树搜索回调
     const searchHandle = (val: any) => {
         restModelData.getArticleTreeData(val);
@@ -354,7 +250,8 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
     const onSelectHandle = (data: MccsFileTree.childTree) => {
         //左侧树节点点击回调
         setCurrentActivedTree(data);
-        setArticleSettingFormInit({});//清空默认值
+        restModelData.setCurrentSelectedActObj(data);
+        articleManagement.setArticleSettingFormInit({});//清空默认值
         //重新获取数据
         tableRef?.current?.getTableRef().current?.reload();
     }
@@ -366,20 +263,6 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
         restModelData.setDrawerVisible(true);
     }
 
-    const articleSetBtnHandle = () => {
-        //条文设置
-        // console.log({ articleSettingFormInit });
-        restModelData.setDrawerFormType('ARTICLE_SET');
-        restModelData.setDrawerVisible(true);
-
-    }
-
-    const onVisibleChangeHandle = (visible: boolean) => {
-        //drawer展示控制
-        !visible && setArticleSettingFormInit({});//清空默认值
-        restModelData.setDrawerVisible(visible);
-    }
-
     const onModalVisibleChange = (visible: boolean) => {
         //表单弹窗
         //  console.log('uploadFormInitValue',restModelData.uploadFormInitValue);
@@ -393,119 +276,20 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
 
     }
 
-    const setEditPageStatus = () => {
-        //更改页面的编辑状态
-        restModelData.setEditMode(!restModelData.editMode);
-    }
-
-    const onTextAreaChange = (e: React.ChangeEvent<HTMLTextAreaElement>, level: string) => {
-        //更改执行情况说明数据
-        //首先找出要更新的项,再进行整体替换
-
-        if (restModelData.selectedSelfEvolution) {
-
-            const editTargetLevel = restModelData.selectedSelfEvolution.label;  //目标等级
-            //找出目标等级下正在更新的level
-            const editImplementationDataItemIndex = restModelData.implementationData[editTargetLevel].findIndex(item => item.level == level);
-            //拷贝旧的目标等级数据
-            let _cpOldImplemetationItem = restModelData.implementationData[editTargetLevel];
-            //将新的编辑内容赋值给正在编辑的目标下的level
-            _cpOldImplemetationItem[editImplementationDataItemIndex].note = e.target.value;
-
-            if (editImplementationDataItemIndex != -1) {
-                restModelData.setImplementationData({
-                    ...restModelData.implementationData,
-                    //插入更新
-                    [editTargetLevel]: _cpOldImplemetationItem
-                }
-                )
-            }
-        }
-
+    const openDetailInDrawer = (record: any) => {
+        // restModelData.setRecords(record)
+        setdetailDrawerVisible(true);
+        restModelData.setCurrentSelectedActObj(record);
+        getTableData({ id: record.id});
     }
 
-    enum ActType {
-        'NOACT',  //不操作
-        'ADD',
-        'EDIT',
-        'DEL'
-    };
-
-    const taizhangDataDerectoryEditHandle = (data: any, actType: ActType) => {
-        //台账资料目录编辑回调
-        console.log({ data, actType });
-        const version = restModelData.leafData?.reviewArticle.version;
-        let prevData = restModelData.taizhangDataDirectoryCommitList;
-        const numStr = restModelData.leafData?.reviewArticle.numStr;
-
-        const objectSimpleFilter = (obj: object, keyToDel: string) => {
-            return JSON.parse(JSON.stringify(obj, function (key, value) {
-                if (key == keyToDel) {
-                    return undefined;
-                } else {
-                    return value;
-                }
-            }))
-        }
-
-
-        if (actType == ActType.DEL && (typeof data.id == 'string')) {
-            //如果是删除操作且删除的不是数据库已有数据时,剔除之前暂时保留数据
-            prevData = prevData.filter(item => item.directory != data.directory);
-            restModelData.setTaizhangDataDirectoryCommitList([...prevData]);
-            return;
-        }
-
-        const replaceData = (item: any, index: number) => {
-            prevData[index] = {
-                ...item, dataStatus: actType, version: version ? version : '',
-                grade: data.grade.join(','), numStr: numStr, accountStatus: data.accountStatus ? '1' : '0'
-            };
-            restModelData.setTaizhangDataDirectoryCommitList([...prevData]);
-
-        }
-
-        const findeIndex = prevData.findIndex(item => item.id == data.id);
-
-        if (findeIndex != -1) {
-            //之前已有操作记录的,替换为最新状态
-            replaceData(data, findeIndex);
-            return;
-        }
 
-        // if(findeIndex == -1){
-        //     //不存在id的情况下,有可能编辑的不是服务已有的数据,比较directory
-        //     const findIndexBydirectory = prevData.findIndex(item=>item.directory == data.directory);
-        //     if(findIndexBydirectory != -1){
-        //         replaceData(data,findIndexBydirectory);
-        //         return;
-        //     }
-        // }
-
-        restModelData.setTaizhangDataDirectoryCommitList(
-            [...prevData, {
-                ...data, dataStatus: actType, version: version ? version : '',
-                grade: data.grade.join(','), numStr: numStr, accountStatus: data.accountStatus ? '1' : '0'
-            }]
-        )
-    }
 
     const taizhangImplementationCommit = () => {
         //台账执行情况编辑结果提交
         restModelData.commitTaizhangImplementationHandle();
     }
 
-    const followWindowResize = (num?: number) => {
-        const _num = num ? num : 0;
-
-        if (leafContentRef.current) {
-            const leafContentH = leafContentRef.current.clientHeight + 50;  //加上padding
-            const headerH = 48 + 16;
-            const scoreH = isModeTwo ? (60 + 32) : 0;
-            const h = window.innerHeight - (leafContentH + headerH + scoreH);
-            setScrollAreaH(h - _num);
-        }
-    }
 
     const getDepartments = async () => {
 
@@ -518,9 +302,6 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
     }
 
 
-
-
-
     useEffect(() => {
 
         if (restModelData.reloadRightContent) {
@@ -537,7 +318,8 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
         if (restModelData.leafData) {
             const { responsibilityDepartmentId, responsibilityDepartmentName, responsibilityUserId, targetEvaluation, responsibilityUserName, accountType } = restModelData.leafData.reviewArticle;
             if (responsibilityDepartmentName && responsibilityDepartmentId) {
-                setArticleSettingFormInit({
+
+                articleManagement.setArticleSettingFormInit({
                     responsibilityDepartment: { label: responsibilityDepartmentName, value: responsibilityDepartmentId },
                     responsibilityUser: { label: responsibilityUserName, value: responsibilityUserId },
                     targetScores: { label: targetEvaluation, value: targetEvaluation },
@@ -573,33 +355,6 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
     }, [treeData]);
 
 
-    useEffect(() => {
-        // followWindowResize();
-        if (isLeaf) {
-            setTimeout(() => {
-                //首次加载叶子节点内容触发一次
-                var myEvent = new Event('resize');
-                window.dispatchEvent(myEvent);
-                document.body.style.overflowY = 'hidden';  //叶子节点下锁住页面滚动
-            }, 500);
-            //获取单位列表
-        }
-
-        if (!isLeaf) {
-            document.body.style.overflowY = 'auto';  //非叶子节点放开
-        }
-    }, [isLeaf]);
-
-
-    useEffect(() => {
-        if (restModelData.editMode) {
-            followWindowResize(40);
-        } else {
-            followWindowResize(0);
-        }
-    }, [restModelData.editMode]);
-
-
     useEffect(() => {
         //页面加载完
         //获取左侧输结构
@@ -607,21 +362,25 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
         //获取当前评分
         restModelData.getCurrentHospScore();
 
-        // followWindowResize();
-        window.addEventListener("resize", () => followWindowResize());
-
         getDepartments();
 
-        return () => {
-            window.removeEventListener("resize", () => followWindowResize());
-        }
-
     }, [])
 
 
 
     return (
         <div className='ArticleManagement'>
+
+            <MccsDrawerForm
+                width={1000}
+                visible={detailDrawerVisible}
+                onVisibleChange={(bool: boolean) => setdetailDrawerVisible(bool)}
+                submitter={false}
+            >
+                <ArticleDetail  />
+            </MccsDrawerForm>
+
+
             <MccsPageContainer
                 config={headerConcig ? headerConcig : {
                     content: !isModeTwo && <div style={{ textAlign: 'right', fontSize: 12, color: '#525866' }}>{restModelData.currentHospSelfScoreAndOthers}</div>,
@@ -689,103 +448,6 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
                     )
                 }
 
-                {
-                    //条文设置/表格批量设置drawer弹窗
-                    //restModelData.drawerVisible && 
-                    (
-                        <MccsDrawerForm
-                            title={restModelData.drawerFormType == 'ARTICLE_SET' ? '条文设置' : '批量设置'}
-                            width={500}
-                            formRef={drawerFormRef}
-                            visible={restModelData.drawerVisible}
-                            initialValues={restModelData.drawerFormType == 'ARTICLE_SET' ? { ...articleSettingFormInit } : {}}
-                            onFinish={(values: any) => restModelData.drawerFormType == 'ARTICLE_SET' ? restModelData.setArticle(values) : restModelData.batchSetting(values)}
-                            onVisibleChange={onVisibleChangeHandle}
-                        >
-                            <div className='formItemTitle'>负责人及单位</div>
-                            <Row gutter={16}>
-                                <Col className="gutter-row" span={10}>
-                                    <ProFormSelect
-                                        name="responsibilityDepartment"
-                                        width='sm'
-                                        showSearch
-                                        request={getDepartmentRequest}
-                                        placeholder="选择单位"
-                                        fieldProps={{
-                                            labelInValue: true,
-                                            onChange: (value, option) => {
-                                                //责任单位修改时清空责任人
-                                                drawerFormRef.current?.setFieldsValue({ ...articleSettingFormInit, responsibilityUser: { label: '', value: '' } });
-                                                getDepartment(value, option)
-                                            }
-                                        }}
-                                        rules={[{ required: true, message: '请选择单位!' }]}
-                                    />
-                                </Col>
-
-                                <Col className="gutter-row" span={8}>
-                                    <ProFormDependency name={['responsibilityDepartment']}>
-                                        {({ responsibilityDepartment }) => {
-                                            return (
-                                                <ProFormSelect
-                                                    name="responsibilityUser"
-                                                    width='sm'
-                                                    disabled={!responsibilityDepartment || JSON.stringify(responsibilityDepartment) == '{}'}
-                                                    options={departmentManagers}
-                                                    placeholder="选择负责人"
-                                                    fieldProps={{
-                                                        labelInValue: true,
-                                                        // onChange:(value,option)=>getManagers(value,option)
-                                                    }}
-                                                    rules={[{ required: true, message: '请选择负责人!' }]}
-                                                />
-                                            )
-                                        }}
-                                    </ProFormDependency>
-                                </Col>
-                            </Row>
-                            <div className='formItemTitle'>目标分数</div>
-                            <Row >
-                                <Col span={24}>
-                                    <Form.Item name='targetScores' rules={[
-                                        {
-                                            required: true,
-                                            message: '请选择目标分数!',
-                                        },
-                                    ]}>
-                                        <MccsClickableTabs
-                                            data={restModelData.targetScores}
-                                        />
-                                    </Form.Item>
-                                </Col>
-                            </Row>
-                            {
-                                true && (
-                                    <>
-                                        <div className='formItemTitle'>条文组别</div>
-                                        <Row>
-                                            <Col span={24}>
-                                                <Form.Item name='articleType' rules={[
-                                                    {
-                                                        required: true,
-                                                        message: '请选择条文组别!',
-                                                    },
-                                                ]}>
-                                                    <MccsClickableTabs
-                                                        data={restModelData.ruleTypes}
-                                                    />
-                                                </Form.Item>
-                                            </Col>
-                                        </Row>
-                                    </>
-                                )
-                            }
-
-                        </MccsDrawerForm>
-
-                    )
-                }
-
                 <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', width: '100%' }}>
                     <div style={{ height: '85vh', width: restModelData.editMode ? 0 : '25%', transition: 'width 0.2s ease-in', padding: '16px', backgroundColor: '#fff', marginRight: '16px', boxSizing: 'border-box' }} >
                         {
@@ -810,212 +472,37 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
                         }
                     </div>
                     <div style={{ padding: 0, width: restModelData.editMode ? '100%' : '75%', transition: 'width 0.2s ease-in' }}>
-                        <div className='card'>
-                            {
-                                !isLeaf && (
-                                    <MccsTable
-                                        ref={tableRef}
-                                        columns={columnsFromProps.length > 0 ? columnsFromProps : columns}
-                                        request={getTableData}
-                                        search={{
-                                            span: 6
-                                        }}
-                                        rowSelection={isModeTwo ? false : {
-                                            // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
-                                            // 注释该行则默认不显示下拉选项
-                                            selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
-                                        }}
-                                        rowKey="id"
-                                        tableAlertOptionRender={({ selectedRowKeys, selectedRows, onCleanSelected }: { selectedRowKeys: number[] | string[], selectedRows: SelectedRowsType[], onCleanSelected: () => void }) => {
-                                            return (
-                                                <Space size={16}>
-                                                    <Button type='primary' onClick={() => batchSelfAssessment(selectedRowKeys)}>批量设置</Button>
-                                                    <Button type='ghost' onClick={onCleanSelected}>取消选择</Button>
-                                                </Space>
-                                            );
-                                        }}
-                                    // searchNode={searchNode()}
-                                    />
-                                )
-                            }
 
-                            {
-                                isLeaf && (
-                                    <div className='leafContent' ref={leafContentRef}>
-                                        <div className='leafContentTitle'>{currentActivedTree ? currentActivedTree.title : ''}</div>
-                                        <div className='peopleGroup'>
-                                            <span>条文组别:</span>
-                                            <span>{restModelData.leafData?.reviewArticle?.accountType}</span>
-                                            <span>负责单位:</span>
-                                            <span>{restModelData.leafData?.reviewArticle?.responsibilityDepartmentName}</span>
-                                            <span>负责人:</span>
-                                            <span>{restModelData.leafData?.reviewArticle?.responsibilityUserName}</span>
-                                        </div>
-                                        {/* <MccsScoreBanner list={scoreList} /> */}
-                                        <div className='scoreRow'>
-                                            <div className='scoreInfo'>
-                                                {
-                                                    scoreList.map((item, index) => {
-                                                        return (
-                                                            <div key={index} className='scoreBlock'>
-                                                                {item.label}
-                                                                {item.value && item.value != '-' ? (<span style={{ color: getScoreColor(item.value) }}>{item.value}</span>) : ' -'}
-                                                            </div>
-                                                        )
-                                                    })
-                                                }
-                                            </div>
-                                            {
-                                                //条文页面
-                                                !restModelData.moduleMode && <div className='ruleSettingBtn' onClick={articleSetBtnHandle}>条文设置</div>
-                                            }
-                                            {
-                                                //台账上传页面且非编辑状态下
-                                                (restModelData.moduleMode && !restModelData.editMode && restModelData.hasEditAuthority) && <div className='editPageBtn' onClick={() => setEditPageStatus()}>{restModelData.editMode ? '取消编辑' : '开启编辑'}</div>
-                                            }
-                                        </div>
-                                        <div className='scoreGradeDetail'>
-
-                                            {
-                                                restModelData.leafData?.pfmViewRuleDetailDataVoList.map((item, index) => (
-                                                    <div className='scoreGradeDetailList' key={index}>
-                                                        <div className='head'>{item.evaluation}</div>
-                                                        <div className='detail'>
-                                                            {
-                                                                item.viewRuleAndLevelVos && item.viewRuleAndLevelVos.map((v, k) => (
-                                                                    <div className='textLine' key={k}>{`${v.grade} ${v.detail}`}</div>
-                                                                ))
-                                                            }
-                                                        </div>
-                                                    </div>
-                                                ))
-                                            }
-                                        </div>
-                                    </div>
-                                )
-                            }
-                        </div>
-                        {
-                            isLeaf && isModeTwo && (
-                                <div className='selfEvaluationWrap'>
-                                    <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', width: '100%', }}>
-                                        <div className='selfEvaluation'>
-                                            自评等级
-                                            {!restModelData.editMode && (
-                                                <span style={{ color: getScoreColor(restModelData.leafData ? restModelData.leafData.reviewArticle.selfEvaluation : '') }}>{restModelData.leafData?.reviewArticle.selfEvaluation ? restModelData.leafData?.reviewArticle.selfEvaluation : '-'}</span>
-                                            )}
-                                        </div>
-                                        {
-                                            restModelData.editMode && (
-                                                <div className='wrap' style={{ width: '60%', display: 'flex', flexDirection: 'row', justifyContent: 'flex-end' }}>
-                                                    {
-                                                        (restModelData.targetScores).map((item, index) => (
-                                                            <div className={restModelData.selectedSelfEvolution?.label == item.label ? 'tab on' : 'tab'} key={index} onClick={() => restModelData.onSelfEvolutionTabChange(item)}>{item.label}</div>
-                                                        ))
-                                                    }
-                                                </div>
-                                            )
-                                        }
-                                    </div>
-                                </div>
-                            )
-                        }
 
-                        {
-                            isLeaf && restModelData.leafData && (
-                                //台账上传页面时,背景色统一白色,cardWrap提供容器实现上下滑动
-                                <div className={isModeTwo ? 'cardWrap isModeTwo' : 'cardWrap'} style={{ height: `${scrollAreaH}px`, marginTop: '16px' }}>
-                                    <div>
-                                        {
-                                            //渲染执行情况说明
-                                            /**
-                                             * 满足条件:
-                                             * 1.存在自评等级从接口获取或手动点击选择
-                                             * 2.implementationData里有当前等级的数据
-                                             */
-                                            (restModelData.selectedSelfEvolution && restModelData.implementationData[restModelData.selectedSelfEvolution.label])
-                                            && restModelData.implementationData[restModelData.selectedSelfEvolution.label].map((item, index) => {
-
-                                                return (
-                                                    <div className='card' key={index} style={{ marginBottom: isModeTwo ? 0 : '16px', paddingBottom: isModeTwo ? 0 : '16px', paddingTop: isModeTwo ? 0 : '16px' }}>
-                                                        <div className='cardTitle' style={{ marginBottom: isModeTwo ? '8px' : '16px' }}>{`执行情况说明(等级${item.level})`}</div>
-
-                                                        <TextArea allowClear showCount maxLength={2000}
-                                                            autoSize={{
-                                                                minRows: 5,
-                                                                maxRows: 20
-                                                            }}
-                                                            disabled={!restModelData.editMode} value={item.note}
-                                                            onChange={e => onTextAreaChange(e, item.level)}
-                                                            style={{ marginBottom: 20 }} />
-
-                                                        {
-                                                            !isModeTwo && (
-                                                                <MccsLightTable
-                                                                    columns={MccsLightTableColumns}
-                                                                    request={(current, pageSize) => getCurrentLevelTable({
-                                                                        level: item.level,
-                                                                        numStr: currentActivedTree ? currentActivedTree.code : 'null',
-                                                                        version: restModelData.leafData ? (restModelData.leafData.reviewArticle.version) : 'null',
-                                                                        current,
-                                                                        pageSize
-                                                                    })}
-                                                                />
-                                                            )
-                                                        }
-                                                    </div>
-                                                )
-                                            })
-                                        }
-                                    </div>
-                                    <div style={{ padding: '0 16px' }}>
-                                        {
-                                            //台帐下展示
-                                            (isModeTwo && restModelData.leafData) && (
-                                                <MccsEditableTable
-                                                    bordered={true}
-                                                    controlled={false}
-                                                    edit={restModelData.editMode}
-                                                    reload={!restModelData.editMode}
-                                                    pagination={true}
-                                                    addHandle={
-                                                        (data: any) => taizhangDataDerectoryEditHandle(data, ActType.ADD)
-                                                    }
-                                                    editHandle={
-                                                        (data: any) => taizhangDataDerectoryEditHandle(data, ActType.EDIT)
-                                                    }
-                                                    delHandle={
-                                                        (data: any) => taizhangDataDerectoryEditHandle(data, ActType.DEL)
-                                                    }
-                                                    request={async (current, pageSize) => {
-
-                                                        if (restModelData.leafData) {
-
-                                                            const { numStr, version } = restModelData.leafData.reviewArticle;
-                                                            const resp = await getTaizhangDirectoryTable({ numStr, version, current, pageSize });
-                                                            const { list = [] } = resp;
-                                                            return {
-                                                                data: list.map(item => ({ ...item, grade: item.grade ? item.grade.split(',') : [], accountStatus: item.accountStatus == '0' ? false : true })), //多选下拉需传数组值
-                                                                total: resp.totalCount,
-                                                                current: resp.current,
-                                                                success: true
-                                                            };
-                                                        }
-                                                        return {
-                                                            data: [],
-                                                            total: 0,
-                                                            success: false
-                                                        }
-                                                    }}
-                                                    columns={mccsEditableTableColumns}
-                                                />
-                                            )
-                                        }
-                                    </div>
-                                </div>
-                            )
-                        }
+                        <div className='card' style={{ display: currentActivedTree?.isLeaf ? 'none' : 'block' }}>
+                            <MccsTable
+                                ref={tableRef}
+                                columns={columnsFromProps.length > 0 ? columnsFromProps : columns}
+                                request={getTableData}
+                                search={{
+                                    span: 6
+                                }}
+                                rowSelection={isModeTwo ? false : {
+                                    // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
+                                    // 注释该行则默认不显示下拉选项
+                                    selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
+                                }}
+                                rowKey="id"
+                                tableAlertOptionRender={({ selectedRowKeys, selectedRows, onCleanSelected }: { selectedRowKeys: number[] | string[], selectedRows: SelectedRowsType[], onCleanSelected: () => void }) => {
+                                    return (
+                                        <Space size={16}>
+                                            <Button type='primary' onClick={() => batchSelfAssessment(selectedRowKeys)}>批量设置</Button>
+                                            <Button type='ghost' onClick={onCleanSelected}>取消选择</Button>
+                                        </Space>
+                                    );
+                                }}
+                            // searchNode={searchNode()}
+                            />
+                        </div>
 
+                        <div style={{ display: currentActivedTree?.isLeaf ? 'block' : 'none' }}>
+                            <ArticleDetail isModeTwo={isModeTwo} />
+                        </div>
                     </div>
                 </div>
             </MccsPageContainer>

+ 41 - 53
src/pages/GradeHospitalAccreditation/articleManagement/model.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-14 10:46:45
- * @LastEditTime: 2022-01-05 14:02:15
+ * @LastEditTime: 2022-03-08 18:27:10
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/model.ts
@@ -16,7 +16,6 @@ import {
   getSelfEvaluation,
   uploadFilePost,
   selfEvolutionCommit,
-  delHistoryRecods,
   getUploadLedgerSelectableType,
   getCurrentHospSelfScore,
   getRuleChildrens,
@@ -44,7 +43,6 @@ export type ImplementationDataItemCache = Record<string, ImplementationDataItem[
 // articleManagement
 const articleManagement = () => {
   const [treeData, setTreeData] = useState<any[]>([]);
-  // const [tableData, setTableData] = useState([]);
   const [currentActivedTree, setCurrentActivedTree] = useState<MccsFileTree.childTree>();
   const [isLeaf, setIsLeaf] = useState(false);
   const [scoreList, setScoreList] = useState<{ label: string; value: string }[]>([]);
@@ -52,14 +50,20 @@ const articleManagement = () => {
   const [departmentManagers, setDepartmentManagers] = useState<{ label: string; value: number }[]>(
     [],
   );
-  const [selectedDepartment, setSelectedDepartment] = useState<any>();
+  
   const [targetScores, setTargetScores] = useState<MccsClickableTabs.TabType[]>([]);
   const [ruleTypes, setRuleTypes] = useState<MccsClickableTabs.TabType[]>([]);
-  const [records, setRecords] = useState<MccsRecordList.MccsRecordListType>([]);
+  
   const [selfEvaluationRecords, setSelfEvaluationRecords] = useState<MccsRecordList.MccsRecordListType>([]); // 自评记录
   const [selectedRowKeys, setSelectedRowKeys] = useState<number[] | string[]>([]);
 
   const [drawerVisible, setDrawerVisible] = useState(false);
+
+  /**
+   * ARTICLE_SET 条文设置
+   * BATCHSETTING 批量设置
+   */
+  
   const [drawerFormType, setDrawerFormType] = useState<'ARTICLE_SET' | 'BATCHSETTING'>(
     'ARTICLE_SET',
   );
@@ -95,6 +99,13 @@ const articleManagement = () => {
 
   const [gradeOptions, setGradeOptions] = useState<{ label: string, value: string | number }[]>([]);
   const [accountTypeOptions, setAccountTypeOptions] = useState<{ label: string, value: string | number }[]>([]);
+  const [articleSettingFormInit, setArticleSettingFormInit] = useState<{}>({});  //条文设置表单回显默认值
+
+  const [currentSelectedActObj,setCurrentSelectedActObj] = useState<any>(undefined);  //当前正在操作的对象,例如当前选中的树中层级数据,点击详情的的行数据
+
+  const [detailDrawerVisible, setdetailDrawerVisible] = useState(false);   //条文详情抽屉
+
+
 
 
   const getArticleTreeData = async (keyword?: string | number) => {
@@ -105,8 +116,6 @@ const articleManagement = () => {
 
   const getTableData = async (params?: any, sorter?: any, filter?: any) => {
     // 根据选中树结构的id获取对应的详情
-    // console.log({params});
-
     let specifyId: number | null = null;
 
     if (params && params.id) {
@@ -134,7 +143,7 @@ const articleManagement = () => {
 
       if (resp) {
         const { page, leafData, isLeaf } = resp;
-        // console.log({page, leafData, isLeaf});
+        setIsLeaf(isLeaf);
         if (!isLeaf && page) {
           // 非叶子结点返回table数据
           const { list = [], totalCount } = page;
@@ -210,7 +219,10 @@ const articleManagement = () => {
 
     if (resp) {
       // 重新刷新表格
-      setReloadRightContent(true);
+      if(!detailDrawerVisible){
+        //当条文详情抽屉存在时,暂不刷新table,交给抽屉关闭时判断刷新
+        setReloadRightContent(true);
+      }
       return true;
     }
   };
@@ -235,7 +247,10 @@ const articleManagement = () => {
       const resp = await settingArticle(paramsData);
       if (resp) {
         // 更新界面信息
-        getTableData();
+        if(!detailDrawerVisible){
+          //当条文详情抽屉存在时,暂不刷新table,交给抽屉关闭时判断刷新
+          getTableData();
+        }
         return true;
       }
     }
@@ -243,8 +258,6 @@ const articleManagement = () => {
 
   const getDepartment = async (item: any, option: any) => {
     // 获取责任单位
-    setSelectedDepartment(option);
-
     const resp = await getDepartmentList({ responsibilityDepartmentId: item.value });
     if (resp) {
       const { list = [] } = resp;
@@ -391,10 +404,11 @@ const articleManagement = () => {
     level: string;
   }) => {
     // 或区指定等级的执行情况说明数据,同时根据返回的数据自行添加需要补充的项
-
+    console.log('getTaizhangImplementation');
     if (implementationData[level]) return; // implementationData集合里已经有了该等级对应的数据时,不请求,为了保证编辑的数据缓存
 
     const data = await getTaizhangImplementation({ numStr, version, level });
+   
     const implementData: ImplementationDataItem[] = data.map((item) => ({
       level: item.level,
       note: item.note,
@@ -446,13 +460,7 @@ const articleManagement = () => {
     }
   };
 
-  const delHistoryRecordHandle = async (historyRecords: MccsRecordList.historyRecordsItem) => {
-    // 删除台账记录
-    const resp = await delHistoryRecods(historyRecords.id);
-    if (resp) {
-      getTableData();
-    }
-  };
+
 
   const getScoreList = async () => {
     // 条文评级
@@ -468,6 +476,7 @@ const articleManagement = () => {
   const accreditationGroupType = async () => {
     // 获取条文组别
     const data = await getAccreditationTypeData();
+    console.log({data});
     const tempArr = data.map((t: any) => ({ label: t.categoryType, value: t.categoryType }));
     return Promise.resolve(tempArr);
   };
@@ -563,27 +572,6 @@ const getAccoutTypeOptions = async () => {
     }
 }
 
-  useEffect(() => {
-    if (currentActivedTree) {
-      const { isLeaf } = currentActivedTree;
-      setIsLeaf(isLeaf);
-      getTableData();
-      if (isLeaf) {
-        getScoreList().then((data) => {
-          const dataFilted = data.filter((t: any) => t.configStatus != 0); // 去掉不启动
-          // console.log({data,dataFilted});
-          setTargetScores(dataFilted);
-        });
-        accreditationGroupType().then((data) => {
-          setRuleTypes(data);
-        });
-      }
-
-      // 每次切换树结构,清空台账上传的缓存数据
-      setImplementationData({}); // 清空执行情况说明
-      setTaizhangDataDirectoryCommitList([]); // 清空台账上传资料目录
-    }
-  }, [currentActivedTree]);
 
   useEffect(() => {
     // 叶子结点数据变化后相关回调
@@ -600,10 +588,6 @@ const getAccoutTypeOptions = async () => {
           label: '自评',
           value: selfEvaluation || '-',
         },
-        // {
-        //   label: '现场查核',
-        //   value: siteEvaluation?siteEvaluation:'-',
-        // },
         {
           label: '系统评分',
           value: systemEvaluation || '-',
@@ -612,9 +596,6 @@ const getAccoutTypeOptions = async () => {
       /**
        * 默认加载页面时执行获取执行情况说明数据
        */
-
-
-
       const t = localStorage.getItem('userData') ? localStorage.getItem('userData') : '';
       const userData = JSON.parse(t as string);
 
@@ -626,23 +607,25 @@ const getAccoutTypeOptions = async () => {
       setSelectedSelfEvolution({ label: selfEvolution, value: selfEvolution });
       setScoreList(tempScoreList);
       getSelectableSelfScoreList();
-      // setRecords(tempRecords);
     }
   }, [leafData]);
 
   useEffect(() => {
     // 当抽屉类型改变时
-    if (drawerFormType == 'BATCHSETTING') {
+    if (drawerFormType == 'BATCHSETTING'||drawerFormType == 'ARTICLE_SET') {
       getScoreList().then((data) => {
         const dataFilted = data.filter((t: any) => t.configStatus != 0); // 去掉不启动
         setTargetScores(dataFilted);
       });
+
+      
       accreditationGroupType().then((data) => {
         setRuleTypes(data);
       });
     }
   }, [drawerFormType]);
 
+
   useEffect(() => {
     // 左侧树结构只看我的开关切换时,重新获取树结构数据
     getArticleTreeData();
@@ -689,7 +672,6 @@ const getAccoutTypeOptions = async () => {
     currentActivedTree,
     setCurrentActivedTree,
     scoreList, // 评分
-    records, // 台账记录
     getDepartmentRequest,
     departmentManagers,
     getDepartment,
@@ -717,7 +699,7 @@ const getAccoutTypeOptions = async () => {
     commitSelfEvolution,
     selectedSelfEvolution,
     getSelfEvaluationRecordList,
-    delHistoryRecordHandle,
+
     getUploadLedgerType,
     uploadLedgerTypeList,
     setUploadLedgerTypeList,
@@ -726,6 +708,7 @@ const getAccoutTypeOptions = async () => {
     getSelectableRuleChilds,
     editMode,
     setEditMode,
+
     implementationData,
     setImplementationData,
     commitTaizhangImplementationHandle,
@@ -738,7 +721,12 @@ const getAccoutTypeOptions = async () => {
     gradeOptions,
     accountTypeOptions,
     getGradeOptions,
-    getAccoutTypeOptions
+    getAccoutTypeOptions,
+    articleSettingFormInit, setArticleSettingFormInit,
+    setCurrentSelectedActObj,
+    currentSelectedActObj,
+    detailDrawerVisible,
+    setdetailDrawerVisible,
   };
 };
 

+ 2 - 1
src/pages/GradeHospitalAccreditation/articleManagement/server.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-14 10:22:20
- * @LastEditTime: 2022-01-05 09:23:19
+ * @LastEditTime: 2022-03-08 18:29:06
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/server.ts
@@ -182,6 +182,7 @@ export const getTaizhangImplementation = async (params: {
    version: string,
    level: string,// 等级
 }) => {
+
    return request<API.TaizhangImplementationItem[]>('/api/pfmimplementation/getImplementationByLevel', {
      method: 'GET',
      params,

+ 2 - 4
src/pages/GradeHospitalAccreditation/ledgerUpload/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-14 10:22:09
- * @LastEditTime: 2022-01-05 14:18:54
+ * @LastEditTime: 2022-03-07 13:58:03
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/index.tsx
@@ -160,7 +160,6 @@ const LedgerUpload: React.FC<LedgerUploadPropsType> = (props) => {
 
 
     const openDrawerHandle = (record: any) => {
-        // console.log({record});
         restLedgerUploadModelData.setCurrentRecord(record)
         restLedgerUploadModelData.setDrawerVisible(true);
         restArticleManagementModelData.getTableData({ id: record.id });
@@ -225,7 +224,7 @@ const LedgerUpload: React.FC<LedgerUploadPropsType> = (props) => {
         if(!drawerVisible){
             restArticleManagementModelData.setEditMode(false);
         }
-      },[restLedgerUploadModelData.drawerVisible]);
+    },[restLedgerUploadModelData.drawerVisible]);
 
     useEffect(() => {
         // 监听上传台账弹窗变化,更新本地drawer里台账记录
@@ -244,7 +243,6 @@ const LedgerUpload: React.FC<LedgerUploadPropsType> = (props) => {
                 isModeTwo={true}
             />
 
-
             <MccsDrawerForm
                 title={restLedgerUploadModelData.currentRecord?.name}
                 visible={restLedgerUploadModelData.drawerVisible}

+ 1 - 3
src/pages/GradeHospitalAccreditation/ledgerUpload/model.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-14 10:46:45
- * @LastEditTime: 2021-12-31 11:33:37
+ * @LastEditTime: 2022-03-07 10:17:07
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/model.ts
@@ -136,8 +136,6 @@ const ledgerUpload = () => {
         systemEvaluation,
         targetEvaluation,
         selfEvaluation,
-        siteEvaluation,
-        // records = [],
       } = currentLeafData.reviewArticle;
       const tempScoreList = [
         {