Commit d0ebbcde authored by Maofei94's avatar Maofei94

feat: 产品配置

parent 65381607
Pipeline #21948 skipped with stages
...@@ -14,16 +14,16 @@ const EditForm = props => { ...@@ -14,16 +14,16 @@ const EditForm = props => {
wrapperCol: { span: 15 }, wrapperCol: { span: 15 },
}; };
const environmentList = [ const environmentList = [
{
value: 'development',
label: 'development',
key: 'development',
},
{ {
value: 'production', value: 'production',
label: 'production', label: '生产环境',
key: 'production', key: 'production',
}, },
{
value: 'development',
label: '开发环境',
key: 'development',
},
]; ];
useEffect(() => { useEffect(() => {
form.setFieldsValue({ ...productObj }); form.setFieldsValue({ ...productObj });
...@@ -44,35 +44,36 @@ const EditForm = props => { ...@@ -44,35 +44,36 @@ const EditForm = props => {
<div style={{ minHeight: 'calc(100vh - 252px)', marginTop: '20px' }}> <div style={{ minHeight: 'calc(100vh - 252px)', marginTop: '20px' }}>
<Form form={form} name="formEdit" {...layout} onFinish={finished}> <Form form={form} name="formEdit" {...layout} onFinish={finished}>
<Item <Item
label="应用环境:" label="产品名称:"
name="Environment" name="ProductName"
rules={[ rules={[
{ {
required: true, required: true,
message: '请选择应用环境', message: '请输入产品名称',
}, },
]} ]}
> >
<Select placeholder="请选择应用环境"> <Input placeholder="请输入产品名称" allowClear />
{environmentList &&
environmentList.map(item => (
<Option value={item.value} key={item.key}>
{item.label}
</Option>
))}
</Select>
</Item> </Item>
<Item <Item
label="应用名称:" label="产品环境:"
name="ProductName" name="Environment"
rules={[ rules={[
{ {
required: true, required: true,
message: '请输入应用名称', message: '请选择产品环境',
}, },
]} ]}
> >
<Input placeholder="请输入应用名称" allowClear /> <Select placeholder="请选择产品环境">
{environmentList &&
environmentList.map(item => (
<Option value={item.value} key={item.key}>
{item.label}
</Option>
))}
</Select>
</Item> </Item>
<Item <Item
label="入口url" label="入口url"
...@@ -84,7 +85,7 @@ const EditForm = props => { ...@@ -84,7 +85,7 @@ const EditForm = props => {
}, },
]} ]}
> >
<Input addonBefore="://" placeholder="请输入入口url" allowClear /> <Input addonBefore="//" placeholder="请输入入口url" allowClear />
</Item> </Item>
<Item <Item
label="默认配置" label="默认配置"
...@@ -107,7 +108,7 @@ const EditForm = props => { ...@@ -107,7 +108,7 @@ const EditForm = props => {
提交 提交
</Button> </Button>
</Item> </Item>
<Item wrapperCol={{ span: 8, offset: 8 }}> {/* <Item wrapperCol={{ span: 8, offset: 8 }}>
<Popconfirm <Popconfirm
title="确实删除产品" title="确实删除产品"
placement="right" placement="right"
...@@ -119,7 +120,7 @@ const EditForm = props => { ...@@ -119,7 +120,7 @@ const EditForm = props => {
删除 删除
</Button> </Button>
</Popconfirm> </Popconfirm>
</Item> </Item> */}
</div> </div>
</Form> </Form>
</div> </div>
......
...@@ -14,16 +14,16 @@ const AddForm = props => { ...@@ -14,16 +14,16 @@ const AddForm = props => {
wrapperCol: { span: 16 }, wrapperCol: { span: 16 },
}; };
const environmentList = [ const environmentList = [
{
value: 'development',
label: 'development',
key: 'development',
},
{ {
value: 'production', value: 'production',
label: 'production', label: '生产环境',
key: 'production', key: 'production',
}, },
{
value: 'development',
label: '开发环境',
key: 'development',
},
]; ];
// 提交选择 // 提交选择
const submit = value => {}; const submit = value => {};
...@@ -59,35 +59,35 @@ const AddForm = props => { ...@@ -59,35 +59,35 @@ const AddForm = props => {
<div style={{ minHeight: 'calc(100vh - 252px)', marginTop: '20px' }}> <div style={{ minHeight: 'calc(100vh - 252px)', marginTop: '20px' }}>
<Form form={form} name="formAdd" {...layout} onFinish={finished}> <Form form={form} name="formAdd" {...layout} onFinish={finished}>
<Item <Item
label="应用环境:" label="产品名称:"
name="Environment" name="ProductName"
rules={[ rules={[
{ {
required: true, required: true,
message: '请选择应用环境', message: '请输入产品名称',
}, },
]} ]}
> >
<Select placeholder="请选择应用环境"> <Input placeholder="请输入产品名称" allowClear />
{environmentList &&
environmentList.map(item => (
<Option value={item.value} key={item.key}>
{item.label}
</Option>
))}
</Select>
</Item> </Item>
<Item <Item
label="应用名称:" label="产品环境:"
name="ProductName" name="Environment"
rules={[ rules={[
{ {
required: true, required: true,
message: '请输入应用名称', message: '请选择产品环境',
}, },
]} ]}
> >
<Input placeholder="请输入应用名称" allowClear /> <Select placeholder="请选择产品环境">
{environmentList &&
environmentList.map(item => (
<Option value={item.value} key={item.key}>
{item.label}
</Option>
))}
</Select>
</Item> </Item>
<Item <Item
label="入口url" label="入口url"
...@@ -99,7 +99,7 @@ const AddForm = props => { ...@@ -99,7 +99,7 @@ const AddForm = props => {
}, },
]} ]}
> >
<Input addonBefore="://" placeholder="请输入入口url" allowClear /> <Input addonBefore="//" placeholder="请输入入口url" allowClear />
</Item> </Item>
<Item <Item
label="默认配置" label="默认配置"
......
...@@ -5,6 +5,7 @@ import PicturesWall from '@/components/Upload/index'; ...@@ -5,6 +5,7 @@ import PicturesWall from '@/components/Upload/index';
import EditeConfigWrapper from './editConfigFileWrapper'; import EditeConfigWrapper from './editConfigFileWrapper';
const { Item } = Form; const { Item } = Form;
const { Option } = Select;
const AddForm = props => { const AddForm = props => {
const { const {
submitCallback, submitCallback,
...@@ -12,6 +13,7 @@ const AddForm = props => { ...@@ -12,6 +13,7 @@ const AddForm = props => {
addType, addType,
submitLoading, submitLoading,
configFiles, configFiles,
productList,
} = props; } = props;
const [form] = Form.useForm(); const [form] = Form.useForm();
const [otherForm] = Form.useForm(); const [otherForm] = Form.useForm();
...@@ -59,6 +61,25 @@ const AddForm = props => { ...@@ -59,6 +61,25 @@ const AddForm = props => {
<Item label="菜单别名" name="shortName"> <Item label="菜单别名" name="shortName">
<Input placeholder="请输入菜单别名" /> <Input placeholder="请输入菜单别名" />
</Item> </Item>
<Item
label="产品类型:"
name="product"
rules={[
{
required: true,
message: '请选择产品类型',
},
]}
>
<Select placeholder="请选择产品类型">
{productList &&
productList.map(item => (
<Option value={item.ProductName} key={item.Id}>
{item.ProductName}
</Option>
))}
</Select>
</Item>
<Item <Item
label="菜单图标" label="菜单图标"
name="imageUrl" name="imageUrl"
......
...@@ -13,6 +13,7 @@ const EditForm = props => { ...@@ -13,6 +13,7 @@ const EditForm = props => {
info, info,
configFiles, configFiles,
valueCallback = () => {}, valueCallback = () => {},
productList,
} = props; } = props;
const [form] = Form.useForm(); const [form] = Form.useForm();
const [otherForm] = Form.useForm(); const [otherForm] = Form.useForm();
...@@ -70,6 +71,25 @@ const EditForm = props => { ...@@ -70,6 +71,25 @@ const EditForm = props => {
<Item label="菜单别名" name="shortName"> <Item label="菜单别名" name="shortName">
<Input placeholder="请输入菜单别名" /> <Input placeholder="请输入菜单别名" />
</Item> </Item>
<Item
label="产品类型:"
name="product"
rules={[
{
required: true,
message: '请选择产品类型',
},
]}
>
<Select placeholder="请选择产品类型">
{productList &&
productList.map(item => (
<Option value={item.ProductName} key={item.Id}>
{item.ProductName}
</Option>
))}
</Select>
</Item>
<Item <Item
label="菜单图标" label="菜单图标"
name="imageUrl" name="imageUrl"
......
...@@ -19,6 +19,7 @@ import { ...@@ -19,6 +19,7 @@ import {
editWebMenu, // 改 editWebMenu, // 改
getWebMenuInfo, // 查 getWebMenuInfo, // 查
dragMenu, // 菜单拖拽 dragMenu, // 菜单拖拽
getProductList,
} from '@/services/webConfig/api'; } from '@/services/webConfig/api';
const MiniMenu = props => { const MiniMenu = props => {
...@@ -38,6 +39,7 @@ const MiniMenu = props => { ...@@ -38,6 +39,7 @@ const MiniMenu = props => {
const [modalLoading, setModalLoading] = useState(false); const [modalLoading, setModalLoading] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false); const [submitLoading, setSubmitLoading] = useState(false);
const [newTreeList, setNewTreeList] = useState([]); const [newTreeList, setNewTreeList] = useState([]);
const [productList, setProductList] = useState([]);
/* ***************************************************** */ /* ***************************************************** */
const [curMenuType, setCurMenuType] = useState(''); const [curMenuType, setCurMenuType] = useState('');
...@@ -46,6 +48,14 @@ const MiniMenu = props => { ...@@ -46,6 +48,14 @@ const MiniMenu = props => {
useEffect(() => { useEffect(() => {
getInfo(); getInfo();
}, [menuID]); }, [menuID]);
useEffect(() => {
getProductList().then(res => {
const { code, data } = res;
if (code === 0) {
setProductList(data);
}
});
}, []);
useEffect(() => { useEffect(() => {
console.log(menu, 'menu'); console.log(menu, 'menu');
...@@ -439,6 +449,7 @@ const MiniMenu = props => { ...@@ -439,6 +449,7 @@ const MiniMenu = props => {
configFiles={configFiles} configFiles={configFiles}
submitCallback={submitCallback} submitCallback={submitCallback}
submitLoading={submitLoading} submitLoading={submitLoading}
productList={productList}
/> />
</Modal> </Modal>
<Modal <Modal
...@@ -459,6 +470,7 @@ const MiniMenu = props => { ...@@ -459,6 +470,7 @@ const MiniMenu = props => {
nodeObj={nodeObj} nodeObj={nodeObj}
configFiles={configFiles} configFiles={configFiles}
addType={addType} addType={addType}
productList={productList}
submitCallback={submitCallback} submitCallback={submitCallback}
/> />
</Modal> </Modal>
...@@ -489,6 +501,7 @@ const MiniMenu = props => { ...@@ -489,6 +501,7 @@ const MiniMenu = props => {
nodeType={nodeType} nodeType={nodeType}
info={info} info={info}
configFiles={configFiles} configFiles={configFiles}
productList={productList}
submitCallback={editSubmitCallback} submitCallback={editSubmitCallback}
valueCallback={valueCallback} valueCallback={valueCallback}
/> />
......
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