| | |
| | | <el-dialog |
| | | v-dialogDrag |
| | | v-loading="statisticsLoading" |
| | | :destroy-on-close="true" |
| | | :visible.sync="statisticsVisible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | |
| | | </avue-crud> |
| | | <div slot="footer" class="dialog-footer" style="display: flex;gap: 20px;justify-content: center"> |
| | | <div> |
| | | <el-tag>当前角色总人数: {{this.countData.length}}</el-tag> |
| | | <el-tag>当前角色总人数: {{ this.countData.length }}</el-tag> |
| | | </div> |
| | | <el-button size="small" @click="statisticsVisible = false" icon="el-icon-close" type="danger">关 闭</el-button> |
| | | <el-button icon="el-icon-close" size="small" type="danger" @click="statisticsVisible = false">关 闭</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | <!-- 导入角色 --> |
| | | <upload-file ref="upload" :tipList="tipList" :fileType="upFileType" :fileUrl="fileUrl" @updata="getTableList" title="导入角色"></upload-file> |
| | | <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="导入角色" |
| | | @updata="getTableList"></upload-file> |
| | | |
| | | </basic-container> |
| | | </template> |
| | |
| | | } from '@/api/system/role/api' |
| | | import basicOption from "@/util/basic-option"; |
| | | import {column} from "@/views/system/role/option"; |
| | | import func from "@/util/func"; |
| | | |
| | | export default { |
| | | name: "index", |
| | |
| | | ...basicOption, |
| | | dialogTop: 0, |
| | | dialogWidth: '30%', |
| | | column: column, |
| | | calcHeight: -60, |
| | | column: column |
| | | }, |
| | | page: { |
| | | currentPage: 1, |
| | |
| | | countData: [], |
| | | countOption: { |
| | | ...basicOption, |
| | | selection:false, |
| | | selection: false, |
| | | refreshBtn: false, |
| | | addBtn:false, |
| | | menu:false, |
| | | addBtn: false, |
| | | menu: false, |
| | | column: [ |
| | | { |
| | | label: '部门', |
| | |
| | | }, |
| | | upFileType: ['xls', 'xlsx'], |
| | | fileUrl: 'api/roleQueryController/importRole', |
| | | tipList:["角色导入只有 名称 和 描述 两列,且名称为必输项不能为空"] |
| | | tipList: ["角色导入只有 名称 和 描述 两列,且名称为必输项不能为空"] |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | |
| | | // 行单选 |
| | | rowClickHandler(row) { |
| | | this.$refs.roleCrud.toggleRowSelection(row); |
| | | func.rowClickHandler( |
| | | row, |
| | | this.$refs.roleCrud, |
| | | this.lastIndex, |
| | | (newIndex) => { this.lastIndex = newIndex; }, |
| | | () => { this.selectList = []; } |
| | | ); |
| | | }, |
| | | |
| | | // 添加 |
| | | rowSaveHandler(row, done,loading) { |
| | | rowSaveHandler(row, done, loading) { |
| | | delete row.roleClassifyText; |
| | | addRole(row).then(res => { |
| | | console.log(res) |
| | |
| | | this.getTableList(); |
| | | done(); |
| | | } |
| | | }).catch(err =>{ |
| | | }).catch(err => { |
| | | console.log(err); |
| | | loading(); |
| | | }) |
| | | }, |
| | | |
| | | // 编辑 |
| | | rowUpdateHandler(row, index, done,loading) { |
| | | rowUpdateHandler(row, index, done, loading) { |
| | | delete row.roleClassifyText; |
| | | updateRole(row).then(res => { |
| | | if (res.data.code === 200) { |
| | |
| | | this.countData = data.map(item => { |
| | | return { |
| | | pkDepartmentName: item.pkDepartmentName, |
| | | name:item.name, |
| | | id:item.id, |
| | | pkPersonName:this.selectList[0].name |
| | | name: item.name, |
| | | id: item.id, |
| | | pkPersonName: this.selectList[0].name |
| | | } |
| | | }); |
| | | this.statisticsVisible = true; |
| | |
| | | }, |
| | | |
| | | // 导入角色 |
| | | upLoadRole(){ |
| | | upLoadRole() { |
| | | this.$refs.upload.visible = true; |
| | | } |
| | | } |