easybill-ui 1.0.9 → 1.0.10
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.
- package/components/CurdForm/src/components/schema-form-checkbox.vue +3 -2
- package/components/CurdForm/src/components/schema-form-radio.vue +2 -2
- package/components/CurdTable/src/hooks/useColumnHook.ts +3 -0
- package/components/CurdTable/src/types.ts +3 -1
- package/components/CurdTable/utils/common.ts +2 -2
- package/package.json +2 -2
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
</template>
|
|
11
11
|
</el-checkbox-group>
|
|
12
12
|
<div v-if="!formItem.loading && !formItem.options?.length" class="empty">
|
|
13
|
-
<component :is="
|
|
13
|
+
<component :is="empty" v-if="empty" :form-model="formModel" :form-item="formItem" :props="props" />
|
|
14
14
|
<template v-else>
|
|
15
15
|
<el-icon><Warning /></el-icon> <span>{{ props.noDataText || "暂无数据" }}</span>
|
|
16
16
|
</template>
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
</div>
|
|
19
19
|
</template>
|
|
20
20
|
<script lang="ts">
|
|
21
|
-
import {
|
|
21
|
+
import {defineComponent, computed, PropType, toRaw} from "vue"
|
|
22
22
|
import { Loading, Warning } from "@element-plus/icons-vue"
|
|
23
23
|
import { ElCheckbox, ElCheckboxButton, ElCheckboxGroup, ElIcon } from "element-plus"
|
|
24
24
|
import { FormItemProps } from "../types"
|
|
@@ -44,6 +44,7 @@ export default defineComponent({
|
|
|
44
44
|
|
|
45
45
|
return {
|
|
46
46
|
model,
|
|
47
|
+
empty:toRaw(props.formItem.empty) || ""
|
|
47
48
|
}
|
|
48
49
|
},
|
|
49
50
|
})
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
</template>
|
|
19
19
|
</el-radio-group>
|
|
20
20
|
<div v-if="!formItem.loading && !formItem.options?.length" class="empty">
|
|
21
|
-
<component :is="
|
|
21
|
+
<component :is="empty" v-if="empty" :form-model="formModel" :form-item="formItem" :props="props" />
|
|
22
22
|
<template v-else>
|
|
23
23
|
<el-icon><Warning /></el-icon> <span>{{ props.noDataText || "暂无数据" }}</span>
|
|
24
24
|
</template>
|
|
@@ -47,9 +47,9 @@ export default defineComponent({
|
|
|
47
47
|
get: () => props.modelValue,
|
|
48
48
|
set: (val) => emit("update:modelValue", val),
|
|
49
49
|
})
|
|
50
|
-
|
|
51
50
|
return {
|
|
52
51
|
model,
|
|
52
|
+
empty:toRaw(props.formItem.empty) || ""
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormSchema
|
|
1
|
+
import {EventObject, FormSchema} from "./../../CurdForm/src/types"
|
|
2
2
|
import { ParamsItem } from "../../TableFilter"
|
|
3
3
|
import { FormItem as FormItemType, Fields, TooltipProps } from "../../CurdForm"
|
|
4
4
|
import { OptionItem } from "../../ConstantStatus"
|
|
@@ -29,8 +29,10 @@ export interface ColumnItemCtx<T> extends Partial<TableColumnCtx<T>> {
|
|
|
29
29
|
children?: ColumnItem<T>[]
|
|
30
30
|
options?: Array<OptionItem> //数据字典
|
|
31
31
|
asyncOptions?: () => Promise<OptionItem[]>
|
|
32
|
+
eventObject?:EventObject
|
|
32
33
|
form?: Partial<FormItemType> | ((formItem: FormItemType, row: T, query: Fields) => Partial<FormItemType>)
|
|
33
34
|
filter?: ColumnItemFilter
|
|
35
|
+
empty?: string | any
|
|
34
36
|
detail?: ColumnItemDetail
|
|
35
37
|
value?: any
|
|
36
38
|
copy?: boolean // 对某一列的单元格的值进行复制
|
|
@@ -2,12 +2,12 @@ export function deepClone<T extends Array<T> | any>(sourceData: T): T {
|
|
|
2
2
|
if (Array.isArray(sourceData)) {
|
|
3
3
|
return sourceData.map((item) => deepClone(item)) as T
|
|
4
4
|
}
|
|
5
|
-
if (typeof sourceData !== "object" || sourceData === null) {
|
|
5
|
+
if (typeof sourceData !== "object" || sourceData === null || sourceData instanceof Function || sourceData instanceof Date || sourceData instanceof File || sourceData instanceof Symbol) {
|
|
6
6
|
return sourceData
|
|
7
7
|
}
|
|
8
8
|
const obj: T = {} as T
|
|
9
9
|
for (const key in sourceData) {
|
|
10
|
-
if (typeof sourceData[key] === "object" && sourceData[key] !== null) {
|
|
10
|
+
if ((typeof sourceData[key] === "object" || sourceData[key] instanceof Date || sourceData[key] instanceof File) && sourceData[key] !== null) {
|
|
11
11
|
obj[key] = deepClone(sourceData[key])
|
|
12
12
|
} else {
|
|
13
13
|
obj[key] = sourceData[key]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easybill-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
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": "7062a18f17f6dd13ea04ce0542b4e905e43ba6a3"
|
|
18
18
|
}
|