Commit c5e4c28c authored by TZW's avatar TZW

1215

parent b86ffb0b
......@@ -48,11 +48,12 @@ export async function getInitialState() {
message.error(res.msg);
}
return undefined;
}; // 如果是登录页面,不执行
};
// 如果是登录页面,不执行
if (history.location.pathname !== loginPath && token) {
const currentUserData = await fetchUserInfo();
let menuData;
if (currentUserData?.data?.userName) {
if (currentUserData?.data?.username) {
menuData = await getmenuData();
}
/* isdev */
......@@ -144,23 +145,23 @@ export const layout = ({ initialState, setInitialState }) => {
//console.log(initialState);
let lastArr = initialState?.newMenu?.userHavePermList
? JSON.parse(JSON.stringify(initialState?.newMenu?.userHavePermList))
: [],
newArr = [
// {
// path: '/welcome',
// name: '首页',
// icon: 'smile',
// component: './Welcome',
// haveChildren: false,
// key: '000000',
// parentKey: '0',
// routes: [],
// children: null,
// title: null,
// },
].concat(lastArr);
: [];
// newArr = [
// // {
// // path: '/welcome',
// // name: '首页',
// // icon: 'smile',
// // component: './Welcome',
// // haveChildren: false,
// // key: '000000',
// // parentKey: '0',
// // routes: [],
// // children: null,
// // title: null,
// // },
// ].concat(lastArr);
return newArr.map((item, index) => {
return lastArr.map((item, index) => {
if (item.icon) {
const icon = strToHump(item.icon),
ItemIcon = Ant4Icons[icon];
......
......@@ -191,7 +191,7 @@ const AvatarDropdown = ({ menu }) => {
</Avatar>
<span className={`${styles.name} anticon`} style={{ margin: '0 12px' }}>
{currentUser.userName}
{currentUser.username}
</span>
</span>
</HeaderDropdown>
......
......@@ -23,8 +23,8 @@ function strToHump(str) {
let CardItems = (datav, i, getstar, addHistory) => {
let name = datav.name,
collected = datav.isExist == '1',
icon = strToHump(datav.icon),
ItemIcon = Ant4Icons[icon];
icon = datav.icon ? strToHump(datav.icon) : 'ToolOutlined',
ItemIcon = icon ? Ant4Icons[icon] : Ant4Icons['ToolOutlined'];
return (
<div
key={i}
......@@ -141,8 +141,8 @@ function SiderMenu({ logo, collapsed, onCollapse, fixSiderbar, theme, isMobile,
const collectList = useMemo(() => {
return collectPerm.map((item, i) => {
const icon = strToHump(item.icon),
ItemIcon = Ant4Icons[icon];
const icon = item.icon ?? strToHump(item.icon),
ItemIcon = icon ? Ant4Icons[icon] : Ant4Icons.ToolOutlined;
return {
key: item.path,
icon: <ItemIcon />,
......@@ -316,8 +316,8 @@ function SiderMenu({ logo, collapsed, onCollapse, fixSiderbar, theme, isMobile,
<div className={styles.column}>
{getMenuData &&
filterMenu(getMenuData, search).map((item, i) => {
const icon = strToHump(item.icon),
ItemIcon = Ant4Icons[icon];
const icon = item.icon ?? strToHump(item.icon),
ItemIcon = icon ? Ant4Icons[icon] : Ant4Icons['ToolOutlined'];
return (
<div className={styles.item} key={i}>
<h2
......@@ -341,8 +341,8 @@ function SiderMenu({ logo, collapsed, onCollapse, fixSiderbar, theme, isMobile,
<div className={styles.rt}>
{getMenuData &&
getMenuData.map((item, i) => {
const icon = strToHump(item.icon),
ItemIcon = Ant4Icons[icon];
const icon = item.icon ?? strToHump(item.icon),
ItemIcon = icon ? Ant4Icons[icon] : Ant4Icons['ToolOutlined'];
return (
<p
className={styles.rtcarditem}
......
......@@ -36,6 +36,15 @@ function getcolumns(setdrawer) {
fieldProps: {
disabled: true,
},
search: false,
},
{
title: '数据类型',
dataIndex: 'dataTypeName',
key: 'dataType',
valueType: 'input',
hideInForm: true,
hideInTable: true,
},
{
title: '描述',
......
function getcolumns(setdrawer) {
function getcolumns(ifs) {
return [
{
title: '表单名称',
......@@ -37,6 +37,9 @@ function getcolumns(setdrawer) {
title: '字段类型',
dataIndex: 'fieldCharName',
key: 'fieldChar',
fieldProps: {
disabled: ifs,
},
formItemProps: {
rules: [
{
......@@ -71,11 +74,14 @@ function getcolumns(setdrawer) {
formItemProps: {
rules: [
{
required: false,
required: true,
message: '此项为必填项',
},
],
},
fieldProps: {
disabled: ifs,
},
hideInForm: {
fieldChar: ['1'],
},
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-10 09:39:56
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-28 16:41:55
* @Last Modified time: 2022-12-15 16:06:11
*/
import * as React from 'react';
......@@ -71,6 +71,7 @@ function Field(props) {
...s,
visible: true,
title: '编辑',
fields: getcolumns(true),
val: 'edit',
// detailpath: urlParams.detail,
// params: { id: row.id },
......@@ -219,6 +220,7 @@ function Field(props) {
},
title: '新增',
val: 'add',
fields: getcolumns(false),
onFinish: async (vals) => {
//console.log(vals);
let params = {
......
......@@ -34,7 +34,7 @@ export function queryCurrentUser(params) {
//获取菜单/权限/菜单/公司类型
export function getMenu(params) {
return request(`/ngic-auth/sysPermission/queryMenu`, {
return request(`/emspro/auth/sysPermission/queryMenu`, {
method: 'POST',
data: params,
});
......
......@@ -88,7 +88,7 @@ export async function sectionSelectByShops(params) {
}
//授权前查询权限树
export async function roleTree(params) {
return request(`/emspro/auth/sysRolePermission/queryAll`, {
return request(`/auth/sysRolePermission/queryAll`, {
method: 'POST',
data: params,
});
......
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