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
5035e007
authored
2022-08-24 16:47:38 +0800
by
任超
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
style:加载动画
1 parent
a43f28a2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
11 deletions
src/api/dict.js
src/components/lb-table/lb-table.vue
src/views/system/dictionaries/components/editDialog.vue
src/views/system/dictionaries/dictionaries.vue
src/api/dict.js
View file @
5035e00
...
...
@@ -15,7 +15,9 @@ export function getQlxxDictList (data) {
data
})
}
// 获取字典子级列表
/*
获取字典子级列表
*/
export
function
getChildDictList
(
bsmDict
)
{
return
request
({
url
:
'/sys/dict/getChildDictList'
,
...
...
@@ -24,4 +26,14 @@ export function getChildDictList (bsmDict) {
bsmDict
:
bsmDict
}
})
}
/*
编辑字典数据
*/
export
function
editDictNode
(
data
)
{
return
request
({
url
:
'/sys/dict/editDictNode'
,
method
:
'post'
,
data
})
}
\ No newline at end of file
...
...
src/components/lb-table/lb-table.vue
View file @
5035e00
...
...
@@ -10,9 +10,11 @@
<
template
>
<div
:class=
"['lb-table', customClass]"
>
<el-table
v-if=
"!heightNumSetting"
ref=
"elTable"
:border=
'border'
:row-class-name=
"tableRowClassName"
:show-header=
'showHeader'
:header-cell-style=
"
{ background: '#f5f7fa' }" v-bind="$attrs" :height="tableHeight"
v-on="$listeners" :data="data" style="width: 100%" :span-method="this.merge ? this.mergeMethod : this.spanMethod">
<el-table
v-if=
"!heightNumSetting"
ref=
"elTable"
:border=
'border'
v-loading=
"loading"
element-loading-text=
"拼命加载中"
element-loading-spinner=
"el-icon-loading"
element-loading-background=
"rgba(0, 0, 0, 0.8)"
:row-class-name=
"tableRowClassName"
:show-header=
'showHeader'
:header-cell-style=
"
{ background: '#f5f7fa' }"
v-bind="$attrs" :height="tableHeight" v-on="$listeners" :data="data" style="width: 100%"
:span-method="this.merge ? this.mergeMethod : this.spanMethod">
<lb-column
v-bind=
"$attrs"
v-for=
"(item, index) in column"
:key=
"index"
:column=
"item"
>
</lb-column>
</el-table>
...
...
@@ -39,6 +41,10 @@ export default {
column
:
Array
,
data
:
Array
,
spanMethod
:
Function
,
loading
:
{
type
:
Boolean
,
default
:
false
,
},
pagination
:
{
type
:
Boolean
,
default
:
true
,
...
...
src/views/system/dictionaries/components/editDialog.vue
View file @
5035e00
<
template
>
<!-- 编辑 -->
<dialogBox
submitForm=
"submitForm"
@
closeDialog=
"closeDialog"
v-model=
"myValue"
title=
"字典信息"
>
<dialogBox
submitForm=
"submitForm"
@
closeDialog=
"closeDialog"
@
submitForm=
"handleSubmit"
v-model=
"myValue"
:isSave=
"details.isenable == 1"
title=
"字典信息"
:saveloding=
"saveloding"
>
<el-form
:model=
"ruleForm"
ref=
"ruleForm"
label-width=
"120px"
>
<el-row
:gutter=
"20"
>
<el-col
:span=
"6"
>
...
...
@@ -23,6 +24,7 @@
<
script
>
import
{
getUuid
,
upward
,
down
,
removeTreeListItem
}
from
'@/utils/operation'
import
{
editDictNode
}
from
'@/api/dict'
export
default
{
props
:
{
value
:
{
type
:
Boolean
,
default
:
false
},
...
...
@@ -40,7 +42,8 @@ export default {
dcode
:
''
,
dname
:
''
},
column
:
[
column
:
[],
columns
:
[
{
width
:
'60'
,
renderHeader
:
(
h
,
scope
)
=>
{
...
...
@@ -166,6 +169,7 @@ export default {
}
],
tableData
:
[],
saveloding
:
false
}
},
watch
:
{
...
...
@@ -176,7 +180,9 @@ export default {
handler
:
function
(
newValue
)
{
this
.
tableData
=
_
.
cloneDeep
(
newValue
.
dataList
)
if
(
newValue
.
isenable
==
2
)
{
this
.
column
=
this
.
column
.
slice
(
0
,
3
)
this
.
column
=
this
.
columns
.
slice
(
0
,
3
)
}
else
{
this
.
column
=
this
.
columns
}
this
.
ruleForm
=
newValue
.
rowData
this
.
addIndexes
()
...
...
@@ -206,7 +212,18 @@ export default {
handleMinus
(
index
,
row
)
{
removeTreeListItem
(
this
.
tableData
,
row
.
bsmDict
)
},
async
handleSubmit
()
{
handleSubmit
()
{
this
.
saveloding
=
true
editDictNode
({
bsmDict
:
this
.
details
.
rowData
.
bsmDict
,
typeid
:
this
.
details
.
rowData
.
typeid
,
children
:
this
.
tableData
}).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
this
.
saveloding
=
false
this
.
$emit
(
'input'
,
false
)
}
})
},
closeDialog
()
{
this
.
$emit
(
'input'
,
false
)
...
...
@@ -248,6 +265,7 @@ export default {
}
)
this
.
addIndexes
()
this
.
key
++
},
// 上移下移
moveUpward
(
index
,
row
)
{
...
...
src/views/system/dictionaries/dictionaries.vue
View file @
5035e00
...
...
@@ -25,9 +25,9 @@
</div>
<!-- 表格 -->
<div
class=
"from-clues-content"
>
<lb-table
:page-size=
"pageData.pageSize"
:
current-page
.
sync=
"pageData.currentPage"
:total=
"tableData.total
"
@
size-change=
"handleSizeChange"
@
p-current-change=
"handleCurrentChange"
:column=
"tableData.columns
"
:data=
"tableData.data"
>
<lb-table
:page-size=
"pageData.pageSize"
:
loading=
"loading"
:current-page
.
sync=
"pageData.currentPage
"
:total=
"tableData.total"
@
size-change=
"handleSizeChange"
@
p-current-change=
"handleCurrentChange
"
:
column=
"tableData.columns"
:
data=
"tableData.data"
>
</lb-table>
</div>
<editDialog
v-model=
"isDialog"
:details=
"details"
/>
...
...
@@ -49,6 +49,7 @@ export default {
},
data
()
{
return
{
loading
:
false
,
isDialog
:
false
,
details
:
{
dataList
:
[],
...
...
@@ -69,7 +70,9 @@ export default {
methods
:
{
// 初始化数据
fetchData
()
{
this
.
loading
=
true
getQlxxDictList
({
...
this
.
ruleForm
,
...
this
.
pageData
}).
then
(
res
=>
{
this
.
loading
=
false
let
{
records
,
total
}
=
res
.
result
this
.
tableData
.
data
=
records
this
.
tableData
.
total
=
total
...
...
Please
register
or
sign in
to post a comment