功能修改

This commit is contained in:
zhangjunwen 2024-06-25 16:57:44 +08:00
parent be3f7833b3
commit 16faf09f46
4 changed files with 95 additions and 10 deletions

View File

@ -8,7 +8,7 @@
<!-- <top-nav id="topmenu-container" class="topmenu-container" v-if="true" /> --> <!-- <top-nav id="topmenu-container" class="topmenu-container" v-if="true" /> -->
<div class="left-content"> <div class="left-content">
<!-- <div class="pro-log"></div> --> <!-- <div class="pro-log"></div> -->
<div class="pro-title">扁鸿设备工控管理系统</div> <div class="pro-title">扁鸿上层平台</div>
<div class="top-title-container"> <div class="top-title-container">
<template v-for="(item, index) in topNavRouters"> <template v-for="(item, index) in topNavRouters">
<div <div

View File

@ -347,7 +347,11 @@ import {
addDrawings, addDrawings,
updateDrawings, updateDrawings,
} from "@/api/equip/drawings"; } 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 { deptTreeSelect } from "@/api/system/user";
import _ from "lodash"; import _ from "lodash";
export default { export default {
@ -582,9 +586,29 @@ export default {
const id = row.id || this.ids; const id = row.id || this.ids;
getDrawings(id).then((response) => { getDrawings(id).then((response) => {
this.form = response.data; this.form = response.data;
//
var equipId = response.data.equipId;
getInfo(equipId).then((res) => {
this.form.equipIds = this.equipDataEchoHandle(res.data);
this.open = true; this.open = true;
this.title = "修改图纸信息"; this.title = "修改图纸信息";
}); });
});
},
// Cascader
equipDataEchoHandle(row) {
//
// addressId
let ancestors = row.ancestors; // id25604
if (row.ancestors && row.ancestors != "") {
// '0,100, 25438, 25519, 25652'
// addressIdaddressId
ancestors = row.ancestors.split(",");
ancestors.shift(); //0
// ancestors = ancestors.map(Number); // stringnumber
ancestors.push(row.id); // id
}
return ancestors;
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {

View File

@ -2,7 +2,7 @@
<div> <div>
<el-form style="margin-left:3%"> <el-form style="margin-left:3%">
<el-form-item label="监测设备"> <el-form-item label="监测设备">
<el-select <!-- <el-select
v-model="equipId" v-model="equipId"
@change="getList()" @change="getList()"
> >
@ -12,7 +12,12 @@
:label="field.equipName" :label="field.equipName"
:value="field.id" :value="field.id"
/> />
</el-select> </el-select> -->
<el-cascader
v-model="equipIds"
:props="props"
placeholder="请选择设备"
/>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -44,6 +49,7 @@ import { VueOkrTree } from "@/components/VueOkrTree/index.js";
import { listInfo } from "@/api/equip/equip"; import { listInfo } from "@/api/equip/equip";
import { getFaultTreeShow } from "@/api/industrial/faultTreeConfig"; import { getFaultTreeShow } from "@/api/industrial/faultTreeConfig";
import _ from "lodash"; import _ from "lodash";
import { getInfoByParentId, getInfo } from "@/api/equip/equip";
export default { export default {
name: "faultTreeShow", name: "faultTreeShow",
components: { components: {
@ -56,12 +62,56 @@ export default {
// //
equipList: [], equipList: [],
equipId: "", equipId: "",
equipIds: [],
treeData: [], treeData: [],
expKeys: [], expKeys: [],
props: {
// lazyLoad 使
lazy: true,
// value: "id",
// label: "equipName",
// children: "children",
// // false
// emitPath: false,
//
checkStrictly: true,
// lazy true
//function(node, resolve)noderesolve()
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() { created() {
this.getEquipList(); // this.getEquipList();
// this.getMonitorPartList(); // this.getMonitorPartList();
}, },
methods: { methods: {
@ -71,9 +121,9 @@ export default {
getList() { getList() {
this.loading = true; this.loading = true;
this.expKeys = []; this.expKeys = [];
console.log("查询的equipId:", this.equipId);
getFaultTreeShow(this.equipId).then((response) => { getFaultTreeShow(this.equipId).then((response) => {
const nodes = this.handleTree(response.data, "nodeId", "parentId"); const nodes = this.handleTree(response.data, "nodeId", "parentId");
console.log("nodes:", nodes);
this.expKeys.push(nodes[0].children[0].nodeId); this.expKeys.push(nodes[0].children[0].nodeId);
this.updateParentStatusBasedOnLogic(nodes); this.updateParentStatusBasedOnLogic(nodes);
this.treeData = nodes[0].children; this.treeData = nodes[0].children;

View File

@ -1,9 +1,10 @@
<template> <template>
<div class="login"> <div class="login">
<div class="login-content"> <div class="login-content">
<div class="login-content-title"> <!-- <div class="login-content-title">
<img src="../assets/images/login/project-title.png"> <img src="../assets/images/login/project-title.png">
</div> </div> -->
<div class="pro-title">扁鸿上层平台</div>
<div class="login-content-sub-title"> <div class="login-content-sub-title">
<img src="../assets/images/login/project-sub-title.png"> <img src="../assets/images/login/project-sub-title.png">
</div> </div>
@ -206,6 +207,15 @@ export default {
<style rel="stylesheet/scss" lang="scss"> <style rel="stylesheet/scss" lang="scss">
.login { .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; height: 100vh;
width: 100vw; width: 100vw;
background-position: center center; background-position: center center;
@ -240,6 +250,7 @@ export default {
} }
} }
} }
.login-content-enter { .login-content-enter {
height: 420px; height: 420px;
background-position: center center; background-position: center center;