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
fd65ec2a
Commit
fd65ec2a
authored
Nov 10, 2022
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
11.10
parent
7219878d
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
333 additions
and
221 deletions
+333
-221
authRoutes.js
config/authRoutes.js
+25
-8
proxy.js
config/proxy.js
+1
-1
FormItems.jsx
src/components/InitForm/FormItems.jsx
+22
-19
index.jsx
src/pages/device/account/index.jsx
+7
-0
columns.js
src/pages/device/model/columns.js
+16
-77
index.jsx
src/pages/device/model/index.jsx
+79
-20
columns.js
src/pages/device/supplier/columns.js
+67
-56
index.jsx
src/pages/device/supplier/index.jsx
+79
-21
index.jsx
src/pages/setting/factory/index.jsx
+5
-3
index.jsx
src/pages/setting/organization/index.jsx
+3
-1
columns.js
src/pages/setting/production/columns.js
+7
-2
index.jsx
src/pages/setting/production/index.jsx
+6
-4
index.jsx
src/pages/setting/role/index.jsx
+2
-1
columns.js
src/pages/setting/section/columns.js
+1
-1
index.jsx
src/pages/setting/section/index.jsx
+5
-3
index.jsx
src/pages/setting/users/index.jsx
+3
-1
index.jsx
src/pages/setting/workshop/index.jsx
+5
-3
No files found.
config/authRoutes.js
View file @
fd65ec2a
...
...
@@ -43,13 +43,30 @@ export default [
],
},
{
name
:
"设备管理"
,
icon
:
'
BulbOutlined
'
,
name
:
'设备管理'
,
icon
:
'
bulb
'
,
path
:
'/device'
,
routes
:
[{
name
:
'设备台账'
,
path
:
'/setting/account'
,
component
:
'./setting/account'
,
}]
}
routes
:
[
{
name
:
'设备台账'
,
path
:
'/device/account'
,
component
:
'./device/account'
,
},
{
name
:
'设备类型'
,
path
:
'/device/type'
,
component
:
'./device/type'
,
},
{
name
:
'设备型号'
,
path
:
'/device/model'
,
component
:
'./device/model'
,
},
{
name
:
'设备供应商'
,
path
:
'/device/supplier'
,
component
:
'./device/supplier'
,
},
],
},
];
config/proxy.js
View file @
fd65ec2a
...
...
@@ -22,7 +22,7 @@ export default {
changeOrigin
:
true
,
},
'/staticfile/'
:
{
target
:
'http://192.168.40.
2
/'
,
target
:
'http://192.168.40.
68:9088
/'
,
changeOrigin
:
true
,
pathRewrite
:
{
'^/staticfile'
:
''
,
...
...
src/components/InitForm/FormItems.jsx
View file @
fd65ec2a
...
...
@@ -38,7 +38,7 @@ import EditTable from './EditTable';
import
EditorItem
from
'./EditorItem'
;
import
defaultSetting
from
'../../../config/defaultSettings'
;
const
{
Image
,
Form
,
Upload
,
Col
,
Pagination
,
Avatar
,
Dropdown
,
Menu
,
Tabs
}
=
Antd
;
const
{
Image
,
Form
,
Upload
,
Col
,
Pagination
,
Avatar
,
Dropdown
,
Menu
,
Tabs
,
message
}
=
Antd
;
const
AntdCheckBox
=
Antd
.
Checkbox
;
const
FormItems
=
{
...
...
@@ -75,7 +75,6 @@ const FormItems = {
CheckboxItem
,
RadioItem
,
};
function
upperCase
(
str
)
{
const
newStr
=
str
.
slice
(
0
,
1
).
toUpperCase
()
+
str
.
slice
(
1
);
return
newStr
;
...
...
@@ -468,7 +467,6 @@ function LinkSelect({ item, colProps, formRef, name, curindex }) {
label=
{
item
.
title
}
placeholder=
{
`请选择${item.title}`
}
params=
{
params
}
mode=
{
item
?.
mode
}
request=
{
async
(
parse
)
=>
{
let
result
=
{};
for
(
let
key
in
curlinkparams
)
{
...
...
@@ -528,7 +526,6 @@ function NolinkSelect({ item, colProps }) {
label=
{
item
.
title
}
placeholder=
{
`请选择${item.title}`
}
showSearch
mode=
{
item
?.
mode
}
{
...
options
}
/>
</>
...
...
@@ -560,7 +557,6 @@ function LinkTreeSelect({ item, colProps, formRef, name, curindex }) {
...
item
?.
fieldProps
,
fieldNames
:
{
label
:
'title'
,
value
:
'key'
,
children
:
'children'
},
showSearch
:
false
,
multiple
:
item
?.
mode
===
'multiple'
,
}
}
formItemProps=
{
item
.
formItemProps
}
name=
{
curkey
}
...
...
@@ -628,14 +624,12 @@ function NolinkTreeSelect({ item, colProps }) {
...
item
?.
fieldProps
,
fieldNames
:
{
label
:
'title'
,
value
:
'key'
,
children
:
'children'
},
showSearch
:
true
,
multiple
:
item
?.
mode
===
'multiple'
,
}
}
formItemProps=
{
item
.
formItemProps
}
name=
{
item
.
key
??
item
.
dataIndex
}
colProps=
{
item
.
colProps
??
colProps
}
label=
{
item
.
title
}
placeholder=
{
`请选择${item.title}`
}
multiple
{
...
options
}
/>
</>
...
...
@@ -876,8 +870,7 @@ function LinkCascader({ item, colProps, formRef, name, curindex }) {
fieldProps=
{
{
...
item
?.
fieldProps
,
fieldNames
:
{
label
:
'title'
,
value
:
'key'
,
children
:
'children'
},
showSearch
:
true
,
multiple
:
item
?.
mode
===
'multiple'
,
showSearch
:
false
,
}
}
formItemProps=
{
item
.
formItemProps
}
name=
{
curkey
}
...
...
@@ -944,7 +937,6 @@ function NolinkCascader({ item, colProps }) {
...
item
?.
fieldProps
,
fieldNames
:
{
label
:
'title'
,
value
:
'key'
,
children
:
'children'
},
showSearch
:
true
,
multiple
:
item
?.
mode
===
'multiple'
,
}
}
formItemProps=
{
item
.
formItemProps
}
name=
{
item
.
key
??
item
.
dataIndex
}
...
...
@@ -1016,12 +1008,14 @@ function Slider({ item, colProps }) {
//uploadbtn
function
UploadBtn
({
item
,
colProps
})
{
let
token
=
`Bearer
${
localStorage
.
getItem
(
'TOKENES'
)}
`
;
return
(
<>
<
ProFormUploadButton
fieldProps=
{
{
...
item
?.
fieldProps
,
action
:
defaultSetting
.
proxypath
+
'/ngic-base-business/sysAttachment/uploadFile'
,
action
:
defaultSetting
.
proxypath
+
'/base/sysAttachment/uploadFile'
,
headers
:
{
Authorization
:
token
},
onPreview
:
(
file
)
=>
{
let
url
=
''
;
if
(
file
.
response
)
{
...
...
@@ -1052,15 +1046,15 @@ function UploadBtn({ item, colProps }) {
colProps=
{
item
.
colProps
??
colProps
}
label=
{
item
.
title
}
title=
{
`上传${item.title}`
}
max=
{
item
.
max
}
/>
</>
);
}
function
UploadImg
({
value
,
onChange
,
fieldProps
})
{
let
token
=
`Bearer
${
localStorage
.
getItem
(
'TOKENES'
)}
`
;
const
[
image
,
setImage
]
=
useState
({});
let
token
=
'18e1081d54f57af2fdeac1964cc981e7'
;
function
beforeUpload
(
file
)
{
const
isJpgOrPng
=
file
.
type
===
'image/jpg'
||
file
.
type
===
'image/jpeg'
||
file
.
type
===
'image/png'
;
...
...
@@ -1074,12 +1068,12 @@ function UploadImg({ value, onChange, fieldProps }) {
// maxCount 最大数量
const
defaultconfig
=
{
name
:
'file'
,
action
:
defaultSetting
.
proxypath
+
'/
ngic-base-business
/sysAttachment/uploadFile'
,
action
:
defaultSetting
.
proxypath
+
'/
base
/sysAttachment/uploadFile'
,
accept
:
'.jpg,.png,.jpeg'
,
listType
:
'picture-card'
,
beforeUpload
:
beforeUpload
,
defaultFileList
:
value
,
headers
:
{
token
},
headers
:
{
Authorization
:
token
},
onChange
(
info
)
{
let
{
file
:
{
name
,
status
,
response
},
...
...
@@ -1090,7 +1084,7 @@ function UploadImg({ value, onChange, fieldProps }) {
message
.
error
(
`
${
info
.
file
.
name
}
上传失败`
);
}
else
if
(
status
===
'done'
)
{
const
transfile
=
fileList
.
map
((
it
)
=>
{
return
it
?.
response
?
it
?.
response
.
data
.
dataList
[
0
]
:
it
;
return
it
?.
response
?
it
?.
response
?.
data
?
.
dataList
[
0
]
:
it
;
});
onChange
(
transfile
);
}
...
...
@@ -1122,6 +1116,7 @@ function UploadImg({ value, onChange, fieldProps }) {
<
div
style=
{
{
marginTop
:
8
}
}
>
上传图片
</
div
>
</
div
>
);
console
.
log
(
value
?.
length
,
fieldProps
.
limit
);
return
(
<>
<
Image
...
...
@@ -1175,12 +1170,14 @@ function UploadImage({ item, colProps }) {
// uploadDragger
function
UploadDragger
({
item
,
colProps
})
{
let
token
=
`Bearer
${
localStorage
.
getItem
(
'TOKENES'
)}
`
;
return
(
<>
<
ProFormUploadDragger
fieldProps=
{
{
...
item
?.
fieldProps
,
action
:
defaultSetting
.
proxypath
+
'/ngic-base-business/sysAttachment/uploadFile'
,
action
:
defaultSetting
.
proxypath
+
'/base/sysAttachment/uploadFile'
,
headers
:
{
Authorization
:
token
},
onPreview
:
(
file
)
=>
{
let
url
=
''
;
if
(
file
.
response
)
{
...
...
@@ -1227,14 +1224,20 @@ function Editor({ item, colProps, formRef }) {
// }}
transform=
{
(
value
)
=>
{
return
{
[
curkey
]:
value
.
toHTML
(),
[
curkey
]:
value
&&
value
?.
toHTML
?.
(),
};
}
}
name=
{
curkey
}
label=
{
item
.
title
}
{
...
item
.
formItemProps
}
>
<
EditorItem
item=
{
item
}
params=
{
item
.
params
}
formRef=
{
formRef
}
curkey=
{
curkey
}
/>
<
EditorItem
serverURL=
{
defaultSetting
.
proxypath
+
'/base/sysAttachment/uploadFile'
}
item=
{
item
}
params=
{
item
.
params
}
formRef=
{
formRef
}
curkey=
{
curkey
}
/>
</
ProForm
.
Item
>
</
Col
>
);
...
...
src/pages/device/account/index.jsx
View file @
fd65ec2a
/*
* @Author: Li Hanlin
* @Date: 2022-11-10 09:39:56
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-10 09:39:56
*/
import
*
as
React
from
'react'
;
import
{
useState
,
useMemo
,
useRef
}
from
'react'
;
import
DrawerPro
from
'@/components/DrawerPro'
;
...
...
src/pages/device/model/columns.js
View file @
fd65ec2a
import
{
Image
}
from
'antd'
;
function
getcolumns
(
setdrawer
)
{
return
[
{
title
:
'基础信息'
,
valueType
:
'split'
,
},
{
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
:
'userName'
,
key
:
'userId'
,
hideInForm
:
{
accountName
:
{
reverse
:
[
'1'
,
'2'
,
'5'
],
},
remark
:
[
'3'
],
},
search
:
false
,
},
{
title
:
'额外信息'
,
valueType
:
'split'
,
},
{
title
:
'联系电话'
,
dataIndex
:
'telephone'
,
title
:
'设备型号'
,
dataIndex
:
'equipmentModelName'
,
key
:
'equipmentModelName'
,
formItemProps
:
{
rules
:
[
{
...
...
@@ -63,45 +13,34 @@ function getcolumns(setdrawer) {
},
],
},
search
:
false
,
},
{
title
:
'邮箱'
,
dataIndex
:
'mailNo'
,
formItemProps
:
{
rules
:
[
{
required
:
false
,
message
:
'此项为必填项'
,
},
],
},
search
:
false
,
},
{
title
:
'备注'
,
dataIndex
:
'remark'
,
valueType
:
'editor'
,
dataIndex
:
'modelDescription'
,
key
:
'modelDescription'
,
initialValue
:
'默认值'
,
hideInForm
:
false
,
search
:
false
,
colProps
:
{
span
:
24
},
initialValue
:
'<p>Hello <b>World!</b></p>'
,
},
{
title
:
'上传样式-图片'
,
dataIndex
:
'uploadImage'
,
key
:
'uploadImage'
,
title
:
'设备图片'
,
dataIndex
:
'pictureUrl'
,
key
:
'picList'
,
search
:
false
,
valueType
:
'uploadImage'
,
fieldProps
:
{
limit
:
2
,
limit
:
1
,
},
formItemProps
:
{
rules
:
[
{
required
:
fals
e
,
required
:
tru
e
,
message
:
'此项为必填项'
,
},
],
},
hideInTable
:
false
,
render
:
(
text
,
row
)
=>
<
Image
width
=
{
70
}
src
=
{
row
.
pictureUrl
}
/>
,
},
];
}
...
...
src/pages/device/model/index.jsx
View file @
fd65ec2a
/* 设备型号
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-10 15:12:23
*/
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
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
message
}
from
'antd'
;
function
Model
(
props
)
{
const
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
set
d
rawer
]
=
useState
({
const
[
drawer
,
set
D
rawer
]
=
useState
({
visible
:
false
,
});
const
urlParams
=
{
save
:
'/asset/equipmentModel/save'
,
remove
:
'/asset/equipmentModel/deleteById'
,
list
:
'/asset/equipmentModel/queryList'
,
detail
:
'/asset/equipmentModel/queryById'
,
};
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
...
...
@@ -19,7 +35,7 @@ function Model(props) {
size
:
'small'
,
type
:
'link'
,
onClick
:
()
=>
{
set
d
rawer
((
s
)
=>
({
set
D
rawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
row
,
...
...
@@ -41,12 +57,32 @@ function Model(props) {
btn=
{
{
size
:
'small'
,
onClick
:
()
=>
{
set
d
rawer
((
s
)
=>
({
set
D
rawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
row
,
title
:
'编辑'
,
val
:
'edit'
,
detailpath
:
urlParams
.
detail
,
params
:
{
id
:
row
.
id
},
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 +99,16 @@ function Model(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
(
'删除成功!'
);
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
actionRef
.
current
.
reload
();
}
},
}
}
btn=
{
{
...
...
@@ -78,39 +122,55 @@ function Model(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=
"/ngic-auth/sysUser/query/page"
path=
{
urlParams
.
list
}
actionRef=
{
actionRef
}
pageextra=
{
'add'
}
resizeable=
{
tru
e
}
resizeable=
{
fals
e
}
addconfig=
{
{
// access: 'sysDepartment_save',
btn
:
{
disabled
:
false
,
onClick
:
()
=>
{
set
d
rawer
((
s
)
=>
({
set
D
rawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
null
,
detailpath
:
null
,
title
:
'新增'
,
val
:
'add'
,
onFinish
:
async
(
vals
)
=>
{
// console.log(1);
console
.
log
(
drawer
);
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 +179,11 @@ function Model(props) {
<
DrawerPro
fields=
{
columns
}
detailpath=
"/ngic-auth/sysUser/query/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
,
}));
...
...
@@ -135,4 +194,4 @@ function Model(props) {
);
}
export
default
Model
;
\ No newline at end of file
export
default
Model
;
src/pages/device/supplier/columns.js
View file @
fd65ec2a
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
Switch
}
from
'antd'
;
function
getcolumns
(
setdrawer
)
{
return
[
{
title
:
'基础信息'
,
valueType
:
'split'
,
title
:
'供应商编号'
,
dataIndex
:
'supplierNo'
,
key
:
'supplierNo'
,
hideInForm
:
{
accountName
:
{
reverse
:
[
'1'
,
'2'
,
'5'
],
},
remark
:
[
'3'
],
},
},
{
title
:
'用户名'
,
dataIndex
:
'accountName'
,
title
:
'供应商名称'
,
dataIndex
:
'supplierName'
,
key
:
'supplierName'
,
formItemProps
:
{
rules
:
[
{
...
...
@@ -15,46 +25,11 @@ function getcolumns(setdrawer) {
},
],
},
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
:
'userName'
,
key
:
'userId'
,
hideInForm
:
{
accountName
:
{
reverse
:
[
'1'
,
'2'
,
'5'
],
},
remark
:
[
'3'
],
},
search
:
false
,
},
{
title
:
'额外信息'
,
valueType
:
'split'
,
},
{
title
:
'联系电话'
,
title
:
'电话'
,
dataIndex
:
'telephone'
,
key
:
'telephone'
,
formItemProps
:
{
rules
:
[
{
...
...
@@ -63,11 +38,11 @@ function getcolumns(setdrawer) {
},
],
},
search
:
false
,
},
{
title
:
'邮箱'
,
dataIndex
:
'mailNo'
,
dataIndex
:
'email'
,
key
:
'email'
,
formItemProps
:
{
rules
:
[
{
...
...
@@ -76,24 +51,37 @@ function getcolumns(setdrawer) {
},
],
},
search
:
false
,
},
{
title
:
'备注'
,
dataIndex
:
'remark'
,
valueType
:
'editor'
,
search
:
false
,
colProps
:
{
span
:
24
},
initialValue
:
'<p>Hello <b>World!</b></p>'
,
title
:
'地址'
,
dataIndex
:
'address'
,
key
:
'address'
,
formItemProps
:
{
rules
:
[
{
required
:
false
,
message
:
'此项为必填项'
,
},
],
},
},
{
title
:
'上传样式-图片'
,
dataIndex
:
'uploadImage'
,
key
:
'uploadImage'
,
valueType
:
'uploadImage'
,
fieldProps
:
{
limit
:
2
,
title
:
'评分'
,
dataIndex
:
'score'
,
formItemProps
:
{
rules
:
[
{
required
:
false
,
message
:
'此项为必填项'
,
},
],
},
},
{
title
:
'状态'
,
dataIndex
:
'status'
,
key
:
'status'
,
valueType
:
'radio'
,
formItemProps
:
{
rules
:
[
{
...
...
@@ -102,6 +90,29 @@ function getcolumns(setdrawer) {
},
],
},
render
:
(
text
,
row
)
=>
{
return
(
<
Switch
checkedChildren
=
"启用"
unCheckedChildren
=
"禁用"
defaultChecked
=
{
row
.
status
==
1
}
onChange
=
{(
flag
)
=>
{
// console.log(e);
if
(
flag
)
{
doFetch
({
url
:
'/asset/equipmentSupplier/update/status'
,
params
:
{
id
:
row
.
id
,
status
:
'1'
},
});
}
else
{
doFetch
({
url
:
'/asset/equipmentSupplier/update/status'
,
params
:
{
id
:
row
.
id
,
status
:
'2'
},
});
}
}}
/
>
);
},
},
];
}
...
...
src/pages/device/supplier/index.jsx
View file @
fd65ec2a
/* 设备供应商
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-10 16:57:58
*/
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
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
message
}
from
'antd'
;
function
Supplier
(
props
)
{
const
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
set
d
rawer
]
=
useState
({
const
[
drawer
,
set
D
rawer
]
=
useState
({
visible
:
false
,
});
const
urlParams
=
{
save
:
'/asset/equipmentSupplier/save'
,
remove
:
'/asset/equipmentSupplier/deleteById'
,
list
:
'/asset/equipmentSupplier/queryList'
,
detail
:
'/asset/equipmentSupplier/query/detail'
,
detail_nocp
:
'/asset/equipmentSupplier/queryById'
,
};
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
...
...
@@ -19,7 +36,7 @@ function Supplier(props) {
size
:
'small'
,
type
:
'link'
,
onClick
:
()
=>
{
set
d
rawer
((
s
)
=>
({
set
D
rawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
row
,
...
...
@@ -41,12 +58,32 @@ function Supplier(props) {
btn=
{
{
size
:
'small'
,
onClick
:
()
=>
{
set
d
rawer
((
s
)
=>
({
set
D
rawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
row
,
detailpath
:
urlParams
.
detail
,
params
:
{
id
:
drawer
?.
item
?.
id
},
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
();
}
},
}));
},
}
}
...
...
@@ -60,11 +97,19 @@ function Supplier(props) {
return
(
<
PremButton
pop=
{
{
title
:
'是否删除该
用户
?'
,
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
(
'删除成功!'
);
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
actionRef
.
current
.
reload
();
}
},
}
}
btn=
{
{
...
...
@@ -78,39 +123,53 @@ function Supplier(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=
"/ngic-auth/sysUser/query/page"
path=
{
urlParams
.
list
}
actionRef=
{
actionRef
}
pageextra=
{
'add'
}
resizeable=
{
tru
e
}
resizeable=
{
fals
e
}
addconfig=
{
{
// access: 'sysDepartment_save',
btn
:
{
disabled
:
false
,
type
:
'primary'
,
onClick
:
()
=>
{
set
d
rawer
((
s
)
=>
({
set
D
rawer
((
s
)
=>
({
...
s
,
visible
:
true
,
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
(
'新增成功!'
);
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
actionRef
.
current
.
reload
();
}
},
}));
},
},
...
...
@@ -119,12 +178,11 @@ function Supplier(props) {
<
DrawerPro
fields=
{
columns
}
detailpath=
"/ngic-auth/sysUser/query/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
,
}));
...
...
@@ -135,4 +193,4 @@ function Supplier(props) {
);
}
export
default
Supplier
;
\ No newline at end of file
export
default
Supplier
;
src/pages/setting/factory/index.jsx
View file @
fd65ec2a
/* 工厂管理
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Last Modified by:
Li Hanlin
* @Last Modified time: 2022-11-
09 14:44:4
4
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-
10 15:41:2
4
*/
import
*
as
React
from
'react'
;
...
...
@@ -95,7 +95,7 @@ function Factory(props) {
return
(
<
PremButton
pop=
{
{
title
:
'是否删除该
用户
?'
,
title
:
'是否删除该
工厂
?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
async
()
=>
{
...
...
@@ -142,12 +142,14 @@ function Factory(props) {
addconfig=
{
{
// access: 'sysDepartment_save',
btn
:
{
type
:
'primary'
,
disabled
:
false
,
onClick
:
()
=>
{
setDrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
null
,
detailpath
:
null
,
title
:
'新增'
,
val
:
'add'
,
onFinish
:
async
(
vals
)
=>
{
...
...
src/pages/setting/organization/index.jsx
View file @
fd65ec2a
...
...
@@ -103,12 +103,14 @@ function Organization(props) {
addconfig=
{
{
// access: 'sysDepartment_save',
btn
:
{
type
:
'primary'
,
disabled
:
false
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
null
,
detailpath
:
null
,
title
:
'新增'
,
val
:
'add'
,
}));
...
...
@@ -135,4 +137,4 @@ function Organization(props) {
);
}
export
default
Organization
;
\ No newline at end of file
export
default
Organization
;
src/pages/setting/production/columns.js
View file @
fd65ec2a
...
...
@@ -18,10 +18,15 @@ function getcolumns(setdrawer) {
{
title
:
'所属车间'
,
dataIndex
:
'shopName'
,
key
:
'shop
Name
'
,
key
:
'shop
Id
'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
valueType
:
'select'
,
options
:
{
path
:
'/auth/sysShop/getShopSelectionByFactory'
,
params
:
{}
},
options
:
{
path
:
'/auth/sysShop/getShopSelectionByFactory'
,
linkParams
:
{
factoryId
:
''
,
//key 后面如果存在value 则该value会在调用接口时format
},
},
},
];
}
...
...
src/pages/setting/production/index.jsx
View file @
fd65ec2a
...
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-09 14:43:54
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-
09 16:47:4
1
* @Last Modified time: 2022-11-
10 16:25:1
1
*/
import
*
as
React
from
'react'
;
...
...
@@ -67,11 +67,11 @@ function Section(props) {
onFinish
:
async
(
vals
)
=>
{
let
params
=
{
...
vals
,
id
:
row
.
id
,
};
let
res
=
await
doFetch
({
url
:
urlParams
.
save
,
params
,
id
:
row
.
id
,
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'新增成功!'
);
...
...
@@ -95,7 +95,7 @@ function Section(props) {
return
(
<
PremButton
pop=
{
{
title
:
'是否删除该
用户
?'
,
title
:
'是否删除该
产线
?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
async
()
=>
{
...
...
@@ -142,12 +142,14 @@ function Section(props) {
addconfig=
{
{
// access: 'sysDepartment_save',
btn
:
{
type
:
'primary'
,
disabled
:
false
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
null
,
detailpath
:
null
,
title
:
'新增'
,
val
:
'add'
,
onFinish
:
async
(
vals
)
=>
{
...
...
@@ -160,7 +162,7 @@ function Section(props) {
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'新增成功!'
);
set
Draw
((
s
)
=>
({
set
drawer
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
...
...
src/pages/setting/role/index.jsx
View file @
fd65ec2a
...
...
@@ -103,6 +103,7 @@ function Role(props) {
addconfig=
{
{
// access: 'sysDepartment_save',
btn
:
{
type
:
'primary'
,
disabled
:
false
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
...
@@ -135,4 +136,4 @@ function Role(props) {
);
}
export
default
Role
;
\ No newline at end of file
export
default
Role
;
src/pages/setting/section/columns.js
View file @
fd65ec2a
...
...
@@ -24,7 +24,7 @@ function getcolumns(setdrawer) {
options
:
{
path
:
'/auth/sysShop/getShopSelectionByFactory'
,
linkParams
:
{
factoryId
:
'
factoryId
'
,
//key 后面如果存在value 则该value会在调用接口时format
factoryId
:
''
,
//key 后面如果存在value 则该value会在调用接口时format
},
},
},
...
...
src/pages/setting/section/index.jsx
View file @
fd65ec2a
...
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-09 14:43:54
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-
09 16:48:08
* @Last Modified time: 2022-11-
10 15:37:21
*/
import
*
as
React
from
'react'
;
...
...
@@ -95,7 +95,7 @@ function Section(props) {
return
(
<
PremButton
pop=
{
{
title
:
'是否删除该
用户
?'
,
title
:
'是否删除该
工段
?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
async
()
=>
{
...
...
@@ -142,12 +142,14 @@ function Section(props) {
addconfig=
{
{
// access: 'sysDepartment_save',
btn
:
{
type
:
'primary'
,
disabled
:
false
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
null
,
detailpath
:
null
,
title
:
'新增'
,
val
:
'add'
,
onFinish
:
async
(
vals
)
=>
{
...
...
@@ -160,7 +162,7 @@ function Section(props) {
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'新增成功!'
);
set
Draw
((
s
)
=>
({
set
drawer
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
...
...
src/pages/setting/users/index.jsx
View file @
fd65ec2a
...
...
@@ -103,12 +103,14 @@ function Users(props) {
addconfig=
{
{
// access: 'sysDepartment_save',
btn
:
{
type
:
'primary'
,
disabled
:
false
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
null
,
detailpath
:
null
,
title
:
'新增'
,
val
:
'add'
,
}));
...
...
@@ -135,4 +137,4 @@ function Users(props) {
);
}
export
default
Users
;
\ No newline at end of file
export
default
Users
;
src/pages/setting/workshop/index.jsx
View file @
fd65ec2a
/* 车间管理
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:18
* @Last Modified by:
Li Hanlin
* @Last Modified time: 2022-11-
09 14:44:18
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-
10 15:36:27
*/
import
*
as
React
from
'react'
;
...
...
@@ -141,12 +141,14 @@ function Factory(props) {
addconfig=
{
{
// access: 'sysDepartment_save',
btn
:
{
type
:
'primary'
,
disabled
:
false
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
null
,
detailpath
:
null
,
title
:
'新增'
,
val
:
'add'
,
onFinish
:
async
(
vals
)
=>
{
...
...
@@ -159,7 +161,7 @@ function Factory(props) {
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'新增成功!'
);
set
Draw
((
s
)
=>
({
set
drawer
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
...
...
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