qidian-vue-ui 2.0.17 → 2.0.19
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/dist/components/columns-controller/index.css +8 -8
- package/dist/components/columns-controller/index.vue.mjs +1 -1
- package/dist/components/columns-controller/index.vue2.mjs +6 -2
- package/dist/components/crud/table/index.css +9 -9
- package/dist/components/crud/table/index.vue.mjs +1 -1
- package/dist/components/crud/table/index.vue2.mjs +21 -4
- package/dist/components/service/table/edit-cell.mjs +18 -10
- package/package.json +1 -1
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
.qd-columns-controller__title[data-v-
|
|
1
|
+
.qd-columns-controller__title[data-v-85b72687] {
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
}
|
|
5
|
-
.qd-columns-controller__drag[data-v-
|
|
5
|
+
.qd-columns-controller__drag[data-v-85b72687] {
|
|
6
6
|
cursor: move;
|
|
7
7
|
margin-right: var(--td-comp-margin-m);
|
|
8
8
|
}
|
|
9
|
-
.qd-columns-controller__ghost[data-v-
|
|
9
|
+
.qd-columns-controller__ghost[data-v-85b72687] {
|
|
10
10
|
opacity: 0.5;
|
|
11
11
|
background: var(--td-brand-color-light);
|
|
12
12
|
}
|
|
13
|
-
.qd-columns-controller__chosen[data-v-
|
|
13
|
+
.qd-columns-controller__chosen[data-v-85b72687] {
|
|
14
14
|
background: var(--td-brand-color-light-hover);
|
|
15
15
|
}
|
|
16
|
-
.qd-columns-controller__width-input[data-v-
|
|
16
|
+
.qd-columns-controller__width-input[data-v-85b72687] {
|
|
17
17
|
width: 100%;
|
|
18
18
|
}
|
|
19
|
-
.qd-columns-controller__help[data-v-
|
|
19
|
+
.qd-columns-controller__help[data-v-85b72687] {
|
|
20
20
|
font-size: var(--td-font-size-title-large);
|
|
21
21
|
}
|
|
22
|
-
.qd-columns-controller__footer[data-v-
|
|
22
|
+
.qd-columns-controller__footer[data-v-85b72687] {
|
|
23
23
|
width: 100%;
|
|
24
24
|
display: flex;
|
|
25
25
|
justify-content: space-between;
|
|
26
26
|
align-items: center;
|
|
27
27
|
}
|
|
28
|
-
.qd-columns-controller__footer-actions[data-v-
|
|
28
|
+
.qd-columns-controller__footer-actions[data-v-85b72687] {
|
|
29
29
|
flex: 1 1 0;
|
|
30
30
|
overflow: hidden;
|
|
31
31
|
}
|
|
@@ -2,7 +2,7 @@ import './index.css'
|
|
|
2
2
|
import _sfc_main from "./index.vue2.mjs";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
5
|
-
const QdColumnsController = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
5
|
+
const QdColumnsController = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-85b72687"]]);
|
|
6
6
|
export {
|
|
7
7
|
QdColumnsController as default
|
|
8
8
|
};
|
|
@@ -57,6 +57,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
57
57
|
const dialogRef = useTemplateRef("dialog");
|
|
58
58
|
const tableRef = useTemplateRef("tableRef");
|
|
59
59
|
const flatColumns = ref([]);
|
|
60
|
+
const hasFormItemColumns = computed(() => hasFormItem(props.columns));
|
|
60
61
|
const tableColumns = [{
|
|
61
62
|
colKey: "title",
|
|
62
63
|
title: t("columnNameText"),
|
|
@@ -74,6 +75,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
74
75
|
fixed: "right"
|
|
75
76
|
}];
|
|
76
77
|
const selectedColKeys = computed(() => flatColumns.value.filter((c) => !c.hidden).map((c) => c.colKey));
|
|
78
|
+
function hasFormItem(columns2) {
|
|
79
|
+
return columns2?.some((column) => column.formItem || hasFormItem(column.children)) ?? false;
|
|
80
|
+
}
|
|
77
81
|
function handleSelectChange(selectedKeys) {
|
|
78
82
|
flatColumns.value.forEach((col) => {
|
|
79
83
|
col.hidden = !selectedKeys.includes(col.colKey);
|
|
@@ -216,7 +220,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
216
220
|
data: flatColumns.value,
|
|
217
221
|
columns: tableColumns,
|
|
218
222
|
"row-key": "colKey",
|
|
219
|
-
"select-type": "multiple",
|
|
223
|
+
"select-type": hasFormItemColumns.value ? void 0 : "multiple",
|
|
220
224
|
"selected-row-keys": selectedColKeys.value,
|
|
221
225
|
"select-on-row-click": false,
|
|
222
226
|
onSelectChange: handleSelectChange
|
|
@@ -287,7 +291,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
287
291
|
_: 2
|
|
288
292
|
}, 1024)]),
|
|
289
293
|
_: 1
|
|
290
|
-
}, 8, ["data", "selected-row-keys"])]),
|
|
294
|
+
}, 8, ["data", "select-type", "selected-row-keys"])]),
|
|
291
295
|
_: 1
|
|
292
296
|
}, 8, ["visible", "header"]);
|
|
293
297
|
};
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
.qd-crud-table[data-v-
|
|
1
|
+
.qd-crud-table[data-v-d070eeff] {
|
|
2
2
|
width: 100%;
|
|
3
3
|
height: 100%;
|
|
4
4
|
display: flex;
|
|
5
5
|
flex-direction: column;
|
|
6
6
|
}
|
|
7
|
-
.qd-crud-table > .qd-crud-search:not(.qd-crud-search--hide) + .qd-crud-table__body[data-v-
|
|
7
|
+
.qd-crud-table > .qd-crud-search:not(.qd-crud-search--hide) + .qd-crud-table__body[data-v-d070eeff] {
|
|
8
8
|
margin-top: var(--td-comp-margin-l);
|
|
9
9
|
}
|
|
10
|
-
.qd-crud-table__body[data-v-
|
|
10
|
+
.qd-crud-table__body[data-v-d070eeff] {
|
|
11
11
|
flex: auto;
|
|
12
12
|
}
|
|
13
|
-
.qd-crud-table__body[data-v-
|
|
13
|
+
.qd-crud-table__body[data-v-d070eeff] > .t-loading__parent > .t-card__body {
|
|
14
14
|
height: 100%;
|
|
15
15
|
min-height: 443px;
|
|
16
16
|
display: flex;
|
|
17
17
|
flex-direction: column;
|
|
18
18
|
}
|
|
19
|
-
.qd-crud-table__body[data-v-
|
|
19
|
+
.qd-crud-table__body[data-v-d070eeff] > .t-loading__parent > .t-card__body > .qd-service-table {
|
|
20
20
|
flex: 1 1 0;
|
|
21
21
|
overflow: hidden;
|
|
22
22
|
}
|
|
23
|
-
.qd-crud-table__body[data-v-
|
|
23
|
+
.qd-crud-table__body[data-v-d070eeff] > .t-loading__parent > .t-card__body > .qd-service-table .t-table__pagination {
|
|
24
24
|
padding-bottom: 0;
|
|
25
25
|
}
|
|
26
|
-
.qd-crud-table__toolbar[data-v-
|
|
26
|
+
.qd-crud-table__toolbar[data-v-d070eeff] {
|
|
27
27
|
display: flex;
|
|
28
28
|
justify-content: space-between;
|
|
29
29
|
}
|
|
30
|
-
.qd-crud-table__toolbar--has-space-item + .qd-service-table[data-v-
|
|
30
|
+
.qd-crud-table__toolbar--has-space-item + .qd-service-table[data-v-d070eeff] {
|
|
31
31
|
margin-top: var(--td-comp-margin-l);
|
|
32
32
|
}
|
|
33
|
-
.qd-crud-table__toolbar-separator[data-v-
|
|
33
|
+
.qd-crud-table__toolbar-separator[data-v-d070eeff] {
|
|
34
34
|
display: inline-block;
|
|
35
35
|
padding-left: var(--td-comp-paddingLR-s);
|
|
36
36
|
}
|
|
@@ -2,7 +2,7 @@ import './index.css'
|
|
|
2
2
|
import _sfc_main from "./index.vue2.mjs";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
5
|
-
const QdCrudTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
5
|
+
const QdCrudTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d070eeff"]]);
|
|
6
6
|
export {
|
|
7
7
|
QdCrudTable as default
|
|
8
8
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './index.css'
|
|
2
|
-
import { defineComponent, mergeDefaults, computed, reactive, useTemplateRef, ref, onMounted, onBeforeUnmount, createElementBlock, openBlock, renderSlot, createVNode, withDirectives, createCommentVNode, createBlock, unref, mergeProps, isRef, createSlots, renderList, withCtx, normalizeProps, guardReactiveProps, vShow, createElementVNode, normalizeClass, Fragment, withModifiers, nextTick, shallowRef, toRef, triggerRef } from "vue";
|
|
2
|
+
import { defineComponent, mergeDefaults, computed, reactive, useTemplateRef, ref, watch, onMounted, onBeforeUnmount, createElementBlock, openBlock, renderSlot, createVNode, withDirectives, createCommentVNode, createBlock, unref, mergeProps, isRef, createSlots, renderList, withCtx, normalizeProps, guardReactiveProps, vShow, createElementVNode, normalizeClass, Fragment, withModifiers, nextTick, shallowRef, toRef, triggerRef } from "vue";
|
|
3
3
|
import { useVModels, useLocalStorage } from "../../../node_modules/.pnpm/@vueuse_core@14.2.0_vue@3.5.26_typescript@5.9.3_/node_modules/@vueuse/core/dist/index.mjs";
|
|
4
4
|
import { MD5, easyCopy, suspectedWrapperPromise, createExposeProxy, extractSlotsWithPrefix, isEmpty, generateRandomString, to } from "qidian-shared";
|
|
5
5
|
import { SearchIcon, RefreshIcon, UnfoldLessIcon, UnfoldMoreIcon, SettingIcon, AddIcon, DeleteIcon } from "tdesign-icons-vue-next";
|
|
@@ -579,11 +579,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
579
579
|
return getColumnsStorageKey(key);
|
|
580
580
|
});
|
|
581
581
|
const cachedColumns = useLocalStorage(finalCacheColumnsKey, []);
|
|
582
|
+
const hasFormItemColumns = computed(() => hasFormItem(reProps.value.columns));
|
|
582
583
|
const mergeColumns = computed({
|
|
583
584
|
get: () => {
|
|
584
585
|
const original = reProps.value.columns;
|
|
585
|
-
|
|
586
|
-
|
|
586
|
+
const mergedColumns = cachedColumns.value ? mergeColumnsWithCache(original, cachedColumns.value) : original;
|
|
587
|
+
if (!hasFormItemColumns.value) return mergedColumns;
|
|
588
|
+
return mergedColumns.map((column) => ({
|
|
589
|
+
...column,
|
|
590
|
+
hidden: false
|
|
591
|
+
}));
|
|
587
592
|
},
|
|
588
593
|
set: (val) => {
|
|
589
594
|
cachedColumns.value = val.map(({
|
|
@@ -594,7 +599,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
594
599
|
fixed
|
|
595
600
|
}) => ({
|
|
596
601
|
colKey,
|
|
597
|
-
hidden,
|
|
602
|
+
hidden: hasFormItemColumns.value ? false : hidden,
|
|
598
603
|
width,
|
|
599
604
|
minWidth,
|
|
600
605
|
fixed
|
|
@@ -608,6 +613,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
608
613
|
const toolbarRef = useTemplateRef("toolbar");
|
|
609
614
|
const toolbarHasSpaceItem = ref(false);
|
|
610
615
|
let toolbarObserver = null;
|
|
616
|
+
function hasFormItem(columns) {
|
|
617
|
+
return columns?.some((column) => column.formItem || hasFormItem(column.children)) ?? false;
|
|
618
|
+
}
|
|
611
619
|
function handleSearch() {
|
|
612
620
|
searchMode = "changeCurrent";
|
|
613
621
|
}
|
|
@@ -1039,6 +1047,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1039
1047
|
function syncToolbarHasSpaceItem() {
|
|
1040
1048
|
toolbarHasSpaceItem.value = !!toolbarRef.value?.querySelector(".t-space-item");
|
|
1041
1049
|
}
|
|
1050
|
+
watch(hasFormItemColumns, (hasFormItem2) => {
|
|
1051
|
+
if (!hasFormItem2 || !cachedColumns.value?.some((column) => column.hidden)) return;
|
|
1052
|
+
cachedColumns.value = cachedColumns.value.map((column) => ({
|
|
1053
|
+
...column,
|
|
1054
|
+
hidden: false
|
|
1055
|
+
}));
|
|
1056
|
+
}, {
|
|
1057
|
+
immediate: true
|
|
1058
|
+
});
|
|
1042
1059
|
onMounted(() => {
|
|
1043
1060
|
syncToolbarHasSpaceItem();
|
|
1044
1061
|
const toolbarEl = toolbarRef.value;
|
|
@@ -128,6 +128,11 @@ const QdServiceTableEditCell = /* @__PURE__ */ defineComponent({
|
|
|
128
128
|
const {
|
|
129
129
|
t
|
|
130
130
|
} = useConfig("form");
|
|
131
|
+
const validationStatus = computed(() => {
|
|
132
|
+
const status = attrs.status;
|
|
133
|
+
if (status === "error" || status === "warning" || status === "success") return status;
|
|
134
|
+
return void 0;
|
|
135
|
+
});
|
|
131
136
|
const reIfRender = computed(() => {
|
|
132
137
|
const ifRender = props.formItem.ifRender;
|
|
133
138
|
if (isEmpty(ifRender)) return true;
|
|
@@ -152,11 +157,8 @@ const QdServiceTableEditCell = /* @__PURE__ */ defineComponent({
|
|
|
152
157
|
...props.lazy && props.active ? {
|
|
153
158
|
autofocus: true
|
|
154
159
|
} : {},
|
|
155
|
-
...
|
|
156
|
-
status:
|
|
157
|
-
} : {},
|
|
158
|
-
...attrs.tips ? {
|
|
159
|
-
tips: attrs.tips
|
|
160
|
+
...validationStatus.value ? {
|
|
161
|
+
status: validationStatus.value
|
|
160
162
|
} : {}
|
|
161
163
|
};
|
|
162
164
|
});
|
|
@@ -174,14 +176,20 @@ const QdServiceTableEditCell = /* @__PURE__ */ defineComponent({
|
|
|
174
176
|
delete rendererAttrs.status;
|
|
175
177
|
delete rendererAttrs.tips;
|
|
176
178
|
delete rendererAttrs.onChange;
|
|
177
|
-
|
|
179
|
+
const status = validationStatus.value;
|
|
180
|
+
return h("div", {
|
|
178
181
|
...rendererAttrs,
|
|
179
|
-
class: "qd-service-table__cell-editor",
|
|
182
|
+
class: ["qd-service-table__cell-editor", "t-form__controls", status ? `t-is-${status}` : void 0, status === "success" ? "t-form--success-border" : void 0],
|
|
183
|
+
onFocusin: props.activate
|
|
184
|
+
}, [h("div", {
|
|
185
|
+
class: "t-form__controls-content"
|
|
186
|
+
}, [h(_sfc_main, {
|
|
180
187
|
config: component.value,
|
|
181
188
|
context: currentContext.value,
|
|
182
|
-
crudMode: props.formItem.crudMode
|
|
183
|
-
|
|
184
|
-
|
|
189
|
+
crudMode: props.formItem.crudMode
|
|
190
|
+
})]), attrs.tips ? h("div", {
|
|
191
|
+
class: ["t-tips", status ? `t-is-${status}` : "t-is-default"]
|
|
192
|
+
}, attrs.tips) : void 0]);
|
|
185
193
|
};
|
|
186
194
|
}
|
|
187
195
|
});
|