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

84 lines
1.9 KiB

2 weeks ago
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()" :templateData="templateData" :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. import SWYPFXCBYPZB from "./comps/sp/SWYPFXCBYPZB.vue";
  14. import SWYPBQGZYZBB from "./comps/sp/SWYPBQGZYZBB.vue";
  15. import SYWZPZJHB from "./comps/dl/SYWZPZJHB.vue";
  16. import SWYPNBGZYZBB from "./comps/sp/SWYPNBGZYZBB.vue";
  17. import Demo from "./comps/sp/Demo.vue";
  18. export default {
  19. name: "TemplateTable",
  20. components: {
  21. SP001,SWYPFXRYPZB ,Demo,SWYPFXCBYPZB,SWYPBQGZYZBB,SYWZPZJHB,SWYPNBGZYZBB,
  22. },
  23. props: {
  24. sn: {
  25. type: String,
  26. default: '',
  27. },
  28. fillType: {
  29. type: String,
  30. default: 'preFill',
  31. },
  32. templateData: {
  33. type: Object,
  34. default: () => {},
  35. },
  36. },
  37. computed: {
  38. templateComponentMap() {
  39. if (!this.componentMap) {
  40. this.componentMap = {
  41. 'SP001': 'SWYPFXRYPZB',
  42. 'SP002': 'SWYPFXCBYPZB',
  43. 'SP003': 'SWYPBQGZYZBB',
  44. 'SP004': 'SWYPNBGZYZBB',
  45. 'DL001': 'SYWZPZJHB',
  46. // 'SP001': 'Demo',
  47. }
  48. }
  49. return this.componentMap || "Demo"
  50. }
  51. },
  52. watch: {
  53. sn: {
  54. immediate: true,
  55. handler(v) {
  56. console.log(v,"sn")
  57. }
  58. }
  59. },
  60. data() {
  61. return {
  62. info: {},
  63. };
  64. },
  65. mounted() {
  66. console.log(this.fillType,"fillType")
  67. },
  68. methods: {
  69. async getFormData() {
  70. return await this.$refs.templateComponent.getFormData();
  71. },
  72. getTemplateComponent() {
  73. return this.templateComponentMap[this.sn]
  74. },
  75. }
  76. };
  77. </script>
  78. <style rel="stylesheet/scss" lang="scss">
  79. .template-table {
  80. background: #fff;
  81. padding: 10px 10px;
  82. }
  83. </style>