- 证件管理系统
+ 公职人员护照管理系统
diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue
index f9c46c8..07dfa9a 100644
--- a/src/views/system/user/index.vue
+++ b/src/views/system/user/index.vue
@@ -215,7 +215,7 @@
label="用户账号"
align="center"
key="userName"
- prop="userName"
+ prop="userName"
v-if="columns[1].visible"
:show-overflow-tooltip="true"
/>
@@ -365,7 +365,7 @@
-
+
-
+
-
+
-
+
+
+
+
+ {{ dict.label }}
+
+
+
+
@@ -530,23 +542,11 @@
-
-
+
-
+
@@ -616,9 +616,9 @@
end-placeholder="结束日期" clearable
format="yyyy-MM-dd" style="width: 100%"
:picker-options="pickerOptions" >
-
+
-
+
-
+
@@ -665,7 +665,7 @@
-
+
取 消
-
+
@@ -767,8 +767,8 @@ import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { validateNewPassword } from '@/utils/validate'
-import store from "@/store";
-import { imgUpLoadTwo } from '@/api/system/upload'
+import store from "@/store";
+import { imgUpLoadTwo } from '@/api/system/upload'
import { decryptWithSM4,encryptWithSM4 } from '@/utils/sm';
export default {
name: 'User',
@@ -815,6 +815,7 @@ export default {
// 登录权限数组
loginTypeArr: [],
isCustomerList:[{id:"0",name:"是"},{id:"1",name:"否"}],
+ isCertificates:[{"value":0,"label":"否"},{"value":1,"label":"是"}],
// 角色下拉多选限制数量
multipleLimit: 1,
// 表单参数
@@ -880,6 +881,10 @@ export default {
trigger: 'blur',
},
],
+ idNumber: [
+ { required: true, message: "身份证不能为空", trigger: "blur" },
+ { validator: this.validateIDCard, trigger: 'blur' }
+ ],
nickName: [
{
required: true,
@@ -949,7 +954,7 @@ export default {
checkUrlList: [],//图片
checkUrlNameList: [],//图片
dialogVisible:false,//图片弹窗
- dialogImageUrl:"",//图片弹窗
+ dialogImageUrl:"",//图片弹窗
loadingBtn:false,
// 是否显示cropper
visible: false,
@@ -998,6 +1003,17 @@ export default {
})
},
methods: {
+ validateIDCard(rule, value, callback) {
+ // 15位身份证正则表达式
+ const reg15 = /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$/;
+ // 18位身份证正则表达式
+ const reg18 = /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}(\d|X|x)$/;
+ if (reg15.test(value) || reg18.test(value)) {
+ callback(); // 验证通过,无错误信息提示
+ } else {
+ callback(new Error('请输入有效的身份证号')); // 验证失败,显示错误信息提示
+ }
+ },
/* 手机号码脱敏 */
hidePhone(phone) {
if (!phone) return ''
@@ -1018,11 +1034,11 @@ export default {
(response) => {
this.userList = response.rows
this.total = response.total
- // this.userList.forEach(item=>{
+ // this.userList.forEach(item=>{
// if(item.phonenumber&&item.phonenumber!=""){
// this.$set(item,"phonenumber",decryptWithSM4(item.phonenumber))
- // }
- // })
+ // }
+ // })
this.loading = false
},
)
@@ -1176,18 +1192,13 @@ export default {
const userId = row.userId || this.ids
getUser(userId).then((response) => {
this.form = response.data
- // if(this.form.phonenumber&&this.form..phonenumber!=""){
- // this.$set(this.form,"phonenumber",decryptWithSM4(response.data.phonenumber))
- // }
- // if(this.form.email&&this.form..email!=""){
- // this.$set(this.form,"email",decryptWithSM4(response.data.email))
- // }
+ console.log("this.form",this.form);
const loginType = response.data.loginType
if (loginType) {
this.loginTypeArr = loginType.split(',')
}
- if(this.form.isPermanent==0){
- this.effectiveDateRange = [new Date(this.form.effectiveStartDay).getTime(),new Date(this.form.effectiveEndDay).getTime()]
+ if(this.form.isPermanent==0){
+ this.effectiveDateRange = [new Date(this.form.effectiveStartDay).getTime(),new Date(this.form.effectiveEndDay).getTime()]
}
this.postOptions = response.posts
this.roleOptions = response.roles
@@ -1202,7 +1213,7 @@ export default {
this.fileList=[]
this.checkUrlList=[]
this.checkUrlNameList = []
- }
+ }
this.open = true
this.title = '修改用户'
this.form.password = ''
@@ -1301,9 +1312,9 @@ export default {
this.form.photoUrl = null
// this.$message.warning('请先上传人脸图片')
}else{
- this.form.photoUrl = this.checkUrlList[0]
+ this.form.photoUrl = this.checkUrlList[0]
}
- if(this.form.isPermanent==0){
+ if(this.form.isPermanent==0){
this.form.effectiveStartDay = this.formatDate(this.effectiveDateRange[0])
this.form.effectiveEndDay = this.formatDate(this.effectiveDateRange[1])
}else{
@@ -1314,10 +1325,10 @@ export default {
if (valid) {
// if(param.phonenumber&¶m.phonenumber!=""){
// this.$set(param,"phonenumber",encryptWithSM4(param.phonenumber))
- // }
+ // }
// if(param.email&¶m.email!=""){
- // this.$set(param,"email",encryptWithSM4(param.email))
- // }
+ // this.$set(param,"email",encryptWithSM4(param.email))
+ // }
if (param.userId != undefined) {
updateUser(param).then((response) => {
this.$modal.msgSuccess('修改成功')
@@ -1392,7 +1403,7 @@ export default {
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit()
- },
+ },
hasSystemOrAuditrRole(roles) {
if (!roles || !Array.isArray(roles)) {
return false // 如果 roles 为空或不是数组,返回 false
@@ -1401,7 +1412,7 @@ export default {
(role) =>
role.roleKey === 'systemAdmin' || role.roleKey === 'audit',
) // 检查是否存在 roleKey 为 admin 的角色
- },
+ },
// 检查行是否可选
checkSelectable(row) {
return !(
@@ -1409,7 +1420,7 @@ export default {
row.isBuiltIn === '0' ||
this.hasSystemOrAuditrRole(row.roles)
)
- },
+ },
getRowClassName(row) {
return !this.checkSelectable(row) ? 'disabled-row' : ''
},
@@ -1420,9 +1431,9 @@ export default {
console.log(row)
const userId = row.userId || this.ids
getUser(userId).then((response) => {
- this.baseForm = response.data
- this.openFace = true
- })
+ this.baseForm = response.data
+ this.openFace = true
+ })
},
submitFace(){
// console.log(this.baseForm)
@@ -1433,7 +1444,7 @@ export default {
this.baseForm.photoUrl = this.checkUrlList[0]
updateUser(this.baseForm).then((response) => {
this.$modal.msgSuccess('上传成功')
- store.commit('SET_FACE', this.checkUrlList[0]);
+ store.commit('SET_FACE', this.checkUrlList[0]);
this.openFace = false;
this.getList()
})
@@ -1448,12 +1459,12 @@ export default {
if (res.code == 200) {
this.checkUrlList.push(res.data.url)
this.checkUrlNameList.push(res.data.name)
- } else {
+ } else {
this.$modal.msgError(res.msg)
}
this.loadingBtn=false
})
- .catch((error) => {
+ .catch((error) => {
this.$modal.msgError(error)
this.loadingBtn=false
})
@@ -1462,7 +1473,7 @@ export default {
console.log('success')
},
// 上传之前
- handleBeforeUpload(file) {
+ handleBeforeUpload(file) {
const isLt = file.size / 1024 / 1024 < 5
if (!isLt) {
this.$modal.msgError(`图片大小不能超过 5 MB`)
@@ -1501,7 +1512,7 @@ export default {
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
- }
+ }
},
}