qidian-vue-ui 2.0.17 → 2.0.18

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,31 +1,31 @@
1
- .qd-columns-controller__title[data-v-f0e1d079] {
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-f0e1d079] {
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-f0e1d079] {
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-f0e1d079] {
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-f0e1d079] {
16
+ .qd-columns-controller__width-input[data-v-85b72687] {
17
17
  width: 100%;
18
18
  }
19
- .qd-columns-controller__help[data-v-f0e1d079] {
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-f0e1d079] {
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-f0e1d079] {
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-f0e1d079"]]);
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-78e20261] {
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-78e20261] {
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-78e20261] {
10
+ .qd-crud-table__body[data-v-d070eeff] {
11
11
  flex: auto;
12
12
  }
13
- .qd-crud-table__body[data-v-78e20261] > .t-loading__parent > .t-card__body {
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-78e20261] > .t-loading__parent > .t-card__body > .qd-service-table {
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-78e20261] > .t-loading__parent > .t-card__body > .qd-service-table .t-table__pagination {
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-78e20261] {
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-78e20261] {
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-78e20261] {
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-78e20261"]]);
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
- if (!cachedColumns.value) return original;
586
- return mergeColumnsWithCache(original, cachedColumns.value);
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qidian-vue-ui",
3
- "version": "2.0.17",
3
+ "version": "2.0.18",
4
4
  "description": "基于 TDesign 的 QiDian Vue UI 组件库",
5
5
  "author": "qidian",
6
6
  "license": "MIT",