Commit 791d56f8 authored by 涂伟's avatar 涂伟

feat: '1.事件进入表单设计交互修改,全屏弹窗2.表别名加载显示优化'

parent ce292de0
Pipeline #68954 waiting for manual action with stages
......@@ -115,9 +115,9 @@ const AddModal = props => {
}, []);
useEffect(() => {
if (props.location.state.id) {
setSelectTreeData(props.location.state.keepData);
setSelectDataFirst(props.location.state.keepTreeFirst);
if (props.tableInfo.id) {
setSelectTreeData(props.tableInfo.keepData);
setSelectDataFirst(props.tableInfo.keepTreeFirst);
if (treeSelectValue) {
let ss = treeSelectValue.substring(0, treeSelectValue.lastIndexOf('@'));
setFormObj(treeSelectValue.substring(0, treeSelectValue.lastIndexOf('@')));
......@@ -158,7 +158,7 @@ const AddModal = props => {
i.fieldName = i.name;
i.configInfo = i.config;
i.presetValue = i.preset == '(无)' ? '' : i.preset;
i.showCss = props.location.state.template.tableStyle;
i.showCss = props.tableInfo.template.tableStyle;
i.tableName = ss;
i.uiGroup = item;
i.readOnly = i.readOnly == '是' ? 1 : 0;
......@@ -172,7 +172,7 @@ const AddModal = props => {
});
flowNodeMeta.groups = arrdata;
list.flowNodeMeta = flowNodeMeta;
list.showCss = props.location.state.template.tableStyle;
list.showCss = props.tableInfo.template.tableStyle;
console.log(list);
let tablesSchema = {
......@@ -194,11 +194,11 @@ const AddModal = props => {
}
});
} else {
let ss = props.location.state.id;
setFormObj(props.location.state.id);
setFormName(props.location.state.name);
let ss = props.tableInfo.id;
setFormObj(props.tableInfo.id);
setFormName(props.tableInfo.name);
reloadTableFields({
tableName: props.location.state.id,
tableName: props.tableInfo.id,
}).then(res => {
setTreeLoading(false);
if (res.msg === 'Ok') {
......@@ -214,7 +214,7 @@ const AddModal = props => {
console.log(arrlist);
setKeepTree(arrlist);
data.TableFieldNames = arrlist;
data.TableName = props.location.state.id;
data.TableName = props.tableInfo.id;
listArr.push(data);
setKeepTreeData(listArr);
let arr = formateArrDataA(res.data.root, 'group');
......@@ -234,7 +234,7 @@ const AddModal = props => {
i.fieldName = i.name;
i.configInfo = i.config;
i.presetValue = i.preset == '(无)' ? '' : i.preset;
i.showCss = props.location.state.template.tableStyle;
i.showCss = props.tableInfo.template.tableStyle;
i.tableName = ss;
i.uiGroup = item;
i.readOnly = i.readOnly == '是' ? 1 : 0;
......@@ -248,7 +248,7 @@ const AddModal = props => {
});
flowNodeMeta.groups = arrdata;
list.flowNodeMeta = flowNodeMeta;
list.showCss = props.location.state.template.tableStyle;
list.showCss = props.tableInfo.template.tableStyle;
console.log(list);
let tablesSchema = {
......@@ -316,7 +316,7 @@ const AddModal = props => {
// 返回上一级
const back = () => {
console.log(props.location.state);
console.log(props.tableInfo);
let {
template,
tableScroll,
......@@ -325,7 +325,7 @@ const AddModal = props => {
groupArr,
searchValue,
select,
} = props.location.state;
} = props.tableInfo;
console.log(keepValue);
console.log(pickIndex, groupArr, 'back');
history.push({
......@@ -389,7 +389,7 @@ const AddModal = props => {
i.fieldName = i.name;
i.configInfo = i.config;
i.presetValue = i.preset == '(无)' ? '' : i.preset;
i.showCss = props.location.state.template.tableStyle;
i.showCss = props.tableInfo.template.tableStyle;
i.tableName = ss;
i.uiGroup = item;
i.readOnly = i.readOnly == '是' ? 1 : 0;
......@@ -403,7 +403,7 @@ const AddModal = props => {
});
flowNodeMeta.groups = arrdata;
list.flowNodeMeta = flowNodeMeta;
list.showCss = props.location.state.template.tableStyle;
list.showCss = props.tableInfo.template.tableStyle;
console.log(list);
let tablesSchema = {
......@@ -449,7 +449,7 @@ const AddModal = props => {
});
});
} else {
setPramFormObj(props.location.state.template);
setPramFormObj(props.tableInfo.template);
}
setType('affiliateAdd');
setVisible(true);
......@@ -459,7 +459,6 @@ const AddModal = props => {
setVisible(false);
setFlag(flag + 1);
};
return (
<>
<Spin tip="loading..." spinning={treeLoading}>
......
......@@ -58,6 +58,7 @@ import AffiliateAdd from './components/Field/affiliateAdd';
import LoadGroup from './components/Field/loadGroup';
import LoadGroupNew from './components/Field/loadGroupNew';
import ChooseTableType from './components/ChooseTableType';
import AddModal from './filedConfig/filedConfig';
// import { defaultFields } from './components/defaultFields';
import styles from './index.less';
import formDesign from '@/assets/font/omsfont/formDesign.svg';
......@@ -96,6 +97,8 @@ const TableManager = props => {
const [tableType, setTableType] = useState(defaultFields[0]);
const [groupPopVisible, setgGroupPopVisible] = useState(false);
const [checkMsg, setCheckMsg] = useState();
const [fieldConfigShow, setFieldConfigShow] = useState(false);
const [tableInfo, setTableInfo] = useState({});
const initNum = useRef(0);
useEffect(() => {
GetDefaultTableFields().then(res => {
......@@ -214,23 +217,24 @@ const TableManager = props => {
const fieldsConfig = (record, e) => {
e.stopPropagation();
setFormObj(record);
history.push({
pathname: `/biz/account/fieldConfig`,
state: {
name: record.tableAlias || record.tableName,
id: record.tableName,
template: record,
tableScroll: document.querySelector('.ant-table-body').scrollTop,
groupArr: groupArr,
pickIndex: pickIndex,
searchValue: searchValue,
select: select,
keepValue: keepValue,
keepTreeSelect: keepTreeSelect,
keepTreeFirst: keepTreeFirst,
keepData: keepData,
},
});
pushFieldConfig(record);
// history.push({
// pathname: `/biz/account/fieldConfig`,
// state: {
// name: record.tableAlias || record.tableName,
// id: record.tableName,
// template: record,
// tableScroll: document.querySelector('.ant-table-body').scrollTop,
// groupArr: groupArr,
// pickIndex: pickIndex,
// searchValue: searchValue,
// select: select,
// keepValue: keepValue,
// keepTreeSelect: keepTreeSelect,
// keepTreeFirst: keepTreeFirst,
// keepData: keepData,
// },
// });
// setType('config');
// setVisible(true);
};
......@@ -375,23 +379,38 @@ const TableManager = props => {
};
const pushFieldConfig = record => {
history.push({
pathname: `/biz/account/fieldConfig`,
state: {
name: record.tableAlias || record.tableName,
id: record.tableName,
template: record,
tableScroll: document.querySelector('.ant-table-body').scrollTop,
groupArr: groupArr,
pickIndex: pickIndex,
searchValue: searchValue,
select: select,
keepValue: keepValue,
keepTreeSelect: keepTreeSelect,
keepTreeFirst: keepTreeFirst,
keepData: keepData,
},
// history.push({
// pathname: `/biz/account/fieldConfig`,
// state: {
// name: record.tableAlias || record.tableName,
// id: record.tableName,
// template: record,
// tableScroll: document.querySelector('.ant-table-body').scrollTop,
// groupArr: groupArr,
// pickIndex: pickIndex,
// searchValue: searchValue,
// select: select,
// keepValue: keepValue,
// keepTreeSelect: keepTreeSelect,
// keepTreeFirst: keepTreeFirst,
// keepData: keepData,
// },
// });
setTableInfo({
name: record.tableAlias || record.tableName,
id: record.tableName,
template: record,
tableScroll: document.querySelector('.ant-table-body').scrollTop,
groupArr: groupArr,
pickIndex: pickIndex,
searchValue: searchValue,
select: select,
keepValue: keepValue,
keepTreeSelect: keepTreeSelect,
keepTreeFirst: keepTreeFirst,
keepData: keepData,
});
setFieldConfigShow(true);
};
const columns = [
......@@ -871,6 +890,24 @@ const TableManager = props => {
>
<div style={{ whiteSpace: 'pre-line', textAlign: 'justify' }}>{checkMsg}</div>
</Modal>
<Modal
title="表单设计"
visible={fieldConfigShow}
// onOk={getNewGroup}
onCancel={() => setFieldConfigShow(false)}
footer={null}
width="100vw"
style={{
maxWidth: '100vw',
top: 0,
paddingBottom: 0,
}}
bodyStyle={{
height: 'calc(100vh - 55px)',
}}
>
<AddModal tableInfo={tableInfo} show={fieldConfigShow} />
</Modal>
</PageContainer>
</Spin>
);
......
......@@ -239,7 +239,7 @@ const incident = () => {
},
},
{
title: '上报方式',
title: '上报类型',
dataIndex: 'createMode',
key: 'createMode',
width: 80,
......@@ -679,12 +679,12 @@ const incident = () => {
})}
>
<div style={{ height: '50px' }}>
<span className={styles.titleName}>{pickItem}</span>
<span>
<Tooltip title="编辑业务类型名称">
<FormOutlined className={styles.iconSize} onClick={editBusiness} />
</Tooltip>
</span>
{pickItem?<span><span className={styles.titleName}>{pickItem}</span>
<span>
<Tooltip title="编辑业务类型名称">
<FormOutlined className={styles.iconSize} onClick={editBusiness} />
</Tooltip>
</span></span>:null}
<span style={{ float: 'right', marginRight: '10px', marginTop: '10px' }}>
<Upload showUploadList={false} accept=".json" beforeUpload={beforeUpload}>
<Button style={{ marginLeft: '10px' }} type="primary" ghost>
......
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