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
7f8afc0d
Commit
7f8afc0d
authored
Nov 28, 2022
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
11281759
parent
83519c19
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
261 additions
and
58 deletions
+261
-58
authRoutes.js
config/authRoutes.js
+6
-0
columns.js
src/pages/system/dictionary/columns.js
+3
-22
index.jsx
src/pages/system/dictionary/index.jsx
+24
-26
index.jsx
src/pages/system/field/index.jsx
+17
-10
columns.js
src/pages/system/rules/columns.js
+13
-0
index.jsx
src/pages/system/rules/index.jsx
+198
-0
No files found.
config/authRoutes.js
View file @
7f8afc0d
...
...
@@ -104,6 +104,12 @@ export default [
icon
:
''
,
component
:
'./system/field'
,
},
{
name
:
'编号规则'
,
path
:
'/system/rules'
,
icon
:
''
,
component
:
'./system/rules'
,
},
],
},
];
src/pages/system/dictionary/columns.js
View file @
7f8afc0d
...
...
@@ -4,6 +4,7 @@ function getcolumns(setdrawer) {
title
:
'数据编号'
,
dataIndex
:
'dataCode'
,
key
:
'dataCode'
,
hideInForm
:
true
,
formItemProps
:
{
rules
:
[
{
...
...
@@ -20,7 +21,7 @@ function getcolumns(setdrawer) {
formItemProps
:
{
rules
:
[
{
required
:
fals
e
,
required
:
tru
e
,
message
:
'此项为必填项'
,
},
],
...
...
@@ -32,6 +33,7 @@ function getcolumns(setdrawer) {
key
:
'dataType'
,
valueType
:
'input'
,
search
:
false
,
hideInForm
:
false
,
fieldProps
:
{
disabled
:
true
,
},
...
...
@@ -42,27 +44,6 @@ function getcolumns(setdrawer) {
key
:
'describe'
,
valueType
:
'input'
,
search
:
false
,
fieldProps
:
{
disabled
:
true
,
},
},
{
title
:
'上级组织'
,
dataIndex
:
'parentKey'
,
key
:
'parentKey'
,
formItemProps
:
{
rules
:
[
{
required
:
false
,
message
:
'此项为必填项'
,
},
],
},
fieldProps
:
{
placeholder
:
'请输入'
,
disabled
:
true
,
},
search
:
false
,
},
];
}
...
...
src/pages/system/dictionary/index.jsx
View file @
7f8afc0d
...
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-24 11:16:02
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-28 1
0:53:27
* @Last Modified time: 2022-11-28 1
7:34:52
*/
import
*
as
React
from
'react'
;
import
{
useState
,
useMemo
,
useRef
}
from
'react'
;
...
...
@@ -55,15 +55,16 @@ function Type(props) {
<
PremButton
btn=
{
{
size
:
'small'
,
disabled
:
row
?.
dataType
==
1
?
true
:
false
,
onClick
:
()
=>
{
console
.
log
(
row
);
setDrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
// detailpath: urlParams.detail,
// params:
{
id
:
row
.
key
},
item
:
{
...
row
,
departmentName
:
row
.
title
,
dataType
:
row
?.
dataTypeName
,
dataName
:
row
?.
title
,
},
title
:
'编辑'
,
val
:
'edit'
,
...
...
@@ -73,10 +74,10 @@ function Type(props) {
...
vals
,
id
:
row
.
key
,
parentId
:
row
.
parentKey
,
departmentType
:
row
.
departmentType
,
};
console
.
log
(
params
);
delete
params
.
title
;
delete
params
.
dataType
;
let
res
=
await
doFetch
({
url
:
urlParams
.
save
,
params
,
...
...
@@ -103,34 +104,31 @@ function Type(props) {
return
(
<
PremButton
btn=
{
{
// disabled: row?.dataType == 1 ? true : false,
size
:
'small'
,
onClick
:
()
=>
{
setDrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
detailpath
:
null
,
item
:
{
parentKey
:
row
.
title
,
departmentTypeName
:
'部门类型'
,
dataType
:
'自定义'
,
},
title
:
'新增
组织
'
,
title
:
'新增
数据
'
,
val
:
'addChild'
,
onFinish
:
async
(
vals
)
=>
{
console
.
log
(
vals
);
let
params
=
{
...
vals
,
parentId
:
row
.
key
,
equipmentTypeName
:
vals
.
title
,
departmentType
:
'1'
,
};
delete
params
.
title
;
delete
params
.
parentKey
;
delete
params
.
dataType
;
let
res
=
await
doFetch
({
url
:
urlParams
.
save
,
params
,
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'新增
组织
成功!'
);
message
.
success
(
'新增
数据
成功!'
);
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
...
...
@@ -142,7 +140,7 @@ function Type(props) {
},
}
}
>
新增
组织
新增
数据
</
PremButton
>
);
};
...
...
@@ -151,7 +149,8 @@ function Type(props) {
return
(
<
PremButton
pop=
{
{
title
:
'是否删除该设备类型?'
,
title
:
'是否删除该字典项?'
,
disabled
:
row
?.
dataType
==
1
?
true
:
false
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
async
()
=>
{
...
...
@@ -168,6 +167,7 @@ function Type(props) {
}
}
btn=
{
{
size
:
'small'
,
disabled
:
row
?.
dataType
==
1
?
true
:
false
,
type
:
'danger'
,
}
}
>
...
...
@@ -178,20 +178,18 @@ function Type(props) {
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
setDrawer
);
if
(
drawer
?.
val
==
'add'
||
drawer
?.
val
==
'edit'
)
{
defcolumn
[
3
].
hideInForm
=
true
;
}
else
{
defcolumn
[
3
].
hideInForm
=
false
;
}
return
defcolumn
.
concat
({
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
addChild
(
text
,
row
,
_
,
action
),
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
),
],
render
:
(
text
,
row
,
_
,
action
)
=>
{
if
(
row
?.
parentKey
==
'0'
)
{
return
[
addChild
(
text
,
row
,
_
,
action
)];
}
else
{
return
[
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
)];
}
},
});
},
[
drawer
.
val
]);
...
...
src/pages/system/field/index.jsx
View file @
7f8afc0d
...
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-10 09:39:56
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-28 1
5:57:26
* @Last Modified time: 2022-11-28 1
6:41:55
*/
import
*
as
React
from
'react'
;
...
...
@@ -29,7 +29,7 @@ function Field(props) {
[
extraparams
,
setextraparams
]
=
useState
({}),
urlParams
=
{
save
:
'/base/paFormField/save'
,
remove
:
'/
asset/equipment/deleteById
'
,
remove
:
'/
base/paFormField/delete
'
,
list
:
'/base/paFormField/queryPage'
,
detail
:
'/asset/equipment/detail'
,
formList
:
'/base/paForm/queryList'
,
...
...
@@ -72,20 +72,28 @@ function Field(props) {
visible
:
true
,
title
:
'编辑'
,
val
:
'edit'
,
detailpath
:
urlParams
.
detail
,
params
:
{
id
:
row
.
id
},
// detailpath: urlParams.detail,
// params:
{
id
:
row
.
id
},
item
:
{
...
row
,
fieldChar
:
String
(
row
?.
fieldChar
),
formName
:
drawer
?.
formName
,
formId
:
drawer
?.
formId
,
},
onFinish
:
async
(
vals
)
=>
{
console
.
log
(
1
);
console
.
log
(
vals
);
let
params
=
{
...
vals
,
id
:
row
.
id
,
formId
:
drawer
?.
formId
,
};
delete
params
.
formName
;
let
res
=
await
doFetch
({
url
:
urlParams
.
save
,
params
,
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'
编辑
成功!'
);
message
.
success
(
'
新增
成功!'
);
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
...
...
@@ -106,7 +114,7 @@ function Field(props) {
return
(
<
PremButton
pop=
{
{
title
:
'是否删除该
设备
?'
,
title
:
'是否删除该
字段
?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
async
()
=>
{
...
...
@@ -147,7 +155,7 @@ function Field(props) {
<
div
className=
"ant-card-head"
>
<
div
className=
"ant-card-head-wrapper"
>
<
div
className=
"ant-card-head-title"
>
<
h3
className=
"page-title"
>
设备台账
</
h3
>
<
h3
className=
"page-title"
>
扩展字段
</
h3
>
</
div
>
</
div
>
</
div
>
...
...
@@ -156,7 +164,6 @@ function Field(props) {
<
div
>
<
h3
style=
{
{
fontWeight
:
600
,
paddingLeft
:
24
,
paddingRight
:
24
,
paddingTop
:
24
,
...
...
@@ -173,7 +180,7 @@ function Field(props) {
});
setDrawer
((
s
)
=>
({
...
s
,
formName
:
items
[
e
?.
key
]
,
formName
:
items
.
filter
((
it
)
=>
it
?.
key
==
e
?.
key
)[
0
].
label
,
formId
:
e
?.
key
,
}));
}
}
...
...
src/pages/system/rules/columns.js
0 → 100644
View file @
7f8afc0d
function
getcolumns
(
setdrawer
)
{
return
[
{
title
:
'单号类型'
,
dataIndex
:
'noTypeName'
,
key
:
'noTypeId'
},
{
title
:
'预览'
,
dataIndex
:
'ruleNames'
,
key
:
'ruleNames'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
];
}
export
default
getcolumns
;
src/pages/system/rules/index.jsx
0 → 100644
View file @
7f8afc0d
/* 编号规则
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-28 17:56:41
*/
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
Rules
(
props
)
{
const
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
setDrawer
]
=
useState
({
visible
:
false
,
});
const
urlParams
=
{
save
:
'/base/bmNumberRule/save'
,
remove
:
'/auth/sysFactory/delete'
,
list
:
'/base/bmNumberRule/queryList'
,
detail
:
'/base/bmNumberRule/queryByNoTypeId'
,
};
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'
,
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
();
}
},
}));
},
}
}
>
编辑
</
PremButton
>
);
};
const
remove
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
pop=
{
{
title
:
'是否删除该规则?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
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=
{
{
size
:
'small'
,
type
:
'danger'
,
}
}
>
删除
</
PremButton
>
);
};
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
setDrawer
);
return
defcolumn
.
concat
({
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
)],
});
},
[]);
return
(
<
div
style=
{
{
position
:
'relative'
}
}
>
<
AutoTable
pagetitle=
{
<
h3
className=
"page-title"
>
编号规则
</
h3
>
}
columns=
{
columns
}
path=
{
urlParams
.
list
}
actionRef=
{
actionRef
}
pageextra=
{
'add'
}
resizeable=
{
false
}
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
)
=>
{
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
();
}
},
}));
},
},
}
}
/>
<
DrawerPro
fields=
{
columns
}
// detailpath={urlParams.detail}
// params={{ id: drawer?.item?.id }}
defaultFormValue=
{
drawer
?.
item
??
{}
}
formRef=
{
formRef
}
placement=
"right"
onClose=
{
()
=>
{
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
}
}
{
...
drawer
}
/>
</
div
>
);
}
export
default
Rules
;
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