From 814aef91c8adca61538f5abfda2c7676caa50832 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期四, 09 十一月 2023 14:39:21 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
Source/UBCS-WEB/src/views/system/PasswordManagement/passwords.vue | 402 ++++++++++++++++++++++++++++++---------------------------
1 files changed, 211 insertions(+), 191 deletions(-)
diff --git a/Source/UBCS-WEB/src/views/system/PasswordManagement/passwords.vue b/Source/UBCS-WEB/src/views/system/PasswordManagement/passwords.vue
index aa9b662..9b24dc2 100644
--- a/Source/UBCS-WEB/src/views/system/PasswordManagement/passwords.vue
+++ b/Source/UBCS-WEB/src/views/system/PasswordManagement/passwords.vue
@@ -1,11 +1,12 @@
<template>
- <basic-container>
+ <basic-container >
<avue-crud v-model="form" :option="option" :data="data" ref="crud" @on-load="onLoad" @row-save="rowSave" @row-update="rowUpdate" @row-del="rowDel" :page.sync="page">
<template slot="menu" slot-scope="{ row, index }">
<el-button
type="text"
size="small"
icon="el-icon-edit"
+ v-if="permissionList.editBtn"
@click="handleEdit(row, index)"
>
缂栬緫
@@ -14,6 +15,7 @@
type="text"
size="small"
icon="el-icon-delete"
+ v-if="permissionList.delBtn"
@click="handleDel(row, index)"
>
鍒犻櫎
@@ -36,6 +38,7 @@
getremove,
combination
} from "@/api/system/passwords";
+import {mapGetters} from "vuex";
export default {
name: "passwords.vue",
data() {
@@ -125,180 +128,7 @@
total: 100
},
data: [],
- option: {
- headerAlign: 'center',
- align: 'center',
- border: true,
- index: true,
- rowKey:'id',
- editBtn:false,
- 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,
- },
- {
- //鍐欎袱涓粍鍚堟柟娉曟槸鍥犱负id鍜宯ame涓嶈兘鍚屾椂缁戝畾杩欎釜prop鏉ユ覆鏌擄紝涓�涓〃鏍煎仛闅愯棌鏉ユ暟鎹搷浣滐紙琛ㄥ崟闅愯棌锛夛紝鍙︿竴涓〃鏍煎仛鏄剧ず鍙樉绀哄湪椤甸潰锛堣〃鍗曢殣钘忥級銆�
- 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:"",
//杩欎釜鏄笅鎷夎彍鍗曠殑鏁版嵁鍙橀噺
@@ -315,26 +145,219 @@
}
},
+ 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 {
@@ -379,7 +402,7 @@
});
this.onLoad();
}).catch(res=>{
- console.log(res)
+ // console.log(res)
})
},
rowSave(row,done){
@@ -399,7 +422,7 @@
})
},
rowEdit(row){
- console.log("鎵撳紑缂栬緫edit",row)
+ // console.log("鎵撳紑缂栬緫edit",row)
},
handleDel(row){
this.$refs.crud.rowDel(row,row.$index);
@@ -407,11 +430,8 @@
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",
@@ -428,7 +448,7 @@
});
done()
}).catch(res=>{
- console.log(res)
+ // console.log(res)
})
},
onLoad(page, params = {}) {
@@ -439,7 +459,7 @@
// 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
});
--
Gitblit v1.10.0