ic-simple-info-modal.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <a-config-provider :locale="zhCN">
  3. <a-modal v-model="visible" :width="1000" :closable="false" @ok="handleOk">
  4. <template slot="title">
  5. <div :class="$style.modaltitle"
  6. >样本信息
  7. <!-- <a-tooltip>
  8. <template slot="title">
  9. 上传提示,内容待定
  10. </template>
  11. <span :class="$style.tips"><a-icon type="exclamation-circle"/></span>
  12. </a-tooltip> -->
  13. </div>
  14. </template>
  15. <xm-child-table
  16. ref="childTable"
  17. v-model="value"
  18. :class="$style.sampleinfo"
  19. :read-only="readonly"
  20. :fields="
  21. [
  22. {
  23. caption: '序号',
  24. name: 'sortNum',
  25. dataType: 'number',
  26. attr: {},
  27. },
  28. ].concat(Array.from(formData.attr.dync))
  29. "
  30. :columns="columns"
  31. >
  32. </xm-child-table>
  33. </a-modal>
  34. </a-config-provider>
  35. </template>
  36. <script>
  37. import zhCN from 'ant-design-vue/es/locale-provider/zh_CN'
  38. import components from './_import-components/ic-simple-info-modal-import'
  39. export default {
  40. name: 'IcSimpleInfoModal',
  41. components,
  42. data() {
  43. return {
  44. zhCN,
  45. visible: false,
  46. formData: null,
  47. readonly: false,
  48. value: null,
  49. columns: [
  50. {
  51. title: '序号',
  52. dataIndex: 'sortNum',
  53. width: '80px',
  54. customRender: (text, record, index) => `${index + 1}`,
  55. },
  56. { dataIndex: 'id', sdHidden: true },
  57. { dataIndex: 'sourceId', sdHidden: true },
  58. { dataIndex: 'sampleName' },
  59. { dataIndex: 'sampleDesc' },
  60. { dataIndex: 'attachment', sdHidden: false },
  61. ],
  62. }
  63. },
  64. created() {
  65. this.readonly = this.model.readonly
  66. console.log(this.model.attr.dync)
  67. this.formData = this.model.attr.dync.find(
  68. (item) =>
  69. item.name === 'icEvaluationControlSampleList' || item.name === 'icEvaluationCrossSampleList'
  70. )
  71. const info =
  72. this.simpleData?.icEvaluationControlSampleList || this.simpleData?.icEvaluationCrossSampleList
  73. if (info) {
  74. this.value = JSON.parse(info)
  75. }
  76. this.visible = true
  77. },
  78. methods: {},
  79. }
  80. </script>
  81. <style module lang="scss">
  82. @use '@/common/design' as *;
  83. .sampleinfo {
  84. :global(.ant-table-wrapper) {
  85. margin-top: 50px;
  86. }
  87. /* stylelint-disable-next-line */
  88. :global(.caption_xm-child-table_product) {
  89. top: 60px;
  90. right: 10px;
  91. }
  92. }
  93. .modaltitle {
  94. position: relative;
  95. z-index: 9;
  96. .tips {
  97. float: right;
  98. }
  99. }
  100. </style>