@ctzy-web-client/plugin-component-vue 1.0.49 → 1.0.50

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.
@@ -89,11 +89,16 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
89
89
  });
90
90
  const maxHeight = ref(0);
91
91
  function updateMaxHeight(list) {
92
- if (list == null ? void 0 : list.length) {
93
- maxHeight.value = list.length * 64 + 62;
94
- } else {
95
- maxHeight.value = 0;
96
- }
92
+ nextTick(() => {
93
+ if (!elTable.value)
94
+ return;
95
+ let h = (list == null ? void 0 : list.length) ? list.length * 64 + 62 : void 0;
96
+ if (h) {
97
+ elTable.value.$el.style.maxHeight = h + "px";
98
+ } else {
99
+ elTable.value.$el.style.maxHeight = "";
100
+ }
101
+ });
97
102
  }
98
103
  const tableAutoHeight = ref(300);
99
104
  const PAGINATION_HEIGHT = 160;
@@ -116,6 +121,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
116
121
  onMounted(() => {
117
122
  calcTableHeight();
118
123
  window.addEventListener("resize", watchResize);
124
+ nextTick(() => {
125
+ var _a2;
126
+ if ((_a2 = props.dataTable.data) == null ? void 0 : _a2.length) {
127
+ updateMaxHeight(props.dataTable.data);
128
+ }
129
+ });
119
130
  });
120
131
  onBeforeUnmount(() => {
121
132
  window.removeEventListener("resize", watchResize);
package/es/utils.css ADDED
@@ -0,0 +1 @@
1
+ .letter-circle[data-v-9ba46efc]{align-items:center;border-radius:50%;color:#fff;display:flex;font-size:14px;height:24px;justify-content:center;margin-right:8px;width:24px}.pct-select-ellipsis .el-select-dropdown__item{box-sizing:border-box!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;width:100%!important}.letter-circle[data-v-cb2d8ca5]{align-items:center;border-radius:50%;color:#fff;display:flex;flex-shrink:0;font-size:12px;height:22px;justify-content:center;width:22px}.option-container[data-v-cb2d8ca5]{align-items:center;display:flex;width:100%}.option-text[data-v-cb2d8ca5]{flex:1;margin-left:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@@ -93,11 +93,16 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
93
93
  });
94
94
  const maxHeight = vue.ref(0);
95
95
  function updateMaxHeight(list) {
96
- if (list == null ? void 0 : list.length) {
97
- maxHeight.value = list.length * 64 + 62;
98
- } else {
99
- maxHeight.value = 0;
100
- }
96
+ vue.nextTick(() => {
97
+ if (!elTable.value)
98
+ return;
99
+ let h = (list == null ? void 0 : list.length) ? list.length * 64 + 62 : void 0;
100
+ if (h) {
101
+ elTable.value.$el.style.maxHeight = h + "px";
102
+ } else {
103
+ elTable.value.$el.style.maxHeight = "";
104
+ }
105
+ });
101
106
  }
102
107
  const tableAutoHeight = vue.ref(300);
103
108
  const PAGINATION_HEIGHT = 160;
@@ -120,6 +125,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
120
125
  vue.onMounted(() => {
121
126
  calcTableHeight();
122
127
  window.addEventListener("resize", watchResize);
128
+ vue.nextTick(() => {
129
+ var _a2;
130
+ if ((_a2 = props.dataTable.data) == null ? void 0 : _a2.length) {
131
+ updateMaxHeight(props.dataTable.data);
132
+ }
133
+ });
123
134
  });
124
135
  vue.onBeforeUnmount(() => {
125
136
  window.removeEventListener("resize", watchResize);
package/lib/utils.css ADDED
@@ -0,0 +1 @@
1
+ .letter-circle[data-v-9ba46efc]{align-items:center;border-radius:50%;color:#fff;display:flex;font-size:14px;height:24px;justify-content:center;margin-right:8px;width:24px}.pct-select-ellipsis .el-select-dropdown__item{box-sizing:border-box!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;width:100%!important}.letter-circle[data-v-cb2d8ca5]{align-items:center;border-radius:50%;color:#fff;display:flex;flex-shrink:0;font-size:12px;height:22px;justify-content:center;width:22px}.option-container[data-v-cb2d8ca5]{align-items:center;display:flex;width:100%}.option-text[data-v-cb2d8ca5]{flex:1;margin-left:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctzy-web-client/plugin-component-vue",
3
- "version": "1.0.49",
3
+ "version": "1.0.50",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "exports": {
@@ -216,11 +216,15 @@ const maxHeight = ref(0)
216
216
 
217
217
  // 计算最大高度
218
218
  function updateMaxHeight(list) {
219
- if (list?.length) {
220
- maxHeight.value = list.length * 64 + 62
221
- } else {
222
- maxHeight.value = 0
223
- }
219
+ nextTick(()=>{
220
+ if(!elTable.value) return
221
+ let h = list?.length ? list.length * 64 + 62 : undefined
222
+ if(h){
223
+ elTable.value.$el.style.maxHeight = h + 'px'
224
+ }else{
225
+ elTable.value.$el.style.maxHeight = ''
226
+ }
227
+ })
224
228
  }
225
229
  // ====================
226
230
  // 自动高度计算(react-base-table 同款逻辑)
@@ -253,6 +257,11 @@ function watchResize() {
253
257
  onMounted(() => {
254
258
  calcTableHeight()
255
259
  window.addEventListener('resize', watchResize)
260
+ nextTick(()=>{
261
+ if(props.dataTable.data?.length){
262
+ updateMaxHeight(props.dataTable.data)
263
+ }
264
+ })
256
265
  })
257
266
 
258
267
  onBeforeUnmount(() => {
package/es/components.css DELETED
@@ -1 +0,0 @@
1
- .letter-circle[data-v-9ba46efc]{font-size:14px;height:24px;margin-right:8px;width:24px}.letter-circle[data-v-9ba46efc],.letter-circle[data-v-cb2d8ca5]{align-items:center;border-radius:50%;color:#fff;display:flex;justify-content:center}.letter-circle[data-v-cb2d8ca5]{flex-shrink:0;font-size:12px;height:22px;width:22px}.option-container[data-v-cb2d8ca5]{align-items:center;display:flex;width:100%}.option-text[data-v-cb2d8ca5]{flex:1;margin-left:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pct-select-ellipsis .el-select-dropdown__item{box-sizing:border-box!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;width:100%!important}
@@ -1 +0,0 @@
1
- .letter-circle[data-v-9ba46efc]{font-size:14px;height:24px;margin-right:8px;width:24px}.letter-circle[data-v-9ba46efc],.letter-circle[data-v-cb2d8ca5]{align-items:center;border-radius:50%;color:#fff;display:flex;justify-content:center}.letter-circle[data-v-cb2d8ca5]{flex-shrink:0;font-size:12px;height:22px;width:22px}.option-container[data-v-cb2d8ca5]{align-items:center;display:flex;width:100%}.option-text[data-v-cb2d8ca5]{flex:1;margin-left:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pct-select-ellipsis .el-select-dropdown__item{box-sizing:border-box!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;width:100%!important}