@ibiz-template/vue3-components 0.7.41-alpha.60 → 0.7.41-alpha.61

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.
@@ -135,7 +135,7 @@ function renderFieldColumn(c, row) {
135
135
  "class": ns.b("toolbar-container")
136
136
  }, [actionToolbar])] : content]);
137
137
  }
138
- function renderColumn(c, model, renderColumns, index) {
138
+ function renderColumn(c, model, renderColumns, index, slots) {
139
139
  var _a, _b, _c, _d;
140
140
  const {
141
141
  codeName: columnName,
@@ -207,13 +207,13 @@ function renderColumn(c, model, renderColumns, index) {
207
207
  ...c.getEventArgs(),
208
208
  data: rowState.data
209
209
  })
210
- });
210
+ }, slots);
211
211
  }
212
212
  return null;
213
213
  }
214
214
  });
215
215
  }
216
- function renderChildColumn(c, model, renderColumns, index) {
216
+ function renderChildColumn(c, model, renderColumns, index, slots) {
217
217
  var _a, _b;
218
218
  if (model.columnType === "GROUPGRIDCOLUMN") {
219
219
  const childColumns = ((_a = model.degridColumns) == null ? void 0 : _a.filter((item) => !item.hideDefault && !item.hiddenDataItem)) || [];
@@ -239,12 +239,12 @@ function renderChildColumn(c, model, renderColumns, index) {
239
239
  },
240
240
  default: () => {
241
241
  return childColumns.map((column, index2) => {
242
- return renderChildColumn(c, column, renderColumns, index2);
242
+ return renderChildColumn(c, column, renderColumns, index2, slots);
243
243
  });
244
244
  }
245
245
  });
246
246
  }
247
- return renderColumn(c, model, renderColumns, index);
247
+ return renderColumn(c, model, renderColumns, index, slots);
248
248
  }
249
249
  const GridControl = /* @__PURE__ */ defineComponent({
250
250
  name: "IBizGridControl",
@@ -437,7 +437,7 @@ const GridControl = /* @__PURE__ */ defineComponent({
437
437
  controller: c.columns[model.codeName]
438
438
  });
439
439
  }
440
- return renderChildColumn(c, model, renderColumns.value, index);
440
+ return renderChildColumn(c, model, renderColumns.value, index, slots);
441
441
  };
