@sy-common/organize-select-help 1.0.0-beta.67 → 1.0.0-beta.69

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 +2 -2
  2. package/src/index.vue +42 -14
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sy-common/organize-select-help",
3
- "version": "1.0.0-beta.67",
3
+ "version": "1.0.0-beta.69",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "devDependencies": {
13
13
  "@lambo-design/core": "^4.7.1-beta.140",
14
- "@sy-common/core": "^1.0.0-beta.39"
14
+ "@sy-common/core": "^1.0.0-beta.56"
15
15
  },
16
16
  "scripts": {
17
17
  "release": "pnpm release-beta && git push --follow-tags && pnpm re-publish",
package/src/index.vue CHANGED
@@ -129,7 +129,7 @@
129
129
  </div>
130
130
  </div>
131
131
  </TabPane>
132
- <TabPane label="选择人员" name="staff" v-if="name.includes('staff')">
132
+ <TabPane label="直接选择人员" name="staff" v-if="name.includes('staff')">
133
133
  <div class="tab staff-left-right-layout">
134
134
  <!-- 左侧:组织选择区域(限制高度) -->
135
135
  <div class="staff-left-panel">
@@ -183,8 +183,8 @@
183
183
  <div class="org-new-header">
184
184
  <Input v-model="orgNewSearch" @on-enter="searchOrgNew" @on-search="searchOrgNew" search placeholder="搜索组织节点名称(如:办公室)" style="width: 100%;"/>
185
185
  <div class="org-new-actions">
186
- <Button type="default" @click="expandAllOrgNew">展开全部</Button>
187
- <Button type="default" @click="collapseAllOrgNew">折叠全部</Button>
186
+ <Button type="primary" ghost @click="expandAllOrgNew">展开全部</Button>
187
+ <Button type="primary" ghost @click="collapseAllOrgNew">折叠全部</Button>
188
188
  <!-- <Button type="default" @click="clearOrgNew">清空</Button>-->
189
189
  </div>
190
190
  </div>
@@ -197,7 +197,7 @@
197
197
  </div>
198
198
  <div class="org-card-actions" v-if="province.children && province.children.length > 0">
199
199
  <Button type="text" @click.stop="selectAllProvinceOrgNew(province)">全选(包含下级)</Button>
200
- <Icon :type="province.expand ? 'md-arrow-dropdown' : 'md-arrow-dropright'" style="margin-left: 8px;"/>
200
+ <Icon size="20" :type="province.expand ? 'md-arrow-dropdown' : 'md-arrow-dropright'" style="margin-left: 8px;"/>
201
201
  </div>
202
202
  </div>
203
203
  <div class="org-card-body" v-if="province.expand && province.children && province.children.length > 0">
@@ -210,7 +210,7 @@
210
210
  <div class="city-card-actions" v-if="city.children && city.children.length > 0">
211
211
  <Button type="text" @click.stop="selectAllCityOrgNew(city)">全选(包含下级)</Button>
212
212
  <!-- <Button type="text" @click.stop="selectAllCityLevelOrgNew(city)">全选市本级</Button>-->
213
- <Icon :type="city.expand ? 'md-arrow-dropdown' : 'md-arrow-dropright'" style="margin-left: 8px;"/>
213
+ <Icon size="20" :type="city.expand ? 'md-arrow-dropdown' : 'md-arrow-dropright'" style="margin-left: 8px;"/>
214
214
  </div>
215
215
  </div>
216
216
  <div class="city-card-body" v-if="city.expand && city.children && city.children.length > 0">
@@ -223,7 +223,7 @@
223
223
  </div>
224
224
  <div class="district-actions" v-if="district.children && district.children.length > 0">
225
225
  <Button type="text" @click.stop="selectAllDistrictOrgNew(district)">全选</Button>
226
- <Icon :type="district.expand ? 'md-arrow-dropdown' : 'md-arrow-dropright'" style="margin-left: 8px;"/>
226
+ <Icon size="20" :type="district.expand ? 'md-arrow-dropdown' : 'md-arrow-dropright'" style="margin-left: 8px;"/>
227
227
  </div>
228
228
  </div>
229
229
  <div class="district-body" v-if="district.expand && district.children && district.children.length > 0">
@@ -279,7 +279,7 @@
279
279
  <!-- 直接选择人员:-->
280
280
  <div v-if="name.includes('staff')">
281
281
  <div class="group-box flex-r-bt">
282
- <div>选择人员:</div>
282
+ <div>已选择人员:</div>
283
283
  <div class="clear-btn" @click="clearStaff">清除全部</div>
284
284
  </div>
285
285
  <div class="group-list-content">
@@ -293,7 +293,7 @@
293
293
  <!-- 组织选择(新):-->
294
294
  <div v-if="name.includes('orgNew')">
295
295
  <div class="group-box flex-r-bt">
296
- <div>组织选择:</div>
296
+ <div>已选择组织:</div>
297
297
  <div class="clear-btn" @click="clearOrgNewList">清除全部</div>
298
298
  </div>
299
299
  <div class="group-list-content">
@@ -1062,7 +1062,7 @@ export default {
1062
1062
  const params = {
1063
1063
  search: this.staffSearch,
1064
1064
  offset: this.offset,
1065
- limit: 10
1065
+ limit: 20
1066
1066
  };
1067
1067
 
1068
1068
  if (this.selectedStaffOrgId && typeof this.selectedStaffOrgId === 'string' && this.selectedStaffOrgId.trim()) {
@@ -1105,7 +1105,7 @@ export default {
1105
1105
  let list = res.rows;
1106
1106
  // 移除这行:list.map((item)=>item.checked=false)
1107
1107
  this.staffAllList = this.staffAllList.concat(list)
1108
- this.offset += 10;
1108
+ this.offset += 20;
1109
1109
  this.loadingStaff = false
1110
1110
  this.lastLoadingTime = Date.now()
1111
1111
  if(res.total===this.staffAllList.length){
@@ -2033,20 +2033,44 @@ export default {
2033
2033
  // 只有有子节点时才允许展开/折叠
2034
2034
  if (province.children && province.children.length > 0) {
2035
2035
  province.expand = !province.expand;
2036
+ // 同步更新原始数据中的节点状态
2037
+ this.updateOriginalNodeExpand(province);
2036
2038
  }
2037
2039
  },
2038
2040
  toggleCityExpand(city) {
2039
2041
  // 只有有子节点时才允许展开/折叠
2040
2042
  if (city.children && city.children.length > 0) {
2041
2043
  city.expand = !city.expand;
2044
+ // 同步更新原始数据中的节点状态
2045
+ this.updateOriginalNodeExpand(city);
2042
2046
  }
2043
2047
  },
2044
2048
  toggleDistrictExpand(district) {
2045
2049
  // 只有有子节点时才允许展开/折叠
2046
2050
  if (district.children && district.children.length > 0) {
2047
2051
  district.expand = !district.expand;
2052
+ // 同步更新原始数据中的节点状态
2053
+ this.updateOriginalNodeExpand(district);
2048
2054
  }
2049
2055
  },
2056
+ updateOriginalNodeExpand(node) {
2057
+ // 查找并更新原始数据中的节点状态
2058
+ const findAndUpdate = (nodes) => {
2059
+ for (let i = 0; i < nodes.length; i++) {
2060
+ if (nodes[i].orgUnitId === node.orgUnitId) {
2061
+ nodes[i].expand = node.expand;
2062
+ return true;
2063
+ }
2064
+ if (nodes[i].children && nodes[i].children.length > 0) {
2065
+ if (findAndUpdate(nodes[i].children)) {
2066
+ return true;
2067
+ }
2068
+ }
2069
+ }
2070
+ return false;
2071
+ };
2072
+ findAndUpdate(this.orgNewTree);
2073
+ },
2050
2074
  selectAllProvinceOrgNew(province) {
2051
2075
  // 全选并添加到已选择条件框,包含下级节点
2052
2076
  this.addOrgNewItemWithChildren(province, true);
@@ -2238,9 +2262,9 @@ export default {
2238
2262
 
2239
2263
  // 如果当前节点匹配或有匹配的子节点,则保留该节点
2240
2264
  if (isMatch || filteredChildren.length > 0) {
2265
+ // 创建一个新对象,保留原始节点的所有属性,包括expand状态
2241
2266
  return {
2242
2267
  ...node,
2243
- expand: true, // 自动展开匹配的节点
2244
2268
  children: filteredChildren
2245
2269
  };
2246
2270
  }
@@ -2250,6 +2274,7 @@ export default {
2250
2274
  }).filter(Boolean); // 过滤掉null值
2251
2275
  };
2252
2276
 
2277
+ // 直接使用原始树数据,不需要深拷贝
2253
2278
  return filterTree(this.orgNewTree);
2254
2279
  }
2255
2280
  },
@@ -2710,7 +2735,6 @@ export default {
2710
2735
  align-items: center;
2711
2736
  padding: 12px 16px;
2712
2737
  background-color: #f9fafb;
2713
- cursor: pointer;
2714
2738
  border-bottom: 1px solid #EAECF0;
2715
2739
 
2716
2740
  &:hover {
@@ -2721,6 +2745,7 @@ export default {
2721
2745
  display: flex;
2722
2746
  align-items: center;
2723
2747
  font-weight: 500;
2748
+ cursor: pointer;
2724
2749
  }
2725
2750
 
2726
2751
  .org-card-actions {
@@ -2732,6 +2757,7 @@ export default {
2732
2757
  color: #1890ff;
2733
2758
  font-weight: 500;
2734
2759
  transition: all 0.2s;
2760
+ cursor: pointer;
2735
2761
 
2736
2762
  &:hover {
2737
2763
  color: #40a9ff;
@@ -2764,7 +2790,6 @@ export default {
2764
2790
  align-items: center;
2765
2791
  padding: 10px 14px;
2766
2792
  background-color: #f9fafb;
2767
- cursor: pointer;
2768
2793
  border-bottom: 1px solid #EAECF0;
2769
2794
 
2770
2795
  &:hover {
@@ -2775,6 +2800,7 @@ export default {
2775
2800
  display: flex;
2776
2801
  align-items: center;
2777
2802
  font-weight: 500;
2803
+ cursor: pointer;
2778
2804
  }
2779
2805
 
2780
2806
  .city-card-actions {
@@ -2786,6 +2812,7 @@ export default {
2786
2812
  color: #1890ff;
2787
2813
  font-weight: 500;
2788
2814
  transition: all 0.2s;
2815
+ cursor: pointer;
2789
2816
 
2790
2817
  &:hover {
2791
2818
  color: #40a9ff;
@@ -2823,7 +2850,6 @@ export default {
2823
2850
  align-items: center;
2824
2851
  padding: 8px 12px;
2825
2852
  background-color: #f9fafb;
2826
- cursor: pointer;
2827
2853
  border-bottom: 1px solid #EAECF0;
2828
2854
 
2829
2855
  &:hover {
@@ -2834,6 +2860,7 @@ export default {
2834
2860
  display: flex;
2835
2861
  align-items: center;
2836
2862
  font-weight: 500;
2863
+ cursor: pointer;
2837
2864
  }
2838
2865
 
2839
2866
  .district-actions {
@@ -2845,6 +2872,7 @@ export default {
2845
2872
  color: #1890ff;
2846
2873
  font-weight: 500;
2847
2874
  transition: all 0.2s;
2875
+ cursor: pointer;
2848
2876
 
2849
2877
  &:hover {
2850
2878
  color: #40a9ff;