华西海圻ELN前端工程
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

69 lines
1.2 KiB

<template>
<div class="template-table">
<!-- <SP001 v-if="sn == 'SP0012'" />
<SWYPFXRYPZB v-if="sn == 'SP001'" /> -->
<component ref="templateComponent" :is="getTemplateComponent()" :fillType="fillType">
</component>
</div>
</template>
<script>
//色谱
import SP001 from './comps/sp/SP001';
import SWYPFXRYPZB from "./comps/sp/SWYPFXRYPZB.vue";
export default {
name: "TemplateTable",
components: {
SP001,SWYPFXRYPZB
},
props: {
sn: {
type: String,
default: '',
},
fillType: {
type: String,
default: 'preFill',
}
},
computed: {
templateComponentMap() {
if (!this.componentMap) {
this.componentMap = {
'SP001': 'SWYPFXRYPZB',
}
}
return this.componentMap
}
},
watch: {
sn: {
immediate: true,
handler(v) {
}
}
},
data() {
return {
info: {},
};
},
mounted() {
},
methods: {
async getFormData() {
return await this.$refs.templateComponent.getFormData();
},
getTemplateComponent() {
return this.templateComponentMap[this.sn]
},
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.template-table {
background: #fff;
padding: 10px 10px;
}
</style>