cnhis-design-vue 2.1.112 → 2.1.113

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 (42) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/es/age/index.js +2 -2
  3. package/es/big-table/index.js +109 -54
  4. package/es/big-table/style.css +1 -1
  5. package/es/button/index.js +2 -2
  6. package/es/captcha/index.js +3 -3
  7. package/es/card-reader-sdk/index.js +1 -1
  8. package/es/checkbox/index.js +1 -1
  9. package/es/color-picker/index.js +1 -1
  10. package/es/drag-layout/index.js +3 -3
  11. package/es/editor/index.js +1 -1
  12. package/es/ellipsis/index.js +1 -1
  13. package/es/fabric-chart/index.js +9 -9
  14. package/es/form-table/index.js +20 -20
  15. package/es/index/index.js +265 -210
  16. package/es/index/style.css +1 -1
  17. package/es/input/index.js +1 -1
  18. package/es/map/index.js +1 -1
  19. package/es/multi-chat/index.js +25 -25
  20. package/es/multi-chat-client/index.js +19 -19
  21. package/es/multi-chat-history/index.js +4 -4
  22. package/es/multi-chat-record/index.js +4 -4
  23. package/es/multi-chat-setting/index.js +20 -20
  24. package/es/multi-chat-sip/index.js +1 -1
  25. package/es/radio/index.js +1 -1
  26. package/es/scale-container/index.js +1 -1
  27. package/es/scale-view/index.js +27 -27
  28. package/es/select/index.js +4 -4
  29. package/es/select-label/index.js +3 -3
  30. package/es/select-person/index.js +2 -2
  31. package/es/select-tag/index.js +4 -4
  32. package/es/shortcut-setter/index.js +2 -2
  33. package/es/slider-tree/index.js +1 -1
  34. package/es/table-filter/index.js +30 -30
  35. package/es/tag/index.js +1 -1
  36. package/es/verification-code/index.js +2 -2
  37. package/lib/cui.common.js +288 -233
  38. package/lib/cui.umd.js +288 -233
  39. package/lib/cui.umd.min.js +8 -8
  40. package/package.json +1 -1
  41. package/packages/big-table/src/BigTable.vue +42 -7
  42. package/packages/big-table/src/assets/style/table-global.less +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "2.1.112",
3
+ "version": "2.1.113",
4
4
  "description": "前端业务UI库",
5
5
  "keyword": "cnhis-design-vue vue cnhis",
6
6
  "homepage": "http://dv.cnhis.com/",
@@ -2138,31 +2138,66 @@ export default create({
2138
2138
  field.searchFilterCONVERT = newValue;
2139
2139
  beforeSearchConvert = vexutils.clone(newValue, true);
2140
2140
  },
2141
+ getOffsetLocation(element, cls, offsetKey){
2142
+ let actualTop = element[offsetKey];
2143
+ let current = element.offsetParent;
2144
+ while (current && current.classList && !current.classList.contains(cls)) {
2145
+ actualTop += current[offsetKey];
2146
+ current = current.offsetParent;
2147
+ }
2148
+ return actualTop;
2149
+ },
2150
+ showFilterHandleLocationNew(target, tempWrapId){
2151
+ let resTop = this.getOffsetLocation(target, tempWrapId, 'offsetTop');
2152
+ let resLeft = this.getOffsetLocation(target, tempWrapId, 'offsetLeft');
2153
+ let resWidth = target.offsetWidth;
2154
+ let resHeight = target.offsetHeight;
2155
+ return {resTop, resLeft, resWidth, resHeight}
2156
+ },
2141
2157
  showFilter(field, columnName, event) {
2142
2158
  if (this.isInlineOperating) return false;
2143
2159
  let target = event.target;
2160
+ if(!target) return false;
2144
2161
  const FILTER_BOX_WIDTH = 400;
2145
2162
  let fontSize = this.styleSetting?.fontSize || 'small'
2146
- const scaleNum = fontSizeMap[fontSize]
2147
- const FILTER_BOX_TOP_OFFSET = filterTopOffsetMap[fontSize]
2163
+ let scaleNum = fontSizeMap[fontSize]
2164
+ let FILTER_BOX_TOP_OFFSET = filterTopOffsetMap[fontSize]
2148
2165
 
2149
2166
  let transformWrap = document.body;
2150
2167
  let { left: btnRectLeft, right: btnRectRight, top: btnRectTop, width: btnWidth } = target.getBoundingClientRect();
2168
+ let transformWrapWidth = transformWrap.clientWidth;
2169
+ let isOverLeft = btnRectLeft + FILTER_BOX_WIDTH > transformWrapWidth;
2170
+ let right= 0;
2171
+ // 位置不够左定位
2172
+ if(isOverLeft) {
2173
+ let transformWrapRight = transformWrap?.getBoundingClientRect().right || 0;
2174
+ right = transformWrapRight - btnRectRight - btnWidth / 2
2175
+ }
2176
+ // 定位一直有问题, 最后还是相对于editTable定位, 不然弹框打开的列表会错位
2177
+ // 如果是相对app的话, filter-wrap插入的位置可能会有问题, 因为通过micro打开的列表, app id是重复的
2178
+ if(this.filterDomPortal && this.filterDomPortal != 'body' && this.filterDomPortal.includes("#")) {
2179
+ let tempWrapId = this.filterDomPortal.slice(1, this.filterDomPortal.length);
2180
+ scaleNum = 1;
2181
+ FILTER_BOX_TOP_OFFSET = 0;
2182
+ const {resTop = 0, resLeft = 0, resWidth = 0, resHeight = 0} = this.showFilterHandleLocationNew(target, tempWrapId)
2183
+ btnRectTop = resTop + resHeight + 8;
2184
+ btnWidth = resWidth;
2185
+ btnRectLeft = resLeft;
2186
+ btnRectRight = resWidth + btnRectLeft;
2187
+ right = document.getElementById(tempWrapId).offsetWidth - btnWidth - resLeft;
2188
+ }
2151
2189
 
2152
2190
  field.left = 'initial';
2153
2191
  field.right = 'initial';
2154
2192
  field.top = 'initial';
2155
- let transformWrapWidth = transformWrap.clientWidth;
2156
- if (btnRectLeft + FILTER_BOX_WIDTH > transformWrapWidth) {
2157
- let transformWrapRight = transformWrap?.getBoundingClientRect().right || 0;
2158
- const right = transformWrapRight - btnRectRight - btnWidth / 2
2193
+
2194
+ if (isOverLeft) {
2159
2195
  field.right = right / scaleNum + 'px';
2160
2196
  } else {
2161
2197
  const left = btnRectLeft + (this.filterLeftOffset || 0)
2162
2198
  field.left = left / scaleNum + 'px';
2163
2199
  }
2164
2200
 
2165
-
2166
2201
  const top = btnRectTop + FILTER_BOX_TOP_OFFSET + (this.filterTopOffset || 0)
2167
2202
  field.top = top / scaleNum + 'px';
2168
2203
 
@@ -1,6 +1,6 @@
1
1
  @import '../iconfont/iconfont.css';
2
2
  .big-table-filter-wrap {
3
- position: fixed;
3
+ position: absolute;
4
4
  z-index: 99998;
5
5
  transform: translateX(-2%);
6
6