Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wms
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
wms
Commits
0d299f54
Commit
0d299f54
authored
Jun 17, 2022
by
wuhao
🎯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sdfad
parent
6d380451
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
470 additions
and
266 deletions
+470
-266
app.jsx
src/app.jsx
+3
-3
index.jsx
src/components/AutoTable/index.jsx
+4
-0
index.jsx
src/components/Deletecheck/index.jsx
+1
-1
index.jsx
src/components/TagView/Tags/index.jsx
+1
-1
index.jsx
src/components/TreeRender/index.jsx
+198
-0
Index.jsx
src/pages/craft/Materiel/Index.jsx
+236
-224
index.jsx
src/pages/platform/Provide/index.jsx
+9
-19
device.js
src/services/device.js
+18
-18
No files found.
src/app.jsx
View file @
0d299f54
...
...
@@ -58,8 +58,8 @@ export async function getInitialState() {
fetchUserInfo
,
settings
:
defaultSettings
,
getmenuData
,
collapsed
:
false
collapsed
:
false
,
tagList
:
[]
};
}
// ProLayout 支持的api https://procomponents.ant.design/components/layout
export
const
layout
=
async
(
props
)
=>
{
...
...
@@ -67,7 +67,7 @@ export const layout = async (props) => {
let
token
=
localStorage
.
getItem
(
"TOKEN_MES"
);
return
{
headerContentRender
:
()
=>
<
RightContent
/>,
rightContentRender
:
()
=>
null
,
rightContentRender
:
()
=>
null
,
disableContentMargin
:
false
,
waterMarkProps
:
{
content
:
initialState
?.
currentUser
?.
name
,
...
...
src/components/AutoTable/index.jsx
View file @
0d299f54
...
...
@@ -21,6 +21,8 @@ export default (props) => {
</
div
>
)
:
props
.
withCard
===
false
?
(
<
div
style=
{
{
display
:
"flex"
,
width
:
"100%"
}
}
>
{
(
props
.
childposition
==
"left"
||
!
props
.
childposition
)
&&
props
.
children
}
<
div
style=
{
{
flex
:
1
,
width
:
"100%"
}
}
>
{
props
.
childposition
==
"top"
&&
props
.
children
}
<
Mtable
{
...
props
}
/>
...
...
@@ -39,6 +41,8 @@ export default (props) => {
onTabChange=
{
props
.
onTabChange
}
>
<
div
style=
{
{
display
:
"flex"
,
width
:
"100%"
}
}
>
{
(
props
.
childposition
==
"left"
||
!
props
.
childposition
)
&&
props
.
children
}
<
div
style=
{
{
flex
:
1
,
width
:
"100%"
}
}
>
{
props
.
childposition
==
"top"
&&
props
.
children
}
<
Mtable
{
...
props
}
/>
...
...
src/components/Deletecheck/index.jsx
View file @
0d299f54
...
...
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
import
{
Button
,
Popconfirm
}
from
'antd'
;
const
Deletecheck
=
props
=>
{
const
{
name
,
type
,
text
,
clickfn
,
pop
,
btnType
}
=
props
;
const
{
name
,
type
,
text
,
clickfn
,
pop
,
btnType
}
=
props
;
//点击删除按钮,若需要调取接口进行校验,需要传btnType,且值为deleteCheck
const
[
title
,
ct
]
=
useState
(
btnType
==
"deleteCheck"
?
""
:
pop
?.
title
),
...
...
src/components/TagView/Tags/index.jsx
View file @
0d299f54
...
...
@@ -60,7 +60,7 @@ const Tags = ({
return
(
<
div
className=
{
styles
.
tags_wrapper
}
ref=
{
tagListRef
}
>
<
Scrollbars
autoHide
autoHideTimeout=
{
1000
}
autoHideDuration=
{
200
}
>
{
tagList
.
map
((
item
,
i
)
=>
(
{
tagList
?.
map
?.
((
item
,
i
)
=>
(
<
div
key=
{
item
.
path
}
className=
{
...
...
src/components/TreeRender/index.jsx
0 → 100644
View file @
0d299f54
import
React
,
{
useState
,
useMemo
}
from
'react'
;
import
{
Tree
,
Input
,
Card
,
Tooltip
,
Divider
}
from
'antd'
;
import
{
MinusSquareOutlined
,
FormOutlined
,
PlusSquareOutlined
}
from
'@ant-design/icons'
;
import
getPrem
from
'@/utils/getPrem'
;
import
{
useRequest
}
from
'ahooks'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
let
{
Search
}
=
Input
;
function
TreeRender
({
url
,
deleteurl
,
saveurl
,
onselected
})
{
const
[
search
,
setsearch
]
=
useState
(
""
);
const
{
data
,
loading
}
=
useRequest
(()
=>
{
return
doFetch
({
url
,
params
:
{
title
:
search
}
})
});
const
treeData
=
useMemo
(()
=>
{
return
data
?.
data
?.
dataList
??
[]
},
[
data
]);
const
loop
=
data
=>
data
.
map
(
item
=>
{
const
index
=
item
.
title
.
indexOf
(
search
);
const
beforeStr
=
item
.
title
.
substr
(
0
,
index
);
const
afterStr
=
item
.
title
.
substr
(
index
+
search
.
length
);
const
title
=
index
>
-
1
?
(
<
Tooltip
title=
{
item
.
title
}
placement=
"bottom"
>
<
span
style=
{
{
display
:
"inline-block"
,
maxWidth
:
68
,
overflow
:
"hidden"
,
textOverflow
:
"ellipsis"
,
whiteSpace
:
"nowrap"
}
}
>
{
beforeStr
}
<
span
style=
{
{
color
:
'#f50'
}
}
>
{
search
}
</
span
>
{
afterStr
}
</
span
>
</
Tooltip
>
)
:
(
<
Tooltip
title=
{
item
.
title
}
placement=
"bottom"
>
<
span
style=
{
{
display
:
"inline-block"
,
maxWidth
:
68
,
overflow
:
"hidden"
,
textOverflow
:
"ellipsis"
,
whiteSpace
:
"nowrap"
}
}
>
{
item
.
title
}
</
span
>
</
Tooltip
>
);
const
actiontitle
=
(
<
div
style=
{
{
display
:
"flex"
,
alignItems
:
"center"
}
}
>
{
title
}
<
Divider
type=
'vertical'
style=
{
{
margin
:
"0 6px"
}
}
></
Divider
>
<
Tooltip
title=
"编辑"
onClick=
{
(
e
)
=>
{
e
.
stopPropagation
();
const
_it
=
this
;
this
.
setState
({
savetitle
:
null
})
if
(
getPrem
(
"enElectricityMeterType_save"
,
"ifs"
))
{
Modal
.
confirm
({
icon
:
<></>,
closable
:
true
,
title
:
"修改电表结构名称"
,
content
:
<
div
>
<
Input
placeholder=
{
item
.
title
}
allowClear
onChange=
{
(
e
)
=>
{
_it
.
setState
({
savetitle
:
e
.
target
.
value
})
}
}
></
Input
>
</
div
>,
okText
:
"修改"
,
cancelText
:
"取消"
,
onOk
:
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
_it
.
state
.
savetitle
)
{
ammeterTreeSave
({
electricityMeterTypeName
:
_it
.
state
.
savetitle
,
id
:
item
.
key
,
}).
then
(
res
=>
{
if
(
res
.
code
==
"0000"
)
{
_it
.
resetData
()
}
})
resolve
()
}
else
{
message
.
warn
(
"请输入修改的名称"
)
reject
()
}
})
}
})
}
}
}
>
<
FormOutlined
style=
{
{
color
:
"#1890ff"
}
}
/>
</
Tooltip
>
<
Divider
type=
'vertical'
style=
{
{
margin
:
"0 6px"
}
}
></
Divider
>
<
Tooltip
title=
"新增"
>
<
PlusSquareOutlined
disabled=
{
!
getPrem
(
"enElectricityMeterType_save"
,
"ifs"
)
}
onClick=
{
(
e
)
=>
{
e
.
stopPropagation
();
const
_it
=
this
;
this
.
setState
({
savetitle
:
null
})
if
(
getPrem
(
"enElectricityMeterType_save"
,
"ifs"
))
{
Modal
.
confirm
({
icon
:
<></>,
closable
:
true
,
title
:
"新增子结构"
,
content
:
<
div
>
<
div
style=
{
{
marginBottom
:
15
,
color
:
"#f50"
,
fontSize
:
16
}
}
>
当前结构:
{
item
.
title
}
</
div
>
<
Input
placeholder=
"子结构"
allowClear
onChange=
{
(
e
)
=>
{
_it
.
setState
({
savetitle
:
e
.
target
.
value
})
}
}
></
Input
>
</
div
>,
okText
:
"新增"
,
cancelText
:
"取消"
,
onOk
:
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
_it
.
state
.
savetitle
)
{
ammeterTreeSave
({
electricityMeterTypeName
:
_it
.
state
.
savetitle
,
parentId
:
item
.
key
}).
then
(
res
=>
{
if
(
res
.
code
==
"0000"
)
{
_it
.
resetData
()
}
})
resolve
()
}
else
{
message
.
warn
(
"请输入修改的名称"
)
reject
()
}
})
}
})
}
}
}
style=
{
{
color
:
`${getPrem("enElectricityMeterType_save", "ifs") ? "green" : ""}`
}
}
/></
Tooltip
>
{
(
!
item
.
children
||
item
.
children
.
length
==
0
)
&&
<
Divider
type=
'vertical'
style=
{
{
margin
:
"0 6px"
}
}
></
Divider
>
}
{
(
!
item
.
children
||
item
.
children
.
length
==
0
)
&&
<
Popconfirm
placement=
'bottom'
title=
"是否删除该电表结构?"
okText=
"删除"
cancelText=
"取消"
onConfirm=
{
()
=>
{
ammeterTreeDelete
({
id
:
item
.
key
}).
then
(
res
=>
{
if
(
res
.
code
==
'0000'
)
{
this
.
resetData
()
}
})
}
}
disabled=
{
!
getPrem
(
"enElectricityMeterType_deleteById"
,
"ifs"
)
}
>
<
Tooltip
title=
"删除"
>
<
MinusSquareOutlined
onClick=
{
(
e
)
=>
{
e
.
stopPropagation
()
}
}
style=
{
{
color
:
"red"
}
}
/>
</
Tooltip
>
</
Popconfirm
>
}
</
div
>
)
// if (item.children) {
// return (
// <TreeNode key={item.key} title={actiontitle}>
// {loop(item.children)}
// </TreeNode>
// );
// }
// return <TreeNode key={item.key} title={title} />;
return
(
<
TreeNode
key=
{
item
.
key
}
title=
{
actiontitle
}
>
{
item
.
children
&&
loop
(
item
.
children
)
}
</
TreeNode
>
);
});
return
(
<
div
>
<
Search
style=
{
{
margin
:
'16px 0 8px 0'
}
}
placeholder=
"搜索电表结构"
onChange=
{
setsearch
}
/>
<
Tree
onSelect=
{
(
selectedKeys
,
e
)
=>
{
onselected
?.(
selectedKeys
)
}
}
autoExpandParent=
{
true
}
>
{
loop
(
treeData
?
treeData
:
[])
}
</
Tree
>
</
div
>
);
}
export
default
TreeRender
;
\ No newline at end of file
src/pages/craft/Materiel/Index.jsx
View file @
0d299f54
This diff is collapsed.
Click to expand it.
src/pages/platform/Provide/index.jsx
View file @
0d299f54
...
...
@@ -157,7 +157,7 @@ const Deviceprovide = (props) => {
return
<
Popconfirm
title=
"是否开启或关闭供应商?"
onConfirm=
{
()
=>
{
run
({
url
:
"/
qj/ngic-equipment-asset/equipment
Supplier/update/status"
,
params
:
{
id
:
row
.
id
,
status
:
row
.
status
==
1
?
0
:
1
}
})
run
({
url
:
"/
ngic-auth/sys
Supplier/update/status"
,
params
:
{
id
:
row
.
id
,
status
:
row
.
status
==
1
?
0
:
1
}
})
}
}
onCancel=
{
()
=>
{
...
...
@@ -182,6 +182,7 @@ const Deviceprovide = (props) => {
formatResult
:
(
res
)
=>
res
,
onSuccess
:
(
result
,
params
)
=>
{
if
(
result
.
code
==
"0000"
)
{
message
.
success
(
"操作成功!"
)
reload
();
dispatch
({
type
:
"close"
})
}
...
...
@@ -200,23 +201,12 @@ const Deviceprovide = (props) => {
}
})
}),
<
Deletecheck
name=
{
"equipmentSupplier_deleteById"
}
type=
{
action
}
text=
"删除"
clickfn=
{
()
=>
{
return
deleteProvideCheck
({
id
:
record
.
id
,
deleteCheck
:
true
})
}
}
pop=
{
{
title
:
"确认删除该供应商?"
,
onConfirm
:
()
=>
{
run
({
url
:
"/qj/ngic-equipment-asset/equipmentSupplier/deleteById"
,
params
:
{
id
:
record
.
id
}
})
}
}
getPrem
(
"equipmentSupplier_deleteById"
,
action
,
'删除'
,
null
,{
title
:
"确认删除该供应商?"
,
onConfirm
:
()
=>
{
run
({
url
:
"/ngic-auth/sysSupplier/deleteById"
,
params
:
{
id
:
record
.
id
}
})
}
btnType=
"deleteCheck"
/>
})
];
};
let
saveData
=
(
values
,
fn
)
=>
{
...
...
@@ -231,7 +221,7 @@ const Deviceprovide = (props) => {
...
newfields
,
supplierUserList
}
run
({
url
:
"/
qj/ngic-equipment-asset/equipment
Supplier/save"
,
params
:
{
...
params
,
...
difrid
}
})
run
({
url
:
"/
ngic-auth/sys
Supplier/save"
,
params
:
{
...
params
,
...
difrid
}
})
};
let
extrarender
=
([
<
Button
disabled=
{
!
getPrem
(
"equipmentSupplier_save"
,
"ifs"
)
}
type=
"primary"
onClick=
{
()
=>
{
...
...
@@ -249,7 +239,7 @@ const Deviceprovide = (props) => {
pagetitle=
{
props
.
route
.
name
}
//页面标题
pageextra=
{
extrarender
}
//页面操作 新增or批量删除
columns=
{
columns
}
path=
"/
qj/ngic-equipment-asset/equipment
Supplier/queryList"
path=
"/
ngic-auth/sys
Supplier/queryList"
actionRef=
{
actionRef
}
onRef=
{
node
=>
ChildRef
=
node
}
></
AutoTable
>
...
...
src/services/device.js
View file @
0d299f54
...
...
@@ -2,7 +2,7 @@ import request from '@/utils/request';
//设备型号下拉框
export
async
function
equipmentModelList
(
params
)
{
return
request
(
'/
qj
/ngic-equipment-asset/equipmentModel/query/selection'
,
{
return
request
(
'/
wms
/ngic-equipment-asset/equipmentModel/query/selection'
,
{
method
:
'POST'
,
data
:
params
,
});
...
...
@@ -10,91 +10,91 @@ export async function equipmentModelList(params) {
//设备型号--(保养标准页面)下拉框
export
async
function
equipmentMaintainModelList
(
params
)
{
return
request
(
'/
qj
/ngic-equipment-asset/equipmentModel/query/selection/maintainStandard'
,
{
return
request
(
'/
wms
/ngic-equipment-asset/equipmentModel/query/selection/maintainStandard'
,
{
method
:
'POST'
,
data
:
params
,
});
}
//设备型号--(点检标准页面)下拉框
export
async
function
equipmentCheckModelList
(
params
)
{
return
request
(
'/
qj
/ngic-equipment-asset/equipmentModel/query/selection/checkStandard'
,
{
return
request
(
'/
wms
/ngic-equipment-asset/equipmentModel/query/selection/checkStandard'
,
{
method
:
'POST'
,
data
:
params
,
});
}
//根据设备型号id查询是寿命件的备件
export
async
function
lifespareSelect
(
params
)
{
return
request
(
`/
qj
/ngic-equipment-asset/equipmentModelSpare/liveparts/selectionbox/byEquipmentModelId`
,
{
return
request
(
`/
wms
/ngic-equipment-asset/equipmentModelSpare/liveparts/selectionbox/byEquipmentModelId`
,
{
method
:
'POST'
,
data
:
params
});
}
//备件下拉框
export
async
function
mdmSpareList
(
params
)
{
return
request
(
`/
qj
/ngic-spare-parts/mdmSpareParts/mdmSpareList`
,
{
return
request
(
`/
wms
/ngic-spare-parts/mdmSpareParts/mdmSpareList`
,
{
method
:
'POST'
,
data
:
params
});
}
//设备供应商详情
export
async
function
deviceprovideDetail
(
params
)
{
return
request
(
'/
qj/ngic-equipment-asset/equipment
Supplier/query/detail'
,
{
return
request
(
'/
wms/ngic-auth/sys
Supplier/query/detail'
,
{
method
:
'POST'
,
data
:
params
,
});
}
//供应商下拉框
export
async
function
equipmentSupplierList
(
params
)
{
return
request
(
'/
qj
/ngic-equipment-asset/equipmentSupplier/query/selection'
,
{
return
request
(
'/
wms
/ngic-equipment-asset/equipmentSupplier/query/selection'
,
{
method
:
'POST'
,
data
:
params
,
});
}
//设备供应商删除前校验
export
async
function
deleteProvideCheck
(
params
)
{
return
request
(
'/
qj
/ngic-equipment-asset/equipmentSupplier/deleteById'
,
{
return
request
(
'/
wms
/ngic-equipment-asset/equipmentSupplier/deleteById'
,
{
method
:
'POST'
,
data
:
params
,
});
}
//设备信息
export
async
function
equipmentDetail
(
params
)
{
return
request
(
'/
qj
/ngic-equipment-asset/equipment/queryDetail'
,
{
return
request
(
'/
wms
/ngic-equipment-asset/equipment/queryDetail'
,
{
method
:
'POST'
,
data
:
params
,
});
}
//查询父设备id和子设备id,添加子设备时使用
export
async
function
equipmentChildren
(
params
)
{
return
request
(
'/
qj
/ngic-equipment-asset/equipment/queryChildren'
,
{
return
request
(
'/
wms
/ngic-equipment-asset/equipment/queryChildren'
,
{
method
:
'POST'
,
data
:
params
,
});
}
//履历详情
export
async
function
equipmentLogDetail
(
params
)
{
return
request
(
'/
qj
/ngic-equipment-asset/equipmentLog/query/detail'
,
{
return
request
(
'/
wms
/ngic-equipment-asset/equipmentLog/query/detail'
,
{
method
:
'POST'
,
data
:
params
,
});
}
//设备类型树查询
export
async
function
deviceTypequeryTreeList
(
params
)
{
return
request
(
`/
qj
/ngic-equipment-asset/equipmentType/queryTreeList`
,
{
return
request
(
`/
wms
/ngic-equipment-asset/equipmentType/queryTreeList`
,
{
method
:
'POST'
,
data
:
params
,
});
}
//设备详情
export
async
function
equipmentAllDetail
(
params
)
{
return
request
(
'/
qj
/ngic-equipment-asset/equipment/query/all/detail'
,
{
return
request
(
'/
wms
/ngic-equipment-asset/equipment/query/all/detail'
,
{
method
:
'POST'
,
data
:
params
,
});
}
//设备型号详情
export
async
function
equipmentModelDetails
(
params
)
{
return
request
(
'/
qj
/ngic-equipment-asset/equipmentModelSpare/queryById'
,
{
return
request
(
'/
wms
/ngic-equipment-asset/equipmentModelSpare/queryById'
,
{
method
:
'POST'
,
data
:
params
,
});
...
...
@@ -102,14 +102,14 @@ export async function equipmentModelDetails(params) {
//设备下拉框
export
async
function
equipmentList
(
params
)
{
return
request
(
'/
qj
/ngic-equipment-asset/equipment/query/selection'
,
{
return
request
(
'/
wms
/ngic-equipment-asset/equipment/query/selection'
,
{
method
:
'POST'
,
data
:
params
,
});
}
//IOT设备下拉框
export
async
function
equipmentIotRelationList
(
params
)
{
return
request
(
'/
qj
/ngic-equipment-asset/equipmentIotRelation/query/device/selection'
,
{
return
request
(
'/
wms
/ngic-equipment-asset/equipmentIotRelation/query/device/selection'
,
{
method
:
'POST'
,
data
:
params
,
});
...
...
@@ -117,7 +117,7 @@ export async function equipmentIotRelationList(params) {
//设备下拉框(过滤已报修)
export
async
function
canApplyRepair
(
params
)
{
return
request
(
'/
qj
/ngic-equipment-repair/omEquipmentApplyRepair/canApplyRepair/equipmens/selection'
,
{
return
request
(
'/
wms
/ngic-equipment-repair/omEquipmentApplyRepair/canApplyRepair/equipmens/selection'
,
{
method
:
'POST'
,
data
:
params
,
});
...
...
@@ -125,7 +125,7 @@ export async function canApplyRepair(params) {
//关联备件
export
async
function
equipmentModelSpareImport
(
params
)
{
return
request
(
'/
qj
/ngic-equipment-asset/equipmentModelSpare/importExcel'
,
{
return
request
(
'/
wms
/ngic-equipment-asset/equipmentModelSpare/importExcel'
,
{
method
:
'POST'
,
data
:
params
,
type
:
"form"
...
...
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