修改打印配置
parent
b376b32841
commit
fb53bec3f3
@ -0,0 +1,81 @@
|
||||
<template>
|
||||
<div
|
||||
:style="{width:props.dimensions.width+'px',height:props.dimensions.height+'px'}">
|
||||
<NodeResizer :min-width="96 / 2.54/2" :min-height="96 / 2.54/2" :max-width="pageSize.width"
|
||||
:max-height="pageSize.height" color="#000"
|
||||
v-if="!props.isView && !props.isHideHandle && props.selected" />
|
||||
<div class="custom-node"
|
||||
:style="{textAlign:props.data.options.align,width:props.dimensions.width+'px',lineHeight:props.dimensions.height+'px',height:props.dimensions.height+'px',pointerEvents:props.isView?'auto': 'auto'}">
|
||||
<el-select
|
||||
v-model="value"
|
||||
style="width: 100%;height: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { defineProps } from 'vue';
|
||||
import { NodeResizer } from '@vue-flow/node-resizer';
|
||||
|
||||
const props = defineProps({
|
||||
isView: {
|
||||
type: Boolean,
|
||||
required: false
|
||||
},
|
||||
isHideHandle: {
|
||||
type: Boolean,
|
||||
required: false
|
||||
},
|
||||
selected: {
|
||||
type: Boolean,
|
||||
required: false
|
||||
},
|
||||
data: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
dimensions: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
pageSize: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
pageData: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
});
|
||||
const value = ref('');
|
||||
const options = ref([]);
|
||||
const getEleData = () => {
|
||||
if (props.isView) {
|
||||
options.value = props.data.options.field ? props.pageData?.[props.data.options.field] : props.data.options.selectOptions;
|
||||
} else {
|
||||
options.value = props.data.options.selectOptions || [];
|
||||
}
|
||||
};
|
||||
onMounted(() => {
|
||||
getEleData();
|
||||
});
|
||||
watch(() => JSON.parse(JSON.stringify(props.data.options.selectOptions)), (obj1, obj2) => {
|
||||
if (JSON.stringify(obj1) !== JSON.stringify(obj2)) {
|
||||
getEleData();
|
||||
}
|
||||
}, { deep: true });
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
.custom-node {
|
||||
position: absolute;
|
||||
}
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue