From 5e2aafeede13d337380f736567caf74f49713be7 Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Fri, 09 Aug 2024 14:38:32 +0800
Subject: [PATCH] 代码优化
---
src/views/userHouse/components/householdManager.vue | 45 +++++++++++++++++++++++----------------------
1 files changed, 23 insertions(+), 22 deletions(-)
diff --git a/src/views/userHouse/components/householdManager.vue b/src/views/userHouse/components/householdManager.vue
index 9341a25..ee5ba04 100644
--- a/src/views/userHouse/components/householdManager.vue
+++ b/src/views/userHouse/components/householdManager.vue
@@ -12,18 +12,6 @@
@click="handleDelete">删 除
</el-button>
</template>
- <template slot-scope="{row}" slot="tenantName">
- <el-tag>{{ row.tenantName }}</el-tag>
- </template>
- <template slot-scope="{row}" slot="roleName">
- <el-tag>{{ row.roleName }}</el-tag>
- </template>
- <template slot-scope="{row}" slot="deptName">
- <el-tag>{{ row.deptName }}</el-tag>
- </template>
- <template slot-scope="{row}" slot="userTypeName">
- <el-tag>{{ row.userTypeName }}</el-tag>
- </template>
</avue-crud>
</basic-container>
</el-col>
@@ -65,7 +53,7 @@
var regIdCard = /^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$/
// 如果通过该验证,说明身份证格式正确,但准确性还需计算
- if (regIdCard.test(value)) {
+ if (regIdCard.test(value) || value == '') {
if (value.length == 18) {
var idCardWi = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10,
5, 8, 4, 2) // 将前17位加权因子保存在数组里
@@ -129,12 +117,15 @@
total: 0
},
option: {
- labelWidth: 144,
+ labelWidth: 120,
+ searchLabelWidth: 96,
+ searchShow: true,
+ searchMenuSpan: 4,
+ menuWidth: 210,
+
height: 420,
calcHeight: 80,
tip: false,
- searchShow: true,
- searchMenuSpan: 6,
border: true,
index: true,
selection: true,
@@ -164,11 +155,12 @@
},
{
- width: 96,
+ width: 110,
label: "姓名",
prop: "name",
+ searchSpan: 4,
+ searchLabelWidth: 66,
search: true,
- searchSpan: 3,
rules: [
{
required: true,
@@ -192,12 +184,12 @@
},
{
- display: true,
width: 160,
+ display: true,
label: "身份证号",
prop: "idCard",
search: true,
- searchSpan: 4,
+ searchSpan: 5,
slot: true,
rules: [
{
@@ -208,9 +200,9 @@
},
{
+ width: 160,
hide: true,
display: false,
- width: 160,
label: "证件号码",
prop: "cardNo",
},
@@ -227,6 +219,7 @@
{
+ width: 60,
label: "性别",
prop: "gender",
type: "select",
@@ -251,7 +244,7 @@
label: "手机号码",
prop: "phoneNumber",
search: true,
- searchSpan: 3,
+ searchSpan: 5,
slot: true,
rules: [
{
@@ -313,6 +306,7 @@
},
{
+ overHidden: true,
label: "地址",
prop: "address",
display: false
@@ -531,6 +525,12 @@
{
label: "车牌号",
prop: "cardNumber",
+ hide: true,
+ },
+
+ {
+ label: "备注",
+ prop: "remark",
hide: true,
},
]
@@ -805,6 +805,7 @@
onLoad (page, params = {}) {
params['houseCode'] = this.houseCode
this.loading = true
+
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data
this.page.total = data.total
--
Gitblit v1.9.3