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