easybill-ui 1.2.25 → 1.2.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -276,7 +276,6 @@ const onItemChange = (prop: string, value: string, filter: FilterItem) => {
|
|
|
276
276
|
listQuery.pageIndex = 1
|
|
277
277
|
fetchData()
|
|
278
278
|
}
|
|
279
|
-
|
|
280
279
|
let hasInit = false
|
|
281
280
|
onActivated(() => {
|
|
282
281
|
// option?.customActivatedFetch为true时,参考/system/partner/account/vendor写法
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-table-column v-if="!
|
|
2
|
+
<el-table-column v-if="!getColumnHidden" :fixed="props.schema.fixed" v-bind="getColumnAttrs">
|
|
3
3
|
<template #header="scope">
|
|
4
4
|
<div class="header-td" :class="[props.schema.align]">
|
|
5
5
|
<slot :name="props.schema.prop + 'Header'" v-bind="scope"></slot>
|
|
@@ -94,16 +94,23 @@ const copyValue = async (value: unknown) => {
|
|
|
94
94
|
ElMessage.success(t("el.table.clickCopySuccess"))
|
|
95
95
|
}
|
|
96
96
|
const emits = defineEmits(["search"])
|
|
97
|
+
const search = inject("search")
|
|
98
|
+
const getColumnHidden = computed(() => {
|
|
99
|
+
if (props.schema.hidden && props.schema.hidden instanceof Function) {
|
|
100
|
+
return props.schema.hidden(props.schema, search)
|
|
101
|
+
}
|
|
102
|
+
return props.schema.hidden
|
|
103
|
+
})
|
|
97
104
|
const onChange = (prop: string, value: string) => {
|
|
98
105
|
emits("search", prop, value, filterSchema.value)
|
|
99
106
|
}
|
|
100
107
|
const tableItemFilterRef = ref<InstanceType<typeof STableItemFilter>>()
|
|
101
|
-
const
|
|
108
|
+
const onSearch = (opt: { listQuery: Record<string, unknown> }) => {
|
|
102
109
|
if (tableItemFilterRef.value) tableItemFilterRef.value.search(opt)
|
|
103
110
|
}
|
|
104
111
|
const tableItemRefs: Ref<Record<string, unknown>> = ref({})
|
|
105
112
|
const onItemChange = (prop: string, value: string) => {
|
|
106
113
|
emits("search", prop, value, filterSchema.value)
|
|
107
114
|
}
|
|
108
|
-
defineExpose({ search })
|
|
115
|
+
defineExpose({ search: onSearch })
|
|
109
116
|
</script>
|
|
@@ -24,7 +24,7 @@ export interface ColumnItemCtx<T> extends Partial<TableColumnCtx<T>> {
|
|
|
24
24
|
prop: string
|
|
25
25
|
label: string
|
|
26
26
|
type?: string
|
|
27
|
-
hidden?: boolean
|
|
27
|
+
hidden?: boolean | ((item: ColumnItemCtx<T>, search: (opt: { listQuery: Record<string, unknown> }) => void) => boolean)
|
|
28
28
|
neverShow?: boolean // 表示不在列控制器里
|
|
29
29
|
children?: ColumnItem<T>[]
|
|
30
30
|
options?: Array<OptionItem> //数据字典
|