bug==select

This commit is contained in:
gaoyuanwei 2022-07-19 17:14:42 +08:00
parent 8ec4b585b6
commit e4d79e03b8
1 changed files with 45 additions and 3 deletions

View File

@ -318,12 +318,24 @@
:list="props.videoList" :list="props.videoList"
tip="支持视频类型大小不超过100M" tip="支持视频类型大小不超过100M"
></upload> ></upload>
<a-button <!-- <a-button
v-else-if="item.type == 'AssociatedApplication'" v-else-if="item.type == 'AssociatedApplication'"
@click="sourceClick" @click="sourceClick"
> >
请选择来源应用 请选择来源应用
</a-button> </a-button> -->
<a-select
v-else-if="item.type == 'select' && item.name == '来源应用'"
style="width: 2.4rem"
v-model:value="item.note1"
show-search
placeholder="请输入关键字"
:options="item.options"
:filter-option="applicationsOption"
@focus="applicationsFocus"
@blur="applicationsBlur"
@change="applicationsChange"
></a-select>
<a-button <a-button
v-else-if="item.type == 'AssociatedComponents'" v-else-if="item.type == 'AssociatedComponents'"
@click="componentsClick" @click="componentsClick"
@ -616,6 +628,19 @@
item.note1 = res1.data.mobile || '' item.note1 = res1.data.mobile || ''
}) })
} }
} else if (item.name === '来源应用') {
queryApplicationRelByResourceId({
referenceId: 0,
}).then((res) => {
const dataList = []
res.data.data.notLinked.forEach((element) => {
dataList.push({
value: element.id,
label: element.name,
})
})
item.options = dataList
})
} else { } else {
data.value.list.push(item) data.value.list.push(item)
} }
@ -744,7 +769,7 @@
const targetKeysOther = ref([]) const targetKeysOther = ref([])
// //
// const targetKeysBack = ref([]) // const targetKeysBack = ref([])
// -back
const sourceClick = () => { const sourceClick = () => {
mockData.value = [] mockData.value = []
visibleAssociatedApplication.value = true visibleAssociatedApplication.value = true
@ -915,18 +940,35 @@
const handleChange2 = (value) => { const handleChange2 = (value) => {
console.log(`selected ${value}`) console.log(`selected ${value}`)
} }
const applicationsChange = (value) => {
data.value.list.map((item) => {
if (item.name === '来源应用') {
item.note1 = value
data.value.list.push(item }
})
console.log(`selected ${value}`)
}
const handleBlur = () => { const handleBlur = () => {
console.log('blur') console.log('blur')
} }
const applicationsBlur = () => {
console.log('blur')
}
const handleFocus = () => { const handleFocus = () => {
console.log('focus') console.log('focus')
} }
const applicationsFocus = () => {
console.log('focus')
}
const filterOption = (input, option) => { const filterOption = (input, option) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
} }
const applicationsOption = (input, option) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
</script> </script>
<style></style> <style></style>
<style lang="less" scoped> <style lang="less" scoped>