| | |
| | | <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>--> |
| | | <el-button type="primary" icon="el-icon-upload2" @click="upload">导入</el-button> |
| | | </div> |
| | | <el-divider /> |
| | | <div class="elTableDiv"> |
| | | <el-table |
| | | :data="tableData" |
| | | border |
| | | |
| | | stripe |
| | | :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" |
| | |
| | | prop="RowNum" |
| | | width="50" |
| | | label="序号" |
| | | fixed |
| | | /> |
| | | <el-table-column |
| | | prop="role_code" |
| | | label="角色编码" |
| | | sortable="custom" |
| | | min-width="110" |
| | | /> |
| | | <el-table-column |
| | | prop="role_name" |
| | | label="角色名称" |
| | | sortable="custom" |
| | | min-width="110" |
| | | /> |
| | | <el-table-column |
| | | prop="roletype_name" |
| | | label="角色类型" |
| | | sortable="custom" |
| | | min-width="110" |
| | | /> |
| | | <el-table-column |
| | | prop="description" |
| | | min-width="160" |
| | | label="角色描述" |
| | | sortable="custom" |
| | | /> |
| | |
| | | prop="lm_user" |
| | | label="创建人员" |
| | | sortable="custom" |
| | | width="110" |
| | | /> |
| | | <el-table-column |
| | | prop="lm_date" |
| | | label="创建时间" |
| | | min-width="160" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | |
| | | > |
| | | <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: #E4E7ED" @click="userClick(row)" /> |
| | | <i v-if="row.is_user==='N'" class="el-icon-user-solid" style="color: rgb(180 ,181, 185)" @click="userClick(row)" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | |
| | | > |
| | | <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: #E4E7ED" @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-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" |
| | |
| | | <div style="display: flex;min-height: 50px"> |
| | | <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 |
| | |
| | | :append-to-body="false" |
| | | :options="StuOrgArr" |
| | | :props="defaultProps" |
| | | style="width: 200px;" |
| | | :style="{width:isIpad? '180px':'200px'}" |
| | | |
| | | @change="dialogCascaderChange" |
| | | /> |
| | |
| | | v-model="dialogFormUser.isrole" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | style="width: 200px" |
| | | :style="{width:isIpad? '180px':'200px'}" |
| | | placeholder="请选择" |
| | | > |
| | | <el-option |
| | |
| | | :data="dialogFormUserTable" |
| | | border |
| | | highlight-current-row |
| | | height="300" |
| | | height="370" |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | :row-key="getRowKey" |
| | |
| | | :visible.sync="dialogVisibleRight" |
| | | width="800px" |
| | | top="15vh" |
| | | :fullscreen="isFullscreen" |
| | | :fullscreen="isIpad" |
| | | :close-on-click-modal="false" |
| | | class="dialogVisibleRight" |
| | | @closed="handleCloseRight" |
| | |
| | | </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 { |
| | | AddUpdateRole, |
| | | DeleteRole, RoleAssociationRight, |
| | |
| | | export default { |
| | | name: 'JSQD', |
| | | components: { |
| | | Pagination |
| | | Pagination, ImportPicker |
| | | }, |
| | | data() { |
| | | const validateName = (rule, value, callback) => { |
| | |
| | | } |
| | | } |
| | | } |
| | | // const validateTypeCode = (rule, value, callback) => { |
| | | // if (!value) { |
| | | // return callback(new Error('请选择上级')) |
| | | // } else { |
| | | // callback() |
| | | // } |
| | | // } |
| | | return { |
| | | isFullscreen: false, |
| | | isIpad: false, |
| | | mainHeight: 0, |
| | | tableHeight: 0, |
| | | form: { |
| | |
| | | value: 'code' |
| | | }, |
| | | PCTrue: false, // 是否展示 |
| | | APPTrue: false// 是否展示 |
| | | APPTrue: false, // 是否展示 |
| | | |
| | | title_value: '数据导入 / 角色清单', |
| | | code: '1', |
| | | shows: false |
| | | } |
| | | }, |
| | | watch: { |
| | | shows() { |
| | | if (!this.shows) { |
| | | this.getRoleSearch() |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.getRoleSearch() |
| | | this.getRoleTypeSearch2() |
| | | this.getUserOrganization() |
| | | this.handleRequest() |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | methods: { |
| | | handleRequest() { |
| | | this.getRoleSearch().then(res => { |
| | | if (res.code === '200') { |
| | | this.getRoleTypeSearch2() |
| | | this.getUserOrganization() |
| | | } |
| | | }) |
| | | }, |
| | | // 获取角色清单 |
| | | async getRoleSearch() { |
| | | const res = await RoleSearch(this.form) |
| | | this.tableData = res.data |
| | | this.total = res.count |
| | | return { code: res.code } |
| | | }, |
| | | // 获取用户类型 |
| | | async getRoleTypeSearch() { |
| | |
| | | this.formSetting.order = order |
| | | this.formSetting.prop = prop |
| | | this.getRoleTypeSearch() |
| | | }, |
| | | |
| | | upload() { |
| | | |
| | | }, |
| | | // 查询 |
| | | search() { |
| | |
| | | // 获取页面高度 |
| | | 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.tableHeight = this.mainHeight - 50 |
| | | if (window.innerHeight < 769) { |
| | | this.tableHeight = this.tableHeight - 50 |
| | | } |
| | | |
| | | this.isIpad = window.innerHeight < 769 && window.innerWidth < 1367 |
| | | }) |
| | | }, |
| | | /* 设置模块*/ |
| | |
| | | type: '' |
| | | } |
| | | const { data: res } = await RoleAssociationRight(data)// 接口获取数据 |
| | | // '0'显示 '1' 不显示 |
| | | |
| | | 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' |
| | | |
| | | // '0'显示 '1' 不显示 过滤出相对应的菜单 |
| | | if (this.PCTrue) { |
| | | this.dialogFormRight.rightPCArr[0].children.forEach((item, index) => { |
| | | if (item.is_delete === '1') { |
| | | this.dialogFormRight.rightPCArr[0].children.splice(index, 1) |
| | | } else { |
| | | if (item.children.length > 0 && item.children) { |
| | | item.children.forEach((it, ind) => { |
| | | console.log(it, 9) |
| | | console.log(it.is_delete, 9) |
| | | if (it.is_delete === '1') { |
| | | item.children.splice(ind, 1) |
| | | } |
| | | }) |
| | | } |
| | | if (item.children.length === 0) { |
| | | this.dialogFormRight.rightPCArr[0].children.splice(index, 1) |
| | | } |
| | | } |
| | | 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.APPTrue) { |
| | | this.dialogFormRight.rightAPPArr[0].children.forEach((item, index) => { |
| | | if (item.is_delete === '1') { |
| | | this.dialogFormRight.rightAPPArr[0].children.splice(index, 1) |
| | | } else { |
| | | if (item.children.length > 0 && item.children) { |
| | | item.children.forEach((it, ind) => { |
| | | if (it.is_delete === '1') { |
| | | item.children.splice(ind, 1) |
| | | } |
| | | }) |
| | | } |
| | | if (item.children.length === 0) { |
| | | this.dialogFormRight.rightAPPArr[0].children.splice(index, 1) |
| | | } |
| | | } |
| | | this.dialogFormRight.rightAPPArr[0].children = this.dialogFormRight.rightAPPArr[0].children.filter(item => item.is_delete === '0') |
| | | this.dialogFormRight.rightAPPArr[0].children.forEach(item => { |
| | | item.children = item.children.filter(it => it.is_delete === '0') |
| | | }) |
| | | } |
| | | |
| | |
| | | this.dialogFormRight.rightAPPArrSelected = ['APP'] |
| | | } |
| | | } |
| | | }, |
| | | // 导入按钮 |
| | | upload() { |
| | | this.shows = true |
| | | this.$refs.importPickerFunc.newDataFunc() |
| | | }, |
| | | colos() { |
| | | this.shows = false |
| | | } |
| | | |
| | | } |