Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ems3.3
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wuhao
ems3.3
Commits
2e168ae0
Commit
2e168ae0
authored
Nov 09, 2022
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2022.11.9
parent
b3a18d30
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
278 additions
and
1156 deletions
+278
-1156
authRoutes.js
config/authRoutes.js
+32
-15
defaultSettings.js
config/defaultSettings.js
+3
-3
routes.js
config/routes.js
+2
-0
app.jsx
src/app.jsx
+14
-2
global.less
src/global.less
+34
-10
index.jsx
src/pages/Test/index.jsx
+0
-163
Welcome.jsx
src/pages/Welcome.jsx
+2
-535
columns.js
src/pages/setting/factory/columns.js
+6
-1
index.jsx
src/pages/setting/factory/index.jsx
+68
-17
columns.js
src/pages/setting/section/columns.js
+17
-97
index.jsx
src/pages/setting/section/index.jsx
+41
-13
columns.js
src/pages/setting/workshop/columns.js
+14
-97
index.jsx
src/pages/setting/workshop/index.jsx
+44
-14
columns.js
src/pages/zll/columns.js
+0
-32
index.jsx
src/pages/zll/index.jsx
+0
-146
tablist.js
src/pages/zll/tablist.js
+0
-10
request.js
src/utils/request.js
+1
-1
No files found.
config/authRoutes.js
View file @
2e168ae0
export
default
[
{
"path"
:
"/welcome"
,
"name"
:
"欢迎"
,
"icon"
:
"smile"
,
"component"
:
"./Welcome"
},
{
"name"
:
"表格"
,
"icon"
:
"table"
,
"path"
:
"/system"
,
"routes"
:
[{
"name"
:
"表格列表"
,
"path"
:
"/system/staff"
,
"unkeepalive"
:
true
,
"component"
:
"./Welcome"
},
{
"name"
:
"测试"
,
"path"
:
"/system/jiagou"
,
"component"
:
"./Test"
},
{
"component"
:
"./404"
}]
},
{
"name"
:
"左玲玲"
,
"path"
:
"/zll"
,
"icon"
:
"eye"
,
"component"
:
"./zll"
},
{
path
:
'/welcome'
,
name
:
'欢迎'
,
icon
:
'smile'
,
component
:
'./Welcome'
},
{
"name"
:
"基础设置"
,
"icon"
:
"setting"
,
"path"
:
"/setting"
,
"routes"
:
[
name
:
'基础设置'
,
icon
:
'setting'
,
path
:
'/setting'
,
routes
:
[
{
"name"
:
"工厂管理"
,
"path"
:
"/setting/factory"
,
"component"
:
"./setting/factory"
}
]
}
name
:
'用户管理'
,
path
:
'/setting/users'
,
component
:
'./setting/users'
,
},
{
name
:
'角色管理'
,
path
:
'/setting/role'
,
component
:
'./setting/role'
,
},
{
name
:
'组织管理'
,
path
:
'/setting/organization'
,
component
:
'./setting/organization'
,
},
{
name
:
'工厂管理'
,
path
:
'/setting/factory'
,
component
:
'./setting/factory'
,
},
{
name
:
'车间管理'
,
path
:
'/setting/workshop'
,
component
:
'./setting/workshop'
,
},
],
},
];
config/defaultSettings.js
View file @
2e168ae0
const
Settings
=
{
title
:
'
basepro
'
,
name
:
'
basepro
'
,
navTheme
:
'
light
'
,
title
:
'
设备管理系统
'
,
name
:
'
设备管理系统
'
,
navTheme
:
'
dark
'
,
primaryColor
:
'#1890ff'
,
layout
:
'side'
,
contentWidth
:
'Fluid'
,
...
...
config/routes.js
View file @
2e168ae0
...
...
@@ -2,6 +2,8 @@
let
allauth
=
authRoutes
;
// .map((it) => ({ ...it, wrappers: ['@/wrappers/auth'] }));
console
.
log
(
allauth
);
export
default
[
{
path
:
'/user'
,
...
...
src/app.jsx
View file @
2e168ae0
...
...
@@ -12,6 +12,8 @@ import routes from '../config/authRoutes';
const
{
LinkOutlined
}
=
Ant4Icons
;
const
isDev
=
process
.
env
.
NODE_ENV
===
'development'
;
// const isDev = false
console
.
log
(
isDev
);
const
loginPath
=
'/user/login'
;
/**
...
...
@@ -47,14 +49,12 @@ export async function getInitialState() {
}
return
undefined
;
};
// 如果是登录页面,不执行
if
(
history
.
location
.
pathname
!==
loginPath
&&
token
)
{
const
currentUserData
=
await
fetchUserInfo
();
let
menuData
;
if
(
currentUserData
?.
data
?.
userName
)
{
menuData
=
await
getmenuData
();
}
/* isdev */
if
(
isDev
)
{
menuData
=
{
...
...
@@ -73,12 +73,23 @@ export async function getInitialState() {
collapsed
:
false
,
};
}
let
menuData
=
{};
if
(
isDev
)
{
menuData
=
{
recentUsePermList
:
[],
collectPerm
:
[],
userHavePermList
:
routes
,
};
}
return
{
fetchUserInfo
,
settings
:
defaultSettings
,
getmenuData
,
collapsed
:
false
,
tagList
:
[],
newMenu
:
menuData
,
};
}
...
...
@@ -130,6 +141,7 @@ export const layout = ({ initialState, setInitialState }) => {
userId
:
initialState
?.
currentUser
?.
id
,
},
request
:
(
params
,
defaultMenuData
)
=>
{
console
.
log
(
initialState
);
let
lastArr
=
initialState
?.
newMenu
?.
userHavePermList
?
JSON
.
parse
(
JSON
.
stringify
(
initialState
?.
newMenu
?.
userHavePermList
))
:
[],
...
...
src/global.less
View file @
2e168ae0
...
...
@@ -58,13 +58,14 @@ ol {
width: 100%;
overflow-x: auto;
&-thead > tr,
&-tbody > tr {
> th,
> td {
&-thead>tr,
&-tbody>tr {
>th,
>td {
white-space: pre;
>
span {
>span {
display: block;
}
}
...
...
@@ -196,6 +197,7 @@ ol {
display: flex !important;
flex-wrap: nowrap !important;
}
.ant-pro {
display: flex;
align-items: center;
...
...
@@ -311,7 +313,7 @@ ol {
}
.lightblue {
>
td:first-child {
>td:first-child {
position: relative;
&::before {
...
...
@@ -333,14 +335,14 @@ ol {
width: 100%;
padding-left: 0 !important;
>
span:first-child {
>span:first-child {
flex: 1;
>
span:first-child {
>span:first-child {
display: none !important;
}
>
.ant-spin-nested-loading {
>.ant-spin-nested-loading {
width: 100%;
}
}
...
...
@@ -367,23 +369,45 @@ ol {
padding-top: 0 !important;
}
}
//editor fixed
.bf-link-editor .buttons {
box-sizing: content-box !important;
}
.bf-container {
display: flex !important;
flex-direction: column !important;
.bf-content {
flex: 1 !important;
}
}
.container,
.diycard {
height: 100% !important;
}
.runtime-keep-alive-layout {
>
div {
>div {
height: 100% !important;
}
}
.page-title {
margin-bottom: 0;
font-weight: 700;
}
.page-title::before {
content: '|';
width: 4px;
position: relative;
top: 2px;
left: 2px;
color: #1890FF;
background-color: #1890FF;
margin-right: 10px;
}
\ No newline at end of file
src/pages/Test/index.jsx
deleted
100644 → 0
View file @
b3a18d30
import
React
,
{
useState
,
useMemo
}
from
'react'
;
import
{
Divider
}
from
'antd'
;
import
AutoTable
from
'@/components/AutoTable'
;
import
PremButton
from
'@/components/PremButton'
;
export
default
()
=>
{
const
[
activeTabKey
,
onTabChange
]
=
useState
(
'0'
);
//配置式table
const
columns
=
useMemo
(()
=>
{
return
[
{
title
:
'用户名'
,
dataIndex
:
'accountName'
,
key
:
'accountName'
,
search
:
false
,
},
{
title
:
'姓名'
,
dataIndex
:
'userName'
,
key
:
'userName'
,
},
{
title
:
'组织'
,
dataIndex
:
'departmentName'
,
key
:
'departmentName'
,
},
{
title
:
'工厂'
,
dataIndex
:
'factoryName'
,
key
:
'factoryName'
,
},
{
title
:
'负责仓库'
,
dataIndex
:
'chargeStoreName'
,
key
:
'chargeStoreName'
,
},
{
title
:
'角色'
,
dataIndex
:
'roleName'
,
key
:
'roleName'
,
},
{
title
:
'联系电话'
,
dataIndex
:
'telephone'
,
key
:
'telephone'
,
},
{
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
),
],
},
];
},
[]);
const
edit
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
onClick
:
()
=>
{
},
}
}
>
编辑
</
PremButton
>
);
};
const
remove
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
pop=
{
{
title
:
'是否删除该用户?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
()
=>
{
alert
(
0
);
},
}
}
btn=
{
{
size
:
'small'
,
type
:
'danger'
,
}
}
>
删除
</
PremButton
>
);
};
const
tableprops
=
{
pagetitle
:
'左001号'
,
addconfig
:
{
access
:
'sysDepartment_save'
,
btn
:
{
disabled
:
true
,
onClick
:
()
=>
{
alert
(
0
);
},
},
},
exportconfig
:
{
access
:
'havePrem'
,
btn
:
{
disabled
:
false
,
onClick
:
()
=>
{
alert
(
1
);
},
},
},
pageextra
:
activeTabKey
==
'0'
?
'none'
:
activeTabKey
==
'1'
?
'add'
:
'export'
,
tabList
:
[
{
tab
:
'全部'
,
key
:
'0'
,
},
{
tab
:
'未完成'
,
key
:
'1'
,
},
{
tab
:
'已完成'
,
key
:
'2'
,
},
],
activeTabKey
,
onTabChange
,
columns
,
path
:
'/ngic-auth/sysUser/query/page'
,
resizeable
:
false
};
return
(
<
div
>
<
h3
>
配置式按钮
</
h3
>
<
AutoTable
{
...
tableprops
}
/>
<
h3
style=
{
{
margin
:
'12px 0'
}
}
>
自定义按钮
</
h3
>
<
AutoTable
pagetitle=
{
'左玲玲'
}
pageextra=
{
<
PremButton
btn=
{
{
key
:
'add'
,
disabled
:
false
,
type
:
'primary'
,
onClick
:
()
=>
{
alert
(
1
);
},
}
}
access=
"havePrem"
>
炸了哦
</
PremButton
>
}
columns=
{
columns
}
path=
"/ngic-auth/sysUser/query/page"
/>
</
div
>
);
};
src/pages/Welcome.jsx
View file @
2e168ae0
This diff is collapsed.
Click to expand it.
src/pages/setting/factory/columns.js
View file @
2e168ae0
function
getcolumns
(
setdrawer
)
{
return
[
{
title
:
'工厂编码'
,
dataIndex
:
'factoryCode'
,
key
:
'factoryCode'
},
{
title
:
'工厂名称'
,
dataIndex
:
'factoryName'
,
key
:
'factoryName'
},
{
title
:
'工厂名称'
,
dataIndex
:
'factoryName'
,
key
:
'factoryName'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
];
}
...
...
src/pages/setting/factory/index.jsx
View file @
2e168ae0
...
...
@@ -4,14 +4,23 @@ import DrawerPro from '@/components/DrawerPro';
import
AutoTable
from
'@/components/AutoTable'
;
import
PremButton
from
'@/components/PremButton'
;
import
getcolumns
from
'./columns'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
message
}
from
'antd'
;
function
Factory
(
props
)
{
const
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
set
d
rawer
]
=
useState
({
const
[
drawer
,
set
D
rawer
]
=
useState
({
visible
:
false
,
});
const
urlParams
=
{
save
:
'/auth/sysFactory/saveOrUpdate'
,
remove
:
'/auth/sysFactory/delete'
,
list
:
'/auth/sysFactory/queryPage'
,
detail
:
'/auth/sysFactory/getById'
,
};
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
...
...
@@ -19,7 +28,7 @@ function Factory(props) {
size
:
'small'
,
type
:
'link'
,
onClick
:
()
=>
{
set
d
rawer
((
s
)
=>
({
set
D
rawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
row
,
...
...
@@ -41,12 +50,31 @@ function Factory(props) {
btn=
{
{
size
:
'small'
,
onClick
:
()
=>
{
set
d
rawer
((
s
)
=>
({
set
D
rawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
row
,
title
:
'编辑'
,
val
:
'edit'
,
onFinish
:
async
(
vals
)
=>
{
console
.
log
(
1
);
let
params
=
{
...
vals
,
id
:
row
.
id
,
};
let
res
=
await
doFetch
({
url
:
urlParams
.
save
,
params
,
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'新增成功!'
);
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
actionRef
.
current
.
reload
();
}
},
}));
},
}
}
...
...
@@ -63,8 +91,16 @@ function Factory(props) {
title
:
'是否删除该用户?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
()
=>
{
alert
(
0
);
onConfirm
:
async
()
=>
{
let
res
=
await
doFetch
({
url
:
urlParams
.
remove
,
params
:
{
id
:
row
.
id
}
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'删除成功!'
);
setDraw
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
actionRef
.
current
.
reload
();
}
},
}
}
btn=
{
{
...
...
@@ -78,25 +114,21 @@ function Factory(props) {
};
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
set
d
rawer
);
let
defcolumn
=
getcolumns
(
set
D
rawer
);
return
defcolumn
.
concat
({
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
detail
(
text
,
row
,
_
,
action
),
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
),
],
render
:
(
text
,
row
,
_
,
action
)
=>
[
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
)],
});
},
[]);
return
(
<
div
style=
{
{
position
:
'relative'
}
}
>
<
AutoTable
pagetitle=
"工厂管理"
pagetitle=
{
<
h3
className=
"page-title"
>
工厂管理
</
h3
>
}
columns=
{
columns
}
path=
"/auth/sysFactory/queryPage"
path=
{
urlParams
.
list
}
actionRef=
{
actionRef
}
pageextra=
{
'add'
}
resizeable=
{
false
}
...
...
@@ -105,12 +137,30 @@ function Factory(props) {
btn
:
{
disabled
:
false
,
onClick
:
()
=>
{
set
d
rawer
((
s
)
=>
({
set
D
rawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
null
,
title
:
'新增'
,
val
:
'add'
,
onFinish
:
async
(
vals
)
=>
{
console
.
log
(
1
);
let
params
=
{
...
vals
,
};
let
res
=
await
doFetch
({
url
:
urlParams
.
save
,
params
,
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'新增成功!'
);
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
actionRef
.
current
.
reload
();
}
},
}));
},
},
...
...
@@ -119,12 +169,13 @@ function Factory(props) {
<
DrawerPro
fields=
{
columns
}
detailpath=
"/ngic-auth/sysUser/query/detail"
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
// detailpath={urlParams.detail}
// params={{ id: drawer?.item?.id }}
defaultFormValue=
{
drawer
?.
item
??
{}
}
formRef=
{
formRef
}
placement=
"right"
onClose=
{
()
=>
{
set
d
rawer
((
s
)
=>
({
set
D
rawer
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
...
...
src/pages/setting/section/columns.js
View file @
2e168ae0
function
getcolumns
(
setdrawer
)
{
return
[
{
title
:
'工段代码'
,
dataIndex
:
'sectionCode'
,
key
:
'sectionCode'
},
{
title
:
'基础信息'
,
valueType
:
'split'
,
title
:
'工段名称'
,
dataIndex
:
'sectionName'
,
key
:
'sectionName'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'用户名'
,
dataIndex
:
'accountName'
,
formItemProps
:
{
rules
:
[
{
required
:
false
,
message
:
'此项为必填项'
,
},
],
},
initialValue
:
'默认值'
,
hideInForm
:
false
,
search
:
false
,
render
:
(
text
,
row
)
=>
{
return
(
<
a
onClick
=
{()
=>
{
setdrawer
?.((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
null
,
title
:
'新增'
,
val
:
'add'
,
}));
}}
>
{
text
}
<
/a
>
);
},
title
:
'所属工厂'
,
dataIndex
:
'factoryName'
,
key
:
'factoryId'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
valueType
:
'select'
,
options
:
{
path
:
'/auth/sysFactory/getAllFactorySelection'
,
params
:
{}
},
},
{
title
:
'姓名'
,
dataIndex
:
'userName'
,
key
:
'userId'
,
hideInForm
:
{
accountName
:
{
reverse
:
[
'1'
,
'2'
,
'5'
],
},
remark
:
[
'3'
],
},
search
:
false
,
},
{
title
:
'额外信息'
,
valueType
:
'split'
,
},
{
title
:
'联系电话'
,
dataIndex
:
'telephone'
,
formItemProps
:
{
rules
:
[
{
required
:
false
,
message
:
'此项为必填项'
,
},
],
},
search
:
false
,
},
{
title
:
'邮箱'
,
dataIndex
:
'mailNo'
,
formItemProps
:
{
rules
:
[
{
required
:
false
,
message
:
'此项为必填项'
,
},
],
},
search
:
false
,
},
{
title
:
'备注'
,
dataIndex
:
'remark'
,
valueType
:
'editor'
,
search
:
false
,
colProps
:
{
span
:
24
},
initialValue
:
'<p>Hello <b>World!</b></p>'
,
},
{
title
:
'上传样式-图片'
,
dataIndex
:
'uploadImage'
,
key
:
'uploadImage'
,
valueType
:
'uploadImage'
,
fieldProps
:
{
limit
:
2
,
},
formItemProps
:
{
rules
:
[
{
required
:
false
,
message
:
'此项为必填项'
,
},
],
},
title
:
'所属车间'
,
dataIndex
:
'shopName'
,
key
:
'shopName'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
valueType
:
'select'
,
options
:
{
path
:
'/auth/sysShop/getShopSelectionByFactory'
,
params
:
{}
},
},
];
}
...
...
src/pages/setting/section/index.jsx
View file @
2e168ae0
...
...
@@ -5,13 +5,20 @@ import AutoTable from '@/components/AutoTable';
import
PremButton
from
'@/components/PremButton'
;
import
getcolumns
from
'./columns'
;
function
Section
(
props
)
{
function
Factory
(
props
)
{
const
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
setdrawer
]
=
useState
({
visible
:
false
,
});
const
urlParams
=
{
save
:
'/auth/sysShop/saveOrUpdate'
,
remove
:
'/auth/sysShop/delete'
,
list
:
'/auth/sysShop/queryPage'
,
detail
:
'/auth/sysShop/getById'
,
};
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
...
...
@@ -63,8 +70,16 @@ function Section(props) {
title
:
'是否删除该用户?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
()
=>
{
alert
(
0
);
onConfirm
:
async
()
=>
{
let
res
=
await
doFetch
({
url
:
urlParams
.
remove
,
params
:
{
id
:
row
.
id
}
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'删除成功!'
);
setDraw
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
actionRef
.
current
.
reload
();
}
},
}
}
btn=
{
{
...
...
@@ -83,23 +98,19 @@ function Section(props) {
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
detail
(
text
,
row
,
_
,
action
),
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
),
],
render
:
(
text
,
row
,
_
,
action
)
=>
[
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
)],
});
},
[]);
return
(
<
div
style=
{
{
position
:
'relative'
}
}
>
<
AutoTable
pagetitle=
"
工段
管理"
pagetitle=
"
车间
管理"
columns=
{
columns
}
path=
"/ngic-auth/sysUser/query/page"
path=
{
urlParams
.
list
}
actionRef=
{
actionRef
}
pageextra=
{
'add'
}
resizeable=
{
tru
e
}
resizeable=
{
fals
e
}
addconfig=
{
{
// access: 'sysDepartment_save',
btn
:
{
...
...
@@ -111,6 +122,23 @@ function Section(props) {
item
:
null
,
title
:
'新增'
,
val
:
'add'
,
onFinish
:
async
(
vals
)
=>
{
let
params
=
{
...
vals
,
};
let
res
=
await
doFetch
({
url
:
urlParams
.
save
,
params
,
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'新增成功!'
);
setDraw
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
actionRef
.
current
.
reload
();
}
},
}));
},
},
...
...
@@ -119,7 +147,7 @@ function Section(props) {
<
DrawerPro
fields=
{
columns
}
detailpath=
"/ngic-auth/sysUser/query/detail"
detailpath=
{
urlParams
.
detail
}
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
formRef=
{
formRef
}
placement=
"right"
...
...
@@ -135,4 +163,4 @@ function Section(props) {
);
}
export
default
Section
;
\ No newline at end of file
export
default
Factory
;
src/pages/setting/workshop/columns.js
View file @
2e168ae0
function
getcolumns
(
setdrawer
)
{
return
[
{
title
:
'基础信息'
,
valueType
:
'split'
,
title
:
'车间代码'
,
dataIndex
:
'shopCode'
,
key
:
'shopCode'
,
formItemProps
:
{
rules
:
[{
required
:
false
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'用户名'
,
dataIndex
:
'accountName'
,
formItemProps
:
{
rules
:
[
{
required
:
false
,
message
:
'此项为必填项'
,
},
],
},
initialValue
:
'默认值'
,
hideInForm
:
false
,
search
:
false
,
render
:
(
text
,
row
)
=>
{
return
(
<
a
onClick
=
{()
=>
{
setdrawer
?.((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
null
,
title
:
'新增'
,
val
:
'add'
,
}));
}}
>
{
text
}
<
/a
>
);
},
title
:
'车间名称'
,
dataIndex
:
'shopName'
,
key
:
'shopName'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'姓名'
,
dataIndex
:
'userName'
,
key
:
'userId'
,
hideInForm
:
{
accountName
:
{
reverse
:
[
'1'
,
'2'
,
'5'
],
},
remark
:
[
'3'
],
},
search
:
false
,
},
{
title
:
'额外信息'
,
valueType
:
'split'
,
},
{
title
:
'联系电话'
,
dataIndex
:
'telephone'
,
formItemProps
:
{
rules
:
[
{
required
:
false
,
message
:
'此项为必填项'
,
},
],
},
search
:
false
,
},
{
title
:
'邮箱'
,
dataIndex
:
'mailNo'
,
formItemProps
:
{
rules
:
[
{
required
:
false
,
message
:
'此项为必填项'
,
},
],
},
search
:
false
,
},
{
title
:
'备注'
,
dataIndex
:
'remark'
,
valueType
:
'editor'
,
search
:
false
,
colProps
:
{
span
:
24
},
initialValue
:
'<p>Hello <b>World!</b></p>'
,
},
{
title
:
'上传样式-图片'
,
dataIndex
:
'uploadImage'
,
key
:
'uploadImage'
,
valueType
:
'uploadImage'
,
fieldProps
:
{
limit
:
2
,
},
formItemProps
:
{
rules
:
[
{
required
:
false
,
message
:
'此项为必填项'
,
},
],
},
title
:
'所属工厂名称'
,
dataIndex
:
'factoryName'
,
key
:
'factoryCode'
,
valueType
:
'select'
,
options
:
{
path
:
'/auth/sysShop/queryPage'
,
params
:
{}
},
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
];
}
...
...
src/pages/setting/workshop/index.jsx
View file @
2e168ae0
...
...
@@ -4,14 +4,23 @@ import DrawerPro from '@/components/DrawerPro';
import
AutoTable
from
'@/components/AutoTable'
;
import
PremButton
from
'@/components/PremButton'
;
import
getcolumns
from
'./columns'
;
import
{
message
}
from
'antd'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
function
Workshop
(
props
)
{
function
Factory
(
props
)
{
const
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
setdrawer
]
=
useState
({
visible
:
false
,
});
const
urlParams
=
{
save
:
'/auth/sysShop/saveOrUpdate'
,
remove
:
'/auth/sysShop/delete'
,
list
:
'/auth/sysShop/queryPage'
,
detail
:
'/auth/sysShop/getById'
,
};
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
...
...
@@ -63,8 +72,16 @@ function Workshop(props) {
title
:
'是否删除该用户?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
()
=>
{
alert
(
0
);
onConfirm
:
async
()
=>
{
let
res
=
await
doFetch
({
url
:
urlParams
.
remove
,
params
:
{
id
:
row
.
id
}
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'删除成功!'
);
setDraw
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
actionRef
.
current
.
reload
();
}
},
}
}
btn=
{
{
...
...
@@ -83,23 +100,19 @@ function Workshop(props) {
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
detail
(
text
,
row
,
_
,
action
),
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
),
],
render
:
(
text
,
row
,
_
,
action
)
=>
[
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
)],
});
},
[]);
return
(
<
div
style=
{
{
position
:
'relative'
}
}
>
<
AutoTable
pagetitle=
"车间管理"
pagetitle=
{
<
h3
className=
"page-title"
>
车间管理
</
h3
>
}
columns=
{
columns
}
path=
"/ngic-auth/sysUser/query/page"
path=
{
urlParams
.
list
}
actionRef=
{
actionRef
}
pageextra=
{
'add'
}
resizeable=
{
tru
e
}
resizeable=
{
fals
e
}
addconfig=
{
{
// access: 'sysDepartment_save',
btn
:
{
...
...
@@ -111,6 +124,23 @@ function Workshop(props) {
item
:
null
,
title
:
'新增'
,
val
:
'add'
,
onFinish
:
async
(
vals
)
=>
{
let
params
=
{
...
vals
,
};
let
res
=
await
doFetch
({
url
:
urlParams
.
save
,
params
,
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'新增成功!'
);
setDraw
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
actionRef
.
current
.
reload
();
}
},
}));
},
},
...
...
@@ -119,8 +149,8 @@ function Workshop(props) {
<
DrawerPro
fields=
{
columns
}
detailpath=
"/ngic-auth/sysUser/query/detail"
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
// detailpath={urlParams.detail}
//
params={{ id: drawer?.item?.id }}
formRef=
{
formRef
}
placement=
"right"
onClose=
{
()
=>
{
...
...
@@ -135,4 +165,4 @@ function Workshop(props) {
);
}
export
default
Workshop
;
\ No newline at end of file
export
default
Factory
;
src/pages/zll/columns.js
deleted
100644 → 0
View file @
b3a18d30
function
getcolumns
(
setdrawer
)
{
return
[
{
title
:
'创建时间'
,
dataIndex
:
'createTime'
,
key
:
'createTime'
,
valueType
:
'dateYear'
},
{
title
:
'修改人'
,
dataIndex
:
'updateUserName'
,
key
:
'updateUserId'
,
valueType
:
'select'
,
mode
:
'tags'
,
options
:
[
{
label
:
'123'
,
value
:
'1'
},
{
label
:
'123'
,
value
:
'12'
},
{
label
:
'123'
,
value
:
'123'
},
{
label
:
'123'
,
value
:
'1231'
},
],
formItemProps
:
{
rules
:
[{
required
:
false
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'创建人'
,
dataIndex
:
'createUserName'
,
key
:
'createUserName'
},
{
title
:
'更新时间'
,
dataIndex
:
'updateTime'
,
key
:
'updateTime'
},
{
title
:
'用户名'
,
dataIndex
:
'userName'
,
key
:
'userName'
,
valueType
:
'uploadImage'
,
mode
:
'tags'
,
},
{
title
:
'姓名'
,
dataIndex
:
'fullName'
,
key
:
'fullName'
},
{
title
:
'电话'
,
dataIndex
:
'telephone'
,
key
:
'telephone'
},
];
}
export
default
getcolumns
;
src/pages/zll/index.jsx
deleted
100644 → 0
View file @
b3a18d30
import
*
as
React
from
'react'
;
import
{
useState
,
useMemo
,
useRef
}
from
'react'
;
import
DrawerPro
from
'@/components/DrawerPro'
;
import
AutoTable
from
'@/components/AutoTable'
;
import
PremButton
from
'@/components/PremButton'
;
import
getcolumns
from
'./columns'
;
import
tabList
from
'./tablist'
;
function
Zll
(
props
)
{
const
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
setdrawer
]
=
useState
({
visible
:
false
,
}),
[
activeTabKey
,
setactiveTabKey
]
=
useState
(
"1"
);
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
type
:
'link'
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
row
,
title
:
'详情'
,
val
:
'detail'
,
title
:
row
.
userName
+
'的详细信息'
,
}));
},
}
}
>
详情
</
PremButton
>
);
};
const
edit
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
row
,
title
:
'编辑'
,
val
:
'edit'
,
}));
},
}
}
>
编辑
</
PremButton
>
);
};
const
remove
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
pop=
{
{
title
:
'是否删除该用户?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
()
=>
{
alert
(
0
);
},
}
}
btn=
{
{
size
:
'small'
,
type
:
'danger'
,
}
}
>
删除
</
PremButton
>
);
};
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
setdrawer
,
activeTabKey
);
return
activeTabKey
==
"1"
?
defcolumn
.
concat
({
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
detail
(
text
,
row
,
_
,
action
),
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
),
],
})
:
defcolumn
;
},
[
activeTabKey
]);
return
(
<
div
style=
{
{
position
:
'relative'
}
}
>
<
AutoTable
pagetitle=
"左玲玲"
columns=
{
columns
}
path=
"/ngic-auth/sysUser/query/page"
actionRef=
{
actionRef
}
pageextra=
{
activeTabKey
==
"1"
?
'add'
:
'none'
}
resizeable=
{
true
}
addconfig=
{
{
// access: 'sysDepartment_save',
btn
:
{
disabled
:
false
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
null
,
title
:
'新增'
,
val
:
'add'
,
}));
},
},
}
}
tabList=
{
tabList
}
activeTabKey=
{
activeTabKey
}
onTabChange=
{
(
key
)
=>
{
setactiveTabKey
(
key
)
}
}
/>
<
DrawerPro
fields=
{
columns
}
detailpath=
"/ngic-auth/sysUser/query/detail"
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
formRef=
{
formRef
}
placement=
"right"
onClose=
{
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
}
}
{
...
drawer
}
/>
</
div
>
);
}
export
default
Zll
;
\ No newline at end of file
src/pages/zll/tablist.js
deleted
100644 → 0
View file @
b3a18d30
export
default
[
{
key
:
"1"
,
tab
:
'未完成'
},
{
key
:
"2"
,
tab
:
'已完成'
}
]
\ No newline at end of file
src/utils/request.js
View file @
2e168ae0
...
...
@@ -32,7 +32,7 @@ const errorHandler = (error) => {
const
errorText
=
codeMessage
[
response
.
status
]
||
response
.
statusText
;
const
{
status
,
url
}
=
response
;
if
(
status
==
'401'
||
status
==
'302'
)
{
window
.
location
.
href
=
'http://idp.nangaoyun.com:8080/login'
;
//
window.location.href = 'http://idp.nangaoyun.com:8080/login';
}
}
else
if
(
!
response
)
{
notification
.
error
({
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment