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