Commit 92e12492 authored by 皮倩雯's avatar 皮倩雯

fix: '接入parseForm组件'

parent ef24a54b
Pipeline #64235 failed with stages
......@@ -118,6 +118,7 @@
"ip": "1.1.5",
"lodash": "4.17.11",
"minimist": "1.2.0",
"parseForm": "^1.8.3",
"prop-types": "15.7.2",
"quill": "^1.3.7",
"rc-tween-one": "^3.0.6",
......
......@@ -45,12 +45,14 @@ const BasicLayout = props => {
console.log(localStorage.getItem('panda-publish'));
if (localStorage.getItem('panda-publish') == 'getway') {
window.globalConfig = {
...window.globalConfig,
access_token: localStorage.getItem('token'),
hasGateWay: true,
apiGatewayDomain: `${window.location.origin}${'/PandaCore/GateWay'}`,
};
} else {
window.globalConfig = {
...window.globalConfig,
access_token: localStorage.getItem('token'),
hasGateWay: false,
apiGatewayDomain: `${window.location.origin}`,
......
import React, { useState, useEffect } from 'react';
import { Modal, Space, Button } from 'antd';
import ParseForm from 'parseForm';
import { LayerSetting } from '@/services/gis/gis';
const PerviewPrase = props => {
const { visible, onCancel, accountData } = props;
const [loading, setLoading] = useState(false);
const [data, setData] = useState({});
useEffect(() => {
console.log(accountData);
if (visible) {
let tablesSchema = {
child: {},
groups: accountData.flowNodeMeta.groups,
values: [],
modules: [],
relationForm: {},
};
LayerSetting({ client: 'sandbox' }).then(res => {
console.log(res.data[0]);
let ss = {
layers: [res.data[0]],
};
let depart = { OID: 1017, code: '1-1016-1017', name: '管理员' };
let userInfo = { OID: 1, fullName: '总经理', loginName: 'admin', depart };
window.globalConfig = {
...window.globalConfig,
mapsettings: ss,
userInfo,
};
});
setData(tablesSchema);
}
}, [visible]);
return (
<Modal
title="预览"
bodyStyle={{
width: '100%',
minHeight: '200px',
maxHeight: '800px',
overflow: 'scroll',
overflowX: 'hidden',
}}
width="1800px"
style={{ marginTop: '-95px' }}
destroyOnClose
maskClosable={false}
footer={
<Space>
<Button onClick={onCancel} type="primary">
关闭
</Button>
</Space>
}
{...props}
confirmLoading={loading}
forceRender
getContainer={false}
>
{console.log(data)}
{visible ? <ParseForm tablesSchema={data} noButtons /> : <></>}
</Modal>
);
};
export default PerviewPrase;
......@@ -23,6 +23,7 @@ import {
PlusSquareOutlined,
RollbackOutlined,
ConsoleSqlOutlined,
EyeOutlined,
} from '@ant-design/icons';
import {
reloadTableFields,
......@@ -35,6 +36,7 @@ import FieldEditor from './fieldEditor';
import AffiliateAdd from '../components/Field/affiliateAdd';
import LoadGroup from '../components/Field/loadGroupNew';
import styles from './index.less';
import PerviewPrase from './PerviewPrase';
const AddModal = props => {
const history = useHistory();
const [allData, setAllData] = useState([]);
......@@ -66,6 +68,8 @@ const AddModal = props => {
const [keepStandingBook, setKeepStandingBook] = useState([]);
const [keepTreeData, setKeepTreeData] = useState([]);
const [keepTree, setKeepTree] = useState([]); // 保存树字段名称
const [perviewPrase, setPerViewPrase] = useState(false);
const [accountData, setAccountData] = useState({});
const editor = record => {
console.log(record);
......@@ -318,19 +322,18 @@ const AddModal = props => {
}, []);
useEffect(() => {
console.log(props);
console.log(treeSelectValue);
console.log(props.location.state.id);
if (props.location.state.id) {
setSelectTreeData(props.location.state.keepTreeSelect);
setSelectDataFirst(props.location.state.keepTreeFirst);
if (treeSelectValue) {
let ss = treeSelectValue.substring(0, treeSelectValue.lastIndexOf('@'));
setFormObj(treeSelectValue.substring(0, treeSelectValue.lastIndexOf('@')));
reloadTableFields({
tableName: treeSelectValue.substring(0, treeSelectValue.lastIndexOf('@')),
}).then(res => {
setTreeLoading(false);
if (res.msg === 'Ok') {
console.log(res.data.root);
let arrlist = [];
let data = {};
let listArr = [];
......@@ -351,11 +354,34 @@ const AddModal = props => {
setAllData(arr);
let aa = [];
let bb = [];
let list = {};
let arrdata = [];
let flowNodeMeta = {};
Object.keys(arr).forEach((item, index) => {
console.log(arr[item]);
arr[item].map(i => {
i.fieldName = i.name;
i.configInfo = i.config;
i.presetValue = i.preset == '(无)' ? '' : i.preset;
i.showCss = props.location.state.template.tableStyle;
i.tableName = ss;
i.uiGroup = item;
i.readOnly = i.readOnly == '是' ? 1 : 0;
i.type = '文本';
i.visible = 1;
i.colSpan = i.rowSpan;
});
aa.push({ name: item, key: index, ID: index, children: arr[item] });
arrdata.push({ groupName: item, schema: arr[item], visible: 1 });
bb.push(item);
});
console.log(aa);
flowNodeMeta.groups = arrdata;
list.flowNodeMeta = flowNodeMeta;
list.showCss = props.location.state.template.tableStyle;
console.log(list);
setAccountData(list);
console.log(arr);
console.log(newArr);
setKeepTreeFirst(bb);
......@@ -366,12 +392,16 @@ const AddModal = props => {
}
});
} else {
let ss = props.location.state.id;
setFormObj(props.location.state.id);
reloadTableFields({
tableName: props.location.state.id,
}).then(res => {
setTreeLoading(false);
if (res.msg === 'Ok') {
console.log(res.data.root);
let result = {};
// result.
let arrlist = [];
let data = {};
let listArr = [];
......@@ -392,10 +422,32 @@ const AddModal = props => {
setAllData(arr);
let aa = [];
let bb = [];
let list = {};
let arrdata = [];
let flowNodeMeta = {};
Object.keys(arr).forEach((item, index) => {
console.log(arr[item]);
arr[item].map(i => {
i.fieldName = i.name;
i.configInfo = i.config;
i.presetValue = i.preset == '(无)' ? '' : i.preset;
i.showCss = props.location.state.template.tableStyle;
i.tableName = ss;
i.uiGroup = item;
i.readOnly = i.readOnly == '是' ? 1 : 0;
i.type = '文本';
i.visible = 1;
i.colSpan = i.rowSpan;
});
aa.push({ name: item, key: index, ID: index, children: arr[item] });
arrdata.push({ groupName: item, schema: arr[item], visible: 1 });
bb.push(item);
});
flowNodeMeta.groups = arrdata;
list.flowNodeMeta = flowNodeMeta;
list.showCss = props.location.state.template.tableStyle;
console.log(list);
setAccountData(list);
console.log(aa, 'aaaaaaaaaaaaa');
console.log(arr);
console.log(newArr);
......@@ -584,6 +636,7 @@ const AddModal = props => {
setMultiOperate(true);
setTreeSelectValue(e);
console.log(e.substring(0, e.lastIndexOf('@')));
let ss = e.substring(0, e.lastIndexOf('@'));
setFormObj(e.substring(0, e.lastIndexOf('@')));
reloadTableFields({
tableName: e.substring(0, e.lastIndexOf('@')),
......@@ -613,10 +666,31 @@ const AddModal = props => {
setTableData(newArr);
let aa = [];
let bb = [];
let list = {};
let arrdata = [];
let flowNodeMeta = {};
Object.keys(arr).forEach((item, index) => {
arr[item].map(i => {
i.fieldName = i.name;
i.configInfo = i.config;
i.presetValue = i.preset == '(无)' ? '' : i.preset;
i.showCss = props.location.state.template.tableStyle;
i.tableName = ss;
i.uiGroup = item;
i.readOnly = i.readOnly == '是' ? 1 : 0;
i.type = '文本';
i.visible = 1;
i.colSpan = i.rowSpan;
});
aa.push({ name: item, key: index, ID: index, children: arr[item] });
arrdata.push({ groupName: item, schema: arr[item], visible: 1 });
bb.push(item);
});
flowNodeMeta.groups = arrdata;
list.flowNodeMeta = flowNodeMeta;
list.showCss = props.location.state.template.tableStyle;
console.log(list);
setAccountData(list);
setKeepTreeFirst(bb);
setTreeData(aa);
setSelect(newArr);
......@@ -663,6 +737,10 @@ const AddModal = props => {
setDeleteUserVisible(true);
};
const preview = () => {
setPerViewPrase(true);
};
return (
<>
<Spin tip="loading..." spinning={treeLoading}>
......@@ -697,6 +775,9 @@ const AddModal = props => {
</Button>
</div>
<div className={styles.btn}>
<Button type="primary" icon={<EyeOutlined />} onClick={preview}>
预览
</Button>
<Button type="primary" icon={<PlusSquareOutlined />} onClick={add}>
附加
</Button>
......@@ -800,6 +881,11 @@ const AddModal = props => {
callBackSubmit={onSubmit}
/>
)}
<PerviewPrase
visible={perviewPrase}
accountData={accountData}
onCancel={() => setPerViewPrase(false)}
/>
</>
);
};
......
......@@ -126,7 +126,7 @@
.btn {
display: flex;
justify-content: space-around;
width: 20rem;
width: 25rem;
}
.ant-btn {
display: flex;
......
......@@ -65,6 +65,7 @@ const GateConfig = () => {
if (res.code === 0) {
console.log(localStorage.getItem('token'));
window.globalConfig = {
...window.globalConfig,
access_token: localStorage.getItem('token'),
hasGateWay: true,
apiGatewayDomain: `${window.location.origin}${'/PandaCore/GateWay'}`,
......@@ -93,6 +94,7 @@ const GateConfig = () => {
if (res.code === 0) {
console.log(localStorage.getItem('token'));
window.globalConfig = {
...window.globalConfig,
access_token: localStorage.getItem('token'),
hasGateWay: false,
apiGatewayDomain: `${window.location.origin}`,
......
......@@ -13,6 +13,7 @@ import {
Spin,
notification,
} from 'antd';
import { ReloadOutlined } from '@ant-design/icons';
import styles from './ProxyConfig.less';
import {
GetNginxConfigInfo,
......@@ -23,7 +24,6 @@ import {
NginxCache,
NginxLog,
} from '@/services/hostmanager/hostmanager';
import { ReloadOutlined } from '@ant-design/icons';
import configuration from '../../../../assets/images/icons/消息.svg';
const layout = {
......@@ -39,6 +39,7 @@ const ProxyConfig = () => {
const [form] = Form.useForm();
const [flag, setFlag] = useState(1);
const [stop, setStop] = useState(false);
const [currentConfig, setCurrentConfig] = useState({
NginxPort: '',
IISIPProt: '',
......@@ -146,6 +147,7 @@ const ProxyConfig = () => {
// });
GetNginxConfigInfo().then(res => {
if (res.code === 0) {
setStop(false);
form.setFieldsValue({
NginxPort: res.data.NginxPort,
IISIPProt: res.data.IISIPProt,
......@@ -175,6 +177,7 @@ const ProxyConfig = () => {
// }
// form.setFieldsValue(obj);
} else {
setStop(true);
notification.error({
message: '提示',
duration: 3,
......@@ -271,7 +274,7 @@ const ProxyConfig = () => {
/^(([1-9]?\d|1\d{2}|2[0-4]\d|25[0-5])\.){3}([1-9]?\d|1\d{2}|2[0-4]\d|25[0-5])(:\d*)$/,
'g',
),
message: '请输入正确的IP例如:127.0.0.18083',
message: '请输入正确的IP例如:127.0.0.1:8083',
},
]}
>
......
......@@ -87,6 +87,7 @@ const Login = props => {
if (res.code === 0 && res.data) {
localStorage.setItem('panda-publish', 'getway');
window.globalConfig = {
...window.globalConfig,
access_token: localStorage.getItem('token'),
hasGateWay: true,
apiGatewayDomain: `${window.location.origin}${'/PandaCore/GateWay'}`,
......@@ -94,6 +95,7 @@ const Login = props => {
} else {
localStorage.setItem('panda-publish', '');
window.globalConfig = {
...window.globalConfig,
access_token: localStorage.getItem('token'),
hasGateWay: false,
apiGatewayDomain: `${window.location.origin}`,
......
......@@ -18,3 +18,6 @@ export const GetMetaDataPreview = param => get(`${PANDA_GIS}/MetaData/D_GetMetaD
// 查看图层元数据
export const GetLayerMetaDataPreview = param =>
get(`${PANDA_GIS}/MetaData/D_GetLayerMetaDataPreview`, param);
// 查看
export const LayerSetting = param => get(`${PANDA_GIS}/MapLayer/LayerSetting`, param);
......@@ -82,3 +82,6 @@ export const LoadLedgers = query =>
// 获取各类表的的默认字段集合
export const GetDefaultTableFields = query =>
get(`${PUBLISH_SERVICE}/CaseManage/GetDefaultTableFields`, query);
export const GetTableGroupMeta = param =>
get(`${PUBLISH_SERVICE}/AccountManage/GetTableGroupMeta`, param);
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