Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
lxyl-vue
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李苏
lxyl-vue
Commits
5df40d6e
Commit
5df40d6e
authored
May 10, 2024
by
李苏
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
假数据展示,选择时填充真数据
parent
a4ca973e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
8 deletions
+37
-8
jhr.vue
src/views/ccgl/ckgl/jhd/top/ackdk/jhr.vue
+37
-8
No files found.
src/views/ccgl/ckgl/jhd/top/ackdk/jhr.vue
View file @
5df40d6e
...
...
@@ -32,10 +32,39 @@
async
mounted
()
{
/* 初始化数据 */
that
=
this
console
.
log
(
that
,
'that'
)
/* 创建假数据*/
let
filterList
=
[]
let
showDatas
=
[]
let
orDatas
=
_
.
cloneDeep
(
this
.
app
.
$datas
)
orDatas
.
forEach
(
item
=>
{
/* 判断条件*/
let
iscf
=
false
filterList
.
forEach
(
fitem
=>
{
if
(
item
.
ckid
==
fitem
.
ckid
&&
item
.
wlid
==
fitem
.
wlid
){
iscf
=
true
}
else
{
iscf
=
false
}
})
if
(
iscf
){
showDatas
.
forEach
(
sitem
=>
{
if
(
item
.
ckid
==
sitem
.
ckid
&&
item
.
wlid
==
sitem
.
wlid
){
sitem
.
jhsl
=
sitem
.
jhsl
+
item
.
jhsl
}
})
}
else
{
filterList
.
push
({
ckid
:
item
.
ckid
,
wlid
:
item
.
wlid
})
showDatas
.
push
(
item
)
}
})
this
.
editTableConfig
.
editTableData
=
showDatas
},
data
()
{
return
{
datas
:
_
.
cloneDeep
(
this
.
app
.
$datas
),
editTableConfig
:
{
editTableTitle
:
[{
label
:
'仓库'
,
...
...
@@ -71,18 +100,18 @@
label
:
'username'
},
give
()
{
/*
v2在批量渲染复杂组件,虽然通过forEach来对数组进行了特殊处理,延迟后进行渲染,明显是响应式
但是由于diff进行一些奇怪的性能增强,导致这些dom刷新排到了下个队列
所以为了符合预期直接改变list的地址让vue2认为这是重新的渲染而不用错误的优化导致展示延迟
/*
v2中对象属性没定义直接去动态添加(不是修改)会监听不到,在下一个周期刷新
要么初始化赋值,要么直接更新对象来解决这个问题
*/
let
list
=
_
.
cloneDeep
(
that
.
editTableConfig
.
editTableData
)
let
list
=
that
.
datas
list
.
forEach
(
item
=>
{
if
(
item
.
wlid
==
this
.
form
.
wlid
&&
item
.
ckid
==
this
.
form
.
ckid
)
{
item
.
fzrName
=
this
.
form
.
fzrName
item
.
fzrid
=
this
.
form
.
fzrid
}
})
that
.
editTableConfig
.
editTableData
=
list
//
that.editTableConfig.editTableData=list
}
...
...
@@ -90,7 +119,7 @@
},
],
editTableData
:
_
.
cloneDeep
(
this
.
app
.
$datas
)
editTableData
:
[]
},
...
...
@@ -99,7 +128,7 @@
methods
:
{
save
()
{
this
.
app
.
showDialog
=
false
this
.
$emit
(
'save'
,
th
at
.
editTableConfig
.
editTableData
)
this
.
$emit
(
'save'
,
th
is
.
datas
)
}
}
...
...
Write
Preview
Markdown
is supported
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