Commit c5e4c28c authored by TZW's avatar TZW

1215

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