@ibiz-template/vue3-components 0.7.4 → 0.7.5

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 (61) hide show
  1. package/dist/index-QdhEqiEH.js +4 -0
  2. package/dist/index.min.css +1 -1
  3. package/dist/index.system.min.js +1 -1
  4. package/dist/{xlsx-util-UXWgtlzc.js → xlsx-util-iqcGVBHE.js} +1 -1
  5. package/es/common/rawitem/rawitem.mjs +5 -3
  6. package/es/common/view-message/view-message.d.ts +1 -0
  7. package/es/common/view-message/view-message.mjs +5 -1
  8. package/es/control/app-menu/app-menu.mjs +5 -3
  9. package/es/control/drbar/drbar.mjs +9 -4
  10. package/es/control/drtab/drtab.controller.mjs +3 -0
  11. package/es/control/drtab/drtab.mjs +17 -5
  12. package/es/control/form/form-detail/form-tab-panel/form-tab-panel.mjs +5 -4
  13. package/es/control/grid/grid/grid-control.util.d.ts +3 -0
  14. package/es/control/grid/grid/grid-control.util.mjs +97 -1
  15. package/es/control/grid/grid/grid.mjs +8 -1
  16. package/es/control/grid/grid/index.mjs +1 -1
  17. package/es/control/grid/grid-column/grid-field-column/grid-field-column.d.ts +1 -0
  18. package/es/control/grid/grid-column/grid-field-column/grid-field-column.mjs +14 -3
  19. package/es/control/grid/grid-column/grid-field-column/index.d.ts +1 -0
  20. package/es/control/grid/index.mjs +1 -1
  21. package/es/control/index.mjs +1 -1
  22. package/es/control/tree/tree.mjs +9 -4
  23. package/es/editor/autocomplete/ibiz-autocomplete/ibiz-autocomplete.mjs +1 -1
  24. package/es/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.mjs +7 -1
  25. package/es/editor/code/monaco-editor/monaco-editor.mjs +13 -1
  26. package/es/editor/data-picker/ibiz-picker/ibiz-picker.mjs +1 -1
  27. package/es/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.mjs +7 -1
  28. package/es/editor/list-box/ibiz-list-box/ibiz-list-box.mjs +7 -1
  29. package/es/editor/radio-button-list/ibiz-radio/ibiz-radio.mjs +7 -1
  30. package/es/editor/span/span/span.mjs +7 -1
  31. package/es/index.mjs +1 -1
  32. package/es/panel-component/nav-pos-index/nav-pos-index.controller.d.ts +27 -0
  33. package/es/panel-component/nav-pos-index/nav-pos-index.controller.mjs +43 -0
  34. package/es/panel-component/nav-pos-index/nav-pos-index.mjs +3 -0
  35. package/lib/common/rawitem/rawitem.cjs +5 -3
  36. package/lib/common/view-message/view-message.cjs +5 -1
  37. package/lib/control/app-menu/app-menu.cjs +5 -3
  38. package/lib/control/drbar/drbar.cjs +8 -3
  39. package/lib/control/drtab/drtab.cjs +16 -4
  40. package/lib/control/drtab/drtab.controller.cjs +3 -0
  41. package/lib/control/form/form-detail/form-tab-panel/form-tab-panel.cjs +5 -4
  42. package/lib/control/grid/grid/grid-control.util.cjs +97 -0
  43. package/lib/control/grid/grid/grid.cjs +7 -0
  44. package/lib/control/grid/grid/index.cjs +1 -0
  45. package/lib/control/grid/grid-column/grid-field-column/grid-field-column.cjs +13 -2
  46. package/lib/control/grid/index.cjs +1 -0
  47. package/lib/control/index.cjs +1 -0
  48. package/lib/control/tree/tree.cjs +8 -3
  49. package/lib/editor/autocomplete/ibiz-autocomplete/ibiz-autocomplete.cjs +1 -1
  50. package/lib/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.cjs +6 -0
  51. package/lib/editor/code/monaco-editor/monaco-editor.cjs +13 -1
  52. package/lib/editor/data-picker/ibiz-picker/ibiz-picker.cjs +1 -1
  53. package/lib/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.cjs +6 -0
  54. package/lib/editor/list-box/ibiz-list-box/ibiz-list-box.cjs +6 -0
  55. package/lib/editor/radio-button-list/ibiz-radio/ibiz-radio.cjs +6 -0
  56. package/lib/editor/span/span/span.cjs +6 -0
  57. package/lib/index.cjs +1 -0
  58. package/lib/panel-component/nav-pos-index/nav-pos-index.cjs +3 -0
  59. package/lib/panel-component/nav-pos-index/nav-pos-index.controller.cjs +43 -0
  60. package/package.json +6 -6
  61. package/dist/index-36xAWDJE.js +0 -4
