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/zzmx/gxdy.vue | 66 ++++++++++++++++++++++-----------
1 files changed, 44 insertions(+), 22 deletions(-)
diff --git a/src/views/zzmx/gxdy.vue b/src/views/zzmx/gxdy.vue
index 8789ee4..38772d7 100644
--- a/src/views/zzmx/gxdy.vue
+++ b/src/views/zzmx/gxdy.vue
@@ -11,12 +11,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-width="70px" label="宸ュ簭缂栫爜" style=" display: flex;">
<el-input v-model="form.stepcode" placeholder="璇疯緭鍏�" style="width: 200px" />
</el-form-item>
<el-form-item label="宸ュ簭鍚嶇О" style=" display: flex;">
@@ -54,24 +54,43 @@
/>
</el-select>
</el-form-item>
- <el-form-item label="鍒涘缓浜哄憳" style=" display: flex;">
+ <el-form-item v-show="isExpandForm" label-width="70px" label="鍒涘缓浜哄憳" style=" display: flex;">
<el-input v-model="form.createuser" style="width: 200px" placeholder="璇疯緭鍏�" />
</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"
+ >
+ <svg-icon
+ v-show="mouseHoverType==='mouseout'"
+ style="cursor: pointer"
+ :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"
+ @mouseenter="mouseHoverType=$event.type"
+ />
+ <svg-icon
+ v-show="mouseHoverType==='mouseenter'"
+ style="cursor: pointer"
+ :icon-class="!isExpandForm?'doubleDown':'doubleUp'"
+ @click="isExpandForm=!isExpandForm"
+ @mouseout="mouseHoverType=$event.type"
+ />
+ </div>
</div>
<div class="elTableDiv">
<el-table
+ ref="tableDataRef"
+ class="tableFixed"
:data="tableData"
- :height="tableHeight"
+ :height="isExpandForm?tableHeight:(tableHeight+40)+'px'"
border
:row-class-name="tableRowClassName"
- :style="{width: 100+'%',height:tableHeight+'px'}"
+ :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+40)+'px',}"
highlight-current-row
:header-cell-style="this.$headerCellStyle"
:cell-style="this.$cellStyle"
@@ -406,26 +425,17 @@
StepSearch
} from '@/api/zzmx'
import $ from 'jquery'
+import { validateCode } from '@/utils/global'
-const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
name: 'GXDY',
components: {
Pagination
},
data() {
- const validateName = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('璇疯緭鍏ョ紪鐮�'))
- } else {
- if (SER_HZ.test(value)) {
- return callback(new Error('缂栫爜涓嶈兘涓轰腑鏂�'))
- } else {
- callback()
- }
- }
- }
return {
+ mouseHoverType: 'mouseout',
+ isExpandForm: false,
isIpad: false,
mainHeight: 0,
tableHeight: 0,
@@ -464,7 +474,7 @@
operation: '',
dialogFormRules: {
stepcode: [
- { required: true, validator: validateName, trigger: ['blur', 'change'] }
+ { required: true, validator: validateCode, trigger: ['blur', 'change'] }
],
stepname: [
{ required: true, message: '璇疯緭鍏ュ悕绉�', trigger: ['blur', 'change'] }
@@ -573,6 +583,9 @@
DeleteStep({ stepcode: row.stepcode }).then(res => {
if (res.code === '200') {
this.$message.success('鍒犻櫎鎴愬姛!')
+ if (this.form.page > 1 && this.tableData.length === 1) {
+ this.form.page--
+ }
this.getStepSearch()
}
})
@@ -623,11 +636,12 @@
this.$nextTick(() => {
// this.mainHeight = window.innerHeight - 250
this.mainHeight = window.innerHeight - 85
- this.tableHeight = this.mainHeight - 200
+ this.tableHeight = this.mainHeight - 255
if (window.innerHeight < 769) {
this.tableHeight = this.tableHeight - 40
}
this.isIpad = window.innerHeight < 769 && window.innerWidth < 1367
+ this.$refs.tableDataRef.doLayout()
})
},
/* 鍏宠仈宸ヤ綔绔欐ā鍧�*/
@@ -637,7 +651,8 @@
this.workDialogForm.stepcode = row.stepcode
this.workDialogForm.stepname = row.stepname
const { data: res } = await StepAssociationEqp({ stepcode: this.workDialogForm.stepcode })
- this.workDialogForm.workArr = res
+ this.workDialogForm.workArr = res.filter(item => item.children.length !== 0)
+
let workGatherArr = []
if (row.flwtype === 'W') { // 澶栧崗鎯呭喌涓�
workGatherArr = this.workDialogForm.workArr.filter(item => item.type === 'W')
@@ -1121,7 +1136,14 @@
.userDialogVisible ::v-deep .el-form-item {
margin-bottom: 0;
}
-
+.tableFixed{
+ ::v-deep .el-table__fixed-right{
+ height: 100% !important;
+ }
+ ::v-deep .el-table__fixed{
+ height: 100% !important;
+ }
+}
</style>
<style>
--
Gitblit v1.9.3