yuang-framework-ui-pc 1.1.70 → 1.1.72

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