Detail.vue 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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="模板分类">{{ categoryMap[model.category ] }}</detail-list-item>
  14. <detail-list-item term="表单类型">{{childrenMaps[model.category ][model.type ]}}</detail-list-item>
  15. <detail-list-item term="关联流程">{{ workFlowList.find(item => item.id === model.flowId).name}}</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-item term="备注">{{ model.remark }}</detail-list-item>
  19. </detail-list>
  20. <title-divider title="表单配置" width="90px"></title-divider>
  21. <a-card>
  22. <a-form :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
  23. <a-row>
  24. <MComponent class="hover" v-for="item in formComponentConfig.components" :key="item.id" :config="formComponentConfig.config" :detail="item" />
  25. </a-row>
  26. </a-form>
  27. </a-card>
  28. </a-card>
  29. </template>
  30. <script>
  31. import DetailList from '@/components/tools/DetailList'
  32. import MComponent from './component/modules/Component.vue'
  33. const DetailListItem = DetailList.Item
  34. import { queryWorkflow } from '@/api/workflow/workflow'
  35. export default {
  36. name: 'CustomFormDetail',
  37. components: {
  38. DetailList,
  39. DetailListItem,
  40. MComponent,
  41. },
  42. data() {
  43. return {
  44. confirmLoading: false,
  45. mdl: {},
  46. modalTitle: null,
  47. visible: false,
  48. // 下拉框map
  49. model: {},
  50. categoryMap: {},
  51. childrenMaps: [],
  52. formComponentConfig: {},
  53. workFlowList: [],
  54. }
  55. },
  56. created() {
  57. // 下拉框map
  58. this.categoryMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CATEGORY_TYPE)
  59. this.DictCache.getChildrenList(this.DictCache.TYPE.CATEGORY_TYPE).forEach((item) => {
  60. this.childrenMaps[item.value] = this.DictCache.getLabelByValueMapByType(item.code)
  61. })
  62. queryWorkflow().then((res) => {
  63. this.workFlowList = res.data
  64. })
  65. },
  66. methods: {
  67. base(record) {
  68. this.visible = true
  69. this.modalTitle = '详情'
  70. this.model = record
  71. this.formComponentConfig = JSON.parse(record.jsonString)
  72. },
  73. handleCancel() {
  74. this.visible = false
  75. this.confirmLoading = false
  76. this.$emit('ok')
  77. },
  78. },
  79. }
  80. </script>