| | |
| | | <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> |
| | |
| | | |
| | | <div class="elTableDiv"> |
| | | <el-table |
| | | ref="tableDataRef" |
| | | :data="tableData" |
| | | class="tableFixed" |
| | | border |
| | | :row-class-name="tableRowClassName" |
| | | :height="tableHeight+'px'" |
| | |
| | | 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> |
| | |
| | | <input |
| | | class="myCheckboxInput" |
| | | type="checkbox" |
| | | :disabled="rightFrom.usercode==='S001'" |
| | | :value="item.code" |
| | | :name="item.name" |
| | | :style="{color:item.isSelected2?'#42b983':'#fff'}" |
| | |
| | | } 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, |
| | |
| | | operation: '', |
| | | dialogFormRules: { |
| | | RoleCode: [ |
| | | { required: true, validator: validateName, trigger: ['blur', 'change'] } |
| | | { required: true, validator: validateCode, trigger: ['blur', 'change'] } |
| | | ], |
| | | RoleName: [ |
| | | { required: true, message: '请输入名称', trigger: ['blur', 'change'] } |
| | |
| | | }, |
| | | // 修改按钮 |
| | | edit(operation, row) { |
| | | if (row.role_code === 'S001') { |
| | | return this.$message.info('此角色无法操作!') |
| | | } |
| | | |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | |
| | |
| | | }, |
| | | // 删除按钮 |
| | | del(row) { |
| | | if (row.role_code === 'S001') { |
| | | return this.$message.info('此角色无法操作!') |
| | | } |
| | | this.$confirm('是否确认删除?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | |
| | | // 获取页面高度 |
| | | 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 }) { |
| | |
| | | |
| | | /* 关联用户模块*/ |
| | | 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 |
| | |
| | | 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) |
| | |
| | | } |
| | | 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 |
| | | } |
| | | } |
| | | |
| | | // 树形回显部分 |
| | |
| | | margin-bottom: 0; |
| | | } |
| | | |
| | | .tableFixed{ |
| | | ::v-deep .el-table__fixed-right{ |
| | | height: 100% !important; |
| | | } |
| | | ::v-deep .el-table__fixed{ |
| | | height: 100% !important; |
| | | } |
| | | } |
| | | </style> |
| | | <style> |
| | | |