From 2c59863afca9475562c4c3a99e66b4b4a4122b0f Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期五, 23 九月 2022 17:12:17 +0800
Subject: [PATCH] 1.设备保养记录开发完成2.修改页面放大时table表错位问题
---
src/views/sbgl/djbz.vue | 44 +++++++++++++++++++++-----------------------
1 files changed, 21 insertions(+), 23 deletions(-)
diff --git a/src/views/sbgl/djbz.vue b/src/views/sbgl/djbz.vue
index 4c08677..2c8e6ab 100644
--- a/src/views/sbgl/djbz.vue
+++ b/src/views/sbgl/djbz.vue
@@ -32,7 +32,7 @@
</el-select>
</el-form-item>
</div>
- <div style="display: flex;align-items: start;margin-top: 5px;z-index: 2">
+ <div class="bodySearchReset">
<el-button type="primary" icon="el-icon-search" @click="search">鏌ヨ</el-button>
<el-button type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
</div>
@@ -41,9 +41,11 @@
<div class="elTableDiv">
<el-table
+ ref="tableDataRef"
:data="tableData"
:height="tableHeight+'px'"
border
+ class="tableFixed"
:row-class-name="tableRowClassName"
:style="{width: 100+'%',height:tableHeight+'px',}"
highlight-current-row
@@ -149,7 +151,7 @@
:page.sync="form.page"
:limit.sync="form.rows"
align="right"
- layout="prev, pager, next,sizes"
+ layout="total,prev, pager, next,sizes"
popper-class="select_bottom"
@pagination="getDeviceCheckStandArdSearch"
/>
@@ -264,6 +266,7 @@
<el-table-column
prop="checkitem_descr"
label="鐐规瑕佹眰"
+ show-tooltip-when-overflow
>
<template slot-scope="{row}">
<div v-if="row.isVisible===0">{{ row.checkitem_descr }}</div>
@@ -429,32 +432,14 @@
ViewDeviceCheckStanedSearch
} from '@/api/sbgl'
import $ from 'jquery'
+import { validateCode } from '@/utils/global'
-const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
name: 'Zzjg',
components: {
Pagination, ImportPicker
},
data() {
- const validateName = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('璇疯緭鍏ョ紪鐮�'))
- } else {
- if (SER_HZ.test(value)) {
- return callback(new Error('缂栫爜涓嶈兘涓轰腑鏂�'))
- } else {
- callback()
- }
- }
- }
- const validateTypeCode = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('璇烽�夋嫨涓婄骇'))
- } else {
- callback()
- }
- }
return {
mainHeight: 0,
tableHeight: 0,
@@ -487,7 +472,7 @@
dialogFormRules: {
code: [
- { required: true, validator: validateName, trigger: ['blur', 'change'] }
+ { required: true, validator: validateCode, trigger: ['blur', 'change'] }
],
name: [
{ required: true, message: '璇疯緭鍏ユ爣鍑嗗悕绉�', trigger: ['blur', 'change'] }
@@ -643,6 +628,9 @@
DeleteDeviceCheckStaned({ checkstand_code: row.code }).then(res => {
if (res.code === '200') {
this.$message.success('鍒犻櫎鎴愬姛!')
+ if (this.form.page > 1 && this.tableData.length === 1) {
+ this.form.page--
+ }
this.getDeviceCheckStandArdSearch()
}
})
@@ -818,6 +806,7 @@
this.$nextTick(() => {
this.mainHeight = window.innerHeight - 85
this.tableHeight = this.mainHeight - 200
+ this.$refs.tableDataRef.doLayout()
})
},
tableRowClassName({ row, rowIndex }) {
@@ -829,7 +818,7 @@
this.dialogFormEqp.code = row.code
const { data: res } = await DeviceCheckStanedAssociationEqp({ checkstand_code: row.code })
- this.dialogFormEqp.eqpAll = res
+ this.dialogFormEqp.eqpAll = res.filter(item => item.children.length > 0)
if (this.dialogFormEqp.eqpAll.length > 0) {
this.dialogFormEqp.eqpAll.forEach((item, index) => {
@@ -1211,6 +1200,15 @@
align-items: center;
justify-content: center;
}
+
+.tableFixed{
+ ::v-deep .el-table__fixed-right{
+ height: 100% !important;
+ }
+ ::v-deep .el-table__fixed{
+ height: 100% !important;
+ }
+}
</style>
<style>
--
Gitblit v1.9.3