442
442
  const renderDragIconColumn = () => {
443
443
  return createVNode(resolveComponent("el-table-column"), {
@@ -1,4 +1,4 @@
1
- import { defineComponent, createVNode, resolveComponent, h, ref, nextTick, computed } from 'vue';
1
+ import { isVNode, defineComponent, renderSlot, h, resolveComponent, createVNode, ref, nextTick, computed } from 'vue';
2
2
  import { useNamespace } from '@ibiz-template/vue3-util';
3
3
  import { RuntimeError } from '@ibiz-template/core';
4
4
  import { GridRowState, GridFieldEditColumnController } from '@ibiz-template/runtime';
@@ -9,6 +9,9 @@ import { useAllEdit } from './all-edit.mjs';
9
9
  import './grid-field-edit-column.css';
10
10
 
11
11
  "use strict";
12
+ function _isSlot(s) {
13
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
14
+ }
12
15
  const GridFieldEditColumn = /* @__PURE__ */ defineComponent({
13
16
  name: "IBizGridFieldEditColumn",
14
17
  props: {
@@ -92,15 +95,24 @@ const GridFieldEditColumn = /* @__PURE__ */ defineComponent({
92
95
  render() {
93
96
  var _a;
94
97
  const val = this.row.data[this.c.fieldName];
95
- return createVNode(resolveComponent("iBizGridEditItem"), {
96
- ref: "componentRef",
97
- required: !this.c.editItem.allowEmpty,
98
- error: this.row.errors[this.c.fieldName],
99
- overflowMode: this.c.grid.overflowMode,
100
- class: [this.ns, this.ns.m(this.c.grid.overflowMode), (_a = this.controller.model.cellSysCss) == null ? void 0 : _a.cssName],
101
- ...this.gridEditItemProps
102
- }, {
103
- default: () => [this.c.editorProvider && h(resolveComponent(this.c.editorProvider.gridEditor), {
98
+ let content = null;
99
+ const editorSlot = "".concat(this.controller.model.codeName, "_editor");
100
+ if (this.$slots[editorSlot]) {
101
+ content = renderSlot(this.$slots, editorSlot, {
102
+ class: this.ns.e("editor"),
103
+ value: val,
104
+ data: this.row.data,
105
+ controller: this.c.editor,
106
+ overflowMode: this.c.grid.overflowMode,
107
+ onChange: this.rowDataChange,
108
+ onInfoTextChange: this.onInfoTextChange,
109
+ title: this.tooltip,
110
+ ...this.editorProps,
111
+ ...this.attrs
112
+ });
113
+ }
114
+ if (this.c.editorProvider) {
115
+ content = h(resolveComponent(this.c.editorProvider.gridEditor), {
104
116
  class: this.ns.e("editor"),
105
117
  value: val,
106
118
  data: this.row.data,
@@ -111,7 +123,17 @@ const GridFieldEditColumn = /* @__PURE__ */ defineComponent({
111
123
  title: this.tooltip,
112
124
  ...this.editorProps,
113
125
  ...this.attrs
114
- })]
126
+ });
127
+ }
128
+ return createVNode(resolveComponent("iBizGridEditItem"), {
129
+ ref: "componentRef",
130
+ required: !this.c.editItem.allowEmpty,
131
+ error: this.row.errors[this.c.fieldName],
132
+ overflowMode: this.c.grid.overflowMode,
133
+ class: [this.ns, this.ns.m(this.c.grid.overflowMode), (_a = this.controller.model.cellSysCss) == null ? void 0 : _a.cssName],
134
+ ...this.gridEditItemProps
135
+ }, _isSlot(content) ? content : {
136
+ default: () => [content]
115
137
  });
116
138
  }
117
139
  });
@@ -81,6 +81,13 @@ class AIChatUtil {
81
81
  if (editorParams.srfaiagent) {
82
82
  chatOptions.activeAIAgentID = editorParams.srfaiagent;
83
83
  }
84
+ if (editorParams.summarymaxtokens) {
85
+ chatOptions.summaryMaxTokens = Number(editorParams.summarymaxtokens);
86
+ } else {
87
+ chatOptions.summaryMaxTokens = Number(
88
+ ibiz.config.common.aiChatSummaryMaxTokens
89
+ );
90
+ }
84
91
  chatOptions.fetchAgentList = () => {
85
92
  return this.getAIAgentList(context, params, editorParams);
86
93
  };
@@ -529,6 +536,14 @@ class AIChatUtil {
529
536
  delete params.srfenableaiagentchange;
530
537
  }
531
538
  chatOptions.enableAIAgentChange = enableAIAgentChange;
539
+ if (params.hasOwnProperty("summarymaxtokens")) {
540
+ chatOptions.summaryMaxTokens = Number(params.summarymaxtokens);
541
+ delete params.summarymaxtokens;
542
+ } else {
543
+ chatOptions.summaryMaxTokens = Number(
544
+ ibiz.config.common.aiChatSummaryMaxTokens
545
+ );
546
+ }
532
547
  chatOptions.fetchAgentList = () => {
533
548
  return this.getAIAgentList(context, params);
534
549
  };
@@ -137,7 +137,7 @@ function renderFieldColumn(c, row) {
137
137
  "class": ns.b("toolbar-container")
138
138
  }, [actionToolbar])] : content]);
139
139
  }
140
- function renderColumn(c, model, renderColumns, index) {
140
+ function renderColumn(c, model, renderColumns, index, slots) {
141
141
  var _a, _b, _c, _d;
142
142
  const {
143
143
  codeName: columnName,
@@ -209,13 +209,13 @@ function renderColumn(c, model, renderColumns, index) {
209
209
  ...c.getEventArgs(),
210
210
  data: rowState.data
211
211
  })
212
- });
212
+ }, slots);
213
213
  }
214
214
  return null;
215
215
  }
216
216
  });
