华西海圻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.

68 lines
1.2 KiB

2 weeks ago
2 weeks ago
  1. <template>
  2. <div class="template-table">
  3. <!-- <SP001 v-if="sn == 'SP0012'" />
  4. <SWYPFXRYPZB v-if="sn == 'SP001'" /> -->
  5. <component ref="templateComponent" :is="getTemplateComponent()" :fillType="fillType">
  6. </component>
  7. </div>
  8. </template>
  9. <script>
  10. //色谱
  11. import SP001 from './comps/sp/SP001';
  12. import SWYPFXRYPZB from "./comps/sp/SWYPFXRYPZB.vue";
  13. export default {
  14. name: "TemplateTable",
  15. components: {
  16. SP001,SWYPFXRYPZB
  17. },
  18. props: {
  19. sn: {
  20. type: String,
  21. default: '',
  22. },
  23. fillType: {
  24. type: String,
  25. default: 'preFill',
  26. }
  27. },
  28. computed: {
  29. templateComponentMap() {
  30. if (!this.componentMap) {
  31. this.componentMap = {
  32. 'SP001': 'SWYPFXRYPZB',
  33. }
  34. }
  35. return this.componentMap
  36. }
  37. },
  38. watch: {
  39. sn: {
  40. immediate: true,
  41. handler(v) {
  42. }
  43. }
  44. },
  45. data() {
  46. return {
  47. info: {},
  48. };
  49. },
  50. mounted() {
  51. },
  52. methods: {
  53. async getFormData() {
  54. return await this.$refs.templateComponent.getFormData();
  55. },
  56. getTemplateComponent() {
  57. return this.templateComponentMap[this.sn]
  58. },
  59. }
  60. };
  61. </script>
  62. <style rel="stylesheet/scss" lang="scss">
  63. .template-table {
  64. background: #fff;
  65. padding: 10px 10px;
  66. }
  67. </style>