看板问题修改

master
yesg 1 week ago
parent a3c7bcdc4a
commit e8f6ecd782

@ -827,7 +827,7 @@
style="width: 100%"
>
<el-option
label="顶部"
label="0刻度"
value="start"
/>
<el-option
@ -835,7 +835,7 @@
value="center"
/>
<el-option
label="底部"
label="最大刻度"
value="end"
/>
</el-select>
@ -1042,7 +1042,7 @@
<el-form-item label="对齐方式" v-if="Object.keys(nodeAttrForm).includes('align')">
<el-select
v-model="nodeAttrForm.align"
placeholder="Select"
placeholder="请选择"
style="width: 100%"
>
<el-option

@ -120,8 +120,6 @@ const getOption = () => {
formatter: props.data?.options?.pieLabelFormatter || '{b}: {d}%'
},
itemStyle:{
color:(a,b,c,d) =>{
}
},
labelLine: {
length: 2,
@ -134,6 +132,7 @@ const getOption = () => {
let yData = [props.inputData?.y1 || []];
let length = Math.min(...xData.map(e => e.length), ...yData.map(e => e.length));
let source = [['product', ...[props.data.options?.yNames?.[0] || '数量']]];
console.log(source);
Array(length).fill(0).forEach((_, i) => {
let item = [];
xData.forEach(e => {

@ -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>

@ -9,7 +9,8 @@ const iframe = ref(null);
onMounted(() => {
iframe.value.onload = function() {
setTimeout(() => {
iframe.value.contentWindow.postMessage('print', '*');
// iframe.value.contentWindow.postMessage({ type: 'print', message: '' }, '*');
iframe.value.contentWindow.postMessage({ type: 'print', message: '' }, '*');
}, 1000);
};
});

Loading…
Cancel
Save