Commit 0e5f7bb5 authored by 皮倩雯's avatar 皮倩雯

fix: '修复产品授权接口调用三次bug,web配置,moblie配置覆盖导入强提醒'

parent 2fbb33e6
Pipeline #82825 failed with stages
......@@ -105,6 +105,10 @@ iframe {
}
}
.ant-popover-message {
display: flex;
}
.ant-table-cell {
overflow: hidden;
white-space: nowrap;
......
......@@ -3,6 +3,8 @@ import { Modal, Upload, Button, Form, Input, message, Popconfirm } from 'antd';
import { UploadOutlined, DownloadOutlined } from '@ant-design/icons';
import { UpLoadWebModuleTree, DownLoadWebModuleTree } from '@/services/webConfig/api';
import icon from '@/assets/images/common/警告.png';
import styles from './ImportOrExport.less';
const ImportOrExport = props => {
const { visible, onFinish, onCancel, nodeObj, subSystemValue } = props;
......@@ -101,13 +103,23 @@ const ImportOrExport = props => {
增量导入
</Button>
<Popconfirm
overlayClassName={styles.ImportOrExport}
title={
<span>
<span style={{ color: 'red' }}>
导入操作会覆盖所有菜单配置并且使
<br />
角色菜单权限失效是否继续导入?
</span>
}
icon={
<img
src={icon}
alt=""
width="18px"
height="18px"
style={{ marginTop: '3px' }}
/>
}
onConfirm={() => handleUpload(1)}
onVisibleChange={() => console.log('visible change')}
>
......@@ -116,6 +128,8 @@ const ImportOrExport = props => {
style={{
marginLeft: '10px',
display: nodeObj ? 'none' : 'block',
backgroundColor: '#ff8f18',
borderColor: '#ff8f18',
}}
>
覆盖导入
......
.ImportOrExport {
.ant-popover-message-title {
padding-left: 12px;
}
}
import React, { useState, useEffect } from 'react';
import { Form, Select, Input, Button, Popconfirm, Spin } from 'antd';
import { modifyProduct, getProductList } from '@/services/webConfig/api';
import { Form, Select, Input, Button } from 'antd';
const { Item } = Form;
const { Option } = Select;
const { TextArea } = Input;
const EditForm = props => {
const { productObj, editCallback, handleDel, userProductsList } = props;
const [config, setConfig] = useState(''); // 网站配置信息
const [loading, setLoading] = useState(false);
const [but, setBut] = useState(false);
const [form] = Form.useForm();
const layout = {
......@@ -28,56 +25,24 @@ const EditForm = props => {
},
];
useEffect(() => {
getProductList().then(res => {
const { code } = res;
if (code === 0) {
const {
data: { AllProducts, UserProducts },
} = res;
console.log(UserProducts);
console.log(productObj);
let aa = UserProducts.find(i => i.ProductName == productObj.ProductName);
if (productObj) {
let aa = userProductsList.find(i => i.ProductName == productObj.ProductName);
getData(aa);
}
});
}, [productObj]);
const getData = aa => {
if (!productObj.IsUsed) {
console.log(12);
setBut(true);
form.setFieldsValue({ ...productObj });
if (aa) {
form.setFieldsValue({ DefaultSetting: aa.DefaultSetting, RouteUrl: aa.RouteUrl });
}
} else {
console.log(34);
setBut(false);
}
form.setFieldsValue({ ...productObj });
if (aa) {
form.setFieldsValue({ DefaultSetting: aa.DefaultSetting, RouteUrl: aa.RouteUrl });
}
}
};
// useEffect(() => {
// if (!productObj.IsUsed) {
// console.log(12);
// setBut(true);
// form.setFieldsValue({ ...productObj });
// // if (aa) {
// // form.setFieldsValue({ DefaultSetting: aa.DefaultSetting });
// // }
// } else {
// console.log(34);
// setBut(false);
// form.setFieldsValue({ ...productObj });
// // if (aa) {
// // form.setFieldsValue({ DefaultSetting: aa.DefaultSetting });
// // }
// }
// }, [productObj]);
// 提交选择
const submit = value => {};
// 提交
const finished = value => {
let params = {
......@@ -87,59 +52,18 @@ const EditForm = props => {
editCallback(params);
};
return (
<Spin spinning={loading} tip="loading...">
{/* <div style={{ marginLeft: '5%', marginTop: '-5px' }}>配置详情</div> */}
<div style={{ minHeight: 'calc(100vh - 252px)', marginTop: '35px' }}>
<Form form={form} name="formEdit" {...layout} onFinish={finished}>
<Item
label="产品包名:"
name="PackageName"
// rules={[
// {
// required: true,
// pattern: new RegExp(/^[a-z0-9A-Z]+$/),
// message: '产品包名必须是英文或者数字',
// },
// ]}
>
<Item label="产品包名:" name="PackageName">
<Input placeholder="请输入产品包名" allowClear disabled />
</Item>
<Item
label="产品名称:"
name="ProductName"
// rules={[
// {
// required: true,
// pattern: new RegExp(/^[a-z0-9A-Z]+$/),
// message: '产品名称必须是英文或者数字',
// },
// ]}
>
<Item label="产品名称:" name="ProductName">
<Input placeholder="请输入产品名称" allowClear disabled />
</Item>
<Item
label="产品说明:"
name="Description"
// rules={[
// {
// required: true,
// pattern: new RegExp(/^[a-z0-9A-Z]+$/),
// message: '产品名称必须是英文或者数字',
// },
// ]}
>
<Item label="产品说明:" name="Description">
<Input placeholder="请输入产品说明" disabled />
</Item>
<Item
label="发布状态:"
name="PublishState"
// rules={[
// {
// required: true,
// message: '请选择发布状态',
// },
// ]}
>
<Item label="发布状态:" name="PublishState">
<Select placeholder="请选择发布状态" disabled>
{environmentList &&
environmentList.map(item => (
......@@ -163,7 +87,6 @@ const EditForm = props => {
},
]}
>
{/* <Input addonBefore="//" placeholder="请输入访问路由" allowClear /> */}
<Input placeholder="请输入访问路由,ip加端口号,示例//localhost:3001" allowClear />
</Item>
......@@ -191,23 +114,9 @@ const EditForm = props => {
提交
</Button>
</Item>
{/* <Item wrapperCol={{ span: 8, offset: 8 }}>
<Popconfirm
title="确实删除产品"
placement="right"
okText="确认"
cancelText="取消"
onConfirm={handleDel}
>
<Button type="primary" danger>
删除
</Button>
</Popconfirm>
</Item> */}
</div>
</Form>
</div>
</Spin>
);
};
export default EditForm;
......@@ -19,43 +19,6 @@ const ProductConfig = props => {
const [flag, setFlag] = useState(1);
const [list, setList] = useState(new Set());
const [keepData, setKeepData] = useState(false);
// 默认展示第一项
// useEffect(() => {
// setLoading(true);
// getProductList()
// .then(res => {
// const { code } = res;
// if (code === 0) {
// const {
// data: { AllProducts, UserProducts },
// } = res;
// // setProductList(AllProducts);
// setUserProductsList(UserProducts);
// setProductObj(AllProducts[0]);
// AllProducts.map(i => {
// list.add(i.ProductType);
// });
// let a = [];
// list.map(i => {
// a.push(i);
// });
// let aa = [];
// a.map((i, j) => {
// let ad = [];
// AllProducts.map(k => {
// if (k.ProductType == i) {
// ad.push(k);
// }
// });
// aa.push(ad);
// });
// setProductList(aa);
// }
// })
// .finally(() => {
// setLoading(false);
// });
// }, []);
useEffect(() => {
setLoading(true);
......
......@@ -3,6 +3,8 @@ import { Modal, Upload, Button, Form, Input, message, Popconfirm } from 'antd';
import { UploadOutlined, DownloadOutlined } from '@ant-design/icons';
import { UpLoadWebModuleTree, DownLoadWebModuleTree } from '@/services/webConfig/api';
import icon from '@/assets/images/common/警告.png';
import styles from './ImportOrExport.less';
const ImportOrExport = props => {
const { visible, onFinish, onCancel, nodeObj, subSystemValue } = props;
......@@ -100,13 +102,23 @@ const ImportOrExport = props => {
增量导入
</Button>
<Popconfirm
overlayClassName={styles.ImportOrExport}
title={
<span>
导入操作会覆盖所有菜单配置并且使
<span style={{ color: 'red' }}>
覆盖导入操作会覆盖所有菜单配置并使
<br />
角色菜单权限失效是否继续导入?
角色菜单权限失效!!!是否继续导入?
</span>
}
icon={
<img
src={icon}
alt=""
width="18px"
height="18px"
style={{ marginTop: '3px' }}
/>
}
onConfirm={() => handleUpload(1)}
onVisibleChange={() => console.log('visible change')}
>
......@@ -115,6 +127,8 @@ const ImportOrExport = props => {
style={{
marginLeft: '10px',
display: nodeObj ? 'none' : 'block',
backgroundColor: '#ff8f18',
borderColor: '#ff8f18',
}}
>
覆盖导入
......
.ImportOrExport {
.ant-popover-message-title {
padding-left: 12px;
}
}
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