From a8230f1ab02069431738bd72f36ab95a0ace01ae Mon Sep 17 00:00:00 2001
From: xyc <jc_xiong@hotmail.com>
Date: 星期二, 06 八月 2024 15:22:22 +0800
Subject: [PATCH] 修改仿真后台
---
web/src/views/modules/taskReliability/TaskPhase.vue | 76 ++++++++++++++++++++++++++++++-------
1 files changed, 61 insertions(+), 15 deletions(-)
diff --git a/web/src/views/modules/taskReliability/TaskPhase.vue b/web/src/views/modules/taskReliability/TaskPhase.vue
index 3886fa4..b2b9a27 100644
--- a/web/src/views/modules/taskReliability/TaskPhase.vue
+++ b/web/src/views/modules/taskReliability/TaskPhase.vue
@@ -1,12 +1,12 @@
<template>
<div>
<el-row :gutter="5">
- <el-col :span="7">
+ <el-col :span="8">
<div class="fa-card-a" style="margin-right: 5px;">
<task @onTaskSelected="onTaskSelected" ref="task"/>
</div>
</el-col>
- <el-col :span="11">
+ <el-col :span="10">
<div class="mod-taskReliability-taskPhase fa-card-a" style="margin-left: 5px;margin-right: 5px;">
<zt-table-wraper ref="tableObj" defaultNotQuery="true" query-url="/taskReliability/TaskPhase/page"
delete-url="/taskReliability/TaskPhase/"
@@ -18,17 +18,22 @@
<zt-button v-if="dataForm.taskId" type="delete" @click="table.deleteHandle()"/>
</el-form-item>
</el-form>
- <el-table v-loading="table.dataLoading" :data="table.dataList" height="100px" v-adaptive="{bottomOffset:30}"
-
+ <el-table v-loading="table.dataLoading" :data="table.dataList" height="100px" v-adaptive="{bottomOffset:30}" border
+ :row-class-name="tableRowClassName"
@row-click="selectPhase" @selection-change="table.selectionChangeHandle">
<el-table-column type="selection" width="40" align="center"/>
<el-table-column prop="phaseName" label="闃舵鍚嶇О" align="center"/>
- <el-table-column prop="phaseDurationRate" label="闃舵鏃堕暱姣�" align="right"/>
- <el-table-column prop="phaseSpeed" label="闃舵鏃堕��" align="right"/>
+ <el-table-column prop="phaseDurationRate" label="闃舵鏃堕暱姣�" align="right" width="120"/>
+ <el-table-column prop="remark" label="澶囨敞" align="center" width="100"/>
+ <!-- <el-table-column prop="phaseSpeed" label="闃舵鏃堕��" align="right"/>-->
<!--<el-table-column prop="phaseSort" label="闃舵椤哄簭" align="center"/>-->
- <el-table-column prop="operatConditDuration" label="宸ュ喌鏃堕暱鍒嗛厤" align="center"/>
- <zt-table-column-handle :table="table"
- delete-perm="taskReliability::delete"/>
+ <!--<el-table-column prop="operatConditDuration" label="宸ュ喌鏃堕暱鍒嗛厤" align="center"/>-->
+ <zt-table-column-handle :table="table" edit-perm="testReviewComment:update"
+ delete-perm="taskReliability::delete" width="100">
+ <template v-slot="{row}">
+ <zt-table-button type="primary" @click="openEditWin(row)">淇敼</zt-table-button>
+ </template>
+ </zt-table-column-handle>
</el-table>
<!-- 寮圭獥, 鏂板 / 淇敼 -->
<add-or-update @refreshDataList="refreshData" ref="AddOrUpdate"/>
@@ -51,12 +56,14 @@
data() {
return {
dataForm: {
- id:'',
+ id: '',
taskId: '',
productId: ''
},
dataList: [],
- time: null
+ time: null,
+ currentId: '',
+ isChange: ''
}
},
components: {
@@ -65,7 +72,7 @@
AddOrUpdate
},
methods: {
- refreshData(){
+ refreshData() {
this.$refs.tableObj.query()
this.$refs.task.$refs.tableObj.query()
},
@@ -75,23 +82,46 @@
for (let i = 0; i < this.dataList.length; i++) {
this.time = this.time + Number(this.dataList[i].phaseDurationRate)
}
- if (this.time>1){
- this.$alert("褰撳墠杩愯鏃堕暱姣斿凡瓒呭嚭锛岃閲嶆柊璁剧疆")
- }
+ console.log(this.time)
},
add() {
+ console.log(this.time)
this.$refs.AddOrUpdate.$refs.dialog.init(null, {
taskId: this.dataForm.taskId,
productId: this.dataForm.productId,
time: this.time
})
},
+ openEditWin(row) {
+ console.log(row)
+ this.$refs.AddOrUpdate.$refs.dialog.init(row.id, {
+ taskId: this.dataForm.taskId,
+ productId: this.dataForm.productId,
+ time: this.time
+ })
+ },
onTaskSelected(row) {
+ this.isChange = this.$refs.model.isChange
+ this.$refs.task.init(this.isChange)
+ if (this.isChange) {
+ this.$alert("鏈夋湭淇濆瓨鐨勫伐鍐垫ā鍨�")
+ return;
+ }
this.dataForm.taskId = row.id
this.dataForm.productId = row.productId
this.$refs.tableObj.query()
+ let param = {
+ row: {id: 0},
+ productId: 0
+ }
+ this.$refs.model.init(param)
},
selectPhase(row) {
+ if (this.$refs.model.isChange) {
+ this.$alert("鏈夋湭淇濆瓨鐨勫伐鍐垫ā鍨�")
+ return;
+ }
+ this.currentId = row.id
this.$emit('selectPhase', row)
let param = {
row: row,
@@ -99,6 +129,22 @@
}
this.$refs.model.init(param)
},
+ tableRowClassName(
+ {
+ row,
+ rowIndex
+ }) {
+ if (row.id == this.currentId) {
+ return 'select-row';
+ } else {
+ return 'not-select-row';
+ }
+ }
}
}
</script>
+<style>
+ .el-table .select-row {
+ background: rgba(23, 179, 163, 0.2) !important;
+ }
+</style>
--
Gitblit v1.9.1