Commit d0ebbcde authored by Maofei94's avatar Maofei94

feat: 产品配置

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