Commit 678e7294 authored by TZW's avatar TZW

location

parent 1a2118b9
...@@ -24,7 +24,8 @@ const loginOut = async () => { ...@@ -24,7 +24,8 @@ const loginOut = async () => {
if (window.location.pathname !== '/user/login' && !redirect) { if (window.location.pathname !== '/user/login' && !redirect) {
localStorage.clear(); localStorage.clear();
history.replace(logoutRedirectUrl); // history.replace(logoutRedirectUrl);
window.location.href(logoutRedirectUrl);
} }
}; };
......
...@@ -2,7 +2,12 @@ import { doFetch } from '@/utils/doFetch'; ...@@ -2,7 +2,12 @@ import { doFetch } from '@/utils/doFetch';
import { Image } from 'antd'; import { Image } from 'antd';
import fieldsDetail from '@/utils/fieldsDetail'; import fieldsDetail from '@/utils/fieldsDetail';
import { useState, useEffect } from 'react'; import { useState, useEffect } from 'react';
function getcolumns(setdrawer, options) { function getcolumns(setdrawer, usermsg) {
console.log(usermsg);
const options = usermsg?.map((it) => ({
label: `${it?.username}-${it?.fullName}`,
value: it?.id,
}));
return [ return [
{ {
title: '用户名', title: '用户名',
...@@ -12,12 +17,18 @@ function getcolumns(setdrawer, options) { ...@@ -12,12 +17,18 @@ function getcolumns(setdrawer, options) {
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] }, formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
valueType: 'select', valueType: 'select',
options, options,
fieldProps: {
onChange: (e) => {
console.log(e);
},
},
}, },
{ {
title: '姓名', title: '姓名',
dataIndex: 'fullName', dataIndex: 'fullName',
width: 100, width: 100,
key: 'fullName', key: 'fullName',
hideInForm: true,
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] }, formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
render: (text, row) => { render: (text, row) => {
return ( return (
...@@ -104,10 +115,22 @@ function getcolumns(setdrawer, options) { ...@@ -104,10 +115,22 @@ function getcolumns(setdrawer, options) {
hideInTable: true, hideInTable: true,
dataIndex: 'telephone', dataIndex: 'telephone',
key: 'telephone', key: 'telephone',
fieldProps: {
disabled: true,
},
hideInTable: true, hideInTable: true,
search: false, search: false,
}, },
{ title: '邮箱', dataIndex: 'mailNo', key: 'mailNo', hideInTable: true, search: false }, {
title: '邮箱',
dataIndex: 'mailNo',
key: 'mailNo',
hideInTable: true,
search: false,
fieldProps: {
disabled: true,
},
},
{ {
title: '公司名称', title: '公司名称',
align: 'center', align: 'center',
...@@ -115,6 +138,7 @@ function getcolumns(setdrawer, options) { ...@@ -115,6 +138,7 @@ function getcolumns(setdrawer, options) {
width: 120, width: 120,
key: 'organizationId', key: 'organizationId',
valueType: 'select', valueType: 'select',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
options: { path: '/auth/sysDepartment/query/organization/selectbox', params: {} }, options: { path: '/auth/sysDepartment/query/organization/selectbox', params: {} },
}, },
{ {
...@@ -123,6 +147,7 @@ function getcolumns(setdrawer, options) { ...@@ -123,6 +147,7 @@ function getcolumns(setdrawer, options) {
align: 'center', align: 'center',
valueType: 'treeSelect', valueType: 'treeSelect',
dataIndex: 'departmentName', dataIndex: 'departmentName',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
key: 'departmentId', key: 'departmentId',
options: { options: {
path: '/auth/sysDepartment/query/children/tree', path: '/auth/sysDepartment/query/children/tree',
...@@ -138,7 +163,7 @@ function getcolumns(setdrawer, options) { ...@@ -138,7 +163,7 @@ function getcolumns(setdrawer, options) {
key: 'factoryNames', key: 'factoryNames',
hideInTable: true, hideInTable: true,
hideInForm: true, hideInForm: true,
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] }, formItemProps: { rules: [{ required: false, message: '此项为必填项' }] },
}, },
{ {
title: '负责车间', title: '负责车间',
...@@ -147,7 +172,7 @@ function getcolumns(setdrawer, options) { ...@@ -147,7 +172,7 @@ function getcolumns(setdrawer, options) {
align: 'center', align: 'center',
hideInTable: true, hideInTable: true,
hideInForm: true, hideInForm: true,
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] }, formItemProps: { rules: [{ required: false, message: '此项为必填项' }] },
}, },
{ {
title: '角色名称', title: '角色名称',
...@@ -268,6 +293,7 @@ function getcolumns(setdrawer, options) { ...@@ -268,6 +293,7 @@ function getcolumns(setdrawer, options) {
// hideInTable: true, // hideInTable: true,
dataIndex: 'statusName', dataIndex: 'statusName',
key: 'status', key: 'status',
fieldProps: { disabled: true },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] }, formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
valueType: 'radio', valueType: 'radio',
options: [ options: [
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44 * @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-16 10:48:21 * @Last Modified time: 2022-12-16 11:18:33
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -147,10 +147,7 @@ function User(props) { ...@@ -147,10 +147,7 @@ function User(props) {
url: '/auth/sysUser/queryLikeIotUsername', url: '/auth/sysUser/queryLikeIotUsername',
params: { username: initialState?.currentUser?.username }, params: { username: initialState?.currentUser?.username },
}); });
return res?.data?.dataList.map((it) => ({ return res?.data?.dataList;
label: `${it?.username}-${it?.fullName}`,
value: it?.id,
}));
}); });
console.log(data); console.log(data);
......
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