From bbb03ff09f77e4ece3dfcf80df855829399528ae Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 27 九月 2022 16:21:43 +0800
Subject: [PATCH] 1.新增cookie参数 rediskey
---
src/views/jcsz/jsqd.vue | 174 +++++++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 136 insertions(+), 38 deletions(-)
diff --git a/src/views/jcsz/jsqd.vue b/src/views/jcsz/jsqd.vue
index 4caa124..490040f 100644
--- a/src/views/jcsz/jsqd.vue
+++ b/src/views/jcsz/jsqd.vue
@@ -2,10 +2,13 @@
<div>
<div class="body" :style="{height:mainHeight+'px'}">
- <div class="bodyTopButtonGroup">
+ <div class="bodyTopButtonGroup" style="justify-content: space-between">
<el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
- <el-button icon="el-icon-setting" @click="settingButton">璁剧疆</el-button>
- <el-button icon="el-icon-download" @click="upload">瀵煎叆</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">
@@ -44,7 +47,7 @@
<el-input v-model="form.UserName" style="width: 200px" placeholder="璇疯緭鍏�" />
</el-form-item>
</div>
- <div style="display: flex;align-items: start;margin-top: 5px;">
+ <div class="bodySearchReset">
<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>
@@ -53,7 +56,9 @@
<div class="elTableDiv">
<el-table
+ ref="tableDataRef"
:data="tableData"
+ class="tableFixed"
border
:row-class-name="tableRowClassName"
:height="tableHeight+'px'"
@@ -97,7 +102,13 @@
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="鍒涘缓浜哄憳"
@@ -122,8 +133,18 @@
sortable="custom"
>
<template slot-scope="{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)" />
+ <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
@@ -134,7 +155,12 @@
>
<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
@@ -253,7 +279,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>
@@ -379,12 +405,12 @@
ref="multipleTable"
:data="dialogFormUserTable"
border
+ :row-class-name="tableRowClassName"
highlight-current-row
:height="isIpad?400:365"
:header-cell-style="this.$headerCellStyle"
:cell-style="this.$cellStyle"
:row-key="getRowKey"
- :row-class-name="tableRowClassName"
@sort-change="sortChangeOfUser"
@selection-change="handleSelectionChange"
>
@@ -394,6 +420,7 @@
type="selection"
width="50"
:reserve-selection="true"
+ fixed
/>
<el-table-column
prop="RowNum"
@@ -419,10 +446,17 @@
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>
@@ -477,6 +511,7 @@
<input
class="myCheckboxInput"
type="checkbox"
+ :disabled="rightFrom.usercode==='S001'"
:value="item.code"
:name="item.name"
:style="{color:item.isSelected2?'#42b983':'#fff'}"
@@ -525,7 +560,14 @@
</el-dialog>
<!--瀵煎叆缁勪欢-->
- <import-picker ref="importPickerFunc" class="importPickerClass" :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>
@@ -542,26 +584,14 @@
} 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 {
isIpad: false,
mainHeight: 0,
@@ -598,7 +628,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'] }
@@ -765,6 +795,10 @@
},
// 淇敼鎸夐挳
edit(operation, row) {
+ if (row.role_code === 'S001') {
+ return this.$message.info('姝よ鑹叉棤娉曟搷浣滐紒')
+ }
+
this.operation = operation
this.dialogVisible = true
@@ -779,6 +813,9 @@
},
// 鍒犻櫎鎸夐挳
del(row) {
+ if (row.role_code === 'S001') {
+ return this.$message.info('姝よ鑹叉棤娉曟搷浣滐紒')
+ }
this.$confirm('鏄惁纭鍒犻櫎?', '鎻愮ず', {
confirmButtonText: '纭畾',
cancelButtonText: '鍙栨秷',
@@ -787,6 +824,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()
}
})
@@ -835,12 +875,14 @@
// 鑾峰彇椤甸潰楂樺害
getHeight() {
this.$nextTick(() => {
+ this.$refs.tableDataRef.doLayout()
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
+ this.$refs.tableDataRef.doLayout()
})
},
tableRowClassName({ row, rowIndex }) {
@@ -880,6 +922,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()
}
})
@@ -916,6 +961,9 @@
/* 鍏宠仈鐢ㄦ埛妯″潡*/
userClick(row) {
+ if (row.role_code === 'S001') {
+ return this.$message.info('姝よ鑹叉棤娉曟搷浣滐紒')
+ }
this.userDialogVisible = true
this.userForm.roleName = row.role_name
this.dialogFormUser.rolecode = row.role_code
@@ -1028,20 +1076,47 @@
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')
this.dialogFormRight.rightPCArr[0].children.forEach(item => {
item.children = item.children.filter(it => it.is_delete === '0')
+
+ if (this.rightFrom.usercode === 'S001') { // Admin绯荤粺绠$悊鍛樿彍鍗曞仛鍒板彧澧炰笉鍑�
+ if (item.flag === 'Y') {
+ item.disabled = true
+ }
+ if (item.children && item.children.length > 0) {
+ item.children.forEach(it => {
+ if (it.flag === 'Y') {
+ it.disabled = true
+ }
+ })
+ }
+ }
})
}
if (this.APPTrue) {
- this.dialogFormRight.rightAPPArr[0].children = this.dialogFormRight.rightAPPArr[0].children.filter(item => item.is_delete === '0' || it.is_delete === null)
+ 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' || it.is_delete === null)
// item.children = item.children.filter(it => it.is_delete !== '1')
+
+ if (this.rightFrom.usercode === 'S001') { // Admin绯荤粺绠$悊鍛樿彍鍗曞仛鍒板彧澧炰笉鍑�
+ if (item.flag === 'Y') {
+ item.disabled = true
+ }
+ if (item.children && item.children.length > 0) {
+ item.children.forEach(it => {
+ if (it.flag === 'Y') {
+ it.disabled = true
+ }
+ })
+ }
+ }
})
}
// console.log(this.dialogFormRight.rightAPPArr[0], 234)
@@ -1132,9 +1207,9 @@
// 鐩墠涓�鏈熻偗瀹氭槸杩欎釜
if (this.PCTrue && !this.APPTrue) {
- pcIsSelected1 = true
+ // pcIsSelected1 = true
if (rightPCArrFlag === 'Y') {
- // pcIsSelected1 = true
+ pcIsSelected1 = true
pcIsSelected2 = true
const interval = setInterval(() => {
@@ -1149,9 +1224,9 @@
}
}, 100)
- // this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightPCArr[0].code
+ this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightPCArr[0].code
}
- this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightPCArr[0].code
+ // this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightPCArr[0].code
}
if (!this.PCTrue && this.APPTrue) {
@@ -1195,9 +1270,15 @@
}
if (this.PCTrue) {
this.dialogFormRight.rightPCArr[0].name = '鍏ㄩ儴'
+ if (this.rightFrom.usercode === 'S001') { // Admin绯荤粺绠$悊鍛樿彍鍗曞仛鍒板彧澧炰笉鍑�
+ this.dialogFormRight.rightPCArr[0].disabled = true
+ }
}
if (this.APPTrue) {
this.dialogFormRight.rightAPPArr[0].name = '鍏ㄩ儴'
+ if (this.rightFrom.usercode === 'S001') { // Admin绯荤粺绠$悊鍛樿彍鍗曞仛鍒板彧澧炰笉鍑�
+ this.dialogFormRight.rightAPPArr[0].disabled = true
+ }
}
// 鏍戝舰鍥炴樉閮ㄥ垎
@@ -1495,6 +1576,7 @@
::v-deep .el-dialog__body {
padding: 20px 100px !important;
}
+
.settingDialogVisible, .userDialogVisible, .dialogVisibleRight {
::v-deep .el-dialog__body {
padding: 10px 20px !important;
@@ -1566,11 +1648,16 @@
<!--鍏叡椤甸潰鏍峰紡-->
<style lang="scss" scoped>
$main_color: #42b983;
-.el-icon-share ,.el-icon-delete,.el-icon-edit-outline{
+::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;
}
-.el-icon-edit-outline{
+
+.el-icon-edit-outline {
margin-right: 15px;
}
@@ -1631,8 +1718,8 @@
background-color: #f8f8fa;
}
-::v-deep .el-table__body .el-table__row.hover-row td{
- background-color: #eaecef ;
+::v-deep .el-table__body .el-table__row.hover-row td {
+ background-color: #eaecef;
}
::v-deep .el-form--inline .el-form-item__label {
@@ -1648,17 +1735,28 @@
.body ::v-deep .el-form-item {
margin-bottom: 0;
}
+
.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>
.el-table .custom-row {
background: #f8f8fa;
}
-.el-form-item__label{
+
+.el-form-item__label {
font-weight: 400 !important
}
+
</style>
--
Gitblit v1.9.3