Detail.vue 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <a-modal
  3. :title="modalTitle"
  4. :width="850"
  5. :visible="visible"
  6. :confirmLoading="confirmLoading"
  7. @cancel="handleCancel"
  8. >
  9. <detail-list title="" :col="2">
  10. <detail-list-item term="编号">{{ model.id }}</detail-list-item>
  11. <detail-list-item term="编码">{{ model.no }}</detail-list-item>
  12. <detail-list-item term="名称">{{ model.name }}</detail-list-item>
  13. <detail-list-item term="类型">{{ BaseTool.Object.getField(positionTypeMap,model.type) }}</detail-list-item>
  14. <detail-list-item term="排序">{{ model.sort }}</detail-list-item>
  15. <detail-list-item term="上层位置">{{ model.parentName }}</detail-list-item>
  16. <detail-list-item term="备注">{{ model.remark }}</detail-list-item>
  17. <detail-list-item term="图片"><img :src="BaseTool.Constant.FILE_URL + model.opcImg" width="200px" height="200px"/></detail-list-item>
  18. <detail-list-item term="创建人">{{ model.createdUserName }}</detail-list-item>
  19. <detail-list-item term="是否OPC展示"><badge :status="DictCache.COLOR.DELFLAG[model.opcFlag]" :text="yesNoMap[model.opcFlag]"></badge></detail-list-item>
  20. <detail-list-item term="是否删除"><badge :status="DictCache.COLOR.DELFLAG[model.delFlag]" :text="delFlagMap[model.delFlag]"></badge></detail-list-item>
  21. <detail-list-item term="更新日期">{{ model.updateTime }}</detail-list-item>
  22. </detail-list>
  23. <template slot="footer">
  24. <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">返回</a-button>
  25. </template>
  26. </a-modal>
  27. </template>
  28. <script>
  29. import DetailList from '@/components/tools/DetailList'
  30. const DetailListItem = DetailList.Item
  31. export default {
  32. name: 'RemotePositionDetail',
  33. components: {
  34. DetailList,
  35. DetailListItem
  36. },
  37. data () {
  38. return {
  39. confirmLoading: false,
  40. mdl: {},
  41. modalTitle: null,
  42. visible: false,
  43. model: {
  44. 'id': null,
  45. 'no': null,
  46. 'name': null,
  47. 'opcFlag': null,
  48. 'opcImg': null,
  49. 'type': null,
  50. 'sort': null,
  51. 'delFlag': null,
  52. 'parentId': null,
  53. 'remark': null,
  54. 'createdUserId': null,
  55. 'updateTime': null,
  56. 'parentName': null,
  57. 'createdUserName': null
  58. },
  59. positionTypeMap: {},
  60. yesNoMap: {},
  61. delFlagMap: {}
  62. }
  63. },
  64. created () {
  65. this.delFlagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.DELFLAG)
  66. this.yesNoMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
  67. this.positionTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBPOSITION_TYPE)
  68. },
  69. methods: {
  70. base (record) {
  71. this.visible = true
  72. this.modalTitle = '详情'
  73. this.model = record
  74. },
  75. handleCancel () {
  76. this.visible = false
  77. this.confirmLoading = false
  78. }
  79. }
  80. }
  81. </script>