@sy-common/organize-select-help 1.0.0-beta.52 → 1.0.0-beta.54

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sy-common/organize-select-help",
3
- "version": "1.0.0-beta.52",
3
+ "version": "1.0.0-beta.54",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
package/src/index.vue CHANGED
@@ -701,11 +701,10 @@ export default {
701
701
  }
702
702
  },
703
703
  async loadMore(){
704
- let nowTime = Date.now()
705
- if (this.loadingStaff || this.staffEnding || (nowTime - this.lastLoadingTime < 1000)) return
704
+ if (this.loadingStaff || this.staffEnding) return
706
705
  this.loadingStaff = true
707
706
  try {
708
- console.log("--触底加载---")
707
+ console.log("--触底加载/强制加载---", new Date().getTime()); // 调试日志,确认方法执行
709
708
  let res = await this.queryAllStaffList()
710
709
  let list = res.rows;
711
710
  list.map((item)=>item.checked=false)
@@ -944,27 +943,57 @@ export default {
944
943
  },
945
944
  visibleChange(val) {
946
945
  this.$emit('input', val);
947
- // val 为 true 时表示帮助框打开,此时发起请求
948
946
  if (val) {
949
- this.initStaffList() // 新增初始化方法,统一处理打开后的请求逻辑
947
+ this.resetStaffTreeChecked();
948
+ this.staffEnding = false;
949
+ this.offset = 0;
950
+ this.staffAllList = [];
951
+ this.loadingStaff = false;
952
+ if (this.tabName === 'staff') {
953
+ this.loadMore().catch(err => console.log("弹窗打开加载失败:", err));
954
+ this.$nextTick(() => {
955
+ setTimeout(() => {
956
+ this.loadMore();
957
+ }, 100);
958
+ });
959
+ }
950
960
  } else {
951
- // 可选:关闭帮助框时重置人员列表相关状态,避免下次打开残留旧数据
952
961
  this.staffEnding = false;
953
962
  this.offset = 0;
954
963
  this.staffAllList = [];
955
- // 关闭时重置选中状态
956
964
  this.$set(this, 'selectedStaffOrgId', '');
965
+ if (this.$refs.staffTree) {
966
+ this.$refs.staffTree.clearAllChecked(this.$refs.staffTree.data);
967
+ this.$refs.staffTree.$emit('handleChange', []);
968
+ }
969
+ }
970
+ },
971
+ resetStaffTreeChecked() {
972
+ this.$set(this, 'selectedStaffOrgId', '');
973
+ this.proStaffOrgList = [];
974
+ if (this.$refs.staffTree) {
975
+ this.$refs.staffTree.clearAllChecked(this.$refs.staffTree.data);
976
+ this.$refs.staffTree.$emit('handleChange', []);
977
+ if (this.$refs.staffTree.initData) {
978
+ this.$refs.staffTree.initData();
979
+ }
980
+ }
981
+ if (this.tabName === 'staff') {
982
+ this.$nextTick(() => {
983
+ this.loadMore();
984
+ });
957
985
  }
958
986
  },
959
987
  initStaffList() {
960
988
  this.staffEnding = false;
961
989
  this.offset = 0;
962
990
  this.staffAllList = [];
963
- // 初始化时确保selectedStaffOrgId状态正确
964
- if (this.tabName === 'staff' && (!this.selectedStaffOrgId || this.selectedStaffOrgId.trim())) {
965
- this.$set(this, 'selectedStaffOrgId', '');
966
- }
967
- this.loadMore(); // 打开帮助框后,再发起第一次请求
991
+ // 小幅延迟,确保树重置完成后再发起查询(避免时序差)
992
+ this.$nextTick(() => {
993
+ setTimeout(() => {
994
+ this.loadMore();
995
+ }, 50); // 50ms足够,可根据实际情况调整
996
+ });
968
997
  },
969
998
  // 处理Tab切换,同步更新tabName
970
999
  handleTabChange(tabName) {
@@ -972,16 +1001,20 @@ export default {
972
1001
 
973
1002
  // 仅修改人员Tab相关逻辑,不影响其他Tab
974
1003
  if (tabName === 'staff') {
975
- // 重置人员选择相关状态
976
- this.$set(this, 'selectedStaffOrgId', '');
977
- this.proStaffOrgList = [];
978
- // 清空树组件选中状态
979
- if (this.$refs.staffTree) {
980
- this.$refs.staffTree.clearAllChecked(this.$refs.staffTree.data);
981
- this.$refs.staffTree.$emit('handleChange', []);
982
- }
983
- // 切换到人员tab时,立即触发一次搜索,确保orgUnitId参数正确
984
- this.$nextTick(() => this.searchStaff());
1004
+ this.resetStaffTreeChecked();
1005
+ // 第一步:同步重置查询参数(确保参数干净)
1006
+ this.staffEnding = false;
1007
+ this.offset = 0;
1008
+ this.staffAllList = [];
1009
+ this.loadingStaff = false; // 强制解除加载中状态
1010
+ // 第二步:立即同步调用(优先执行)
1011
+ this.loadMore().catch(err => console.log("同步加载失败:", err));
1012
+ // 第三步:异步兜底调用(防止同步调用被阻塞)
1013
+ this.$nextTick(() => {
1014
+ setTimeout(() => {
1015
+ this.loadMore();
1016
+ }, 100);
1017
+ });
985
1018
  } else if (tabName === 'post' && this.$refs.postTree && this.proPostList.length === 0) {
986
1019
  // 保留原有岗位Tab逻辑,不修改
987
1020
  this.proPostList = [];
@@ -1578,81 +1611,192 @@ export default {
1578
1611
 
1579
1612
  .staff-left-right-layout {
1580
1613
  display: flex;
1581
- height: 600px;
1614
+ height: 550px !important;
1582
1615
  gap: 15px;
1583
1616
  padding: 0 5px;
1584
1617
  width: 100%;
1585
1618
  box-sizing: border-box;
1586
-
1587
- .staff-left-panel {
1588
- min-width: 300px;
1589
- max-width: 350px;
1590
- width: 320px;
1591
- display: flex;
1592
- flex-direction: column;
1593
- box-sizing: border-box;
1594
- flex-shrink: 0;
1595
-
1596
- .panel-title { /* 原有样式保留 */ }
1619
+ flex-wrap: nowrap !important;
1620
+
1621
+ & > .staff-left-panel {
1622
+ width: 320px !important;
1623
+ min-width: 320px !important;
1624
+ max-width: 320px !important;
1625
+ display: flex !important;
1626
+ flex-direction: column !important;
1627
+ box-sizing: border-box !important;
1628
+ flex-shrink: 0 !important;
1629
+ flex-grow: 0 !important;
1630
+ height: 100% !important;
1631
+ position: relative !important; // 确保子元素 z-index 生效
1632
+
1633
+ ::v-deep(.panel-title) {
1634
+ all: unset !important;
1635
+ display: flex !important; // 改为flex,方便对齐竖条和文字
1636
+ align-items: center !important; // 文字垂直居中
1637
+ visibility: visible !important;
1638
+ opacity: 1 !important;
1639
+ height: 20px !important;
1640
+ line-height: 20px !important;
1641
+ font-size: 14px !important;
1642
+ font-weight: 500 !important;
1643
+ color: #333 !important;
1644
+ margin-bottom: 8px !important;
1645
+ background: #fff !important;
1646
+ z-index: 999 !important;
1647
+ padding: 0 !important;
1648
+ box-sizing: border-box !important;
1649
+ position: relative !important;
1650
+ width: 100% !important;
1651
+ // 左侧竖条核心样式
1652
+ &::before {
1653
+ content: '' !important;
1654
+ display: inline-block !important;
1655
+ width: 5px !important; // 竖条宽度
1656
+ height: 16px !important; // 竖条高度(略小于文字行高)
1657
+ background-color: #1890ff !important; // 蓝色竖条(可改颜色)
1658
+ margin-right: 8px !important; // 竖条与文字间距
1659
+ //border-radius: 1.5px !important;
1660
+ }
1661
+ }
1597
1662
 
1598
1663
  .staff-org-tree {
1599
- height: calc(100% - 38px) !important;
1664
+ height: calc(100% - 28px) !important; /* 28 = 标题高度20 + 间距8 */
1600
1665
  border: 1px solid #EAECF0;
1601
1666
  border-radius: 4px;
1602
- padding: 8px;
1667
+ padding: 0 !important;
1603
1668
  box-sizing: border-box;
1604
- /* 原样式保留,新增:禁止自身滚动,交给内部容器 */
1605
- overflow: hidden !important;
1669
+ width: 100% !important;
1670
+ overflow-x: auto !important;
1671
+ overflow-y: auto !important;
1606
1672
  position: relative;
1607
- }
1673
+ flex-shrink: 1;
1674
+ min-height: 0 !important;
1608
1675
 
1609
- /* 新增强制滚动容器样式(关键) */
1610
- .tree-scroll-force {
1611
- width: 100%;
1612
- height: 100%;
1613
- overflow: auto !important; /* 强制开启滚动 */
1614
- overflow-x: scroll !important; /* 强制显示横向滚动条 */
1615
- overflow-y: auto !important;
1616
- /* 强制最小宽度,确保内容溢出时触发滚动 */
1617
- min-width: 100%;
1618
- max-width: none !important;
1619
- /* 滚动条样式强制显示 */
1620
1676
  &::-webkit-scrollbar {
1621
1677
  width: 8px !important;
1622
1678
  height: 8px !important;
1623
- display: block !important;
1624
1679
  background: #f9f9f9 !important;
1625
1680
  }
1626
1681
  &::-webkit-scrollbar-thumb {
1627
1682
  background: #ccc !important;
1628
1683
  border-radius: 4px !important;
1629
1684
  }
1630
- /* 兼容Firefox */
1631
1685
  scrollbar-width: thin !important;
1632
1686
  scrollbar-color: #ccc #f9f9f9 !important;
1633
1687
  }
1634
1688
 
1635
- /* 强制组织树组件宽度自适应内容 */
1636
- .tree-scroll-force /deep/ .ivu-tree {
1637
- width: fit-content !important; /* 宽度跟随内容 */
1638
- min-width: 100% !important; /* 最小占满容器 */
1639
- white-space: nowrap !important;
1640
- display: inline-block !important;
1689
+ .tree-scroll-force {
1690
+ width: 100% !important;
1691
+ height: 100% !important;
1692
+ margin: 0 !important;
1693
+ padding: 8px !important;
1694
+ box-sizing: border-box;
1695
+ overflow: visible !important;
1696
+ position: relative;
1641
1697
  }
1642
1698
  }
1643
1699
 
1644
1700
  .staff-right-panel {
1645
1701
  flex: 1 !important;
1646
- min-width: 350px;
1702
+ min-width: 0 !important;
1647
1703
  width: calc(100% - 335px) !important;
1648
1704
  display: flex;
1649
1705
  flex-direction: column;
1650
1706
  box-sizing: border-box;
1651
- gap: 8px;
1707
+ gap: 8px; /* 搜索框与列表、列表与底部选择栏的间距统一为8px */
1652
1708
  padding: 0 5px;
1653
- flex-shrink: 0;
1709
+ flex-shrink: 1 !important;
1710
+
1711
+ // 搜索框:固定高度
1712
+ .ivu-input-wrapper {
1713
+ height: 32px;
1714
+ flex-shrink: 0;
1715
+ }
1716
+
1717
+ // 右侧人员列表容器:高度 = 父容器高度 - 搜索框高度 - 底部选择栏高度 - 两次间距(8*2)
1718
+ .staff-content {
1719
+ height: calc(100% - 32px - 40px - 16px) !important; /* 40=底部选择栏高度,16=8*2间距 */
1720
+ border: 1px solid #EAECF0;
1721
+ border-radius: 4px;
1722
+ overflow-x: hidden !important;
1723
+ overflow-y: auto !important;
1724
+ flex-shrink: 1;
1725
+
1726
+ &::-webkit-scrollbar {
1727
+ width: 8px !important;
1728
+ height: 8px !important;
1729
+ background: #f9f9f9 !important;
1730
+ }
1731
+ &::-webkit-scrollbar-thumb {
1732
+ background: #ccc !important;
1733
+ border-radius: 4px !important;
1734
+ }
1735
+ scrollbar-width: thin !important;
1736
+ scrollbar-color: #ccc #f9f9f9 !important;
1737
+ }
1738
+
1739
+ // 底部选择栏:固定高度
1740
+ .bottom-select {
1741
+ height: 40px;
1742
+ flex-shrink: 0;
1743
+ display: flex;
1744
+ align-items: center;
1745
+ justify-content: space-between;
1746
+ padding: 8px 0;
1747
+ background: #fff !important;
1748
+ border-top: 1px solid #f0f0f0;
1749
+
1750
+ .num {
1751
+ color: var(--primary-color);
1752
+ }
1753
+ }
1754
+ }
1755
+ }
1756
+
1757
+ .tab-content-pro {
1758
+ .tab {
1759
+ .tree {
1760
+ height: 400px !important;
1761
+ max-height: 400px !important;
1762
+ margin-top:20px;
1763
+ overflow-y: auto !important;
1764
+ overflow-x: auto !important;
1765
+ border: 1px solid #EAECF0;
1766
+ border-radius: 4px;
1767
+ box-sizing: border-box;
1768
+
1769
+ &::-webkit-scrollbar {
1770
+ width: 8px !important;
1771
+ height: 8px !important;
1772
+ display: block !important;
1773
+ background: #f9f9f9 !important;
1774
+ }
1775
+ &::-webkit-scrollbar-thumb {
1776
+ background: #ccc !important;
1777
+ border-radius: 4px !important;
1778
+ }
1779
+ }
1780
+
1781
+ &.post .right .tree {
1782
+ height: 380px !important;
1783
+ max-height: 380px !important;
1784
+ }
1654
1785
 
1655
- // 其他右侧样式保持不变...
1786
+ .bottom-select {
1787
+ display:flex;
1788
+ align-items: center;
1789
+ justify-content: space-between;
1790
+ margin-top:15px !important;
1791
+ padding: 8px 0;
1792
+ background: #fff !important;
1793
+ position: relative;
1794
+ z-index: 10;
1795
+ border-top: 1px solid #f0f0f0;
1796
+ .num{
1797
+ color:var(--primary-color);
1798
+ }
1799
+ }
1656
1800
  }
1657
1801
  }
1658
1802
 
@@ -1857,9 +2001,30 @@ export default {
1857
2001
  display:flex;
1858
2002
  align-items: center;
1859
2003
  }
1860
- .tree{
1861
- height:450px;
2004
+ .tree {
2005
+ height: 400px !important; // 从450px下调,预留下方复选框空间
2006
+ max-height: 400px !important; // 强制最大高度,禁止超出
1862
2007
  margin-top:20px;
2008
+ overflow-y: auto !important; // 纵向溢出时滚动,而非超出
2009
+ overflow-x: auto !important; // 横向溢出时滚动
2010
+ border: 1px solid #EAECF0; // 明确容器边界(可选)
2011
+ border-radius: 4px;
2012
+ box-sizing: border-box; // 包含边框/内边距计算
2013
+ // 滚动条样式统一(与人员Tab保持一致)
2014
+ &::-webkit-scrollbar {
2015
+ width: 8px !important;
2016
+ height: 8px !important;
2017
+ display: block !important;
2018
+ background: #f9f9f9 !important;
2019
+ }
2020
+ &::-webkit-scrollbar-thumb {
2021
+ background: #ccc !important;
2022
+ border-radius: 4px !important;
2023
+ }
2024
+ }
2025
+ &.post .right .tree {
2026
+ height: 380px !important;
2027
+ max-height: 380px !important;
1863
2028
  }
1864
2029
  .staff-content{
1865
2030
  overflow:auto;
@@ -1868,7 +2033,12 @@ export default {
1868
2033
  display:flex;
1869
2034
  align-items: center;
1870
2035
  justify-content: space-between;
1871
- margin-top:20px;
2036
+ margin-top:15px !important; // 增加间距
2037
+ padding: 8px 0; // 内边距提升可读性
2038
+ background: #fff !important; // 白色背景覆盖树溢出内容
2039
+ position: relative;
2040
+ z-index: 10; // 层级高于树容器
2041
+ border-top: 1px solid #f0f0f0; // 视觉分隔(可选)
1872
2042
  .num{
1873
2043
  color:var(--primary-color);
1874
2044
  }
@@ -423,6 +423,7 @@ export default {
423
423
  min-width: 100% !important;
424
424
  height: 100% !important;
425
425
  white-space: nowrap !important;
426
+ overflow: visible !important;
426
427
  }
427
428
 
428
429
  /deep/ .ivu-tree-node {
@@ -436,6 +437,7 @@ export default {
436
437
  cursor: default !important;
437
438
  pointer-events: none !important;
438
439
  padding-left: 0 !important;
440
+ width: 100% !important; /* 关键:节点内容宽度100% */
439
441
 
440
442
  .ivu-checkbox, .ivu-tree-switcher {
441
443
  pointer-events: auto !important;
@@ -446,11 +448,13 @@ export default {
446
448
  /deep/ .ivu-tree {
447
449
  white-space: nowrap !important;
448
450
  display: inline-block !important;
449
- width: auto !important; /* 宽度自适应内容 */
450
- min-width: 100% !important; /* 最小宽度占满容器 */
451
+ width: auto !important;
452
+ min-width: 100% !important;
451
453
  box-sizing: border-box;
454
+ height: 100% !important; /* 关键:树组件高度100% */
452
455
  }
453
456
 
457
+
454
458
  /deep/ .ivu-tree-node,
455
459
  /deep/ .ivu-tree-node *,
456
460
  /deep/ .ivu-tree-node-content,