Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hls-xcmg-vue-app
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
xugong
hls-xcmg-vue-app
Commits
2e3084a0
Commit
2e3084a0
authored
Dec 12, 2019
by
786817560
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ren' into develop
parents
021289c9
6f625997
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
137 additions
and
54 deletions
+137
-54
12-7.md
12-7.md
+0
-11
enclosure.vue
src/pages/userBindNew/org/enclosure.vue
+137
-43
No files found.
12-7.md
deleted
100644 → 0
View file @
021289c9
### dom操作,一次性插入100个节点,和我分100次插入1个节点,哪个性能更高?
**答案**
: 一次性插入100个节点性能更好。
**理解**
:一次性插入100个,只对dom节点进行了一次操作,而分100次插入则操作了100次dom节点。插入节点时dom树每次会重新计算,生成新的dom树,渲染树也会跟着改变。浏览器会使渲染树中受影响的部分失效,重新绘制,因此也会进行100次重绘。影响性能。(也不知是影响cpu? Gpu? 还是浏览器--)。
### 问题
-
ssr从服务器返回字符串,进行HTML渲染,是怎么返回的?以何种方式返回的?
-
js解析主线程跟GUI渲染线程存在优先级吗?
src/pages/userBindNew/org/enclosure.vue
View file @
2e3084a0
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Description: 附件信息
* @Description: 附件信息
* @Author: your name
* @Author: your name
* @Date: 2019-09-20 09:35:11
* @Date: 2019-09-20 09:35:11
* @LastEditTime: 2019-12-12 1
4:37:36
* @LastEditTime: 2019-12-12 1
7:23:31
* @LastEditors: Please set LastEditors
* @LastEditors: Please set LastEditors
-->
-->
<
template
>
<
template
>
...
@@ -17,57 +17,61 @@
...
@@ -17,57 +17,61 @@
<div
v-for=
"(list, index) in cddItemList"
:key=
"index"
class=
"card2"
>
<div
v-for=
"(list, index) in cddItemList"
:key=
"index"
class=
"card2"
>
<span>
{{
list
.
description
}}
</span>
<span>
{{
list
.
description
}}
</span>
<div
class=
"img-content"
>
<div
class=
"img-content"
>
<div
v-if=
"list.cdd_item==='CAR_CARD' || list.cdd_item==='HOUSE_CARD'"
>
<!-- 房产 -->
<!--从服务器上下载的图片-->
<div
v-if=
"list.cdd_item==='HOUSE_CARD'"
>
<div
v-for=
"item in dowload_list"
>
<div
v-if=
"!houseImg"
class=
"card-upload plus"
@
click=
"ocrShow(list.cdd_item, '')"
>
<div
v-for=
"(pic, index) in item"
v-if=
"pic.check_id==list.check_id"
:key=
"index"
>
<img
src=
"@/assets/userBind/camera.png"
class=
"upload-btn"
>
<!-- 通过 -->
<div
v-if=
"isApproved"
class=
"card-upload"
>
<img
:src=
"pic.url"
@
click=
"showBigPicture(pic.url)"
>
</div>
<!-- 未通过 -->
<div
v-if=
"!isApproved"
class=
"card-upload"
>
<img
:src=
"pic.url"
@
click=
"ocrShow(list.cdd_item, '')"
>
</div>
<!--
<div
v-if=
"pic.length === 0"
class=
"card-upload plus"
@
click=
"imgUploadShow(list.description,list.check_id)"
>
<img
src=
"@/assets/userBind/camera.png"
class=
"upload-btn"
>
</div>
-->
</div>
</div>
</div>
<!--待上传图片列表-->
<!-- 通过 -->
<div
<div
v-if=
"isApproved"
class=
"card-upload"
>
v-for=
"(item, index) in upload_list"
v-if=
"item.check_id==list.check_id"
:key=
"index"
<img
:src=
"houseImg"
@
click=
"showBigPicture(houseImg)"
>
class=
"card-upload"
>
</div>
<img
:src=
"item.picture"
@
click=
"ocrShow(list.cdd_item, '')"
>
<!-- 未通过 -->
<!--
<div
class=
"close"
@
click=
"remove_pic(item.attachment_id, index)"
>
<div
v-if=
"houseImg&&!isApproved"
class=
"card-upload"
>
<img
src=
"@/assets/userBind/deleteIcon.png"
>
<img
:src=
"houseImg"
@
click=
"ocrShow(list.cdd_item, '')"
>
</div>
-->
</div>
</div>
</div>
</div>
<div
v-else
>
<!-- 车辆 -->
<div
v-for=
"item in dowload_list"
>
<div
v-if=
"list.cdd_item==='CAR_CARD'"
>
<div
v-for=
"(pic, index) in item"
v-if=
"pic.check_id==list.check_id"
:key=
"index"
class=
"card-upload"
>
<div
v-if=
"!carImg"
class=
"card-upload plus"
@
click=
"ocrShow(list.cdd_item, '')"
>
<img
:src=
"pic.url"
@
click=
"showBigPicture(pic.url)"
>
<img
src=
"@/assets/userBind/camera.png"
class=
"upload-btn"
>
<div
class=
"close"
@
click=
"delete_pic(pic.attachment_id)"
>
</div>
<img
src=
"@/assets/userBind/deleteIcon.png"
>
<!-- 通过 -->
</div>
<div
v-if=
"carImg&&isApproved"
class=
"card-upload"
>
</div>
<img
:src=
"carImg"
@
click=
"showBigPicture(carImg)"
>
</div>
<!-- 未通过 -->
<div
v-if=
"carImg&&!isApproved"
class=
"card-upload"
>
<img
:src=
"carImg"
@
click=
"ocrShow(list.cdd_item, '')"
>
</div>
</div>
</div>
<!-- 其他 -->
<div
v-if=
"list.cdd_item==='ASSETS_CARD'"
>
<!--待上传图片列表-->
<!--待上传图片列表-->
<div
<div
v-for=
"(item, index) in upload_list"
v-if=
"item.check_id==list.check_id"
:key=
"index"
v-for=
"(item, index) in upload_list"
class=
"card-upload"
>
v-if=
"item.check_id==list.check_id"
<img
:src=
"item.picture"
@
click=
"ocrShow(list.cdd_item, '')"
>
:key=
"index"
<div
class=
"close"
@
click=
"remove_pic(item.attachment_id, index)"
>
class=
"card-upload"
<img
src=
"@/assets/userBind/deleteIcon.png"
>
>
<img
:src=
"item.picture"
@
click=
"showBigPicture(item.picture)"
>
<div
class=
"close"
@
click=
"remove_pic(item.attachment_id,index)"
>
<img
src=
"@/assets/userBind/deleteIcon.png"
>
</div>
</div>
<!--从服务器上下载的图片-->
<div
v-for=
"(pic, index) in dowload_list[0]"
:key=
"index"
>
<div
v-if=
"pic.check_id==list.check_id"
:key=
"index"
class=
"card-upload"
>
<img
:src=
"pic.url"
@
click=
"showBigPicture(pic.url)"
>
<div
class=
"close"
@
click=
"delete_pic(pic.attachment_id)"
>
<img
src=
"@/assets/userBind/deleteIcon.png"
>
</div>
</div>
</div>
</div>
</div>
<div
class=
"card-upload plus"
@
click=
"imgUploadShow(list.description,list.check_id)"
>
<div
class=
"card-upload plus"
@
click=
"imgUploadShow(list.description,list.check_id)"
>
<img
src=
"@/assets/userBind/camera.png"
class=
"upload-btn"
>
<img
src=
"@/assets/userBind/camera.png"
class=
"upload-btn"
>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--
</div>
-->
<!--
</div>
-->
...
@@ -81,6 +85,10 @@
...
@@ -81,6 +85,10 @@
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
house_id
:
''
,
// 房产证checkid
car_id
:
''
,
// 车辆证checkid
carFlag
:
false
,
// 行驶证查看标识,为false则用查询出来的,为true则用拍照出来的
houseFlag
:
false
,
// 房产证查看标识,为false则用查询出来的,为true则用拍照出来的
carImg
:
''
,
carImg
:
''
,
houseImg
:
''
,
houseImg
:
''
,
from
:
false
,
from
:
false
,
...
@@ -89,6 +97,8 @@ export default {
...
@@ -89,6 +97,8 @@ export default {
isApproved
:
false
,
isApproved
:
false
,
isUploadCar
:
false
,
isUploadCar
:
false
,
isUploadHouse
:
false
,
isUploadHouse
:
false
,
carAttachmentId
:
''
,
// 车辆证id
houseAttachmentId
:
''
,
// 房产证id
cddItemList
:
[],
// 资料清单列表
cddItemList
:
[],
// 资料清单列表
dowload_list
:
[],
// 下载图片列表
dowload_list
:
[],
// 下载图片列表
upload_list
:
[],
// 上传图片列表
upload_list
:
[],
// 上传图片列表
...
@@ -116,6 +126,43 @@ export default {
...
@@ -116,6 +126,43 @@ export default {
bp_id
:
this
.
bp_id
,
bp_id
:
this
.
bp_id
,
},
},
})
})
let
vm
=
this
if
(
vm
.
isUploadHouse
)
{
vm
.
houseFlag
=
true
vm
.
delete_pic_to_ocr
(
vm
.
houseAttachmentId
)
// 房产证修改,重新上传
let
list
=
[]
let
obj
=
{
pkvalue
:
vm
.
house_id
,
source_type
:
'PRJ_CDD_ITEM_CHECK'
,
picture
:
''
,
check_id
:
vm
.
house_id
,
filePath
:
vm
.
houseImg
,
attachment_id
:
''
,
user_id
:
1
,
fileName
:
'房产证'
,
}
list
.
push
(
obj
)
vm
.
save_picture
(
list
)
vm
.
isUploadHouse
=
false
// 置为false,防止再次保存重复上传,只有重新识别才会重新上传
}
if
(
vm
.
isUploadCar
)
{
vm
.
carFlag
=
true
vm
.
delete_pic_to_ocr
(
vm
.
carAttachmentId
)
// 房产证修改,重新上传
let
list
=
[]
let
obj
=
{
pkvalue
:
vm
.
car_id
,
source_type
:
'PRJ_CDD_ITEM_CHECK'
,
picture
:
''
,
check_id
:
vm
.
car_id
,
filePath
:
vm
.
carImg
,
attachment_id
:
''
,
user_id
:
1
,
fileName
:
'行驶证'
,
}
list
.
push
(
obj
)
vm
.
save_picture
(
list
)
vm
.
isUploadCar
=
false
// 置为false,防止再次保存重复上传,只有重新识别才会重新上传
}
},
},
// 房产证/车辆证识别
// 房产证/车辆证识别
ocrShow
(
ocrType
,
type
)
{
ocrShow
(
ocrType
,
type
)
{
...
@@ -171,8 +218,10 @@ export default {
...
@@ -171,8 +218,10 @@ export default {
}
else
{
}
else
{
if
(
ocrType
===
'HOUSE_CARD'
)
{
if
(
ocrType
===
'HOUSE_CARD'
)
{
vm
.
houseImg
=
imgUrl
[
0
]
vm
.
houseImg
=
imgUrl
[
0
]
vm
.
isUploadHouse
=
true
}
else
if
(
ocrType
===
'CAR_CARD'
)
{
}
else
if
(
ocrType
===
'CAR_CARD'
)
{
vm
.
carImg
=
imgUrl
[
0
]
vm
.
carImg
=
imgUrl
[
0
]
vm
.
isUploadCar
=
true
}
}
}
}
}
}
...
@@ -195,6 +244,19 @@ export default {
...
@@ -195,6 +244,19 @@ export default {
vm
.
hlsHttp
.
post
(
url
,
param
).
then
(
function
(
res
)
{
vm
.
hlsHttp
.
post
(
url
,
param
).
then
(
function
(
res
)
{
if
(
res
.
result
===
'S'
)
{
if
(
res
.
result
===
'S'
)
{
vm
.
cddItemList
=
[]
vm
.
cddItemList
=
[]
var
listTemp
=
[...
res
.
lists
]
listTemp
.
forEach
(
item
=>
{
switch
(
item
.
cdd_item
)
{
case
'HOUSE_CARD'
:
// 房产证
vm
.
house_id
=
item
.
check_id
break
case
'CAR_CARD'
:
// 承租人身份证背面
vm
.
car_id
=
item
.
check_id
break
default
:
break
}
})
vm
.
cddItemList
=
res
.
lists
.
filter
(
item
=>
{
return
item
.
cdd_item
===
'HOUSE_CARD'
||
item
.
cdd_item
===
'CAR_CARD'
||
item
.
cdd_item
===
'ASSETS_CARD'
})
vm
.
cddItemList
=
res
.
lists
.
filter
(
item
=>
{
return
item
.
cdd_item
===
'HOUSE_CARD'
||
item
.
cdd_item
===
'CAR_CARD'
||
item
.
cdd_item
===
'ASSETS_CARD'
})
// 查询图片
// 查询图片
vm
.
cddItemList
.
forEach
((
item
,
index
)
=>
{
vm
.
cddItemList
.
forEach
((
item
,
index
)
=>
{
...
@@ -217,9 +279,24 @@ export default {
...
@@ -217,9 +279,24 @@ export default {
res
.
lists
.
forEach
(
item
=>
{
res
.
lists
.
forEach
(
item
=>
{
item
[
'url'
]
=
process
.
env
.
filePath
+
'attachment_id='
+
item
.
attachment_id
+
'&access_token='
+
window
.
localStorage
.
access_token
item
[
'url'
]
=
process
.
env
.
filePath
+
'attachment_id='
+
item
.
attachment_id
+
'&access_token='
+
window
.
localStorage
.
access_token
})
})
switch
(
cdd_item
)
{
case
'HOUSE_CARD'
:
// 房产证
if
(
!
vm
.
houseFlag
)
{
vm
.
houseImg
=
res
.
lists
[
0
].
url
}
vm
.
houseAttachmentId
=
res
.
lists
[
0
].
attachment_id
break
case
'CAR_CARD'
:
// 行驶证
if
(
!
vm
.
carFlag
)
{
vm
.
carImg
=
res
.
lists
[
0
].
url
}
vm
.
carAttachmentId
=
res
.
lists
[
0
].
attachment_id
break
default
:
vm
.
dowload_list
.
push
(
res
.
lists
)
console
.
log
(
'dowload_listbbbbbbbbbbbb'
,
vm
.
dowload_list
)
}
console
.
log
(
'res.lists'
,
res
.
lists
)
console
.
log
(
'res.lists'
,
res
.
lists
)
vm
.
dowload_list
.
push
(
res
.
lists
)
console
.
log
(
'dowload_list'
,
vm
.
dowload_list
)
}
else
{
}
else
{
hlsPopup
.
showLongCenter
(
res
.
message
)
hlsPopup
.
showLongCenter
(
res
.
message
)
}
}
...
@@ -403,6 +480,23 @@ export default {
...
@@ -403,6 +480,23 @@ export default {
hlsPopup
.
hideLoading
()
hlsPopup
.
hideLoading
()
}
}
},
},
// 删除重新识别之前的图
delete_pic_to_ocr
(
attachment_id
)
{
let
vm
=
this
var
delete_list
=
[]
let
obj
=
{
attachment_id
:
attachment_id
}
delete_list
.
push
(
obj
)
let
url
=
process
.
env
.
basePath
+
'app_delete_attment'
// 附件删除
let
param
=
{
picturelist
:
delete_list
,
}
vm
.
hlsHttp
.
post
(
url
,
param
).
then
(
function
(
res
)
{
hlsPopup
.
hideLoading
()
if
(
res
.
result
===
'S'
)
{
}
else
if
(
res
.
result
===
'E'
)
{
}
})
},
},
},
}
}
</
script
>
</
script
>
...
...
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