@ibiz-template/vue3-components 0.5.3 → 0.5.6

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.
Files changed (35) hide show
  1. package/dist/{index-JryyIvVw.js → index-13Oh42A8.js} +1 -1
  2. package/dist/index-Sw1mQx8I.js +2 -0
  3. package/dist/{index-_-rmev8_.js → index-ZIuDbCjc.js} +1 -1
  4. package/dist/index.min.css +1 -1
  5. package/dist/index.system.min.js +1 -1
  6. package/dist/{xlsx-util-gLo7UcOH.js → xlsx-util-OwLxXdXL.js} +1 -1
  7. package/es/common/action-toolbar/action-toolbar.mjs +2 -1
  8. package/es/common/grid-setting/grid-setting.css +1 -1
  9. package/es/common/grid-setting/grid-setting.mjs +2 -2
  10. package/es/control/search-bar/search-groups/edit-group-util.mjs +1 -0
  11. package/es/control/search-bar/search-groups/new-group-util.mjs +8 -0
  12. package/es/control/search-bar/search-groups/search-groups.d.ts +1 -0
  13. package/es/control/search-bar/search-groups/search-groups.mjs +34 -14
  14. package/es/editor/autocomplete/ibiz-autocomplete/ibiz-autocomplete.mjs +21 -14
  15. package/es/editor/upload/ibiz-file-upload/ibiz-file-upload.d.ts +1 -0
  16. package/es/editor/upload/ibiz-file-upload/ibiz-file-upload.mjs +8 -3
  17. package/es/editor/upload/ibiz-image-upload/ibiz-image-upload.d.ts +1 -0
  18. package/es/editor/upload/ibiz-image-upload/ibiz-image-upload.mjs +8 -3
  19. package/es/locale/en/index.d.ts +3 -0
  20. package/es/locale/en/index.mjs +4 -1
  21. package/es/locale/zh-CN/index.d.ts +3 -0
  22. package/es/locale/zh-CN/index.mjs +4 -1
  23. package/lib/common/action-toolbar/action-toolbar.cjs +2 -1
  24. package/lib/common/grid-setting/grid-setting.cjs +2 -2
  25. package/lib/common/grid-setting/grid-setting.css +1 -1
  26. package/lib/control/search-bar/search-groups/edit-group-util.cjs +1 -0
  27. package/lib/control/search-bar/search-groups/new-group-util.cjs +8 -0
  28. package/lib/control/search-bar/search-groups/search-groups.cjs +34 -14
  29. package/lib/editor/autocomplete/ibiz-autocomplete/ibiz-autocomplete.cjs +21 -14
  30. package/lib/editor/upload/ibiz-file-upload/ibiz-file-upload.cjs +7 -2
  31. package/lib/editor/upload/ibiz-image-upload/ibiz-image-upload.cjs +7 -2
  32. package/lib/locale/en/index.cjs +4 -1
  33. package/lib/locale/zh-CN/index.cjs +4 -1
  34. package/package.json +5 -5
  35. package/dist/index-Pgs8_HX2.js +0 -2
@@ -115,7 +115,8 @@ const IBizActionToolbar = /* @__PURE__ */ defineComponent({
115
115
  }, {
116
116
  icon: () => createVNode("ion-icon", {
117
117
  "class": this.ns.e("icon"),
118
- "name": "ellipsis-vertical-outline"
118
+ "name": "ellipsis-vertical-outline",
119
+ "title": ibiz.i18n.t("component.actionToolbar.more")
119
120
  }, null)
120
121
  }), createVNode(resolveComponent("el-popover"), {
121
122
  "placement": "bottom-start",
@@ -1 +1 @@
1
- .ibiz-grid-setting-column-states{max-height:500px;overflow-y:auto}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state{display:flex;align-items:center;justify-content:flex-start;padding:var(--ibiz-spacing-extra-tight) 0;font-size:var(--ibiz-font-size-regular);cursor:pointer}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state.is-disabled{opacity:.5}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state img{display:inline-block;width:var(--ibiz-font-size-small);margin-right:var(--ibiz-spacing-extra-tight);font-size:var(--ibiz-font-size-regular);color:var(--ibiz-color-text-3)}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state-ghost{background-color:var(--ibiz-color-primary-light-default);opacity:.5}
1
+ .ibiz-grid-setting-column-states{max-height:500px;overflow-y:auto}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state{display:flex;align-items:center;justify-content:flex-start;padding:var(--ibiz-spacing-extra-tight) 0;font-size:var(--ibiz-font-size-regular);cursor:pointer}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state.is-disabled{opacity:.5}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state img{display:inline-block;width:var(--ibiz-font-size-small);margin-right:var(--ibiz-spacing-extra-tight);font-size:var(--ibiz-font-size-regular);color:var(--ibiz-color-text-3)}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state-ghost{background-color:var(--ibiz-color-primary-light-default);opacity:.5}.ibiz-grid-setting-set-icon{color:var(--ibiz-color-primary);cursor:pointer}
@@ -64,8 +64,8 @@ const IBizGridSetting = /* @__PURE__ */ defineComponent({
64
64
  }, {
65
65
  reference: () => {
66
66
  return createVNode("ion-icon", {
67
- "name": "settings-outline",
68
- "class": this.ns.b(),
67
+ "name": "ellipsis-vertical-outline",
68
+ "class": this.ns.b("set-icon"),
69
69
  "title": ibiz.i18n.t("component.gridSetting.hideControl")
70
70
  }, null);
71
71
  },
@@ -28,6 +28,7 @@ function useEditGroup(c) {
28
28
  }
29
29
  }
30
30
  }
31
+ ibiz.message.success("\u66F4\u65B0\u6210\u529F\uFF01");
31
32
  editDialogVisible.value = false;
32
33
  }
33
34
  }
