v1.9 修复修改业主,修改门禁钥匙出现多个的bug

This commit is contained in:
wuxw 2025-08-29 09:44:08 +08:00
parent 27cc2c15e5
commit a5f85f5f05
2 changed files with 100 additions and 12 deletions

View File

@ -81,22 +81,39 @@
<el-row :gutter="20" v-if="index % 2 === 0">
<el-col :span="12">
<el-form-item :label="item.specName">
<el-input v-if="item.specType === '2233'" v-model="item.value" :placeholder="item.specHoldplace" />
<el-select v-else-if="item.specType === '3344'" v-model="item.value" style="width:100%">
<el-option v-for="val in item.values" :key="val.value" :label="val.valueName" :value="val.value" />
</el-select>
<input v-if="item.specType === '2233'"
v-model="item.value"
:placeholder="item.specHoldplace"
class="custom-input" />
<select v-else-if="item.specType === '3344'"
v-model="item.value"
class="custom-select">
<option v-for="val in item.values"
:key="val.value"
:label="val.valueName"
:value="val.value">
{{ val.valueName }}
</option>
</select>
</el-form-item>
</el-col>
<el-col :span="12" v-if="index < attrs.length - 1">
<el-form-item :label="attrs[index + 1].specName">
<el-input v-if="attrs[index + 1].specType === '2233'" v-model="attrs[index + 1].value"
:placeholder="attrs[index + 1].specHoldplace" />
<el-select v-else-if="attrs[index + 1].specType === '3344'" v-model="attrs[index + 1].value"
style="width:100%">
<el-option v-for="val in attrs[index + 1].values" :key="val.value" :label="val.valueName"
:value="val.value" />
</el-select>
<input v-if="attrs[index + 1].specType === '2233'"
v-model="attrs[index + 1].value"
:placeholder="attrs[index + 1].specHoldplace"
class="custom-input" />
<select v-else-if="attrs[index + 1].specType === '3344'"
v-model="attrs[index + 1].value"
class="custom-select">
<option v-for="val in attrs[index + 1].values"
:key="val.value"
:label="val.valueName"
:value="val.value">
{{ val.valueName }}
</option>
</select>
</el-form-item>
</el-col>
</el-row>
@ -196,6 +213,7 @@ export default {
if (this.form.ownerAttrDtos) {
const attrDto = this.form.ownerAttrDtos.find(dto => dto.specCd === attr.specCd)
attr.value = attrDto ? attrDto.value : ''
attr.attrId = attrDto ? attrDto.attrId : ''
}
}
} catch (error) {
@ -235,6 +253,7 @@ export default {
const params = {
...this.form,
attrs: this.attrs.map(attr => ({
attrId: attr.attrId,
specCd: attr.specCd,
value: attr.value
}))
@ -281,4 +300,73 @@ export default {
.mt-10 {
margin-top: 10px;
}
/* 自定义输入框样式,模拟 el-input */
.custom-input {
width: 100%;
height: 32px;
line-height: 32px;
padding: 0 12px;
border: 1px solid #dcdfe6;
border-radius: 4px;
font-size: 14px;
color: #606266;
background-color: #fff;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
box-sizing: border-box;
}
.custom-input:focus {
outline: none;
border-color: #409eff;
}
.custom-input:hover {
border-color: #c0c4cc;
}
.custom-input::placeholder {
color: #c0c4cc;
}
/* 自定义选择框样式,模拟 el-select */
.custom-select {
width: 100%;
height: 32px;
line-height: 32px;
padding: 0 12px;
border: 1px solid #dcdfe6;
border-radius: 4px;
font-size: 14px;
color: #606266;
background-color: #fff;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
box-sizing: border-box;
cursor: pointer;
appearance: none;
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
background-position: right 8px center;
background-repeat: no-repeat;
background-size: 16px;
padding-right: 32px;
}
.custom-select:focus {
outline: none;
border-color: #409eff;
}
.custom-select:hover {
border-color: #c0c4cc;
}
.custom-select option {
padding: 8px 12px;
background-color: #fff;
color: #606266;
}
.custom-select option:hover {
background-color: #f5f7fa;
}
</style>

View File

@ -274,7 +274,7 @@ export default {
async getColumns() {
try {
const {data} = await getAttrSpecList({
const { data } = await getAttrSpecList({
page: 1,
row: 100,
tableName: 'building_owner_attr'