ct-component-plus 0.0.37 → 0.0.38
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/package.json
CHANGED
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
:clear-icon="clearIcon"
|
|
8
8
|
:prefix-icon="prefixIcon"
|
|
9
9
|
:unlink-panels="unlinkPanels"
|
|
10
|
-
v-bind="rawAttr"
|
|
11
|
-
>
|
|
10
|
+
v-bind="rawAttr">
|
|
12
11
|
<template #default="cell">
|
|
13
12
|
<slot v-bind="cell"></slot>
|
|
14
13
|
</template>
|
|
@@ -32,10 +31,13 @@ const showValue = computed({
|
|
|
32
31
|
set(newValue) {
|
|
33
32
|
let val = newValue;
|
|
34
33
|
const defaultCount = 24 * 60 * 60 * 1000 - 1000;
|
|
34
|
+
const rawType = props.rawAttr?.type || attr.type;
|
|
35
35
|
try {
|
|
36
36
|
if (props.valueFormat === "x") {
|
|
37
37
|
if (isFunction(props.addTimestamp)) {
|
|
38
38
|
val = props.addTimestamp(val);
|
|
39
|
+
} else if (rawType?.includes && rawType.includes("time")) {
|
|
40
|
+
// 包含自己选时间的情况,不需要添加默认的时间戳
|
|
39
41
|
} else if (isArray(val)) {
|
|
40
42
|
if (isArray(props.addTimestamp)) {
|
|
41
43
|
val = val.map((item, index) => {
|
|
@@ -72,5 +74,4 @@ useBuriedParams(props, emit, {
|
|
|
72
74
|
});
|
|
73
75
|
onMounted(() => {});
|
|
74
76
|
</script>
|
|
75
|
-
<style lang=
|
|
76
|
-
</style>
|
|
77
|
+
<style lang="less"></style>
|
|
@@ -237,6 +237,7 @@ export default {
|
|
|
237
237
|
});
|
|
238
238
|
}
|
|
239
239
|
const ns = useNamespace("page-component");
|
|
240
|
+
console.log(slots);
|
|
240
241
|
expose({
|
|
241
242
|
searchMethod,
|
|
242
243
|
searchRef,
|
|
@@ -257,7 +258,7 @@ export default {
|
|
|
257
258
|
slots.header
|
|
258
259
|
? slots.header()
|
|
259
260
|
: h("div", { class: ns.em("header", "default") }, [
|
|
260
|
-
slots
|
|
261
|
+
slots["header-before"] ? slots["header-before"]() : null,
|
|
261
262
|
h("div", { class: ns.e("search") }, [
|
|
262
263
|
h(
|
|
263
264
|
SearchBox,
|
|
@@ -269,7 +270,7 @@ export default {
|
|
|
269
270
|
{ ...getSelfSlots("search") }
|
|
270
271
|
),
|
|
271
272
|
]),
|
|
272
|
-
slots
|
|
273
|
+
slots["header-after"] ? slots["header-after"]() : null,
|
|
273
274
|
]),
|
|
274
275
|
]),
|
|
275
276
|
h("div", { class: ns.e("content") }, [
|
|
@@ -287,9 +288,11 @@ export default {
|
|
|
287
288
|
{ "is-load": state.pageLoading, ...props.loadProps },
|
|
288
289
|
{
|
|
289
290
|
default: () => [
|
|
290
|
-
slots
|
|
291
|
-
|
|
292
|
-
|
|
291
|
+
slots["content-before"]
|
|
292
|
+
? slots["content-before"]()
|
|
293
|
+
: null,
|
|
294
|
+
slots["table-top"]
|
|
295
|
+
? slots["table-top"]()
|
|
293
296
|
: h(
|
|
294
297
|
TableTitle,
|
|
295
298
|
{
|
|
@@ -306,8 +309,13 @@ export default {
|
|
|
306
309
|
ref: tableTitleRef,
|
|
307
310
|
},
|
|
308
311
|
{
|
|
309
|
-
|
|
310
|
-
|
|
312
|
+
"table-title": slots["table-title"],
|
|
313
|
+
"table-desc": slots["table-desc"],
|
|
314
|
+
"table-handle": slots["table-handle"],
|
|
315
|
+
"table-handle-before":
|
|
316
|
+
slots["table-handle-before"],
|
|
317
|
+
"table-handle-after":
|
|
318
|
+
slots["table-handle-after"],
|
|
311
319
|
}
|
|
312
320
|
),
|
|
313
321
|
h("div", { class: ns.e("table") }, [
|
|
@@ -330,7 +338,9 @@ export default {
|
|
|
330
338
|
ref: paginationRef,
|
|
331
339
|
}),
|
|
332
340
|
]),
|
|
333
|
-
slots
|
|
341
|
+
slots["content-after"]
|
|
342
|
+
? slots["content-after"]()
|
|
343
|
+
: null,
|
|
334
344
|
],
|
|
335
345
|
}
|
|
336
346
|
),
|
|
@@ -165,6 +165,15 @@ let spanObj = {};
|
|
|
165
165
|
watch(
|
|
166
166
|
() => props.mergeList,
|
|
167
167
|
(newVal, oldVal) => {
|
|
168
|
+
/**
|
|
169
|
+
* 将数组型的合并单元格数据转换成对象型,转换示例如下:
|
|
170
|
+
* {row: 1, col: 1, span: [2, 2]} =>
|
|
171
|
+
* {
|
|
172
|
+
* 1: { 1: [2,2], 2: [0,0] },
|
|
173
|
+
* 2: { 1: [0,0], 2: [0,0] }
|
|
174
|
+
* }
|
|
175
|
+
* 这里的合并数据对象的第一层的key表示对应的行,第二层的key对应的是列, 行和列都是从1开始的索引
|
|
176
|
+
*/
|
|
168
177
|
let spanObjRes = {};
|
|
169
178
|
if (Array.isArray(newVal)) {
|
|
170
179
|
newVal.forEach((item) => {
|