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
4ee16be7
authored
2022-08-26 09:37:42 +0800
by
任超
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
style:字典
1 parent
6fd96f6b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
28 deletions
src/utils/operation.js
src/views/system/dictionaries/components/editDialog.vue
src/views/ywbl/ywsq/components/gyjsydsyq/gyjsydsyq.vue
src/utils/operation.js
View file @
4ee16be
...
...
@@ -34,7 +34,59 @@ export function getUuid (len, radix) {
}
return
uuid
.
join
(
""
);
}
export
function
judgeSort
(
arr
)
{
if
(
arr
.
length
)
{
for
(
let
i
in
arr
)
{
arr
[
i
][
"isTop"
]
=
false
;
arr
[
i
][
"isBottom"
]
=
false
;
arr
[
i
]
==
arr
[
0
]
&&
(
arr
[
i
].
isTop
=
true
);
arr
[
i
]
==
arr
[
arr
.
length
-
1
]
&&
(
arr
[
i
].
isBottom
=
true
);
arr
[
i
].
children
&&
arr
[
i
].
children
.
length
&&
judgeSort
(
arr
[
i
].
children
)
}
}
return
arr
}
// 上下移动
export
function
realMove
(
bsmDict
,
operate
,
data
)
{
function
changeSort
(
arr
,
bsmDict
)
{
if
(
arr
.
length
)
{
let
flag
=
false
;
for
(
let
i
in
arr
)
{
if
(
arr
[
i
].
bsmDict
==
bsmDict
)
{
if
(
operate
===
"UP"
)
{
arr
[
i
]
=
arr
.
splice
(
i
-
1
,
1
,
arr
[
i
])[
0
];
}
else
if
(
operate
===
"DOWN"
)
{
let
temp
=
arr
.
splice
(
i
-
0
+
1
,
1
,
arr
[
i
])
arr
[
i
]
=
temp
[
0
];
}
flag
=
true
;
break
;
}
if
(
!
flag
&&
arr
[
i
].
children
&&
arr
[
i
].
children
.
length
)
{
arr
[
i
].
children
=
changeSort
(
arr
[
i
].
children
,
bsmDict
);
}
}
}
return
arr
;
}
data
=
judgeSort
(
changeSort
(
data
,
bsmDict
));
}
// 获取所有父节点
export
function
findParents
(
treeData
,
bsmDict
)
{
if
(
treeData
.
length
==
0
)
return
for
(
let
i
=
0
;
i
<
treeData
.
length
;
i
++
)
{
if
(
treeData
[
i
].
bsmDict
==
bsmDict
)
{
return
[]
}
else
{
if
(
treeData
[
i
].
children
)
{
let
res
=
findParents
(
treeData
[
i
].
children
,
bsmDict
)
if
(
res
!==
undefined
)
{
return
res
.
concat
(
treeData
[
i
].
bsmDict
)
}
}
}
}
}
// 上移下移
export
function
upward
(
index
,
data
)
{
if
(
index
>
0
)
{
...
...
src/views/system/dictionaries/components/editDialog.vue
View file @
4ee16be
...
...
@@ -23,7 +23,7 @@
</
template
>
<
script
>
import
{
getUuid
,
upward
,
down
,
removeTreeListItem
}
from
'@/utils/operation'
import
{
getUuid
,
judgeSort
,
realMove
,
findParents
,
removeTreeListItem
}
from
'@/utils/operation'
import
{
editDictNode
}
from
'@/api/dict'
export
default
{
props
:
{
...
...
@@ -180,7 +180,7 @@ export default {
},
details
:
{
handler
:
function
(
newValue
)
{
this
.
tableData
=
this
.
judgeSort
(
_
.
cloneDeep
(
newValue
.
dataList
))
this
.
tableData
=
judgeSort
(
_
.
cloneDeep
(
newValue
.
dataList
))
if
(
newValue
.
isenable
==
2
)
{
this
.
column
=
this
.
columns
.
slice
(
0
,
3
)
}
else
{
...
...
@@ -193,28 +193,21 @@ export default {
}
},
methods
:
{
judgeSort
(
arr
)
{
if
(
arr
.
length
)
{
for
(
let
i
in
arr
)
{
arr
[
i
][
"isTop"
]
=
false
;
arr
[
i
][
"isBottom"
]
=
false
;
arr
[
i
]
==
arr
[
0
]
&&
(
arr
[
i
].
isTop
=
true
);
arr
[
i
]
==
arr
[
arr
.
length
-
1
]
&&
(
arr
[
i
].
isBottom
=
true
);
arr
[
i
].
children
&&
arr
[
i
].
children
.
length
&&
this
.
judgeSort
(
arr
[
i
].
children
)
}
}
return
arr
},
// 添加索引
addIndexes
()
{
this
.
tableD
ata
.
forEach
((
item
,
index
)
=>
{
addIndexes
(
data
=
this
.
tableData
,
isAdd
=
true
)
{
d
ata
.
forEach
((
item
,
index
)
=>
{
if
(
index
==
0
)
{
item
.
codeShow
=
true
}
else
{
item
.
codeShow
=
false
item
.
nameShow
=
false
}
if
(
isAdd
)
{
item
.
index
=
index
+
1
}
if
(
item
.
children
)
{
this
.
addIndexes
(
item
.
children
,
false
)
}
})
},
itemShowFalse
()
{
...
...
@@ -259,7 +252,7 @@ export default {
}
)
this
.
keyList
=
[];
this
.
keyList
.
push
(
row
.
dictid
)
this
.
keyList
.
push
(
row
.
bsmDict
)
},
// 增加
handleAdd
()
{
...
...
@@ -283,12 +276,16 @@ export default {
},
// 上移下移
moveUpward
(
index
,
row
)
{
upward
(
index
,
this
.
tableData
)
realMove
(
row
.
bsmDict
,
'UP'
,
this
.
tableData
)
this
.
key
++
let
id
=
findParents
(
this
.
tableData
,
row
.
bsmDict
)
this
.
keyList
=
id
},
moveDown
(
index
,
row
)
{
down
(
index
,
this
.
tableData
)
realMove
(
row
.
bsmDict
,
'DOWN'
,
this
.
tableData
)
this
.
key
++
let
id
=
findParents
(
this
.
tableData
,
row
.
bsmDict
)
this
.
keyList
=
id
}
}
}
...
...
src/views/ywbl/ywsq/components/gyjsydsyq/gyjsydsyq.vue
View file @
4ee16be
...
...
@@ -43,7 +43,7 @@
</div>
<!-- 表格 -->
<div
class=
"from-clues-content"
>
<lb-table
:page-size=
"pageData.pageSize"
heightNum=
"400"
:current-page
.
sync=
"pageData.currentPage"
<lb-table
:page-size=
"pageData.pageSize"
:
heightNum=
"400"
:current-page
.
sync=
"pageData.currentPage"
:total=
"tableData.total"
@
size-change=
"handleSizeChange"
@
p-current-change=
"handleCurrentChange"
@
selection-change=
"handleSelectionChange"
:column=
"tableData.columns"
:data=
"tableData.data"
>
</lb-table>
...
...
@@ -78,10 +78,9 @@ export default {
columns
:
datas
.
columns
(),
data
:
[],
},
bdcdyid
:
''
,
bdcdyh
:
''
,
myValue
:
this
.
value
,
saveloding
:
false
saveloding
:
false
,
bdcdysz
:
[]
};
},
mounted
()
{
...
...
@@ -114,8 +113,7 @@ export default {
this
.
saveloding
=
true
startBusinessFlow
({
bsmSqyw
:
this
.
bsmSqyw
,
bdcdyid
:
this
.
bdcdyid
,
bdcdyh
:
this
.
bdcdyh
bdcdysz
:
this
.
bdcdysz
}).
then
(
res
=>
{
this
.
saveloding
=
false
this
.
$emit
(
'input'
,
false
)
...
...
@@ -128,8 +126,7 @@ export default {
this
.
$emit
(
"input"
,
false
);
},
handleSelectionChange
(
val
)
{
this
.
bdcdyid
=
val
.
map
(
item
=>
item
.
dyhbsm
?
item
.
dyhbsm
:
''
).
join
(
','
)
this
.
bdcdyh
=
val
.
map
(
item
=>
item
.
bdcdyh
?
item
.
bdcdyh
:
''
).
join
(
','
)
this
.
bdcdysz
=
val
}
},
};
...
...
Please
register
or
sign in
to post a comment