Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
csbr-daop
/
fe-data-trusted-space
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
4870f9f9
authored
2025-06-25 18:04:57 +0800
by
fanguang
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix
1 parent
b130a8d4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
38 deletions
src/views/data_meta/components/dictFileds.vue
src/views/data_meta/standard-codetable.vue
src/views/data_meta/components/dictFileds.vue
View file @
4870f9f
...
...
@@ -249,7 +249,10 @@ const tableBtnClick = (scope, btn) => {
// chunkData()
}
tableInfo
.
value
.
page
.
rows
=
tableData
.
value
.
length
saveDisabled
.
value
=
true
// saveDisabled.value = true
console
.
log
(
tableData
.
value
)
let
haveState
=
tableData
.
value
.
some
(
item
=>
item
.
STATE
)
saveDisabled
.
value
=
!
haveState
}
else
if
(
type
==
'remove'
)
{
open
(
"是否确定删除所选数据?"
,
"warning"
);
}
...
...
src/views/data_meta/standard-codetable.vue
View file @
4870f9f
...
...
@@ -79,7 +79,7 @@ const treeInfo = ref({
value
:
"value"
,
isLeaf
:
"isLeaf"
,
},
lazy
:
true
,
//
lazy: true,
nodeKey
:
'value'
,
expandedKey
:
[
'01'
],
currentNodeKey
:
'01'
,
...
...
@@ -1319,7 +1319,7 @@ const saveData = async (params, btnValue) => {
request
(
params
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
proxy
.
$passCode
)
{
ElMessage
.
success
(
'操作成功'
)
getTreeData
().
then
(()
=>
{
initTree
().
then
(()
=>
{
drawerInfo
.
value
.
visible
=
false
if
(
btnValue
===
'saveAndAdd'
)
{
// 跳转代码详情
...
...
@@ -1441,50 +1441,67 @@ const radioGroupChange = async (val, info) => {
}
function
initTree
()
{
Promise
.
all
([
getParamsList
({
dictType
:
'标准类型'
}),
getStandardCodeTree
()]).
then
((
resList
:
any
)
=>
{
return
Promise
.
all
([
getParamsList
({
dictType
:
'标准类型'
}),
getStandardCodeTree
()]).
then
((
resList
:
any
)
=>
{
let
treeRoot
=
resList
[
0
].
data
||
[]
let
treeData
=
resList
[
1
].
data
||
[]
console
.
log
(
'treeRoot'
,
treeRoot
)
console
.
log
(
'treeData'
,
treeData
)
// console.log('treeRoot', treeRoot)
// console.log('treeData', treeData)
treeData
.
forEach
(
item
=>
{
if
(
item
.
children
)
{
item
.
children
.
forEach
(
subItem
=>
{
// 二级标准name 为 value
subItem
.
treeLevel
=
2
subItem
.
label
=
subItem
.
name
subItem
.
value
=
subItem
.
name
if
(
subItem
.
children
)
{
subItem
.
children
.
forEach
(
threeItem
=>
{
threeItem
.
label
=
threeItem
.
name
threeItem
.
value
=
threeItem
.
guid
threeItem
.
isLeaf
=
threeItem
.
isCode
})
}
})
}
})
let
tree
=
treeRoot
.
map
(
item
=>
{
let
obj
:
any
=
{}
obj
.
treeLevel
=
1
obj
.
guid
=
item
.
value
obj
.
name
=
item
.
label
item
.
treeLevel
=
1
let
target
=
treeData
.
find
(
v
=>
v
.
guid
===
item
.
value
)
obj
.
children
=
target
?
target
.
children
:
null
return
obj
item
.
children
=
target
?
target
.
children
:
null
return
item
})
// standardOptions.value = treeRoot
// treeInfo.value.data = tree
// nodeClick(tree[0])
// console.log('treeData', treeData)
// console.log('tree', tree)
standardOptions
.
value
=
treeRoot
treeInfo
.
value
.
data
=
tree
})
}
onBeforeMount
(()
=>
{
// getDataType()
// initTree()
getTreeData
().
then
(()
=>
{
// 默认展开第一个
let
data
=
treeInfo
.
value
.
data
if
(
data
.
length
===
0
)
return
let
params
=
{
pageIndex
:
1
,
pageSize
:
50
,
standardTypeCode
:
data
[
0
].
value
,
// codeName: '标准类型'
}
getStandardCodeList
(
params
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
proxy
.
$passCode
)
{
let
data
=
res
.
data
data
.
records
&&
data
.
records
.
forEach
((
item
,
index
)
=>
item
.
index
=
index
)
tableInfo
.
value
.
data
=
data
.
records
tableInfo
.
value
.
page
.
limit
=
data
.
pageSize
tableInfo
.
value
.
page
.
curr
=
data
.
pageIndex
tableInfo
.
value
.
page
.
rows
=
data
.
totalRows
}
})
})
initTree
().
then
(()
=>
{
nodeClick
(
treeInfo
.
value
.
data
[
0
])
})
// getTreeData().then(() => {
// // 默认展开第一个
// let data = treeInfo.value.data
// if (data.length === 0) return
// let params = {
// pageIndex: 1,
// pageSize: 50,
// standardTypeCode: data[0].value,
// // codeName: '标准类型'
// }
// getStandardCodeList(params).then((res:any) => {
// if (res.code === proxy.$passCode) {
// let data = res.data
// data.records && data.records.forEach((item,index) => item.index = index)
// tableInfo.value.data = data.records
// tableInfo.value.page.limit = data.pageSize
// tableInfo.value.page.curr = data.pageIndex
// tableInfo.value.page.rows = data.totalRows
// }
// })
// })
getParamsList
({
dictType
:
'发布单位'
}).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
proxy
.
$passCode
)
{
const
data
=
res
.
data
||
[]
...
...
@@ -1503,7 +1520,8 @@ onMounted(() => {
<div
class=
"container_wrap full flex"
>
<div
class=
"aside_wrap"
>
<div
class=
"aside_title"
>
标准代码列表
</div>
<Tree
ref=
"dictTreeRef"
:treeInfo=
"treeInfo"
@
nodeClick=
"nodeClick"
@
loadNode=
"loadTreeNode"
/>
<!--
<Tree
ref=
"dictTreeRef"
:treeInfo=
"treeInfo"
@
nodeClick=
"nodeClick"
@
loadNode=
"loadTreeNode"
/>
-->
<Tree
ref=
"dictTreeRef"
:treeInfo=
"treeInfo"
@
nodeClick=
"nodeClick"
/>
</div>
<DictFileds
ref=
"dictFiledsRef"
v-if=
"showFiledsPage"
@
exportData=
"exportData"
/>
<div
class=
"main_wrap"
v-else
>
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment