|
@@ -1,7 +1,7 @@
|
|
/*
|
|
/*
|
|
* @Author: your name
|
|
* @Author: your name
|
|
* @Date: 2021-12-24 09:43:04
|
|
* @Date: 2021-12-24 09:43:04
|
|
- * @LastEditTime: 2022-06-21 15:01:04
|
|
|
|
|
|
+ * @LastEditTime: 2022-07-04 16:32:17
|
|
* @LastEditors: code4eat awesomedema@gmail.com
|
|
* @LastEditors: code4eat awesomedema@gmail.com
|
|
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
* @FilePath: /MedicalWisdomCheckSys/src/components/MccsLightTable/index.tsx
|
|
* @FilePath: /MedicalWisdomCheckSys/src/components/MccsLightTable/index.tsx
|
|
@@ -12,6 +12,7 @@ import type { MccsLightTableTypes } from './typings';
|
|
import { Empty, Tooltip, Pagination } from 'antd';
|
|
import { Empty, Tooltip, Pagination } from 'antd';
|
|
|
|
|
|
import './style.less';
|
|
import './style.less';
|
|
|
|
+import { useModel } from 'umi';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -27,6 +28,8 @@ const MccsLightTable: React.FC<{
|
|
renderRow?: (data: any) => React.Component<any>,
|
|
renderRow?: (data: any) => React.Component<any>,
|
|
}> = props => {
|
|
}> = props => {
|
|
|
|
|
|
|
|
+ const { initialState } = useModel('@@initialState');
|
|
|
|
+
|
|
const {
|
|
const {
|
|
columns,
|
|
columns,
|
|
renderRow,
|
|
renderRow,
|
|
@@ -68,10 +71,12 @@ const MccsLightTable: React.FC<{
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
const _columns = columns.filter(item => !item.hideInTable);
|
|
const _columns = columns.filter(item => !item.hideInTable);
|
|
|
|
+
|
|
const hasSetWidColumns = _columns.filter(item => item.width);
|
|
const hasSetWidColumns = _columns.filter(item => item.width);
|
|
const needCountWidCloumnsNum = _columns.length - hasSetWidColumns.length;
|
|
const needCountWidCloumnsNum = _columns.length - hasSetWidColumns.length;
|
|
const widArray = hasSetWidColumns.map(item => item.width)
|
|
const widArray = hasSetWidColumns.map(item => item.width)
|
|
const CountableWid = widArray.reduce((prev, curr) => (prev || 0) + (curr || 0), 0);
|
|
const CountableWid = widArray.reduce((prev, curr) => (prev || 0) + (curr || 0), 0);
|
|
|
|
+
|
|
// 初始化cell长度
|
|
// 初始化cell长度
|
|
const a = _columns.map((item, index) => {
|
|
const a = _columns.map((item, index) => {
|
|
|
|
|
|
@@ -133,20 +138,29 @@ const MccsLightTable: React.FC<{
|
|
|
|
|
|
const { pfmDataDirectoryList: list, gradeLevel: grade } = data;
|
|
const { pfmDataDirectoryList: list, gradeLevel: grade } = data;
|
|
const _cpcolumns = Object.assign([], renderColumns);
|
|
const _cpcolumns = Object.assign([], renderColumns);
|
|
- _cpcolumns.splice(0, 1); // 剔除第一个
|
|
|
|
|
|
+
|
|
|
|
+ if(initialState?.currentUser?.ruleVersion != 'HB202001') {
|
|
|
|
+ //非武汉医院
|
|
|
|
+ _cpcolumns.splice(0, 1); // 剔除第一个
|
|
|
|
+ }
|
|
|
|
|
|
const headWid = renderColumns[0] && renderColumns[0].width ? renderColumns[0].width : 0;
|
|
const headWid = renderColumns[0] && renderColumns[0].width ? renderColumns[0].width : 0;
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
return (
|
|
return (
|
|
<div className='list' >
|
|
<div className='list' >
|
|
- <div className='head' style={{ width: `${headWid}%` }}>{grade}</div>
|
|
|
|
- <div className='headRelaData' style={{ position: 'relative', left: `${headWid}%` }}>
|
|
|
|
|
|
+ {initialState?.currentUser?.ruleVersion != 'HB202001'&&<div className='head' style={{ width: `${headWid}%` }}>{grade}</div>}
|
|
|
|
+ <div className='headRelaData' style={{ position: 'relative', left: `${initialState?.currentUser?.ruleVersion != 'HB202001'?headWid:0}%` }}>
|
|
{
|
|
{
|
|
(list).map((item: any, index: number) => {
|
|
(list).map((item: any, index: number) => {
|
|
|
|
+
|
|
|
|
+ console.log({item});
|
|
return (
|
|
return (
|
|
<div className='subList' key={index}>
|
|
<div className='subList' key={index}>
|
|
{
|
|
{
|
|
_cpcolumns.map((v: any, k: any) => {
|
|
_cpcolumns.map((v: any, k: any) => {
|
|
|
|
+ // console.log({v,_cpcolumns,list});
|
|
let cellValue = item[v.key];
|
|
let cellValue = item[v.key];
|
|
// 自定义value结果
|
|
// 自定义value结果
|
|
if (v.render) {
|
|
if (v.render) {
|