|
@@ -1,13 +1,14 @@
|
|
|
/*
|
|
|
* @Author: your name
|
|
|
* @Date: 2021-09-14 10:22:09
|
|
|
- * @LastEditTime: 2022-01-05 14:29:28
|
|
|
+ * @LastEditTime: 2022-03-04 18:23:33
|
|
|
* @LastEditors: Please set LastEditors
|
|
|
* @Description: In User Settings Edit
|
|
|
* @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/index.tsx
|
|
|
*/
|
|
|
|
|
|
|
|
|
+
|
|
|
import React, { useRef, useEffect, useState } from 'react'
|
|
|
import MccsPageContainer from '@/components/MccsPageContainer/index'
|
|
|
// import MccsProCard from '@/components/MccsProCard/index';
|
|
@@ -26,7 +27,7 @@ import MccsLightTable from '@/components/MccsLightTable';
|
|
|
|
|
|
import MccsEditableTable from '@/components/MccsEditableTable/index';
|
|
|
|
|
|
-import { getCurrentLevelTable, getTaizhangDirectoryTable } from './server';
|
|
|
+import { getCurrentLevelTable, getDepartmentList, getTaizhangDirectoryTable } from './server';
|
|
|
|
|
|
import { getScoreLevelData } from '@/pages/PlatformMana/generalSetting/serve';
|
|
|
|
|
@@ -39,6 +40,7 @@ import {
|
|
|
} from '@ant-design/pro-form';
|
|
|
|
|
|
import './index.less';
|
|
|
+import MccsSelect from '@/components/MccsProFormSelect';
|
|
|
|
|
|
|
|
|
const { TextArea } = Input;
|
|
@@ -57,143 +59,6 @@ type SelectedRowsType = {
|
|
|
}
|
|
|
|
|
|
|
|
|
-const columns = [
|
|
|
-
|
|
|
- {
|
|
|
- key: 'keyword',
|
|
|
- hideInTable: true,
|
|
|
- renderFormItem: (item: any, { type }: any, form: any) => {
|
|
|
-
|
|
|
- if (type === 'form') {
|
|
|
- return null;
|
|
|
- }
|
|
|
- return (
|
|
|
- <Form.Item name='keyword'>
|
|
|
- <ProFormText placeholder='条文/条款' />
|
|
|
- </Form.Item>
|
|
|
- )
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- key: 'department',
|
|
|
- hideInTable: true,
|
|
|
- renderFormItem: (item: any, { type }: any, form: any) => {
|
|
|
-
|
|
|
- if (type === 'form') {
|
|
|
- return null;
|
|
|
- }
|
|
|
- return (
|
|
|
- <Form.Item name='department'>
|
|
|
- <ProFormText placeholder='单位' />
|
|
|
- </Form.Item>
|
|
|
- )
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- key: 'name',
|
|
|
- hideInTable: true,
|
|
|
- renderFormItem: (item: any, { type }: any, form: any) => {
|
|
|
-
|
|
|
- if (type === 'form') {
|
|
|
- return null;
|
|
|
- }
|
|
|
- return (
|
|
|
- <Form.Item name='name'>
|
|
|
- <ProFormText placeholder='负责人' />
|
|
|
- </Form.Item>
|
|
|
- )
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- key: 'selfEvaluation',
|
|
|
- hideInTable: true,
|
|
|
- renderFormItem: (item: any, { type }: any, form: any) => {
|
|
|
-
|
|
|
- if (type === 'form') {
|
|
|
- return null;
|
|
|
- }
|
|
|
- return (
|
|
|
- <ProFormSelect
|
|
|
- name="selfEvaluation"
|
|
|
- request={async () => {
|
|
|
- const data = await getScoreLevelData();
|
|
|
- if (!data) return [];
|
|
|
- return data.map(item => ({ label: item.levelNumber, value: item.levelNumber }))
|
|
|
- }}
|
|
|
- placeholder="选择自评"
|
|
|
- rules={[{ required: false }]}
|
|
|
- />
|
|
|
- )
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- key: 'targetEvaluation',
|
|
|
- hideInTable: true,
|
|
|
- renderFormItem: (item: any, { type }: any, form: any) => {
|
|
|
-
|
|
|
- if (type === 'form') {
|
|
|
- return null;
|
|
|
- }
|
|
|
- return (
|
|
|
- <ProFormSelect
|
|
|
- name="targetEvaluation"
|
|
|
- request={async () => {
|
|
|
- const data = await getScoreLevelData();
|
|
|
- if (!data) return [];
|
|
|
- return data.map(item => ({ label: item.levelNumber, value: item.levelNumber }))
|
|
|
- }}
|
|
|
- placeholder="选择目标"
|
|
|
- rules={[{ required: false }]}
|
|
|
- />
|
|
|
- )
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- title: '条款',
|
|
|
- key: 'numStr',
|
|
|
- dataIndex: 'numStr',
|
|
|
- hideInSearch: true,
|
|
|
-
|
|
|
- },
|
|
|
- {
|
|
|
- title: '条文',
|
|
|
- dataIndex: 'name',
|
|
|
- hideInSearch: true,
|
|
|
- width: '35%',
|
|
|
- ellipsis: true
|
|
|
- },
|
|
|
- {
|
|
|
- title: '负责单位',
|
|
|
- dataIndex: 'responsibilityDepartmentName',
|
|
|
- hideInSearch: true,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '负责人',
|
|
|
- dataIndex: 'responsibilityUserName',
|
|
|
- hideInSearch: true,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '自评',
|
|
|
- hideInSearch: true,
|
|
|
- dataIndex: 'selfEvaluation',
|
|
|
- },
|
|
|
- // {
|
|
|
- // title: '现场查核',
|
|
|
- // hideInSearch: true,
|
|
|
- // dataIndex: 'siteEvaluation',
|
|
|
- // },
|
|
|
- {
|
|
|
- title: '目标',
|
|
|
- dataIndex: 'targetEvaluation',
|
|
|
- hideInSearch: true,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '系统评分',
|
|
|
- dataIndex: 'systemEvaluation',
|
|
|
- hideInSearch: true,
|
|
|
- },
|
|
|
-]
|
|
|
-
|
|
|
const MccsLightTableColumns = [
|
|
|
{
|
|
|
key: 'gradeLevel',
|
|
@@ -241,9 +106,159 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
|
|
|
const [articleSettingFormInit, setArticleSettingFormInit] = useState<{}>({}); //条文设置表单回显默认值
|
|
|
const [defaultOpened, setDefaultOpened] = useState<string>();
|
|
|
- const [scrollAreaH,setScrollAreaH] = useState(100);
|
|
|
+ const [scrollAreaH, setScrollAreaH] = useState(100);
|
|
|
const leafContentRef = useRef<HTMLDivElement>(null);
|
|
|
-
|
|
|
+ const [departments, setdepartments] = useState<{ label: string; value: string }[]>([]);
|
|
|
+
|
|
|
+ const columns = [
|
|
|
+
|
|
|
+ {
|
|
|
+ key: 'keyword',
|
|
|
+ hideInTable: true,
|
|
|
+ renderFormItem: (item: any, { type }: any, form: any) => {
|
|
|
+
|
|
|
+ if (type === 'form') {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return (
|
|
|
+ <Form.Item name='keyword'>
|
|
|
+ <ProFormText placeholder='条文/条款' />
|
|
|
+ </Form.Item>
|
|
|
+ )
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'department',
|
|
|
+ hideInTable: true,
|
|
|
+ renderFormItem: (item: any, { type }: any, form: any) => {
|
|
|
+
|
|
|
+ if (type === 'form') {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ return (
|
|
|
+ <Form.Item name='department'>
|
|
|
+ <Select
|
|
|
+ showSearch
|
|
|
+ placeholder="请选择单位"
|
|
|
+ >
|
|
|
+ {
|
|
|
+ departments.map((item,index)=>{
|
|
|
+ return (
|
|
|
+ <Option value={item.value} key={index}>{item.label}</Option>
|
|
|
+ )
|
|
|
+ })
|
|
|
+ }
|
|
|
+ </Select>
|
|
|
+ </Form.Item>
|
|
|
+ )
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'name',
|
|
|
+ hideInTable: true,
|
|
|
+ renderFormItem: (item: any, { type }: any, form: any) => {
|
|
|
+
|
|
|
+ if (type === 'form') {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return (
|
|
|
+ <Form.Item name='name'>
|
|
|
+ <ProFormText placeholder='负责人' />
|
|
|
+ </Form.Item>
|
|
|
+ )
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'selfEvaluation',
|
|
|
+ hideInTable: true,
|
|
|
+ renderFormItem: (item: any, { type }: any, form: any) => {
|
|
|
+
|
|
|
+ if (type === 'form') {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return (
|
|
|
+ <ProFormSelect
|
|
|
+ name="selfEvaluation"
|
|
|
+ request={async () => {
|
|
|
+ const data = await getScoreLevelData();
|
|
|
+ if (!data) return [];
|
|
|
+ return data.map(item => ({ label: item.levelNumber, value: item.levelNumber }))
|
|
|
+ }}
|
|
|
+ placeholder="选择自评"
|
|
|
+ rules={[{ required: false }]}
|
|
|
+ />
|
|
|
+ )
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'targetEvaluation',
|
|
|
+ hideInTable: true,
|
|
|
+ renderFormItem: (item: any, { type }: any, form: any) => {
|
|
|
+
|
|
|
+ if (type === 'form') {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return (
|
|
|
+ <ProFormSelect
|
|
|
+ name="targetEvaluation"
|
|
|
+ request={async () => {
|
|
|
+ const data = await getScoreLevelData();
|
|
|
+ if (!data) return [];
|
|
|
+ return data.map(item => ({ label: item.levelNumber, value: item.levelNumber }))
|
|
|
+ }}
|
|
|
+ placeholder="选择目标"
|
|
|
+ rules={[{ required: false }]}
|
|
|
+ />
|
|
|
+ )
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '条款',
|
|
|
+ key: 'numStr',
|
|
|
+ dataIndex: 'numStr',
|
|
|
+ hideInSearch: true,
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '条文',
|
|
|
+ dataIndex: 'name',
|
|
|
+ hideInSearch: true,
|
|
|
+ width: '35%',
|
|
|
+ ellipsis: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '负责单位',
|
|
|
+ dataIndex: 'responsibilityDepartmentName',
|
|
|
+ hideInSearch: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '负责人',
|
|
|
+ dataIndex: 'responsibilityUserName',
|
|
|
+ hideInSearch: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '自评',
|
|
|
+ hideInSearch: true,
|
|
|
+ dataIndex: 'selfEvaluation',
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // title: '现场查核',
|
|
|
+ // hideInSearch: true,
|
|
|
+ // dataIndex: 'siteEvaluation',
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ title: '目标',
|
|
|
+ dataIndex: 'targetEvaluation',
|
|
|
+ hideInSearch: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '系统评分',
|
|
|
+ dataIndex: 'systemEvaluation',
|
|
|
+ hideInSearch: true,
|
|
|
+ },
|
|
|
+ ]
|
|
|
+
|
|
|
|
|
|
const mccsEditableTableColumns = [
|
|
|
{
|
|
@@ -277,13 +292,13 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
placeholder='请选择'
|
|
|
>
|
|
|
{
|
|
|
- restModelData.gradeOptions.map((item,index)=>(
|
|
|
+ restModelData.gradeOptions.map((item, index) => (
|
|
|
<Option value={item.value} key={index}>{item.label}</Option>
|
|
|
))
|
|
|
}
|
|
|
</Select>
|
|
|
-
|
|
|
- ): <Input />;
|
|
|
+
|
|
|
+ ) : <Input />;
|
|
|
},
|
|
|
render: (_: any, row: any) => {
|
|
|
return typeof _ == 'object' ? _.join(',') : _;
|
|
@@ -303,10 +318,10 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
|
|
|
return isEditable ? (
|
|
|
<Select
|
|
|
- placeholder='请选择'
|
|
|
+ placeholder='请选择'
|
|
|
>
|
|
|
{
|
|
|
- restModelData.accountTypeOptions.map((item,index)=>(
|
|
|
+ restModelData.accountTypeOptions.map((item, index) => (
|
|
|
<Option value={item.value} key={index}>{item.label}</Option>
|
|
|
))
|
|
|
}
|
|
@@ -374,32 +389,6 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
|
|
|
}
|
|
|
|
|
|
- // const upLoadFileHandle = (formInitData?: any) => {
|
|
|
- // //因为modalForm开启了request+params获取表单默认值,
|
|
|
- // //所以必须先设置默认值才能开启弹窗
|
|
|
- // if (formInitData) {
|
|
|
- // const { fileUrl, recordTypeName, accountType, fileName, cateId } = formInitData;
|
|
|
- // console.log({ formInitData });
|
|
|
- // restModelData.setUploadFormInitValue({
|
|
|
- // tab: { label: accountType, value: { label: recordTypeName, value: cateId } },
|
|
|
- // files: [{
|
|
|
- // uid: new Date().getTime(),
|
|
|
- // name: fileName,
|
|
|
- // status: 'done',
|
|
|
- // url: fileUrl
|
|
|
- // }]
|
|
|
- // });
|
|
|
- // } else {
|
|
|
- // restModelData.setUploadFormInitValue({})
|
|
|
- // }
|
|
|
- // restModelData.getUploadLedgerType().then(data => {
|
|
|
- // //设置上传台账类型
|
|
|
- // restModelData.setUploadLedgerTypeList(data);
|
|
|
-
|
|
|
- // })
|
|
|
- // restModelData.setModalVisible(true);
|
|
|
- // }
|
|
|
-
|
|
|
const uploadLedgerChangeHandle = (tabData: any) => {
|
|
|
//台账上传类型选择回调
|
|
|
|
|
@@ -445,7 +434,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
|
|
|
const taizhangDataDerectoryEditHandle = (data: any, actType: ActType) => {
|
|
|
//台账资料目录编辑回调
|
|
|
- console.log({data,actType});
|
|
|
+ console.log({ data, actType });
|
|
|
const version = restModelData.leafData?.reviewArticle.version;
|
|
|
let prevData = restModelData.taizhangDataDirectoryCommitList;
|
|
|
const numStr = restModelData.leafData?.reviewArticle.numStr;
|
|
@@ -467,24 +456,24 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
restModelData.setTaizhangDataDirectoryCommitList([...prevData]);
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
- const replaceData = (item:any,index:number)=>{
|
|
|
+
|
|
|
+ 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'
|
|
|
+ ...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){
|
|
|
+ const findeIndex = prevData.findIndex(item => item.id == data.id);
|
|
|
+
|
|
|
+ if (findeIndex != -1) {
|
|
|
//之前已有操作记录的,替换为最新状态
|
|
|
- replaceData(data,findeIndex);
|
|
|
+ replaceData(data, findeIndex);
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// if(findeIndex == -1){
|
|
|
// //不存在id的情况下,有可能编辑的不是服务已有的数据,比较directory
|
|
|
// const findIndexBydirectory = prevData.findIndex(item=>item.directory == data.directory);
|
|
@@ -497,7 +486,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
restModelData.setTaizhangDataDirectoryCommitList(
|
|
|
[...prevData, {
|
|
|
...data, dataStatus: actType, version: version ? version : '',
|
|
|
- grade: data.grade.join(','), numStr: numStr, accountStatus: data.accountStatus?'1':'0'
|
|
|
+ grade: data.grade.join(','), numStr: numStr, accountStatus: data.accountStatus ? '1' : '0'
|
|
|
}]
|
|
|
)
|
|
|
}
|
|
@@ -507,19 +496,29 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
restModelData.commitTaizhangImplementationHandle();
|
|
|
}
|
|
|
|
|
|
- const followWindowResize = (num?:number)=>{
|
|
|
- const _num = num?num:0;
|
|
|
+ const followWindowResize = (num?: number) => {
|
|
|
+ const _num = num ? num : 0;
|
|
|
|
|
|
- if(leafContentRef.current){
|
|
|
+ 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 scoreH = isModeTwo ? (60 + 32) : 0;
|
|
|
+ const h = window.innerHeight - (leafContentH + headerH + scoreH);
|
|
|
+ setScrollAreaH(h - _num);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ const getDepartments = async () => {
|
|
|
+
|
|
|
+ const resp = await getDepartmentList();
|
|
|
+
|
|
|
+ if (resp) {
|
|
|
+ const { list = [] } = resp;
|
|
|
+ setdepartments(list.map(t => ({ label: t.name, value: t.name })));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -575,30 +574,31 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
}, [treeData]);
|
|
|
|
|
|
|
|
|
- useEffect(()=>{
|
|
|
+ useEffect(() => {
|
|
|
// followWindowResize();
|
|
|
- if(isLeaf){
|
|
|
- setTimeout(()=>{
|
|
|
+ if (isLeaf) {
|
|
|
+ setTimeout(() => {
|
|
|
//首次加载叶子节点内容触发一次
|
|
|
var myEvent = new Event('resize');
|
|
|
- window.dispatchEvent(myEvent);
|
|
|
+ window.dispatchEvent(myEvent);
|
|
|
document.body.style.overflowY = 'hidden'; //叶子节点下锁住页面滚动
|
|
|
- },500);
|
|
|
+ }, 500);
|
|
|
+ //获取单位列表
|
|
|
}
|
|
|
-
|
|
|
- if(!isLeaf){
|
|
|
+
|
|
|
+ if (!isLeaf) {
|
|
|
document.body.style.overflowY = 'auto'; //非叶子节点放开
|
|
|
}
|
|
|
- },[isLeaf]);
|
|
|
+ }, [isLeaf]);
|
|
|
|
|
|
|
|
|
- useEffect(()=>{
|
|
|
- if(restModelData.editMode){
|
|
|
+ useEffect(() => {
|
|
|
+ if (restModelData.editMode) {
|
|
|
followWindowResize(40);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
followWindowResize(0);
|
|
|
- }
|
|
|
- },[restModelData.editMode]);
|
|
|
+ }
|
|
|
+ }, [restModelData.editMode]);
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
@@ -607,14 +607,16 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
restModelData.getArticleTreeData();
|
|
|
//获取当前评分
|
|
|
restModelData.getCurrentHospScore();
|
|
|
-
|
|
|
+
|
|
|
// followWindowResize();
|
|
|
- window.addEventListener("resize",()=>followWindowResize());
|
|
|
+ window.addEventListener("resize", () => followWindowResize());
|
|
|
|
|
|
- return ()=>{
|
|
|
- window.removeEventListener("resize",()=>followWindowResize());
|
|
|
+ getDepartments();
|
|
|
+
|
|
|
+ return () => {
|
|
|
+ window.removeEventListener("resize", () => followWindowResize());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}, [])
|
|
|
|
|
|
|
|
@@ -923,7 +925,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
{
|
|
|
isLeaf && restModelData.leafData && (
|
|
|
//台账上传页面时,背景色统一白色,cardWrap提供容器实现上下滑动
|
|
|
- <div className={isModeTwo ? 'cardWrap isModeTwo' : 'cardWrap'} style={{height:`${scrollAreaH}px`,marginTop:'16px'}}>
|
|
|
+ <div className={isModeTwo ? 'cardWrap isModeTwo' : 'cardWrap'} style={{ height: `${scrollAreaH}px`, marginTop: '16px' }}>
|
|
|
<div>
|
|
|
{
|
|
|
//渲染执行情况说明
|
|
@@ -987,7 +989,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
(data: any) => taizhangDataDerectoryEditHandle(data, ActType.DEL)
|
|
|
}
|
|
|
request={async (current, pageSize) => {
|
|
|
-
|
|
|
+
|
|
|
if (restModelData.leafData) {
|
|
|
|
|
|
const { numStr, version } = restModelData.leafData.reviewArticle;
|