Commit c19a2d10 authored by xioln's avatar xioln

架次类型选择组件

parent 14404fe6
......@@ -53,7 +53,7 @@ export default {
'assemblyStartTime': form.assemblyTime[0],
'assemblyEndTime': form.assemblyTime[1],
'jobNo': form.jobNo,
'soritesType': { type: form.soritesType.type },
'soritesTypeId': form.soritesTypeId,
'aircraftTypeId': form.aircraftTypeId,
'aircraftSortiesId': form.aircraftSortiesId
}
......
export default {
props: {},
layoutConfigData: [
{
title: '高级组件配置',
data: [
{
key: 'linkageAttr',
title: '联动属性',
component: {
defaultValue: 'aircraftSortiesId',
name: 'el-input',
placeholder: '架次ID'
}
}
]
}
],
data() {
return {
}
},
created() {
},
computed: {
},
methods: {
}
}
<template>
<div>
<el-select v-model="selVal" :disabled="disabledVal">
<el-option
v-for="(item,i) in options"
:key="i"
:label="item.label"
:value="item.id"
/>
</el-select>
</div>
</template>
<script>
import config from './config'
import _get from 'lodash.get'
export default {
componentName: '架次类型',
name: 'SoritesLinkSelect',
components: {},
mixins: [config],
props: {
form: {
type: Object,
default: null
},
itemObj: {
type: Object,
default: null
}
},
data() {
return {
options: [],
disabledVal: false,
selVal: ''
}
},
computed: {},
watch: {
form: {
immediate: true,
deep: true,
handler(val) {
if (val) {
if (!this.itemObj.linkageAttr) {
return
}
const _val = _get(this.form, this.itemObj.linkageAttr)
if (_val !== this.linkageValue) {
this.linkageValue = _val
this.getData(_val)
}
}
}
},
itemObj: {
immediate: true,
deep: true,
handler(v) {
if (v.component.hasOwnProperty('disabled')) {
this.disabledVal = v.component.disabled
}
}
}
},
// 生命周期 - 创建完成(可以访问当前this 实例)
created() {
},
// 生命周期 - 挂载之前
beforeMount() {
},
// 生命周期 - 挂载完成(可以访问 DOM 元素)
mounted() {
this.$nextTick(() => {
if (this.form.materialType) {
this.selVal = this.form.materialType
}
})
},
methods: {
getData(val) {
if (val) {
const params = {
searchItems: {
items: [{ 'fieldName': 'source.id', operator: 'EQ', value: val }],
operator: 'AND'
},
'openProps': [{ name: 'target' }]
}
this.$api.searchApi('SoritesLink', params).then(res => {
this.options = res.items.content.map(row => {
return {
value: row.target.id,
label: row.target.type
}
})
})
}
},
changeVal() {
this.$emit('input', this.selVal)
}
}
}
</script>
<style lang='scss' scoped>
</style>
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