fix(AiEartagPicker): 修复耳标选择器组件
- 优化代码格式和缩进 - 修复 penId 属性未使用的问题 - 改进 getEartag 方法,确保正确处理返回数据 - 更新模板中的点击事件和样式
This commit is contained in:
@@ -39,7 +39,7 @@ export default {
|
|||||||
getEartag() {
|
getEartag() {
|
||||||
!/undefined/.test(this.api) && this.instance.post(this.api).then(res => {
|
!/undefined/.test(this.api) && this.instance.post(this.api).then(res => {
|
||||||
if (res?.data) {
|
if (res?.data) {
|
||||||
this.list = res.data
|
this.list = res.data?.map(v => ({ key: v, label: v })) || []
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -61,7 +61,8 @@ export default {
|
|||||||
<el-option v-for="op in list" :key="op.id" :label="op.earTag" :value="op.id" />
|
<el-option v-for="op in list" :key="op.id" :label="op.earTag" :value="op.id" />
|
||||||
<div slot="prefix" @click.stop="dialog = true" />
|
<div slot="prefix" @click.stop="dialog = true" />
|
||||||
</el-select>
|
</el-select>
|
||||||
<ai-dialog v-model="dialog" title="选择牲畜" width="640px" @confirm="handleConfirm" @closed="selected=[]" @open="selected=value">
|
<ai-dialog v-model="dialog" title="选择牲畜" width="640px" @confirm="handleConfirm" @closed="selected = []"
|
||||||
|
@open="selected = value">
|
||||||
<el-transfer :data="list" v-model="selected" :titles="['可选', '已选择']" />
|
<el-transfer :data="list" v-model="selected" :titles="['可选', '已选择']" />
|
||||||
</ai-dialog>
|
</ai-dialog>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
Reference in New Issue
Block a user