Commit 3e83e9f9 authored by xioln's avatar xioln

供外出库架次联动修改

parent a9dcdea0
export default {
props: {},
layoutConfigData: [
{
title: '高级组件配置',
data: [
{
key: 'linkageAttr',
title: '架次联动属性',
component: {
defaultValue: 'aircraftType',
name: 'el-input',
placeholder: '机型Key'
}
}
]
}
],
data() {
return {
}
},
created() {
},
computed: {
},
methods: {
}
}
......@@ -17,10 +17,14 @@
</div>
</template>
<script>
import config from './config'
import _get from 'lodash.get'
export default {
componentName: '供外出库架次',
name: 'GetSortiesSelect', // name写在组件的最前方,自定义组件为必填
components: {},
mixins: [config],
props: {
itemObj: {
type: Object,
......@@ -43,31 +47,26 @@ export default {
return {
options: [],
selVal: '',
disabledVal: false
disabledVal: false,
linkageValue: null
}
},
computed: {},
watch: {
'form.aircraftType': {
form: {
immediate: true,
deep: true,
handler(val, oldVal) {
if (val !== oldVal) {
const params = {
searchItems: {
items: [{ 'fieldName': 'aircraftTypeId', operator: 'EQ', value: val.split('+')[0] }],
operator: 'AND'
}
handler(val) {
if (val) {
if (!this.itemObj.linkageAttr) {
return
}
const _val = _get(this.form, this.itemObj.linkageAttr)
console.log('watch', _val)
if (_val !== this.linkageValue) {
this.linkageValue = _val
this.getData(_val)
}
this.$api.searchApi('AircraftSorties', params).then(res => {
this.options = res.items.content.map(row => {
return {
value: row.id + '+' + row.defName,
label: row.defName
}
})
})
}
}
},
......@@ -94,6 +93,22 @@ export default {
// 初始化数据
},
methods: {
getData(val) {
const params = {
searchItems: {
items: [{ 'fieldName': 'aircraftTypeId', operator: 'EQ', value: val.split('+')[0] }],
operator: 'AND'
}
}
this.$api.searchApi('AircraftSorties', params).then(res => {
this.options = res.items.content.map(row => {
return {
value: row.id + '+' + row.defName,
label: row.defName
}
})
})
},
changeVal() {
this.$emit('input', this.selVal)
}
......
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