Commit 9b5607e1 authored by jingnan's avatar jingnan 👀

架次关联站位编号组件修改

parent cbc56237
...@@ -87,7 +87,6 @@ export default { ...@@ -87,7 +87,6 @@ export default {
} }
}, },
created() { created() {
console.log(http, 'http')
// 初始化数据 // 初始化数据
}, },
methods: { methods: {
......
export default {
props: {},
layoutConfigData: [
{
title: '高级组件配置',
data: [
{
key: 'bindKey',
title: '绑定属性',
disabled: true,
component: {
defaultValue: 'positionNumber',
name: 'el-input'
}
},
{
key: 'relatedAttribute',
title: '受关联属性',
disabled: true,
component: {
defaultValue: '',
name: 'el-input'
}
}
]
}
],
data() {
return {
}
},
created() {
},
computed: {
},
methods: {
}
}
<template> <template>
<div> <div>
<el-select <el-select
:value="value" :value="selVal"
:loading="loading" :loading="loading"
filterable filterable
remote remote
...@@ -22,10 +22,11 @@ ...@@ -22,10 +22,11 @@
</template> </template>
<script> <script>
import config from './config'
export default { export default {
name: 'StationSelect', name: 'StationSelect',
componentName: '架次关联站位编号', componentName: '架次关联站位编号',
mixins: [config],
props: { props: {
value: { value: {
type: [String, Number], type: [String, Number],
...@@ -47,20 +48,35 @@ export default { ...@@ -47,20 +48,35 @@ export default {
data() { data() {
return { return {
loading: false, loading: false,
options: [] options: [],
// linkageValue: '',
selVal: ''
} }
}, },
computed: {}, computed: {},
watch: { watch: {
'form.sorties': { 'form.sorties': {
immediate: true, immediate: true,
deep: true, // deep: true,
handler(val) { handler(val) {
// if (val !== this.linkageValue) {
if (this.item.key !== 'position') { if (this.item.key !== 'position') {
// this.linkageValue = val
this.$set(this.form, 'positionNumber', '') this.$set(this.form, 'positionNumber', '')
this.selVal = ''
} }
// }
val && this.getOptions() val && this.getOptions()
} }
},
value: {
immediate: true,
deep: true,
handler(v) {
if (v) {
this.selVal = this.value
}
}
} }
}, },
methods: { methods: {
...@@ -104,6 +120,15 @@ export default { ...@@ -104,6 +120,15 @@ export default {
}, },
change(val) { change(val) {
this.$emit('input', val) this.$emit('input', val)
this.clearRelativeAttr()
},
clearRelativeAttr() {
if (this.item.relatedAttribute) {
const attributes = this.item.relatedAttribute.split(',') || []
attributes.forEach(el => {
el && this.$set(this.form, el, '')
})
}
}, },
clear() { clear() {
this.$emit('input') this.$emit('input')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment