yuang-framework-ui-pc 1.1.161 → 1.1.162

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.
@@ -42,6 +42,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
42
42
  reserveCurrent: BooleanConstructor;
43
43
  selectedRowKeys: import('vue').PropType<DataKey[]>;
44
44
  cacheData: import('vue').PropType<DataItem[]>;
45
+ isAllowShowEmpty: {
46
+ type: BooleanConstructor;
47
+ default: boolean;
48
+ };
45
49
  data: {
46
50
  type: import('vue').PropType<any[]>;
47
51
  default: () => never[];
@@ -208,6 +212,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
208
212
  reserveCurrent: BooleanConstructor;
209
213
  selectedRowKeys: import('vue').PropType<DataKey[]>;
210
214
  cacheData: import('vue').PropType<DataItem[]>;
215
+ isAllowShowEmpty: {
216
+ type: BooleanConstructor;
217
+ default: boolean;
218
+ };
211
219
  data: {
212
220
  type: import('vue').PropType<any[]>;
213
221
  default: () => never[];
@@ -336,6 +344,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
336
344
  bottomLine: boolean;
337
345
  emptyProps: import('./types').TableEmptyProps;
338
346
  reserveCurrent: boolean;
347
+ isAllowShowEmpty: boolean;
339
348
  }, {}, {
340
349
  ElTable: import('element-plus/es/utils/index').SFCWithInstall<import('vue').DefineComponent<{
341
350
  data: {
@@ -352,7 +352,7 @@ const index = /* @__PURE__ */ defineComponent({
352
352
  };
353
353
  return () => createVNode(ElTable, mergeProps(tableProps.value, {
354
354
  "ref": tableRef,
355
- "emptyText": props.errorText || props.emptyText,
355
+ "emptyText": props.isAllowShowEmpty ? props.errorText || props.emptyText : "",
356
356
  "rowClassName": (param) => getBodyRowClass(props.rowClassName, param),
357
357
  "headerRowClassName": (param) => getHeadRowClass(props.headerRowClassName, param, props.headerEllipsis),
358
358
  "class": ["ele-data-table", {
@@ -380,18 +380,25 @@ const index = /* @__PURE__ */ defineComponent({
380
380
  var _a;
381
381
  return (_a = slots.append) == null ? void 0 : _a.call(slots, slotProps);
382
382
  } : void 0,
383
- empty: slots.empty ? () => {
383
+ //empty: slots.empty ? () => slots.empty?.({ text: props.emptyText, error: props.errorText }) : props.emptyProps ? () => <ElEmpty imageSize={68} {...(!props.emptyProps || props.emptyProps === true ? {} : props.emptyProps)} description={props.errorText || props.emptyText} class="ele-table-empty" /> : void 0,
384
+ empty: () => {
384
385
  var _a;
385
- return (_a = slots.empty) == null ? void 0 : _a.call(slots, {
386
- text: props.emptyText,
387
- error: props.errorText
388
- });
389
- } : props.emptyProps ? () => createVNode(ElEmpty, mergeProps({
390
- "imageSize": 68
391
- }, !props.emptyProps || props.emptyProps === true ? {} : props.emptyProps, {
392
- "description": props.errorText || props.emptyText,
393
- "class": "ele-table-empty"
394
- }), null) : void 0,
386
+ if (!props.isAllowShowEmpty) return null;
387
+ if (slots.empty) {
388
+ return (_a = slots.empty) == null ? void 0 : _a.call(slots, {
389
+ text: props.emptyText,
390
+ error: props.errorText
391
+ });
392
+ }
393
+ if (props.emptyProps) {
394
+ return createVNode(ElEmpty, mergeProps({
395
+ "imageSize": 68
396
+ }, !props.emptyProps || props.emptyProps === true ? {} : props.emptyProps, {
397
+ "description": props.errorText || props.emptyText,
398
+ "class": "ele-table-empty"
399
+ }), null);
400
+ }
401
+ },
395
402
  default: () => tableCols.value.map(renderTableColumn)
396
403
  });
397
404
  }
@@ -148,6 +148,10 @@ export declare const dataTableProps: {
148
148
  selectedRowKeys: PropType<DataKey[]>;
149
149
  /** 缓存数据 */
150
150
  cacheData: PropType<DataItem[]>;
151
+ isAllowShowEmpty: {
152
+ type: BooleanConstructor;
153
+ default: boolean;
154
+ };
151
155
  width: (NumberConstructor | StringConstructor)[];
152
156
  height: (NumberConstructor | StringConstructor)[];
153
157
  data: {
@@ -55,7 +55,11 @@ const dataTableProps = {
55
55
  /** 多选选中行的值 */
56
56
  selectedRowKeys: Array,
57
57
  /** 缓存数据 */
58
- cacheData: Array
58
+ cacheData: Array,
59
+ isAllowShowEmpty: {
60
+ type: Boolean,
61
+ default: false
62
+ }
59
63
  };
60
64
  const dataTableEmits = {
61
65
  select: (_selection, _row) => true,
@@ -61,6 +61,7 @@ const _sfc_main = defineComponent({
61
61
  hasNext: tableData.value.length >= tableLimit.value
62
62
  });
63
63
  });
64
+ const isFinishedFirstRequest = ref(false);
64
65
  const tableEmptyProps = computed(() => {
65
66
  return mergeProps(props.emptyProps, globalProps.value.emptyProps);
66
67
  });
@@ -172,6 +173,7 @@ const _sfc_main = defineComponent({
172
173
  tablePage.value = currentPage;
173
174
  tableTotal.value = totalCount;
174
175
  handleDone({ records, currentPage, totalCount, response: props.datasource });
176
+ isFinishedFirstRequest.value = true;
175
177
  return;
176
178
  }
177
179
  if (!parent) {
@@ -200,9 +202,13 @@ const _sfc_main = defineComponent({
200
202
  });
201
203
  };
202
204
  const reload = (option, parent, resolve) => {
205
+ if (parent === void 0) {
206
+ isFinishedFirstRequest.value = false;
207
+ }
203
208
  load(option, parent, resolve);
204
209
  };
205
210
  const reset = () => {
211
+ isFinishedFirstRequest.value = false;
206
212
  methods.doLayout();
207
213
  if (props.lazy) {
208
214
  isShowTable.value = false;
@@ -242,6 +248,9 @@ const _sfc_main = defineComponent({
242
248
  tableTotal.value = totalCount || data.length;
243
249
  }
244
250
  tableLoading.value = false;
251
+ if (parent === void 0) {
252
+ isFinishedFirstRequest.value = true;
253
+ }
245
254
  const result = {
246
255
  records: tableData.value,
247
256
  currentPage: tablePage.value,
@@ -475,6 +484,7 @@ const _sfc_main = defineComponent({
475
484
  toolExportConfig,
476
485
  toolPrintConfig,
477
486
  loadingProps,
487
+ isFinishedFirstRequest,
478
488
  handleRefresh,
479
489
  handleSizeChange,
480
490
  handleColumnsChange,
@@ -521,7 +531,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
521
531
  void 0
522
532
  ]), 1040)) : createCommentVNode("", true),
523
533
  renderSlot(_ctx.$slots, "default"),
524
- _ctx.virtual ? (openBlock(), createBlock(_component_EleVirtualTable, mergeProps$1({ key: 1 }, _ctx.tableProps, { ref: "tableViewRef" }), createSlots({ _: 2 }, [
534
+ _ctx.virtual ? (openBlock(), createBlock(_component_EleVirtualTable, mergeProps$1({ key: 1 }, _ctx.tableProps, {
535
+ ref: "tableViewRef",
536
+ isAllowShowEmpty: _ctx.isFinishedFirstRequest
537
+ }), createSlots({ _: 2 }, [
525
538
  renderList(Object.keys(_ctx.$slots).filter((k) => !_ctx.tableSlotExcludes.includes(k)), (name) => {
526
539
  return {
527
540
  name,
@@ -530,8 +543,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
530
543
  ])
531
544
  };
532
545
  })
533
- ]), 1040)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
534
- _ctx.isShowTable ? (openBlock(), createBlock(_component_EleDataTable, mergeProps$1({ key: 0 }, _ctx.tableProps, { ref: "tableViewRef" }), createSlots({ _: 2 }, [
546
+ ]), 1040, ["isAllowShowEmpty"])) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
547
+ _ctx.isShowTable ? (openBlock(), createBlock(_component_EleDataTable, mergeProps$1({ key: 0 }, _ctx.tableProps, {
548
+ ref: "tableViewRef",
549
+ isAllowShowEmpty: _ctx.isFinishedFirstRequest
550
+ }), createSlots({ _: 2 }, [
535
551
  renderList(Object.keys(_ctx.$slots).filter((k) => !_ctx.tableSlotExcludes.includes(k)), (name) => {
536
552
  return {
537
553
  name,
@@ -540,7 +556,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
540
556
  ])
541
557
  };
542
558
  })
543
- ]), 1040)) : createCommentVNode("", true)
559
+ ]), 1040, ["isAllowShowEmpty"])) : createCommentVNode("", true)
544
560
  ], 64)),
545
561
  _ctx.paginationProps || _ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
546
562
  key: 3,
@@ -202,6 +202,10 @@ export declare const proTableProps: {
202
202
  rowClickChecked: PropType<import('../ele-data-table/types').RowClickChecked>;
203
203
  reserveCurrent: BooleanConstructor;
204
204
  selectedRowKeys: PropType<import('../ele-data-table/types').DataKey[]>;
205
+ isAllowShowEmpty: {
206
+ type: BooleanConstructor;
207
+ default: boolean;
208
+ };
205
209
  };
206
210
  export type ProTableProps = ExtractPropTypes<typeof proTableProps>;
207
211
  /**
@@ -353,7 +353,7 @@ const index = /* @__PURE__ */ vue.defineComponent({
353
353
  };
354
354
  return () => vue.createVNode(elementPlus.ElTable, vue.mergeProps(tableProps.value, {
355
355
  "ref": tableRef,
356
- "emptyText": props$1.errorText || props$1.emptyText,
356
+ "emptyText": props$1.isAllowShowEmpty ? props$1.errorText || props$1.emptyText : "",
357
357
  "rowClassName": (param) => util.getBodyRowClass(props$1.rowClassName, param),
358
358
  "headerRowClassName": (param) => util.getHeadRowClass(props$1.headerRowClassName, param, props$1.headerEllipsis),
359
359
  "class": ["ele-data-table", {
@@ -381,18 +381,25 @@ const index = /* @__PURE__ */ vue.defineComponent({
381
381
  var _a;
382
382
  return (_a = slots.append) == null ? void 0 : _a.call(slots, slotProps);
383
383
  } : void 0,
384
- empty: slots.empty ? () => {
384
+ //empty: slots.empty ? () => slots.empty?.({ text: props.emptyText, error: props.errorText }) : props.emptyProps ? () => <ElEmpty imageSize={68} {...(!props.emptyProps || props.emptyProps === true ? {} : props.emptyProps)} description={props.errorText || props.emptyText} class="ele-table-empty" /> : void 0,
385
+ empty: () => {
385
386
  var _a;
386
- return (_a = slots.empty) == null ? void 0 : _a.call(slots, {
387
- text: props$1.emptyText,
388
- error: props$1.errorText
389
- });
390
- } : props$1.emptyProps ? () => vue.createVNode(elementPlus.ElEmpty, vue.mergeProps({
391
- "imageSize": 68
392
- }, !props$1.emptyProps || props$1.emptyProps === true ? {} : props$1.emptyProps, {
393
- "description": props$1.errorText || props$1.emptyText,
394
- "class": "ele-table-empty"
395
- }), null) : void 0,
387
+ if (!props$1.isAllowShowEmpty) return null;
388
+ if (slots.empty) {
389
+ return (_a = slots.empty) == null ? void 0 : _a.call(slots, {
390
+ text: props$1.emptyText,
391
+ error: props$1.errorText
392
+ });
393
+ }
394
+ if (props$1.emptyProps) {
395
+ return vue.createVNode(elementPlus.ElEmpty, vue.mergeProps({
396
+ "imageSize": 68
397
+ }, !props$1.emptyProps || props$1.emptyProps === true ? {} : props$1.emptyProps, {
398
+ "description": props$1.errorText || props$1.emptyText,
399
+ "class": "ele-table-empty"
400
+ }), null);
401
+ }
402
+ },
396
403
  default: () => tableCols.value.map(renderTableColumn)
397
404
  });
398
405
  }
@@ -42,6 +42,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
42
42
  reserveCurrent: BooleanConstructor;
43
43
  selectedRowKeys: import('vue').PropType<DataKey[]>;
44
44
  cacheData: import('vue').PropType<DataItem[]>;
45
+ isAllowShowEmpty: {
46
+ type: BooleanConstructor;
47
+ default: boolean;
48
+ };
45
49
  data: {
46
50
  type: import('vue').PropType<any[]>;
47
51
  default: () => never[];
@@ -208,6 +212,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
208
212
  reserveCurrent: BooleanConstructor;
209
213
  selectedRowKeys: import('vue').PropType<DataKey[]>;
210
214
  cacheData: import('vue').PropType<DataItem[]>;
215
+ isAllowShowEmpty: {
216
+ type: BooleanConstructor;
217
+ default: boolean;
218
+ };
211
219
  data: {
212
220
  type: import('vue').PropType<any[]>;
213
221
  default: () => never[];
@@ -336,6 +344,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
336
344
  bottomLine: boolean;
337
345
  emptyProps: import('./types').TableEmptyProps;
338
346
  reserveCurrent: boolean;
347
+ isAllowShowEmpty: boolean;
339
348
  }, {}, {
340
349
  ElTable: import('element-plus/es/utils/index').SFCWithInstall<import('vue').DefineComponent<{
341
350
  data: {
@@ -57,7 +57,11 @@ const dataTableProps = {
57
57
  /** 多选选中行的值 */
58
58
  selectedRowKeys: Array,
59
59
  /** 缓存数据 */
60
- cacheData: Array
60
+ cacheData: Array,
61
+ isAllowShowEmpty: {
62
+ type: Boolean,
63
+ default: false
64
+ }
61
65
  };
62
66
  const dataTableEmits = {
63
67
  select: (_selection, _row) => true,
@@ -148,6 +148,10 @@ export declare const dataTableProps: {
148
148
  selectedRowKeys: PropType<DataKey[]>;
149
149
  /** 缓存数据 */
150
150
  cacheData: PropType<DataItem[]>;
151
+ isAllowShowEmpty: {
152
+ type: BooleanConstructor;
153
+ default: boolean;
154
+ };
151
155
  width: (NumberConstructor | StringConstructor)[];
152
156
  height: (NumberConstructor | StringConstructor)[];
153
157
  data: {
@@ -62,6 +62,7 @@ const _sfc_main = vue.defineComponent({
62
62
  hasNext: tableData.value.length >= tableLimit.value
63
63
  });
64
64
  });
65
+ const isFinishedFirstRequest = vue.ref(false);
65
66
  const tableEmptyProps = vue.computed(() => {
66
67
  return util$1.mergeProps(props2.emptyProps, globalProps.value.emptyProps);
67
68
  });
@@ -173,6 +174,7 @@ const _sfc_main = vue.defineComponent({
173
174
  tablePage.value = currentPage;
174
175
  tableTotal.value = totalCount;
175
176
  handleDone({ records, currentPage, totalCount, response: props2.datasource });
177
+ isFinishedFirstRequest.value = true;
176
178
  return;
177
179
  }
178
180
  if (!parent) {
@@ -201,9 +203,13 @@ const _sfc_main = vue.defineComponent({
201
203
  });
202
204
  };
203
205
  const reload = (option, parent, resolve) => {
206
+ if (parent === void 0) {
207
+ isFinishedFirstRequest.value = false;
208
+ }
204
209
  load(option, parent, resolve);
205
210
  };
206
211
  const reset = () => {
212
+ isFinishedFirstRequest.value = false;
207
213
  methods.doLayout();
208
214
  if (props2.lazy) {
209
215
  isShowTable.value = false;
@@ -243,6 +249,9 @@ const _sfc_main = vue.defineComponent({
243
249
  tableTotal.value = totalCount || data.length;
244
250
  }
245
251
  tableLoading.value = false;
252
+ if (parent === void 0) {
253
+ isFinishedFirstRequest.value = true;
254
+ }
246
255
  const result = {
247
256
  records: tableData.value,
248
257
  currentPage: tablePage.value,
@@ -476,6 +485,7 @@ const _sfc_main = vue.defineComponent({
476
485
  toolExportConfig,
477
486
  toolPrintConfig,
478
487
  loadingProps,
488
+ isFinishedFirstRequest,
479
489
  handleRefresh,
480
490
  handleSizeChange,
481
491
  handleColumnsChange,
@@ -522,7 +532,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
522
532
  void 0
523
533
  ]), 1040)) : vue.createCommentVNode("", true),
524
534
  vue.renderSlot(_ctx.$slots, "default"),
525
- _ctx.virtual ? (vue.openBlock(), vue.createBlock(_component_EleVirtualTable, vue.mergeProps({ key: 1 }, _ctx.tableProps, { ref: "tableViewRef" }), vue.createSlots({ _: 2 }, [
535
+ _ctx.virtual ? (vue.openBlock(), vue.createBlock(_component_EleVirtualTable, vue.mergeProps({ key: 1 }, _ctx.tableProps, {
536
+ ref: "tableViewRef",
537
+ isAllowShowEmpty: _ctx.isFinishedFirstRequest
538
+ }), vue.createSlots({ _: 2 }, [
526
539
  vue.renderList(Object.keys(_ctx.$slots).filter((k) => !_ctx.tableSlotExcludes.includes(k)), (name) => {
527
540
  return {
528
541
  name,
@@ -531,8 +544,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
531
544
  ])
532
545
  };
533
546
  })
534
- ]), 1040)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
535
- _ctx.isShowTable ? (vue.openBlock(), vue.createBlock(_component_EleDataTable, vue.mergeProps({ key: 0 }, _ctx.tableProps, { ref: "tableViewRef" }), vue.createSlots({ _: 2 }, [
547
+ ]), 1040, ["isAllowShowEmpty"])) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
548
+ _ctx.isShowTable ? (vue.openBlock(), vue.createBlock(_component_EleDataTable, vue.mergeProps({ key: 0 }, _ctx.tableProps, {
549
+ ref: "tableViewRef",
550
+ isAllowShowEmpty: _ctx.isFinishedFirstRequest
551
+ }), vue.createSlots({ _: 2 }, [
536
552
  vue.renderList(Object.keys(_ctx.$slots).filter((k) => !_ctx.tableSlotExcludes.includes(k)), (name) => {
537
553
  return {
538
554
  name,
@@ -541,7 +557,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
541
557
  ])
542
558
  };
543
559
  })
544
- ]), 1040)) : vue.createCommentVNode("", true)
560
+ ]), 1040, ["isAllowShowEmpty"])) : vue.createCommentVNode("", true)
545
561
  ], 64)),
546
562
  _ctx.paginationProps || _ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock("div", {
547
563
  key: 3,
@@ -202,6 +202,10 @@ export declare const proTableProps: {
202
202
  rowClickChecked: PropType<import('../ele-data-table/types').RowClickChecked>;
203
203
  reserveCurrent: BooleanConstructor;
204
204
  selectedRowKeys: PropType<import('../ele-data-table/types').DataKey[]>;
205
+ isAllowShowEmpty: {
206
+ type: BooleanConstructor;
207
+ default: boolean;
208
+ };
205
209
  };
206
210
  export type ProTableProps = ExtractPropTypes<typeof proTableProps>;
207
211
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yuang-framework-ui-pc",
3
- "version": "1.1.161",
3
+ "version": "1.1.162",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite --host --config vite.global.ts --mode dev",