@sy-common/organize-select-help 1.0.0-beta.57 → 1.0.0-beta.62

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.vue +131 -90
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sy-common/organize-select-help",
3
- "version": "1.0.0-beta.57",
3
+ "version": "1.0.0-beta.62",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
package/src/index.vue CHANGED
@@ -151,26 +151,21 @@
151
151
  v-for="(item, index) in staffAllList"
152
152
  :key="`staff_${index}_${item.id}`"
153
153
  @click="handlestaff(item)">
154
- <Checkbox
155
- v-model="item.checked"
156
- class="staff-checkbox"
157
- @click.stop="() => handlestaff(item)"
158
- ></Checkbox>
154
+ <!-- 移除 Checkbox 组件 -->
159
155
  <div class="left-panel-pro">{{item.name && item.name.slice(0,1) || ''}}</div>
160
156
  <div class="right-panel-pro">
161
157
  <p>{{item.name}}</p>
162
158
  <p>{{item.orgNodeName || item.orgUnitName}}</p>
163
159
  </div>
164
- <!-- <div class="checked-icon" v-show="item.checked">✔</div>-->
165
160
  </div>
166
161
  <p v-if="staffEnding" style="color:#CCCCCC;text-align: center">---我也是有底线的---</p>
167
162
  </div>
168
163
  <Spin v-if="loadingStaff" size="large" fix />
169
164
  </div>
170
- <div class="bottom-select">
171
- <div>当前已选择 <span class="num">{{getCheckedStaff}}</span>人</div>
172
- <Button type="primary" icon="md-add" @click="addStaffList">添加人员</Button>
173
- </div>
165
+ <!-- <div class="bottom-select">-->
166
+ <!-- <div>当前已选择 <span class="num">{{getCheckedStaff}}</span>人</div>-->
167
+ <!-- <Button type="primary" icon="md-add" @click="addStaffList">添加人员</Button>-->
168
+ <!-- </div>-->
174
169
  </div>
175
170
  </div>
176
171
  </TabPane>
