From ef9633e0d1689fd8869170f3aa0af6c90c2e5e7f Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期三, 07 九月 2022 16:18:24 +0800
Subject: [PATCH] 1.优化项目2.搜索栏多行的变为一行可展开
---
src/views/jcsz/jsqd.vue | 394 +++++++++++++++++++++++++++----------------------------
1 files changed, 195 insertions(+), 199 deletions(-)
diff --git a/src/views/jcsz/jsqd.vue b/src/views/jcsz/jsqd.vue
index dec57fa..9151a0f 100644
--- a/src/views/jcsz/jsqd.vue
+++ b/src/views/jcsz/jsqd.vue
@@ -1,7 +1,17 @@
<template>
<div>
<div class="body" :style="{height:mainHeight+'px'}">
- <div style="padding: 10px 5px 0 0">
+
+ <div class="bodyTopButtonGroup" style="justify-content: space-between">
+ <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
+
+ <div style="display: flex">
+ <el-button icon="el-icon-setting" @click="settingButton">璁剧疆</el-button>
+ <el-button icon="el-icon-download" @click="upload">瀵煎叆</el-button>
+ </div>
+ </div>
+
+ <div class="bodyTopFormGroup">
<el-form
ref="form"
:model="form"
@@ -43,20 +53,14 @@
</div>
</el-form>
</div>
- <el-divider />
- <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-setting" @click="settingButton">璁剧疆</el-button>
- <el-button type="primary" icon="el-icon-upload2" @click="upload">瀵煎叆</el-button>
- </div>
- <el-divider />
+
<div class="elTableDiv">
<el-table
:data="tableData"
border
- stripe
+ :row-class-name="tableRowClassName"
:height="tableHeight+'px'"
- :style="{width: 100+'%',height:tableHeight+'px'}"
+ :style="{width: 100+'%',height: tableHeight+'px'}"
highlight-current-row
:header-cell-style="this.$headerCellStyle"
:cell-style="this.$cellStyle"
@@ -96,17 +100,28 @@
min-width="160"
label="瑙掕壊鎻忚堪"
sortable="custom"
- />
+ show-tooltip-when-overflow
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.description">{{ row.description }}</div>
+ <div v-else>/</div>
+ </template>
+ </el-table-column>
<el-table-column
prop="lm_user"
label="鍒涘缓浜哄憳"
sortable="custom"
width="110"
- />
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.lm_user===null">/</div>
+ <div v-else>{{ row.lm_user }}</div>
+ </template>
+ </el-table-column>
<el-table-column
prop="lm_date"
label="鍒涘缓鏃堕棿"
- min-width="160"
+ width="160"
sortable="custom"
/>
<el-table-column
@@ -116,8 +131,18 @@
sortable="custom"
>
<template slot-scope="{row}">
- <i v-if="row.is_user==='Y'" class="el-icon-user-solid" @click="userClick(row)" />
- <i v-if="row.is_user==='N'" class="el-icon-user-solid" style="color: rgb(180 ,181, 185)" @click="userClick(row)" />
+ <i
+ v-if="row.is_user==='Y'"
+ class="el-icon-user-solid"
+ style="color:#42b983;cursor: pointer"
+ @click="userClick(row)"
+ />
+ <i
+ v-if="row.is_user==='N'"
+ class="el-icon-user-solid"
+ style="color: rgb(180 ,181, 185);cursor: pointer"
+ @click="userClick(row)"
+ />
</template>
</el-table-column>
<el-table-column
@@ -128,17 +153,27 @@
>
<template slot-scope="{row}">
<i v-if="row.is_right==='Y'" class="el-icon-share" @click="rightClick(row)" />
- <i v-if="row.is_right==='N'" class="el-icon-share" style="color: rgb(180 ,181, 185)" @click="rightClick(row)" />
+ <i
+ v-if="row.is_right==='N'"
+ class="el-icon-share"
+ style="color: rgb(180 ,181, 185)"
+ @click="rightClick(row)"
+ />
</template>
</el-table-column>
<el-table-column
label="鎿嶄綔"
fixed="right"
+ width="120"
>
<template slot-scope="{row}">
<div class="operationClass">
- <el-button type="text" @click="edit('edit',row)">缂栬緫</el-button>
- <el-button type="text" @click="del(row)">鍒犻櫎</el-button>
+ <el-tooltip class="item" effect="dark" content="缂栬緫" placement="top">
+ <i class="el-icon-edit-outline" @click="edit('edit',row)" />
+ </el-tooltip>
+ <el-tooltip v-del-tab-index class="item" effect="dark" content="鍒犻櫎" placement="top">
+ <i class="el-icon-delete" @click="del(row)" />
+ </el-tooltip>
</div>
</template>
</el-table-column>
@@ -146,12 +181,11 @@
</div>
<!--鍒嗛〉-->
<pagination
- v-show="total>0"
:total="total"
: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="getRoleSearch"
/>
@@ -216,12 +250,14 @@
<!-- <el-button type="primary" icon="el-icon-delete" @click="delSetting">鍒犻櫎</el-button>-->
</div>
<el-table
+ ref="RoleTypeCodeArr"
:data="RoleTypeCodeArr"
border
height="300"
highlight-current-row
:header-cell-style="this.$headerCellStyle"
:cell-style="this.$cellStyle"
+ :row-class-name="tableRowClassName"
@sort-change="sortChangeOfSetting"
>
<!-- :style="{width: 100+'%',height:tableHeight-300+'px'}"-->
@@ -241,7 +277,7 @@
sortable="custom"
>
<template slot-scope="{row}">
- <el-input v-if="row.isVisible===1" v-model="row.roletype_code" placeholder="璇疯緭鍏�" />
+ <el-input v-if="row.isVisible===1" v-model="row.roletype_code" oninput="value=value.replace(/[^0-9a-zA-Z]/g,'')" placeholder="璇疯緭鍏�" />
<div v-else> {{ row.roletype_code }}</div>
</template>
</el-table-column>
@@ -267,12 +303,12 @@
</el-table>
<!--鍒嗛〉-->
<pagination
- v-show="RoleTypeCodeArrLength>0"
:total="RoleTypeCodeArrLength"
:page.sync="formSetting.page"
:limit.sync="formSetting.rows"
align="right"
- layout="prev, pager, next,sizes"
+ style="margin-top: 10px"
+ layout="total ,prev, pager, next,sizes"
popper-class="select_bottom"
@pagination="getRoleTypeSearch"
/>
@@ -287,10 +323,10 @@
<el-dialog
title="瑙掕壊鍏宠仈鐢ㄦ埛"
:visible.sync="userDialogVisible"
- width="1500px"
+ width="900px"
:close-on-click-modal="false"
top="15vh"
- :fullscreen="isFullscreen"
+ :fullscreen="isIpad"
class="userDialogVisible"
@closed="handleCloseUser"
@close="handleCloseUser"
@@ -302,13 +338,19 @@
<div style="margin-bottom: 10px">
<i class="el-icon-s-operation" style="color:#42b983;" /> 鐢ㄦ埛鍒楄〃
</div>
- <div style="display: flex;min-height: 50px">
+ <div style="display: flex;min-height: 50px;margin-bottom: 10px">
<el-form ref="dialogFormUser" inline :model="dialogFormUser" label-width="80px">
<el-form-item label="鐢ㄦ埛缂栫爜">
- <el-input v-model="dialogFormUser.usercode" style="width: 200px" />
+ <el-input
+ v-model="dialogFormUser.usercode"
+ :style="{width:isIpad? '180px':'200px'}"
+ />
</el-form-item>
<el-form-item label="鐢ㄦ埛鍚嶇О">
- <el-input v-model="dialogFormUser.username" style="width: 200px" />
+ <el-input
+ v-model="dialogFormUser.username"
+ :style="{width:isIpad? '180px':'200px'}"
+ />
</el-form-item>
<el-form-item label="鎵�灞炵粍缁�">
<el-cascader
@@ -319,7 +361,7 @@
:append-to-body="false"
:options="StuOrgArr"
:props="defaultProps"
- style="width: 200px;"
+ :style="{width:isIpad? '180px':'200px'}"
@change="dialogCascaderChange"
/>
@@ -330,7 +372,7 @@
v-model="dialogFormUser.isrole"
filterable
:popper-append-to-body="false"
- style="width: 200px"
+ :style="{width:isIpad? '180px':'200px'}"
placeholder="璇烽�夋嫨"
>
<el-option
@@ -361,8 +403,9 @@
ref="multipleTable"
:data="dialogFormUserTable"
border
+ :row-class-name="tableRowClassName"
highlight-current-row
- height="300"
+ :height="isIpad?400:365"
:header-cell-style="this.$headerCellStyle"
:cell-style="this.$cellStyle"
:row-key="getRowKey"
@@ -375,6 +418,7 @@
type="selection"
width="50"
:reserve-selection="true"
+ fixed
/>
<el-table-column
prop="RowNum"
@@ -400,22 +444,29 @@
prop="flag"
label="鍏宠仈瑙掕壊"
sortable="custom"
+ fixed="right"
>
<template slot-scope="{row}">
- <div v-if="row.flag==='Y'">鏄�</div>
- <div v-if="row.flag==='N'">鍚�</div>
+ <div v-if="row.flag==='Y'">
+ <svg-icon icon-class="circleYes" style="margin-right: 2px" />
+ 鏄�
+ </div>
+ <div v-if="row.flag==='N'">
+ <svg-icon icon-class="circleNo" style="margin-right: 2px" />
+ 鍚�
+ </div>
</template>
</el-table-column>
</el-table>
<!--鍒嗛〉-->
<pagination
- v-show="dialogFormUserTableLength>0"
:total="dialogFormUserTableLength"
:page.sync="dialogFormUser.page"
:limit.sync="dialogFormUser.rows"
align="right"
- layout="prev, pager, next,sizes"
+ style="margin-top: 10px"
+ layout="total ,prev, pager, next,sizes"
popper-class="select_bottom"
@pagination="getRoleAssociationUser"
/>
@@ -433,7 +484,7 @@
:visible.sync="dialogVisibleRight"
width="800px"
top="15vh"
- :fullscreen="isFullscreen"
+ :fullscreen="isIpad"
:close-on-click-modal="false"
class="dialogVisibleRight"
@closed="handleCloseRight"
@@ -471,7 +522,7 @@
<div style="margin-bottom: 10px">
<i class="el-icon-s-operation" style="color:#42b983;" /> 鍔熻兘鏉冮檺
</div>
- <div style="height: 400px;overflow-y: scroll">
+ <div style="height: 393px;overflow-y: scroll">
<el-tree
v-if="dialogFormRight.rightCurrentCode==='PC'"
ref="rightPCRef"
@@ -506,7 +557,14 @@
</el-dialog>
<!--瀵煎叆缁勪欢-->
- <import-picker ref="importPickerFunc" :shows.sync="shows" :title="title_value" :colos="colos" :code="code" />
+ <import-picker
+ ref="importPickerFunc"
+ class="importPickerClass"
+ :shows.sync="shows"
+ :title="title_value"
+ :colos="colos"
+ :code="code"
+ />
</div>
</template>
@@ -523,28 +581,16 @@
} from '@/api/jcsz'
import { getCookie } from '@/utils/auth'
import $ from 'jquery'
-import clearAllChildren from '@/utils/global'
+import clearAllChildren, { validateCode } from '@/utils/global'
-const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
name: 'JSQD',
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()
- }
- }
- }
return {
- isFullscreen: false,
+ isIpad: false,
mainHeight: 0,
tableHeight: 0,
form: {
@@ -579,7 +625,7 @@
operation: '',
dialogFormRules: {
RoleCode: [
- { required: true, validator: validateName, trigger: ['blur', 'change'] }
+ { required: true, validator: validateCode, trigger: ['blur', 'change'] }
],
RoleName: [
{ required: true, message: '璇疯緭鍏ュ悕绉�', trigger: ['blur', 'change'] }
@@ -693,6 +739,9 @@
settingButton() {
this.settingDialogVisible = true
this.getRoleTypeSearch()
+ this.$nextTick(() => {
+ this.$refs.RoleTypeCodeArr.doLayout()
+ })
},
// 鑾峰彇鎵�灞炵粍缁�
async getUserOrganization() {
@@ -765,6 +814,9 @@
DeleteRole({ RoleCode: row.role_code }).then(res => {
if (res.code === '200') {
this.$message.success('鍒犻櫎鎴愬姛!')
+ if (this.form.page > 1 && this.tableData.length === 1) {
+ this.form.page--
+ }
this.getRoleSearch()
}
})
@@ -813,12 +865,16 @@
// 鑾峰彇椤甸潰楂樺害
getHeight() {
this.$nextTick(() => {
- console.log(window.innerHeight)
- console.log(window.innerHeight)
- this.mainHeight = window.innerHeight - 250
- this.tableHeight = this.mainHeight - 100
- // this.isFullscreen = window.innerHeight < 800
+ this.mainHeight = window.innerHeight - 85
+ this.tableHeight = this.mainHeight - 200
+ if (window.innerHeight < 769) {
+ this.tableHeight = this.tableHeight - 40
+ }
+ this.isIpad = window.innerHeight < 769 && window.innerWidth < 1367
})
+ },
+ tableRowClassName({ row, rowIndex }) {
+ return 'custom-row'
},
/* 璁剧疆妯″潡*/
// 璁剧疆瀵硅瘽妗嗗叧闂簨浠�
@@ -854,6 +910,9 @@
RoleTypeDelete({ RoleTypeCode: row.roletype_code }).then(res => {
if (res.code === '200') {
this.$message.success('鍒犻櫎鎴愬姛!')
+ if (this.formSetting.page > 1 && this.RoleTypeCodeArr.length === 1) {
+ this.formSetting.page--
+ }
this.getRoleTypeSearch()
}
})
@@ -894,6 +953,9 @@
this.userForm.roleName = row.role_name
this.dialogFormUser.rolecode = row.role_code
this.getRoleAssociationUser()
+ this.$nextTick(() => {
+ this.$refs.multipleTable.doLayout()
+ })
},
// 鑾峰彇瑙掕壊娓呭崟鍏宠仈鐢ㄦ埛
async getRoleAssociationUser() {
@@ -994,12 +1056,13 @@
type: ''
}
const { data: res } = await RoleAssociationRight(data)// 鎺ュ彛鑾峰彇鏁版嵁
-
+ // console.log(res, 111)
this.dialogFormRight.rightPCArr = res[0][0].is_delete === '0' ? res[0] : []
this.dialogFormRight.rightAPPArr = res[1][0].is_delete === '0' ? res[1] : []
this.PCTrue = res[0][0].is_delete === '0'
- this.APPTrue = res[1][0].is_delete === '0'
+ this.APPTrue = res[1][0].children.filter(item => item.is_delete === '0').length === 0 ? false : res[1][0].is_delete === '0'
+
// '0'鏄剧ず '1' 涓嶆樉绀� 杩囨护鍑虹浉瀵瑰簲鐨勮彍鍗�
if (this.PCTrue) {
this.dialogFormRight.rightPCArr[0].children = this.dialogFormRight.rightPCArr[0].children.filter(item => item.is_delete === '0')
@@ -1009,12 +1072,13 @@
}
if (this.APPTrue) {
- this.dialogFormRight.rightAPPArr[0].children = this.dialogFormRight.rightAPPArr[0].children.filter(item => item.is_delete === '0')
+ this.dialogFormRight.rightAPPArr[0].children = this.dialogFormRight.rightAPPArr[0].children.filter(item => item.is_delete === '0' || item.is_delete === null)
this.dialogFormRight.rightAPPArr[0].children.forEach(item => {
- item.children = item.children.filter(it => it.is_delete === '0')
+ item.children = item.children.filter(it => it.is_delete === '0' || it.is_delete === null)
+ // item.children = item.children.filter(it => it.is_delete !== '1')
})
}
-
+ // console.log(this.dialogFormRight.rightAPPArr[0], 234)
// 鍒ゆ柇鍝釜鏄珮浜�
let pcIsSelected1 = false
let pcIsSelected2 = false
@@ -1100,7 +1164,9 @@
}
}
+ // 鐩墠涓�鏈熻偗瀹氭槸杩欎釜
if (this.PCTrue && !this.APPTrue) {
+ // pcIsSelected1 = true
if (rightPCArrFlag === 'Y') {
pcIsSelected1 = true
pcIsSelected2 = true
@@ -1119,6 +1185,7 @@
this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightPCArr[0].code
}
+ // this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightPCArr[0].code
}
if (!this.PCTrue && this.APPTrue) {
@@ -1458,53 +1525,6 @@
<style lang="scss" scoped>
$main_color: #42b983;
-::v-deep .el-button--primary {
- background-color: $main_color !important;
- height: 30px;
- display: flex;
- align-items: center;
- //border: 1px solid $main_color;
- border: none;
- padding: 0 20px;
-}
-
-::v-deep .el-button--primary:hover {
- border: none;
-}
-
-::v-deep .el-button--info {
- //background-color: $main_color !important;
- height: 30px;
- display: flex;
- align-items: center;
- padding: 0 20px;
-}
-
-::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active {
- background-color: $main_color !important;
-}
-
-::v-deep .el-dialog__footer {
- display: flex;
- justify-content: flex-end;
-}
-
-.footerButton {
- display: flex;
- justify-content: end;
-}
-
-::v-deep .el-button--default {
- background-color: #ffffff !important;
- height: 30px;
- display: flex;
- align-items: center;
- padding: 0 20px;
-}
-
-::v-deep .el-button--default:hover {
- color: #606266;
-}
::v-deep .el-dialog__body {
padding: 20px 100px !important;
@@ -1576,86 +1596,87 @@
}
}
-::v-deep .el-radio__input.is-checked .el-radio__inner {
- background-color: $main_color;
- border-color: $main_color;
+</style>
+
+<!--鍏叡椤甸潰鏍峰紡-->
+<style lang="scss" scoped>
+$main_color: #42b983;
+::v-deep .el-button--text{
+ font-size: 14px ;
+ cursor: pointer ;
+}
+.el-icon-share, .el-icon-delete, .el-icon-edit-outline {
+ color: $main_color;
+ cursor: pointer;
}
-::v-deep .el-radio__input.is-checked + .el-radio__label {
- color: $main_color !important;
+.el-icon-edit-outline {
+ margin-right: 15px;
}
-::v-deep .el-checkbox__input.is-checked .el-checkbox__inner {
- border-color: $main_color;
- background-color: $main_color;
+::v-deep .el-button--primary, .el-button--default, .el-button--info {
+ height: 34px;
+ display: flex;
+ align-items: center;
+ padding: 0 15px;
+}
+
+::v-deep .el-button--primary {
+ //background-color: $main_color !important;
+}
+
+::v-deep .el-button--default {
+ background-color: #f8f8fa;
+ border: none;
}
::v-deep .el-input__inner {
- height: 30px;
- line-height: 30px;
+ height: 34px;
+ line-height: 34px;
+ //color: #a7a7a7;
}
-::v-deep .el-input__inner:focus {
- border-color: $main_color;
+::v-deep .el-dialog__body {
+ padding: 20px 100px !important;
+}
+
+::v-deep .dialogVisibleRoles .el-dialog__body {
+ padding: 20px 20px !important;
+}
+
+::v-deep .importPickerClass .el-dialog__body {
+ padding: 20px 20px !important;
+}
+
+::v-deep .el-dialog__footer {
+ display: flex;
+ justify-content: flex-end;
}
::v-deep .el-table .caret-wrapper {
- //float: right;
transform: scale(0.8);
}
::v-deep .cell {
- display: flex !important;
- align-items: center !important;
- justify-content: space-between !important;
-}
-
-::v-deep .el-button--text {
- color: $main_color;
- font-size: 14px;
- cursor: pointer;
-}
-
-.operationClass {
- height: 23px;
display: flex;
- justify-content: space-between;
align-items: center;
+ justify-content: space-between;
}
-.el-icon-share, .el-icon-user-solid {
- color: $main_color;
- cursor: pointer;
+::v-deep .el-table::before {
+ height: 0;
}
-.el-checkbox.is-bordered.is-checked {
- border-color: $main_color;
+::v-deep .el-table__body-wrapper {
+ background-color: #f8f8fa;
}
-::v-deep .el-radio__input.is-checked .el-radio__inner {
- border-color: $main_color;
- background: $main_color;
+::v-deep .el-table__body .el-table__row.hover-row td {
+ background-color: #eaecef;
}
-::v-deep .el-checkbox__input.is-indeterminate .el-checkbox__inner {
- border-color: $main_color;
- background: $main_color;
-}
-
-::v-deep .el-checkbox__input.is-checked + .el-checkbox__label {
- color: $main_color !important;
-}
-
-::v-deep .el-checkbox.is-bordered + .el-checkbox.is-bordered {
- margin: 10px 30px 0px 0;
-}
-
-::v-deep .el-radio__input.is-checked + .el-radio__label {
- color: $main_color;
-}
-
-::v-deep .el-radio.is-bordered + .el-radio.is-bordered {
- margin: 10px 30px 0px 0;
+::v-deep .el-form--inline .el-form-item__label {
+ color: #a7a7a7;
}
.body ::v-deep .el-divider {
@@ -1668,44 +1689,19 @@
margin-bottom: 0;
}
-::v-deep .el-input__inner:focus {
- border-color: $main_color;
-}
-
-::v-deep .el-select .el-input__inner:focus {
- border-color: $main_color;
-}
-
-::v-deep .el-select-dropdown__item.selected {
- color: $main_color;
-}
-
-::v-deep .el-textarea__inner:focus {
- border-color: $main_color;
+.userDialogVisible ::v-deep .el-form-item {
+ margin-bottom: 0;
}
</style>
-<style lang="scss">
-.elCascader {
- //.el-cascader-node.in-active-path, .el-cascader-node.is-active, .el-cascader-node.is-selectable.in-checked-path {
- // color: #42b983 ;
- //}
- .el-cascader-node.is-selectable.in-checked-path {
- color: #42b983;
- }
+<style>
- .el-radio__input.is-checked .el-radio__inner {
- background-color: #42b983;
- border-color: #42b983;
- }
-
- .el-radio__input.is-checked .el-radio__inner:hover {
- border-color: #42b983;
- }
-
- .el-input__inner {
- border-color: #42b983 !important;
- }
-
+.el-table .custom-row {
+ background: #f8f8fa;
}
+
+.el-form-item__label {
+ font-weight: 400 !important
+}
+
</style>
--
Gitblit v1.9.3