yuang-framework-ui-pc 1.1.71 → 1.1.73

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.
@@ -19,6 +19,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
19
19
  const emit = __emit;
20
20
  const modelValue = useModel(__props, "modelValue");
21
21
  const initList = ref([]);
22
+ const initSelectionList = ref([]);
22
23
  const inputValue = ref("");
23
24
  const isShowDialog = ref(false);
24
25
  const isInitSuccess = ref(false);
@@ -29,9 +30,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
29
30
  // 是否禁止选择已存在的角色
30
31
  isDisableSelectExistsRole: true,
31
32
  ...props.param,
32
- initList: initList.value
33
+ initList: initList.value,
34
+ initSelectionList: initSelectionList.value
33
35
  }));
34
36
  const init = async () => {
37
+ initList.value = [];
35
38
  if (modelValue.value) {
36
39
  if (!componentParam.value.isMultiple) {
37
40
  if (modelValue.value != "0") {
@@ -56,7 +59,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
56
59
  }
57
60
  isInitSuccess.value = true;
58
61
  };
59
- const showDialog = () => {
62
+ const showDialog = async () => {
63
+ await init();
60
64
  isShowDialog.value = true;
61
65
  };
62
66
  const hideDialog = () => {
@@ -66,26 +70,26 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
66
70
  }
67
71
  isShowDialog.value = false;
68
72
  };
69
- const handleChange = (selections) => {
70
- console.log("selections", selections);
73
+ const handleChange = (selectionList) => {
74
+ console.log("selectionList", selectionList);
71
75
  modelValue.value = "";
72
76
  inputValue.value = "";
73
- if (selections.length > 0) {
77
+ if (selectionList.length > 0) {
74
78
  if (!componentParam.value.isMultiple) {
75
- modelValue.value = selections[0].id;
76
- inputValue.value = selections[0].name;
79
+ modelValue.value = selectionList[0].id;
80
+ inputValue.value = selectionList[0].name;
77
81
  } else {
78
82
  let modelValueValue = "";
79
83
  let inputValueValue = "";
80
- for (let index in selections) {
81
- modelValueValue += selections[index].id + "|";
82
- inputValueValue += selections[index].name + "、";
84
+ for (let index in selectionList) {
85
+ modelValueValue += selectionList[index].id + "|";
86
+ inputValueValue += selectionList[index].name + "、";
83
87
  }
84
88
  modelValue.value = "|" + modelValueValue;
85
89
  inputValue.value = inputValueValue.substring(0, inputValueValue.length - 1);
86
90
  }
87
91
  }
88
- emit("change", selections);
92
+ emit("change", selectionList);
89
93
  hideDialog();
90
94
  };
91
95
  watch(
@@ -6,6 +6,7 @@ const core = require("../../utils/core");
6
6
  const httpConfig = require("yuang-framework-ui-common/lib/config/httpConfig");
7
7
  const applicationConfig = require("yuang-framework-ui-common/lib/config/applicationConfig");
8
8
  const icons = require("../../icons");
9
+ const objectUtils = require("yuang-framework-ui-common/lib/utils/objectUtils");
9
10
  const _hoisted_1 = { style: { "padding": "0 16px 12px 0" } };
10
11
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
11
12
  ...{ name: "UimsRoleV2" },
@@ -29,6 +30,10 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
29
30
  const isShowTree = vue.ref(true);
30
31
  const selectedApplication = vue.ref(null);
31
32
  const applicationName = vue.ref("");
33
+ const selectionList = vue.ref([]);
34
+ vue.onMounted(() => {
35
+ selectionList.value = objectUtils.deepClone(props.param.initList ?? []);
36
+ });
32
37
  const queryPage = async () => {
33
38
  let data = { parentIdForEqual: "0", nameForLike: applicationName.value };
34
39
  isLoading.value = true;
@@ -78,9 +83,16 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
78
83
  };
79
84
  const handleSure = () => {
80
85
  handleCancel();
81
- emit("change", roleListRef.value.selections);
86
+ emit("change", selectionList.value);
82
87
  };
83
88
  queryPage();
89
+ vue.watch(
90
+ () => selectionList.value,
91
+ () => {
92
+ console.log("selectionList.value", selectionList.value);
93
+ },
94
+ { deep: true }
95
+ );
84
96
  return (_ctx, _cache) => {
85
97
  const _component_el_input = vue.resolveComponent("el-input");
86
98
  const _component_el_icon = vue.resolveComponent("el-icon");
@@ -95,7 +107,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
95
107
  form: "",
96
108
  width: "85%",
97
109
  modelValue: isOpenDialog.value,
98
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isOpenDialog.value = $event),
110
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isOpenDialog.value = $event),
99
111
  title: "选择角色",
100
112
  class: "yu-big-dialog"
101
113
  }, {
@@ -104,11 +116,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
104
116
  icon: vue.unref(iconsVue.Close),
105
117
  onClick: handleCancel
106
118
  }, {
107
- default: vue.withCtx(() => _cache[2] || (_cache[2] = [
119
+ default: vue.withCtx(() => _cache[3] || (_cache[3] = [
108
120
  vue.createTextVNode("取消")
109
121
  ])),
110
122
  _: 1,
111
- __: [2]
123
+ __: [3]
112
124
  }, 8, ["icon"]),
113
125
  vue.createVNode(_component_el_button, {
114
126
  type: "primary",
@@ -116,11 +128,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
116
128
  loading: isLoading.value,
117
129
  onClick: handleSure
118
130
  }, {
119
- default: vue.withCtx(() => _cache[3] || (_cache[3] = [
131
+ default: vue.withCtx(() => _cache[4] || (_cache[4] = [
120
132
  vue.createTextVNode(" 确认 ")
121
133
  ])),
122
134
  _: 1,
123
- __: [3]
135
+ __: [4]
124
136
  }, 8, ["icon", "loading"])
125
137
  ]),
126
138
  default: vue.withCtx(() => [
@@ -151,9 +163,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
151
163
  key: 0,
152
164
  ref_key: "roleListRef",
153
165
  ref: roleListRef,
154
- application: selectedApplication.value,
155
- param: props.param
156
- }, null, 8, ["application", "param"])) : vue.createCommentVNode("", true)
166
+ uimsApplication: selectedApplication.value,
167
+ param: props.param,
168
+ selectionList: selectionList.value,
169
+ "onUpdate:selectionList": _cache[1] || (_cache[1] = ($event) => selectionList.value = $event)
170
+ }, null, 8, ["uimsApplication", "param", "selectionList"])) : vue.createCommentVNode("", true)
157
171
  ]),
158
172
  default: vue.withCtx(() => [
159
173
  vue.createElementVNode("div", _hoisted_1, [
@@ -3,15 +3,19 @@ const vue = require("vue");
3
3
  const RoleQuery = require("./role-query");
4
4
  const httpConfig = require("yuang-framework-ui-common/lib/config/httpConfig");
5
5
  const applicationConfig = require("yuang-framework-ui-common/lib/config/applicationConfig");
6
+ const objectUtils = require("yuang-framework-ui-common/lib/utils/objectUtils");
6
7
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
7
8
  ...{ name: "UimsUserList" },
8
9
  __name: "role-list",
9
10
  props: {
10
11
  param: {},
11
- application: {}
12
+ uimsApplication: {},
13
+ selectionList: {}
12
14
  },
13
- setup(__props, { expose: __expose }) {
15
+ emits: ["update:selectionList"],
16
+ setup(__props, { emit: __emit }) {
14
17
  const props = __props;
18
+ const emit = __emit;
15
19
  const queryRef = vue.ref(null);
16
20
  const tableRef = vue.ref(null);
17
21
  const columns = vue.ref([
@@ -108,17 +112,29 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
108
112
  }
109
113
  ]);
110
114
  const selections = vue.ref([]);
115
+ const tableList = vue.ref([]);
116
+ vue.onMounted(() => {
117
+ initSelectionList();
118
+ });
119
+ const initSelectionList = () => {
120
+ selections.value = objectUtils.deepClone(props.selectionList ?? []);
121
+ console.log("props.param", props.param);
122
+ console.log("selections.value", selections.value);
123
+ };
111
124
  const datasource = async ({ queryParam, pageParam, orderParamList }) => {
112
125
  var _a, _b;
113
126
  const data = {
114
127
  ...queryParam,
115
128
  ...pageParam,
116
129
  orderParamList,
117
- uimsApplicationIdForEqual: props.application.id,
130
+ uimsApplicationIdForEqual: props.uimsApplication.id,
118
131
  // 查询角色存在的用户id
119
- selectRoleExistsUserIdForEqual: ((_a = props.param) == null ? void 0 : _a.isDisableSelectExistsUser) && ((_b = props.param) == null ? void 0 : _b.selectRoleExistsUserId)
132
+ selectRoleExistsUserIdForEqual: ((_a = props.param) == null ? void 0 : _a.isDisableSelectExistsUser) && ((_b = props.param) == null ? void 0 : _b.selectRoleExistsUserId),
133
+ // 是否排除所有人角色
134
+ isExcludeEveryOne: true
120
135
  };
121
136
  const res = await httpConfig.http.post(`${applicationConfig.application.gatewayServerBaseUrl}/uims-api/admin/uims-role/selectPage`, data);
137
+ tableList.value = res.data.data.records;
122
138
  return res.data.data;
123
139
  };
124
140
  const queryPage = () => {
@@ -127,14 +143,32 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
127
143
  (_c = (_a = tableRef.value) == null ? void 0 : _a.reload) == null ? void 0 : _c.call(_a, { currentPage: 1, queryParam: (_b = queryRef.value) == null ? void 0 : _b.queryForm });
128
144
  };
129
145
  vue.watch(
130
- () => props.application.id,
146
+ () => props.uimsApplication.id,
131
147
  () => {
132
148
  var _a, _b;
133
149
  (_b = (_a = queryRef.value) == null ? void 0 : _a.resetFields) == null ? void 0 : _b.call(_a);
134
150
  queryPage();
151
+ initSelectionList();
152
+ }
153
+ );
154
+ vue.watch(
155
+ () => selections.value,
156
+ (newSelections) => {
157
+ let tempSelections = objectUtils.deepClone(newSelections ?? []);
158
+ let updateSelectionList = objectUtils.deepClone(props.selectionList ?? []);
159
+ tempSelections.forEach((item) => {
160
+ const isRepeat = updateSelectionList.some((old) => old.id === item.id);
161
+ if (!isRepeat) {
162
+ updateSelectionList.push(item);
163
+ }
164
+ });
165
+ updateSelectionList = updateSelectionList.filter((item) => {
166
+ return tempSelections.some((newItem) => newItem.id === item.id) || !tableList.value.some((t) => t.id === item.id);
167
+ });
168
+ console.log("updateSelectionList", updateSelectionList);
169
+ emit("update:selectionList", updateSelectionList);
135
170
  }
136
171
  );
137
- __expose({ selections });
138
172
  return (_ctx, _cache) => {
139
173
  const _component_el_tag = vue.resolveComponent("el-tag");
140
174
  const _component_ele_pro_table = vue.resolveComponent("ele-pro-table");
@@ -4,44 +4,18 @@ import { UimsRole } from 'yuang-framework-ui-common/lib/interface/uims/uimsRole'
4
4
  declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
5
5
  param: any;
6
6
  /** 应用 */
7
- application: UimsApplication;
8
- }>>, {
9
- selections: import('vue').Ref<{
10
- code?: string | undefined;
11
- name?: string | undefined;
12
- status?: number | undefined;
13
- id?: string | undefined;
14
- parentId?: string | undefined;
15
- uimsApplicationId?: string | undefined;
16
- sequence?: number | undefined;
17
- remark?: string | undefined;
18
- createUserAccount?: string | undefined;
19
- createUserName?: string | undefined;
20
- createTime?: string | undefined;
21
- lastUpdateUserAccount?: string | undefined;
22
- lastUpdateUserName?: string | undefined;
23
- lastUpdateTime?: Date | undefined;
24
- }[], UimsRole[] | {
25
- code?: string | undefined;
26
- name?: string | undefined;
27
- status?: number | undefined;
28
- id?: string | undefined;
29
- parentId?: string | undefined;
30
- uimsApplicationId?: string | undefined;
31
- sequence?: number | undefined;
32
- remark?: string | undefined;
33
- createUserAccount?: string | undefined;
34
- createUserName?: string | undefined;
35
- createTime?: string | undefined;
36
- lastUpdateUserAccount?: string | undefined;
37
- lastUpdateUserName?: string | undefined;
38
- lastUpdateTime?: Date | undefined;
39
- }[]>;
40
- }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
7
+ uimsApplication: UimsApplication;
8
+ selectionList: UimsRole[];
9
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
10
+ "update:selectionList": (changeList: UimsRole[]) => void;
11
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
41
12
  param: any;
42
13
  /** 应用 */
43
- application: UimsApplication;
44
- }>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
14
+ uimsApplication: UimsApplication;
15
+ selectionList: UimsRole[];
16
+ }>>> & Readonly<{
17
+ "onUpdate:selectionList"?: ((changeList: UimsRole[]) => any) | undefined;
18
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
45
19
  export default _default;
46
20
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
47
21
  type __VLS_TypePropsToRuntimeProps<T> = {
@@ -33,6 +33,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
33
33
  initList: initList.value
34
34
  }));
35
35
  const init = async () => {
36
+ initList.value = [];
36
37
  if (modelValue.value) {
37
38
  if (!componentParam.value.isMultiple) {
38
39
  if (modelValue.value != "0") {
@@ -57,7 +58,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
57
58
  }
58
59
  isInitSuccess.value = true;
59
60
  };
60
- const showDialog = () => {
61
+ const showDialog = async () => {
62
+ await init();
61
63
  isShowDialog.value = true;
62
64
  };
63
65
  const hideDialog = () => {
@@ -67,26 +69,26 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
67
69
  }
68
70
  isShowDialog.value = false;
69
71
  };
70
- const handleChange = (selections) => {
71
- console.log("selections", selections);
72
+ const handleChange = (selectionList) => {
73
+ console.log("selectionList", selectionList);
72
74
  modelValue.value = "";
73
75
  inputValue.value = "";
74
- if (selections.length > 0) {
76
+ if (selectionList.length > 0) {
75
77
  if (!componentParam.value.isMultiple) {
76
- modelValue.value = selections[0].id;
77
- inputValue.value = selections[0].name;
78
+ modelValue.value = selectionList[0].id;
79
+ inputValue.value = selectionList[0].name;
78
80
  } else {
79
81
  let modelValueValue = "";
80
82
  let inputValueValue = "";
81
- for (let index in selections) {
82
- modelValueValue += selections[index].id + "|";
83
- inputValueValue += selections[index].name + "、";
83
+ for (let index in selectionList) {
84
+ modelValueValue += selectionList[index].id + "|";
85
+ inputValueValue += selectionList[index].name + "、";
84
86
  }
85
87
  modelValue.value = "|" + modelValueValue;
86
88
  inputValue.value = inputValueValue.substring(0, inputValueValue.length - 1);
87
89
  }
88
90
  }
89
- emit("change", selections);
91
+ emit("change", selectionList);
90
92
  hideDialog();
91
93
  };
92
94
  vue.watch(
@@ -10,7 +10,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
10
10
  default: any;
11
11
  };
12
12
  }>, {
13
- showDialog: () => void;
13
+ showDialog: () => Promise<void>;
14
14
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
15
15
  change: (uimsRoleList: UimsRole[]) => void;
16
16
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
@@ -28,8 +28,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
28
28
  const userListRef = vue.ref(null);
29
29
  const isLoading = vue.ref(true);
30
30
  const isShowTree = vue.ref(true);
31
- const organization = vue.ref(null);
31
+ const uimsOrganization = vue.ref(null);
32
32
  const orgName = vue.ref("");
33
+ const selectionList = vue.ref([]);
34
+ vue.onMounted(() => {
35
+ selectionList.value = objectUtils.deepClone(props.param.initList ?? []);
36
+ });
33
37
  const loadTreeNode = async (node, resolve) => {
34
38
  var _a, _b;
35
39
  let data = {};
@@ -47,8 +51,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
47
51
  isLoading.value = false;
48
52
  }
49
53
  let listData = res.data.data.records;
50
- listData.forEach((organization2) => {
51
- organization2.isLeaf = !organization2.isHasChildren;
54
+ listData.forEach((organization) => {
55
+ organization.isLeaf = !organization.isHasChildren;
52
56
  });
53
57
  vue.nextTick(() => {
54
58
  if (node.level == 0) {
@@ -79,10 +83,10 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
79
83
  const handleNodeClick = (row) => {
80
84
  var _a, _b;
81
85
  if (row && row.id) {
82
- organization.value = row;
86
+ uimsOrganization.value = row;
83
87
  (_b = (_a = treeRef.value) == null ? void 0 : _a.setCurrentKey) == null ? void 0 : _b.call(_a, row.id);
84
88
  } else {
85
- organization.value = null;
89
+ uimsOrganization.value = null;
86
90
  }
87
91
  };
88
92
  let queryCondition = null;
@@ -101,8 +105,15 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
101
105
  };
102
106
  const handleSure = () => {
103
107
  handleCancel();
104
- emit("change", userListRef.value.selections);
108
+ emit("change", selectionList.value);
105
109
  };
110
+ vue.watch(
111
+ () => selectionList.value,
112
+ () => {
113
+ console.log("selectionList.value", selectionList.value);
114
+ },
115
+ { deep: true }
116
+ );
106
117
  return (_ctx, _cache) => {
107
118
  const _component_el_input = vue.resolveComponent("el-input");
108
119
  const _component_el_icon = vue.resolveComponent("el-icon");
@@ -117,7 +128,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
117
128
  form: "",
118
129
  width: "85%",
119
130
  modelValue: isOpenDialog.value,
120
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isOpenDialog.value = $event),
131
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isOpenDialog.value = $event),
121
132
  title: "选择用户",
122
133
  class: "yu-big-dialog"
123
134
  }, {
@@ -126,11 +137,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
126
137
  icon: vue.unref(iconsVue.Close),
127
138
  onClick: handleCancel
128
139
  }, {
129
- default: vue.withCtx(() => _cache[2] || (_cache[2] = [
140
+ default: vue.withCtx(() => _cache[3] || (_cache[3] = [
130
141
  vue.createTextVNode("取消")
131
142
  ])),
132
143
  _: 1,
133
- __: [2]
144
+ __: [3]
134
145
  }, 8, ["icon"]),
135
146
  vue.createVNode(_component_el_button, {
136
147
  type: "primary",
@@ -138,11 +149,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
138
149
  loading: isLoading.value,
139
150
  onClick: handleSure
140
151
  }, {
141
- default: vue.withCtx(() => _cache[3] || (_cache[3] = [
152
+ default: vue.withCtx(() => _cache[4] || (_cache[4] = [
142
153
  vue.createTextVNode(" 确认 ")
143
154
  ])),
144
155
  _: 1,
145
- __: [3]
156
+ __: [4]
146
157
  }, 8, ["icon", "loading"])
147
158
  ]),
148
159
  default: vue.withCtx(() => [
@@ -169,13 +180,15 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
169
180
  style: { height: "100%", overflow: "visible" }
170
181
  }, {
171
182
  body: vue.withCtx(() => [
172
- organization.value && organization.value.id ? (vue.openBlock(), vue.createBlock(UserList, {
183
+ uimsOrganization.value && uimsOrganization.value.id ? (vue.openBlock(), vue.createBlock(UserList, {
173
184
  key: 0,
174
185
  ref_key: "userListRef",
175
186
  ref: userListRef,
176
187
  param: props.param,
177
- organization: organization.value
178
- }, null, 8, ["param", "organization"])) : vue.createCommentVNode("", true)
188
+ uimsOrganization: uimsOrganization.value,
189
+ selectionList: selectionList.value,
190
+ "onUpdate:selectionList": _cache[1] || (_cache[1] = ($event) => selectionList.value = $event)
191
+ }, null, 8, ["param", "uimsOrganization", "selectionList"])) : vue.createCommentVNode("", true)
179
192
  ]),
180
193
  default: vue.withCtx(() => [
181
194
  vue.createElementVNode("div", _hoisted_1, [
@@ -5,15 +5,19 @@ const UserQuery = require("./user-query");
5
5
  const icons = require("../../icons");
6
6
  const httpConfig = require("yuang-framework-ui-common/lib/config/httpConfig");
7
7
  const applicationConfig = require("yuang-framework-ui-common/lib/config/applicationConfig");
8
+ const objectUtils = require("yuang-framework-ui-common/lib/utils/objectUtils");
8
9
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
9
10
  ...{ name: "UimsUserList" },
10
11
  __name: "user-list",
11
12
  props: {
12
13
  param: {},
13
- organization: {}
14
+ uimsOrganization: {},
15
+ selectionList: {}
14
16
  },
15
- setup(__props, { expose: __expose }) {
17
+ emits: ["update:selectionList"],
18
+ setup(__props, { emit: __emit }) {
16
19
  const props = __props;
20
+ const emit = __emit;
17
21
  const queryRef = vue.ref(null);
18
22
  const tableRef = vue.ref(null);
19
23
  const columns = vue.ref([
@@ -24,7 +28,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
24
28
  align: "center",
25
29
  fixed: "left",
26
30
  selectable: (row) => {
27
- return !row.isUserExistsRole;
31
+ return !row.isRoleExistsUser;
28
32
  }
29
33
  },
30
34
  {
@@ -132,17 +136,27 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
132
136
  }
133
137
  ]);
134
138
  const selections = vue.ref([]);
139
+ const tableList = vue.ref([]);
140
+ vue.onMounted(() => {
141
+ initSelectionList();
142
+ });
143
+ const initSelectionList = () => {
144
+ selections.value = objectUtils.deepClone(props.selectionList ?? []);
145
+ console.log("props.param", props.param);
146
+ console.log("selections.value", selections.value);
147
+ };
135
148
  const datasource = async ({ queryParam, pageParam, orderParamList }) => {
136
149
  var _a, _b;
137
150
  const data = {
138
151
  ...queryParam,
139
152
  ...pageParam,
140
153
  orderParamList,
141
- organizationIdForEqual: props.organization.id,
154
+ organizationIdForEqual: props.uimsOrganization.id,
142
155
  // 查询用户存在的角色id
143
156
  selectUserExistsRoleIdForEqual: ((_a = props.param) == null ? void 0 : _a.isDisableSelectExistsRole) && ((_b = props.param) == null ? void 0 : _b.selectUserExistsRoleId)
144
157
  };
145
158
  const res = await httpConfig.http.post(`${applicationConfig.application.gatewayServerBaseUrl}/uims-api/admin/uims-user/selectPage`, data);
159
+ tableList.value = res.data.data.records;
146
160
  return res.data.data;
147
161
  };
148
162
  const queryPage = () => {
@@ -151,14 +165,32 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
151
165
  (_c = (_a = tableRef.value) == null ? void 0 : _a.reload) == null ? void 0 : _c.call(_a, { currentPage: 1, queryParam: (_b = queryRef.value) == null ? void 0 : _b.queryForm });
152
166
  };
153
167
  vue.watch(
154
- () => props.organization.id,
168
+ () => props.uimsOrganization.id,
155
169
  () => {
156
170
  var _a, _b;
157
171
  (_b = (_a = queryRef.value) == null ? void 0 : _a.resetFields) == null ? void 0 : _b.call(_a);
158
172
  queryPage();
173
+ initSelectionList();
174
+ }
175
+ );
176
+ vue.watch(
177
+ () => selections.value,
178
+ (newSelections) => {
179
+ let tempSelections = objectUtils.deepClone(newSelections ?? []);
180
+ let updateSelectionList = objectUtils.deepClone(props.selectionList ?? []);
181
+ tempSelections.forEach((item) => {
182
+ const isRepeat = updateSelectionList.some((old) => old.id === item.id);
183
+ if (!isRepeat) {
184
+ updateSelectionList.push(item);
185
+ }
186
+ });
187
+ updateSelectionList = updateSelectionList.filter((item) => {
188
+ return tempSelections.some((newItem) => newItem.id === item.id) || !tableList.value.some((t) => t.id === item.id);
189
+ });
190
+ console.log("updateSelectionList", updateSelectionList);
191
+ emit("update:selectionList", updateSelectionList);
159
192
  }
160
193
  );
161
- __expose({ selections });
162
194
  return (_ctx, _cache) => {
163
195
  const _component_el_icon = vue.resolveComponent("el-icon");
164
196
  const _component_el_tag = vue.resolveComponent("el-tag");