Commit 95691697 authored by 皮倩雯's avatar 皮倩雯

fix: '表字段建表增加类型,默认不显示内置字段'

parent 746ff097
Pipeline #64138 waiting for manual action with stages
......@@ -32,7 +32,14 @@ import index from '../../../../../assets/images/icons/索引.svg';
// import { defaultFields } from './defaultFields';
const EditableContext = React.createContext(null);
const tableMap = { 事件表: '事件', 工单表: '工单', 台账表: '台账', 设备表: '设备', 反馈表: '反馈' };
const tableMap = {
事件表: '事件',
事件工单表: '事件',
工单表: '工单',
台账表: '台账',
设备表: '设备',
反馈表: '反馈',
};
const EditableRow = ({ index, ...props }) => {
const [form] = Form.useForm();
return (
......@@ -318,7 +325,11 @@ const TableView = props => {
});
setDefaultData(defaultList);
setCount(fieldList.length);
setDataSource(fieldList);
setShowDefault(false);
let list = JSON.parse(JSON.stringify(fieldList));
list = list.filter(item => !item.ReadOnly);
setDataSource(list);
} else {
notification.error({ message: '提示', duration: 3, description: res.msg });
}
......@@ -339,11 +350,14 @@ const TableView = props => {
console.log(list);
setDefaultData(list);
setCount(list.length);
setDataSource(list);
setShowDefault(false);
let listitem = JSON.parse(JSON.stringify(list));
listitem = listitem.filter(item => !item.ReadOnly);
setDataSource(listitem);
});
}
} else {
setShowDefault(true);
setShowDefault(false);
setDataSource([]);
setDefaultData([]);
setSelectedRowKeys([]);
......@@ -698,7 +712,6 @@ const TableView = props => {
<div style={{ display: 'flex' }}>
<Form.Item label="内置字段" style={{ marginBottom: '0', marginRight: '10px' }}>
<Switch
defaultChecked
checkedChildren="显示"
unCheckedChildren="隐藏"
onChange={showDefaultFields}
......
......@@ -82,7 +82,15 @@ const TableManager = props => {
const [treeVisible, setTreeVisible] = useState(true); // 是否显示左侧树
const [hoverItemIndex, setHoverItemIndex] = useState(0); // hover流程索引
const [pickIndex, setPickIndex] = useState(0);
const [tableType, setTableType] = useState(defaultFields[0].value);
const [defaultFields1, setDefaultFields1] = useState([
'事件表',
'事件工单表',
'工单表',
'台账表',
'设备表',
'反馈表',
]);
const [tableType, setTableType] = useState(defaultFields1[0]);
const [groupPopVisible, setgGroupPopVisible] = useState(false);
const [checkMsg, setCheckMsg] = useState();
......@@ -127,6 +135,7 @@ const TableManager = props => {
setTimeout(() => {
setSelect(selectValue);
setPickIndex(i);
console.log(group);
setGroupArr(group);
document.querySelector('.ant-table-body').scrollTop = tableScroll;
}, 0);
......@@ -247,7 +256,15 @@ const TableManager = props => {
let bb = [];
console.log(groupData, 'groupData');
// 对分组进行排序
const sortNameArr = ['事件表', '工单表', '台账表', '设备表', '反馈表', '其他表'];
const sortNameArr = [
'事件表',
'事件工单表',
'工单表',
'台账表',
'设备表',
'反馈表',
'其他表',
];
const sortList = [];
sortNameArr.forEach(ele => {
Object.keys(groupData).map((item, index) => {
......@@ -509,10 +526,7 @@ const TableManager = props => {
});
};
const menu = (
<Menu
onClick={onMenuClick}
items={defaultFields.map(item => ({ key: item.value, label: item.value }))}
/>
<Menu onClick={onMenuClick} items={defaultFields1.map(item => ({ key: item, label: item }))} />
);
return (
<Spin tip="loading..." spinning={treeLoading}>
......
......@@ -174,13 +174,13 @@ const FlowNode = () => {
width: 100,
render: (text, record) => <span style={{ color: textStyleOne(text, record) }}>{text}</span>,
},
{
title: '节点类型',
dataIndex: 'extendNodeType',
align: 'center',
width: 80,
render: (text, record) => <span style={{ color: textStyleOne(text, record) }}>{text}</span>,
},
// {
// title: '节点类型',
// dataIndex: 'extendNodeType',
// align: 'center',
// width: 80,
// render: (text, record) => <span style={{ color: textStyleOne(text, record) }}>{text}</span>,
// },
{
title: '工单主表',
dataIndex: 'extendTableName',
......@@ -404,11 +404,11 @@ const FlowNode = () => {
align: 'center',
width: 100,
},
{
title: '节点类型',
align: 'center',
width: 80,
},
// {
// title: '节点类型',
// align: 'center',
// width: 80,
// },
{
title: '工单主表',
align: 'center',
......
......@@ -45,8 +45,10 @@ const NodeEdit = props => {
const [visibleChecked2, setVisibleChecked2] = useState('');
const [visibleChecked3, setVisibleChecked3] = useState('');
const [visibleChecked5, setVisibleChecked5] = useState('');
const [visibleChecked6, setVisibleChecked6] = useState('');
const [autoClose, setAutoClose] = useState(false);
const [transfer, setTransfer] = useState(false);
const [half, setHalf] = useState(false);
const [form] = Form.useForm();
useEffect(() => {
......@@ -66,6 +68,7 @@ const NodeEdit = props => {
setVisibleChecked2(false);
setVisibleChecked3(false);
setVisibleChecked5(false);
setVisibleChecked6(false);
setTransfer(false);
}
}, [visible]);
......@@ -91,6 +94,11 @@ const NodeEdit = props => {
} else {
setTransfer(false);
}
if (res.data.Type != 2 && res.data.Type != 1) {
setHalf(false);
} else {
setHalf(true);
}
let obj = {
...res.data.Extend,
FlowName: res.data.FlowName,
......@@ -107,6 +115,7 @@ const NodeEdit = props => {
setVisibleChecked(obj.Transferable == 1);
obj.IsSave = obj.IsSave == 1;
setVisibleChecked5(obj.IsSave == 1);
setVisibleChecked6(obj.halfwayClose == 1);
if (obj.EventsInformation) {
if (obj.EventsInformation == 1) {
obj.EventsInformation = true;
......@@ -142,6 +151,7 @@ const NodeEdit = props => {
setVisibleChecked1(true);
setVisibleChecked2(true);
setVisibleChecked5(false);
setVisibleChecked6(false);
form.setFieldsValue({
FlowName: res.data.FlowName,
......@@ -149,6 +159,12 @@ const NodeEdit = props => {
Handover: '移交选择人',
});
}
} else {
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
}
});
};
......@@ -280,6 +296,7 @@ const NodeEdit = props => {
validate.IsSendMessage = visibleChecked2 ? 1 : 0;
validate.IsSave = visibleChecked5 ? 1 : 0;
validate.AutoClose = visibleChecked3 ? '是' : '否';
validate.halfwayClose = visibleChecked6 ? 1 : 0;
console.log(validate);
editFlowNodeExtend({ ...validate, flowNodeId: msg.ID })
.then(res => {
......@@ -388,6 +405,11 @@ const NodeEdit = props => {
setVisibleChecked5(e);
};
const change6 = e => {
console.log(e);
setVisibleChecked6(e);
};
return (
<Drawer
title="流程节点配置"
......@@ -529,10 +551,31 @@ const NodeEdit = props => {
checked={visibleChecked5}
onChange={change5}
/>
{/* <Radio.Group>
<Radio value={0}>否</Radio>
<Radio value={1}>是</Radio>
</Radio.Group> */}
</Form.Item>
<Form.Item
label={
<div style={{ display: 'flex', alignItems: 'center' }}>
{half == true ? (
<>
<Tooltip title="开始节点和结束节点不可配置中途关单">
<InfoCircleOutlined style={{ color: '#1890ff', marginRight: '3px' }} />
</Tooltip>
<span>中途关单</span>
</>
) : (
<span>中途关单</span>
)}
</div>
}
name="halfwayClose"
>
<Switch
checkedChildren="是"
unCheckedChildren="否"
checked={visibleChecked6}
onChange={change6}
disabled={half}
/>
</Form.Item>
<Form.Item
......
import React, { useEffect, useState } from 'react';
import { Modal, Checkbox, Spin } from 'antd';
import { RoleGroupList } from '@/services/messagemanage/messagemanage';
import { GetUserRelationListNew } from '@/services/userManage/api';
import styles from './RoleModal.less';
const CheckboxGroup = Checkbox.Group;
......@@ -13,7 +14,7 @@ const RoleModal = porps => {
if (visible) {
setIsLoading(true);
let hasCheckList = selectValue ? selectValue.split(',') : [];
RoleGroupList().then(res => {
GetUserRelationListNew({ userID: 9999999 }).then(res => {
setIsLoading(false);
if (res.code === 0) {
let roleListData = res.data.roleList;
......
......@@ -30,7 +30,8 @@
.bottomCheckbox {
margin-top: 10px;
.ant-checkbox-wrapper {
min-width: 200px;
min-width: 240px;
margin-bottom: 10px;
margin-left: 0;
}
}
......
......@@ -40,7 +40,9 @@ const Login = props => {
if (result.data && result.data.pass) {
const { userMode, token } = result.data;
console.log(token);
localStorage.setItem('token', token?.access_token || '');
updateDicName();
setUserMode(userMode);
setLoginName(loginName);
if (userMode === USER_MODE.SUPER || userMode === USER_MODE.ADMIN) {
......@@ -103,9 +105,6 @@ const Login = props => {
console.error(err);
});
};
useEffect(() => {
updateDicName();
}, []);
return (
<div className={styles.main}>
......
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