Detail.vue 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <template>
  2. <a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
  3. <a-row :gutter="48" slot="extra">
  4. <a-col :md="48" :sm="48">
  5. <span class="table-page-search-submitButtons" style="float: right">
  6. <a-button style="margin-left: 8px" type="default" @click="handleCancel()">返回</a-button>
  7. </span>
  8. </a-col>
  9. </a-row>
  10. <title-divider title="基础信息" width="90px"></title-divider>
  11. <detail-list :col="2">
  12. <detail-list-item term="表单名称">{{ model.name }}</detail-list-item>
  13. <detail-list-item term="表单类型">{{ this.typeMap[model.type ] }}</detail-list-item>
  14. <detail-list-item term="模板分类">{{ this.categoryMap[model.category ] }}</detail-list-item>
  15. <detail-list-item term="备注">{{ model.remark }}</detail-list-item>
  16. <detail-list-item term="创建人">{{ model.createdUserName }}</detail-list-item>
  17. <detail-list-item term="创建时间">{{ model.createdTime }}</detail-list-item>
  18. </detail-list>
  19. <title-divider title="表单配置" width="90px"></title-divider>
  20. <a-card>
  21. <a-form
  22. :labelCol="BaseTool.Constant.labelCol"
  23. :wrapperCol="BaseTool.Constant.wrapperCol">
  24. <a-row>
  25. <MComponent
  26. class="hover"
  27. v-for="item in formComponentConfig.components"
  28. :key="item.id"
  29. :config="formComponentConfig.config"
  30. :detail="item"
  31. />
  32. </a-row>
  33. </a-form>
  34. </a-card>
  35. </a-card>
  36. </template>
  37. <script>
  38. import DetailList from '@/components/tools/DetailList'
  39. import MComponent from './component/modules/Component.vue'
  40. const DetailListItem = DetailList.Item
  41. export default {
  42. name: 'CustomFormDetail',
  43. components: {
  44. DetailList,
  45. DetailListItem,
  46. MComponent
  47. },
  48. data () {
  49. return {
  50. confirmLoading: false,
  51. mdl: {},
  52. modalTitle: null,
  53. visible: false,
  54. // 下拉框map
  55. model: {
  56. },
  57. categoryMap: {},
  58. typeMap: {},
  59. formComponentConfig: {}
  60. }
  61. },
  62. created () {
  63. // 下拉框map
  64. this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CUSTOM_FORM_TYPE)
  65. this.categoryMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CATEGORY_TYPE)
  66. },
  67. methods: {
  68. base (record) {
  69. this.visible = true
  70. this.modalTitle = '详情'
  71. this.model = record
  72. this.formComponentConfig = JSON.parse(record.jsonString)
  73. },
  74. handleCancel () {
  75. this.visible = false
  76. this.confirmLoading = false
  77. this.$emit('ok')
  78. }
  79. }
  80. }
  81. </script>