@@ -35,6 +35,14 @@ export declare class NavPosIndexController extends PanelItemController<IPanelRaw
35
35
  * @type {boolean}
36
36
  */
37
37
  autoGoLast: boolean;
38
+ /**
39
+ * 无缓存
40
+ * @author lxm
41
+ * @date 2024-04-22 04:12:41
42
+ * @readonly
43
+ * @type {boolean}
44
+ */
45
+ noCache: boolean;
38
46
  protected createState(): NavPosIndexState;
39
47
  setRouter(router: Router): void;
40
48
  /**
@@ -60,6 +68,16 @@ export declare class NavPosIndexController extends PanelItemController<IPanelRaw
60
68
  * @type {(IAppMenuController | undefined)}
61
69
  */
62
70
  get appmenu(): IAppMenuController | undefined;
71
+ /**
72
+ * 自定义补充参数
73
+ *
74
+ * @author zk
75
+ * @date 2023-09-27 03:09:02
76
+ * @type {IData}
77
+ * @memberof NavPosController
78
+ */
79
+ rawItemParams: IData;
80
+ protected onInit(): Promise<void>;
63
81
  /**
64
82
  * 改变显示视图
65
83
  * @author lxm
@@ -124,4 +142,13 @@ export declare class NavPosIndexController extends PanelItemController<IPanelRaw
124
142
  * @protected
125
143
  */
126
144
  protected goLast(): void;
145
+ /**
146
+ * 处理自定义补充参数 [{key:'name',value:'data'}] => {name:'data'}
147
+ *
148
+ * @author zk
149
+ * @date 2023-09-27 03:09:55
150
+ * @protected
151
+ * @memberof NavPosController
152
+ */
153
+ protected handleRawItemParams(): void;
127
154
  }
@@ -1,5 +1,6 @@
1
1
  import { PanelItemController, ViewMode, Modal } from '@ibiz-template/runtime';
2
2
  import { routerCallback } from '@ibiz-template/vue3-util';
3
+ import { notNilEmpty } from 'qx-util';
3
4
  import { NavPosIndexState } from './nav-pos-index.state.mjs';
4
5
 
5
6
  "use strict";
@@ -33,6 +34,23 @@ class NavPosIndexController extends PanelItemController {
33
34
  * @type {boolean}
34
35
  */
35
36
  __publicField(this, "autoGoLast", true);
37
+ /**
38
+ * 无缓存
39
+ * @author lxm
40
+ * @date 2024-04-22 04:12:41
41
+ * @readonly
42
+ * @type {boolean}
43
+ */
44
+ __publicField(this, "noCache", false);
45
+ /**
46
+ * 自定义补充参数
47
+ *
48
+ * @author zk
49
+ * @date 2023-09-27 03:09:02
50
+ * @type {IData}
51
+ * @memberof NavPosController
52
+ */
53
+ __publicField(this, "rawItemParams", {});
36
54
  }
