123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <template>
- <el-dialog :title="title" :visible.sync="dialogVisible" width="900px" id="lookUnrelatBSpace">
- <el-input :placeholder="`请输入业务空间名称`" v-model="queryString" @keyup.enter.native="queryTableData">
- <i slot="suffix" class="el-input__icon el-icon-search" @click="queryTableData"></i>
- </el-input>
- <div style="margin-top:10px;height:300px;">
- <el-table :data="data" style="width: 100%" height="100%" v-loading="loading" :header-cell-style="headerStyle">
- <el-table-column prop="RoomLocalName" label="业务空间名称" show-overflow-tooltip min-width="200"></el-table-column>
- <el-table-column prop="BuildingName" label="所属建筑" show-overflow-tooltip min-width="100"></el-table-column>
- <el-table-column prop="FloorName" label="所属楼层" show-overflow-tooltip min-width="100"></el-table-column>
- <el-table-column prop="action" label="操作" min-width="100" v-if="isAction">
- <template slot-scope="scope">
- <el-button @click="createRelation(scope.row)">关联平面图</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </el-dialog>
- </template>
- <script>
- export default {
- name: "unRelateBSP",
- data() {
- return {
- title: '未关联平面图的业务空间',
- dialogVisible: false,
- loading: false,
- headerStyle: {
- backgroundColor: '#e1e4e5',
- color: '#2b2b2b',
- lineHeight: '30px'
- },
- queryString: '',
- data: []
- };
- },
- props: {
- tableData: {
- default: []
- }, //列表数据
- isAction: false, //是否显示操作按钮
- },
- methods: {
- // 显示弹窗
- showDialog() {
- this.data = this.tableData;
- this.dialogVisible = true;
- },
- // 搜索
- queryTableData() {
- var restaurants = this.tableData;
- this.data = this.queryString ?
- restaurants.filter(this.createFilter(this.queryString)) :
- restaurants;
- },
- createFilter(queryString) {
- return restaurant => {
- return restaurant.RoomLocalName.indexOf(queryString) > -1;
- };
- },
- // 关联平面图
- createRelation(row) {
- this.$emit('createFromUnrelated', row);
- this.dialogVisible = false;
- }
- },
- };
- </script>
|