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
f95740a1
Commit
f95740a1
authored
Dec 07, 2022
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
20221207
parent
12d2fab9
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
202 additions
and
49 deletions
+202
-49
index.jsx
src/components/Addform/index.jsx
+45
-3
index.jsx
src/components/InitForm/index.jsx
+6
-0
AvatarDropdown.jsx
src/components/RightContent/AvatarDropdown.jsx
+2
-3
index.jsx
src/pages/device/account/index.jsx
+1
-1
index.jsx
src/pages/repair/failure/index.jsx
+4
-2
columns.js
src/pages/repair/fault/columns.js
+9
-0
index.jsx
src/pages/repair/fault/index.jsx
+110
-17
index.jsx
src/pages/repair/track/index.jsx
+13
-9
columns.js
src/pages/setting/users/columns.js
+2
-11
columns.js
src/pages/setting/workshop/columns.js
+4
-1
index.jsx
src/pages/setting/workshop/index.jsx
+6
-2
No files found.
src/components/Addform/index.jsx
View file @
f95740a1
import
{
useState
,
useEffect
}
from
'react'
;
import
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
InitForm
from
'@/components/InitForm'
;
import
{
message
}
from
'antd'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
const
App
=
()
=>
{
const
App
=
(
{
url
,
actionRef
,
setdrawer
}
)
=>
{
const
columns
=
[
{
title
:
'选择设备'
,
...
...
@@ -98,9 +100,49 @@ const App = () => {
},
},
];
const
formRef
=
useRef
();
return
(
<>
<
InitForm
fields=
{
columns
}
/>
<
InitForm
formRef=
{
formRef
}
fields=
{
columns
}
onValuesChange=
{
(
changedValues
,
allValues
)
=>
{
console
.
log
(
changedValues
,
allValues
);
if
(
Object
.
keys
(
changedValues
)[
0
]
==
'faultDetailId'
)
{
doFetch
({
url
:
'/repair/umFaultSettingDetail/queryById'
,
params
:
{
id
:
changedValues
?.
faultDetailId
,
},
}).
then
((
res
)
=>
{
console
.
log
(
res
);
formRef
?.
current
?.
setFieldsValue
({
faultDescription
:
res
?.
data
?.
data
.
faultPhenomenon
,
});
});
}
}
}
onFinish=
{
async
(
vals
)
=>
{
console
.
log
(
vals
);
let
params
=
{
...
vals
,
};
let
res
=
await
doFetch
({
url
,
params
,
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'新建成功!'
);
setdrawer
((
s
)
=>
({
...
s
,
open
:
false
,
}));
actionRef
.
current
.
reload
();
}
}
}
/>
</>
);
};
...
...
src/components/InitForm/index.jsx
View file @
f95740a1
...
...
@@ -96,6 +96,9 @@ function InitForm({
fields
,
extendField
=
''
,
colProps
=
{
xs
:
24
,
sm
:
24
,
md
:
12
,
lg
:
12
,
xl
:
12
,
xxl
:
12
},
onValuesChange
=
(
changedValues
,
allValues
)
=>
{
console
.
log
(
changedValues
,
allValues
);
},
})
{
let
proformRef
=
useRef
();
proformRef
=
formRef
??
proformRef
;
...
...
@@ -145,6 +148,9 @@ function InitForm({
}
}
}
autoFocusFirstInput
onValuesChange=
{
(
changedValues
,
allValues
)
=>
{
onValuesChange
?.(
changedValues
,
allValues
);
}
}
>
<
FormRender
fields=
{
fields
.
filter
((
it
)
=>
it
.
valueType
!=
'option'
)
}
...
...
src/components/RightContent/AvatarDropdown.jsx
View file @
f95740a1
...
...
@@ -18,13 +18,13 @@ import moment from 'moment';
* 退出登录,并且将当前的 url 保存
*/
const
loginOut
=
async
()
=>
{
await
fakeAccountLoginOut
();
const
{
logoutRedirectUrl
}
=
await
fakeAccountLoginOut
();
const
{
query
=
{}
}
=
history
.
location
;
const
{
redirect
}
=
query
;
// Note: There may be security issues, please note
if
(
window
.
location
.
pathname
!==
'/user/login'
&&
!
redirect
)
{
localStorage
.
clear
();
history
.
replace
(
'/user/login'
);
history
.
replace
(
logoutRedirectUrl
);
}
};
...
...
@@ -121,7 +121,6 @@ const AvatarDropdown = ({ menu }) => {
if
(
!
currentUser
||
!
currentUser
.
username
)
{
return
loadings
;
}
let
saveData
=
(
values
)
=>
{
let
newfields
=
JSON
.
parse
(
JSON
.
stringify
(
values
));
...
...
src/pages/device/account/index.jsx
View file @
f95740a1
...
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-10 09:39:56
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-0
1 16:49:23
* @Last Modified time: 2022-12-0
7 13:43:37
*/
import
*
as
React
from
'react'
;
...
...
src/pages/repair/failure/index.jsx
View file @
f95740a1
...
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-12-02 11:41:03
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-0
6 16:52:05
* @Last Modified time: 2022-12-0
7 16:10:34
*/
import
*
as
React
from
'react'
;
...
...
@@ -124,7 +124,9 @@ function Failure(props) {
const
selectType
=
(
type
)
=>
{
switch
(
type
)
{
case
'add'
:
return
<
Addform
/>;
return
(
<
Addform
url=
"/repair/umFailureRepair/save"
actionRef=
{
actionRef
}
setdrawer=
{
setdrawer
}
/>
);
default
:
break
;
}
...
...
src/pages/repair/fault/columns.js
View file @
f95740a1
...
...
@@ -4,6 +4,14 @@ function getcolumns(setdrawer) {
title
:
'故障类型'
,
dataIndex
:
'faultType'
,
key
:
'faultType'
,
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
},
{
title
:
'故障代码'
,
...
...
@@ -25,6 +33,7 @@ function getcolumns(setdrawer) {
dataIndex
:
'remark'
,
key
:
'remark'
,
valueType
:
'textarea'
,
search
:
false
,
},
];
}
...
...
src/pages/repair/fault/index.jsx
View file @
f95740a1
/* 故障设置
* @Author: Li Hanlin
* @Date: 2022-12-07 11:19:30
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-07 15:12:48
*/
import
*
as
React
from
'react'
;
import
{
useState
,
useMemo
,
useRef
}
from
'react'
;
import
{
useState
,
useMemo
,
use
Effect
,
use
Ref
}
from
'react'
;
import
DrawerPro
from
'@/components/DrawerPro'
;
import
AutoTable
from
'@/components/AutoTable'
;
import
PremButton
from
'@/components/PremButton'
;
import
getcolumns
from
'./columns'
;
import
{
useRequest
}
from
'ahooks'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
InitForm
from
'@/components/InitForm'
;
import
{
ProDescriptions
}
from
'@ant-design/pro-components'
;
const
pathconfig
=
{
enableadd
:
true
,
...
...
@@ -39,7 +48,7 @@ function Fault(props) {
},
});
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
const
gzmc
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
btn=
{
{
...
...
@@ -50,7 +59,8 @@ function Fault(props) {
open
:
true
,
item
:
row
,
title
:
'详情'
,
val
:
'detail'
,
val
:
'only'
,
type
:
'gzmc'
,
title
:
'详细信息'
,
}));
},
...
...
@@ -105,18 +115,97 @@ function Fault(props) {
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
setdrawer
);
return
defcolumn
.
concat
({
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
pathconfig
?.
enabledetail
&&
detail
(
text
,
row
,
_
,
action
),
pathconfig
?.
enableedit
&&
edit
(
text
,
row
,
_
,
action
),
pathconfig
?.
enabledelete
&&
remove
(
text
,
row
,
_
,
action
),
],
if
(
drawer
?.
type
==
'gzmc'
)
{
return
defcolumn
;
}
else
{
return
defcolumn
.
concat
({
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
pathconfig
?.
enabledetail
&&
gzmc
(
text
,
row
,
_
,
action
),
pathconfig
?.
enableedit
&&
edit
(
text
,
row
,
_
,
action
),
pathconfig
?.
enabledelete
&&
remove
(
text
,
row
,
_
,
action
),
],
});
}
},
[
drawer
?.
type
]);
const
FaultName
=
()
=>
{
const
[
request
,
setrequest
]
=
useState
();
const
[
drawergz
,
setdrawergz
]
=
useState
({
open
:
false
,
});
},
[]);
useEffect
(()
=>
{
const
fn
=
async
()
=>
{
let
params
=
{
id
:
drawer
?.
item
?.
id
};
let
res
=
await
doFetch
({
url
:
'/repair/umFaultSetting/queryById'
,
params
});
setrequest
(
res
?.
data
.
data
);
};
fn
();
},
[]);
return
(
<>
<
ProDescriptions
dataSource=
{
request
}
columns=
{
columns
}
/>
<
AutoTable
columns=
{
[
{
title
:
'故障名称'
,
dataIndex
:
'faultDetailName'
,
key
:
'faultDetailName'
,
},
{
title
:
'故障代码'
,
dataIndex
:
'faultDetailCode'
,
key
:
'faultDetailCode'
,
},
{
title
:
'故障描述'
,
dataIndex
:
'faultPhenomenon'
,
key
:
'faultPhenomenon'
,
},
{
title
:
'解决方案'
,
dataIndex
:
'faultSolution'
,
key
:
'faultSolution'
,
search
:
false
,
},
]
}
path=
"/repair/umFaultSettingDetail/queryById"
params=
{
{
id
:
drawer
?.
item
.
id
}
}
pageextra=
{
'add'
}
addconfig=
{
{
// access: 'sysDepartment_save',
btn
:
{
disabled
:
false
,
type
:
'primary'
,
onClick
:
()
=>
{
setdrawergz
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
{
isShutdown
:
1
,
},
title
:
'新建追踪工单'
,
val
:
'add'
,
type
:
'add'
,
}));
},
},
}
}
/>
</>
);
};
function
selectType
(
type
)
{
switch
(
type
)
{
case
'gzmc'
:
return
<
FaultName
/>;
default
:
break
;
}
}
return
(
<
div
style=
{
{
position
:
'relative'
}
}
>
<
AutoTable
...
...
@@ -125,7 +214,7 @@ function Fault(props) {
actionRef=
{
actionRef
}
path=
{
pathconfig
?.
list
||
'/ngic-auth/sysUser/query/page'
}
pageextra=
{
pathconfig
?.
enableadd
?
'add'
:
null
}
resizeable=
{
tru
e
}
resizeable=
{
fals
e
}
addconfig=
{
{
// access: 'sysDepartment_save',
btn
:
{
...
...
@@ -145,16 +234,18 @@ function Fault(props) {
<
DrawerPro
fields=
{
columns
}
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
//
params={{ id: drawer?.item?.id }}
formRef=
{
formRef
}
placement=
"right"
detailpath=
{
pathconfig
?.
detail
||
null
}
//
detailpath={pathconfig?.detail || null}
detailData=
{
drawer
?.
item
}
defaultFormValue=
{
drawer
?.
item
}
onClose=
{
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
false
,
type
:
null
,
item
:
null
,
}));
}
}
{
...
drawer
}
...
...
@@ -165,7 +256,9 @@ function Fault(props) {
run
({
url
:
pathconfig
?.
edit
||
'/edit'
,
params
:
{
...
vals
,
id
:
drawer
?.
item
?.
id
}
});
}
}
}
/>
>
{
selectType
(
drawer
?.
type
)
}
</
DrawerPro
>
</
div
>
);
}
...
...
src/pages/repair/track/index.jsx
View file @
f95740a1
...
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-12-02 11:41:03
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-07 1
0:00:30
* @Last Modified time: 2022-12-07 1
4:31:33
*/
import
*
as
React
from
'react'
;
...
...
@@ -105,6 +105,7 @@ function Failure(props) {
actionRef
.
current
.
reload
();
}
}
}
{
...
drawer
}
/>
</>
);
...
...
@@ -193,6 +194,7 @@ function Failure(props) {
actionRef
.
current
.
reload
();
}
}
}
{
...
drawer
}
/>
</>
);
...
...
@@ -294,6 +296,7 @@ function Failure(props) {
actionRef
.
current
.
reload
();
}
}
}
{
...
drawer
}
/>
</>
);
...
...
@@ -334,7 +337,7 @@ function Failure(props) {
id
:
row
?.
id
,
};
let
res
=
await
doFetch
({
url
:
'/repair/um
OtherUnits
Order/orderReceiving'
,
url
:
'/repair/um
Track
Order/orderReceiving'
,
params
,
});
if
(
res
.
code
===
'0000'
)
{
...
...
@@ -356,7 +359,7 @@ function Failure(props) {
id
:
row
?.
id
,
};
let
res
=
await
doFetch
({
url
:
'/repair/um
OtherUnits
Order/dispatchById'
,
url
:
'/repair/um
Track
Order/dispatchById'
,
params
,
});
if
(
res
.
code
===
'0000'
)
{
...
...
@@ -386,6 +389,8 @@ function Failure(props) {
item
:
{
id
:
row
.
id
,
},
detailpath
:
null
,
params
:
null
,
val
:
'only'
,
title
:
'追踪信息'
,
}));
...
...
@@ -403,9 +408,6 @@ function Failure(props) {
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
// item:
{
// id: row.id,
//
},
val
:
'only'
,
title
:
'验证'
,
detailpath
:
'/repair/umTrackTraceinfo/queryByTrackOrderId'
,
...
...
@@ -511,7 +513,9 @@ function Failure(props) {
const
selectType
=
(
type
)
=>
{
switch
(
type
)
{
case
'add'
:
return
<
Addform
/>;
return
(
<
Addform
url=
{
'/repair/umTrackOrder/save'
}
setdrawer=
{
setdrawer
}
actionRef=
{
actionRef
}
/>
);
case
'track'
:
return
<
TrackForm
/>;
case
'check'
:
...
...
@@ -525,7 +529,7 @@ function Failure(props) {
return
(
<
div
style=
{
{
position
:
'relative'
}
}
ref=
{
containderef
}
>
<
AutoTable
pagetitle=
{
<
h3
className=
"page-title"
>
外协
工单
</
h3
>
}
pagetitle=
{
<
h3
className=
"page-title"
>
追踪
工单
</
h3
>
}
columns=
{
columns
}
path=
{
pathconfig
?.
list
||
'/ngic-auth/sysUser/query/page'
}
actionRef=
{
actionRef
}
...
...
@@ -543,7 +547,7 @@ function Failure(props) {
item
:
{
isShutdown
:
1
,
},
title
:
'新建
外协
工单'
,
title
:
'新建
追踪
工单'
,
val
:
'only'
,
type
:
'add'
,
}));
...
...
src/pages/setting/users/columns.js
View file @
f95740a1
...
...
@@ -382,7 +382,7 @@ function getcolumns(setdrawer) {
},
{
title
:
'状态'
,
hideInTable
:
true
,
//
hideInTable: true,
dataIndex
:
'statusName'
,
key
:
'status'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
...
...
@@ -398,14 +398,6 @@ function getcolumns(setdrawer) {
},
],
},
// {
// title: '状态',
// width: 50,
// hideInForm: true,
// dataIndex: 'statusName',
// key: 'status',
// search: false,
// },
{
title
:
'备注'
,
hideInTable
:
true
,
...
...
@@ -414,7 +406,6 @@ function getcolumns(setdrawer) {
key
:
'remarks'
,
search
:
false
,
},
// { title: '个人图片', hideInTable: true, dataIndex: 'userImgList', key: 'userImgList' },
{
title
:
'个人图片'
,
search
:
false
,
...
...
@@ -423,7 +414,7 @@ function getcolumns(setdrawer) {
valueType
:
'uploadImage'
,
hideInTable
:
true
,
fieldProps
:
{
limit
:
2
,
limit
:
1
,
},
render
:
(
text
,
row
)
=>
{
...
...
src/pages/setting/workshop/columns.js
View file @
f95740a1
function
getcolumns
(
setdrawer
)
{
function
getcolumns
(
ifs
)
{
return
[
{
title
:
'车间代码'
,
...
...
@@ -22,6 +22,9 @@ function getcolumns(setdrawer) {
valueType
:
'select'
,
options
:
{
path
:
'/auth/sysFactory/getAllFactorySelection'
,
params
:
{}
},
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
fieldProps
:
{
disabled
:
ifs
,
},
},
];
}
...
...
src/pages/setting/workshop/index.jsx
View file @
f95740a1
...
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:18
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-1
1-10 15:36:27
* @Last Modified time: 2022-1
2-07 16:37:56
*/
import
*
as
React
from
'react'
;
...
...
@@ -56,13 +56,16 @@ function Factory(props) {
<
PremButton
btn=
{
{
size
:
'small'
,
onClick
:
()
=>
{
onClick
:
async
()
=>
{
// let res = await doFetch(
{
url
:
''
,
params
:
{}
});
setdrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
row
,
title
:
'编辑'
,
val
:
'edit'
,
fields
:
getcolumns
(
true
),
onFinish
:
async
(
vals
)
=>
{
let
params
=
{
...
vals
,
...
...
@@ -151,6 +154,7 @@ function Factory(props) {
detailpath
:
null
,
title
:
'新增'
,
val
:
'add'
,
fields
:
getcolumns
(
false
),
onFinish
:
async
(
vals
)
=>
{
let
params
=
{
...
vals
,
...
...
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