|
@@ -84,15 +84,21 @@
|
|
|
<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>
|
|
|
- <!-- 清除对应关系弹窗 -->
|
|
|
- <del-relation-dialog ref="del" @refresh="refresh" :typeName="'project'"></del-relation-dialog>
|
|
|
+ <!-- 删除关系 -->
|
|
|
+ <!-- 批量创建选择弹窗 -->
|
|
|
+ <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>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import tools from "@/utils/tools";
|
|
|
import { mapGetters, mapActions } from "vuex";
|
|
|
import applyRulesDialog from "@/components/point/dynamicdata/applyRulesDialog";
|
|
|
-import delRelationDialog from "@/components/point/dynamicdata/delRelationDialog";
|
|
|
import dictionaryDevice from "@/components/point/dynamicdata/dictionaryDevice";
|
|
|
import dataSource from "@/components/point/dynamicdata/dataSource";
|
|
|
import locationFlag from "@/components/point/dynamicdata/locationFlag";
|
|
@@ -102,7 +108,10 @@ import {
|
|
|
dynamicExecute,
|
|
|
dynamicQuery,
|
|
|
dynamicQueryPoint,
|
|
|
- dynamicPointTypeList
|
|
|
+ dynamicPointTypeList,
|
|
|
+ dynamicPendingobjs,
|
|
|
+ dynamicCreateRelation,
|
|
|
+ dynamicDeleteRelation
|
|
|
} from "@/api/scan/request";
|
|
|
export default {
|
|
|
computed: {
|
|
@@ -133,11 +142,13 @@ export default {
|
|
|
}, //查询条件
|
|
|
loading: false, //列表loading
|
|
|
autoLoading: false, //自动对应实例
|
|
|
+ RtableData: {}, //当前项目实例
|
|
|
+ deleteRelationVis: false, // 删除弹窗
|
|
|
+ row: {}, // 删除时,选中的行
|
|
|
};
|
|
|
},
|
|
|
components: {
|
|
|
applyRulesDialog,
|
|
|
- delRelationDialog,
|
|
|
dictionaryDevice,
|
|
|
dataSource,
|
|
|
locationFlag
|
|
@@ -155,15 +166,40 @@ export default {
|
|
|
methods: {
|
|
|
//获取查询条件-提示信息
|
|
|
init() {
|
|
|
- this.getTableData()
|
|
|
+ this.getTableData();
|
|
|
+ this.getProjectObj();
|
|
|
},
|
|
|
//清除对应关系
|
|
|
handleDelete(index, row) {
|
|
|
- this.$refs.del.showDialog(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) {
|
|
|
- this.$message('开发中');
|
|
|
+ if (this.RtableData.ObjectID) {
|
|
|
+ let object = {
|
|
|
+ Objs: [row],
|
|
|
+ Points: [this.RtableData]
|
|
|
+ };
|
|
|
+ let param = [];
|
|
|
+ param.push(object);
|
|
|
+ dynamicCreateRelation(param, res => {
|
|
|
+ this.getTableData();
|
|
|
+ this.$message.success("关联成功");
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
//改变pagesize
|
|
|
handleSizeChange(pageSize) {
|
|
@@ -175,10 +211,18 @@ export default {
|
|
|
this.page.pageNumber = pageNo;
|
|
|
this.getTableData();
|
|
|
},
|
|
|
- //跳转至填充对应规则
|
|
|
- // toAddRelation() {
|
|
|
- // this.$router.push({ path: "spaceRela", query: { typeName: this.typeName } });
|
|
|
- // },
|
|
|
+ // 获取项目实例
|
|
|
+ getProjectObj() {
|
|
|
+ let param = {
|
|
|
+ TypeNameList: [this.typeName]
|
|
|
+ };
|
|
|
+ this.RtableData = {}
|
|
|
+ dynamicPendingobjs(param, res => {
|
|
|
+ if (res.Content && res.Content.length) {
|
|
|
+ this.RtableData = res.Content[0];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
//获取表格数据
|
|
|
getTableData() {
|
|
|
let param = {
|