|
@@ -1,7 +1,7 @@
|
|
|
/*
|
|
|
* @Author: your name
|
|
|
* @Date: 2021-09-14 10:22:09
|
|
|
- * @LastEditTime: 2022-01-05 14:29:28
|
|
|
+ * @LastEditTime: 2022-03-04 18:38:25
|
|
|
* @LastEditors: Please set LastEditors
|
|
|
* @Description: In User Settings Edit
|
|
|
* @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/index.tsx
|
|
@@ -26,7 +26,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,158 +39,24 @@ import {
|
|
|
} from '@ant-design/pro-form';
|
|
|
|
|
|
import './index.less';
|
|
|
+import MccsSelect from '@/components/MccsProFormSelect';
|
|
|
|
|
|
|
|
|
const { TextArea } = Input;
|
|
|
const { Option } = Select;
|
|
|
|
|
|
type ArticleManagementProps = {
|
|
|
- // 组件配置信息
|
|
|
+ //组件配置信息
|
|
|
columnsFromProps?: {}[],
|
|
|
- headerConcig?: Record<string, any>, // 配置参考ProPageContainer
|
|
|
+ headerConcig?: { [key: string]: any }, //配置参考ProPageContainer
|
|
|
isModeTwo?: boolean
|
|
|
|
|
|
}
|
|
|
|
|
|
-type SelectedRowsType = Record<string, any>
|
|
|
-
|
|
|
-
|
|
|
-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,
|
|
|
+type SelectedRowsType = {
|
|
|
+ [propsName: string]: any
|
|
|
+}
|
|
|
|
|
|
- },
|
|
|
- {
|
|
|
- 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 = [
|
|
|
{
|
|
@@ -218,7 +84,7 @@ const MccsLightTableColumns = [
|
|
|
|
|
|
|
|
|
|
|
|
-// 条文管理
|
|
|
+//条文管理
|
|
|
const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
const { columnsFromProps = [], headerConcig, isModeTwo } = props;
|
|
|
const { articleManagement } = useModel('allModels');
|
|
@@ -232,16 +98,166 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
scoreList,
|
|
|
getDepartmentRequest,
|
|
|
departmentManagers,
|
|
|
- getDepartment,// 获取责任单位
|
|
|
+ getDepartment,//获取责任单位
|
|
|
...restModelData
|
|
|
} = articleManagement;
|
|
|
const tableRef = useRef<MccsTable.MccsTableRef>();
|
|
|
|
|
|
- const [articleSettingFormInit, setArticleSettingFormInit] = useState<{}>({}); // 条文设置表单回显默认值
|
|
|
+ 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 = [
|
|
|
{
|
|
@@ -275,16 +291,16 @@ 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(',') : _;
|
|
|
+ return typeof _ == 'object' ? _.join(',') : _;
|
|
|
},
|
|
|
},
|
|
|
{
|
|
@@ -301,10 +317,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>
|
|
|
))
|
|
|
}
|
|
@@ -330,28 +346,28 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
]
|
|
|
|
|
|
|
|
|
- // 左侧树搜索回调
|
|
|
+ //左侧树搜索回调
|
|
|
const searchHandle = (val: any) => {
|
|
|
restModelData.getArticleTreeData(val);
|
|
|
}
|
|
|
|
|
|
const onSelectHandle = (data: MccsFileTree.childTree) => {
|
|
|
- // 左侧树节点点击回调
|
|
|
+ //左侧树节点点击回调
|
|
|
setCurrentActivedTree(data);
|
|
|
- setArticleSettingFormInit({});// 清空默认值
|
|
|
- // 重新获取数据
|
|
|
+ setArticleSettingFormInit({});//清空默认值
|
|
|
+ //重新获取数据
|
|
|
tableRef?.current?.getTableRef().current?.reload();
|
|
|
}
|
|
|
|
|
|
const batchSelfAssessment = (rowkeys: number[] | string[]) => {
|
|
|
- // 批量设置
|
|
|
+ //批量设置
|
|
|
restModelData.setDrawerFormType('BATCHSETTING');
|
|
|
restModelData.setSelectedRowKeys(rowkeys);
|
|
|
restModelData.setDrawerVisible(true);
|
|
|
}
|
|
|
|
|
|
const articleSetBtnHandle = () => {
|
|
|
- // 条文设置
|
|
|
+ //条文设置
|
|
|
// console.log({ articleSettingFormInit });
|
|
|
restModelData.setDrawerFormType('ARTICLE_SET');
|
|
|
restModelData.setDrawerVisible(true);
|
|
@@ -359,73 +375,47 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
}
|
|
|
|
|
|
const onVisibleChangeHandle = (visible: boolean) => {
|
|
|
- // drawer展示控制
|
|
|
- !visible && setArticleSettingFormInit({});// 清空默认值
|
|
|
+ //drawer展示控制
|
|
|
+ !visible && setArticleSettingFormInit({});//清空默认值
|
|
|
restModelData.setDrawerVisible(visible);
|
|
|
}
|
|
|
|
|
|
const onModalVisibleChange = (visible: boolean) => {
|
|
|
- // 表单弹窗
|
|
|
+ //表单弹窗
|
|
|
// console.log('uploadFormInitValue',restModelData.uploadFormInitValue);
|
|
|
!visible && restModelData.setUploadFormInitValue(undefined);
|
|
|
restModelData.setModalVisible(visible);
|
|
|
|
|
|
}
|
|
|
|
|
|
- // 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) => {
|
|
|
- // 台账上传类型选择回调
|
|
|
+ //台账上传类型选择回调
|
|
|
|
|
|
}
|
|
|
|
|
|
const setEditPageStatus = () => {
|
|
|
- // 更改页面的编辑状态
|
|
|
+ //更改页面的编辑状态
|
|
|
restModelData.setEditMode(!restModelData.editMode);
|
|
|
}
|
|
|
|
|
|
const onTextAreaChange = (e: React.ChangeEvent<HTMLTextAreaElement>, level: string) => {
|
|
|
- // 更改执行情况说明数据
|
|
|
- // 首先找出要更新的项,再进行整体替换
|
|
|
+ //更改执行情况说明数据
|
|
|
+ //首先找出要更新的项,再进行整体替换
|
|
|
|
|
|
if (restModelData.selectedSelfEvolution) {
|
|
|
|
|
|
- const editTargetLevel = restModelData.selectedSelfEvolution.label; // 目标等级
|
|
|
- // 找出目标等级下正在更新的level
|
|
|
+ const editTargetLevel = restModelData.selectedSelfEvolution.label; //目标等级
|
|
|
+ //找出目标等级下正在更新的level
|
|
|
const editImplementationDataItemIndex = restModelData.implementationData[editTargetLevel].findIndex(item => item.level == level);
|
|
|
- // 拷贝旧的目标等级数据
|
|
|
- const _cpOldImplemetationItem = restModelData.implementationData[editTargetLevel];
|
|
|
- // 将新的编辑内容赋值给正在编辑的目标下的level
|
|
|
+ //拷贝旧的目标等级数据
|
|
|
+ let _cpOldImplemetationItem = restModelData.implementationData[editTargetLevel];
|
|
|
+ //将新的编辑内容赋值给正在编辑的目标下的level
|
|
|
_cpOldImplemetationItem[editImplementationDataItemIndex].note = e.target.value;
|
|
|
|
|
|
if (editImplementationDataItemIndex != -1) {
|
|
|
restModelData.setImplementationData({
|
|
|
...restModelData.implementationData,
|
|
|
- // 插入更新
|
|
|
+ //插入更新
|
|
|
[editTargetLevel]: _cpOldImplemetationItem
|
|
|
}
|
|
|
)
|
|
@@ -435,54 +425,54 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
}
|
|
|
|
|
|
enum ActType {
|
|
|
- 'NOACT', // 不操作
|
|
|
+ 'NOACT', //不操作
|
|
|
'ADD',
|
|
|
'EDIT',
|
|
|
'DEL'
|
|
|
};
|
|
|
|
|
|
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;
|
|
|
|
|
|
const objectSimpleFilter = (obj: object, keyToDel: string) => {
|
|
|
- return JSON.parse(JSON.stringify(obj, (key, value) => {
|
|
|
+ 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')) {
|
|
|
- // 如果是删除操作且删除的不是数据库已有数据时,剔除之前暂时保留数据
|
|
|
+ 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)=>{
|
|
|
+
|
|
|
+ const replaceData = (item: any, index: number) => {
|
|
|
prevData[index] = {
|
|
|
- ...item,dataStatus: actType, version: version || '',
|
|
|
- grade: data.grade.join(','), 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){
|
|
|
- // 之前已有操作记录的,替换为最新状态
|
|
|
- replaceData(data,findeIndex);
|
|
|
+ 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);
|
|
@@ -494,37 +484,47 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
|
|
|
restModelData.setTaizhangDataDirectoryCommitList(
|
|
|
[...prevData, {
|
|
|
- ...data, dataStatus: actType, version: version || '',
|
|
|
- grade: data.grade.join(','), numStr, accountStatus: data.accountStatus?'1':'0'
|
|
|
+ ...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 || 0;
|
|
|
+ const followWindowResize = (num?: number) => {
|
|
|
+ const _num = num ? num : 0;
|
|
|
|
|
|
- if(leafContentRef.current){
|
|
|
- const leafContentH = leafContentRef.current.clientHeight + 50; // 加上padding
|
|
|
+ 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 })));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
|
if (restModelData.reloadRightContent) {
|
|
|
- // 重新获取数据
|
|
|
+ //重新获取数据
|
|
|
tableRef?.current?.getTableRef().current?.reload();
|
|
|
tableRef?.current?.getTableRef().current?.clearSelected();
|
|
|
}
|
|
@@ -533,7 +533,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
- // 点击叶子结点时回调
|
|
|
+ //点击叶子结点时回调
|
|
|
if (restModelData.leafData) {
|
|
|
const { responsibilityDepartmentId, responsibilityDepartmentName, responsibilityUserId, targetEvaluation, responsibilityUserName, accountType } = restModelData.leafData.reviewArticle;
|
|
|
if (responsibilityDepartmentName && responsibilityDepartmentId) {
|
|
@@ -545,8 +545,8 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- restModelData.getGradeOptions(); // 获取可选档次
|
|
|
- restModelData.getAccoutTypeOptions(); // 可选类型
|
|
|
+ restModelData.getGradeOptions(); //获取可选档次
|
|
|
+ restModelData.getAccoutTypeOptions(); //可选类型
|
|
|
|
|
|
}
|
|
|
|
|
@@ -555,64 +555,67 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
|
|
|
useEffect(() => {
|
|
|
if (isModeTwo) {
|
|
|
- // 设置当前模块模式,台账上传共用时
|
|
|
+ //设置当前模块模式,台账上传共用时
|
|
|
restModelData.setModuleMode(isModeTwo);
|
|
|
} else {
|
|
|
- // 设置当前模块模式
|
|
|
+ //设置当前模块模式
|
|
|
restModelData.setModuleMode(false);
|
|
|
}
|
|
|
}, [props]);
|
|
|
|
|
|
useEffect(() => {
|
|
|
if (treeData.length > 0) {
|
|
|
- // 默认展开书结构第一个结点
|
|
|
- // 树结构组件会默认执行一遍onSelectHandle,将选中结点信息传出来
|
|
|
+ //默认展开书结构第一个结点
|
|
|
+ //树结构组件会默认执行一遍onSelectHandle,将选中结点信息传出来
|
|
|
const { id } = treeData[0];
|
|
|
setDefaultOpened(`${id}`);
|
|
|
}
|
|
|
}, [treeData]);
|
|
|
|
|
|
|
|
|
- useEffect(()=>{
|
|
|
+ useEffect(() => {
|
|
|
// followWindowResize();
|
|
|
- if(isLeaf){
|
|
|
- setTimeout(()=>{
|
|
|
- // 首次加载叶子节点内容触发一次
|
|
|
- const myEvent = new Event('resize');
|
|
|
- window.dispatchEvent(myEvent);
|
|
|
- document.body.style.overflowY = 'hidden'; // 叶子节点下锁住页面滚动
|
|
|
- },500);
|
|
|
+ if (isLeaf) {
|
|
|
+ setTimeout(() => {
|
|
|
+ //首次加载叶子节点内容触发一次
|
|
|
+ var myEvent = new Event('resize');
|
|
|
+ window.dispatchEvent(myEvent);
|
|
|
+ document.body.style.overflowY = 'hidden'; //叶子节点下锁住页面滚动
|
|
|
+ }, 500);
|
|
|
+ //获取单位列表
|
|
|
}
|
|
|
-
|
|
|
- if(!isLeaf){
|
|
|
- document.body.style.overflowY = 'auto'; // 非叶子节点放开
|
|
|
+
|
|
|
+ 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(() => {
|
|
|
- // 页面加载完
|
|
|
- // 获取左侧输结构
|
|
|
+ //页面加载完
|
|
|
+ //获取左侧输结构
|
|
|
restModelData.getArticleTreeData();
|
|
|
- // 获取当前评分
|
|
|
+ //获取当前评分
|
|
|
restModelData.getCurrentHospScore();
|
|
|
-
|
|
|
+
|
|
|
// followWindowResize();
|
|
|
- window.addEventListener("resize",()=>followWindowResize());
|
|
|
+ window.addEventListener("resize", () => followWindowResize());
|
|
|
|
|
|
- return ()=>{
|
|
|
- window.removeEventListener("resize",()=>followWindowResize());
|
|
|
+ getDepartments();
|
|
|
+
|
|
|
+ return () => {
|
|
|
+ window.removeEventListener("resize", () => followWindowResize());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}, [])
|
|
|
|
|
|
|
|
@@ -620,7 +623,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
return (
|
|
|
<div className='ArticleManagement'>
|
|
|
<MccsPageContainer
|
|
|
- config={headerConcig || {
|
|
|
+ config={headerConcig ? headerConcig : {
|
|
|
content: !isModeTwo && <div style={{ textAlign: 'right', fontSize: 12, color: '#525866' }}>{restModelData.currentHospSelfScoreAndOthers}</div>,
|
|
|
footer: restModelData.editMode ? [
|
|
|
<Button key="3" onClick={() => restModelData.setEditMode(false)}>取消</Button>,
|
|
@@ -632,7 +635,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
>
|
|
|
{
|
|
|
restModelData.modalVisible && (
|
|
|
- // 台账上传弹窗
|
|
|
+ //台账上传弹窗
|
|
|
<MccsModal title='台账上传' visible={restModelData.modalVisible}
|
|
|
onFinish={(values: any) => restModelData.uploadFile(values)}
|
|
|
initialValues={!restModelData.uploadFormInitValue ? {} : restModelData.uploadFormInitValue}
|
|
@@ -650,8 +653,8 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
},
|
|
|
]}>
|
|
|
<MccsClickableTabs
|
|
|
- // 重新上传不允许更改类型
|
|
|
- disabled={!!((restModelData.uploadFormInitValue && JSON.stringify(restModelData.uploadFormInitValue) != '{}'))}
|
|
|
+ //重新上传不允许更改类型
|
|
|
+ disabled={(restModelData.uploadFormInitValue && JSON.stringify(restModelData.uploadFormInitValue) != '{}') ? true : false}
|
|
|
type='multi'
|
|
|
onChange={uploadLedgerChangeHandle}
|
|
|
data={restModelData.uploadLedgerTypeList}
|
|
@@ -660,7 +663,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
<ProFormDependency name={['tab']}>
|
|
|
{
|
|
|
({ tab }) => {
|
|
|
- // 制度特殊处理
|
|
|
+ //制度特殊处理
|
|
|
return tab && tab.value.label == '制度' && (
|
|
|
<ProFormSelect
|
|
|
name="publicCateId"
|
|
@@ -687,8 +690,8 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
}
|
|
|
|
|
|
{
|
|
|
- // 条文设置/表格批量设置drawer弹窗
|
|
|
- // restModelData.drawerVisible &&
|
|
|
+ //条文设置/表格批量设置drawer弹窗
|
|
|
+ //restModelData.drawerVisible &&
|
|
|
(
|
|
|
<MccsDrawerForm
|
|
|
title={restModelData.drawerFormType == 'ARTICLE_SET' ? '条文设置' : '批量设置'}
|
|
@@ -711,7 +714,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
fieldProps={{
|
|
|
labelInValue: true,
|
|
|
onChange: (value, option) => {
|
|
|
- // 责任单位修改时清空责任人
|
|
|
+ //责任单位修改时清空责任人
|
|
|
drawerFormRef.current?.setFieldsValue({ ...articleSettingFormInit, responsibilityUser: { label: '', value: '' } });
|
|
|
getDepartment(value, option)
|
|
|
}
|
|
@@ -793,7 +796,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
onSelectHandle={onSelectHandle}
|
|
|
searchHandle={searchHandle}
|
|
|
renderFilter={() => {
|
|
|
- // 只在台账上传时展示
|
|
|
+ //只在台账上传时展示
|
|
|
return isModeTwo ? (
|
|
|
<div className='onlyMyselfFilter'>
|
|
|
<span>只看我的</span>
|
|
@@ -863,11 +866,11 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
}
|
|
|
</div>
|
|
|
{
|
|
|
- // 条文页面
|
|
|
+ //条文页面
|
|
|
!restModelData.moduleMode && <div className='ruleSettingBtn' onClick={articleSetBtnHandle}>条文设置</div>
|
|
|
}
|
|
|
{
|
|
|
- // 台账上传页面且非编辑状态下
|
|
|
+ //台账上传页面且非编辑状态下
|
|
|
(restModelData.moduleMode && !restModelData.editMode && restModelData.hasEditAuthority) && <div className='editPageBtn' onClick={() => setEditPageStatus()}>{restModelData.editMode ? '取消编辑' : '开启编辑'}</div>
|
|
|
}
|
|
|
</div>
|
|
@@ -920,11 +923,11 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
|
|
|
{
|
|
|
isLeaf && restModelData.leafData && (
|
|
|
- // 台账上传页面时,背景色统一白色,cardWrap提供容器实现上下滑动
|
|
|
- <div className={isModeTwo ? 'cardWrap isModeTwo' : 'cardWrap'} style={{height:`${scrollAreaH}px`,marginTop:'16px'}}>
|
|
|
+ //台账上传页面时,背景色统一白色,cardWrap提供容器实现上下滑动
|
|
|
+ <div className={isModeTwo ? 'cardWrap isModeTwo' : 'cardWrap'} style={{ height: `${scrollAreaH}px`, marginTop: '16px' }}>
|
|
|
<div>
|
|
|
{
|
|
|
- // 渲染执行情况说明
|
|
|
+ //渲染执行情况说明
|
|
|
/**
|
|
|
* 满足条件:
|
|
|
* 1.存在自评等级从接口获取或手动点击选择
|
|
@@ -967,7 +970,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
|
|
|
</div>
|
|
|
<div style={{ padding: '0 16px' }}>
|
|
|
{
|
|
|
- // 台帐下展示
|
|
|
+ //台帐下展示
|
|
|
(isModeTwo && restModelData.leafData) && (
|
|
|
<MccsEditableTable
|
|
|
bordered={true}
|
|
@@ -985,14 +988,14 @@ 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;
|
|
|
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' })), // 多选下拉需传数组值
|
|
|
+ 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
|