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