1、列表普遍存在一个问题,如果点击列表行(不是checkbox),应该选中点击行,checkbox选中,其他行的checkbox取消,如果点击行的checkbox,则其他行的checkbox不变,当前点击行的checkbox选中状态切换。
2、部门管理单元格设置为左对齐
| | |
| | | import CryptoJS from 'crypto-js' |
| | | |
| | | export default class func { |
| | | |
| | | /** |
| | | * 单选表格行 |
| | | * row 当前行数据 |
| | | * CrudRef 表格ref绑定值 |
| | | * lastIndex 判断二次点击index是否和第一次点击一致 |
| | | * setLastIndex 更新lastIndex值 |
| | | * setSelectList 将下拉框保存数组置空 |
| | | */ |
| | | |
| | | static rowClickHandler(row, CrudRef, lastIndex, setLastIndex, setSelectList) { |
| | | if (lastIndex === row.$index) { |
| | | setSelectList(); |
| | | CrudRef.clearSelection(); |
| | | } else { |
| | | setSelectList(); |
| | | CrudRef.clearSelection(); |
| | | CrudRef.toggleRowSelection(row); |
| | | } |
| | | |
| | | setLastIndex(row.$index); |
| | | } |
| | | |
| | | /** |
| | | * 不为空 |
| | | * @param val |
| | |
| | | ], |
| | | upFileType: ['xls', 'xlsx'], |
| | | fileUrl: 'api/attributeController/importAttributes', |
| | | lastIndex: null |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | |
| | | // 点击行 |
| | | rowClickHandler(row) { |
| | | this.$refs.userCrud.toggleRowSelection(row); |
| | | func.rowClickHandler( |
| | | row, |
| | | this.$refs.userCrud, |
| | | this.lastIndex, |
| | | (newIndex) => { this.lastIndex = newIndex; }, |
| | | () => { this.selectList = []; } |
| | | ); |
| | | }, |
| | | |
| | | // 条数 |
| | |
| | | { |
| | | label: '描述', |
| | | prop: 'description', |
| | | overHidden:true, |
| | | }, |
| | | ]; |
| | |
| | | }, |
| | | tableLoading: false, |
| | | selectList: [], |
| | | searchParams: {} |
| | | searchParams: {}, |
| | | lastIndex: null |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | |
| | | // 选择框 |
| | | selectChange(row) { |
| | | console.log(row) |
| | | this.selectList = row; |
| | | }, |
| | | |
| | | // 点击行 |
| | | rowClickHandler(row) { |
| | | this.$refs.userCrud.toggleRowSelection(row); |
| | | func.rowClickHandler( |
| | | row, |
| | | this.$refs.userCrud, |
| | | this.lastIndex, |
| | | (newIndex) => { this.lastIndex = newIndex; }, |
| | | () => { this.selectList = []; } |
| | | ); |
| | | }, |
| | | |
| | | // 关闭对话框 |
| | |
| | | </el-button> |
| | | <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">导入 |
| | | </el-button> |
| | | <el-button class="smallBtn" style="padding-left: 7px !important;" icon="el-icon-circle-plus-outline" plain size="small" |
| | | <el-button class="smallBtn" icon="el-icon-circle-plus-outline" plain size="small" |
| | | style="padding-left: 7px !important;" |
| | | type="primary" @click="createViewClickHandler">创建视图 |
| | | </el-button> |
| | | <el-button class="smallBtn" icon="el-icon-menu" plain size="small" style="padding-left: 1px" |
| | |
| | | main: 'el-icon-warning-outline', |
| | | desc: 'el-icon-chat-line-square' |
| | | }, |
| | | bizLastIndex: null, |
| | | attrLastIndex:null |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | |
| | | // 添加属性池 行点击 |
| | | dialogAttrRowClickHandler(row) { |
| | | this.$refs.dialogAttrCrud.toggleRowSelection(row); |
| | | |
| | | func.rowClickHandler( |
| | | row, |
| | | this.$refs.dialogAttrCrud, |
| | | this.attrLastIndex, |
| | | (newIndex) => { this.attrLastIndex = newIndex; }, |
| | | () => { this.selectList = []; } |
| | | ); |
| | | }, |
| | | |
| | | // 添加属性池 关闭对话框 |
| | |
| | | |
| | | // form to 类型行点击 |
| | | bizTypeRowClick(row) { |
| | | this.$refs.bizTypeCrud.toggleRowSelection(row); |
| | | func.rowClickHandler( |
| | | row, |
| | | this.$refs.bizTypeCrud, |
| | | this.bizLastIndex, |
| | | (newIndex) => { this.bizLastIndex = newIndex; }, |
| | | () => { this.selectList = []; } |
| | | ); |
| | | }, |
| | | |
| | | // form to 类型保存 |
| | |
| | | <el-tag v-if="nodeRow.description">{{ nodeRow.description }}</el-tag> |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | <!-- <avue-crud>--> |
| | | <!-- :data="data"--> |
| | | <!-- :option="option"--> |
| | | <!-- </avue-crud>--> |
| | | </basic-container> |
| | | </el-main> |
| | | |
| | |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | data:[], |
| | | option:{ |
| | | ...basicOption |
| | | }, |
| | | checkViewVisible: false, |
| | | checkViewData: [], |
| | | checkViewDataSearch: [], |
| | |
| | | <div> |
| | | <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", |
| | |
| | | |
| | | // 行单选 |
| | | rowClickHandler(row) { |
| | | this.$refs.roleCrud.toggleRowSelection(row); |
| | | func.rowClickHandler( |
| | | row, |
| | | this.$refs.roleCrud, |
| | | this.lastIndex, |
| | | (newIndex) => { this.lastIndex = newIndex; }, |
| | | () => { this.selectList = []; } |
| | | ); |
| | | }, |
| | | |
| | | // 添加 |
| | |
| | | { |
| | | label: '名称', |
| | | prop: 'name', |
| | | align:'left' |
| | | }, |
| | | { |
| | | label: '编号', |
| | |
| | | leftRoleData: [], // 分配角色穿梭框左侧初始数据 |
| | | rightRoleData: [], // 分配角色穿梭框右侧初始数据 |
| | | transferTitle: ['现有角色', '拥有角色'], |
| | | tipList:["导入模板中标明红色字体的为必输项","部门列上下级关系必须按照反斜杠隔开(/)"] |
| | | tipList:["导入模板中标明红色字体的为必输项","部门列上下级关系必须按照反斜杠隔开(/)"], |
| | | lastIndex:null, |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | |
| | | // 点击行 |
| | | rowClickHandler(row) { |
| | | this.$refs.userCrud.toggleRowSelection(row); |
| | | func.rowClickHandler( |
| | | row, |
| | | this.$refs.userCrud, |
| | | this.lastIndex, |
| | | (newIndex) => { this.lastIndex = newIndex; }, |
| | | () => { this.selectList = []; } |
| | | ); |
| | | }, |
| | | |
| | | // 分配角色 |