Commit 70fe1612 authored by Maofei94's avatar Maofei94

perf: 产品配置修改

parent 3dc3762f
Pipeline #22917 passed with stages
in 19 minutes 36 seconds
...@@ -22,6 +22,7 @@ const SiteConfig = props => { ...@@ -22,6 +22,7 @@ const SiteConfig = props => {
]); // 系统登陆页 ]); // 系统登陆页
const [styleList, setStyleList] = useState([ const [styleList, setStyleList] = useState([
{ text: '默认风格', value: 'default' }, { text: '默认风格', value: 'default' },
{ text: '熊猫风格', value: '熊猫风格' },
]); // 系统风格 ]); // 系统风格
const [themeList, setThemeList] = useState([ const [themeList, setThemeList] = useState([
{ text: '默认皮肤', value: 'default' }, { text: '默认皮肤', value: 'default' },
......
...@@ -17,6 +17,7 @@ const AddConfig = props => { ...@@ -17,6 +17,7 @@ const AddConfig = props => {
]); // 系统登陆页 ]); // 系统登陆页
const [styleList, setStyleList] = useState([ const [styleList, setStyleList] = useState([
{ text: '默认风格', value: 'default' }, { text: '默认风格', value: 'default' },
{ text: '熊猫风格', value: '熊猫风格' },
]); // 系统风格 ]); // 系统风格
const [themeList, setThemeList] = useState([ const [themeList, setThemeList] = useState([
{ text: '默认皮肤', value: 'default' }, { text: '默认皮肤', value: 'default' },
......
...@@ -17,12 +17,12 @@ const EditForm = props => { ...@@ -17,12 +17,12 @@ const EditForm = props => {
const environmentList = [ const environmentList = [
{ {
value: 'production', value: 'production',
label: '生产环境', label: '已发布',
key: 'production', key: 'production',
}, },
{ {
value: 'development', value: 'development',
label: '开发环境', label: '研发中',
key: 'development', key: 'development',
}, },
]; ];
...@@ -59,7 +59,7 @@ const EditForm = props => { ...@@ -59,7 +59,7 @@ const EditForm = props => {
<Input placeholder="请输入产品名称" allowClear disabled /> <Input placeholder="请输入产品名称" allowClear disabled />
</Item> </Item>
<Item <Item
label="产品名:" label="产品名:"
name="ProductAlias" name="ProductAlias"
// rules={[ // rules={[
// { // {
...@@ -68,20 +68,20 @@ const EditForm = props => { ...@@ -68,20 +68,20 @@ const EditForm = props => {
// }, // },
// ]} // ]}
> >
<Input placeholder="请输入产品别名" allowClear /> <Input placeholder="请输入产品包名:" allowClear />
</Item> </Item>
<Item <Item
label="产品环境:" label="发布状态:"
name="Environment" name="Environment"
rules={[ rules={[
{ {
required: true, required: true,
message: '请选择产品环境', message: '请选择发布状态:',
}, },
]} ]}
> >
<Select placeholder="请选择产品环境"> <Select placeholder="请选择发布状态:">
{environmentList && {environmentList &&
environmentList.map(item => ( environmentList.map(item => (
<Option value={item.value} key={item.key}> <Option value={item.value} key={item.key}>
...@@ -91,16 +91,16 @@ const EditForm = props => { ...@@ -91,16 +91,16 @@ const EditForm = props => {
</Select> </Select>
</Item> </Item>
<Item <Item
label="入口url" label="访问路由"
name="StartUrl" name="StartUrl"
rules={[ rules={[
{ {
required: true, required: true,
message: '请输入入口url', message: '请输入访问路由',
}, },
]} ]}
> >
<Input addonBefore="//" placeholder="请输入入口url" allowClear /> <Input addonBefore="//" placeholder="请输入访问路由" allowClear />
</Item> </Item>
<Item <Item
label="默认配置" label="默认配置"
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Card, List, Drawer, Button, Empty, Spin, notification } from 'antd'; import {
Card,
List,
Drawer,
Button,
Empty,
Spin,
notification,
Switch,
} from 'antd';
import { import {
modifyProduct, modifyProduct,
getProductList, getProductList,
...@@ -95,6 +104,9 @@ const ProductConfig = props => { ...@@ -95,6 +104,9 @@ const ProductConfig = props => {
console.log(err); console.log(err);
}); });
}; };
const handleSwitchClick = (e, id) => {
console.log(e, id);
};
const renderListItem = arr => const renderListItem = arr =>
arr.map(item => ( arr.map(item => (
<List.Item <List.Item
...@@ -105,7 +117,18 @@ const ProductConfig = props => { ...@@ -105,7 +117,18 @@ const ProductConfig = props => {
})} })}
onClick={() => setProductObt(item)} onClick={() => setProductObt(item)}
> >
{item.ProductName} <Switch
// size="small"
defaultChecked={!item.checked}
checkedChildren="启用"
unCheckedChildren="关闭"
onClick={e => {
handleSwitchClick(e, item.Id);
}}
/>
<span className={classnames({ [styles.itemspan]: true })}>
{item.ProductName}
</span>
</List.Item> </List.Item>
)); ));
return ( return (
...@@ -114,9 +137,9 @@ const ProductConfig = props => { ...@@ -114,9 +137,9 @@ const ProductConfig = props => {
<Card className={classnames(`${styles.leftList}`)}> <Card className={classnames(`${styles.leftList}`)}>
<div className={styles.listTop}> <div className={styles.listTop}>
产品选择: 产品选择:
<Button type="primary" onClick={handleAdd}> {/* <Button type="primary" onClick={handleAdd}>
新增 新增
</Button> </Button> */}
{/* <Button type="primary" danger onClick={handleDel}> {/* <Button type="primary" danger onClick={handleDel}>
删除 删除
</Button> */} </Button> */}
......
...@@ -23,6 +23,12 @@ ...@@ -23,6 +23,12 @@
padding-left: 5px; padding-left: 5px;
cursor: pointer; cursor: pointer;
font-size: 14px; font-size: 14px;
display: flex;
align-items: center;
justify-content: flex-start;
.itemspan{
margin-left: 10px;
}
} }
.listItem:hover{ .listItem:hover{
background-color: #f8f8f8 ; background-color: #f8f8f8 ;
......
...@@ -185,26 +185,26 @@ export const getDefaultGetWebconfig = ({ ...@@ -185,26 +185,26 @@ export const getDefaultGetWebconfig = ({
}, },
], ],
}, },
product: { // product: {
label: '产品类型', // label: '产品类型',
formType: ITEM_TYPE.SELECT, // formType: ITEM_TYPE.SELECT,
placeholder: '请选择产品类型', // placeholder: '请选择产品类型',
options: products.map(t => ({ // options: products.map(t => ({
value: t.ProductName, // value: t.ProductName,
children: t.ProductAlias, // children: t.ProductAlias,
key: t.Id, // key: t.Id,
})), // })),
onDropdownVisibleChange: onGetProduct, // onDropdownVisibleChange: onGetProduct,
showSearch: false, // showSearch: false,
filterOption: (input, option) => // filterOption: (input, option) =>
option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0, // option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
rules: [ // rules: [
{ // {
required: false, // required: false,
message: '产品类型必填', // message: '产品类型必填',
}, // },
], // ],
}, // },
theme: { theme: {
label: '系统皮肤', label: '系统皮肤',
formType: ITEM_TYPE.SELECT, formType: ITEM_TYPE.SELECT,
......
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