Merge pull request #7779 from dataease/pr@dev-v2@perf_log_tips

perf: 日志列表过滤条件文案
This commit is contained in:
fit2cloud-chenyw 2024-01-24 10:09:08 +08:00 committed by GitHub
commit 971f327994
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 42 additions and 9 deletions

View File

@ -2,7 +2,8 @@
import { propTypes } from '@/utils/propTypes' import { propTypes } from '@/utils/propTypes'
import { ElSelect, ElOption } from 'element-plus-secondary' import { ElSelect, ElOption } from 'element-plus-secondary'
import { computed, reactive } from 'vue' import { computed, reactive } from 'vue'
import { useI18n } from '@/hooks/web/useI18n'
const { t } = useI18n()
const props = defineProps({ const props = defineProps({
optionList: propTypes.arrayOf( optionList: propTypes.arrayOf(
propTypes.shape({ propTypes.shape({
@ -10,7 +11,13 @@ const props = defineProps({
name: propTypes.string name: propTypes.string
}) })
), ),
title: propTypes.string title: propTypes.string,
property: {
type: Object,
default: () => {
placeholder: ''
}
}
}) })
const state = reactive({ const state = reactive({
@ -46,6 +53,7 @@ defineExpose({
v-model="state.activeStatus" v-model="state.activeStatus"
value-key="id" value-key="id"
filterable filterable
:placeholder="t('common.please_select') + props.property.placeholder"
multiple multiple
@change="selectStatus" @change="selectStatus"
> >

View File

@ -1,8 +1,15 @@
<script setup lang="ts"> <script setup lang="ts">
import { propTypes } from '@/utils/propTypes' import { propTypes } from '@/utils/propTypes'
import { ElTreeSelect } from 'element-plus-secondary' import { ElTreeSelect } from 'element-plus-secondary'
import { computed, reactive, ref } from 'vue' import { computed, reactive, ref, PropType, toRefs } from 'vue'
import { useI18n } from '@/hooks/web/useI18n'
const { t } = useI18n()
interface TreeConfig {
checkStrictly: boolean
showCheckbox: boolean
checkOnClickNode: boolean
placeholder: string
}
const props = defineProps({ const props = defineProps({
optionList: propTypes.arrayOf( optionList: propTypes.arrayOf(
propTypes.shape({ propTypes.shape({
@ -12,7 +19,22 @@ const props = defineProps({
disabled: Boolean disabled: Boolean
}) })
), ),
title: propTypes.string title: propTypes.string,
property: Object as PropType<TreeConfig>
})
const { property } = toRefs(props)
const treeConfig = computed(() => {
let obj = Object.assign(
{
checkStrictly: false,
showCheckbox: true,
checkOnClickNode: true,
placeholder: t('user.role')
},
property.value
)
return obj
}) })
const state = reactive({ const state = reactive({
@ -58,9 +80,10 @@ defineExpose({
:highlight-current="true" :highlight-current="true"
multiple multiple
:render-after-expand="false" :render-after-expand="false"
:placeholder="$t('common.please_select') + $t('user.role')" :placeholder="$t('common.please_select') + treeConfig.placeholder"
show-checkbox :show-checkbox="treeConfig.showCheckbox"
check-on-click-node :check-strictly="treeConfig.checkStrictly"
:check-on-click-node="treeConfig.checkOnClickNode"
/> />
</div> </div>
</div> </div>

View File

@ -107,6 +107,7 @@ defineExpose({
v-if="component.type === 'tree-select'" v-if="component.type === 'tree-select'"
:option-list="component.option" :option-list="component.option"
:title="component.title" :title="component.title"
:property="component.property"
@filter-change="v => filterChange(v, component.field, 'in')" @filter-change="v => filterChange(v, component.field, 'in')"
/> />
<drawer-filter <drawer-filter
@ -114,6 +115,7 @@ defineExpose({
v-if="component.type === 'select'" v-if="component.type === 'select'"
:option-list="component.option" :option-list="component.option"
:title="component.title" :title="component.title"
:property="component.property"
@filter-change="v => filterChange(v, component.field, 'in')" @filter-change="v => filterChange(v, component.field, 'in')"
/> />
<drawer-enum-filter <drawer-enum-filter

@ -1 +1 @@
Subproject commit 217f54b5a74178cb1de0b9daed983ea78bf48578 Subproject commit 62f9e14297af537ce48f32571d97e3e90ba60796