From 769ba15e9071b01cb53a65e8fdf4c8f37ac005b9 Mon Sep 17 00:00:00 2001
From: xyc <jc_xiong@hotmail.com>
Date: 星期四, 07 十一月 2024 17:15:30 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java | 33 +++++---
web/src/views/modules/basicInfo/XhProductModel.vue | 5 -
web/src/views/modules/taskReliability/ModelView.vue | 72 +++++++++--------
modules/mainPart/src/main/resources/mapper/baseReliability/ParamDataBasicDao.xml | 27 ++++++
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java | 2
web/src/views/modules/basicInfo/XhProductModel-AddOrUpdate.vue | 4
modules/mainPart/src/main/resources/mapper/basicInfo/XhProductModelDao.xml | 1
web/src/views/modules/baseReliability/ParamDataBasic.vue | 14 +-
web/src/views/modules/taskReliability/OperatCondit.vue | 32 ++++++-
web/src/views/modules/taskReliability/OperatConditModel.vue | 18 ++--
10 files changed, 131 insertions(+), 77 deletions(-)
diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java
index 7f07865..07f6d0b 100644
--- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java
@@ -171,7 +171,7 @@
paramDataService.insert(data);
}
-
+ xhProductModel.setNamePath(xhProductModel.getNamePath() + "," + xhProductModel.getName());
xhProductModelService.insert(xhProductModel);
Map<Long, XhProductModel> imgMap = new HashMap<>();
imgMap = (Map<Long, XhProductModel>) CacheUtils.get("sysImgCache", "sysImgCache");
diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java
index 75a409d..946c469 100644
--- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java
@@ -451,23 +451,37 @@
Workbook workbook = new XSSFWorkbook(inputStream);
// 鑾峰彇绗竴涓伐浣滆〃
Sheet sheet = workbook.getSheetAt(0);
+ List.sort((o1, o2) -> {
+ String[] parentList1 = o1.getNamePath().split(",");
+ String[] parentList2 = o2.getNamePath().split(",");
+ String xt1 = parentList1.length > 0 ? parentList1[0] : "";
+ String xt2 = parentList2.length > 0 ? parentList2[0] : "";
+
+ // 棣栧厛姣旇緝xt鍊�
+ int xtCompare = xt1.compareTo(xt2);
+ if (xtCompare != 0) {
+ return xtCompare;
+ }
+
+ // 濡傛灉xt鐩稿悓锛屾瘮杈僷arentList鐨勯暱搴︼紝纭繚parentList.length = 2鐨勬暟鎹帓鍦ㄥ墠闈�
+ return Integer.compare(parentList1.length, parentList2.length);
+ });
int num = 0;
String xt = "";
String fxt = "";
String sb = "";
for (int i = 0; i < List.size(); i++) {
- if (List.get(i).getProductType() == 5) {
num = num + 1;
String[] parentList = List.get(i).getNamePath().split(",");
Row row = sheet.createRow(sheet.getLastRowNum() + 1); // 鍒涘缓鏂拌
Cell cell = row.createCell(0);
cell.setCellValue(num);
+ if (!xt.equals(parentList[0])) {
+ xt = parentList[0];
+ cell = row.createCell(1);
+ cell.setCellValue(xt);
+ }
if (parentList.length > 2) {
- if (!xt.equals(parentList[0])) {
- xt = parentList[0];
- cell = row.createCell(1);
- cell.setCellValue(xt);
- }
if (!fxt.equals(parentList[1])) {
fxt = parentList[1];
cell = row.createCell(2);
@@ -479,12 +493,6 @@
cell.setCellValue(sb);
}
} else {
- if (!xt.equals(parentList[0])) {
- xt = parentList[0];
- cell = row.createCell(1);
- cell.setCellValue(xt);
- }
-
if (!sb.equals(parentList[1])) {
sb = parentList[1];
cell = row.createCell(3);
@@ -563,7 +571,6 @@
cell.setCellValue(List.get(i).getRepairMttcrOtherParams3());
}
}
- }
response.setContentType("application/octet-stream;charset=UTF-8");
String encodedFilename = DownloadService.getNameEncoder(request, name + "_浜у搧缁撴瀯鏍�.xlsx");
response.addHeader("Content-Disposition", "attachment;filename=" + encodedFilename);
diff --git a/modules/mainPart/src/main/resources/mapper/baseReliability/ParamDataBasicDao.xml b/modules/mainPart/src/main/resources/mapper/baseReliability/ParamDataBasicDao.xml
index 12b4d14..07807e5 100644
--- a/modules/mainPart/src/main/resources/mapper/baseReliability/ParamDataBasicDao.xml
+++ b/modules/mainPart/src/main/resources/mapper/baseReliability/ParamDataBasicDao.xml
@@ -113,6 +113,33 @@
where b.ship_id = ${shipId}
and a.product_id = b.id
and a.basic_join_compute = 1
+ and b.product_type = 5
+ group by b.pid
+ ) b
+ set a.basic_join_compute = b.basic_join_compute
+ where a.product_id = b.pid;
+
+ UPDATE param_data a,(
+ select pid, case when count(1) > 0 then 1 else 0 end as basic_join_compute
+ from param_data a,
+ product_model b
+ where b.ship_id = ${shipId}
+ and a.product_id = b.id
+ and a.basic_join_compute = 1
+ and b.product_type = 4
+ group by b.pid
+ ) b
+ set a.basic_join_compute = b.basic_join_compute
+ where a.product_id = b.pid;
+
+ UPDATE param_data a,(
+ select pid, case when count(1) > 0 then 1 else 0 end as basic_join_compute
+ from param_data a,
+ product_model b
+ where b.ship_id = ${shipId}
+ and a.product_id = b.id
+ and a.basic_join_compute = 1
+ and b.product_type = 3
group by b.pid
) b
set a.basic_join_compute = b.basic_join_compute
diff --git a/modules/mainPart/src/main/resources/mapper/basicInfo/XhProductModelDao.xml b/modules/mainPart/src/main/resources/mapper/basicInfo/XhProductModelDao.xml
index 5e22afc..19a32ca 100644
--- a/modules/mainPart/src/main/resources/mapper/basicInfo/XhProductModelDao.xml
+++ b/modules/mainPart/src/main/resources/mapper/basicInfo/XhProductModelDao.xml
@@ -191,6 +191,7 @@
and a.ship_id = ${shipId}
AND a.id <> a.ship_id
and a.id = b.product_id
+ and a.product_type = 5
</select>
<select id="getProductListByShip" resultType="com.zt.life.modules.mainPart.basicInfo.model.XhProductModel">
select a.*, b.basic_unit_num as sameSbNum
diff --git a/web/src/views/modules/baseReliability/ParamDataBasic.vue b/web/src/views/modules/baseReliability/ParamDataBasic.vue
index 5b497be..3039eac 100644
--- a/web/src/views/modules/baseReliability/ParamDataBasic.vue
+++ b/web/src/views/modules/baseReliability/ParamDataBasic.vue
@@ -29,33 +29,33 @@
border @selection-change="table.selectionChangeHandle">
<!--<el-table-column type="selection" width="40"/>-->
<el-table-column prop="name" label="鍚嶇О"/>
- <el-table-column prop="basicUnitNum" label="鍗曞厓鏁伴噺"/>
- <el-table-column prop="basicMtbfRegulate" label="MTBF" align="right">
+ <el-table-column prop="basicUnitNum" label="鍗曞厓鏁伴噺" align="center" width="100"/>
+ <el-table-column prop="basicMtbfRegulate" label="MTBF" align="right" width="120">
<template slot-scope="scope">
<span>{{ keepNumber(scope.row.basicMtbfRegulate) }}</span>
</template>
</el-table-column>
- <el-table-column prop="repairMttcr" label="MTTR" align="right">
+ <el-table-column prop="repairMttcr" label="MTTR" align="right" width="120">
<template slot-scope="scope">
<span>{{ keepNumber(scope.row.repairMttcr) }}</span>
</template>
</el-table-column>
- <el-table-column prop="basicMtbfRegulSuccRate" label="鎴愬姛鐜�" align="right">
+ <el-table-column prop="basicMtbfRegulSuccRate" label="鎴愬姛鐜�" align="right" width="100">
<template slot-scope="scope">
<span>{{keepNumber(scope.row.basicMtbfRegulSuccRate) }}</span>
</template>
</el-table-column>
- <el-table-column prop="basicRunsNum" label="杩愯娆℃暟" align="right">
+ <el-table-column prop="basicRunsNum" label="杩愯娆℃暟" align="right" width="100">
<template slot-scope="scope">
<span>{{scope.row.basicRunsNum}}</span>
</template>
</el-table-column>
- <el-table-column prop="basicMtbfOperatingRatio" label="杩愯姣�" align="right">
+ <el-table-column prop="basicMtbfOperatingRatio" label="杩愯姣�" align="right" width="100">
<template slot-scope="scope">
<span>{{keepNumber(scope.row.basicMtbfOperatingRatio) }}</span>
</template>
</el-table-column>
- <el-table-column prop="ai" label="鍙敤搴�" align="right">
+ <el-table-column prop="ai" label="鍙敤搴�" align="right" width="100">
<template slot-scope="scope">
<span>{{keepNumber(scope.row.ai)}}</span>
</template>
diff --git a/web/src/views/modules/basicInfo/XhProductModel-AddOrUpdate.vue b/web/src/views/modules/basicInfo/XhProductModel-AddOrUpdate.vue
index b78c5c2..1f678d3 100644
--- a/web/src/views/modules/basicInfo/XhProductModel-AddOrUpdate.vue
+++ b/web/src/views/modules/basicInfo/XhProductModel-AddOrUpdate.vue
@@ -49,6 +49,7 @@
operatImgName: '',
sort: '',
equipType: '',
+ namePath:'',
status: ''
}
}
@@ -73,9 +74,8 @@
this.getDefaultImg(this.dataForm.productType)
} else {
this.dataForm.pid = params.pid
- console.log(params.productType,'type')
- console.log(parseInt(params.productType),'parseInttype')
this.dataForm.productType = parseInt(params.productType)
+ this.dataForm.namePath= params.namePath
this.getDefaultImg(this.dataForm.productType)
}
if (this.dataForm.productType === '10' && id == null) {
diff --git a/web/src/views/modules/basicInfo/XhProductModel.vue b/web/src/views/modules/basicInfo/XhProductModel.vue
index 7aa5a65..5683acf 100644
--- a/web/src/views/modules/basicInfo/XhProductModel.vue
+++ b/web/src/views/modules/basicInfo/XhProductModel.vue
@@ -107,7 +107,7 @@
shipId: this.shipId,
namePath: this.namePath
})*/
- this.$refs.AddOrUpdate.$refs.dialog.init(null, {id: null, productType: parseInt(this.dataForm.type)+1 , pid: this.dataForm.pid,shipId: this.shipId})
+ this.$refs.AddOrUpdate.$refs.dialog.init(null, {id: null, productType: parseInt(this.dataForm.type)+1 , pid: this.dataForm.pid,shipId: this.shipId,namePath: this.namePath})
} else {
this.$refs.AddOrUpdate.$refs.dialog.init(null, {id: null, type: 'zt', pid: this.dataForm.pid,shipId: this.shipId})
}
@@ -157,9 +157,6 @@
})
let apiURL = `/basicInfo/XhProductModel/exportData`
window.location.href = `${window.SITE_CONFIG['apiURL']}${apiURL}?${params}`
-
-
-
},
exportProduct() {
window.location.href = './浜у搧缁撴瀯鏍戝鍏ユā鏉�.xlsx'
diff --git a/web/src/views/modules/taskReliability/ModelView.vue b/web/src/views/modules/taskReliability/ModelView.vue
index 08fab2a..c52f956 100644
--- a/web/src/views/modules/taskReliability/ModelView.vue
+++ b/web/src/views/modules/taskReliability/ModelView.vue
@@ -1,13 +1,16 @@
<template>
<div>
- <div class="fa-card-a">
-
- <div id="containerImg" style="border: 1px solid #EAEBEE;border-radius: 6px;
- box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);height: 100%">
+ <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()">
+ <el-form-item :label="modelName"></el-form-item>
+ <el-form-item style="float: right">
+ <el-button type="danger" @click="closeDigram()">鍏抽棴</el-button>
+ </el-form-item>
+ </el-form>
+ <div style="border: 1px solid #EAEBEE;border-radius: 6px;box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);height: calc(100vh - 233px);">
+ <div id="containerImg"></div>
</div>
<config-node ref="configNode" v-show="type === 'node'"/>
<config-edge ref="configEdge" v-show="type === 'edge'"/>
- </div>
</div>
</template>
@@ -668,17 +671,22 @@
this.projectId = this.$route.params.projectId
console.log(this.$route.params.projectId, 'this.$route.params.projectId')
console.log(this.$route.params.diagramId, 'this.$route.params.diagramId')
- }
+ },
},
mounted() {
this.type = 'grid'
},
methods: {
init(row) {
- this.modelName = row.modelName
+ this.modelName = row.title
this.dataForm.id = row.id
+ this.collapseTransition = row.collapseTransition
this.initDigram()
console.log(this.dataForm, 'init(row){')
+ },
+ closeDigram(){
+ this.collapseTransition = 16
+ this.$emit('closeWindow',this.collapseTransition)
},
async getDiagram(modelId) {
this.isFirstLoad = true;
@@ -697,7 +705,8 @@
this.isFirstLoad = false;
console.log(this.diagramJson.cells.length, 'this.diagramJson.cells.length')
- this.graph.positionContent('left')
+ // this.graph.positionContent('left')
+ this.graph.positionContent('left',{ padding: { left: 0 }})
// this.graph.centerContent()
// this.graph.zoomToFit()
} else {
@@ -719,7 +728,7 @@
this.graph = new Graph({
container: document.getElementById('containerImg'),
width: document.documentElement.clientWidth,
- height: document.documentElement.clientHeight - 200,
+ height: document.documentElement.clientHeight - 240,
// async: true,
grid: {
visible: true,
@@ -734,23 +743,16 @@
}
},
},
- scroller: {
- enabled: true,
- pageVisible: true,
- autoResize: true,
- pageBreak: true,
- pannable: true,
- minVisibleWidth: 200,
- minVisibleHeight: 200,
- modifiers: 'shift',
- },
- mousewheel: {
- enabled: true,
- zoomAtMousePosition: true,
- modifiers: 'ctrl',
- minScale: 0.5,
- maxScale: 3,
- },
+ // scroller: {
+ // enabled: true,
+ // pageVisible: true,
+ // autoResize: true,
+ // pageBreak: true,
+ // pannable: true,
+ // minVisibleWidth: 200,
+ // minVisibleHeight: 200,
+ // modifiers: 'shift',
+ // },
connecting: {
router: {
name: 'manhattan',
@@ -822,12 +824,12 @@
},
resizing: true,
rotating: true,
- selecting: {
- enabled: true,
- rubberband: true,
- rubberEdge: true,
- showNodeSelectionBox: true,
- },
+ // selecting: {
+ // enabled: true,
+ // rubberband: true,
+ // rubberEdge: true,
+ // showNodeSelectionBox: true,
+ // },
snapline: true,
keyboard: true,
clipboard: true,
@@ -1451,8 +1453,8 @@
leftTopY = centerY
let dragNodeType = dragNode.getData().nodeType
if (dragNodeType === 'node') {
- width = 60
- height = 60
+ width = 100
+ height = 70
} else if (dragNodeType === 'dashedBox') {
width = 60
height = 40
@@ -1461,7 +1463,7 @@
height = 175
} else {
width = 270
- height = 60
+ height = 70
}
leftTopX = centerX - width / 2
leftTopY = centerY - height / 2
diff --git a/web/src/views/modules/taskReliability/OperatCondit.vue b/web/src/views/modules/taskReliability/OperatCondit.vue
index f968740..e30ce91 100644
--- a/web/src/views/modules/taskReliability/OperatCondit.vue
+++ b/web/src/views/modules/taskReliability/OperatCondit.vue
@@ -1,7 +1,7 @@
<template>
<div>
- <el-row :gutter="16">
- <el-col :span="14">
+ <el-row>
+ <el-col :span="collapseTransition">
<div class="mod-taskReliability-operatCondit}">
<div class="fa-card-a">
<div style="margin-top: 10px">
@@ -20,7 +20,7 @@
</el-form>
<el-table v-loading="table.dataLoading" :data="table.dataList" height="100px"
:row-class-name="tableRowClassName"
- v-adaptive="{bottomOffset:70}"
+ v-adaptive="{bottomOffset:30}"
border @row-click="selectOperatCondit" @selection-change="table.selectionChangeHandle">
<el-table-column type="selection" width="40" align="center"/>
<el-table-column prop="name" label="宸ュ喌鍚嶇О"/>
@@ -35,22 +35,30 @@
</div>
</div>
</el-col>
- <el-col :span="10">
+ <el-col :span="8">
<div class="fa-card-a">
- <opera-condit-model ref="model"/>
+ <opera-condit-model ref="model" @collapseTransitionChange="collapseTransitionChange"/>
</div>
</el-col>
+ <el-col :span="16 - collapseTransition">
+ <div class="fa-card-a">
+ <model-view ref="modelView" @closeWindow="closeWindow"></model-view>
+ </div>
+ </el-col>
+
</el-row>
</div>
</template>
<script>
import AddOrUpdate from './OperatCondit-AddOrUpdate'
+ import ModelView from "./ModelView";
import OperaConditModel from "./OperatConditModel";
export default {
data() {
return {
+ collapseTransition:16,
productList: [],
dataForm: {
productId: '',
@@ -64,7 +72,8 @@
},
components: {
OperaConditModel,
- AddOrUpdate
+ AddOrUpdate,
+ ModelView
},
methods: {
add() {
@@ -99,6 +108,17 @@
} else {
return 'not-select-row';
}
+ },
+ collapseTransitionChange(param){
+ console.log(param,'collapseTransition')
+ this.collapseTransition = param.collapseTransition
+ this.$nextTick(() => {
+ this.$refs.modelView.init(param)
+ })
+ },
+ closeWindow(collapseTransition){
+ this.collapseTransition = collapseTransition
+ this.$refs.tableObj.query()
}
}
}
diff --git a/web/src/views/modules/taskReliability/OperatConditModel.vue b/web/src/views/modules/taskReliability/OperatConditModel.vue
index 78e4fd2..1a763c3 100644
--- a/web/src/views/modules/taskReliability/OperatConditModel.vue
+++ b/web/src/views/modules/taskReliability/OperatConditModel.vue
@@ -9,7 +9,7 @@
</el-form-item>
</el-form>
<el-table v-loading="table.dataLoading" :data="table.dataList" height="100px"
- v-adaptive="{bottomOffset:70}" border @selection-change="table.selectionChangeHandle"
+ v-adaptive="{bottomOffset:30}" border @selection-change="table.selectionChangeHandle"
row-key="iid"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
:default-expand-all="true">
@@ -33,9 +33,9 @@
</template>
</el-table-column>
</el-table>
- <el-dialog v-dialogDrag :title="title" top="1vh" width='95%' :visible.sync="dialogVisible2" v-if="dialogVisible2">
- <model-view ref="modelView"></model-view>
- </el-dialog>
+<!-- <el-dialog v-dialogDrag :title="title" top="1vh" width='95%' :visible.sync="dialogVisible2" v-if="dialogVisible2">-->
+<!-- <model-view ref="modelView"></model-view>-->
+<!-- </el-dialog>-->
</zt-table-wraper>
</div>
</template>
@@ -144,15 +144,15 @@
}
},
drawRBD(row) {
- this.dialogVisible2 = true
- this.title=row.modelName + '妯″瀷璁捐'
let param = {
id: row.modelId,
modelName: row.modelName,
+ collapseTransition:0,
+ title:row.modelName + '妯″瀷璁捐'
}
- this.$nextTick(() => {
- this.$refs.modelView.init(param)
- })
+ this.$emit('collapseTransitionChange', param)
+
+
}
}
}
--
Gitblit v1.9.1