217
217
  }
218
- function renderChildColumn(c, model, renderColumns, index) {
218
+ function renderChildColumn(c, model, renderColumns, index, slots) {
219
219
  var _a, _b;
220
220
  if (model.columnType === "GROUPGRIDCOLUMN") {
221
221
  const childColumns = ((_a = model.degridColumns) == null ? void 0 : _a.filter((item) => !item.hideDefault && !item.hiddenDataItem)) || [];
@@ -241,12 +241,12 @@ function renderChildColumn(c, model, renderColumns, index) {
241
241
  },
242
242
  default: () => {
243
243
  return childColumns.map((column, index2) => {
244
- return renderChildColumn(c, column, renderColumns, index2);
244
+ return renderChildColumn(c, column, renderColumns, index2, slots);
245
245
  });
246
246
  }
247
247
  });
248
248
  }
249
- return renderColumn(c, model, renderColumns, index);
249
+ return renderColumn(c, model, renderColumns, index, slots);
250
250
  }
251
251
  const GridControl = /* @__PURE__ */ vue.defineComponent({
252
252
  name: "IBizGridControl",
@@ -439,7 +439,7 @@ const GridControl = /* @__PURE__ */ vue.defineComponent({
439
439
  controller: c.columns[model.codeName]
440
440
  });
441
441
  }
442
- return renderChildColumn(c, model, renderColumns.value, index);
442
+ return renderChildColumn(c, model, renderColumns.value, index, slots);
443
443
  };
