Commit e51dea1e authored by 皮倩雯's avatar 皮倩雯

fix: '授权修复'

parent fa8bf5b9
Pipeline #78897 passed with stages
import React, { useState, useEffect } from 'react';
import { Card, List, Empty, Spin, notification, Switch } from 'antd';
import { modifyProduct, getProductList, delProductList } from '@/services/webConfig/api';
import { Card, List, Empty, Spin, notification, Switch, Button } from 'antd';
import {
modifyProduct,
getProductList,
delProductList,
ProductRepair,
} from '@/services/webConfig/api';
import classnames from 'classnames';
import { ToolOutlined } from '@ant-design/icons';
import EditForm from './components/editForm';
import styles from './productConfig.less';
......@@ -61,11 +67,8 @@ const ProductConfig = props => {
data: { AllProducts, UserProducts },
} = res;
// setProductList(AllProducts);
console.log(res.data.IsAuthorize);
setKeepData(res.data.IsAuthorize);
setUserProductsList(UserProducts);
console.log(UserProducts);
console.log(userProductsList);
if (!productObj && AllProducts.length > 0) {
setProductObj(AllProducts[0]);
}
......@@ -74,7 +77,6 @@ const ProductConfig = props => {
list.add(i.ProductType);
});
let a = [];
console.log(list, 'listsss');
[...list].map(i => {
a.push(i);
});
......@@ -219,11 +221,42 @@ const ProductConfig = props => {
))}
</div>
);
const repair = () => {
setLoading(true);
ProductRepair().then(res => {
setLoading(false);
if (res.code === 0) {
setFlag(flag + 1);
notification.success({
message: '提示',
description: '修复成功',
duration: 3,
});
} else {
notification.error({
message: '提示',
description: res.msg,
duration: 3,
});
}
});
};
return (
<Spin spinning={loading} tip="loading...">
<div className={styles.box}>
<Card className={classnames(`${styles.leftList}`)}>
<div className={styles.listTop}>可用产品:</div>
<div className={styles.listTop}>
<div>可用产品:</div>
<Button
onClick={() => {
repair();
}}
>
<ToolOutlined />
修复授权
</Button>
</div>
<div style={{ height: 'calc(100% - 50px)', overflow: 'scroll' }}>
{productList && productList.length > 0 ? (
productList.map(item => renderListItem(item))
......
......@@ -341,3 +341,5 @@ export const SortScheme = param => get(`${PANDA_GIS}/MapLayer/SortScheme`, param
export const SortSchemePost = param => post(`${PANDA_GIS}/MapLayer/SortSchemePost`, param);
export const GetUserName = param => get(`${PUBLISH_SERVICE}/UserCenter/GetUserName`, param);
export const ProductRepair = param => get(`${PUBLISH_SERVICE}/DBManager/ProductRepair`, param);
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