index.vue 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <!--
  2. * @Author: Liugh
  3. * @Date: 2021-05-17 14:54:08
  4. * @LastEditTime: 2021-05-20 10:53:13
  5. * @LastEditors: Do not edit
  6. * @FilePath: \auth-web\src\pages\data-auth-module\auth-object-manage\object-prop-manage\index.vue
  7. * @Description:
  8. -->
  9. <template>
  10. <main class="subject-property">
  11. <dg-row gutter="1rem">
  12. <dg-col :span="5">
  13. <tree ref="tree" title="客体属性类" type="OBJ" @submitNodeOperate="getNodeOperate" />
  14. </dg-col>
  15. <!-- 属性详情 -->
  16. <dg-col :span="6">
  17. <prop-detail
  18. :parentNode="parentNode"
  19. type="OBJ"
  20. :key="key"
  21. :operateType="operateType"
  22. @savePropSuccess="refreshTree"
  23. ></prop-detail>
  24. </dg-col>
  25. <dg-col :span="13">
  26. <!-- TODO 根据点击属性类型判断显示什么表格 -->
  27. <component
  28. :is="componentValue"
  29. :parentNode="parentNode"
  30. :operateType="operateType"
  31. :key="key"
  32. ></component>
  33. </dg-col>
  34. </dg-row>
  35. </main>
  36. </template>
  37. <script>
  38. import Tree from "../../auth-subject-manage/subject-prop-manage/prop-tree";
  39. import propDetail from "../../auth-subject-manage/subject-prop-manage/prop-detail";
  40. import functionList from "./function-list";
  41. import serviceList from "./service-list";
  42. import applicationList from "./application-list";
  43. import dataSourceList from "./data-source-list";
  44. export default {
  45. name: "subject-property", // 组件名称
  46. props: {
  47. // 接收父组件的数据
  48. },
  49. data() {
  50. // 组件内部参数
  51. return {
  52. // 参数名称及默认值
  53. componentType: {
  54. FUN: "function-list",
  55. SER: "service-list",
  56. APP: "application-list",
  57. DATA: "data-source-list"
  58. },
  59. componentValue: "application-list",
  60. parentNode: {},
  61. key: 0,
  62. // 操作类型,新增属性还是编辑
  63. operateType: ""
  64. };
  65. },
  66. computed: {}, // 计算属性
  67. watch: {}, // 侦听器(扩展的计算属性)
  68. components: { Tree, functionList, serviceList, applicationList, propDetail, dataSourceList }, // 注册局部组件
  69. methods: {
  70. /**
  71. * 获取树操作
  72. */
  73. getNodeOperate(data) {
  74. const { attrBelongType, operateType } = data;
  75. this.operateType = operateType;
  76. this.parentNode = data;
  77. this.componentValue = this.componentType[attrBelongType];
  78. this.key++;
  79. },
  80. /**
  81. * 刷新属性树
  82. */
  83. refreshTree() {
  84. this.$refs.tree.init();
  85. },
  86. /**
  87. * @description: 表单查询
  88. */
  89. handleSearch() {}
  90. },
  91. created() {} // 组件创建完成后
  92. };
  93. </script>
  94. <style lang="scss" scoped>
  95. @import "../../auth-subject-manage/index.scss";
  96. </style>