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

fix: '接入parseForm组件'

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