easybill-ui 1.0.32 → 1.0.34
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-select v-model="model" style="width: 100%" :loading="formItem.loading || loading" :placeholder="'请选择' + formItem.label" v-bind="
|
|
2
|
+
<el-select v-model="model" style="width: 100%" :loading="formItem.loading || loading" :placeholder="'请选择' + formItem.label" v-bind="props" v-on="eventObject">
|
|
3
3
|
<el-option v-if="props.all && !props.multiple" value="" label="全部"></el-option>
|
|
4
4
|
<el-checkbox v-if="props.all && props.multiple" v-model="checked" label="全选" class="schema-form-select-check" />
|
|
5
5
|
<template v-for="option in list" :key="option.value">
|
|
@@ -34,18 +34,20 @@ const props = defineProps({
|
|
|
34
34
|
})
|
|
35
35
|
const option = inject<FilterOption>("option")
|
|
36
36
|
const query = ref<any>({})
|
|
37
|
-
|
|
38
|
-
const formItemLeft = props.selectParams.filter((a) => a.external === true || a.external === "left").sort((a, b) => parseInt(String(b.sortIndex || 0)) - parseInt(String(a.sortIndex || 0))) as FormItem[]
|
|
39
|
-
const formItemRight = props.selectParams.filter((a) => a.external === "right") as FormItem[]
|
|
40
|
-
const as = [...formItemLeft]
|
|
41
|
-
if (props.hasSlot) {
|
|
42
|
-
as.push({ prop: "defaultFilter", type: "defaultFilter" })
|
|
43
|
-
}
|
|
44
|
-
const formItem: FormItem[] = [...as, ...formItemRight]
|
|
37
|
+
|
|
45
38
|
const formSchema = ref<FormSchema>({
|
|
46
|
-
formItem,
|
|
39
|
+
formItem: [],
|
|
47
40
|
})
|
|
48
41
|
const init = () => {
|
|
42
|
+
// 特殊处理数组
|
|
43
|
+
const formItemLeft = props.selectParams.filter((a) => a.external === true || a.external === "left").sort((a, b) => parseInt(String(b.sortIndex || 0)) - parseInt(String(a.sortIndex || 0))) as FormItem[]
|
|
44
|
+
const formItemRight = props.selectParams.filter((a) => a.external === "right") as FormItem[]
|
|
45
|
+
const as = [...formItemLeft]
|
|
46
|
+
if (props.hasSlot) {
|
|
47
|
+
as.push({ prop: "defaultFilter", type: "defaultFilter" })
|
|
48
|
+
}
|
|
49
|
+
const formItem: FormItem[] = [...as, ...formItemRight]
|
|
50
|
+
formSchema.value.formItem = formItem
|
|
49
51
|
// const query = deepClone(query.value)
|
|
50
52
|
for (let i in formSchema.value.formItem) {
|
|
51
53
|
const item = formSchema.value.formItem[i] as ParamsItem
|
|
@@ -68,6 +70,12 @@ const init = () => {
|
|
|
68
70
|
// query.value = query
|
|
69
71
|
}
|
|
70
72
|
init()
|
|
73
|
+
watch(
|
|
74
|
+
() => props.selectParams,
|
|
75
|
+
() => {
|
|
76
|
+
init()
|
|
77
|
+
},
|
|
78
|
+
)
|
|
71
79
|
|
|
72
80
|
const emit = defineEmits(["change"])
|
|
73
81
|
watch(
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
export default { name: "TableFilter" }
|
|
17
17
|
</script>
|
|
18
18
|
<script lang="ts" setup>
|
|
19
|
-
import { PropType, provide, Ref, ref, reactive, onMounted } from "vue"
|
|
19
|
+
import { PropType, provide, Ref, ref, reactive, onMounted, watch } from "vue"
|
|
20
20
|
import * as I from "../types"
|
|
21
21
|
import FilterExternal from "./FilterExternal/FilterExternal.vue"
|
|
22
22
|
import FilterSearchBox from "./FilterSearchBox.vue"
|
|
@@ -190,8 +190,8 @@ const clear = () => {
|
|
|
190
190
|
}
|
|
191
191
|
// 重新调用selectParams
|
|
192
192
|
const refreshSelectParams = () => {
|
|
193
|
-
if (props.schema) {
|
|
194
|
-
selectParams.value = deepClone(props.schema)
|
|
193
|
+
if (props.schema || props.selectParams) {
|
|
194
|
+
selectParams.value = deepClone(props.schema || props.selectParams)
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
const getCurrentIndex = () => {
|
|
@@ -209,6 +209,13 @@ const tableFilterContext = reactive<I.TableFilterContext>({
|
|
|
209
209
|
},
|
|
210
210
|
setValue,
|
|
211
211
|
})
|
|
212
|
+
watch(
|
|
213
|
+
() => [props.schema, props.selectParams],
|
|
214
|
+
() => {
|
|
215
|
+
refreshSelectParams()
|
|
216
|
+
getTags()
|
|
217
|
+
},
|
|
218
|
+
)
|
|
212
219
|
provide("tableFilter", tableFilterContext)
|
|
213
220
|
provide("state", state)
|
|
214
221
|
provide("selectList", selectList)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easybill-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.34",
|
|
4
4
|
"description": "A component library for easybill",
|
|
5
5
|
"author": "tuchongyang <779311998@qq.com>",
|
|
6
6
|
"private": false,
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
"publishConfig": {
|
|
15
15
|
"access": "public"
|
|
16
16
|
},
|
|
17
|
-
"gitHead": "
|
|
17
|
+
"gitHead": "a8d171c2ac5f0a16ba1c85aa8114cd05013d3e2d"
|
|
18
18
|
}
|