From 1d662c1648aeeff4b1bfdadb619cdba922740348 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期三, 28 九月 2022 15:14:26 +0800
Subject: [PATCH] 1.头部搜索栏、下拉箭头优化
---
src/views/sbgl/bybz.vue | 103 ++++++++++++++++++++++++++++-----------------------
1 files changed, 57 insertions(+), 46 deletions(-)
diff --git a/src/views/sbgl/bybz.vue b/src/views/sbgl/bybz.vue
index 974b262..e4efde1 100644
--- a/src/views/sbgl/bybz.vue
+++ b/src/views/sbgl/bybz.vue
@@ -10,12 +10,12 @@
<el-form
ref="form"
:model="form"
- label-width="80px"
+ label-width="100px"
inline
style="display: flex;justify-content: space-between"
>
<div class="elForm">
- <el-form-item label="鏍囧噯缂栫爜" style=" display: flex;">
+ <el-form-item label="鏍囧噯缂栫爜" label-width="70px" style=" display: flex;">
<el-input v-model="form.repairstandcode" placeholder="璇疯緭鍏�" style="width: 200px" />
</el-form-item>
<el-form-item label="鏍囧噯鍚嶇О" style=" display: flex;">
@@ -25,18 +25,23 @@
<el-input v-model="form.repairstanddescr" placeholder="璇疯緭鍏�" style="width: 200px" />
</el-form-item>
</div>
- <div style="display: flex;align-items: start;margin-top: 5px;z-index: 2">
+ <div class="bodySearchReset" :style="{marginLeft:$store.state.app.sidebar.opened?'5%':'10%'}">
<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>
</el-form>
+ <div
+ class="bodyTopFormExpand"
+ />
</div>
<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
@@ -51,6 +56,7 @@
<el-table-column
prop="RowNum"
width="50"
+ fixed
label="搴忓彿"
/>
<el-table-column
@@ -76,19 +82,26 @@
</template>
</el-table-column>
<el-table-column
- prop="iscontr"
+ prop="main_cycle"
label="淇濆吇鍛ㄦ湡"
sortable="custom"
- />
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.main_cycle==='Y'">骞�</div>
+ <div v-if="row.main_cycle==='S'">瀛�</div>
+ <div v-if="row.main_cycle==='M'">鏈�</div>
+ <div v-if="row.main_cycle==='W'">鍛�</div>
+ </template>
+ </el-table-column>
<el-table-column
- prop="is_checkeqp"
+ prop="is_repaireqp"
label="鍏宠仈璁惧"
sortable="custom"
>
<template slot-scope="{row}">
- <i v-if="row.is_checkeqp==='Y'" class="el-icon-share" @click="checkeqpClick(row)" />
+ <i v-if="row.is_repaireqp==='Y'" class="el-icon-share" @click="checkeqpClick(row)" />
<i
- v-if="row.is_checkeqp==='N'"
+ v-if="row.is_repaireqp==='N'"
class="el-icon-share"
style="color: rgb(180 ,181, 185)"
@click="checkeqpClick(row)"
@@ -130,7 +143,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="getDeviceRepairStandArdSearch"
/>
@@ -244,6 +257,7 @@
<el-table-column
prop="repairitem_descr"
label="淇濆吇瑕佹眰"
+ show-tooltip-when-overflow
>
<template slot-scope="{row}">
<div v-if="row.isVisible===0">{{ row.repairitem_descr }}</div>
@@ -379,46 +393,26 @@
<script>
import Pagination from '@/components/Pagination'
-import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
-import { getCookie } from '@/utils/auth'
+
import ImportPicker from '@/components/ImportPicker'
import {
- AddUpdateDeviceCheckStandArd, AddUpdateDeviceRepairStandArd,
- DeleteDeviceCheckStaned, DeleteDeviceRepairStaned,
- DeviceCheckItemSelect,
- DeviceCheckStandArdSearch,
- DeviceCheckStanedAssociationEqp, DeviceRepairItemSelect,
- DeviceRepairStandArdSearch, DeviceRepairStanedAssociationEqp,
- SaveDeviceCheckStanedAssociationEqp, SaveDeviceRepairStanedAssociationEqp,
- ViewDeviceCheckStanedSearch
+ AddUpdateDeviceRepairStandArd,
+ DeleteDeviceRepairStaned,
+ DeviceRepairItemSelect,
+ DeviceRepairStandArdSearch,
+ DeviceRepairStanedAssociationEqp,
+ SaveDeviceRepairStanedAssociationEqp,
+ ViewDeviceRepairStanedSearch
} 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,
@@ -454,7 +448,7 @@
dialogFormRules: {
code: [
- { required: true, validator: validateName, trigger: ['blur', 'change'] }
+ { required: true, validator: validateCode, trigger: ['blur', 'change'] }
],
name: [
{ required: true, message: '璇疯緭鍏ユ爣鍑嗗悕绉�', trigger: ['blur', 'change'] }
@@ -566,7 +560,7 @@
// 淇敼鎸夐挳
edit(operation, row) {
this.operation = operation
- this.getViewDeviceCheckStanedSearch(row.code)
+ this.getViewDeviceRepairStanedSearch(row.code)
this.dialogVisible = true
this.$nextTick(() => {
@@ -580,8 +574,8 @@
// })
},
// 淇敼鍓嶈姹傛帴鍙�
- async getViewDeviceCheckStanedSearch(checkstand_code) {
- const { data: res } = await ViewDeviceCheckStanedSearch({ checkstand_code })
+ async getViewDeviceRepairStanedSearch(repairstand_code) {
+ const { data: res } = await ViewDeviceRepairStanedSearch({ repairstand_code })
this.tableDataDialog = res.Data
this.dialogForm.code = res.code
@@ -593,7 +587,7 @@
item.isVisible = 0
item.repairitem_code = item.code
item.repairitem_name = item.name
- item.repairitem_descr = item.chkdesc
+ item.repairitem_descr = item.chk_desc
})
this.repairItemSelectArr = [...this.repairItemSelectArr].filter(x => [...this.tableDataDialog].every(y => y.repairitem_code !== x.code))
@@ -608,6 +602,9 @@
DeleteDeviceRepairStaned({ repairstand_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.getDeviceRepairStandArdSearch()
}
})
@@ -770,7 +767,8 @@
getHeight() {
this.$nextTick(() => {
this.mainHeight = window.innerHeight - 85
- this.tableHeight = this.mainHeight - 200
+ this.tableHeight = this.mainHeight - 195
+ this.$refs.tableDataRef.doLayout()
})
},
tableRowClassName({ row, rowIndex }) {
@@ -781,8 +779,8 @@
this.dialogFormEqp.name = row.name
this.dialogFormEqp.code = row.code
- const { data: res } = await DeviceRepairStanedAssociationEqp({ checkstand_code: row.code })
- this.dialogFormEqp.eqpAll = res
+ const { data: res } = await DeviceRepairStanedAssociationEqp({ repairstand_code: row.code })
+ this.dialogFormEqp.eqpAll = res.filter(item => item.children.length > 0)
if (this.dialogFormEqp.eqpAll.length > 0) {
this.dialogFormEqp.eqpAll.forEach((item, index) => {
@@ -834,6 +832,9 @@
this.dialogFormEqp.eqpAll[index].name = '鍏ㄩ儴'
this.dialogFormEqp.eqpTree = [this.dialogFormEqp.eqpAll[index]]
}
+ })
+ this.$nextTick(() => { // 鏍戝舰鍥炴樉
+ this.$refs.epqTree.setCheckedKeys(this.dialogFormEqp.eqpCodeSelectedArr)
})
},
// 灏忕洅瀛愮偣鍑�
@@ -1161,6 +1162,16 @@
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