addSystemDialog.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <el-dialog :title="title" :visible.sync="dialogVisible" width="800px" id="addSyDialog">
  3. <div class="table-box">
  4. <el-table :data="tableData" style="width: 100%" height="100%" v-loading="loading" :header-cell-style="headerStyle" ref="multipleTable"
  5. @selection-change="handleSelectionChange">
  6. <el-table-column type="selection" width="55"></el-table-column>
  7. <el-table-column :label="`${inSpaceType}名称`" show-overflow-tooltip min-width="100">
  8. <template slot-scope="scope">
  9. <div>
  10. {{scope.row.SysLocalName||scope.row.SysName||''}}
  11. </div>
  12. </template>
  13. </el-table-column>
  14. <el-table-column prop="SysLocalID" :label="`${inSpaceType}本地编码`" show-overflow-tooltip min-width="100"></el-table-column>
  15. <el-table-column prop="action" label="操作" min-width="100">
  16. <template slot-scope="scope">
  17. <el-button size="mini" @click="toDetail(scope.$index, scope.row)" type="danger" plain icon="el-icon-delete"></el-button>
  18. </template>
  19. </el-table-column>
  20. </el-table>
  21. </div>
  22. <span slot="footer" class="dialog-footer">
  23. <el-button size="small" @click="dialogVisible = false">取 消</el-button>
  24. <el-button size="small" type="primary" @click="savaRelation">确 定</el-button>
  25. </span>
  26. </el-dialog>
  27. </template>
  28. <script>
  29. // import {
  30. // notSyInSpaceQuery, //没有和当前空间绑定的系统
  31. // syInSpaceCreate, //系统所在业务空间--创建关系
  32. // } from "@/api/scan/request";
  33. export default {
  34. data() {
  35. return {
  36. title: '添加空间内的系统',
  37. inSpaceType: '系统',
  38. dialogVisible: false,
  39. tableData: [],
  40. loading: false,
  41. headerStyle: {
  42. backgroundColor: '#e1e4e5',
  43. color: '#2b2b2b',
  44. lineHeight: '30px'
  45. }, // 列表样式
  46. selections: [], // 选中项
  47. }
  48. },
  49. props: {
  50. type: String, //选中的tab页
  51. params: Object //查看的竖井关系信息
  52. },
  53. methods: {
  54. // 显示
  55. showDialog() {
  56. this.dialogVisible = true;
  57. this.getTableData();
  58. },
  59. // 选中项修改
  60. handleSelectionChange(val) {
  61. this.selections = val;
  62. },
  63. // 确认
  64. savaRelation() {
  65. let pa = {
  66. data: {
  67. SpaceId: this.spaceId,
  68. SysIdList: []
  69. },
  70. type: this.zone
  71. }
  72. this.selections.map(t => {
  73. pa.data.SysIdList.push(t.SysID)
  74. })
  75. syInSpaceCreate(pa, res => {
  76. this.$message.success('关联成功');
  77. this.$emit('refresh');
  78. this.dialogVisible = false;
  79. })
  80. },
  81. // 获取表格数据
  82. getTableData() {
  83. let pa = {
  84. data: {
  85. PageSize: 200,
  86. },
  87. type: this.zone,
  88. spaceId: this.spaceId
  89. }
  90. notSyInSpaceQuery(pa, res => {
  91. this.tableData = res.Content;
  92. })
  93. },
  94. // 查看详情
  95. toDetail() {
  96. this.$message('开发中')
  97. }
  98. }
  99. }
  100. </script>
  101. <style lang="less" scoped>
  102. #addSyDialog {
  103. .table-box {
  104. height: 350px;
  105. }
  106. }
  107. </style>