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

feat: webconfig

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