@ebiz/designer-components 0.0.19-beta.13 → 0.0.19-beta.16

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": "@ebiz/designer-components",
3
- "version": "0.0.19-beta.13",
3
+ "version": "0.0.19-beta.16",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -161,7 +161,7 @@
161
161
  <div class="org-selected-container">
162
162
  <div v-if="tempGlobalSelectedOrgs.length === 0" class="no-selected-tip">请从左侧选择组织</div>
163
163
  <div v-else class="selected-orgs-tags">
164
- <t-tag v-for="org in tempGlobalSelectedOrgs" :key="org.id" closable @close="removeGlobalOrg(org.id)"
164
+ <t-tag v-for="org in tempGlobalSelectedOrgs" :key="org.id" closable @close="removeGlobalSelectedOrg(org.id)"
165
165
  theme="primary" variant="light" class="org-tag">
166
166
  {{ org.name }}
167
167
  </t-tag>
@@ -310,7 +310,8 @@ import {
310
310
  Input as TInput,
311
311
  Tree as TTree,
312
312
  Tag as TTag,
313
- Icon as TIcon
313
+ Icon as TIcon,
314
+ Message
314
315
  } from 'tdesign-vue-next'
315
316
 
316
317
  const apis = {
@@ -372,10 +373,12 @@ function getRoleConfig() {
372
373
  if (matchedFunction) {
373
374
  // 设置功能勾选状态为true
374
375
  matchedFunction.checked = true;
375
-
376
+
376
377
  // 保存数据权限配置(如果有)
377
378
  if (item.dataScope) {
378
379
  row.dataPermission = item.dataScope;
380
+ // 标记为自定义配置
381
+ row.hasCustomConfig = true;
379
382
  // 如果是自定义数据权限,则设置已选组织
380
383
  if (item.dataScope === 6 && item.deptIds && item.deptIds.length > 0) {
381
384
  row.selectedOrgs = item.deptIds.map(id => {
@@ -387,7 +390,7 @@ function getRoleConfig() {
387
390
  });
388
391
  }
389
392
  }
390
-
393
+
391
394
  // 更新父级勾选状态(模块、子模块)
392
395
  updateParentCheckStatus(row);
393
396
  }
@@ -761,16 +764,17 @@ const handleOrgNodeExpand = (value) => {
761
764
  // 打开数据权限配置弹窗
762
765
  const openPermissionDialog = (row) => {
763
766
  currentRow.value = row
764
- // 只做展示,不写入行权限
765
- if (row.dataPermission) {
766
- selectedPermission.value = row.dataPermission
767
+ // 检查是否已有自定义配置
768
+ if (row.hasCustomConfig) {
769
+ // 已有自定义配置,使用自身配置
770
+ selectedPermission.value = row.dataPermission || 1
767
771
  if (row.dataPermission === 6 && row.selectedOrgs) {
768
772
  selectedOrgs.value = [...row.selectedOrgs]
769
773
  } else {
770
774
  selectedOrgs.value = []
771
775
  }
772
776
  } else {
773
- // 没有配置则展示全局,但不写入行
777
+ // 没有自定义配置,继承全局配置
774
778
  selectedPermission.value = globalPermission.value
775
779
  if (globalPermission.value === 6) {
776
780
  selectedOrgs.value = [...globalSelectedOrgs.value]
@@ -818,15 +822,19 @@ const handleGlobalOrgNodeSelect = (node, checked) => {
818
822
  }
819
823
  } else {
820
824
  // 从已选中中移除
821
- removeGlobalOrg(node.id)
825
+ removeGlobalSelectedOrg(node.id)
822
826
  }
823
827
  }
824
828
 
825
829
  // 移除选中的全局组织(对话框中使用)
826
830
  const removeGlobalSelectedOrg = (id) => {
827
- const index = tempGlobalSelectedOrgs.value.findIndex((org) => org.id === id)
831
+ console.log('移除临时全局组织', id);
832
+ const index = tempGlobalSelectedOrgs.value.findIndex((org) => org.id === id);
828
833
  if (index !== -1) {
829
- tempGlobalSelectedOrgs.value.splice(index, 1)
834
+ tempGlobalSelectedOrgs.value.splice(index, 1);
835
+ console.log('移除成功,剩余组织数量:', tempGlobalSelectedOrgs.value.length);
836
+ } else {
837
+ console.log('未找到对应组织');
830
838
  }
831
839
  }
832
840
 
@@ -864,7 +872,7 @@ const handleGlobalOrgConfirm = () => {
864
872
  // 保存选择结果
865
873
  globalSelectedOrgs.value = [...tempGlobalSelectedOrgs.value]
866
874
 
867
- // 应用到所有选择了自定义数据的行
875
+ // 应用到未配置自定义数据权限的行
868
876
  applyGlobalOrgsToCustomRows()
869
877
 
870
878
  globalOrgDialogVisible.value = false
@@ -875,11 +883,21 @@ const handleGlobalOrgCancel = () => {
875
883
  globalOrgDialogVisible.value = false
876
884
  }
877
885
 
878
- // 将全局组织应用到所有自定义数据权限的行
886
+ // 将全局组织应用到未配置自定义数据权限的行
879
887
  const applyGlobalOrgsToCustomRows = () => {
888
+ // 遍历每一行数据
880
889
  data.value.forEach((row) => {
881
- if (row.dataPermission === 6) {
882
- row.selectedOrgs = [...globalSelectedOrgs.value]
890
+ // 只对没有自定义配置的行应用全局设置
891
+ if (!row.hasCustomConfig) {
892
+ // 应用全局权限设置
893
+ row.dataPermission = globalPermission.value
894
+
895
+ // 如果全局设置是自定义数据权限,则应用全局选择的组织
896
+ if (globalPermission.value === 6) {
897
+ row.selectedOrgs = [...globalSelectedOrgs.value]
898
+ } else {
899
+ row.selectedOrgs = []
900
+ }
883
901
  }
884
902
  })
885
903
  }
@@ -887,6 +905,8 @@ const applyGlobalOrgsToCustomRows = () => {
887
905
  // 确认权限配置(修改处理全局配置的情况)
888
906
  const handlePermissionConfirm = () => {
889
907
  if (currentRow.value) {
908
+ // 标记该行已有自定义配置
909
+ currentRow.value.hasCustomConfig = true;
890
910
  currentRow.value.dataPermission = selectedPermission.value
891
911
  if (selectedPermission.value === 6) {
892
912
  currentRow.value.selectedOrgs = [...selectedOrgs.value]
@@ -899,6 +919,7 @@ const handlePermissionConfirm = () => {
899
919
 
900
920
  // 取消权限配置(修改处理全局配置的情况)
901
921
  const handlePermissionCancel = () => {
922
+ // 只关闭弹窗,不做其他操作
902
923
  permissionDialogVisible.value = false
903
924
  }
904
925
 
package/src/index.js CHANGED
@@ -57,6 +57,7 @@ import EbizTreeSelector from './components/EbizTreeSelector.vue';
57
57
  import EbizTimePicker from './components/EbizTimePicker.vue';
58
58
  import EbizPopconfirm from './components/EbizPopconfirm.vue';
59
59
  import EbizTreeMergeTable from './components/EbizTreeMergeTable.vue';
60
+ import EbizTdesignLoading from './components/EbizTdesignLoading.vue';
60
61
  import { MessagePlugin as EbizMessage } from 'tdesign-vue-next';
61
62
 
62
63
  // import EbizDescriptions from './components/EbizDescriptions.vue';
@@ -181,5 +182,6 @@ export {
181
182
  // 新增 EbizDescriptions 和 EbizDescriptionsItem
182
183
  EbizDescriptions,
183
184
  EbizDescriptionsItem,
184
- TDescriptionsItem
185
+ TDescriptionsItem,
186
+ EbizTdesignLoading
185
187
  };