Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
bdc
/
bdcdj-web
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
bd208a6f
authored
2023-04-11 11:22:31 +0800
by
renchao@pashanhoo.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
style:系统管理
1 parent
524a0a70
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
56 deletions
src/views/system/dictionaries/components/editDialog.vue
src/views/system/dictionaries/dictionaries.js
src/views/system/dictionaries/dictionaries.vue
src/views/system/dictionaries/components/editDialog.vue
View file @
bd208a6
<
template
>
<!-- 编辑 -->
<dialogBox
submitForm=
"submitForm"
@
closeDialog=
"closeDialog"
@
submitForm=
"handleSubmit"
width=
"80%"
v-model=
"myValue"
:isSave=
"details.isenable == 1"
title=
"字典信息"
>
<div>
<el-form
:model=
"ruleForm"
ref=
"ruleForm"
label-width=
"100px"
>
<el-row
:gutter=
"20"
>
<el-col
:span=
"4"
>
...
...
@@ -19,24 +17,27 @@
<lb-table
:column=
"column"
class=
"loadingtext"
:heightNum=
"420"
:key=
"key"
:expand-row-keys=
"keyList"
row-key=
"bsmDict"
:tree-props=
"
{ children: 'children' }" :pagination="false" :data="tableData">
</lb-table>
</dialogBox>
<div
class=
"text-center"
>
<el-button
@
click=
"$popupCacel"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"handleSubmit"
>
确定
</el-button>
</div>
</div>
</
template
>
<
script
>
import
{
getUuid
,
judgeSort
,
realMove
,
findParents
,
removeTreeListItem
}
from
'@/utils/operation'
import
{
editDictNode
,
getChildDictList
}
from
'@/api/user'
export
default
{
import
{
getUuid
,
judgeSort
,
realMove
,
findParents
,
removeTreeListItem
}
from
'@/utils/operation'
import
{
editDictNode
,
getChildDictList
}
from
'@/api/user'
export
default
{
props
:
{
value
:
{
type
:
Boolean
,
default
:
false
},
details
:
{
formData
:
{
type
:
Object
,
default
:
{
}
default
:
()
=>
{
}
}
},
data
()
{
return
{
key
:
0
,
myValue
:
this
.
value
,
keyList
:
[],
ruleForm
:
{
dcode
:
''
,
...
...
@@ -49,7 +50,7 @@
renderHeader
:
(
h
,
scope
)
=>
{
return
(
<
div
>
{
this
.
details
.
isenable
===
'0'
?
this
.
formData
.
isenable
===
'0'
?
<
span
>
序号
<
/span>
:
<
i
class
=
"el-icon-plus"
onClick
=
{()
=>
{
this
.
handleAdd
()
}}
style
=
"cursor:pointer;color:#409EFF"
><
/i
>
}
...
...
@@ -68,12 +69,12 @@
render
:
(
h
,
scope
)
=>
{
return
(
<
div
>
<
el
-
input
placeholder
=
"字典项编码"
disabled
=
{
this
.
details
.
isenable
==
2
}
v
-
show
=
{
scope
.
row
.
codeShow
}
v
-
fo
value
=
{
scope
.
row
[
scope
.
column
.
property
]}
<
el
-
input
placeholder
=
"字典项编码"
disabled
=
{
this
.
formData
.
isenable
==
2
}
v
-
show
=
{
scope
.
row
.
codeShow
}
v
-
fo
value
=
{
scope
.
row
[
scope
.
column
.
property
]}
onFocus
=
{()
=>
{
this
.
itemShowFalse
();
scope
.
row
.
codeShow
=
true
;
}}
onInput
=
{(
val
)
=>
{
scope
.
row
[
scope
.
column
.
property
]
=
val
;
this
.
itemShowFalse
();
scope
.
row
.
codeShow
=
true
;
}}
maxlength
=
'8'
><
/el-input
>
<
el
-
input
placeholder
=
"字典项编码"
disabled
=
{
this
.
details
.
isenable
==
2
}
v
-
show
=
{
!
scope
.
row
.
codeShow
}
value
=
{
scope
.
row
[
scope
.
column
.
property
]}
<
el
-
input
placeholder
=
"字典项编码"
disabled
=
{
this
.
formData
.
isenable
==
2
}
v
-
show
=
{
!
scope
.
row
.
codeShow
}
value
=
{
scope
.
row
[
scope
.
column
.
property
]}
onFocus
=
{()
=>
{
this
.
itemShowFalse
();
scope
.
row
.
codeShow
=
true
;
}}
onInput
=
{(
val
)
=>
{
scope
.
row
[
scope
.
column
.
property
]
=
val
;
this
.
itemShowFalse
();
scope
.
row
.
codeShow
=
true
;
}}
maxlength
=
'8'
><
/el-input
>
<
/div
>
...
...
@@ -86,11 +87,11 @@
render
:
(
h
,
scope
)
=>
{
return
(
<
div
>
<
el
-
input
placeholder
=
"字典项编码"
disabled
=
{
this
.
details
.
isenable
==
2
}
v
-
show
=
{
scope
.
row
.
nameShow
}
v
-
fo
value
=
{
scope
.
row
[
scope
.
column
.
property
]}
<
el
-
input
placeholder
=
"字典项编码"
disabled
=
{
this
.
formData
.
isenable
==
2
}
v
-
show
=
{
scope
.
row
.
nameShow
}
v
-
fo
value
=
{
scope
.
row
[
scope
.
column
.
property
]}
onFocus
=
{()
=>
{
this
.
itemShowFalse
();
scope
.
row
.
nameShow
=
true
;
}}
onInput
=
{(
val
)
=>
{
scope
.
row
[
scope
.
column
.
property
]
=
val
;
this
.
itemShowFalse
();
scope
.
row
.
codeShow
=
true
;
}}
><
/el-input
>
<
el
-
input
placeholder
=
"字典项名称"
disabled
=
{
this
.
details
.
isenable
==
2
}
v
-
show
=
{
!
scope
.
row
.
nameShow
}
value
=
{
scope
.
row
[
scope
.
column
.
property
]}
<
el
-
input
placeholder
=
"字典项名称"
disabled
=
{
this
.
formData
.
isenable
==
2
}
v
-
show
=
{
!
scope
.
row
.
nameShow
}
value
=
{
scope
.
row
[
scope
.
column
.
property
]}
onFocus
=
{()
=>
{
this
.
itemShowFalse
();
scope
.
row
.
nameShow
=
true
;
}}
onInput
=
{(
val
)
=>
{
scope
.
row
[
scope
.
column
.
property
]
=
val
;
this
.
itemShowFalse
();
scope
.
row
.
codeShow
=
true
;
}}
><
/el-input
>
<
/div
>
...
...
@@ -104,11 +105,11 @@
render
:
(
h
,
scope
)
=>
{
return
(
<
div
>
<
el
-
input
placeholder
=
"部标编码"
disabled
=
{
this
.
details
.
isenable
==
2
}
v
-
show
=
{
scope
.
row
.
normcodeShow
}
v
-
fo
value
=
{
scope
.
row
[
scope
.
column
.
property
]}
<
el
-
input
placeholder
=
"部标编码"
disabled
=
{
this
.
formData
.
isenable
==
2
}
v
-
show
=
{
scope
.
row
.
normcodeShow
}
v
-
fo
value
=
{
scope
.
row
[
scope
.
column
.
property
]}
onFocus
=
{()
=>
{
this
.
itemShowFalse
();
scope
.
row
.
normcodeShow
=
true
;
}}
onInput
=
{(
val
)
=>
{
scope
.
row
[
scope
.
column
.
property
]
=
val
;
this
.
itemShowFalse
();
scope
.
row
.
codeShow
=
true
;
}}
maxlength
=
'8'
><
/el-input
>
<
el
-
input
placeholder
=
"部标编码"
disabled
=
{
this
.
details
.
isenable
==
2
}
v
-
show
=
{
!
scope
.
row
.
normcodeShow
}
value
=
{
scope
.
row
[
scope
.
column
.
property
]}
<
el
-
input
placeholder
=
"部标编码"
disabled
=
{
this
.
formData
.
isenable
==
2
}
v
-
show
=
{
!
scope
.
row
.
normcodeShow
}
value
=
{
scope
.
row
[
scope
.
column
.
property
]}
onFocus
=
{()
=>
{
this
.
itemShowFalse
();
scope
.
row
.
normcodeShow
=
true
;
}}
onInput
=
{(
val
)
=>
{
scope
.
row
[
scope
.
column
.
property
]
=
val
;
this
.
itemShowFalse
();
scope
.
row
.
codeShow
=
true
;
}}
maxlength
=
'8'
><
/el-input
>
<
/div
>
...
...
@@ -121,11 +122,11 @@
render
:
(
h
,
scope
)
=>
{
return
(
<
div
>
<
el
-
input
placeholder
=
"部标名称"
disabled
=
{
this
.
details
.
isenable
==
2
}
v
-
show
=
{
scope
.
row
.
normnameShow
}
v
-
fo
value
=
{
scope
.
row
[
scope
.
column
.
property
]}
<
el
-
input
placeholder
=
"部标名称"
disabled
=
{
this
.
formData
.
isenable
==
2
}
v
-
show
=
{
scope
.
row
.
normnameShow
}
v
-
fo
value
=
{
scope
.
row
[
scope
.
column
.
property
]}
onFocus
=
{()
=>
{
this
.
itemShowFalse
();
scope
.
row
.
normnameShow
=
true
;
}}
onInput
=
{(
val
)
=>
{
scope
.
row
[
scope
.
column
.
property
]
=
val
;
this
.
itemShowFalse
();
scope
.
row
.
codeShow
=
true
;
}}
><
/el-input
>
<
el
-
input
placeholder
=
"部标名称"
disabled
=
{
this
.
details
.
isenable
==
2
}
v
-
show
=
{
!
scope
.
row
.
normnameShow
}
value
=
{
scope
.
row
[
scope
.
column
.
property
]}
<
el
-
input
placeholder
=
"部标名称"
disabled
=
{
this
.
formData
.
isenable
==
2
}
v
-
show
=
{
!
scope
.
row
.
normnameShow
}
value
=
{
scope
.
row
[
scope
.
column
.
property
]}
onFocus
=
{()
=>
{
this
.
itemShowFalse
();
scope
.
row
.
normnameShow
=
true
;
}}
onInput
=
{(
val
)
=>
{
scope
.
row
[
scope
.
column
.
property
]
=
val
;
this
.
itemShowFalse
();
scope
.
row
.
codeShow
=
true
;
}}
><
/el-input
>
<
/div
>
...
...
@@ -138,7 +139,7 @@
label
:
'是否禁用'
,
render
:
(
h
,
scope
)
=>
{
return
(
<
el
-
radio
-
group
disabled
=
{
this
.
details
.
isenable
==
2
}
v
-
model
=
{
scope
.
row
.
isenable
}
>
<
el
-
radio
-
group
disabled
=
{
this
.
formData
.
isenable
==
2
}
v
-
model
=
{
scope
.
row
.
isenable
}
>
<
el
-
radio
label
=
"1"
>
启用
<
/el-radio
>
<
el
-
radio
label
=
"0"
>
禁用
<
/el-radio
>
<
/el-radio-group
>
...
...
@@ -173,39 +174,28 @@
tableData
:
[]
}
},
watch
:
{
value
(
val
)
{
this
.
myValue
=
val
},
'details.bsmDict'
:
{
handler
:
function
(
newValue
)
{
if
(
!
this
.
value
)
return
mounted
()
{
if
(
this
.
formData
?.
bsmDict
)
{
this
.
$startLoading
();
getChildDictList
(
newValue
).
then
(
res
=>
{
getChildDictList
(
this
.
formData
.
bsmDict
).
then
(
res
=>
{
this
.
$endLoading
();
let
{
result
}
=
res
this
.
tableData
=
result
?
result
:
[]
this
.
tableData
.
forEach
((
item
,
index
)
=>
{
item
.
index
=
index
+
1
})
this
.
tableData
=
judgeSort
(
this
.
tableData
)
})
},
immediate
:
true
},
details
:
{
handler
:
function
(
newValue
)
{
if
(
newValue
.
isenable
==
2
)
{
}
if
(
this
.
formData
?.
isenable
==
2
)
{
this
.
column
=
this
.
columns
.
slice
(
0
,
6
)
}
else
{
this
.
column
=
this
.
columns
}
this
.
ruleForm
=
newValue
.
rowData
this
.
ruleForm
=
this
.
formData
.
rowData
this
.
addIndexes
()
this
.
key
++
},
deep
:
true
}
},
methods
:
{
// 添加索引
addIndexes
(
data
=
this
.
tableData
,
isAdd
=
true
)
{
...
...
@@ -256,11 +246,13 @@
})
},
handleSubmit
()
{
this
.
$startLoading
();
editDictNode
({
bsmDict
:
this
.
details
.
rowData
.
bsmDict
,
typeid
:
this
.
details
.
rowData
.
typeid
,
bsmDict
:
this
.
formData
.
rowData
.
bsmDict
,
typeid
:
this
.
formData
.
rowData
.
typeid
,
children
:
this
.
tableData
}).
then
(
res
=>
{
this
.
$endLoading
();
if
(
res
.
code
===
200
)
{
this
.
$message
({
message
:
'修改成功'
,
...
...
@@ -268,11 +260,10 @@
})
this
.
$emit
(
'input'
,
false
)
}
}).
catch
((
error
)
=>
{
this
.
$endLoading
();
})
},
closeDialog
()
{
this
.
$emit
(
'input'
,
false
)
},
// 增加下级
handleAddSubordinate
(
row
)
{
if
(
!
row
.
children
)
{
...
...
@@ -326,12 +317,13 @@
this
.
keyList
=
id
}
}
}
}
</
script
>
<
style
rel=
"stylesheet/scss"
lang=
"scss"
scoped
>
@import
"~@/styles/dialogBoxheader.scss"
;
/
deep
/
.el-radio
{
@import
"~@/styles/dialogBoxheader.scss"
;
/
deep
/
.el-radio
{
margin-right
:
5px
!important
;
}
}
</
style
>
...
...
src/views/system/dictionaries/dictionaries.js
View file @
bd208a6
/*
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-04-11 10:49:40
*/
import
filter
from
'@/utils/filter.js'
let
vm
=
null
...
...
@@ -32,7 +37,6 @@ class data extends filter {
},
{
label
:
"是否允许修改"
,
width
:
'110'
,
render
:
(
h
,
scope
)
=>
{
return
(
<
div
>
...
...
@@ -47,9 +51,7 @@ class data extends filter {
},
{
label
:
'操作'
,
width
:
'150'
,
align
:
'center'
,
fixed
:
'right'
,
width
:
'80'
,
render
:
(
h
,
scope
)
=>
{
return
(
<
div
>
...
...
@@ -64,7 +66,6 @@ class data extends filter {
}
]
}
}
let
datas
=
new
data
()
export
{
...
...
src/views/system/dictionaries/dictionaries.vue
View file @
bd208a6
...
...
@@ -30,7 +30,6 @@
:column=
"tableData.columns"
:data=
"tableData.data"
>
</lb-table>
</div>
<editDialog
v-model=
"isDialog"
:details=
"details"
/>
</div>
</
template
>
<
script
>
...
...
@@ -49,7 +48,6 @@ export default {
},
data
()
{
return
{
isDialog
:
false
,
details
:
{
bsmDict
:
''
,
isenable
:
1
,
...
...
@@ -103,11 +101,12 @@ export default {
});
});
},
// 修改
editClick
(
row
,
val
)
{
this
.
details
.
rowData
=
row
this
.
details
.
isenable
=
val
this
.
details
.
bsmDict
=
row
.
bsmDict
this
.
isDialog
=
true
this
.
$popupDialog
(
"字典信息"
,
"system/dictionaries/components/editDialog"
,
this
.
details
)
}
}
}
...
...
Please
register
or
sign in
to post a comment