444
444
  const renderDragIconColumn = () => {
445
445
  return vue.createVNode(vue.resolveComponent("el-table-column"), {
@@ -13,6 +13,9 @@ var allEdit = require('./all-edit.cjs');
13
13
  require('./grid-field-edit-column.css');
14
14
 
15
15
  "use strict";
16
+ function _isSlot(s) {
17
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
18
+ }
16
19
  const GridFieldEditColumn = /* @__PURE__ */ vue.defineComponent({
17
20
  name: "IBizGridFieldEditColumn",
18
21
  props: {
@@ -96,15 +99,24 @@ const GridFieldEditColumn = /* @__PURE__ */ vue.defineComponent({
96
99
  render() {
97
100
  var _a;
98
101
  const val = this.row.data[this.c.fieldName];
99
- return vue.createVNode(vue.resolveComponent("iBizGridEditItem"), {
100
- ref: "componentRef",
101
- required: !this.c.editItem.allowEmpty,
102
- error: this.row.errors[this.c.fieldName],
103
- overflowMode: this.c.grid.overflowMode,
104
- class: [this.ns, this.ns.m(this.c.grid.overflowMode), (_a = this.controller.model.cellSysCss) == null ? void 0 : _a.cssName],
105
- ...this.gridEditItemProps
106
- }, {
107
- default: () => [this.c.editorProvider && vue.h(vue.resolveComponent(this.c.editorProvider.gridEditor), {
102
+ let content = null;
103
+ const editorSlot = "".concat(this.controller.model.codeName, "_editor");
104
+ if (this.$slots[editorSlot]) {
105
+ content = vue.renderSlot(this.$slots, editorSlot, {
106
+ class: this.ns.e("editor"),
107
+ value: val,
108
+ data: this.row.data,
109
+ controller: this.c.editor,
110
+ overflowMode: this.c.grid.overflowMode,
111
+ onChange: this.rowDataChange,
112
+ onInfoTextChange: this.onInfoTextChange,
113
+ title: this.tooltip,
114
+ ...this.editorProps,
115
+ ...this.attrs
116
+ });
117
+ }
118
+ if (this.c.editorProvider) {
119
+ content = vue.h(vue.resolveComponent(this.c.editorProvider.gridEditor), {
108
120
  class: this.ns.e("editor"),
109
121
  value: val,
110
122
  data: this.row.data,
@@ -115,7 +127,17 @@ const GridFieldEditColumn = /* @__PURE__ */ vue.defineComponent({
115
127
  title: this.tooltip,
116
128
  ...this.editorProps,
117
129
  ...this.attrs
118
- })]
130
+ });
131
+ }
132
+ return vue.createVNode(vue.resolveComponent("iBizGridEditItem"), {
133
+ ref: "componentRef",
134
+ required: !this.c.editItem.allowEmpty,
135
+ error: this.row.errors[this.c.fieldName],
136
+ overflowMode: this.c.grid.overflowMode,
137
+ class: [this.ns, this.ns.m(this.c.grid.overflowMode), (_a = this.controller.model.cellSysCss) == null ? void 0 : _a.cssName],
138
+ ...this.gridEditItemProps
139
+ }, _isSlot(content) ? content : {
140
+ default: () => [content]
119
141
  });
120
142
  }
121
143
  });
@@ -83,6 +83,13 @@ class AIChatUtil {
83
83
  if (editorParams.srfaiagent) {
84
84
  chatOptions.activeAIAgentID = editorParams.srfaiagent;
85
85
  }
86
+ if (editorParams.summarymaxtokens) {
87
+ chatOptions.summaryMaxTokens = Number(editorParams.summarymaxtokens);
88
+ } else {
89
+ chatOptions.summaryMaxTokens = Number(
90
+ ibiz.config.common.aiChatSummaryMaxTokens
91
+ );
92
+ }
86
93
  chatOptions.fetchAgentList = () => {
87
94
  return this.getAIAgentList(context, params, editorParams);
88
95
  };
@@ -531,6 +538,14 @@ class AIChatUtil {
531
538
  delete params.srfenableaiagentchange;
532
539
  }
533
540
  chatOptions.enableAIAgentChange = enableAIAgentChange;
541
+ if (params.hasOwnProperty("summarymaxtokens")) {
542
+ chatOptions.summaryMaxTokens = Number(params.summarymaxtokens);
543
+ delete params.summarymaxtokens;
544
+ } else {
545
+ chatOptions.summaryMaxTokens = Number(
546
+ ibiz.config.common.aiChatSummaryMaxTokens
547
+ );
548
+ }
534
549
  chatOptions.fetchAgentList = () => {
535
550
  return this.getAIAgentList(context, params);
536
551
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiz-template/vue3-components",
3
- "version": "0.7.41-alpha.60",
3
+ "version": "0.7.41-alpha.61",
4
4
  "description": "web端组件库(vue3)",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.mjs",
@@ -30,16 +30,16 @@
30
30
  "dependencies": {
31
31
  "@amap/amap-jsapi-loader": "^1.0.1",
32
32
  "@floating-ui/dom": "^1.5.3",
33
- "@ibiz-template-plugin/ai-chat": "^0.0.51",
33
+ "@ibiz-template-plugin/ai-chat": "^0.0.52",
34
34
  "@ibiz-template-plugin/gantt": "0.1.8-alpha.378",
35
35
  "@ibiz-template-plugin/bi-report": "0.0.32",
36
36
  "@ibiz-template-plugin/data-view": "0.0.6",
37
37
  "@ibiz-template/core": "0.7.41-alpha.63",
38
38
  "@ibiz-template/devtool": "0.0.14",
39
- "@ibiz-template/model-helper": "0.7.41-alpha.64",
40
- "@ibiz-template/runtime": "0.7.41-alpha.64",
39
+ "@ibiz-template/model-helper": "0.7.41-alpha.67",
40
+ "@ibiz-template/runtime": "0.7.41-alpha.67",
41
41
  "@ibiz-template/theme": "0.7.39",
42
- "@ibiz-template/vue3-util": "0.7.41-alpha.64",
42
+ "@ibiz-template/vue3-util": "0.7.41-alpha.67",
43
43
  "@ibiz-template/web-theme": "3.10.0",
44
44
  "@ibiz/model-core": "^0.1.84",
45
45
  "@imengyu/vue3-context-menu": "^1.3.5",