| | |
| | | type="text" |
| | | size="small" |
| | | icon="el-icon-edit" |
| | | v-if="permissionList.editBtn" |
| | | @click="handleEdit(row, index)" |
| | | > |
| | | 编辑 |
| | |
| | | type="text" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | v-if="permissionList.delBtn" |
| | | @click="handleDel(row, index)" |
| | | > |
| | | 删除 |
| | |
| | | getremove, |
| | | combination |
| | | } from "@/api/system/passwords"; |
| | | import {mapGetters} from "vuex"; |
| | | export default { |
| | | name: "passwords.vue", |
| | | data() { |
| | |
| | | total: 100 |
| | | }, |
| | | data: [], |
| | | option: { |
| | | headerAlign: 'center', |
| | | align: 'center', |
| | | border: true, |
| | | index: true, |
| | | rowKey:'id', |
| | | editBtn:false, |
| | | height:700, |
| | | delBtn:false, |
| | | column: [ |
| | | { |
| | | label: '策略名称', |
| | | prop: 'strategyName', |
| | | align: 'left', |
| | | span:24, |
| | | labelWidth: "11%", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入策略名称", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: '密码最小长度', |
| | | prop: 'minPwdLen', |
| | | span:12, |
| | | labelWidth:"22%", |
| | | rules: [{ |
| | | required: true, |
| | | validator:validatePass, |
| | | trigger: 'blur' |
| | | }] |
| | | }, |
| | | { |
| | | label: '密码最大长度', |
| | | prop: 'maxPwdLen', |
| | | span:12, |
| | | labelWidth:"25%", |
| | | rules: [{ |
| | | required: true, |
| | | validator:validatePass1, |
| | | trigger: 'change' |
| | | }] |
| | | }, |
| | | { |
| | | label: '组合方法', |
| | | prop: 'combinationNames', |
| | | labelWidth: 91, |
| | | display:false, |
| | | |
| | | }, |
| | | { |
| | | label: '组合方法', |
| | | prop: 'combinationIds', |
| | | type: "checkbox", |
| | | span:12, |
| | | labelWidth:"22%", |
| | | id:5, |
| | | hide:true, |
| | | change:this.handleCheckboxChange, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择组合方法", |
| | | trigger: "blur" |
| | | }], |
| | | dicUrl: '/api/ubcs-system/combination/select', |
| | | dicMethod: 'get', |
| | | props: { |
| | | value: "ID", |
| | | label: "NAME", |
| | | }, |
| | | }, |
| | | { |
| | | label: '必填种类', |
| | | prop: 'requiredType', |
| | | type: 'select', |
| | | span:12, |
| | | labelWidth:"25%", |
| | | change:this.handleSelectChange, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择必填种类", |
| | | trigger: "blur" |
| | | }], |
| | | dicData:[{ |
| | | label:'1种', |
| | | value:1, |
| | | disabled:false |
| | | }, |
| | | { |
| | | label:'2种', |
| | | value:2, |
| | | disabled:false |
| | | }, |
| | | { |
| | | label:'3种', |
| | | value:3, |
| | | disabled:false |
| | | }, |
| | | { |
| | | label:'4种', |
| | | value:4, |
| | | disabled:false |
| | | } |
| | | ] |
| | | |
| | | }, |
| | | { |
| | | label: '过期时间(天)', |
| | | prop:'expirationTime', |
| | | span:12, |
| | | labelWidth:"22%", |
| | | rules: [{ |
| | | required: true, |
| | | validator:validatePass2, |
| | | trigger: 'blur' |
| | | }] |
| | | }, |
| | | { |
| | | label: '提醒时间(天)', |
| | | prop:'reminderTime', |
| | | span:12, |
| | | labelWidth:"25%", |
| | | rules: [{ |
| | | required: true, |
| | | validator:validatePass3, |
| | | trigger: 'blur' |
| | | }] |
| | | }, |
| | | { |
| | | label: '锁定次数(次)', |
| | | prop:'lockingNum', |
| | | span:12, |
| | | labelWidth:"22%", |
| | | rules: [{ |
| | | required: true, |
| | | validator:validatePass4, |
| | | trigger: 'blur' |
| | | }] |
| | | }, |
| | | { |
| | | label: '锁定时间(分钟)', |
| | | prop:'lockingTime', |
| | | span:12, |
| | | labelWidth:"25%", |
| | | rules: [{ |
| | | required: true, |
| | | validator:validatePass5, |
| | | trigger: 'blur' |
| | | }] |
| | | }, |
| | | { |
| | | label: '描述', |
| | | prop:'desc', |
| | | type: 'textarea', |
| | | span:12, |
| | | labelWidth:"22%", |
| | | rows: 5, |
| | | }, |
| | | { |
| | | label: '是否为默认策略', |
| | | prop: 'isDefault', |
| | | type: 'switch', |
| | | labelWidth: 132, |
| | | dicData:[{ |
| | | label:'否', |
| | | value:0 |
| | | },{ |
| | | label:'是', |
| | | value:1 |
| | | }] |
| | | } |
| | | ], |
| | | }, |
| | | //添加存放多选的变量,用于下拉菜单的禁用效果和必填种类是否大于组合方式然后提示用户重新选择 |
| | | checkboxlength:"", |
| | | //这个是下拉菜单的数据变量 |
| | |
| | | } |
| | | |
| | | }, |
| | | computed:{ |
| | | ...mapGetters(["permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.password.password_add, false), |
| | | //viewBtn: this.vaildData(this.permission.password.user_view, false), |
| | | delBtn: this.vaildData(this.permission.password.password_delete, false), |
| | | editBtn: this.vaildData(this.permission.password.password_edit, false), |
| | | }; |
| | | }, |
| | | platformPermissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.password.password_add, false), |
| | | //viewBtn: this.vaildData(this.permission.password.user_view, false), |
| | | delBtn: this.vaildData(this.permission.password.password_delete, false), |
| | | editBtn: this.vaildData(this.permission.password.password_edit, false), |
| | | }; |
| | | }, |
| | | option(){ |
| | | return{ |
| | | headerAlign: 'center', |
| | | align: 'center', |
| | | columnBtn:false, |
| | | border: true, |
| | | index: true, |
| | | rowKey:'id', |
| | | addBtn:this.permissionList.addBtn, |
| | | editBtn:false, |
| | | height:700, |
| | | delBtn:false, |
| | | column: [ |
| | | { |
| | | label: '策略名称', |
| | | prop: 'strategyName', |
| | | align: 'left', |
| | | span:24, |
| | | labelWidth: "11%", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入策略名称", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: '密码最小长度', |
| | | prop: 'minPwdLen', |
| | | span:12, |
| | | labelWidth:"22%", |
| | | rules: [{ |
| | | required: true, |
| | | validator:this.validatePass, |
| | | trigger: 'blur' |
| | | }] |
| | | }, |
| | | { |
| | | label: '密码最大长度', |
| | | prop: 'maxPwdLen', |
| | | span:12, |
| | | labelWidth:"25%", |
| | | rules: [{ |
| | | required: true, |
| | | validator:this.validatePass1, |
| | | trigger: 'change' |
| | | }] |
| | | }, |
| | | { |
| | | label: '组合方法', |
| | | prop: 'combinationNames', |
| | | labelWidth: 91, |
| | | display:false, |
| | | |
| | | }, |
| | | { |
| | | label: '组合方法', |
| | | prop: 'combinationIds', |
| | | type: "checkbox", |
| | | span:12, |
| | | labelWidth:"22%", |
| | | id:5, |
| | | hide:true, |
| | | change: this.handleCheckboxChange, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择组合方法", |
| | | trigger: "blur" |
| | | }], |
| | | dicUrl: '/api/ubcs-system/combination/select', |
| | | dicMethod: 'get', |
| | | props: { |
| | | value: "ID", |
| | | label: "NAME", |
| | | }, |
| | | }, |
| | | { |
| | | label: '必填种类', |
| | | prop: 'requiredType', |
| | | type: 'select', |
| | | span:12, |
| | | labelWidth:"25%", |
| | | change:this.handleSelectChange, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择必填种类", |
| | | trigger: "blur" |
| | | }], |
| | | dicData:[{ |
| | | label:'1种', |
| | | value:1, |
| | | disabled:false |
| | | }, |
| | | { |
| | | label:'2种', |
| | | value:2, |
| | | disabled:false |
| | | }, |
| | | { |
| | | label:'3种', |
| | | value:3, |
| | | disabled:false |
| | | }, |
| | | { |
| | | label:'4种', |
| | | value:4, |
| | | disabled:false |
| | | } |
| | | ] |
| | | |
| | | }, |
| | | { |
| | | label: '过期时间(天)', |
| | | prop:'expirationTime', |
| | | span:12, |
| | | labelWidth:"22%", |
| | | rules: [{ |
| | | required: true, |
| | | validator:this.validatePass2, |
| | | trigger: 'blur' |
| | | }] |
| | | }, |
| | | { |
| | | label: '提醒时间(天)', |
| | | prop:'reminderTime', |
| | | span:12, |
| | | labelWidth:"25%", |
| | | rules: [{ |
| | | required: true, |
| | | validator:this.validatePass3, |
| | | trigger: 'blur' |
| | | }] |
| | | }, |
| | | { |
| | | label: '锁定次数(次)', |
| | | prop:'lockingNum', |
| | | span:12, |
| | | labelWidth:"22%", |
| | | rules: [{ |
| | | required: true, |
| | | validator:this.validatePass4, |
| | | trigger: 'blur' |
| | | }] |
| | | }, |
| | | { |
| | | label: '锁定时间(分钟)', |
| | | prop:'lockingTime', |
| | | span:12, |
| | | labelWidth:"25%", |
| | | rules: [{ |
| | | required: true, |
| | | validator:this.validatePass5, |
| | | trigger: 'blur' |
| | | }] |
| | | }, |
| | | { |
| | | label: '描述', |
| | | prop:'desc', |
| | | type: 'textarea', |
| | | span:12, |
| | | labelWidth:"22%", |
| | | rows: 5, |
| | | }, |
| | | { |
| | | label: '是否为默认策略', |
| | | prop: 'isDefault', |
| | | type: 'switch', |
| | | labelWidth: 132, |
| | | dicData:[{ |
| | | label:'否', |
| | | value:0 |
| | | },{ |
| | | label:'是', |
| | | value:1 |
| | | }] |
| | | } |
| | | ], |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.onLoad() |
| | | combination().then(res=>{ |
| | | console.log("111",res) |
| | | }) |
| | | }, |
| | | mount() { |
| | | }, |
| | | methods:{ |
| | | handleSelectChange(val){ |
| | | this.selectlength=val |
| | | // if(val.value >= this.checkboxlength.value.length && this.checkboxlength.value.length > 0){ |
| | | // console.log("大于") |
| | | // } |
| | | }, |
| | | handleCheckboxChange(val) { |
| | | // console.log("val",val); |
| | | const arr = this.option.column[5]; |
| | | this.checkboxlength = val.value; |
| | | if(val){ |
| | | this.checkboxlength = val.value; |
| | | return |
| | | } |
| | | // console.log("this.checkboxlength",this.checkboxlength); |
| | | this.checkboxedit = this.checkboxlength.toString().split(","); |
| | | |
| | | if (val.value != undefined && val.value != null) { |
| | | if (this.checkboxlist == val.value) { |
| | | } else { |
| | |
| | | }); |
| | | this.onLoad(); |
| | | }).catch(res=>{ |
| | | console.log(res) |
| | | // console.log(res) |
| | | }) |
| | | }, |
| | | rowSave(row,done){ |
| | |
| | | }) |
| | | }, |
| | | rowEdit(row){ |
| | | console.log("打开编辑edit",row) |
| | | // console.log("打开编辑edit",row) |
| | | }, |
| | | handleDel(row){ |
| | | this.$refs.crud.rowDel(row,row.$index); |
| | |
| | | handleEdit(row){ |
| | | this.$refs.crud.rowEdit(row,row.$index); |
| | | this.editFlag=true; |
| | | // const arr=this.option.column[5]; |
| | | this.checkboxNumber=row.combinationIds.split(",") |
| | | this.selectNumber=row.requiredType |
| | | console.log(this.checkboxNumber, this.selectNumber) |
| | | // 打开编辑首先判断,组合方法是否小于必填种类,如果小于给予提醒修改 |
| | | if(this.checkboxNumber.length<=this.selectNumber){ |
| | | this.$message({ |
| | | type:"warning", |
| | |
| | | }); |
| | | done() |
| | | }).catch(res=>{ |
| | | console.log(res) |
| | | // console.log(res) |
| | | }) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | |
| | | // this.data = data.records; |
| | | // this.loading = false; |
| | | // this.selectionClear(); |
| | | console.log(res) |
| | | // console.log(res) |
| | | this.page.total=res.data.data.total |
| | | this.data=res.data.data.records |
| | | }); |