@@ -743,10 +738,10 @@ export default {
743
738
  if (this.loadingStaff || this.staffEnding) return
744
739
  this.loadingStaff = true
745
740
  try {
746
- console.log("--触底加载/强制加载---", new Date().getTime()); // 调试日志,确认方法执行
741
+ console.log("--触底加载/强制加载---", new Date().getTime());
747
742
  let res = await this.queryAllStaffList()
748
743
  let list = res.rows;
749
- list.map((item)=>item.checked=false)
744
+ // 移除这行:list.map((item)=>item.checked=false)
750
745
  this.staffAllList = this.staffAllList.concat(list)
751
746
  this.offset += 10;
752
747
  this.loadingStaff = false
@@ -945,36 +940,50 @@ export default {
945
940
  this.postList.splice(index,1)
946
941
  },
947
942
  //staff
948
- addStaffList(){
949
- console.log("this.staffSingle", this.staffSingle)
950
- let staffList = this.staffAllList.filter((item)=>item.checked===true);
951
-
952
- if (!staffList.length) {
953
- this.$Message.error("请选择人员");
954
- return;
955
- }
956
- if (this.staffSingle && this.staffList.length >= 1) {
957
- this.$Message.error("请先清除已选人员,再重新添加");
958
- return;
943
+ // addStaffList(){
944
+ // console.log("this.staffSingle", this.staffSingle)
945
+ // let staffList = this.staffAllList.filter((item)=>item.checked===true);
946
+ //
947
+ // if (!staffList.length) {
948
+ // this.$Message.error("请选择人员");
949
+ // return;
950
+ // }
951
+ // if (this.staffSingle && this.staffList.length >= 1) {
952
+ // this.$Message.error("请先清除已选人员,再重新添加");
953
+ // return;
954
+ // }
955
+ //
956
+ // if(this.staffSingle && staffList.length > 1){
957
+ // this.$Message.error("温馨提示:当前业务暂时只支持选择一位人员");
958
+ // return;
959
+ // }
960
+ //
961
+ // // 基于item.id去重,不修改原数据字段,仅过滤重复项
962
+ // let uniqueStaffList = staffList.filter(newItem =>
963
+ // // 检查右侧条件区域(staffList)是否已有该人员,避免重复添加
964
+ // !this.staffList.some(existItem => existItem.userId === newItem.userId)
965
+ // );
966
+ // // 合并去重后的列表
967
+ // this.staffList = this.staffList.concat(uniqueStaffList);
968
+ // // 清空选中状态
969
+ // this.staffAllList.forEach(item => item.checked = false);
970
+ // },
971
+ handlestaff(item){
972
+ // 处理单选逻辑
973
+ if (this.staffSingle) {
974
+ // 单选时先清空已选人员
975
+ this.staffList = [];
959
976
  }
960
-
961
- if(this.staffSingle && staffList.length > 1){
962
- this.$Message.error("温馨提示:当前业务暂时只支持选择一位人员");
963
- return;
977
+ // 去重校验:避免重复添加
978
+ const isExist = this.staffList.some(existItem => existItem.userId === item.userId);
979
+ if (!isExist) {
980
+ // 深拷贝防止原数据引用污染
981
+ const newItem = this.safeDeepCopy(item);
982
+ this.staffList.push(newItem);
983
+ this.$Message.success(`已添加【${item.name}】`);
984
+ } else {
985
+ this.$Message.warning(`【${item.name}】已在选择列表中`);
964
986
  }
965
-
966
- // 基于item.id去重,不修改原数据字段,仅过滤重复项
967
- let uniqueStaffList = staffList.filter(newItem =>
968
- // 检查右侧条件区域(staffList)是否已有该人员,避免重复添加
969
- !this.staffList.some(existItem => existItem.userId === newItem.userId)
970
- );
971
- // 合并去重后的列表
972
- this.staffList = this.staffList.concat(uniqueStaffList);
973
- // 清空选中状态
974
- this.staffAllList.forEach(item => item.checked = false);
975
- },
976
- handlestaff(item){
977
- item.checked=!item.checked
978
987
  },
979
988
  clearStaff(){
980
989
  this.staffList = []
@@ -1587,9 +1596,9 @@ export default {
1587
1596
 
1588
1597
  },
1589
1598
  computed:{
1590
- getCheckedStaff(){
1591
- return this.staffAllList.filter((item)=>item.checked===true).length
1592
- },
1599
+ // getCheckedStaff(){
1600
+ // return this.staffAllList.filter((item)=>item.checked===true).length
1601
+ // },
1593
1602
  getCheckTypenum(){
1594
1603
  let l1 = this.orgList.length?1:0;
1595
1604
  let l2 = this.postList.length?1:0;
@@ -1627,32 +1636,32 @@ export default {
1627
1636
  </script>
1628
1637
  <style lang="less" scoped>
1629
1638
  // 新增checkbox样式
1630
- .staff-checkbox {
1631
- margin-right: 12px;
1632
- flex-shrink: 0;
1633
-
1634
- /deep/ .ivu-checkbox-wrapper {
1635
- display: flex;
1636
- align-items: center;
1637
- cursor: pointer;
1638
- }
1639
-
1640
- /deep/ .ivu-checkbox {
1641
- width: 18px;
1642
- height: 18px;
1643
-
1644
- &:checked {
1645
- /deep/ .ivu-checkbox-inner {
1646
- background-color: var(--primary-color);
1647
- border-color: var(--primary-color);
1648
- }
1649
- }
1650
- }
1651
- }
1639
+ //.staff-checkbox {
1640
+ // margin-right: 12px;
1641
+ // flex-shrink: 0;
1642
+ //
1643
+ // /deep/ .ivu-checkbox-wrapper {
1644
+ // display: flex;
1645
+ // align-items: center;
1646
+ // cursor: pointer;
1647
+ // }
1648
+ //
1649
+ // /deep/ .ivu-checkbox {
1650
+ // width: 18px;
1651
+ // height: 18px;
1652
+ //
1653
+ // &:checked {
1654
+ // /deep/ .ivu-checkbox-inner {
1655
+ // background-color: var(--primary-color);
1656
+ // border-color: var(--primary-color);
1657
+ // }
1658
+ // }
1659
+ // }
1660
+ //}
1652
1661
 
1653
1662
  .staff-left-right-layout {
1654
1663
  display: flex;
1655
- height: 550px !important;
1664
+ height: 650px !important;
1656
1665
  gap: 15px;
1657
1666
  padding: 0 5px;
1658
1667
  width: 100%;
@@ -1788,9 +1797,9 @@ export default {
1788
1797
  background: #fff !important;
1789
1798
  border-top: 1px solid #f0f0f0;
1790
1799
 
1791
- .num {
1792
- color: var(--primary-color);
1793
- }
1800
+ //.num {
1801
+ // color: var(--primary-color);
1802
+ //}
1794
1803
  }
1795
1804
  }
1796
1805
  }
@@ -1798,8 +1807,8 @@ export default {
1798
1807
  .tab-content-pro {
1799
1808
  .tab {
1800
1809
  .tree {
1801
- height: 400px !important;
1802
- max-height: 400px !important;
1810
+ height: 500px !important;
1811
+ max-height: 500px !important;
1803
1812
  margin-top:20px;
1804
1813
  overflow-y: auto !important;
1805
1814
  overflow-x: auto !important;
@@ -1841,7 +1850,7 @@ export default {
1841
1850
  }
1842
1851
  }
1843
1852
 
1844
- // 其他原有样式保持不变
1853
+
1845
1854
  /deep/ .ivu-tree {
1846
1855
  width: 100% !important;
1847
1856
  box-sizing: border-box;
@@ -1860,10 +1869,14 @@ export default {
1860
1869
  margin-top: 8px;
1861
1870
  cursor: pointer;
1862
1871
  box-sizing: border-box;
1863
- border: none !important; // 强制移除默认边框
1872
+ border: none !important;
1873
+ &:hover {
1874
+ background-color: #f2f8ff;
1875
+ border-radius: 4px;
1876
+ }
1864
1877
  }
1865
1878
 
1866
- // 恢复滚动条样式(确保滚动可见)
1879
+ // 滚动条样式
1867
1880
  .staff-content::-webkit-scrollbar {
1868
1881
  width: 8px !important;
1869
1882
  height: 8px;
@@ -1879,7 +1892,6 @@ export default {
1879
1892
  background-color: #f9f9f9 !important;
1880
1893
  }
1881
1894
 
1882
- // 其他原有样式保持不变
1883
1895
  .tab.post .left {
1884
1896
  width: 200px;
1885
1897
  height: 450px !important;
@@ -2018,17 +2030,46 @@ export default {
2018
2030
  display: flex;
2019
2031
  height: 700px;
2020
2032
  background: #fff;
2033
+
2034
+ :global(.ivu-tabs-ink-bar) {
2035
+ height: 0 !important;
2036
+ display: none !important;
2037
+ width: 0 !important;
2038
+ background: transparent !important;
2039
+ visibility: hidden !important;
2040
+ }
2041
+
2021
2042
  /deep/.ivu-tabs-nav{
2022
2043
  font-weight: bold;
2023
2044
  font-size: 16px;
2024
- }
2025
- /deep/.ivu-tabs-nav{
2026
2045
  width: 100%;
2027
2046
  display: flex;
2047
+ margin: 0 !important;
2048
+ padding: 0 !important;
2028
2049
  }
2029
2050
  /deep/.ivu-tabs-nav .ivu-tabs-tab{
2030
2051
  flex:1;
2031
2052
  text-align: center;
2053
+ background: #F0F2F5 !important;
2054
+ margin: 0 !important;
2055
+ padding: 12px 0 !important;
2056
+ border: none !important;
2057
+ line-height: 1 !important;
2058
+ border-right: 2px solid #E5E6EB !important; // 页签右侧竖线
2059
+ line-height: 1 !important;
2060
+ // 最后一个页签去掉右侧竖线
2061
+ &:last-child {
2062
+ border-right: none !important;
2063
+ }
2064
+ }
2065
+ /deep/.ivu-tabs-nav .ivu-tabs-tab-active {
2066
+ background: #1890FF !important;
2067
+ color: #fff !important;
2068
+ margin: 0 !important;
2069
+ border-right: 1px solid #E5E6EB !important;
2070
+ &:last-child {
2071
+ border-right: none !important;
2072
+ }
2032
2073
  }
2033
2074
  .tab-content-pro{
2034
2075
  width: 720px;
@@ -2043,8 +2084,8 @@ export default {
2043
2084
  align-items: center;
2044
2085
  }
2045
2086
  .tree {
2046
- height: 400px !important; // 从450px下调,预留下方复选框空间
2047
- max-height: 400px !important; // 强制最大高度,禁止超出
2087
+ height: 500px !important; // 从450px下调,预留下方复选框空间
2088
+ max-height: 500px !important; // 强制最大高度,禁止超出
2048
2089
  margin-top:20px;
2049
2090
  overflow-y: auto !important; // 纵向溢出时滚动,而非超出
2050
2091
  overflow-x: auto !important; // 横向溢出时滚动
@@ -2181,17 +2222,17 @@ export default {
2181
2222
  font-size:18px;
2182
2223
  }
2183
2224
  }
2184
- .staff-active {
2185
- background: transparent !important; // 彻底移除背景色
2186
- border: none !important; // 彻底移除边框高亮
2187
- border-radius: 0 !important; // 移除圆角
2188
-
2189
- > .right-panel > p:first-child {
2190
- color: inherit !important; // 可选:也移除文字颜色变化,仅保留Checkbox选中
2191
- // 如果需要保留文字变色,删除上面这行,保留下面注释的行
2192
- // color: var(--primary-color);
2193
- }
2194
- }
2225
+ //.staff-active {
2226
+ // background: transparent !important; // 彻底移除背景色
2227
+ // border: none !important; // 彻底移除边框高亮
2228
+ // border-radius: 0 !important; // 移除圆角
2229
+ //
2230
+ // > .right-panel > p:first-child {
2231
+ // color: inherit !important; // 可选:也移除文字颜色变化,仅保留Checkbox选中
2232
+ // // 如果需要保留文字变色,删除上面这行,保留下面注释的行
2233
+ // // color: var(--primary-color);
2234
+ // }
2235
+ //}
2195
2236
  }
2196
2237
  .form-content{
2197
2238
  flex:1;