功能修改
This commit is contained in:
parent
be3f7833b3
commit
16faf09f46
@ -8,7 +8,7 @@
|
||||
<!-- <top-nav id="topmenu-container" class="topmenu-container" v-if="true" /> -->
|
||||
<div class="left-content">
|
||||
<!-- <div class="pro-log"></div> -->
|
||||
<div class="pro-title">扁鸿设备工控管理系统</div>
|
||||
<div class="pro-title">扁鸿上层平台</div>
|
||||
<div class="top-title-container">
|
||||
<template v-for="(item, index) in topNavRouters">
|
||||
<div
|
||||
|
@ -347,7 +347,11 @@ import {
|
||||
addDrawings,
|
||||
updateDrawings,
|
||||
} from "@/api/equip/drawings";
|
||||
import { getInfoByParentId, getEquipTreeByDept } from "@/api/equip/equip";
|
||||
import {
|
||||
getInfoByParentId,
|
||||
getEquipTreeByDept,
|
||||
getInfo,
|
||||
} from "@/api/equip/equip";
|
||||
import { deptTreeSelect } from "@/api/system/user";
|
||||
import _ from "lodash";
|
||||
export default {
|
||||
@ -582,9 +586,29 @@ export default {
|
||||
const id = row.id || this.ids;
|
||||
getDrawings(id).then((response) => {
|
||||
this.form = response.data;
|
||||
//回显设备
|
||||
var equipId = response.data.equipId;
|
||||
getInfo(equipId).then((res) => {
|
||||
this.form.equipIds = this.equipDataEchoHandle(res.data);
|
||||
this.open = true;
|
||||
this.title = "修改图纸信息";
|
||||
});
|
||||
});
|
||||
},
|
||||
// Cascader 级联选择器 懒加载 数据回显
|
||||
equipDataEchoHandle(row) {
|
||||
//
|
||||
// 获取到当前的addressId
|
||||
let ancestors = row.ancestors; // 当前的id,比如:25604
|
||||
if (row.ancestors && row.ancestors != "") {
|
||||
// 格式:'0,100, 25438, 25519, 25652'
|
||||
// 对数据进行回显(获取所有父级的addressId,加上当前的addressId,组成的数组。)
|
||||
ancestors = row.ancestors.split(",");
|
||||
ancestors.shift(); //去掉0
|
||||
// ancestors = ancestors.map(Number); // 数组的每个元素由string转为number类型
|
||||
ancestors.push(row.id); // 将当前的id加入
|
||||
}
|
||||
return ancestors;
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
|
@ -2,7 +2,7 @@
|
||||
<div>
|
||||
<el-form style="margin-left:3%">
|
||||
<el-form-item label="监测设备">
|
||||
<el-select
|
||||
<!-- <el-select
|
||||
v-model="equipId"
|
||||
@change="getList()"
|
||||
>
|
||||
@ -12,7 +12,12 @@
|
||||
:label="field.equipName"
|
||||
:value="field.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-select> -->
|
||||
<el-cascader
|
||||
v-model="equipIds"
|
||||
:props="props"
|
||||
placeholder="请选择设备"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
@ -44,6 +49,7 @@ import { VueOkrTree } from "@/components/VueOkrTree/index.js";
|
||||
import { listInfo } from "@/api/equip/equip";
|
||||
import { getFaultTreeShow } from "@/api/industrial/faultTreeConfig";
|
||||
import _ from "lodash";
|
||||
import { getInfoByParentId, getInfo } from "@/api/equip/equip";
|
||||
export default {
|
||||
name: "faultTreeShow",
|
||||
components: {
|
||||
@ -56,12 +62,56 @@ export default {
|
||||
// 监测部位
|
||||
equipList: [],
|
||||
equipId: "",
|
||||
equipIds: [],
|
||||
treeData: [],
|
||||
expKeys: [],
|
||||
props: {
|
||||
//是否动态加载子节点,需与 lazyLoad 方法结合使用
|
||||
lazy: true,
|
||||
// value: "id",
|
||||
// label: "equipName",
|
||||
// children: "children",
|
||||
// //在选中节点改变时,是否返回由该节点所在的各级菜单的值所组成的数组,若设置 false,则只返回该节点的值
|
||||
// emitPath: false,
|
||||
//是否严格的遵守父子节点不互相关联
|
||||
checkStrictly: true,
|
||||
//加载动态数据的方法,仅在 lazy 为 true 时有效
|
||||
//function(node, resolve),node为当前点击的节点,resolve为数据加载完成的回调(必须调用)
|
||||
lazyLoad(node, resolve) {
|
||||
const queryParams = {};
|
||||
const data = [];
|
||||
if (node.value != null) {
|
||||
queryParams.parentEquipId = node.value;
|
||||
} else {
|
||||
queryParams.parentEquipId = "0";
|
||||
}
|
||||
|
||||
//根据parentId 查询下级的数据
|
||||
getInfoByParentId(queryParams).then((res) => {
|
||||
// this.getList();
|
||||
res.data.forEach((item) => {
|
||||
data.push({
|
||||
id: item.id,
|
||||
label: item.equipName,
|
||||
value: item.id,
|
||||
leaf: item.leaf,
|
||||
});
|
||||
});
|
||||
resolve(data);
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
// 根据名称筛选部门树
|
||||
equipIds(val) {
|
||||
this.equipId = _.last(this.equipIds);
|
||||
this.getList();
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getEquipList();
|
||||
// this.getEquipList();
|
||||
// this.getMonitorPartList();
|
||||
},
|
||||
methods: {
|
||||
@ -71,9 +121,9 @@ export default {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.expKeys = [];
|
||||
console.log("查询的equipId:", this.equipId);
|
||||
getFaultTreeShow(this.equipId).then((response) => {
|
||||
const nodes = this.handleTree(response.data, "nodeId", "parentId");
|
||||
console.log("nodes:", nodes);
|
||||
this.expKeys.push(nodes[0].children[0].nodeId);
|
||||
this.updateParentStatusBasedOnLogic(nodes);
|
||||
this.treeData = nodes[0].children;
|
||||
|
@ -1,9 +1,10 @@
|
||||
<template>
|
||||
<div class="login">
|
||||
<div class="login-content">
|
||||
<div class="login-content-title">
|
||||
<!-- <div class="login-content-title">
|
||||
<img src="../assets/images/login/project-title.png">
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="pro-title">扁鸿上层平台</div>
|
||||
<div class="login-content-sub-title">
|
||||
<img src="../assets/images/login/project-sub-title.png">
|
||||
</div>
|
||||
@ -206,6 +207,15 @@ export default {
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss">
|
||||
.login {
|
||||
.pro-title {
|
||||
font-size: 25px;
|
||||
font-weight: 800;
|
||||
letter-spacing: 10px;
|
||||
transform: skew(-10deg);
|
||||
color: lightblue;
|
||||
text-align: center;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
background-position: center center;
|
||||
@ -240,6 +250,7 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.login-content-enter {
|
||||
height: 420px;
|
||||
background-position: center center;
|
||||
|
Loading…
Reference in New Issue
Block a user