yuang-framework-ui-pc 1.1.52 → 1.1.53

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 (82) hide show
  1. package/es/core-components.d.ts +3 -0
  2. package/es/core-components.js +7 -1
  3. package/es/ele-admin-layout/components/layout-tabs.d.ts +4 -4
  4. package/es/ele-dropdown/components/pro-dropdown.d.ts +2 -2
  5. package/es/ele-pro-layout/index.d.ts +4 -4
  6. package/es/ele-tab-wrap/components/tab-dropdown.d.ts +4 -4
  7. package/es/icons/ApiItem.d.ts +2 -0
  8. package/es/icons/ApiItem.js +32 -0
  9. package/es/icons/ApiTeam.d.ts +2 -0
  10. package/es/icons/ApiTeam.js +42 -0
  11. package/es/icons/OrganizationDept.d.ts +2 -0
  12. package/es/icons/OrganizationDept.js +33 -0
  13. package/es/icons/OrganizationOrg.d.ts +2 -0
  14. package/es/icons/OrganizationOrg.js +32 -0
  15. package/es/icons/OrganizationUnit.d.ts +2 -0
  16. package/es/icons/OrganizationUnit.js +32 -0
  17. package/es/icons/index.d.ts +5 -0
  18. package/es/icons/index.js +10 -0
  19. package/es/yu-framework-attachment-upload/index.d.ts +0 -1
  20. package/es/yu-framework-attachment-upload/index.js +17 -19
  21. package/es/yu-uims-organization-dialog/components/organization-dialog.d.ts +20 -0
  22. package/es/yu-uims-organization-dialog/components/organization-dialog.js +327 -0
  23. package/es/yu-uims-organization-dialog/index.d.ts +45 -0
  24. package/es/yu-uims-organization-dialog/index.js +68 -0
  25. package/es/yu-uims-role-dialog/components/role-dialog.d.ts +20 -0
  26. package/es/yu-uims-role-dialog/components/role-dialog.js +224 -0
  27. package/es/yu-uims-role-dialog/components/role-list.d.ts +54 -0
  28. package/es/yu-uims-role-dialog/components/role-list.js +188 -0
  29. package/es/yu-uims-role-dialog/components/role-query.d.ts +28 -0
  30. package/es/yu-uims-role-dialog/components/role-query.js +132 -0
  31. package/es/yu-uims-role-dialog/index.d.ts +23 -0
  32. package/es/yu-uims-role-dialog/index.js +42 -0
  33. package/es/yu-uims-user-dialog/components/user-dialog.d.ts +20 -0
  34. package/es/yu-uims-user-dialog/components/user-dialog.js +247 -0
  35. package/es/yu-uims-user-dialog/components/user-list.d.ts +84 -0
  36. package/es/yu-uims-user-dialog/components/user-list.js +232 -0
  37. package/es/yu-uims-user-dialog/components/user-query.d.ts +30 -0
  38. package/es/yu-uims-user-dialog/components/user-query.js +167 -0
  39. package/es/yu-uims-user-dialog/index.d.ts +23 -0
  40. package/es/yu-uims-user-dialog/index.js +42 -0
  41. package/lib/core-components.cjs +6 -0
  42. package/lib/core-components.d.ts +3 -0
  43. package/lib/ele-admin-layout/components/layout-tabs.d.ts +4 -4
  44. package/lib/ele-dropdown/components/pro-dropdown.d.ts +2 -2
  45. package/lib/ele-pro-layout/index.d.ts +4 -4
  46. package/lib/ele-tab-wrap/components/tab-dropdown.d.ts +4 -4
  47. package/lib/icons/ApiItem.cjs +31 -0
  48. package/lib/icons/ApiItem.d.ts +2 -0
  49. package/lib/icons/ApiTeam.cjs +41 -0
  50. package/lib/icons/ApiTeam.d.ts +2 -0
  51. package/lib/icons/OrganizationDept.cjs +32 -0
  52. package/lib/icons/OrganizationDept.d.ts +2 -0
  53. package/lib/icons/OrganizationOrg.cjs +31 -0
  54. package/lib/icons/OrganizationOrg.d.ts +2 -0
  55. package/lib/icons/OrganizationUnit.cjs +31 -0
  56. package/lib/icons/OrganizationUnit.d.ts +2 -0
  57. package/lib/icons/index.cjs +10 -0
  58. package/lib/icons/index.d.ts +5 -0
  59. package/lib/yu-framework-attachment-upload/index.cjs +16 -18
  60. package/lib/yu-framework-attachment-upload/index.d.ts +0 -1
  61. package/lib/yu-uims-organization-dialog/components/organization-dialog.cjs +326 -0
  62. package/lib/yu-uims-organization-dialog/components/organization-dialog.d.ts +20 -0
  63. package/lib/yu-uims-organization-dialog/index.cjs +67 -0
  64. package/lib/yu-uims-organization-dialog/index.d.ts +45 -0
  65. package/lib/yu-uims-role-dialog/components/role-dialog.cjs +223 -0
  66. package/lib/yu-uims-role-dialog/components/role-dialog.d.ts +20 -0
  67. package/lib/yu-uims-role-dialog/components/role-list.cjs +187 -0
  68. package/lib/yu-uims-role-dialog/components/role-list.d.ts +54 -0
  69. package/lib/yu-uims-role-dialog/components/role-query.cjs +131 -0
  70. package/lib/yu-uims-role-dialog/components/role-query.d.ts +28 -0
  71. package/lib/yu-uims-role-dialog/index.cjs +41 -0
  72. package/lib/yu-uims-role-dialog/index.d.ts +23 -0
  73. package/lib/yu-uims-user-dialog/components/user-dialog.cjs +246 -0
  74. package/lib/yu-uims-user-dialog/components/user-dialog.d.ts +20 -0
  75. package/lib/yu-uims-user-dialog/components/user-list.cjs +231 -0
  76. package/lib/yu-uims-user-dialog/components/user-list.d.ts +84 -0
  77. package/lib/yu-uims-user-dialog/components/user-query.cjs +166 -0
  78. package/lib/yu-uims-user-dialog/components/user-query.d.ts +30 -0
  79. package/lib/yu-uims-user-dialog/index.cjs +41 -0
  80. package/lib/yu-uims-user-dialog/index.d.ts +23 -0
  81. package/package.json +2 -2
  82. package/typings/global.d.ts +3 -0
