123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156 |
- <template>
- <div id="eqInSp">
- <el-row>
- <el-button type="primary" @click="add">添加{{inSpaceType}}</el-button>
- <el-tooltip class="item" effect="dark" content="可前往“全部关系总览”中,按系统内包含的设备与竖井关系计算" placement="right">
- <el-button>按系统内设备与竖井关系计算</el-button>
- </el-tooltip>
- </el-row>
- <div class="table-box">
- <el-table :data="tableData" style="width: 100%" height="100%" v-loading="loading" :header-cell-style="headerStyle">
- <el-table-column :label="`${inSpaceType}名称`" show-overflow-tooltip min-width="100">
- <template slot-scope="scope">
- <div>
- {{scope.row.ShaftLocalName||scope.row.ShaftName||''}}
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="ShaftLocalID" :label="`${inSpaceType}本地编码`" show-overflow-tooltip min-width="100"></el-table-column>
- <el-table-column :label="`${inSpaceType}类型`" show-overflow-tooltip min-width="100">
- <template slot-scope="scope">
- <div>
- {{scope.row.StructureInfo.ShaftFuncType}}
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="action" label="操作" min-width="100">
- <template slot-scope="scope">
- <el-tooltip class="item" effect="dark" content="删除关系" placement="left">
- <el-button size="mini" @click="handleDelete(scope.$index, scope.row)" type="danger" plain icon="el-icon-delete"></el-button>
- </el-tooltip>
- </template>
- </el-table-column>
- <template slot="empty">
- <div style="height: 60%;transform: translateY(50%);">
- <i class="icon-wushuju iconfont"></i>
- 可前往“全部关系总览”中计算连通的其它竖井
- </div>
- </template>
- </el-table>
- </div>
- <!-- 添加设备弹窗 -->
- <addCenoteDialog ref="addCenoteDialog" @refresh="getTableData" :type="type" :params="params"></addCenoteDialog>
- </div>
- </template>
- <script>
- import { queryLinkSys, queryShaftType, syinshUnlink } from "@/api/scan/request";
- import { mapGetters } from "vuex";
- import addCenoteDialog from "@/components/ledger/system/dialog/addCenoteDialog"
- export default {
- components: {
- addCenoteDialog
- },
- computed: {
- ...mapGetters("layout", ["projectId"])
- },
- data() {
- return {
- inSpaceType: '竖井',
- headerStyle: {
- backgroundColor: '#e1e4e5',
- color: '#2b2b2b',
- lineHeight: '30px'
- }, // 列表样式
- loading: false, // loading
- tableData: [], //列表数据
- shaftType: {} //竖井类型
- };
- },
- props: {
- params: Object,
- type: String
- },
- created() {
- queryShaftType(res => {
- res.Content.forEach(item => {
- this.shaftType[item.Code] = item.Name
- })
- this.getTableData()
- })
- },
- methods: {
- // 获取列表数据
- getTableData() {
- let params = {
- Filters: `SysID='${this.params.SysID}'`,
- Cascade: [
- {
- Name: 'shaftList',
- }
- ]
- }
- queryLinkSys(params, res => {
- this.tableData = res.Content[0].Shaft || []
- this.tableData.forEach(item => {
- if (item.StructureInfo && item.StructureInfo.ShaftFuncType) {
- item.StructureInfo.ShaftFuncType = this.shaftType[item.StructureInfo.ShaftFuncType]
- }
- })
- })
- },
- // 删除关系
- handleDelete(index, row) {
- let sysId = this.$route.query.SysID
- this.$confirm("确认删除该关系?", "提示", {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- let params = {
- ShaftId: row.ShaftID,
- SysId: sysId
- }
- this.deleteShThroughSh(params);
- }).catch(() => {
- this.$message("取消删除")
- })
- },
- // 删除设备所在空间关系
- deleteShThroughSh(params) {
- syinshUnlink(params, res => {
- this.$message.success('删除成功')
- this.getTableData()
- })
- },
- // 改变pagesize
- handleSizeChange(pageSize) {
- this.page.pageSize = pageSize;
- this.getTableData();
- },
- // 改变pageno
- handleCurrentChange(pageNo) {
- this.page.pageNumber = pageNo;
- this.getTableData();
- },
- // 添加设备
- add() {
- this.$refs.addCenoteDialog.showDialog()
- }
- },
- watch: {
- type() {
- // this.getTableData()
- }
- }
- };
- </script>
- <style lang="less" scoped>
- #eqInSp {
- height: 100%;
- .table-box {
- margin-top: 10px;
- height: calc(100% - 50px);
- }
- }
- </style>
|