|
@@ -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>
|