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 |
| | |
| | | </el-form-item> |
| | | <el-form-item v-if="!form.enumSwitch" label="运算符:"> |
| | | <div> |
| | | <el-button size="mini" @click="operationHandler('>')"> > </el-button> |
| | | <el-button size="mini" @click="operationHandler('<')"> < </el-button> |
| | | <el-button size="mini" @click="operationHandler('>=')"> >= </el-button> |
| | | <el-button size="mini" @click="operationHandler('<=')"> <= </el-button> |
| | | <el-button size="mini" @click="operationHandler('=')"> = </el-button> |
| | | <el-button size="mini" @click="operationHandler('!=')"> != </el-button> |
| | | <el-button size="mini" @click="operationHandler('()')"> () </el-button> |
| | | <el-button size="mini" @click="operationHandler('>')"> ></el-button> |
| | | <el-button size="mini" @click="operationHandler('<')"> <</el-button> |
| | | <el-button size="mini" @click="operationHandler('>=')"> >=</el-button> |
| | | <el-button size="mini" @click="operationHandler('<=')"> <=</el-button> |
| | | <el-button size="mini" @click="operationHandler('=')"> =</el-button> |
| | | <el-button size="mini" @click="operationHandler('!=')"> !=</el-button> |
| | | <el-button size="mini" @click="operationHandler('()')"> ()</el-button> |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item :label="form.enumSwitch ? '当前枚举值:' : '当前值域:'" prop="rangeValue"> |
| | |
| | | </el-form-item> |
| | | <el-form-item label="运算符:"> |
| | | <div> |
| | | <el-button size="mini" @click="operationHandler('>')"> > </el-button> |
| | | <el-button size="mini" @click="operationHandler('<')"> < </el-button> |
| | | <el-button size="mini" @click="operationHandler('>=')"> >= </el-button> |
| | | <el-button size="mini" @click="operationHandler('<=')"> <= </el-button> |
| | | <el-button size="mini" @click="operationHandler('=')"> = </el-button> |
| | | <el-button size="mini" @click="operationHandler('!=')"> != </el-button> |
| | | <el-button size="mini" @click="operationHandler('()')"> () </el-button> |
| | | <el-button size="mini" @click="operationHandler('>')"> ></el-button> |
| | | <el-button size="mini" @click="operationHandler('<')"> <</el-button> |
| | | <el-button size="mini" @click="operationHandler('>=')"> >=</el-button> |
| | | <el-button size="mini" @click="operationHandler('<=')"> <=</el-button> |
| | | <el-button size="mini" @click="operationHandler('=')"> =</el-button> |
| | | <el-button size="mini" @click="operationHandler('!=')"> !=</el-button> |
| | | <el-button size="mini" @click="operationHandler('()')"> ()</el-button> |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item :label="form.enumSwitch ? '当前枚举值:' : '当前值域:'" prop="rangeValue"> |
| | | <el-form-item :label="form.enumSwitch ? '当前枚举值:' : '当前值域:'" prop="rangeValue"> |
| | | <textarea v-model="form.rangeValue" |
| | | style="width: 330px; height: 80px; border: 1px solid #DCDFE6; overflow: auto; text-align: left;resize: none;"> |
| | | </textarea> |
| | |
| | | ], |
| | | 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> |
| | | |
| | | <!-- 新增 修改 --> |
| | | <!-- 新增 修改 --> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :title="dialogTitle === 'add' ? '创建' : '修改'" |
| | |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- 导入 --> |
| | | <!-- 导入 --> |
| | | <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="导入" |
| | | @updata="getTreeList"></upload-file> |
| | | |
| | | <!-- 查看使用范围 --> |
| | | <!-- 查看使用范围 --> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :visible.sync="checkViewVisible" |
| | |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | data:[], |
| | | option:{ |
| | | ...basicOption |
| | | }, |
| | | checkViewVisible: false, |
| | | checkViewData: [], |
| | | checkViewDataSearch: [], |
| | |
| | | </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", |
| | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | { |
| | | 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 = []; } |
| | | ); |
| | | }, |
| | | |
| | | // 分配角色 |