Commit 2e3084a0 authored by 786817560's avatar 786817560

Merge branch 'ren' into develop

parents 021289c9 6f625997
### dom操作,一次性插入100个节点,和我分100次插入1个节点,哪个性能更高?
**答案**: 一次性插入100个节点性能更好。
**理解**:一次性插入100个,只对dom节点进行了一次操作,而分100次插入则操作了100次dom节点。插入节点时dom树每次会重新计算,生成新的dom树,渲染树也会跟着改变。浏览器会使渲染树中受影响的部分失效,重新绘制,因此也会进行100次重绘。影响性能。(也不知是影响cpu? Gpu? 还是浏览器--)。
### 问题
- ssr从服务器返回字符串,进行HTML渲染,是怎么返回的?以何种方式返回的?
- js解析主线程跟GUI渲染线程存在优先级吗?
...@@ -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 14:37:36 * @LastEditTime: 2019-12-12 17: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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment