Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
f03902bb
Commit
f03902bb
authored
Jul 28, 2022
by
季圣华
Browse files
优化功能模块页面
parent
0fd608fd
Changes
3
Hide whitespace changes
Inline
Side-by-side
jshERP-web/src/api/api.js
View file @
f03902bb
...
@@ -72,6 +72,7 @@ const getAllMaterialAttribute = (params)=>getAction("/materialAttribute/getAll",
...
@@ -72,6 +72,7 @@ const getAllMaterialAttribute = (params)=>getAction("/materialAttribute/getAll",
const
addFunction
=
(
params
)
=>
postAction
(
"
/function/add
"
,
params
);
const
addFunction
=
(
params
)
=>
postAction
(
"
/function/add
"
,
params
);
const
editFunction
=
(
params
)
=>
putAction
(
"
/function/update
"
,
params
);
const
editFunction
=
(
params
)
=>
putAction
(
"
/function/update
"
,
params
);
const
checkFunction
=
(
params
)
=>
getAction
(
"
/function/checkIsNameExist
"
,
params
);
const
checkFunction
=
(
params
)
=>
getAction
(
"
/function/checkIsNameExist
"
,
params
);
const
checkNumber
=
(
params
)
=>
getAction
(
"
/function/checkIsNumberExist
"
,
params
);
//系统配置
//系统配置
const
addSystemConfig
=
(
params
)
=>
postAction
(
"
/systemConfig/add
"
,
params
);
const
addSystemConfig
=
(
params
)
=>
postAction
(
"
/systemConfig/add
"
,
params
);
const
editSystemConfig
=
(
params
)
=>
putAction
(
"
/systemConfig/update
"
,
params
);
const
editSystemConfig
=
(
params
)
=>
putAction
(
"
/systemConfig/update
"
,
params
);
...
@@ -163,6 +164,7 @@ export {
...
@@ -163,6 +164,7 @@ export {
addFunction
,
addFunction
,
editFunction
,
editFunction
,
checkFunction
,
checkFunction
,
checkNumber
,
addSystemConfig
,
addSystemConfig
,
editSystemConfig
,
editSystemConfig
,
checkSystemConfig
,
checkSystemConfig
,
...
...
jshERP-web/src/views/system/FunctionList.vue
View file @
f03902bb
...
@@ -104,20 +104,21 @@
...
@@ -104,20 +104,21 @@
}
}
},
},
{
title
:
'
编号
'
,
dataIndex
:
'
number
'
,
width
:
80
},
{
title
:
'
编号
'
,
dataIndex
:
'
number
'
,
width
:
80
},
{
title
:
'
名称
'
,
dataIndex
:
'
name
'
,
width
:
1
00
},
{
title
:
'
名称
'
,
dataIndex
:
'
name
'
,
width
:
1
20
,
ellipsis
:
true
},
{
title
:
'
上级编号
'
,
dataIndex
:
'
parentNumber
'
,
width
:
80
},
{
title
:
'
上级编号
'
,
dataIndex
:
'
parentNumber
'
,
width
:
80
},
{
title
:
'
链接
'
,
dataIndex
:
'
url
'
,
width
:
250
},
{
title
:
'
上级名称
'
,
dataIndex
:
'
parentName
'
,
width
:
120
,
ellipsis
:
true
},
{
title
:
'
组件
'
,
dataIndex
:
'
component
'
,
width
:
250
},
{
title
:
'
链接
'
,
dataIndex
:
'
url
'
,
width
:
250
,
ellipsis
:
true
},
{
title
:
'
排序
'
,
dataIndex
:
'
sort
'
,
width
:
80
},
{
title
:
'
组件
'
,
dataIndex
:
'
component
'
,
width
:
250
,
ellipsis
:
true
},
{
title
:
'
排序
'
,
dataIndex
:
'
sort
'
,
width
:
60
},
{
{
title
:
'
是否启用
'
,
dataIndex
:
'
enabled
'
,
width
:
80
,
align
:
"
center
"
,
title
:
'
是否启用
'
,
dataIndex
:
'
enabled
'
,
width
:
80
,
align
:
"
center
"
,
scopedSlots
:
{
customRender
:
'
customRenderFlag
'
}
scopedSlots
:
{
customRender
:
'
customRenderFlag
'
}
},
},
{
title
:
'
图标
'
,
dataIndex
:
'
icon
'
,
width
:
1
1
0
},
{
title
:
'
图标
'
,
dataIndex
:
'
icon
'
,
width
:
1
2
0
},
{
{
title
:
'
操作
'
,
title
:
'
操作
'
,
dataIndex
:
'
action
'
,
dataIndex
:
'
action
'
,
width
:
20
0
,
width
:
15
0
,
align
:
"
center
"
,
align
:
"
center
"
,
scopedSlots
:
{
customRender
:
'
action
'
},
scopedSlots
:
{
customRender
:
'
action
'
},
}
}
...
...
jshERP-web/src/views/system/modules/FunctionModal.vue
View file @
f03902bb
...
@@ -23,22 +23,22 @@
...
@@ -23,22 +23,22 @@
<a-input
placeholder=
"请输入名称"
v-decorator.trim=
"[ 'name', validatorRules.name]"
/>
<a-input
placeholder=
"请输入名称"
v-decorator.trim=
"[ 'name', validatorRules.name]"
/>
</a-form-item>
</a-form-item>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"上级编号"
>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"上级编号"
>
<a-input
placeholder=
"请输入上级编号"
v-decorator.trim=
"[ 'parentNumber' ]"
/>
<a-input
placeholder=
"请输入上级编号"
v-decorator.trim=
"[ 'parentNumber'
, validatorRules.parentNumber
]"
/>
</a-form-item>
</a-form-item>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"链接"
>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"链接"
>
<a-input
placeholder=
"请输入链接"
v-decorator.trim=
"[ 'url' ]"
/>
<a-input
placeholder=
"请输入链接"
v-decorator.trim=
"[ 'url'
, validatorRules.url
]"
/>
</a-form-item>
</a-form-item>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"组件"
>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"组件"
>
<a-input
placeholder=
"请输入组件"
v-decorator.trim=
"[ 'component' ]"
/>
<a-input
placeholder=
"请输入组件"
v-decorator.trim=
"[ 'component'
, validatorRules.component
]"
/>
</a-form-item>
</a-form-item>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"排序"
>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"排序"
>
<a-input
placeholder=
"请输入排序"
v-decorator.trim=
"[ 'sort' ]"
/>
<a-input
placeholder=
"请输入排序"
v-decorator.trim=
"[ 'sort'
, validatorRules.sort
]"
/>
</a-form-item>
</a-form-item>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"功能按钮"
>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"功能按钮"
>
<j-select-multiple
placeholder=
"请选择功能按钮"
v-model=
"jselectMultiple.value"
:options=
"jselectMultiple.options"
/>
<j-select-multiple
placeholder=
"请选择功能按钮"
v-model=
"jselectMultiple.value"
:options=
"jselectMultiple.options"
/>
</a-form-item>
</a-form-item>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"图标"
>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"图标"
>
<a-input
placeholder=
"请输入图标"
v-decorator.trim=
"[ 'icon' ]"
/>
<a-input
placeholder=
"请输入图标"
v-decorator.trim=
"[ 'icon'
, validatorRules.icon
]"
/>
</a-form-item>
</a-form-item>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"是否启用"
>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"是否启用"
>
<a-switch
checked-children=
"启用"
un-checked-children=
"禁用"
v-model=
"enabledSwitch"
@
change=
"onChange"
/>
<a-switch
checked-children=
"启用"
un-checked-children=
"禁用"
v-model=
"enabledSwitch"
@
change=
"onChange"
/>
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
</template>
</template>
<
script
>
<
script
>
import
pick
from
'
lodash.pick
'
import
pick
from
'
lodash.pick
'
import
{
addFunction
,
editFunction
,
checkFunction
}
from
'
@/api/api
'
import
{
addFunction
,
editFunction
,
checkFunction
,
checkNumber
}
from
'
@/api/api
'
import
{
autoJumpNextInput
}
from
"
@/utils/util
"
import
{
autoJumpNextInput
}
from
"
@/utils/util
"
import
JSelectMultiple
from
'
@/components/jeecg/JSelectMultiple
'
import
JSelectMultiple
from
'
@/components/jeecg/JSelectMultiple
'
export
default
{
export
default
{
...
@@ -87,17 +87,45 @@
...
@@ -87,17 +87,45 @@
confirmLoading
:
false
,
confirmLoading
:
false
,
form
:
this
.
$form
.
createForm
(
this
),
form
:
this
.
$form
.
createForm
(
this
),
validatorRules
:{
validatorRules
:{
number
:{
rules
:
[
{
required
:
true
,
message
:
'
请输入编号!
'
},
{
min
:
2
,
max
:
30
,
message
:
'
长度在 2 到 30 个字符
'
,
trigger
:
'
blur
'
},
{
validator
:
this
.
validateNumber
}
]
},
name
:{
name
:{
rules
:
[
rules
:
[
{
required
:
true
,
message
:
'
请输入名称!
'
},
{
required
:
true
,
message
:
'
请输入名称!
'
},
{
min
:
2
,
max
:
30
,
message
:
'
长度在 2 到 30 个字符
'
,
trigger
:
'
blur
'
},
{
min
:
2
,
max
:
30
,
message
:
'
长度在 2 到 30 个字符
'
,
trigger
:
'
blur
'
},
{
validator
:
this
.
validatePersonName
}
{
validator
:
this
.
validateName
}
]},
]
type
:{
},
parentNumber
:{
rules
:
[
rules
:
[
{
required
:
true
,
message
:
'
请
选择类型
!
'
}
{
required
:
true
,
message
:
'
请
输入上级编号
!
'
}
]
]
}
},
url
:{
rules
:
[
{
required
:
true
,
message
:
'
请输入链接!
'
}
]
},
component
:{
rules
:
[
{
required
:
true
,
message
:
'
请输入组件!
'
}
]
},
sort
:{
rules
:
[
{
required
:
true
,
message
:
'
请输入排序!
'
}
]
},
icon
:{
rules
:
[
{
required
:
true
,
message
:
'
请输入图标!
'
}
]
},
},
},
}
}
},
},
...
@@ -125,7 +153,7 @@
...
@@ -125,7 +153,7 @@
this
.
jselectMultiple
.
value
=
''
this
.
jselectMultiple
.
value
=
''
}
}
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
form
.
setFieldsValue
(
pick
(
this
.
model
,
'
number
'
,
'
name
'
,
'
parentNumber
'
,
'
url
'
,
'
component
'
,
'
sort
'
,
'
pushBtn
'
,
'
icon
'
,
'
enabled
'
))
this
.
form
.
setFieldsValue
(
pick
(
this
.
model
,
'
number
'
,
'
name
'
,
'
parentNumber
'
,
'
parentName
'
,
'
url
'
,
'
component
'
,
'
sort
'
,
'
pushBtn
'
,
'
icon
'
,
'
enabled
'
))
autoJumpNextInput
(
'
functionModal
'
)
autoJumpNextInput
(
'
functionModal
'
)
});
});
},
},
...
@@ -163,7 +191,24 @@
...
@@ -163,7 +191,24 @@
handleCancel
()
{
handleCancel
()
{
this
.
close
()
this
.
close
()
},
},
validatePersonName
(
rule
,
value
,
callback
){
validateNumber
(
rule
,
value
,
callback
){
let
params
=
{
number
:
value
,
id
:
this
.
model
.
id
?
this
.
model
.
id
:
0
};
checkNumber
(
params
).
then
((
res
)
=>
{
if
(
res
&&
res
.
code
===
200
)
{
if
(
!
res
.
data
.
status
){
callback
();
}
else
{
callback
(
"
编号已经存在!
"
);
}
}
else
{
callback
(
res
.
data
);
}
});
},
validateName
(
rule
,
value
,
callback
){
let
params
=
{
let
params
=
{
name
:
value
,
name
:
value
,
id
:
this
.
model
.
id
?
this
.
model
.
id
:
0
id
:
this
.
model
.
id
?
this
.
model
.
id
:
0
...
@@ -173,7 +218,7 @@
...
@@ -173,7 +218,7 @@
if
(
!
res
.
data
.
status
){
if
(
!
res
.
data
.
status
){
callback
();
callback
();
}
else
{
}
else
{
callback
(
"
名称已经存在
"
);
callback
(
"
名称已经存在
!
"
);
}
}
}
else
{
}
else
{
callback
(
res
.
data
);
callback
(
res
.
data
);
...
...
Write
Preview
Supports
Markdown
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