|
|
|
|
@ -1,49 +1,82 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div
|
|
|
|
|
:style="{width:props.dimensions.width*props.ratioWidth+'px',height:props.dimensions.height*props.ratioHeight+'px'}">
|
|
|
|
|
<NodeResizer @resizeEnd="(e) => $emit('resize', e)" color="#fff" v-if="!props.isView && !props.isHideHandle && props.selected"
|
|
|
|
|
@resize="resize" />
|
|
|
|
|
<div :style="{ width: props.dimensions.width * props.ratioWidth + 'px', height: props.dimensions.height * props.ratioHeight + 'px' }">
|
|
|
|
|
<NodeResizer @resizeEnd="(e) => $emit('resize', e)" color="#fff" v-if="!props.isView && !props.isHideHandle && props.selected" @resize="resize" />
|
|
|
|
|
|
|
|
|
|
<div class="custom-node"
|
|
|
|
|
:style="{width:props.dimensions.width*props.ratioWidth+'px',height:props.dimensions.height*props.ratioHeight+'px',pointerEvents:props.isView?'auto': 'none'}">
|
|
|
|
|
<div style="background-color: #094170" v-if="props.data.options.isThShow"
|
|
|
|
|
:style="{ height:props.data.options.thHeight, color:props.data.options.thColor,backgroundColor:props.data.options?.thBgColor }">
|
|
|
|
|
<div class="scrollTable" style="font-weight: bold;"
|
|
|
|
|
:style="{width: i.width || '100px',textAlign:i.align || 'left',lineHeight:props.data.options.thHeight}"
|
|
|
|
|
v-for="i in props.data.options.tableOptions">
|
|
|
|
|
<div
|
|
|
|
|
class="custom-node"
|
|
|
|
|
:style="{
|
|
|
|
|
width: props.dimensions.width * props.ratioWidth + 'px',
|
|
|
|
|
height: props.dimensions.height * props.ratioHeight + 'px',
|
|
|
|
|
pointerEvents: props.isView ? 'auto' : 'none'
|
|
|
|
|
}"
|
|
|
|
|
>
|
|
|
|
|
<div
|
|
|
|
|
style="background-color: #094170"
|
|
|
|
|
v-if="props.data.options.isThShow"
|
|
|
|
|
:style="{ height: props.data.options.thHeight, color: props.data.options.thColor, backgroundColor: props.data.options?.thBgColor }"
|
|
|
|
|
>
|
|
|
|
|
<div
|
|
|
|
|
class="scrollTable"
|
|
|
|
|
style="font-weight: bold"
|
|
|
|
|
:style="{ width: i.width || '100px', textAlign: i.align || 'left', lineHeight: props.data.options.thHeight }"
|
|
|
|
|
v-for="i in props.data.options.tableOptions"
|
|
|
|
|
>
|
|
|
|
|
{{ i.name }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<vue3ScrollSeamless
|
|
|
|
|
:classOptions="props.data.options.tableClassOption ||{}"
|
|
|
|
|
:classOptions="props.data.options.tableClassOption || {}"
|
|
|
|
|
:dataList="props.inputData.tableData"
|
|
|
|
|
v-if="scrollShow"
|
|
|
|
|
style=" overflow: hidden"
|
|
|
|
|
:style="{height: `calc(100% - ${props.data.options.thHeight || '0px'})`}"
|
|
|
|
|
style="overflow: hidden"
|
|
|
|
|
:style="{ height: `calc(100% - ${props.data.options.thHeight || '0px'})` }"
|
|
|
|
|
>
|
|
|
|
|
<div
|
|
|
|
|
:style="{color:props.data.options.tdColor[index % props.data.options.tdColor?.length],backgroundColor:(props.data.options?.tdBgColor||[])[index % props.data.options.tdBgColor?.length]}"
|
|
|
|
|
v-for="(data,index) in props.inputData.tableData" :key="index ">
|
|
|
|
|
<div class="scrollTable" style="font-weight: bold;"
|
|
|
|
|
:style="{width: i.width || '100px',height:props.data.options.tdHeight,lineHeight:props.data.options.tdHeight,textAlign:i.align || 'left' }"
|
|
|
|
|
v-for="(i,k) in props.data.options.tableOptions">
|
|
|
|
|
<span v-if="i.type === '文本'">
|
|
|
|
|
{{ setText(((props.inputData.tableData || [])[index] || {})[i.field], i.formula)}}
|
|
|
|
|
</span>
|
|
|
|
|
:style="{
|
|
|
|
|
color: props.data.options.tdColor[index % props.data.options.tdColor?.length],
|
|
|
|
|
backgroundColor: (props.data.options?.tdBgColor || [])[index % props.data.options.tdBgColor?.length]
|
|
|
|
|
}"
|
|
|
|
|
v-for="(data, index) in props.inputData.tableData"
|
|
|
|
|
:key="index"
|
|
|
|
|
>
|
|
|
|
|
<div
|
|
|
|
|
class="scrollTable"
|
|
|
|
|
style="font-weight: bold"
|
|
|
|
|
:style="{
|
|
|
|
|
width: i.width || '100px',
|
|
|
|
|
height: props.data.options.tdHeight,
|
|
|
|
|
lineHeight: props.data.options.tdHeight,
|
|
|
|
|
textAlign: i.align || 'left'
|
|
|
|
|
}"
|
|
|
|
|
v-for="(i, k) in props.data.options.tableOptions"
|
|
|
|
|
>
|
|
|
|
|
<div style="width:100%;height:100%;overflow: hidden;position: relative;">
|
|
|
|
|
<span v-if="i.type === '文本'" class="lrScroll">
|
|
|
|
|
{{ setText(((props.inputData.tableData || [])[index] || {})[i.field], i.formula) }}
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
<el-progress class="progress" v-else-if="i.type === '进度条'" :text-inside="true"
|
|
|
|
|
:stroke-width="26"
|
|
|
|
|
:percentage="parseFloat(setText(((props.inputData.tableData || [])[index] || {})[i.field], i.formula))" />
|
|
|
|
|
<el-progress
|
|
|
|
|
class="progress"
|
|
|
|
|
v-else-if="i.type === '进度条'"
|
|
|
|
|
:text-inside="true"
|
|
|
|
|
:stroke-width="26"
|
|
|
|
|
:percentage="parseFloat(setText(((props.inputData.tableData || [])[index] || {})[i.field], i.formula))"
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<el-tag type="primary" v-else-if="i.type === '标签'">
|
|
|
|
|
{{ setText(((props.inputData.tableData || [])[index] || {})[i.field], i.formula) }}
|
|
|
|
|
</el-tag>
|
|
|
|
|
<el-image :preview-src-list="[((props.inputData.tableData || [])[index] || {})[i.field]]"
|
|
|
|
|
v-else-if="i.type === '图片'" style="width: 100%;" :style="{height:props.data.options.tdHeight}"
|
|
|
|
|
:src="setText(((props.inputData.tableData || [])[index] || {})[i.field],i.formula)" fit="contain" />
|
|
|
|
|
|
|
|
|
|
<span v-else>{{ setText(((props.inputData.tableData || [])[index] || {})[i.field], i.formula) }}</span>
|
|
|
|
|
<el-tag type="primary" v-else-if="i.type === '标签'">
|
|
|
|
|
{{ setText(((props.inputData.tableData || [])[index] || {})[i.field], i.formula) }}
|
|
|
|
|
</el-tag>
|
|
|
|
|
<el-image
|
|
|
|
|
:preview-src-list="[((props.inputData.tableData || [])[index] || {})[i.field]]"
|
|
|
|
|
v-else-if="i.type === '图片'"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
:style="{ height: props.data.options.tdHeight }"
|
|
|
|
|
:src="setText(((props.inputData.tableData || [])[index] || {})[i.field], i.formula)"
|
|
|
|
|
fit="contain"
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<span class="lrScroll" v-else>{{ setText(((props.inputData.tableData || [])[index] || {})[i.field], i.formula) }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</vue3ScrollSeamless>
|
|
|
|
|
@ -107,17 +140,20 @@ const setText = (value, formula) => {
|
|
|
|
|
if (!formula) {
|
|
|
|
|
return value;
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
watch(() => JSON.parse(JSON.stringify([props.inputData?.tableData || '', props.data.options])), (obj1, obj2) => {
|
|
|
|
|
if (JSON.stringify(obj1) !== JSON.stringify(obj2)) {
|
|
|
|
|
scrollShow.value = false;
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
scrollShow.value = true;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, { deep: true, immediate: true });
|
|
|
|
|
watch(
|
|
|
|
|
() => JSON.parse(JSON.stringify([props.inputData?.tableData || '', props.data.options])),
|
|
|
|
|
(obj1, obj2) => {
|
|
|
|
|
if (JSON.stringify(obj1) !== JSON.stringify(obj2)) {
|
|
|
|
|
scrollShow.value = false;
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
scrollShow.value = true;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{ deep: true, immediate: true }
|
|
|
|
|
);
|
|
|
|
|
const emit = defineEmits(['resize']);
|
|
|
|
|
const resize = (e) => {
|
|
|
|
|
emit('resize', e, props.id);
|
|
|
|
|
@ -133,11 +169,29 @@ const resize = (e) => {
|
|
|
|
|
vertical-align: top;
|
|
|
|
|
position: relative;
|
|
|
|
|
}
|
|
|
|
|
.progress{
|
|
|
|
|
|
|
|
|
|
.progress {
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 50%;
|
|
|
|
|
width: 100%;
|
|
|
|
|
transform: translateY(-50%);
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
.lrScroll {
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
animation: scroll 1s linear infinite alternate;
|
|
|
|
|
display: inline-block;
|
|
|
|
|
transition: all 1s;
|
|
|
|
|
height:100%;
|
|
|
|
|
position: absolute;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@keyframes scroll {
|
|
|
|
|
from {
|
|
|
|
|
transform: translateX(0);
|
|
|
|
|
}
|
|
|
|
|
to {
|
|
|
|
|
transform: translateX(-100%);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|