unRelateBSP.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <el-dialog :title="title" :visible.sync="dialogVisible" width="600px" id="lookUnrelatBSpace">
  3. <el-input :placeholder="`请输入业务空间名称`" v-model="queryString" @keyup.enter.native="queryTableData">
  4. <i slot="suffix" class="el-input__icon el-icon-search" @click="queryTableData"></i>
  5. </el-input>
  6. <div style="margin-top:10px;height:300px;">
  7. <el-table :data="data" style="width: 100%" height="100%" v-loading="loading" :header-cell-style="headerStyle">
  8. <el-table-column prop="RoomLocalName" label="业务空间名称" show-overflow-tooltip min-width="200"></el-table-column>
  9. <el-table-column prop="action" label="操作" min-width="100" v-if="isAction">
  10. <template slot-scope="scope">
  11. <el-button @click="createRelation(scope.row)">关联平面图</el-button>
  12. </template>
  13. </el-table-column>
  14. </el-table>
  15. </div>
  16. </el-dialog>
  17. </template>
  18. <script>
  19. export default {
  20. name: "unRelateBSP",
  21. data() {
  22. return {
  23. title: '未关联平面图的业务空间',
  24. dialogVisible: false,
  25. loading: false,
  26. headerStyle: {
  27. backgroundColor: '#e1e4e5',
  28. color: '#2b2b2b',
  29. lineHeight: '30px'
  30. },
  31. queryString: '',
  32. data: []
  33. };
  34. },
  35. props: {
  36. tableData: {
  37. default: []
  38. }, //列表数据
  39. isAction: false, //是否显示操作按钮
  40. },
  41. methods: {
  42. // 显示弹窗
  43. showDialog() {
  44. this.data = this.tableData;
  45. this.dialogVisible = true;
  46. },
  47. // 搜索
  48. queryTableData() {
  49. var restaurants = this.tableData;
  50. this.data = this.queryString ?
  51. restaurants.filter(this.createFilter(this.queryString)) :
  52. restaurants;
  53. },
  54. createFilter(queryString) {
  55. return restaurant => {
  56. return restaurant.RoomLocalName.indexOf(queryString) > -1;
  57. };
  58. },
  59. // 关联平面图
  60. createRelation(row) {
  61. this.$emit('createFromUnrelated', row);
  62. this.dialogVisible = false;
  63. }
  64. },
  65. };
  66. </script>