@@ -21,9 +21,17 @@ function useNewGroup(c) {
21
21
  await newFormRef.value.validate(
22
22
  async (valid, _fields) => {
23
23
  if (valid) {
24
+ const sameCaptionGroup = c.state.searchBarGroups.find((group) => {
25
+ return group.caption === newForm.caption;
26
+ });
27
+ if (sameCaptionGroup) {
28
+ ibiz.message.error("\u5206\u7EC4\u540D\u79F0\u4E0D\u80FD\u91CD\u590D\uFF01");
29
+ return;
30
+ }
24
31
  await c.service.create(newForm.caption);
25
32
  handleNewFormCancel();
26
33
  await c.initSearBarGroups();
34
+ ibiz.message.success("\u65B0\u5EFA\u6210\u529F\uFF01");
27
35
  }
28
36
  }
29
37
  );
@@ -31,6 +31,7 @@ export declare const SearchGroups: import("vue").DefineComponent<{
31
31
  removeGroup: (groupItem: IBackendSearchBarGroup) => void;
32
32
  isActiveMore: import("vue").ComputedRef<boolean>;
33
33
  onDragChange: (evt: IData) => Promise<void>;
34
+ editLinkTitle: (groupItem: IBackendSearchBarGroup) => "" | "配置的分组不可编辑" | "请先保存该分组";
34
35
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
35
36
  controller: {
36
37
  type: PropType<SearchBarController>;
@@ -3,7 +3,7 @@ import { useNamespace } from '@ibiz-template/vue3-util';
3
3
  import './search-groups.css';
4
4
  import { ElMessageBox } from 'element-plus';
5
5
  import draggable from 'vuedraggable';
6
- import { cloneDeep } from 'lodash-es';
6
+ import { mergeInLeft } from '@ibiz-template/core';
7
7
  import { useNewGroup } from './new-group-util.mjs';
8
8
  import { useEditGroup } from './edit-group-util.mjs';
9
9
 
@@ -54,6 +54,15 @@ const SearchGroups = /* @__PURE__ */ defineComponent({
54
54
  }
55
55
  return false;
56
56
  });
57
+ const editLinkTitle = (groupItem) => {
58
+ if (groupItem.saved) {
59
+ if (groupItem.noEdit) {
60
+ return "\u914D\u7F6E\u7684\u5206\u7EC4\u4E0D\u53EF\u7F16\u8F91";
61
+ }
62
+ return "";
63
+ }
64
+ return "\u8BF7\u5148\u4FDD\u5B58\u8BE5\u5206\u7EC4";
65
+ };
57
66
  const onGroupClick = (item) => {
58
67
  c.handleGroupClick(item);
59
68
  };
@@ -66,7 +75,7 @@ const SearchGroups = /* @__PURE__ */ defineComponent({
66
75
  const editGroup = (groupItem) => {
67
76
  editDialogVisible.value = true;
68
77
  c.currentEditGroup = groupItem;
69
- editForm.caption = groupItem.caption || groupItem.id;
78
+ editForm.caption = groupItem.caption || groupItem.name;
70
79
  };
71
80
  const removeGroup = (groupItem) => {
72
81
  ElMessageBox({
@@ -76,7 +85,7 @@ const SearchGroups = /* @__PURE__ */ defineComponent({
76
85
  "class": ns.b("remove-dialog")
77
86
  }, [createVNode("div", {
78
87
  "class": ns.b("remove-dialog-content")
79
- }, [createTextVNode("\u786E\u8BA4\u5220\u9664\u5206\u7EC4"), createVNode("span", null, [groupItem.caption || groupItem.id]), createTextVNode("\u5417\uFF1F")]), createVNode("div", {
88
+ }, [createTextVNode("\u786E\u8BA4\u5220\u9664\u5206\u7EC4"), createVNode("span", null, [groupItem.caption || groupItem.name]), createTextVNode("\u5417\uFF1F")]), createVNode("div", {
80
89
  "class": ns.b("remove-dialog-tip")
81
90
  }, [createTextVNode("\u5206\u7EC4\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D")])]);
82
91
  },
@@ -89,11 +98,12 @@ const SearchGroups = /* @__PURE__ */ defineComponent({
89
98
  if (groupItem.id) {
90
99
  const res = await c.service.remove(groupItem.id);
91
100
  if (res.ok) {
92
- const index = c.state.searchBarGroups.findIndex((item) => item.id === groupItem.id);
101
+ const index = c.state.searchBarGroups.findIndex((item) => item.name === groupItem.name);
93
102
  if (index !== -1) {
94
103
  c.state.searchBarGroups.splice(index, 1);
95
104
  }
96
105
  }
106
+ ibiz.message.success("\u5220\u9664\u6210\u529F\uFF01");
97
107
  await c.initSearBarGroups();
98
108
  }
99
109
  }).catch(() => {
@@ -108,7 +118,7 @@ const SearchGroups = /* @__PURE__ */ defineComponent({
108
118
  const oldIndex = evt.moved.oldIndex;
109
119
  const startIndex = Math.min(newIndex, oldIndex);
110
120
  const endIndex = Math.max(newIndex, oldIndex) + 1;
111
- const changedSearchBarGroups = cloneDeep(c.state.searchBarGroups.slice(startIndex, endIndex));
121
+ const changedSearchBarGroups = c.state.searchBarGroups.slice(startIndex, endIndex);
112
122
  if (changedSearchBarGroups.length > 0) {
113
123
  const updateBatch = async () => {
114
124
  await c.service.updateBatch(changedSearchBarGroups);
@@ -116,10 +126,19 @@ const SearchGroups = /* @__PURE__ */ defineComponent({
116
126
  const unSavedGroups = changedSearchBarGroups.filter((group) => !group.saved);
117
127
  if (unSavedGroups.length) {
118
128
  const res = await c.service.createBatch(unSavedGroups);
119
- if (res.ok) {
129
+ if (res.ok && res.data && res.data[0]) {
130
+ const createBatchGroups = res.data[0];
131
+ if (createBatchGroups.length > 0) {
132
+ createBatchGroups.forEach((createGroup) => {
133
+ const newCreateGroup = changedSearchBarGroups.find((group) => group.name === createGroup.name);
134
+ if (newCreateGroup) {
135
+ mergeInLeft(newCreateGroup, createGroup);
136
+ }
137
+ });
138
+ }
120
139
  await updateBatch();
121
140
  unSavedGroups.forEach((group) => {
122
- const unSavedGroup = c.state.searchBarGroups.find((item) => item.id === group.id);
141
+ const unSavedGroup = c.state.searchBarGroups.find((item) => item.name === group.name);
123
142
  if (unSavedGroup) {
124
143
  unSavedGroup.saved = true;
125
144
  }
@@ -155,7 +174,8 @@ const SearchGroups = /* @__PURE__ */ defineComponent({
155
174
  editGroup,
156
175
  removeGroup,
157
176
  isActiveMore,
158
- onDragChange
177
+ onDragChange,
178
+ editLinkTitle
159
179
  };
160
180
  },
161
181
  render() {
@@ -165,9 +185,9 @@ const SearchGroups = /* @__PURE__ */ defineComponent({
165
185
  }, [(_a = this.showGroups) == null ? void 0 : _a.map((groupItem) => {
166
186
  var _a2;
167
187
  return createVNode("span", {
168
- "class": [this.ns.b("quick-group-item"), this.ns.is("selected", ((_a2 = this.c.state.selectedSearchGroupItem) == null ? void 0 : _a2.id) === groupItem.id)],
188
+ "class": [this.ns.b("quick-group-item"), this.ns.is("selected", ((_a2 = this.c.state.selectedSearchGroupItem) == null ? void 0 : _a2.name) === groupItem.name)],
169
189
  "onClick": () => this.onGroupClick(groupItem)
170
- }, [groupItem.caption || groupItem.id]);
190
+ }, [groupItem.caption || groupItem.name]);
171
191
  }), createVNode(resolveComponent("el-dropdown"), {
172
192
  "popper-class": this.ns.b("dropdown")
173
193
  }, {
@@ -187,7 +207,7 @@ const SearchGroups = /* @__PURE__ */ defineComponent({
187
207
  "name": "list-outline"
188
208
  }, null), createVNode("span", {
189
209
  "class": this.ns.b("item-caption")
190
- }, [groupItem.caption || groupItem.id]), ((_a2 = this.c.state.selectedSearchGroupItem) == null ? void 0 : _a2.id) === groupItem.id && createVNode("ion-icon", {
210
+ }, [groupItem.caption || groupItem.name]), ((_a2 = this.c.state.selectedSearchGroupItem) == null ? void 0 : _a2.name) === groupItem.name && createVNode("ion-icon", {
191
211
  "name": "checkmark-outline"
192
212
  }, null)];
193
213
  }
@@ -344,7 +364,7 @@ const SearchGroups = /* @__PURE__ */ defineComponent({
344
364
  "class": this.ns.b("table-row")
345
365
  }, [createVNode("div", {
346
366
  "class": this.ns.b("name")
347
- }, [groupItem.caption || groupItem.id]), createVNode("div", {
367
+ }, [groupItem.caption || groupItem.name]), createVNode("div", {
348
368
  "class": this.ns.b("show")
349
369
  }, [createVNode(resolveComponent("el-switch"), {
350
370
  "modelValue": groupItem.show,
@@ -353,8 +373,8 @@ const SearchGroups = /* @__PURE__ */ defineComponent({
353
373
  "class": this.ns.b("action")
354
374
  }, [createVNode(resolveComponent("el-link"), {
355
375
  "type": "primary",
356
- "disabled": !groupItem.saved,
357
- "title": !groupItem.saved ? "\u8BF7\u5148\u4FDD\u5B58\u8BE5\u5206\u7EC4" : "",
376
+ "disabled": !groupItem.saved || groupItem.noEdit,
377
+ "title": this.editLinkTitle(groupItem),
358
378
  "onClick": () => this.editGroup(groupItem)
359
379
  }, {
360
380
  default: () => [createTextVNode("\u7F16\u8F91")]
@@ -19,6 +19,7 @@ const IBizAutoComplete = /* @__PURE__ */ defineComponent({
19
19
  const isShowAll = ref(true);
20
20
  const isEditable = ref(false);
21
21
  const editorRef = ref();
22
+ const isSearched = ref(false);
22
23
  const showFormDefaultContent = computed(() => {
23
24
  if (props.controlParams && props.controlParams.editmode === "hover") {
24
25
  return true;
@@ -42,8 +43,24 @@ const IBizAutoComplete = /* @__PURE__ */ defineComponent({
42
43
  }, 100);
43
44
  }
44
45
  };
45
- watch(() => props.value, (newVal) => {
46
+ const onSearch = async (query, cb) => {
47
+ if (c.model.appDataEntityId) {
48
+ const trimQuery = query.trim();
49
+ const res = await c.getServiceData(trimQuery, props.data);
50
+ if (res) {
51
+ items.value = res.data;
52
+ isSearched.value = true;
53
+ if (cb && cb instanceof Function) {
54
+ cb(items.value);
55
+ }
56
+ }
57
+ }
58
+ };
59
+ watch(() => props.value, async (newVal, oldVal) => {
46
60
  if (newVal || newVal === null) {
61
+ if (!isSearched.value && oldVal === void 0) {
62
+ await onSearch("");
63
+ }
47
64
  if (newVal === null) {
48
65
  curValue.value = "";
49
66
  }
@@ -71,19 +88,9 @@ const IBizAutoComplete = /* @__PURE__ */ defineComponent({
71
88
  isShowAll.value = true;
72
89
  setEditable(false);
73
90
  };
74
- const onSearch = async (query, cb) => {
75
- if (c.model.appDataEntityId) {
76
- const trimQuery = query.trim();
77
- const res = await c.getServiceData(trimQuery, props.data);
78
- if (res) {
79
- items.value = res.data;
80
- if (cb && cb instanceof Function) {
81
- cb(items.value);
82
- }
83
- }
84
- }
85
- };
86
- onSearch("");
91
+ if (props.value) {
92
+ onSearch("");
93
+ }
87
94
  const onClear = () => {
88
95
  const dataItems = c.dataItems;
89
96
  if (dataItems.length > 0) {
@@ -40,6 +40,7 @@ export declare const IBizFileUpload: import("vue").DefineComponent<{
40
40
  onSuccess: (response: IData) => void;
41
41
  beforeUpload: () => void;
42
42
  isGridEditor: import("vue").ComputedRef<boolean>;
43
+ componentRef: import("vue").Ref<any>;
43
44
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
44
45
  change: (_value: unknown, _name?: string | undefined) => boolean;
45
46
  blur: (_event?: IData | undefined) => boolean;
@@ -1,5 +1,5 @@
1
1
  import { computed, resolveComponent, createTextVNode, createVNode, defineComponent } from 'vue';
2
- import { getUploadProps, getEditorEmits, useNamespace } from '@ibiz-template/vue3-util';
2
+ import { getUploadProps, getEditorEmits, useNamespace, useFocusAndBlur } from '@ibiz-template/vue3-util';
3
3
  import './ibiz-file-upload.css';
4
4
  import { useIViewUpload } from '../use/use-iview-upload.mjs';
5
5
 
@@ -33,6 +33,9 @@ const IBizFileUpload = /* @__PURE__ */ defineComponent({
33
33
  const isGridEditor = computed(() => {
34
34
  return !!c.parent.model.columnType;
35
35
  });
36
+ const {
37
+ componentRef
38
+ } = useFocusAndBlur(() => emit("focus"), () => emit("blur"));
36
39
  return {
37
40
  ns,
38
41
  c,
@@ -46,12 +49,14 @@ const IBizFileUpload = /* @__PURE__ */ defineComponent({
46
49
  onRemove,
47
50
  onSuccess,
48
51
  beforeUpload,
49
- isGridEditor
52
+ isGridEditor,
53
+ componentRef
50
54
  };
51
55
  },
52
56
  render() {
53
57
  return createVNode("div", {
54
- "class": [this.ns.b(), this.disabled ? this.ns.m("disabled") : "", this.readonly ? this.ns.m("readonly") : ""]
58
+ "class": [this.ns.b(), this.disabled ? this.ns.m("disabled") : "", this.readonly ? this.ns.m("readonly") : ""],
59
+ "ref": "componentRef"
55
60
  }, [createVNode(resolveComponent("el-upload"), {
56
61
  "class": [this.ns.b("icon"), this.ns.is("not-show", this.noUploadIcon)],
57
62
  "file-list": this.files,
@@ -43,6 +43,7 @@ export declare const IBizImageUpload: import("vue").DefineComponent<{
43
43
  onDownload: (file: IData) => void;
44
44
  onDialogVisibleChange: (value: boolean) => void;
45
45
  onPreview: (file: IData) => void;
46
+ componentRef: import("vue").Ref<any>;
46
47
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
47
48
  change: (_value: unknown, _name?: string | undefined) => boolean;
48
49
  blur: (_event?: IData | undefined) => boolean;
@@ -1,5 +1,5 @@
1
1
  import { ref, computed, createVNode, resolveComponent, defineComponent } from 'vue';
2
- import { getUploadProps, getEditorEmits, useNamespace } from '@ibiz-template/vue3-util';
2
+ import { getUploadProps, getEditorEmits, useNamespace, useFocusAndBlur } from '@ibiz-template/vue3-util';
3
3
  import './ibiz-image-upload.css';
4
4
  import { useIViewUpload } from '../use/use-iview-upload.mjs';
5
5
 
@@ -38,6 +38,9 @@ const IBizImageUpload = /* @__PURE__ */ defineComponent({
38
38
  const noUploadIcon = computed(() => {
39
39
  return limit.value === 1 && files.value.length === 1;
40
40
  });
41
+ const {
42
+ componentRef
43
+ } = useFocusAndBlur(() => emit("focus"), () => emit("blur"));
41
44
  return {
42
45
  ns,
43
46
  c,
@@ -54,12 +57,14 @@ const IBizImageUpload = /* @__PURE__ */ defineComponent({
54
57
  onRemove,
55
58
  onDownload,
56
59
  onDialogVisibleChange,
57
- onPreview
60
+ onPreview,
61
+ componentRef
58
62
  };
59
63
  },
60
64
  render() {
61
65
  return createVNode("div", {
62
- "class": [this.ns.b(), this.disabled ? this.ns.m("disabled") : "", this.readonly ? this.ns.m("readonly") : ""]
66
+ "class": [this.ns.b(), this.disabled ? this.ns.m("disabled") : "", this.readonly ? this.ns.m("readonly") : ""],
67
+ "ref": "componentRef"
63
68
  }, [createVNode("div", {
64
69
  "class": this.ns.e("image-upload-list")
65
70
  }, [this.files.map((item) => createVNode("div", {
@@ -99,6 +99,9 @@ declare const _default: {
99
99
  gridSetting: {
100
100
  hideControl: string;
101
101
  };
102
+ actionToolbar: {
103
+ more: string;
104
+ };
102
105
  };
103
106
  editor: {};
104
107
  };
@@ -102,7 +102,10 @@ var index = {
102
102
  noSupportVideo: "Your browser does not support video tags"
103
103
  },
104
104
  gridSetting: {
105
- hideControl: "Table Column Hide Control"
105
+ hideControl: "Column selection"
106
+ },
107
+ actionToolbar: {
108
+ more: "More"
106
109
  }
107
110
  },
108
111
  // 编辑器
@@ -99,6 +99,9 @@ declare const _default: {
99
99
  gridSetting: {
100
100
  hideControl: string;
101
101
  };
102
+ actionToolbar: {
103
+ more: string;
104
+ };
102
105
  };
103
106
  editor: {};
104
107
  };
@@ -102,7 +102,10 @@ var index = {
102
102
  noSupportVideo: "\u4F60\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301video\u6807\u7B7E"
103
103
  },
104
104
  gridSetting: {
105
- hideControl: "\u8868\u683C\u5217\u9690\u85CF\u63A7\u5236"
105
+ hideControl: "\u5217\u9009\u62E9"
106
+ },
107
+ actionToolbar: {
108
+ more: "\u66F4\u591A"
106
109
  }
107
110
  },
108
111
  // 编辑器
@@ -117,7 +117,8 @@ const IBizActionToolbar = /* @__PURE__ */ vue.defineComponent({
117
117
  }, {
118
118
  icon: () => vue.createVNode("ion-icon", {
119
119
  "class": this.ns.e("icon"),
120
- "name": "ellipsis-vertical-outline"
120
+ "name": "ellipsis-vertical-outline",
121
+ "title": ibiz.i18n.t("component.actionToolbar.more")
121
122
  }, null)
122
123
  }), vue.createVNode(vue.resolveComponent("el-popover"), {
123
124
  "placement": "bottom-start",
@@ -66,8 +66,8 @@ const IBizGridSetting = /* @__PURE__ */ vue.defineComponent({
66
66
  }, {
67
67
  reference: () => {
68
68
  return vue.createVNode("ion-icon", {
69
- "name": "settings-outline",
70
- "class": this.ns.b(),
69
+ "name": "ellipsis-vertical-outline",
70
+ "class": this.ns.b("set-icon"),
71
71
  "title": ibiz.i18n.t("component.gridSetting.hideControl")
72
72
  }, null);
73
73
  },
@@ -1 +1 @@
1
- .ibiz-grid-setting-column-states{max-height:500px;overflow-y:auto}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state{display:flex;align-items:center;justify-content:flex-start;padding:var(--ibiz-spacing-extra-tight) 0;font-size:var(--ibiz-font-size-regular);cursor:pointer}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state.is-disabled{opacity:.5}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state img{display:inline-block;width:var(--ibiz-font-size-small);margin-right:var(--ibiz-spacing-extra-tight);font-size:var(--ibiz-font-size-regular);color:var(--ibiz-color-text-3)}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state-ghost{background-color:var(--ibiz-color-primary-light-default);opacity:.5}
1
+ .ibiz-grid-setting-column-states{max-height:500px;overflow-y:auto}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state{display:flex;align-items:center;justify-content:flex-start;padding:var(--ibiz-spacing-extra-tight) 0;font-size:var(--ibiz-font-size-regular);cursor:pointer}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state.is-disabled{opacity:.5}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state img{display:inline-block;width:var(--ibiz-font-size-small);margin-right:var(--ibiz-spacing-extra-tight);font-size:var(--ibiz-font-size-regular);color:var(--ibiz-color-text-3)}.ibiz-grid-setting-column-states .ibiz-grid-setting-column-state-ghost{background-color:var(--ibiz-color-primary-light-default);opacity:.5}.ibiz-grid-setting-set-icon{color:var(--ibiz-color-primary);cursor:pointer}
@@ -30,6 +30,7 @@ function useEditGroup(c) {
30
30
  }
31
31
  }
32
32
  }
33
+ ibiz.message.success("\u66F4\u65B0\u6210\u529F\uFF01");
33
34
  editDialogVisible.value = false;
34
35
  }
35
36
  }
@@ -23,9 +23,17 @@ function useNewGroup(c) {
23
23
  await newFormRef.value.validate(
24
24
  async (valid, _fields) => {
25
25
  if (valid) {
26
+ const sameCaptionGroup = c.state.searchBarGroups.find((group) => {
27
+ return group.caption === newForm.caption;
28
+ });
29
+ if (sameCaptionGroup) {
30
+ ibiz.message.error("\u5206\u7EC4\u540D\u79F0\u4E0D\u80FD\u91CD\u590D\uFF01");
31
+ return;
32
+ }
26
33
  await c.service.create(newForm.caption);
27
34
  handleNewFormCancel();
28
35
  await c.initSearBarGroups();
36
+ ibiz.message.success("\u65B0\u5EFA\u6210\u529F\uFF01");
29
37
  }
30
38
  }
31
39
  );
@@ -5,7 +5,7 @@ var vue3Util = require('@ibiz-template/vue3-util');
5
5
  require('./search-groups.css');
6
6
  var ElementPlus = require('element-plus');
7
7
  var draggable = require('vuedraggable');
8
- var lodashEs = require('lodash-es');
8
+ var core = require('@ibiz-template/core');
9
9
  var newGroupUtil = require('./new-group-util.cjs');
10
10
  var editGroupUtil = require('./edit-group-util.cjs');
11
11
 
@@ -56,6 +56,15 @@ const SearchGroups = /* @__PURE__ */ vue.defineComponent({
56
56
  }
57
57
  return false;
58
58
  });
59
+ const editLinkTitle = (groupItem) => {
60
+ if (groupItem.saved) {
61
+ if (groupItem.noEdit) {
62
+ return "\u914D\u7F6E\u7684\u5206\u7EC4\u4E0D\u53EF\u7F16\u8F91";
63
+ }
64
+ return "";
65
+ }
66
+ return "\u8BF7\u5148\u4FDD\u5B58\u8BE5\u5206\u7EC4";
67
+ };
59
68
  const onGroupClick = (item) => {
60
69
  c.handleGroupClick(item);
61
70
  };
@@ -68,7 +77,7 @@ const SearchGroups = /* @__PURE__ */ vue.defineComponent({
68
77
  const editGroup = (groupItem) => {
69
78
  editDialogVisible.value = true;
70
79
  c.currentEditGroup = groupItem;
71
- editForm.caption = groupItem.caption || groupItem.id;
80
+ editForm.caption = groupItem.caption || groupItem.name;
72
81
  };
73
82
  const removeGroup = (groupItem) => {
74
83
  ElementPlus.ElMessageBox({
@@ -78,7 +87,7 @@ const SearchGroups = /* @__PURE__ */ vue.defineComponent({
78
87
  "class": ns.b("remove-dialog")
79
88
  }, [vue.createVNode("div", {
80
89
  "class": ns.b("remove-dialog-content")
81
- }, [vue.createTextVNode("\u786E\u8BA4\u5220\u9664\u5206\u7EC4"), vue.createVNode("span", null, [groupItem.caption || groupItem.id]), vue.createTextVNode("\u5417\uFF1F")]), vue.createVNode("div", {
90
+ }, [vue.createTextVNode("\u786E\u8BA4\u5220\u9664\u5206\u7EC4"), vue.createVNode("span", null, [groupItem.caption || groupItem.name]), vue.createTextVNode("\u5417\uFF1F")]), vue.createVNode("div", {
82
91
  "class": ns.b("remove-dialog-tip")
83
92
  }, [vue.createTextVNode("\u5206\u7EC4\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D")])]);
84
93
  },
@@ -91,11 +100,12 @@ const SearchGroups = /* @__PURE__ */ vue.defineComponent({
91
100
  if (groupItem.id) {
92
101
  const res = await c.service.remove(groupItem.id);
93
102
  if (res.ok) {
94
- const index = c.state.searchBarGroups.findIndex((item) => item.id === groupItem.id);
103
+ const index = c.state.searchBarGroups.findIndex((item) => item.name === groupItem.name);
95
104
  if (index !== -1) {
96
105
  c.state.searchBarGroups.splice(index, 1);
97
106
  }
98
107
  }
108
+ ibiz.message.success("\u5220\u9664\u6210\u529F\uFF01");
99
109
  await c.initSearBarGroups();
100
110
  }
101
111
  }).catch(() => {
@@ -110,7 +120,7 @@ const SearchGroups = /* @__PURE__ */ vue.defineComponent({
110
120
  const oldIndex = evt.moved.oldIndex;
111
121
  const startIndex = Math.min(newIndex, oldIndex);
112
122
  const endIndex = Math.max(newIndex, oldIndex) + 1;
113
- const changedSearchBarGroups = lodashEs.cloneDeep(c.state.searchBarGroups.slice(startIndex, endIndex));
123
+ const changedSearchBarGroups = c.state.searchBarGroups.slice(startIndex, endIndex);
114
124
  if (changedSearchBarGroups.length > 0) {
115
125
  const updateBatch = async () => {
116
126
  await c.service.updateBatch(changedSearchBarGroups);
@@ -118,10 +128,19 @@ const SearchGroups = /* @__PURE__ */ vue.defineComponent({
118
128
  const unSavedGroups = changedSearchBarGroups.filter((group) => !group.saved);
119
129
  if (unSavedGroups.length) {
120
130
  const res = await c.service.createBatch(unSavedGroups);
121
- if (res.ok) {
131
+ if (res.ok && res.data && res.data[0]) {
132
+ const createBatchGroups = res.data[0];
133
+ if (createBatchGroups.length > 0) {
134
+ createBatchGroups.forEach((createGroup) => {
135
+ const newCreateGroup = changedSearchBarGroups.find((group) => group.name === createGroup.name);
136
+ if (newCreateGroup) {
137
+ core.mergeInLeft(newCreateGroup, createGroup);
138
+ }
139
+ });
140
+ }
122
141
  await updateBatch();
123
142
  unSavedGroups.forEach((group) => {
124
- const unSavedGroup = c.state.searchBarGroups.find((item) => item.id === group.id);
143
+ const unSavedGroup = c.state.searchBarGroups.find((item) => item.name === group.name);
125
144
  if (unSavedGroup) {
126
145
  unSavedGroup.saved = true;
127
146
  }
@@ -157,7 +176,8 @@ const SearchGroups = /* @__PURE__ */ vue.defineComponent({
157
176
  editGroup,
158
177
  removeGroup,
159
178
  isActiveMore,
160
- onDragChange
179
+ onDragChange,
180
+ editLinkTitle
161
181
  };
162
182
  },
163
183
  render() {
@@ -167,9 +187,9 @@ const SearchGroups = /* @__PURE__ */ vue.defineComponent({
167
187
  }, [(_a = this.showGroups) == null ? void 0 : _a.map((groupItem) => {
168
188
  var _a2;
169
189
  return vue.createVNode("span", {
170
- "class": [this.ns.b("quick-group-item"), this.ns.is("selected", ((_a2 = this.c.state.selectedSearchGroupItem) == null ? void 0 : _a2.id) === groupItem.id)],
190
+ "class": [this.ns.b("quick-group-item"), this.ns.is("selected", ((_a2 = this.c.state.selectedSearchGroupItem) == null ? void 0 : _a2.name) === groupItem.name)],
171
191
  "onClick": () => this.onGroupClick(groupItem)
172
- }, [groupItem.caption || groupItem.id]);
192
+ }, [groupItem.caption || groupItem.name]);
173
193
  }), vue.createVNode(vue.resolveComponent("el-dropdown"), {
174
194
  "popper-class": this.ns.b("dropdown")
175
195
  }, {
@@ -189,7 +209,7 @@ const SearchGroups = /* @__PURE__ */ vue.defineComponent({
189
209
  "name": "list-outline"
190
210
  }, null), vue.createVNode("span", {
191
211
  "class": this.ns.b("item-caption")
192
- }, [groupItem.caption || groupItem.id]), ((_a2 = this.c.state.selectedSearchGroupItem) == null ? void 0 : _a2.id) === groupItem.id && vue.createVNode("ion-icon", {
212
+ }, [groupItem.caption || groupItem.name]), ((_a2 = this.c.state.selectedSearchGroupItem) == null ? void 0 : _a2.name) === groupItem.name && vue.createVNode("ion-icon", {
193
213
  "name": "checkmark-outline"
194
214
  }, null)];
195
215
  }
@@ -346,7 +366,7 @@ const SearchGroups = /* @__PURE__ */ vue.defineComponent({
346
366
  "class": this.ns.b("table-row")
347
367
  }, [vue.createVNode("div", {
348
368
  "class": this.ns.b("name")
349
- }, [groupItem.caption || groupItem.id]), vue.createVNode("div", {
369
+ }, [groupItem.caption || groupItem.name]), vue.createVNode("div", {
350
370
  "class": this.ns.b("show")
351
371
  }, [vue.createVNode(vue.resolveComponent("el-switch"), {
352
372
  "modelValue": groupItem.show,
@@ -355,8 +375,8 @@ const SearchGroups = /* @__PURE__ */ vue.defineComponent({
355
375
  "class": this.ns.b("action")
356
376
  }, [vue.createVNode(vue.resolveComponent("el-link"), {
357
377
  "type": "primary",
358
- "disabled": !groupItem.saved,
359
- "title": !groupItem.saved ? "\u8BF7\u5148\u4FDD\u5B58\u8BE5\u5206\u7EC4" : "",
378
+ "disabled": !groupItem.saved || groupItem.noEdit,
379
+ "title": this.editLinkTitle(groupItem),
360
380
  "onClick": () => this.editGroup(groupItem)
361
381
  }, {
362
382
  default: () => [vue.createTextVNode("\u7F16\u8F91")]
@@ -21,6 +21,7 @@ const IBizAutoComplete = /* @__PURE__ */ vue.defineComponent({
21
21
  const isShowAll = vue.ref(true);
22
22
  const isEditable = vue.ref(false);
23
23
  const editorRef = vue.ref();
24
+ const isSearched = vue.ref(false);
24
25
  const showFormDefaultContent = vue.computed(() => {
25
26
  if (props.controlParams && props.controlParams.editmode === "hover") {
26
27
  return true;
@@ -44,8 +45,24 @@ const IBizAutoComplete = /* @__PURE__ */ vue.defineComponent({
44
45
  }, 100);
45
46
  }
46
47
  };
47
- vue.watch(() => props.value, (newVal) => {
48
+ const onSearch = async (query, cb) => {
49
+ if (c.model.appDataEntityId) {
50
+ const trimQuery = query.trim();
51
+ const res = await c.getServiceData(trimQuery, props.data);
52
+ if (res) {
53
+ items.value = res.data;
54
+ isSearched.value = true;
55
+ if (cb && cb instanceof Function) {
56
+ cb(items.value);
57
+ }
58
+ }
59
+ }
60
+ };
61
+ vue.watch(() => props.value, async (newVal, oldVal) => {
48
62
  if (newVal || newVal === null) {
63
+ if (!isSearched.value && oldVal === void 0) {
64
+ await onSearch("");
65
+ }
49
66
  if (newVal === null) {
50
67
  curValue.value = "";
51
68
  }
@@ -73,19 +90,9 @@ const IBizAutoComplete = /* @__PURE__ */ vue.defineComponent({
73
90
  isShowAll.value = true;
74
91
  setEditable(false);
75
92
  };
76
- const onSearch = async (query, cb) => {
77
- if (c.model.appDataEntityId) {
78
- const trimQuery = query.trim();
79
- const res = await c.getServiceData(trimQuery, props.data);
80
- if (res) {
81
- items.value = res.data;
82
- if (cb && cb instanceof Function) {
83
- cb(items.value);
84
- }
85
- }
86
- }
87
- };
88
- onSearch("");
93
+ if (props.value) {
94
+ onSearch("");
95
+ }
89
96
  const onClear = () => {
90
97
  const dataItems = c.dataItems;
91
98
  if (dataItems.length > 0) {