fix:修复报告新增 category 部分选项 Params 国际化无法动态改变问题
This commit is contained in:
@@ -165,7 +165,7 @@
|
|||||||
multiple
|
multiple
|
||||||
placeholder=" "
|
placeholder=" "
|
||||||
:disabled="!!editObject.id"
|
:disabled="!!editObject.id"
|
||||||
popper-class="right-box-select-dropdown right-box-select-report "
|
popper-class="right-box-select-dropdown right-box-select-report"
|
||||||
size="small"
|
size="small"
|
||||||
@change="()=>{ this.$forceUpdate() }">
|
@change="()=>{ this.$forceUpdate() }">
|
||||||
<template v-for="time in weekOptions" :key="time.value">
|
<template v-for="time in weekOptions" :key="time.value">
|
||||||
@@ -222,7 +222,7 @@
|
|||||||
collapse-tags
|
collapse-tags
|
||||||
placeholder=" "
|
placeholder=" "
|
||||||
:disabled="!!editObject.id"
|
:disabled="!!editObject.id"
|
||||||
popper-class="right-box-select-dropdown right-box-select-report "
|
popper-class="right-box-select-dropdown right-box-select-report"
|
||||||
size="small"
|
size="small"
|
||||||
@change="typeChange">
|
@change="typeChange">
|
||||||
<template v-for="category in categoryList" :key="category.id">
|
<template v-for="category in categoryList" :key="category.id">
|
||||||
@@ -235,21 +235,19 @@
|
|||||||
<!-- <el-input v-model="param.value" placeholder=" " v-for="(param, index) in editObject.categoryParams" :key="index" size="small" style="vertical-align: unset;" :disabled="!!editObject.id">
|
<!-- <el-input v-model="param.value" placeholder=" " v-for="(param, index) in editObject.categoryParams" :key="index" size="small" style="vertical-align: unset;" :disabled="!!editObject.id">
|
||||||
<template #prepend>{{param.key}}</template>
|
<template #prepend>{{param.key}}</template>
|
||||||
</el-input>-->
|
</el-input>-->
|
||||||
<el-select v-model="param.value"
|
<el-select v-model="editObject.categoryParams[0].value"
|
||||||
v-for="(param, index) in editObject.categoryParams"
|
|
||||||
:key="index"
|
|
||||||
class="right-box__select right-box__select--param"
|
class="right-box__select right-box__select--param"
|
||||||
placeholder=" "
|
placeholder=" "
|
||||||
filterable
|
filterable
|
||||||
:disabled="!!editObject.id"
|
:disabled="!!editObject.id"
|
||||||
popper-class="right-box-select-dropdown right-box-select-report "
|
popper-class="right-box-select-dropdown right-box-select-report"
|
||||||
size="small"
|
size="small"
|
||||||
>
|
>
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
{{$t(param.i18n)}}
|
{{$t(editObject.categoryParams[0].i18n)}}
|
||||||
</template>
|
</template>
|
||||||
<template v-for="paramOption in paramsOptions">
|
<template v-for="paramOption in paramsOptions">
|
||||||
<template v-if="paramOption.key === param.key">
|
<template v-if="paramOption.key === editObject.categoryParams[0].key">
|
||||||
<el-option :key="p" :value="p" v-for="p in paramOption.options"></el-option>
|
<el-option :key="p" :value="p" v-for="p in paramOption.options"></el-option>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
@@ -415,6 +413,8 @@ export default {
|
|||||||
},
|
},
|
||||||
'editObject.categoryId': {
|
'editObject.categoryId': {
|
||||||
handler (n) {
|
handler (n) {
|
||||||
|
const dom = document.getElementsByClassName('el-input__inner')
|
||||||
|
console.log(dom)
|
||||||
const category = this.categoryList.find(c => c.id === n)
|
const category = this.categoryList.find(c => c.id === n)
|
||||||
if (category && category.config && category.config.queryParam) {
|
if (category && category.config && category.config.queryParam) {
|
||||||
this.editObject.categoryParams = category.config.queryParam
|
this.editObject.categoryParams = category.config.queryParam
|
||||||
@@ -460,6 +460,16 @@ export default {
|
|||||||
}
|
}
|
||||||
} else if (this.currentCategoryId) {
|
} else if (this.currentCategoryId) {
|
||||||
this.editObject.categoryId = this.currentCategoryId
|
this.editObject.categoryId = this.currentCategoryId
|
||||||
|
const category = this.categoryList.find(c => c.id === this.currentCategoryId)
|
||||||
|
if (category && category.config && category.config.queryParam) {
|
||||||
|
this.editObject.categoryParams = category.config.queryParam
|
||||||
|
if (!this.editObject.id) {
|
||||||
|
this.editObject.categoryParams.forEach(t => { t.value = '' })
|
||||||
|
}
|
||||||
|
this.loadParamOptions()
|
||||||
|
} else {
|
||||||
|
this.editObject.categoryParams = []
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user