From d33eacc1f85ac3a736b33ba4713a19aae466d711 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期五, 05 八月 2022 16:42:53 +0800
Subject: [PATCH] 1.做适应平板显示的内容大小
---
src/views/zzmx/jpgj.vue | 50 +++++++++++++++++++++++++++++++++++++-------------
1 files changed, 37 insertions(+), 13 deletions(-)
diff --git a/src/views/zzmx/jpgj.vue b/src/views/zzmx/jpgj.vue
index e685e1c..ae07edf 100644
--- a/src/views/zzmx/jpgj.vue
+++ b/src/views/zzmx/jpgj.vue
@@ -114,41 +114,48 @@
prop="RowNum"
width="50"
label="搴忓彿"
+ fixed
/>
<el-table-column
prop="partcode"
+ min-width="160"
label="浜у搧缂栫爜"
sortable="custom"
/>
<el-table-column
prop="partname"
label="浜у搧鍚嶇О"
+ min-width="160"
sortable="custom"
/>
<el-table-column
prop="partspec"
label="浜у搧瑙勬牸"
- width="110"
+ min-width="110"
sortable="custom"
/>
<el-table-column
prop="wksp_name"
label="鐢熶骇杞﹂棿"
+ min-width="110"
sortable="custom"
/>
<el-table-column
prop="route_name"
label="宸ヨ壓璺嚎"
sortable="custom"
+ min-width="120"
/>
<el-table-column
prop="stepname"
label="鍔犲伐宸ュ簭"
sortable="custom"
+ min-width="110"
/>
<el-table-column
prop="eqp_name"
label="鍔犲伐璁惧"
+ min-width="110"
sortable="custom"
/>
<el-table-column
@@ -178,6 +185,8 @@
<el-table-column
label="鎿嶄綔"
+ fixed="right"
+ width="120"
>
<template slot-scope="{row}">
<div class="operationClass">
@@ -204,9 +213,8 @@
<el-dialog
:title="operation==='add'?'鏂板':'缂栬緫'"
:visible.sync="dialogVisible"
- width="1200px"
- top="15vh"
- :fullscreen="isFullscreen"
+ width="1000px"
+ :top="isIpad?'5vh':'15vh'"
:close-on-click-modal="false"
@closed="handleClose"
@close="handleClose"
@@ -291,7 +299,8 @@
<el-table
:data="eqpDialogArr"
- height="400"
+ :height="tableHeight"
+ :style="{width: 100+'%',height:tableHeight-50+'px',}"
border
stripe
highlight-current-row
@@ -308,16 +317,19 @@
prop="eqpcode"
label="璁惧缂栫爜"
sortable="custom"
+ min-width="110"
/>
<el-table-column
prop="eqpname"
label="璁惧鍚嶇О"
+ min-width="110"
sortable="custom"
/>
<el-table-column
prop="wksp_name"
sortable="custom"
label="鐢熶骇杞﹂棿"
+ min-width="110"
/>
<el-table-column
sortable="custom"
@@ -403,12 +415,13 @@
:page.sync="eqpTable.page"
:limit.sync="eqpTable.rows"
align="right"
- style="padding-top: 20px"
+ style="padding-top: 20px;"
layout="prev, pager, next,sizes"
popper-class="select_bottom"
@pagination="getEqpTable"
/>
</div>
+ <div v-if="eqpTableLength===0" style="width: 100px;height: 84px;" />
<span slot="footer" class="dialog-footer">
<div class="footerButton">
@@ -423,8 +436,6 @@
<script>
import Pagination from '@/components/Pagination'
-import { AddUpdateOrganization, DeleteOrganization } from '@/api/jcsz'
-import { getCookie } from '@/utils/auth'
import {
BeatRateSearch, DeleteBeatRate,
PartSelect,
@@ -460,7 +471,7 @@
}
}
return {
- isFullscreen: false,
+ isIpad: false,
mainHeight: 0,
tableHeight: 0,
form: {
@@ -528,18 +539,27 @@
}
},
created() {
- this.getBeatRateSearch()
- this.getPartSelect()
+ this.handleRequest()
},
mounted() {
window.addEventListener('resize', this.getHeight)
this.getHeight()
},
methods: {
+
+ handleRequest() {
+ this.getBeatRateSearch().then(res => {
+ if (res.code === '200') {
+ this.getPartSelect()
+ }
+ })
+ },
+
async getBeatRateSearch() {
const res = await BeatRateSearch(this.form)
this.tableData = res.data
this.total = res.count
+ return { code: res.code }
},
// 鎺掑簭鏀瑰彉鏃�
sortChange({ column, prop, order }) {
@@ -782,6 +802,7 @@
this.dialogForm.stand_value = ''
this.dialogForm.cavity_qty = ''
this.dialogForm.unprice = ''
+ this.eqpTableLength = 0
this.routeDialogArr = []
this.stepDialogArr = []
this.eqpDialogArr = []
@@ -818,8 +839,11 @@
getHeight() {
this.$nextTick(() => {
this.mainHeight = window.innerHeight - 250
- this.tableHeight = this.mainHeight - 100
- // this.isFullscreen = window.innerHeight < 800
+ this.tableHeight = this.mainHeight - 50
+ if (window.innerHeight < 769) {
+ this.tableHeight = this.tableHeight - 50
+ }
+ this.isIpad = window.innerHeight < 769 && window.innerWidth < 1367
})
}
}
--
Gitblit v1.9.3