@@ -0,0 +1,327 @@
1
+ import { defineComponent, mergeModels, useModel, ref, onMounted, nextTick, resolveComponent, createBlock, openBlock, withCtx, createVNode, createElementVNode, withKeys, unref, createCommentVNode, resolveDynamicComponent, toDisplayString, createElementBlock, Fragment, renderList, createTextVNode } from "vue";
2
+ import { SearchOutlined, ClusterOutlined, OrganizationOrg, OrganizationUnit, OrganizationDept } from "../../icons";
3
+ import { deepClone } from "yuang-framework-ui-common/lib/utils/objectUtils";
4
+ import { Close, Check } from "@element-plus/icons-vue";
5
+ import { handleOrganizationTreeDefaultExpandNode } from "yuang-framework-ui-common/lib/hooks/uims/uimsOrganization";
6
+ import { getShortUuid } from "yuang-framework-ui-common/lib/utils/uuidUtils";
7
+ import { http } from "yuang-framework-ui-common/lib/config/httpConfig";
8
+ import { application } from "yuang-framework-ui-common/lib/config/applicationConfig";
9
+ const _hoisted_1 = { style: { "padding": "0 16px 12px 0" } };
10
+ const _hoisted_2 = { class: "yu-dialog-tag" };
11
+ const _sfc_main = /* @__PURE__ */ defineComponent({
12
+ ...{ name: "UimsUserV2" },
13
+ __name: "organization-dialog",
14
+ props: /* @__PURE__ */ mergeModels({
15
+ param: {}
16
+ }, {
17
+ "modelValue": { type: Boolean },
18
+ "modelModifiers": {}
19
+ }),
20
+ emits: /* @__PURE__ */ mergeModels(["change"], ["update:modelValue"]),
21
+ setup(__props, { emit: __emit }) {
22
+ const props = __props;
23
+ const emit = __emit;
24
+ const isOpenDialog = useModel(__props, "modelValue");
25
+ const splitRef = ref(null);
26
+ const treeRef = ref(null);
27
+ const treeId = ref(`tree-${getShortUuid()}`);
28
+ const isLoading = ref(true);
29
+ const isShowTree = ref(true);
30
+ const selections = ref([]);
31
+ const checkedKeys = ref([]);
32
+ const orgName = ref("");
33
+ onMounted(async () => {
34
+ if (props.param.modelValue) {
35
+ nextTick(async () => {
36
+ let res = await http.get(`${application.gatewayServerBaseUrl}/uims-api/admin/uims-organization/selectInfo`, { params: { id: props.param.modelValue } });
37
+ const organization = res.data.data;
38
+ selections.value.push({
39
+ id: organization.id,
40
+ code: organization.code,
41
+ name: organization.name
42
+ });
43
+ checkedKeys.value.push(props.param.modelValue);
44
+ handleOrganizationTreeDefaultExpandNode({ id: props.param.modelValue, treeId: treeId.value });
45
+ });
46
+ }
47
+ });
48
+ const loadTreeNode = async (node, resolve) => {
49
+ var _a, _b;
50
+ let data = {};
51
+ if (!queryCondition) {
52
+ data = { parentId: ((_a = node == null ? void 0 : node.data) == null ? void 0 : _a.id) || "0" };
53
+ } else {
54
+ data = deepClone(queryCondition);
55
+ data.parentId = ((_b = node == null ? void 0 : node.data) == null ? void 0 : _b.id) || "0";
56
+ }
57
+ if (node.level == 0) {
58
+ isLoading.value = true;
59
+ }
60
+ const res = await http.post(`${application.gatewayServerBaseUrl}/uims-api/admin/uims-organization/selectPage`, data);
61
+ if (node.level == 0) {
62
+ isLoading.value = false;
63
+ }
64
+ let listData = res.data.data.records;
65
+ listData.forEach((organization) => {
66
+ organization.isLeaf = !organization.isHasChildren;
67
+ });
68
+ nextTick(() => {
69
+ if (listData.length == 1 && listData[0].isHasChildren) {
70
+ nextTick(() => {
71
+ const nodeList = document.querySelectorAll(`#${treeId.value}.el-tree [data-key='${listData[0].id}'] .el-tree-node__expand-icon`);
72
+ for (let i = 0; i < nodeList.length; i++) {
73
+ if (!nodeList[i].classList.contains("expanded")) {
74
+ nodeList[i] && nodeList[i].click();
75
+ } else {
76
+ if (queryCondition) {
77
+ queryCondition.parentId = listData[0].id || "0";
78
+ queryCondition.levelNum = listData[0].levelNum + 1;
79
+ http.post(`${application.gatewayServerBaseUrl}/uims-api/admin/uims-organization/selectPage`, queryCondition).then((res2) => {
80
+ var _a2;
81
+ (_a2 = treeRef == null ? void 0 : treeRef.value) == null ? void 0 : _a2.updateKeyChildren(queryCondition == null ? void 0 : queryCondition.parentId, res2.data.data.records);
82
+ });
83
+ }
84
+ }
85
+ }
86
+ });
87
+ }
88
+ });
89
+ return resolve(listData);
90
+ };
91
+ const handleCheck = (data, checkedData, checked) => {
92
+ if (props.param.isMultiple) {
93
+ return;
94
+ }
95
+ if (typeof checked == "undefined") {
96
+ checked = false;
97
+ let checkedKeys2 = checkedData.checkedKeys;
98
+ checkedKeys2.forEach((id) => {
99
+ if (data.id == id) {
100
+ checked = true;
101
+ } else {
102
+ treeRef.value.setChecked(id, false, false);
103
+ }
104
+ });
105
+ }
106
+ selections.value.forEach((item) => {
107
+ handleDeleteTag(item);
108
+ });
109
+ if (checked) {
110
+ selections.value.push({
111
+ id: data.id,
112
+ code: data.code,
113
+ name: data.name
114
+ });
115
+ treeRef.value.setChecked(data.id, checked, false);
116
+ }
117
+ };
118
+ const handleCheckChange = (data, checked, indeterminate) => {
119
+ if (!props.param.isMultiple) {
120
+ return;
121
+ }
122
+ selections.value = selections.value.filter((item) => {
123
+ return item.id !== data.id;
124
+ });
125
+ if (checked) {
126
+ selections.value.push({
127
+ id: data.id,
128
+ code: data.code,
129
+ name: data.name
130
+ });
131
+ treeRef.value.setChecked(data.id, checked, false);
132
+ }
133
+ };
134
+ const handleNodeClick = (row, node) => {
135
+ let checked = !node.checked;
136
+ if (!props.param.isMultiple) {
137
+ handleCheck(row, { checkedKeys: [row.id] }, checked);
138
+ if (checked) {
139
+ treeRef.value.setChecked(row.id, checked, false);
140
+ }
141
+ } else {
142
+ handleCheckChange(row, checked);
143
+ treeRef.value.setChecked(row.id, checked, false);
144
+ }
145
+ };
146
+ let queryCondition = null;
147
+ const initQueryPage = async () => {
148
+ queryCondition = orgName.value ? { queryFor: "treePart", parentId: "0", name: orgName.value } : null;
149
+ reloadTree();
150
+ };
151
+ const reloadTree = () => {
152
+ isShowTree.value = false;
153
+ nextTick(() => {
154
+ isShowTree.value = true;
155
+ });
156
+ };
157
+ const handleDeleteTag = (item) => {
158
+ selections.value = selections.value.filter((organization) => organization.code !== item.code);
159
+ treeRef.value.setChecked(item.id, false, false);
160
+ };
161
+ const handleCancel = () => {
162
+ isOpenDialog.value = false;
163
+ };
164
+ const handleSure = () => {
165
+ handleCancel();
166
+ emit("change", selections.value);
167
+ };
168
+ return (_ctx, _cache) => {
169
+ const _component_el_input = resolveComponent("el-input");
170
+ const _component_el_icon = resolveComponent("el-icon");
171
+ const _component_el_tree = resolveComponent("el-tree");
172
+ const _component_ele_loading = resolveComponent("ele-loading");
173
+ const _component_el_tag = resolveComponent("el-tag");
174
+ const _component_ele_split_panel = resolveComponent("ele-split-panel");
175
+ const _component_ele_card = resolveComponent("ele-card");
176
+ const _component_ele_page = resolveComponent("ele-page");
177
+ const _component_el_button = resolveComponent("el-button");
178
+ const _component_ele_dialog = resolveComponent("ele-dialog");
179
+ return openBlock(), createBlock(_component_ele_dialog, {
180
+ form: "",
181
+ width: "50%",
182
+ modelValue: isOpenDialog.value,
183
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isOpenDialog.value = $event),
184
+ title: "选择机构",
185
+ class: "yu-big-dialog"
186
+ }, {
187
+ footer: withCtx(() => [
188
+ createVNode(_component_el_button, {
189
+ icon: unref(Close),
190
+ onClick: handleCancel
191
+ }, {
192
+ default: withCtx(() => _cache[2] || (_cache[2] = [
193
+ createTextVNode("取消")
194
+ ])),
195
+ _: 1,
196
+ __: [2]
197
+ }, 8, ["icon"]),
198
+ createVNode(_component_el_button, {
199
+ type: "primary",
200
+ icon: unref(Check),
201
+ loading: isLoading.value,
202
+ onClick: handleSure
203
+ }, {
204
+ default: withCtx(() => _cache[3] || (_cache[3] = [
205
+ createTextVNode(" 确认 ")
206
+ ])),
207
+ _: 1,
208
+ __: [3]
209
+ }, 8, ["icon", "loading"])
210
+ ]),
211
+ default: withCtx(() => [
212
+ createVNode(_component_ele_page, {
213
+ "flex-table": "",
214
+ "multi-card": false,
215
+ "hide-footer": "",
216
+ style: { "min-height": "600px" }
217
+ }, {
218
+ default: withCtx(() => [
219
+ createVNode(_component_ele_card, {
220
+ "flex-table": "",
221
+ "body-style": { padding: "0 0 0 16px", overflow: "hidden" }
222
+ }, {
223
+ default: withCtx(() => [
224
+ createVNode(_component_ele_split_panel, {
225
+ ref_key: "splitRef",
226
+ ref: splitRef,
227
+ "flex-table": "",
228
+ size: "256px",
229
+ "allow-collapse": "",
230
+ "custom-style": { borderWidth: "0 1px 0 0", padding: "16px 0" },
231
+ "body-style": { padding: "16px 16px 0 0", overflow: "hidden" },
232
+ style: { height: "100%", overflow: "visible" }
233
+ }, {
234
+ body: withCtx(() => [
235
+ createElementVNode("div", _hoisted_2, [
236
+ (openBlock(true), createElementBlock(Fragment, null, renderList(selections.value, (item, index) => {
237
+ return openBlock(), createBlock(_component_el_tag, {
238
+ type: "success",
239
+ size: "large",
240
+ "disable-transitions": true,
241
+ closable: "",
242
+ key: index,
243
+ onClick: ($event) => handleDeleteTag(item),
244
+ onClose: ($event) => handleDeleteTag(item)
245
+ }, {
246
+ default: withCtx(() => [
247
+ createTextVNode(toDisplayString(item.name), 1)
248
+ ]),
249
+ _: 2
250
+ }, 1032, ["onClick", "onClose"]);
251
+ }), 128))
252
+ ])
253
+ ]),
254
+ default: withCtx(() => [
255
+ createElementVNode("div", _hoisted_1, [
256
+ createVNode(_component_el_input, {
257
+ modelValue: orgName.value,
258
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => orgName.value = $event),
259
+ placeholder: "输入机构名称后按回车搜索",
260
+ "prefix-icon": unref(SearchOutlined),
261
+ clearable: "",
262
+ maxlength: 20,
263
+ onKeyup: withKeys(initQueryPage, ["enter"]),
264
+ onClear: initQueryPage
265
+ }, null, 8, ["modelValue", "prefix-icon"])
266
+ ]),
267
+ createVNode(_component_ele_loading, {
268
+ loading: isLoading.value,
269
+ style: { flex: 1, paddingRight: "16px", overflow: "auto" }
270
+ }, {
271
+ default: withCtx(() => [
272
+ isShowTree.value ? (openBlock(), createBlock(_component_el_tree, {
273
+ key: 0,
274
+ ref_key: "treeRef",
275
+ ref: treeRef,
276
+ id: treeId.value,
277
+ "node-key": "id",
278
+ lazy: "",
279
+ load: loadTreeNode,
280
+ "show-checkbox": "",
281
+ "check-strictly": true,
282
+ "highlight-current": "",
283
+ props: { label: "name", children: "children", isLeaf: "isLeaf" },
284
+ "default-checked-keys": checkedKeys.value,
285
+ "expand-on-click-node": false,
286
+ style: { "--ele-tree-item-height": "34px" },
287
+ onCheck: handleCheck,
288
+ onCheckChange: handleCheckChange,
289
+ onNodeClick: handleNodeClick
290
+ }, {
291
+ default: withCtx(({ data }) => [
292
+ createElementVNode("span", null, [
293
+ createVNode(_component_el_icon, {
294
+ size: 15,
295
+ style: { "margin-right": "8px", "vertical-align": "-2px" }
296
+ }, {
297
+ default: withCtx(() => [
298
+ data.parentId == "0" ? (openBlock(), createBlock(resolveDynamicComponent(unref(ClusterOutlined)), { key: 0 })) : data.type == "org" ? (openBlock(), createBlock(resolveDynamicComponent(unref(OrganizationOrg)), { key: 1 })) : data.type == "unit" ? (openBlock(), createBlock(resolveDynamicComponent(unref(OrganizationUnit)), { key: 2 })) : data.type == "dept" ? (openBlock(), createBlock(resolveDynamicComponent(unref(OrganizationDept)), { key: 3 })) : createCommentVNode("", true)
299
+ ]),
300
+ _: 2
301
+ }, 1024),
302
+ createElementVNode("span", null, toDisplayString(data.name), 1)
303
+ ])
304
+ ]),
305
+ _: 1
306
+ }, 8, ["id", "default-checked-keys"])) : createCommentVNode("", true)
307
+ ]),
308
+ _: 1
309
+ }, 8, ["loading"])
310
+ ]),
311
+ _: 1
312
+ }, 512)
313
+ ]),
314
+ _: 1
315
+ })
316
+ ]),
317
+ _: 1
318
+ })
319
+ ]),
320
+ _: 1
321
+ }, 8, ["modelValue"]);
322
+ };
323
+ }
324
+ });
325
+ export {
326
+ _sfc_main as default
327
+ };
@@ -0,0 +1,45 @@
1
+ import { UimsOrganization } from 'yuang-framework-ui-common/lib/interface/uims/uimsOrganization';
2
+
3
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
4
+ modelValue?: string;
5
+ param?: object;
6
+ }>, {
7
+ model: string;
8
+ param: {
9
+ isMultiple: boolean;
10
+ };
11
+ }>>, {
12
+ showDialog: () => void;
13
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
14
+ change: (uimsOrganizationList: UimsOrganization[]) => void;
15
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
16
+ modelValue?: string;
17
+ param?: object;
18
+ }>, {
19
+ model: string;
20
+ param: {
21
+ isMultiple: boolean;
22
+ };
23
+ }>>> & Readonly<{
24
+ onChange?: ((uimsOrganizationList: UimsOrganization[]) => any) | undefined;
25
+ }>, {
26
+ param: object;
27
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
28
+ export default _default;
29
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
30
+ type __VLS_TypePropsToRuntimeProps<T> = {
31
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
32
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
33
+ } : {
34
+ type: import('vue').PropType<T[K]>;
35
+ required: true;
36
+ };
37
+ };
38
+ type __VLS_WithDefaults<P, D> = {
39
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
40
+ default: D[K];
41
+ }> : P[K];
42
+ };
43
+ type __VLS_Prettify<T> = {
44
+ [K in keyof T]: T[K];
45
+ } & {};
@@ -0,0 +1,68 @@
1
+ import { defineComponent, watch, onBeforeMount, ref, resolveComponent, createElementBlock, openBlock, withDirectives, createBlock, createCommentVNode, createVNode, vShow } from "vue";
2
+ import OrganizationDialog from "./components/organization-dialog";
3
+ const _sfc_main = /* @__PURE__ */ defineComponent({
4
+ ...{ name: "YuUimsOrganizationDialog" },
5
+ __name: "index",
6
+ props: {
7
+ modelValue: {},
8
+ param: { default: {
9
+ isMultiple: true
10
+ } }
11
+ },
12
+ emits: ["change"],
13
+ setup(__props, { expose: __expose, emit: __emit }) {
14
+ const props = __props;
15
+ watch(
16
+ () => props.modelValue,
17
+ () => {
18
+ init();
19
+ }
20
+ );
21
+ watch(
22
+ () => props.param,
23
+ () => {
24
+ init();
25
+ }
26
+ );
27
+ const emit = __emit;
28
+ onBeforeMount(() => {
29
+ init();
30
+ });
31
+ const init = () => {
32
+ props.param.isMultiple = props.param.isMultiple ?? true;
33
+ props.param.modelValue = props.modelValue;
34
+ };
35
+ const isShowDialog = ref(false);
36
+ const showDialog = () => {
37
+ isShowDialog.value = true;
38
+ };
39
+ const hideDialog = () => {
40
+ isShowDialog.value = false;
41
+ };
42
+ const handleChange = (selections) => {
43
+ emit("change", selections);
44
+ hideDialog();
45
+ };
46
+ __expose({
47
+ showDialog
48
+ });
49
+ return (_ctx, _cache) => {
50
+ const _component_el_input = resolveComponent("el-input");
51
+ return openBlock(), createElementBlock("div", null, [
52
+ withDirectives(createVNode(_component_el_input, { onClick: showDialog }, null, 512), [
53
+ [vShow, false]
54
+ ]),
55
+ isShowDialog.value ? (openBlock(), createBlock(OrganizationDialog, {
56
+ key: 0,
57
+ modelValue: isShowDialog.value,
58
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isShowDialog.value = $event),
59
+ param: props.param,
60
+ onChange: handleChange
61
+ }, null, 8, ["modelValue", "param"])) : createCommentVNode("", true)
62
+ ]);
63
+ };
64
+ }
65
+ });
66
+ export {
67
+ _sfc_main as default
68
+ };
@@ -0,0 +1,20 @@
1
+ import { UimsRole } from 'yuang-framework-ui-common/lib/interface/uims/uimsRole';
2
+
3
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
4
+ modelValue: import('vue').PropType<any>;
5
+ param: {
6
+ type: import('vue').PropType<any>;
7
+ required: true;
8
+ };
9
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
10
+ change: (uimsRoleList: UimsRole[]) => void;
11
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
12
+ modelValue: import('vue').PropType<any>;
13
+ param: {
14
+ type: import('vue').PropType<any>;
15
+ required: true;
16
+ };
17
+ }>> & Readonly<{
18
+ onChange?: ((uimsRoleList: UimsRole[]) => any) | undefined;
19
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
20
+ export default _default;
@@ -0,0 +1,224 @@
1
+ import { defineComponent, mergeModels, useModel, ref, resolveComponent, createBlock, openBlock, withCtx, createVNode, createElementVNode, withKeys, unref, createCommentVNode, toDisplayString, createTextVNode, nextTick } from "vue";
2
+ import { Monitor, Close, Check } from "@element-plus/icons-vue";
3
+ import RoleList from "./role-list";
4
+ import { toTree } from "../../utils/core";
5
+ import { http } from "yuang-framework-ui-common/lib/config/httpConfig";
6
+ import { application } from "yuang-framework-ui-common/lib/config/applicationConfig";
7
+ import { SearchOutlined, ApplicationOutlined } from "../../icons";
8
+ const _hoisted_1 = { style: { "padding": "0 16px 12px 0" } };
9
+ const _sfc_main = /* @__PURE__ */ defineComponent({
10
+ ...{ name: "UimsRoleV2" },
11
+ __name: "role-dialog",
12
+ props: /* @__PURE__ */ mergeModels({
13
+ param: {}
14
+ }, {
15
+ "modelValue": { type: Boolean },
16
+ "modelModifiers": {}
17
+ }),
18
+ emits: /* @__PURE__ */ mergeModels(["change"], ["update:modelValue"]),
19
+ setup(__props, { emit: __emit }) {
20
+ const props = __props;
21
+ const emit = __emit;
22
+ const isOpenDialog = useModel(__props, "modelValue");
23
+ const splitRef = ref(null);
24
+ const treeRef = ref(null);
25
+ const treeData = ref([]);
26
+ const roleListRef = ref(null);
27
+ const isLoading = ref(true);
28
+ const isShowTree = ref(true);
29
+ const selectedApplication = ref(null);
30
+ const applicationName = ref("");
31
+ const queryPage = async () => {
32
+ let data = { parentId: "0", name: applicationName.value };
33
+ isLoading.value = true;
34
+ const res = await http.post(`${application.gatewayServerBaseUrl}/uims-api/admin/uims-application/selectPage`, data);
35
+ isLoading.value = false;
36
+ const listData = [
37
+ {
38
+ id: "0",
39
+ name: "全部应用",
40
+ isHasChildren: true,
41
+ isLeaf: false,
42
+ levelNum: 0,
43
+ parentId: ""
44
+ },
45
+ ...res.data.data.records
46
+ ];
47
+ treeData.value = toTree({
48
+ data: listData,
49
+ idField: "id",
50
+ parentIdField: "parentId"
51
+ });
52
+ nextTick(() => {
53
+ handleNodeClick(listData[0] || { id: "0" });
54
+ });
55
+ };
56
+ const handleNodeClick = (row) => {
57
+ var _a, _b;
58
+ if (row && row.id) {
59
+ selectedApplication.value = row;
60
+ (_b = (_a = treeRef.value) == null ? void 0 : _a.setCurrentKey) == null ? void 0 : _b.call(_a, row.id);
61
+ } else {
62
+ selectedApplication.value = null;
63
+ }
64
+ };
65
+ const initQueryPage = async () => {
66
+ applicationName.value ? { queryFor: "treePart", parentId: "0", name: applicationName.value } : null;
67
+ reloadTree();
68
+ };
69
+ const reloadTree = () => {
70
+ isShowTree.value = false;
71
+ nextTick(() => {
72
+ isShowTree.value = true;
73
+ });
74
+ };
75
+ const handleCancel = () => {
76
+ isOpenDialog.value = false;
77
+ };
78
+ const handleSure = () => {
79
+ handleCancel();
80
+ emit("change", roleListRef.value.selections);
81
+ };
82
+ queryPage();
83
+ return (_ctx, _cache) => {
84
+ const _component_el_input = resolveComponent("el-input");
85
+ const _component_el_icon = resolveComponent("el-icon");
86
+ const _component_el_tree = resolveComponent("el-tree");
87
+ const _component_ele_loading = resolveComponent("ele-loading");
88
+ const _component_ele_split_panel = resolveComponent("ele-split-panel");
89
+ const _component_ele_card = resolveComponent("ele-card");
90
+ const _component_ele_page = resolveComponent("ele-page");
91
+ const _component_el_button = resolveComponent("el-button");
92
+ const _component_ele_dialog = resolveComponent("ele-dialog");
93
+ return openBlock(), createBlock(_component_ele_dialog, {
94
+ form: "",
95
+ width: "85%",
96
+ modelValue: isOpenDialog.value,
97
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isOpenDialog.value = $event),
98
+ title: "选择角色",
99
+ class: "yu-big-dialog"
100
+ }, {
101
+ footer: withCtx(() => [
102
+ createVNode(_component_el_button, {
103
+ icon: unref(Close),
104
+ onClick: handleCancel
105
+ }, {
106
+ default: withCtx(() => _cache[2] || (_cache[2] = [
107
+ createTextVNode("取消")
108
+ ])),
109
+ _: 1,
110
+ __: [2]
111
+ }, 8, ["icon"]),
112
+ createVNode(_component_el_button, {
113
+ type: "primary",
114
+ icon: unref(Check),
115
+ loading: isLoading.value,
116
+ onClick: handleSure
117
+ }, {
118
+ default: withCtx(() => _cache[3] || (_cache[3] = [
119
+ createTextVNode(" 确认 ")
120
+ ])),
121
+ _: 1,
122
+ __: [3]
123
+ }, 8, ["icon", "loading"])
124
+ ]),
125
+ default: withCtx(() => [
126
+ createVNode(_component_ele_page, {
127
+ "flex-table": "",
128
+ "multi-card": false,
129
+ "hide-footer": "",
130
+ style: { "min-height": "600px" }
131
+ }, {
132
+ default: withCtx(() => [
133
+ createVNode(_component_ele_card, {
134
+ "flex-table": "",
135
+ "body-style": { padding: "0 0 0 16px", overflow: "hidden" }
136
+ }, {
137
+ default: withCtx(() => [
138
+ createVNode(_component_ele_split_panel, {
139
+ ref_key: "splitRef",
140
+ ref: splitRef,
141
+ "flex-table": "",
142
+ size: "256px",
143
+ "allow-collapse": "",
144
+ "custom-style": { borderWidth: "0 1px 0 0", padding: "16px 0" },
145
+ "body-style": { padding: "16px 16px 0 0", overflow: "hidden" },
146
+ style: { height: "100%", overflow: "visible" }
147
+ }, {
148
+ body: withCtx(() => [
149
+ selectedApplication.value && selectedApplication.value.id ? (openBlock(), createBlock(RoleList, {
150
+ key: 0,
151
+ ref_key: "roleListRef",
152
+ ref: roleListRef,
153
+ application: selectedApplication.value,
154
+ param: props.param
155
+ }, null, 8, ["application", "param"])) : createCommentVNode("", true)
156
+ ]),
157
+ default: withCtx(() => [
158
+ createElementVNode("div", _hoisted_1, [
159
+ createVNode(_component_el_input, {
160
+ modelValue: applicationName.value,
161
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => applicationName.value = $event),
162
+ placeholder: "输入应用名称后按回车搜索",
163
+ "prefix-icon": unref(SearchOutlined),
164
+ clearable: "",
165
+ maxlength: 20,
166
+ onKeyup: withKeys(initQueryPage, ["enter"]),
167
+ onClear: initQueryPage
168
+ }, null, 8, ["modelValue", "prefix-icon"])
169
+ ]),
170
+ createVNode(_component_ele_loading, {
171
+ loading: isLoading.value,
172
+ style: { flex: 1, paddingRight: "16px", overflow: "auto" }
173
+ }, {
174
+ default: withCtx(() => [
175
+ isShowTree.value ? (openBlock(), createBlock(_component_el_tree, {
176
+ key: 0,
177
+ ref_key: "treeRef",
178
+ ref: treeRef,
179
+ "node-key": "id",
180
+ data: treeData.value,
181
+ "highlight-current": "",
182
+ props: { label: "name", children: "children", isLeaf: "isLeaf" },
183
+ "expand-on-click-node": false,
184
+ style: { "--ele-tree-item-height": "34px" },
185
+ "default-expand-all": true,
186
+ onNodeClick: handleNodeClick
187
+ }, {
188
+ default: withCtx(({ data }) => [
189
+ createElementVNode("span", null, [
190
+ createVNode(_component_el_icon, {
191
+ size: 15,
192
+ style: { "margin-right": "8px", "vertical-align": "-2px" }
193
+ }, {
194
+ default: withCtx(() => [
195
+ data.id == "0" ? (openBlock(), createBlock(unref(ApplicationOutlined), { key: 0 })) : (openBlock(), createBlock(unref(Monitor), { key: 1 }))
196
+ ]),
197
+ _: 2
198
+ }, 1024),
199
+ createElementVNode("span", null, toDisplayString(data.name), 1)
200
+ ])
201
+ ]),
202
+ _: 1
203
+ }, 8, ["data"])) : createCommentVNode("", true)
204
+ ]),
205
+ _: 1
206
+ }, 8, ["loading"])
207
+ ]),
208
+ _: 1
209
+ }, 512)
210
+ ]),
211
+ _: 1
212
+ })
213
+ ]),
214
+ _: 1
215
+ })
216
+ ]),
217
+ _: 1
218
+ }, 8, ["modelValue"]);
219
+ };
220
+ }
221
+ });
222
+ export {
223
+ _sfc_main as default
224
+ };