Commit 0cbd8e52 by chenwq

素材弹窗

1 parent c9263645
......@@ -34,11 +34,16 @@
</el-tooltip> -->
<!-- <el-popover placement="top" trigger="click">
<div>
<img src="@/assets/material/car.png" alt="" />
<img style="width: 72px; height: 72px;" v-if="item.materialContentRpcResponse.materialUrl" :src="item.materialContentRpcResponse.materialUrl" alt="" />
<img class="img-material" v-else src="@/assets/material/car.png" alt="" />
</div>
<img slot="reference" class="img-material" src="@/assets/material/car.png" alt="" />
<span slot="reference">
<img v-if="item.materialContentRpcResponse.materialUrl" class="img-material" :src="item.materialContentRpcResponse.materialUrl" />
<img v-else class="img-material" src="@/assets/material/car.png" alt="" />
</span>
</el-popover> -->
<img class="img-material" src="@/assets/material/car.png" alt="" />
<img v-if="item.materialContentRpcResponse.materialUrl" class="img-material" :src="item.materialContentRpcResponse.materialUrl" />
<img v-else class="img-material" src="@/assets/material/car.png" alt="" />
</span>
</div>
<!-- </div> -->
......@@ -180,6 +185,24 @@ export default {
this.$apis.sop.getMaterialListApi(params).then(res => {
this.modelList = res.data
this.tableTotal = res.count
let tableData = []
this.modelList.forEach(item => {
if (item.materialType != 3) {
item.materialContentRpcResponse.materialUrl = ''
}
if (item.materialType == 3) {
let html = decodeURIComponent(item.materialContentRpcResponse.materialUrl)
let imgHtml = html.match(/<img.*?(?:>|\/>)/g)
if (imgHtml) {
let imgSrc = imgHtml[0].match('<img[^<>]*? src="([^<>]*?)"')
item.materialContentRpcResponse.materialUrl = imgSrc[1]
} else {
item.materialContentRpcResponse.materialUrl = ''
}
}
tableData.push(item)
})
console.log(this.modelList)
})
},
handleReset() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!