Commit 87fe3060 by zhaochengxiang

服务增加固定列

parent aa547828
...@@ -16,6 +16,7 @@ import { dispatch } from '../../../../model'; ...@@ -16,6 +16,7 @@ import { dispatch } from '../../../../model';
import { showMessage, getQueryParam, paginate, isSzseEnv, formatDate, getDataModelerRole } from '../../../../util'; import { showMessage, getQueryParam, paginate, isSzseEnv, formatDate, getDataModelerRole } from '../../../../util';
import { AnchorId, AnchorTimestamp, Action, CatalogId, ModelerId, DataModelerRoleReader } from '../../../../util/constant'; import { AnchorId, AnchorTimestamp, Action, CatalogId, ModelerId, DataModelerRoleReader } from '../../../../util/constant';
import { AppContext } from "../../../../App"; import { AppContext } from "../../../../App";
import SelectUser from "./SelectUsers";
// import Tag from "../../Tag"; // import Tag from "../../Tag";
import './ModelTable.less'; import './ModelTable.less';
...@@ -180,22 +181,61 @@ const ModelTable = (props) => { ...@@ -180,22 +181,61 @@ const ModelTable = (props) => {
filter: false, filter: false,
} }
const editorCol = { const fixedCols = [
{
title: '路径',
dataIndex: 'path',
width: 120,
ellipsis: true,
filter: false,
render: (text, _, __) => {
return (
<Tooltip title={text||''}>
<Text ellipsis={true}>{text||''}</Text>
</Tooltip>
)
}
},
{
title: '状态',
dataIndex: 'state',
width: 100,
ellipsis: true,
filter: false,
render: (_, record) => {
let color = '';
if (record?.state?.id === '1') {
color = '#DE7777';
} else if (record?.state?.id === '2') {
color = '#779BDE';
} else if (record?.state?.id === '4') {
color = '#77DEBF';
}
return (
<span>
<span style={{ display: 'inline-block', width: 10, height: 10, borderRadius: 5, marginRight: 5, backgroundColor: color }}></span>
<span>{record?.state?.cnName||''}</span>
</span>
);
}
},
{
title: '管理人', title: '管理人',
dataIndex: 'editor', dataIndex: 'editor',
width: 100, width: 100,
ellipsis: true, ellipsis: true,
filter: false, filter: false,
render: (editor, record) => { render: (editor, record) => {
const user = users?.filter((user)=>user.pernr===editor); return <SelectUser
if (user && user.length > 0) { type='detail'
return <Tooltip title={user[0].nachn?`${user[0].nachn}(${user[0].pernr})`:user[0].pernr}> users={users}
<Text ellipsis={true}>{user[0].nachn?`${user[0].nachn}(${user[0].pernr})`:user[0].pernr}</Text> value={editor}
</Tooltip> />;
}
return '';
}
} }
},
]
const actionCol = { const actionCol = {
title: '操作', title: '操作',
...@@ -521,13 +561,11 @@ const ModelTable = (props) => { ...@@ -521,13 +561,11 @@ const ModelTable = (props) => {
if (item.userSelected === true) { if (item.userSelected === true) {
col.render = (_, record) => { col.render = (_, record) => {
const user = users?.filter((user)=>(user.pernr===record.basicInfo?.[item.key])); return <SelectUser
if (user && user.length > 0) { type='detail'
return <Tooltip title={user[0].nachn?`${user[0].nachn}(${user[0].pernr})`:user[0].pernr}> users={users}
<Text ellipsis={true}>{user[0].nachn?`${user[0].nachn}(${user[0].pernr})`:user[0].pernr}</Text> value={record.basicInfo?.[item.key]}
</Tooltip> />;
}
return '';
}; };
} }
...@@ -536,9 +574,9 @@ const ModelTable = (props) => { ...@@ -536,9 +574,9 @@ const ModelTable = (props) => {
}); });
if (!modelId) { if (!modelId) {
newCols = [indexCol, ...newCols, editorCol, actionCol]; newCols = [indexCol, ...newCols, ...fixedCols, actionCol];
} else { } else {
newCols = [...newCols, editorCol, actionCol]; newCols = [...newCols, ...fixedCols, actionCol];
} }
if ((visibleColNames||[]).length > 0) { if ((visibleColNames||[]).length > 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment