|
@@ -26,15 +26,16 @@
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
</el-col>
|
|
|
- <!-- <el-col :span="2">
|
|
|
+ <el-col :span="2">
|
|
|
<el-tooltip class="item" effect="dark" :content="`填充${typeName}标识与实例对应规则`" placement="left">
|
|
|
- <el-button size="small" type="primary" @click="toAddRelation" icon="el-icon-edit-outline" style="float:right;" :disabled="isPending"></el-button>
|
|
|
+ <el-button size="small" type="primary" @click="toAddRelation" icon="el-icon-edit-outline" style="float:right;" :disabled="isPending">
|
|
|
+ </el-button>
|
|
|
</el-tooltip>
|
|
|
- <el-tooltip class="item" effect="dark" :content="`根据${typeName}标识自动填充实例`" placement="left">
|
|
|
+ <!-- <el-tooltip class="item" effect="dark" :content="`根据${typeName}标识自动填充实例`" placement="left">
|
|
|
<el-button size="small" type="primary" @click="autoGroupRela" :icon="autoLoading?'iconfont icon-jiazai':'iconfont icon-zidong'"
|
|
|
style="float:right;padding:7px 14px;margin-right:10px;" :disabled="autoLoading"></el-button>
|
|
|
- </el-tooltip>
|
|
|
- </el-col> -->
|
|
|
+ </el-tooltip> -->
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
<el-row>
|
|
@@ -70,11 +71,9 @@
|
|
|
<el-table-column prop="CascadeEquipLocalName" label="所属设备实例" show-overflow-tooltip min-width="100"></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" v-if="!(isPending||scope.row.Related=='True')">
|
|
|
- <el-button size="mini" @click="handleAdd(scope.$index, scope.row)" type="primary" plain icon="el-icon-plus"></el-button>
|
|
|
- </el-tooltip>
|
|
|
- <el-tooltip class="item" effect="dark" content="清除对应规则" placement="left" v-if="!(isPending||scope.row.Related=='False')">
|
|
|
- <el-button size="mini" @click="handleDelete(scope.$index, scope.row)" type="danger" plain icon="el-icon-delete"></el-button>
|
|
|
+ <el-tooltip class="item" effect="dark" content="清除对应规则" placement="left">
|
|
|
+ <el-button size="mini" @click="handleDelete(scope.$index, scope.row)" type="danger" plain
|
|
|
+ :disabled="isPending||scope.row.Related=='False'" icon="el-icon-delete"></el-button>
|
|
|
</el-tooltip>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -84,15 +83,8 @@
|
|
|
<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-dialog title="提示" :visible.sync="deleteRelationVis" width="20%">
|
|
|
- <p>确定要清除对应关系?</p>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button size="small" @click="deleteRelationVis=false">取消</el-button>
|
|
|
- <el-button size="small" type="primary" @click="confirm">清除已选</el-button>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
+ <!-- 清除对应关系弹窗 -->
|
|
|
+ <del-relation-dialog ref="del" @refresh="refresh" :typeName="'space'"></del-relation-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -100,6 +92,7 @@ import tools from "@/utils/tools";
|
|
|
import { mapGetters, mapActions } from "vuex";
|
|
|
import applyRulesDialog from "@/components/point/dynamicdata/applyRulesDialog";
|
|
|
import dictionaryDevice from "@/components/point/dynamicdata/dictionaryDevice";
|
|
|
+import delRelationDialog from "@/components/point/dynamicdata/delRelationDialog";
|
|
|
import dataSource from "@/components/point/dynamicdata/dataSource";
|
|
|
import locationFlag from "@/components/point/dynamicdata/locationFlag";
|
|
|
import equipRules from "@/components/point/dynamicdata/equipRules";
|
|
@@ -151,7 +144,8 @@ export default {
|
|
|
applyRulesDialog,
|
|
|
dictionaryDevice,
|
|
|
dataSource,
|
|
|
- locationFlag
|
|
|
+ locationFlag,
|
|
|
+ delRelationDialog
|
|
|
},
|
|
|
props: {
|
|
|
typeName: {},
|
|
@@ -167,39 +161,10 @@ export default {
|
|
|
//获取查询条件-提示信息
|
|
|
init() {
|
|
|
this.getTableData();
|
|
|
- this.getProjectObj();
|
|
|
},
|
|
|
//清除对应关系
|
|
|
handleDelete(index, row) {
|
|
|
- this.deleteRelationVis = true;
|
|
|
- this.row = row;
|
|
|
- },
|
|
|
- // 确认清除
|
|
|
- confirm() {
|
|
|
- let pa = [{
|
|
|
- Objs: [this.row],
|
|
|
- Points: [this.row]
|
|
|
- }]
|
|
|
- dynamicDeleteRelation(pa, res => {
|
|
|
- this.deleteRelationVis = false;
|
|
|
- this.getTableData();
|
|
|
- this.$message.success('清除成功');
|
|
|
- })
|
|
|
- },
|
|
|
- //添加关系
|
|
|
- handleAdd(index, row) {
|
|
|
- if (this.RtableData.ObjectID) {
|
|
|
- let object = {
|
|
|
- Objs: [row],
|
|
|
- Points: [this.RtableData]
|
|
|
- };
|
|
|
- let param = [];
|
|
|
- param.push(object);
|
|
|
- dynamicCreateRelation(param, res => {
|
|
|
- this.getTableData();
|
|
|
- this.$message.success("关联成功");
|
|
|
- });
|
|
|
- }
|
|
|
+ this.$refs.del.showDialog(row);
|
|
|
},
|
|
|
//改变pagesize
|
|
|
handleSizeChange(pageSize) {
|
|
@@ -211,17 +176,9 @@ export default {
|
|
|
this.page.pageNumber = pageNo;
|
|
|
this.getTableData();
|
|
|
},
|
|
|
- // 获取项目实例
|
|
|
- getProjectObj() {
|
|
|
- let param = {
|
|
|
- TypeNameList: [this.typeName]
|
|
|
- };
|
|
|
- this.RtableData = {}
|
|
|
- dynamicPendingobjs(param, res => {
|
|
|
- if (res.Content && res.Content.length) {
|
|
|
- this.RtableData = res.Content[0];
|
|
|
- }
|
|
|
- });
|
|
|
+ //跳转至填充对应规则
|
|
|
+ toAddRelation() {
|
|
|
+ this.$router.push({ path: "projectRela", query: { typeName: this.typeName } });
|
|
|
},
|
|
|
//获取表格数据
|
|
|
getTableData() {
|