Commit 7c3020e3 authored by 张烨's avatar 张烨

feat: webconfig

parent bb93830b
...@@ -2,10 +2,20 @@ import React from 'react'; ...@@ -2,10 +2,20 @@ import React from 'react';
import { Button, Col, Drawer, Row } from 'antd'; import { Button, Col, Drawer, Row } from 'antd';
import styles from './siteConfigDrawer.less'; import styles from './siteConfigDrawer.less';
import BaseForm, { ITEM_TYPE } from '@/components/BaseForm'; import BaseForm, { ITEM_TYPE } from '@/components/BaseForm';
let form = null; let form = null;
const typeContent = hasIntegerate => {
if (hasIntegerate) {
return [];
}
return [
{
value: 'a',
children: '集成网站',
},
];
};
const defaultKeyMap = { const defaultKeyMap = ({ hasIntegerate }) => ({
title: { title: {
label: '标题', label: '标题',
formType: ITEM_TYPE.INPUT, formType: ITEM_TYPE.INPUT,
...@@ -23,6 +33,17 @@ const defaultKeyMap = { ...@@ -23,6 +33,17 @@ const defaultKeyMap = {
formType: ITEM_TYPE.INPUT, formType: ITEM_TYPE.INPUT,
allowClear: true, allowClear: true,
}, },
type: {
label: '网站类型',
formType: ITEM_TYPE.SINGLE_RADIO,
initialValue: hasIntegerate ? 'b' : 'a',
options: [
{
value: 'b',
children: '一般网站',
},
].concat(typeContent(hasIntegerate)),
},
shortcutIcon: { shortcutIcon: {
label: '图标icon', label: '图标icon',
formType: ITEM_TYPE.IMGSHOP, formType: ITEM_TYPE.IMGSHOP,
...@@ -120,19 +141,19 @@ const defaultKeyMap = { ...@@ -120,19 +141,19 @@ const defaultKeyMap = {
// qrcode: '二维码地址', // qrcode: '二维码地址',
// mapPlan: '地图方案', // mapPlan: '地图方案',
// waterMark: '地图水印', // waterMark: '地图水印',
}; });
export default props => { export default props => {
const { visible, onClose, config } = props; const { visible, onClose, config, hasIntegerate = true } = props;
const getForm = f => { const getForm = f => {
form = f; form = f;
}; };
const itemsMap = defaultKeyMap({ hasIntegerate });
const formConfig = { const formConfig = {
getForm, getForm,
items: Object.keys(defaultKeyMap).map(k => ({ items: Object.keys(itemsMap).map(k => ({
...defaultKeyMap[k], ...itemsMap[k],
dataIndex: k, dataIndex: k,
})), })),
buttons: [ buttons: [
......
...@@ -2,14 +2,13 @@ import React, { useEffect, useState } from 'react'; ...@@ -2,14 +2,13 @@ import React, { useEffect, useState } from 'react';
import { PageContainer } from '@ant-design/pro-layout'; import { PageContainer } from '@ant-design/pro-layout';
import { Tabs } from 'antd'; import { Tabs } from 'antd';
import { getWebModuleTree } from '@/services/webConfig/api'; import { getWebModuleTree } from '@/services/webConfig/api';
import menuTreeMock from '@/services/mocks/web4site';
import styles from './index.less'; import styles from './index.less';
import SiteConfig from './components/siteConfigDrawer'; import SiteConfig from './components/siteConfigDrawer';
import { appConnector } from '@/containers/App/store'; import { appConnector } from '@/containers/App/store';
const { TabPane } = Tabs; const { TabPane } = Tabs;
const getMenuTree = userMode => const getMenuTree = userMode =>
getWebModuleTree(userMode).then(res => console.log(res)); getWebModuleTree(userMode || 'super').then(res => console.log(res));
const WebConfigPage = props => { const WebConfigPage = props => {
const [configVisible, setConfigVisible] = useState(false); const [configVisible, setConfigVisible] = useState(false);
...@@ -55,6 +54,7 @@ const WebConfigPage = props => { ...@@ -55,6 +54,7 @@ const WebConfigPage = props => {
visible={configVisible} visible={configVisible}
onClose={onDrawerClose} onClose={onDrawerClose}
config={configObj} config={configObj}
hasIntegerate={false}
/> />
</div> </div>
</PageContainer> </PageContainer>
......
import sha from 'sha1'; // import sha from 'sha1';
import { CITY_SERVICE, get, post, PUBLISH_SERVICE } from '../index'; import { CITY_SERVICE, get, post, PUBLISH_SERVICE } from '../index';
export const getUserInfo = param => get('/cityinterface/getUserinfo', param); export const getUserInfo = param => get('/cityinterface/getUserinfo', param);
...@@ -9,5 +9,5 @@ export const login = param => ...@@ -9,5 +9,5 @@ export const login = param =>
export const OMSLogin = (loginName, password) => export const OMSLogin = (loginName, password) =>
post(`${PUBLISH_SERVICE}/OMSLogin`, { post(`${PUBLISH_SERVICE}/OMSLogin`, {
UserName: loginName, UserName: loginName,
PassWord: sha(password).toUpperCase(), PassWord: password, // sha(password).toUpperCase(),
}); });
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