|
@@ -1,29 +1,52 @@
|
|
<template>
|
|
<template>
|
|
<el-dialog :title="title" :visible.sync="dialogVisible" width="900px" id="addEqDialog">
|
|
<el-dialog :title="title" :visible.sync="dialogVisible" width="900px" id="addEqDialog">
|
|
<el-row class="filters">
|
|
<el-row class="filters">
|
|
- <el-col :span="8">
|
|
|
|
- <el-input placeholder="输入设备名称或设备本地编码进行查询" v-model="keycode" clearable @keyup.enter.native="getTableData">
|
|
|
|
|
|
+ <el-col :span="7" style="width:268px">
|
|
|
|
+ <el-input
|
|
|
|
+ placeholder="输入设备名称或设备本地编码进行查询"
|
|
|
|
+ v-model="keycode"
|
|
|
|
+ clearable
|
|
|
|
+ @keyup.enter.native="getTableData"
|
|
|
|
+ >
|
|
<i slot="suffix" class="el-input__icon el-icon-search" @click="getTableData"></i>
|
|
<i slot="suffix" class="el-input__icon el-icon-search" @click="getTableData"></i>
|
|
</el-input>
|
|
</el-input>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :span="9" style="padding:0 0;">
|
|
|
|
|
|
+ <el-col :span="8.5" style="padding:0 0;">
|
|
<floor-cascader @change="changeFloor" style="margin-left:5px;"></floor-cascader>
|
|
<floor-cascader @change="changeFloor" style="margin-left:5px;"></floor-cascader>
|
|
</el-col>
|
|
</el-col>
|
|
|
|
+ <el-col :span="8.5" style="padding-right:0;">
|
|
|
|
+ <myCascader @change="changeDevice" :params="params"></myCascader>
|
|
|
|
+ </el-col>
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
<div class="table-box">
|
|
<div class="table-box">
|
|
- <el-table :data="tableData" style="width: 100%" height="350" v-loading="loading" :header-cell-style="headerStyle" ref="multipleTable"
|
|
|
|
- @selection-change="handleSelectionChange">
|
|
|
|
|
|
+ <el-table
|
|
|
|
+ :data="tableData"
|
|
|
|
+ style="width: 100%"
|
|
|
|
+ height="350"
|
|
|
|
+ v-loading="loading"
|
|
|
|
+ :header-cell-style="headerStyle"
|
|
|
|
+ ref="multipleTable"
|
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
|
+ >
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
<el-table-column :label="`${inSpaceType}名称`" show-overflow-tooltip min-width="100">
|
|
<el-table-column :label="`${inSpaceType}名称`" show-overflow-tooltip min-width="100">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <div>
|
|
|
|
- {{scope.row.EquipLocalName||scope.row.EquipName||''}}
|
|
|
|
- </div>
|
|
|
|
|
|
+ <div>{{scope.row.EquipLocalName||scope.row.EquipName||''}}</div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column prop="EquipLocalID" :label="`${inSpaceType}本地编码`" show-overflow-tooltip min-width="100"></el-table-column>
|
|
|
|
- <el-table-column prop="EquipCategory.EquipName" :label="`${inSpaceType}类`" show-overflow-tooltip min-width="100"></el-table-column>
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="EquipLocalID"
|
|
|
|
+ :label="`${inSpaceType}本地编码`"
|
|
|
|
+ show-overflow-tooltip
|
|
|
|
+ min-width="100"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="EquipCategory.EquipName"
|
|
|
|
+ :label="`${inSpaceType}类`"
|
|
|
|
+ show-overflow-tooltip
|
|
|
|
+ min-width="100"
|
|
|
|
+ ></el-table-column>
|
|
<el-table-column prop="action" label="操作" min-width="100">
|
|
<el-table-column prop="action" label="操作" min-width="100">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button size="mini" @click="toDetail(scope.$index, scope.row)" plain>查看详情</el-button>
|
|
<el-button size="mini" @click="toDetail(scope.$index, scope.row)" plain>查看详情</el-button>
|
|
@@ -31,9 +54,17 @@
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
<!-- 分页 -->
|
|
<!-- 分页 -->
|
|
- <el-pagination class="fr" v-show="tableData && tableData.length" @size-change="handleSizeChange" @current-change="handleCurrentChange"
|
|
|
|
- :current-page="page.pageNumber" :page-sizes="page.pageSizes" :page-size="page.pageSize" layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
- :total="page.total"></el-pagination>
|
|
|
|
|
|
+ <el-pagination
|
|
|
|
+ class="fr"
|
|
|
|
+ v-show="tableData && tableData.length"
|
|
|
|
+ @size-change="handleSizeChange"
|
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
|
+ :current-page="page.pageNumber"
|
|
|
|
+ :page-sizes="page.pageSizes"
|
|
|
|
+ :page-size="page.pageSize"
|
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
+ :total="page.total"
|
|
|
|
+ ></el-pagination>
|
|
</div>
|
|
</div>
|
|
<span slot="footer" class="dialog-footer">
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-button size="small" @click="dialogVisible = false">取 消</el-button>
|
|
<el-button size="small" @click="dialogVisible = false">取 消</el-button>
|
|
@@ -43,7 +74,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { sysLinkEquip, unSysEq} from "@/api/scan/request";
|
|
|
|
|
|
+import { sysLinkEquip, unSysEq } from "@/api/scan/request";
|
|
import floorCascader from "@/components/ledger/lib/floorCascader";
|
|
import floorCascader from "@/components/ledger/lib/floorCascader";
|
|
import myCascader from "@/components/ledger/system/lib/equipType";
|
|
import myCascader from "@/components/ledger/system/lib/equipType";
|
|
import { mapGetters } from "vuex";
|
|
import { mapGetters } from "vuex";
|
|
@@ -58,10 +89,10 @@ export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
title: "添加系统内设备",
|
|
title: "添加系统内设备",
|
|
- keycode: '', //输入查询条件
|
|
|
|
- Buildfloor: ['all'], // 选中的建筑楼层
|
|
|
|
- Equipcategory: null,// 选中的设备类型
|
|
|
|
- inSpaceType: '设备',
|
|
|
|
|
|
+ keycode: "", //输入查询条件
|
|
|
|
+ Buildfloor: ["all"], // 选中的建筑楼层
|
|
|
|
+ Equipcategory: null, // 选中的设备类型
|
|
|
|
+ inSpaceType: "设备",
|
|
dialogVisible: false,
|
|
dialogVisible: false,
|
|
tableData: [],
|
|
tableData: [],
|
|
loading: false,
|
|
loading: false,
|
|
@@ -73,9 +104,9 @@ export default {
|
|
total: 0
|
|
total: 0
|
|
},
|
|
},
|
|
headerStyle: {
|
|
headerStyle: {
|
|
- backgroundColor: '#e1e4e5',
|
|
|
|
- color: '#2b2b2b',
|
|
|
|
- lineHeight: '30px'
|
|
|
|
|
|
+ backgroundColor: "#e1e4e5",
|
|
|
|
+ color: "#2b2b2b",
|
|
|
|
+ lineHeight: "30px"
|
|
} // 列表样式
|
|
} // 列表样式
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -83,61 +114,62 @@ export default {
|
|
type: String, //选中的tab页
|
|
type: String, //选中的tab页
|
|
params: Object //查看的竖井关系信息
|
|
params: Object //查看的竖井关系信息
|
|
},
|
|
},
|
|
- created() { },
|
|
|
|
|
|
+ created() {},
|
|
methods: {
|
|
methods: {
|
|
//修改建筑楼层
|
|
//修改建筑楼层
|
|
changeFloor(value) {
|
|
changeFloor(value) {
|
|
- this.Buildfloor = value
|
|
|
|
- this.getTableData()
|
|
|
|
|
|
+ this.Buildfloor = value;
|
|
|
|
+ this.getTableData();
|
|
},
|
|
},
|
|
// 显示弹窗
|
|
// 显示弹窗
|
|
showDialog() {
|
|
showDialog() {
|
|
- this.dialogVisible = true
|
|
|
|
- this.page.pageNumber = 1
|
|
|
|
- this.tableData = []
|
|
|
|
- this.getTableData()
|
|
|
|
|
|
+ this.dialogVisible = true;
|
|
|
|
+ this.page.pageNumber = 1;
|
|
|
|
+ this.tableData = [];
|
|
|
|
+ this.getTableData();
|
|
},
|
|
},
|
|
getTableData() {
|
|
getTableData() {
|
|
-
|
|
|
|
let params = {
|
|
let params = {
|
|
data: {
|
|
data: {
|
|
Filters: `not EquipID isNull`,
|
|
Filters: `not EquipID isNull`,
|
|
- Cascade: [{ Name: 'equipCategory' }],
|
|
|
|
|
|
+ Cascade: [{ Name: "equipCategory" }],
|
|
Orders: "createTime desc, EquipID desc",
|
|
Orders: "createTime desc, EquipID desc",
|
|
PageNumber: this.page.pageNumber,
|
|
PageNumber: this.page.pageNumber,
|
|
- PageSize: this.page.pageSize,
|
|
|
|
|
|
+ PageSize: this.page.pageSize
|
|
},
|
|
},
|
|
shaftId: this.params.ShaftID,
|
|
shaftId: this.params.ShaftID,
|
|
- sysId:this.$route.query.SysID
|
|
|
|
- }
|
|
|
|
|
|
+ sysId: this.$route.query.SysID
|
|
|
|
+ };
|
|
if (this.Buildfloor[0] == "noKnow") {
|
|
if (this.Buildfloor[0] == "noKnow") {
|
|
- params.data.Filters += `;buildingId isNull`
|
|
|
|
|
|
+ params.data.Filters += `;buildingId isNull`;
|
|
} else if (this.Buildfloor[0] && this.Buildfloor[0] != "all") {
|
|
} else if (this.Buildfloor[0] && this.Buildfloor[0] != "all") {
|
|
- params.data.Filters += `;buildingId='${this.Buildfloor[0]}'`
|
|
|
|
|
|
+ params.data.Filters += `;buildingId='${this.Buildfloor[0]}'`;
|
|
}
|
|
}
|
|
if (this.Buildfloor[1] == "noKnow") {
|
|
if (this.Buildfloor[1] == "noKnow") {
|
|
- params.data.Filters += `;floorId isNull`
|
|
|
|
|
|
+ params.data.Filters += `;floorId isNull`;
|
|
} else if (this.Buildfloor[1] && this.Buildfloor[1] != "all") {
|
|
} else if (this.Buildfloor[1] && this.Buildfloor[1] != "all") {
|
|
- params.data.Filters += `;floorId='${this.Buildfloor[1]}'`
|
|
|
|
- }
|
|
|
|
- if (this.keycode != '') {
|
|
|
|
- params.data.Filters += `;EquipName contain '${this.keycode}' or EquipLocalName contain '${this.keycode}' or EquipLocalID contain '${this.keycode}'`
|
|
|
|
|
|
+ params.data.Filters += `;floorId='${this.Buildfloor[1]}'`;
|
|
}
|
|
}
|
|
- if (this.Equipcategory) {
|
|
|
|
- params.data.Filters += `;category='${this.Equipcategory}'`
|
|
|
|
|
|
+ if (this.keycode != "") {
|
|
|
|
+ params.data.Filters += `;EquipName contain '${this.keycode}' or EquipLocalName contain '${this.keycode}' or EquipLocalID contain '${this.keycode}'`;
|
|
}
|
|
}
|
|
|
|
+ // if (this.Equipcategory) {
|
|
|
|
+ // params.data.Filters += `;category='${this.Equipcategory}'`;
|
|
|
|
+ // }
|
|
unSysEq(params, res => {
|
|
unSysEq(params, res => {
|
|
res.Content.forEach(item => {
|
|
res.Content.forEach(item => {
|
|
- item.ShaftListName = ""
|
|
|
|
|
|
+ item.ShaftListName = "";
|
|
if (item.ShaftList && item.ShaftList.length) {
|
|
if (item.ShaftList && item.ShaftList.length) {
|
|
item.ShaftListName = item.ShaftList.map(shaft => {
|
|
item.ShaftListName = item.ShaftList.map(shaft => {
|
|
- return shaft.ShaftLocalName ? shaft.ShaftLocalName : shaft.ShaftName
|
|
|
|
- }).join("、")
|
|
|
|
|
|
+ return shaft.ShaftLocalName
|
|
|
|
+ ? shaft.ShaftLocalName
|
|
|
|
+ : shaft.ShaftName;
|
|
|
|
+ }).join("、");
|
|
}
|
|
}
|
|
- })
|
|
|
|
- this.tableData = res.Content
|
|
|
|
- this.page.total = res.Total
|
|
|
|
- })
|
|
|
|
|
|
+ });
|
|
|
|
+ this.tableData = res.Content;
|
|
|
|
+ this.page.total = res.Total;
|
|
|
|
+ });
|
|
},
|
|
},
|
|
//选中项修改
|
|
//选中项修改
|
|
handleSelectionChange(val) {
|
|
handleSelectionChange(val) {
|
|
@@ -148,18 +180,23 @@ export default {
|
|
let params = {
|
|
let params = {
|
|
SysId: this.$route.query.SysID,
|
|
SysId: this.$route.query.SysID,
|
|
EquipIdList: this.selections.map(item => {
|
|
EquipIdList: this.selections.map(item => {
|
|
- return item.EquipID
|
|
|
|
|
|
+ return item.EquipID;
|
|
})
|
|
})
|
|
- }
|
|
|
|
|
|
+ };
|
|
sysLinkEquip(params, res => {
|
|
sysLinkEquip(params, res => {
|
|
- this.dialogVisible = false
|
|
|
|
- this.$message.success('关联成功!')
|
|
|
|
- this.$emit('refresh')
|
|
|
|
- })
|
|
|
|
|
|
+ this.dialogVisible = false;
|
|
|
|
+ this.$message.success("关联成功!");
|
|
|
|
+ this.$emit("refresh");
|
|
|
|
+ });
|
|
} else {
|
|
} else {
|
|
- this.$message('请选择要关联的设备')
|
|
|
|
|
|
+ this.$message("请选择要关联的设备");
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ //修改设备类别
|
|
|
|
+ changeDevice(value) {
|
|
|
|
+ this.Equipcategory = value.code;
|
|
|
|
+ this.getTableData();
|
|
|
|
+ },
|
|
//改变pagesize
|
|
//改变pagesize
|
|
handleSizeChange(pageSize) {
|
|
handleSizeChange(pageSize) {
|
|
this.page.pageSize = pageSize;
|
|
this.page.pageSize = pageSize;
|
|
@@ -172,9 +209,9 @@ export default {
|
|
},
|
|
},
|
|
// 查看详情
|
|
// 查看详情
|
|
toDetail() {
|
|
toDetail() {
|
|
- this.$message('开发中')
|
|
|
|
|
|
+ this.$message("开发中");
|
|
}
|
|
}
|
|
- },
|
|
|
|
|
|
+ }
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|