|
@@ -75,15 +75,15 @@ export default {
|
|
|
this.$emit('click', item)
|
|
|
},
|
|
|
setItemwidth () { // 适配嵌入工作台内
|
|
|
- const bodyWidth = window.screen.width - 212
|
|
|
+ const bodyWidth = window.screen.width - 212 - 8
|
|
|
if (window.goTemplateData && window.goTemplateData.inIframe && bodyWidth > 1248) {
|
|
|
const itemwidth = 279 + 104 // 104是margin
|
|
|
const num = Math.floor((bodyWidth - 96) / itemwidth)
|
|
|
- const newwidth = ((Math.floor((bodyWidth - (itemwidth * num) - 96) / num)) + itemwidth) - 104
|
|
|
+ console.log(num)
|
|
|
+ const newwidth = (Math.floor((bodyWidth - 96 - (itemwidth * num)) / num)) + 279
|
|
|
var elements = document.querySelectorAll('.card-item')
|
|
|
elements.forEach(function (ele) {
|
|
|
ele.style.width = newwidth + 'px' // 设置新的宽度
|
|
|
- console.log(ele.style.width)
|
|
|
})
|
|
|
}
|
|
|
}
|