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/jcsz/yhqd.vue | 90 +++++++++++++++++++++++++++++++++------------
1 files changed, 66 insertions(+), 24 deletions(-)
diff --git a/src/views/jcsz/yhqd.vue b/src/views/jcsz/yhqd.vue
index 915bd58..573a413 100644
--- a/src/views/jcsz/yhqd.vue
+++ b/src/views/jcsz/yhqd.vue
@@ -71,7 +71,7 @@
<div style="margin-left: 10px;display: flex">
<el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
<el-button type="primary" icon="el-icon-menu" @click="workingTramClick">鐢熶骇鐝粍</el-button>
- <!-- <el-button type="primary" icon="el-icon-upload2" @click="upload">瀵煎叆</el-button>-->
+ <el-button type="primary" icon="el-icon-upload2" @click="upload">瀵煎叆</el-button>
</div>
<el-divider />
<div class="elTableDiv">
@@ -94,36 +94,43 @@
prop="RowNum"
width="50"
label="搴忓彿"
+ fixed
/>
<el-table-column
prop="usercode"
label="鐢ㄦ埛缂栫爜"
+ min-width="110"
sortable="custom"
/>
<el-table-column
prop="username"
label="鐢ㄦ埛鍚嶇О"
+ min-width="110"
sortable="custom"
/>
<el-table-column
prop="password"
label="鐢ㄦ埛瀵嗙爜"
+ min-width="110"
sortable="custom"
/>
<el-table-column
prop="org_name"
label="鎵�灞炵粍缁�"
+ min-width="110"
sortable="custom"
/>
<el-table-column
prop="group_name"
label="鐢熶骇鐝粍"
+ min-width="110"
sortable="custom"
/>
<el-table-column
prop="wagetype"
label="宸ヨ祫绫诲瀷"
sortable="custom"
+ width="110"
>
<template slot-scope="{row}">
<div v-if="row.wagetype==='1'">璁℃椂鍒�</div>
@@ -133,6 +140,7 @@
<el-table-column
prop="mobile"
label="鑱旂郴鏂瑰紡"
+ min-width="110"
sortable="custom"
>
<template slot-scope="{row}">
@@ -144,6 +152,7 @@
prop="email"
label="鐢靛瓙閭"
sortable="custom"
+ min-width="110"
>
<template slot-scope="{row}">
<div v-if="row.email===''">/</div>
@@ -151,8 +160,9 @@
</template>
</el-table-column>
<el-table-column
- prop=""
+ prop="enable"
label="鍦ㄨ亴鐘舵��"
+ width="110"
sortable="custom"
>
<template slot-scope="{row}">
@@ -163,24 +173,29 @@
<el-table-column
prop="lm_user"
label="鍒涘缓浜哄憳"
+ width="110"
sortable="custom"
/>
<el-table-column
prop="lm_date"
label="鍒涘缓鏃堕棿"
- width="200"
+ width="160"
sortable="custom"
/>
<el-table-column
prop="is_role"
label="鍏宠仈瑙掕壊"
+ width="110"
>
<template slot-scope="{row}">
- <i class="el-icon-share" @click="roleClick({row})" />
+ <i v-if="row.is_role==='Y'" class="el-icon-share" @click="roleClick({row})" />
+ <i v-if="row.is_role==='N'" class="el-icon-share" style="color: rgb(180 ,181, 185)" @click="roleClick({row})" />
</template>
</el-table-column>
<el-table-column
label="鎿嶄綔"
+ fixed="right"
+ width="120"
>
<template slot-scope="{row}">
<div class="operationClass">
@@ -304,8 +319,8 @@
title="鍏宠仈瑙掕壊"
:visible.sync="dialogVisibleRoles"
width="800px"
- top="15vh"
- :fullscreen="isFullscreen"
+ :top="isIpad?'3vh':'15vh'"
+ :fullscreen="isIpad"
:close-on-click-modal="false"
class="dialogVisibleRoles"
@closed="handleCloseRoles"
@@ -460,16 +475,20 @@
</div>
</span>
</el-dialog>
+
+ <!--瀵煎叆缁勪欢-->
+ <import-picker ref="importPickerFunc" :shows.sync="shows" :title="title_value" :colos="colos" :code="code" />
+
</div>
</template>
<script>
import Pagination from '@/components/Pagination'
+import ImportPicker from '@/components/ImportPicker'
+
import {
AddUpdateUser,
DeleteUser,
- RoleTypeAdd,
- RoleTypeDelete,
SaveUserAssoctRole,
UserAssociationRole,
UserGroupAdd,
@@ -487,7 +506,7 @@
export default {
name: 'YYQD',
components: {
- Pagination
+ Pagination, ImportPicker
},
data() {
const validateName = (rule, value, callback) => {
@@ -532,7 +551,7 @@
}
return {
- isFullscreen: false,
+ isIpad: false,
mainHeight: 0,
tableHeight: 0,
form: {
@@ -566,7 +585,7 @@
UserCode: '',
UserName: '',
Password: '',
- Enable: '',
+ Enable: 'Y',
StuOrg: '',
Mobile: '',
Email: '',
@@ -634,23 +653,43 @@
page: 1,
prop: 'group_code',
order: 'desc'
+ },
+
+ title_value: '鏁版嵁瀵煎叆 / 鐢ㄦ埛娓呭崟',
+ code: '2',
+ shows: false
+ }
+ },
+ watch: {
+ shows() {
+ if (!this.shows) {
+ this.getUserSearch()
}
}
},
created() {
- this.getUserSearch()
- this.getUserOrganization()
+ this.handleRequest()
},
+
mounted() {
window.addEventListener('resize', this.getHeight)
this.getHeight()
},
methods: {
+ handleRequest() {
+ this.getUserSearch().then(res => {
+ if (res.code === '200') {
+ this.getUserOrganization()
+ }
+ })
+ },
+
// 鑾峰彇鐢ㄦ埛娓呭崟
async getUserSearch() {
const res = await UserSearch(this.form)
this.tableData = res.data
this.total = res.count
+ return { code: res.code }
},
// 鑾峰彇鎵�灞炵粍缁�
async getUserOrganization() {
@@ -664,7 +703,11 @@
},
// 瀵煎叆鎸夐挳
upload() {
-
+ this.shows = true
+ this.$refs.importPickerFunc.newDataFunc()
+ },
+ colos() {
+ this.shows = false
},
// 鎺掑簭鏀瑰彉鏃�
sortChange({ column, prop, order }) {
@@ -688,7 +731,7 @@
this.form.UserCode = ''
this.form.UserName = ''
this.form.StuOrg = ''
- this.form.Enable = ''
+ this.form.Enable = 'Y'
this.form.wagetype = ''
this.$refs.cascader.checkedValue = ''// 绾ц仈閫夋嫨鍣ㄧ殑娓呯┖
this.getUserSearch()
@@ -757,7 +800,7 @@
this.dialogForm.UserCode = ''
this.dialogForm.UserName = ''
this.dialogForm.Password = ''
- this.dialogForm.Enable = ''
+ this.dialogForm.Enable = 'Y'
this.$refs.dialogCascader.checkedValue = ''
this.dialogForm.StuOrg = ''
this.dialogForm.Mobile = ''
@@ -803,15 +846,13 @@
},
// 鑾峰彇椤甸潰楂樺害
getHeight() {
- console.log(window.innerHeight)
- console.log(window.innerWidth)
this.$nextTick(() => {
this.mainHeight = window.innerHeight - 250
- this.tableHeight = this.mainHeight - 100
- // this.isFullscreen = window.innerHeight < 800
- if (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
})
},
// 鍏宠仈瑙掕壊鐐瑰嚮浜嬩欢
@@ -880,6 +921,7 @@
const res = await SaveUserAssoctRole(this.dialogFormRoles.roleTreeSelectedArr, this.dialogFormRoles.usercode)
if (res.code === '200') {
this.$message.success('淇濆瓨鎴愬姛锛�')
+ await this.getUserSearch()
this.dialogVisibleRoles = false
}
},
@@ -1167,9 +1209,9 @@
if (row.group_name.trim().length < 1) {
return this.$message.info('鐝粍鍚嶇О涓嶈兘涓虹┖锛�')
}
- if (row.description.trim().length < 1) {
- return this.$message.info('鐝粍鎻忚堪涓嶈兘涓虹┖锛�')
- }
+ // if (row.description.trim().length < 1) {
+ // return this.$message.info('鐝粍鎻忚堪涓嶈兘涓虹┖锛�')
+ // }
const data = {
code: row.group_code,
name: row.group_name,
--
Gitblit v1.9.3