37
55
  createState() {
38
56
  var _a;
@@ -70,6 +88,11 @@ class NavPosIndexController extends PanelItemController {
70
88
  get appmenu() {
71
89
  return this.panel.getController("appmenu");
72
90
  }
91
+ async onInit() {
92
+ await super.onInit();
93
+ this.handleRawItemParams();
94
+ this.noCache = this.rawItemParams.expcache === "NO_CACHE";
95
+ }
73
96
  /**
74
97
  * 改变显示视图
75
98
  * @author lxm
@@ -248,6 +271,26 @@ class NavPosIndexController extends PanelItemController {
248
271
  ibiz.util.setBrowserTitle("");
249
272
  }
250
273
  }
274
+ /**
275
+ * 处理自定义补充参数 [{key:'name',value:'data'}] => {name:'data'}
276
+ *
277
+ * @author zk
278
+ * @date 2023-09-27 03:09:55
279
+ * @protected
280
+ * @memberof NavPosController
281
+ */
282
+ handleRawItemParams() {
283
+ var _a;
284
+ let params = {};
285
+ const rawItemParams = (_a = this.model.rawItem) == null ? void 0 : _a.rawItemParams;
286
+ if (notNilEmpty(rawItemParams)) {
287
+ params = rawItemParams.reduce((param, item) => {
288
+ param[item.key.toLowerCase()] = item.value;
289
+ return param;
290
+ }, {});
291
+ }
292
+ Object.assign(this.rawItemParams, params);
293
+ }
251
294
  }
252
295
 
253
296
  export { NavPosIndexController };
@@ -69,6 +69,9 @@ const NavPosIndex = /* @__PURE__ */ defineComponent({
69
69
  default: ({
70
70
  Component
71
71
  }) => {
72
+ if (this.c.noCache) {
73
+ return Component ? createVNode(Component, null, null) : null;
74
+ }
72
75
  return createVNode(resolveComponent("keepAlive"), {
73
76
  "include": cacheKeys,
74
77
  "max": 30,
@@ -31,7 +31,7 @@ const IBizRawItem = /* @__PURE__ */ vue.defineComponent({
31
31
  }
32
32
  const rawItemType = vue.ref(props.type || contentType || "");
33
33
  const rawItemContent = vue.ref("");
34
- let sysImage = null;
34
+ let sysImage;
35
35
  if (contentType === "IMAGE") {
36
36
  sysImage = rawItem.sysImage;
37
37
  }
@@ -71,7 +71,7 @@ const IBizRawItem = /* @__PURE__ */ vue.defineComponent({
71
71
  const rawItemText = vue.ref("");
72
72
  const convertValue = () => {
73
73
  if (rawItemType.value === "IMAGE") {
74
- if (typeof props.content === "string") {
74
+ if (props.content && typeof props.content === "string") {
75
75
  if (isImg(props.content)) {
76
76
  rawItemContent.value = {
77
77
  imagePath: props.content
@@ -81,6 +81,8 @@ const IBizRawItem = /* @__PURE__ */ vue.defineComponent({
81
81
  cssClass: props.content
82
82
  };
83
83
  }
84
+ } else if (sysImage) {
85
+ rawItemContent.value = sysImage;
84
86
  }
85
87
  }
86
88
  if (["TEXT", "HEADING1", "HEADING2", "HEADING3", "HEADING4", "HEADING5", "HEADING6", "PARAGRAPH", "HTML", "RAW"].includes(rawItemType.value)) {
@@ -124,7 +126,7 @@ const IBizRawItem = /* @__PURE__ */ vue.defineComponent({
124
126
  };
125
127
  convertValue();
126
128
  vue.watch(() => props.content, (newVal, oldVal) => {
127
- if (newVal !== oldVal) {
129
+ if (newVal && newVal !== oldVal) {
128
130
  rawItemContent.value = newVal;
129
131
  convertValue();
130
132
  }
@@ -69,11 +69,15 @@ const ViewMessage = /* @__PURE__ */ vue.defineComponent({
69
69
  });
70
70
  const handleAlertClose = (index) => {
71
71
  items.value[index].hidden = true;
72
- const isHiddenCarouse = items.value.every((item) => item.hidden);
72
+ const isHiddenCarouse = items.value.every((item2) => item2.hidden);
73
73
  if (isHiddenCarouse) {
74
74
  isHiddenContainer.value = true;
75
75
  }
76
76
  uuid.value = qxUtil.createUUID();
77
+ const item = items.value[index];
78
+ if (item.removeMode === 1) {
79
+ localStorage.setItem(item.key, "1");
80
+ }
77
81
  };
78
82
  const handleChange = (index) => {
79
83
  initialIndex.value = index;
@@ -192,6 +192,9 @@ const AppMenuControl = /* @__PURE__ */ vue.defineComponent({
192
192
  defaultActive.value = activeMenu ? activeMenu.id : "";
193
193
  }
194
194
  });
195
+ const fn = (data) => {
196
+ counterData.value = data;
197
+ };
195
198
  c.evt.on("onMounted", async () => {
196
199
  const allItems = c.getAllItems();
197
200
  const defaultActiveMenuItem = allItems.find((item) => {
@@ -216,13 +219,12 @@ const AppMenuControl = /* @__PURE__ */ vue.defineComponent({
216
219
  if (counterRefId) {
217
220
  counter = c.getCounter(counterRefId);
218
221
  if (counter) {
219
- counter.onChange((data) => {
220
- counterData.value = data;
221
- });
222
+ counter.onChange(fn);
222
223
  }
223
224
  }
224
225
  });
225
226
  vue.onUnmounted(() => {
227
+ counter == null ? void 0 : counter.offChange(fn);
226
228
  counter == null ? void 0 : counter.destroy();
227
229
  });
228
230
  const menuMode = vue.computed(() => {
@@ -46,13 +46,18 @@ const DRBarControl = /* @__PURE__ */ vue.defineComponent({
46
46
  const ns = vue3Util.useNamespace("control-".concat(c.model.controlType.toLowerCase()));
47
47
  const router = vueRouter.useRouter();
48
48
  const counterData = vue.reactive({});
49
+ const fn = (counter) => {
50
+ Object.assign(counterData, counter);
51
+ };
49
52
  c.evt.on("onCreated", () => {
50
53
  if (c.counter) {
51
- c.counter.onChange((counter) => {
52
- Object.assign(counterData, counter);
53
- }, true);
54
+ c.counter.onChange(fn, true);
54
55
  }
55
56
  });
57
+ vue.onUnmounted(() => {
58
+ var _a;
59
+ (_a = c.counter) == null ? void 0 : _a.offChange(fn);
60
+ });
56
61
  c.setRouter(router);
57
62
  const handleSelect = (key) => {
58
63
  c.handleSelectChange(key);
@@ -36,13 +36,18 @@ const DRTabControl = /* @__PURE__ */ vue.defineComponent({
36
36
  const ns = vue3Util.useNamespace("control-".concat(c.model.controlType.toLowerCase()));
37
37
  const router = vueRouter.useRouter();
38
38
  const counterData = vue.reactive({});
39
+ const fn = (counter) => {
40
+ Object.assign(counterData, counter);
41
+ };
39
42
  c.evt.on("onCreated", () => {
40
43
  if (c.counter) {
41
- c.counter.onChange((counter) => {
42
- Object.assign(counterData, counter);
43
- }, true);
44
+ c.counter.onChange(fn, true);
44
45
  }
45
46
  });
47
+ vue.onUnmounted(() => {
48
+ var _a;
49
+ (_a = c.counter) == null ? void 0 : _a.offChange(fn);
50
+ });
46
51
  c.setRouter(router);
47
52
  const handleTabChange = () => {
48
53
  c.handleTabChange();
@@ -62,10 +67,17 @@ const DRTabControl = /* @__PURE__ */ vue.defineComponent({
62
67
  const {
63
68
  srfnav
64
69
  } = routePath.pathNodes[depth - 1];
70
+ const isRoutePushed = !!c.routeDepth && runtime.hasSubRoute(c.routeDepth);
65
71
  if (srfnav && c.state.activeName && c.state.activeName !== srfnav) {
66
72
  c.state.activeName = srfnav;
67
- const isRoutePushed = !!c.routeDepth && runtime.hasSubRoute(c.routeDepth);
68
73
  c.handleTabChange(isRoutePushed);
74
+ } else if (!srfnav) {
75
+ const routeNoSub = !!c.routeDepth && !runtime.hasSubRoute(c.routeDepth);
76
+ const doTabChange = c.state.activeName !== c.state.defaultName || routeNoSub;
77
+ if (doTabChange) {
78
+ c.state.activeName = c.state.defaultName;
79
+ c.handleTabChange(isRoutePushed);
80
+ }
69
81
  }
70
82
  }
71
83
  }
@@ -170,6 +170,9 @@ class DRTabController extends runtime.ControlController {
170
170
  sysImage: editItemSysImage,
171
171
  fullPath: this.routeDepth ? vue3Util.getNestedRoutePath(this.router.currentRoute.value, this.routeDepth) : ""
172
172
  });
173
+ this.state.defaultName = "";
174
+ } else {
175
+ this.state.defaultName = (dedrtabPages == null ? void 0 : dedrtabPages[0].id) || "";
173
176
  }
174
177
  dedrtabPages == null ? void 0 : dedrtabPages.forEach((item) => {
175
178
  let itemCaption = item.caption;
@@ -38,6 +38,9 @@ const FormTabPanel = /* @__PURE__ */ vue.defineComponent({
38
38
  pageC.onClick(event);
39
39
  }
40
40
  };
41
+ const fn = (data) => {
42
+ counterData.value = data;
43
+ };
41
44
  vue.onMounted(() => {
42
45
  var _a, _b;
43
46
  const defaultSlots = ((_a = slots.default) == null ? void 0 : _a.call(slots)) || [];
@@ -52,14 +55,12 @@ const FormTabPanel = /* @__PURE__ */ vue.defineComponent({
52
55
  if (counterRefId.value) {
53
56
  counter = props.controller.getCounter(counterRefId.value);
54
57
  if (counter) {
55
- counter.onChange((data) => {
56
- counterData.value = data;
57
- });
58
+ counter.onChange(fn);
58
59
  }
59
60
  }
60
61
  });
61
62
  vue.onUnmounted(() => {
62
- counter == null ? void 0 : counter.destroy();
63
+ counter == null ? void 0 : counter.offChange(fn);
63
64
  });
64
65
  return {
65
66
  ns,
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ var core = require('@ibiz-template/core');
3
4
  var runtime = require('@ibiz-template/runtime');
4
5
  var vue = require('vue');
5
6
 
@@ -92,6 +93,9 @@ function useITableEvent(c) {
92
93
  if (row.srfkey) {
93
94
  activeClassName += " id-".concat(row.srfkey);
94
95
  }
96
+ if (c.enableRowEditOrder) {
97
+ activeClassName += " enable-order";
98
+ }
95
99
  return activeClassName;
96
100
  }
97
101
  function handleHeaderCellClassName({
@@ -293,8 +297,101 @@ function useGridHeaderStyle(tableRef, ns) {
293
297
  headerCssVars
294
298
  };
295
299
  }
300
+ function useGridDraggable(tableRef, ns, c) {
301
+ if (!c.enableRowEditOrder || !c.model.orderValueAppDEFieldId) {
302
+ return {};
303
+ }
304
+ let draggingDom = null;
305
+ let dragIndex = 0;
306
+ let draggingKey = "";
307
+ let draggingData = null;
308
+ const cleanups = [];
309
+ const calcSrfKeyByClass = (classList) => {
310
+ let result = "";
311
+ classList.forEach((className) => {
312
+ if (className.startsWith("id-")) {
313
+ result = className.replace("id-", "");
314
+ }
315
+ });
316
+ return result;
317
+ };
318
+ const setRowDragEvent = (item) => {
319
+ item.setAttribute("draggable", "true");
320
+ const cleanDragStart = core.listenJSEvent(
321
+ item,
322
+ "dragstart",
323
+ (event) => {
324
+ if (event.target) {
325
+ draggingDom = event.target;
326
+ event.dataTransfer.effectAllowed = "move";
327
+ draggingKey = calcSrfKeyByClass(draggingDom.classList);
328
+ dragIndex = c.state.rows.findIndex(
329
+ (row) => row.data.srfkey === draggingKey
330
+ );
331
+ draggingData = c.state.rows[dragIndex];
332
+ }
333
+ }
334
+ );
335
+ const cleanDragEnter = core.listenJSEvent(
336
+ item,
337
+ "dragenter",
338
+ (event) => {
339
+ event.preventDefault();
340
+ const targetDom = event.currentTarget;
341
+ const targetKey = calcSrfKeyByClass(targetDom.classList);
342
+ const targetIndex = c.state.rows.findIndex(
343
+ (row) => row.data.srfkey === targetKey
344
+ );
345
+ if (draggingKey === targetKey || targetIndex === -1) {
346
+ return;
347
+ }
348
+ c.state.rows.splice(dragIndex, 1);
349
+ c.state.rows.splice(targetIndex, 0, draggingData);
350
+ dragIndex = targetIndex;
351
+ }
352
+ );
353
+ const cleanDragOver = core.listenJSEvent(
354
+ item,
355
+ "dragover",
356
+ (event) => {
357
+ event.preventDefault();
358
+ }
359
+ );
360
+ const cleanDragEnd = core.listenJSEvent(item, "dragend", (event) => {
361
+ event.preventDefault();
362
+ c.onDragChange();
363
+ });
364
+ cleanups.push(cleanDragStart);
365
+ cleanups.push(cleanDragEnter);
366
+ cleanups.push(cleanDragOver);
367
+ cleanups.push(cleanDragEnd);
368
+ };
369
+ vue.watch(
370
+ [() => tableRef.value, () => c.state.isLoaded],
371
+ (table, isLoaded) => {
372
+ if (!isLoaded || !table) {
373
+ return;
374
+ }
375
+ const grid = tableRef.value.$el;
376
+ if (grid) {
377
+ const rows = grid.getElementsByClassName("el-table__row");
378
+ rows.forEach((item) => {
379
+ setRowDragEvent(item);
380
+ });
381
+ }
382
+ }
383
+ );
384
+ return {
385
+ cleanup: () => {
386
+ cleanups.forEach((cleanup) => {
387
+ cleanup();
388
+ });
389
+ }
390
+ };
391
+ }
296
392
 
297
393
  exports.useAppGridBase = useAppGridBase;
298
394
  exports.useAppGridPagination = useAppGridPagination;
395
+ exports.useGridDraggable = useGridDraggable;
299
396
  exports.useGridHeaderStyle = useGridHeaderStyle;
300
397
  exports.useITableEvent = useITableEvent;
@@ -3,6 +3,7 @@
3
3
  var vue = require('vue');
4
4
  var vue3Util = require('@ibiz-template/vue3-util');
5
5
  var runtime = require('@ibiz-template/runtime');
6
+ var core = require('@ibiz-template/core');
6
7
  var gridControl_util = require('./grid-control.util.cjs');
7
8
  require('./grid.css');
8
9
  var useRowEditPopover = require('../row-edit-popover/use-row-edit-popover.cjs');
@@ -166,6 +167,9 @@ const GridControl = /* @__PURE__ */ vue.defineComponent({
166
167
  const {
167
168
  headerCssVars
168
169
  } = gridControl_util.useGridHeaderStyle(tableRef, ns);
170
+ const {
171
+ cleanup = core.NOOP
172
+ } = gridControl_util.useGridDraggable(tableRef, ns, c);
169
173
  const renderNoData = () => {
170
174
  var _a;
171
175
  const {
@@ -231,6 +235,9 @@ const GridControl = /* @__PURE__ */ vue.defineComponent({
231
235
  };
232
236
  vue.onUnmounted(() => {
233
237
  zIndex.decrement();
238
+ if (cleanup !== core.NOOP) {
239
+ cleanup();
240
+ }
234
241
  });
235
242
  return {
236
243
  c,
@@ -27,6 +27,7 @@ const IBizGridControl = vue3Util.withInstall(grid.GridControl, (v) => {
27
27
 
28
28
  exports.useAppGridBase = gridControl_util.useAppGridBase;
29
29
  exports.useAppGridPagination = gridControl_util.useAppGridPagination;
30
+ exports.useGridDraggable = gridControl_util.useGridDraggable;
30
31
  exports.useGridHeaderStyle = gridControl_util.useGridHeaderStyle;
31
32
  exports.useITableEvent = gridControl_util.useITableEvent;
32
33
  exports.IBizGridControl = IBizGridControl;
@@ -55,6 +55,16 @@ const GridFieldColumn = /* @__PURE__ */ vue.defineComponent({
55
55
  const onActionClick = async (detail, event) => {
56
56
  await props.controller.onActionClick(detail, props.row, event);
57
57
  };
58
+ const items = vue.ref([]);
59
+ if (props.controller.codeList) {
60
+ items.value = props.controller.codeListItems;
61
+ }
62
+ const fn = (data) => {
63
+ if (data) {
64
+ items.value = data;
65
+ }
66
+ };
67
+ vue3Util.useCodeListListen(props.controller.model.appCodeListId, props.controller.context.srfappid, fn);
58
68
  return {
59
69
  ns,
60
70
  onCellClick,
@@ -66,7 +76,8 @@ const GridFieldColumn = /* @__PURE__ */ vue.defineComponent({
66
76
  formatValue,
67
77
  codeListValue,
68
78
  tooltip,
69
- zIndex
79
+ zIndex,
80
+ items
70
81
  };
71
82
  },
72
83
  render() {
@@ -89,7 +100,7 @@ const GridFieldColumn = /* @__PURE__ */ vue.defineComponent({
89
100
  } else if (c.codeList) {
90
101
  content = vue.createVNode(vue.resolveComponent("iBizCodeList"), {
91
102
  "class": this.ns.e("text"),
92
- "codeListItems": c.codeListItems,
103
+ "codeListItems": this.items,
93
104
  "codeList": c.codeList,
94
105
  "value": this.codeListValue,
95
106
  "onClick": this.onTextClick,
@@ -13,6 +13,7 @@ var index$4 = require('./grid-column/grid-group-column/index.cjs');
13
13
  exports.IBizGridControl = index.IBizGridControl;
14
14
  exports.useAppGridBase = gridControl_util.useAppGridBase;
15
15
  exports.useAppGridPagination = gridControl_util.useAppGridPagination;
16
+ exports.useGridDraggable = gridControl_util.useGridDraggable;
16
17
  exports.useGridHeaderStyle = gridControl_util.useGridHeaderStyle;
17
18
  exports.useITableEvent = gridControl_util.useITableEvent;
18
19
  exports.IBizGridFieldColumn = index$1.IBizGridFieldColumn;
@@ -102,6 +102,7 @@ exports.IBizGanttControl = index$R.IBizGanttControl;
102
102
  exports.IBizContextMenuControl = index$S.IBizContextMenuControl;
103
103
  exports.useAppGridBase = gridControl_util.useAppGridBase;
104
104
  exports.useAppGridPagination = gridControl_util.useAppGridPagination;
105
+ exports.useGridDraggable = gridControl_util.useGridDraggable;
105
106
  exports.useGridHeaderStyle = gridControl_util.useGridHeaderStyle;
106
107
  exports.useITableEvent = gridControl_util.useITableEvent;
107
108
  exports.IBizGridControl = index$2.IBizGridControl;
@@ -71,16 +71,21 @@ const TreeControl = /* @__PURE__ */ vue.defineComponent({
71
71
  const c = vue3Util.useControlController((...args) => new runtime.TreeController(...args));
72
72
  const cascadeSelect = vue.ref(false);
73
73
  const counterData = vue.reactive({});
74
+ const fn = (counter) => {
75
+ Object.assign(counterData, counter);
76
+ };
74
77
  c.evt.on("onCreated", () => {
75
78
  if (c.counter) {
76
- c.counter.onChange((counter) => {
77
- Object.assign(counterData, counter);
78
- }, true);
79
+ c.counter.onChange(fn, true);
79
80
  }
80
81
  if (c.controlParams.cascadeselect) {
81
82
  cascadeSelect.value = true;
82
83
  }
83
84
  });
85
+ vue.onUnmounted(() => {
86
+ var _a;
87
+ (_a = c.counter) == null ? void 0 : _a.offChange(fn);
88
+ });
84
89
  const ns = vue3Util.useNamespace("control-".concat(c.model.controlType.toLowerCase()));
85
90
  const treeRef = vue.ref(null);
86
91
  const treeviewRef = vue.ref(null);
@@ -168,7 +168,7 @@ const IBizAutoComplete = /* @__PURE__ */ vue.defineComponent({
168
168
  "placeholder": this.c.placeHolder,
169
169
  "placement": "bottom",
170
170
  "clearable": this.autoCompleteClearable,
171
- "popper-class": [this.ns.e("transfer")],
171
+ "popper-class": this.ns.e("transfer"),
172
172
  "teleported": !this.showFormDefaultContent,
173
173
  "fetch-suggestions": this.onSearch,
174
174
  "onClear": this.onClear,
@@ -40,6 +40,12 @@ const IBizCheckboxList = /* @__PURE__ */ vue.defineComponent({
40
40
  }
41
41
  return "str";
42
42
  });
43
+ const fn = (data) => {
44
+ if (data) {
45
+ items.value = data;
46
+ }
47
+ };
48
+ vue3Util.useCodeListListen(c.model.appCodeListId, c.context.srfappid, fn);
43
49
  let valueSeparator = ",";
44
50
  if (codeList && codeList.valueSeparator) {
45
51
  valueSeparator = codeList.valueSeparator;
@@ -35,6 +35,15 @@ const IBizCode = /* @__PURE__ */ vue.defineComponent({
35
35
  }, {
36
36
  immediate: true
37
37
  });
38
+ vue.watch(() => props.readonly, (newVal) => {
39
+ if (editor) {
40
+ editor.updateOptions({
41
+ readOnly: newVal
42
+ });
43
+ }
44
+ }, {
45
+ immediate: true
46
+ });
38
47
  const codeEditBox = vue.ref();
39
48
  const editorInit = () => {
40
49
  vue.nextTick(() => {
@@ -58,8 +67,11 @@ const IBizCode = /* @__PURE__ */ vue.defineComponent({
58
67
  minimap: {
59
68
  enabled: true
60
69
  },
61
- readOnly: false,
70
+ readOnly: props.readonly,
62
71
  // 只读
72
+ readOnlyMessage: {
73
+ value: "\u5F53\u524D\u4E3A\u53EA\u8BFB\u6A21\u5F0F\uFF0C\u4E0D\u53EF\u7F16\u8F91"
74
+ },
63
75
  fontSize: 16,
64
76
  // 字体大小
65
77
  scrollBeyondLastLine: false,
@@ -261,7 +261,7 @@ const IBizPicker = /* @__PURE__ */ vue.defineComponent({
261
261
  "value-key": this.c.textName,
262
262
  "placeholder": this.c.placeHolder,
263
263
  "clearable": true,
264
- "popper-class": [this.ns.e("transfer")],
264
+ "popper-class": this.ns.e("transfer"),
265
265
  "fetch-suggestions": this.onSearch,
266
266
  "onClear": this.onClear,
267
267
  "onBlur": this.onBlur,
@@ -199,6 +199,12 @@ const IBizDropdown = /* @__PURE__ */ vue.defineComponent({
199
199
  }
200
200
  }
201
201
  };
202
+ const fn = (data) => {
203
+ if (data) {
204
+ items.value = data;
205
+ }
206
+ };
207
+ vue3Util.useCodeListListen(c.model.appCodeListId, c.context.srfappid, fn);
202
208
  vue.onMounted(() => {
203
209
  if (editorRef.value) {
204
210
  funcs = vue3Util.useClickOutside(editorRef, async (_evt) => {
@@ -54,6 +54,12 @@ const IBizListBox = /* @__PURE__ */ vue.defineComponent({
54
54
  }
55
55
  };
56
56
  loadListBoxItems();
57
+ const fn = (data) => {
58
+ if (data) {
59
+ items.value = data;
60
+ }
61
+ };
62
+ vue3Util.useCodeListListen(c.model.appCodeListId, c.context.srfappid, fn);
57
63
  const currentMode = vue.computed(() => {
58
64
  if (codeList && codeList.orMode) {
59
65
  return codeList.orMode.toLowerCase();
@@ -41,6 +41,12 @@ const IBizRadio = /* @__PURE__ */ vue.defineComponent({
41
41
  immediate: true,
42
42
  deep: true
43
43
  });
44
+ const fn = (data) => {
45
+ if (data) {
46
+ items.value = data;
47
+ }
48
+ };
49
+ vue3Util.useCodeListListen(c.model.appCodeListId, c.context.srfappid, fn);
44
50
  const valueText = vue.computed(() => {
45
51
  var _a;
46
52
  return ((_a = items.value.find((item) => item.value == props.value)) == null ? void 0 : _a.text) || "";
@@ -97,6 +97,12 @@ const IBizSpan = /* @__PURE__ */ vue.defineComponent({
97
97
  deep: true
98
98
  });
99
99
  }
100
+ const fn = (data) => {
101
+ if (data) {
102
+ items.value = data;
103
+ }
104
+ };
105
+ vue3Util.useCodeListListen(c.model.appCodeListId, c.context.srfappid, fn);
100
106
  const {
101
107
  componentRef: editorRef
102
108
  } = vue3Util.useFocusAndBlur(() => emit("focus"), () => emit("blur"));
package/lib/index.cjs CHANGED
@@ -144,6 +144,7 @@ exports.IBizAppMenuControl = index$2.IBizAppMenuControl;
144
144
  exports.IBizAppMenuIconViewControl = index$3.IBizAppMenuIconViewControl;
145
145
  exports.useAppGridBase = gridControl_util.useAppGridBase;
146
146
  exports.useAppGridPagination = gridControl_util.useAppGridPagination;
147
+ exports.useGridDraggable = gridControl_util.useGridDraggable;
147
148
  exports.useGridHeaderStyle = gridControl_util.useGridHeaderStyle;
148
149
  exports.useITableEvent = gridControl_util.useITableEvent;
149
150
  exports.IBizGridControl = index$4.IBizGridControl;