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.
- package/es/core-components.d.ts +4 -2
- package/es/core-components.js +9 -5
- package/es/ele-admin-layout/components/layout-tabs.d.ts +4 -4
- package/es/ele-dropdown/components/pro-dropdown.d.ts +2 -2
- package/es/ele-pro-layout/index.d.ts +4 -4
- package/es/ele-tab-wrap/components/tab-dropdown.d.ts +4 -4
- package/es/ele-upload-list/components/list-item.d.ts +1 -0
- package/es/ele-upload-list/components/list-item.js +11 -3
- package/es/ele-upload-list/index.d.ts +2 -0
- package/es/ele-upload-list/index.js +16 -3
- package/es/ele-upload-list/types.d.ts +2 -0
- package/es/icons/ApiItem.d.ts +2 -0
- package/es/icons/ApiItem.js +32 -0
- package/es/icons/ApiTeam.d.ts +2 -0
- package/es/icons/ApiTeam.js +42 -0
- package/es/icons/OrganizationDept.d.ts +2 -0
- package/es/icons/OrganizationDept.js +33 -0
- package/es/icons/OrganizationOrg.d.ts +2 -0
- package/es/icons/OrganizationOrg.js +32 -0
- package/es/icons/OrganizationUnit.d.ts +2 -0
- package/es/icons/OrganizationUnit.js +32 -0
- package/es/icons/index.d.ts +5 -0
- package/es/icons/index.js +10 -0
- package/{lib/yu-framework-attachment-image-upload → es/yu-framework-attachment-upload}/index.d.ts +0 -1
- package/es/{yu-framework-attachment-image-upload → yu-framework-attachment-upload}/index.js +43 -64
- package/es/yu-framework-slider-captcha-dialog/{SliderCaptcha.js → components/SliderCaptcha.js} +1 -1
- package/es/yu-framework-slider-captcha-dialog/index.js +1 -1
- package/es/yu-uims-organization-dialog/components/organization-dialog.d.ts +20 -0
- package/es/yu-uims-organization-dialog/components/organization-dialog.js +327 -0
- package/es/yu-uims-organization-dialog/index.d.ts +45 -0
- package/es/yu-uims-organization-dialog/index.js +68 -0
- package/es/yu-uims-role-dialog/components/role-dialog.d.ts +20 -0
- package/es/yu-uims-role-dialog/components/role-dialog.js +224 -0
- package/es/yu-uims-role-dialog/components/role-list.d.ts +54 -0
- package/es/yu-uims-role-dialog/components/role-list.js +188 -0
- package/es/yu-uims-role-dialog/components/role-query.d.ts +28 -0
- package/es/yu-uims-role-dialog/components/role-query.js +132 -0
- package/es/yu-uims-role-dialog/index.d.ts +23 -0
- package/es/yu-uims-role-dialog/index.js +42 -0
- package/es/yu-uims-user-dialog/components/user-dialog.d.ts +20 -0
- package/es/yu-uims-user-dialog/components/user-dialog.js +247 -0
- package/es/yu-uims-user-dialog/components/user-list.d.ts +84 -0
- package/es/yu-uims-user-dialog/components/user-list.js +232 -0
- package/es/yu-uims-user-dialog/components/user-query.d.ts +30 -0
- package/es/yu-uims-user-dialog/components/user-query.js +167 -0
- package/es/yu-uims-user-dialog/index.d.ts +23 -0
- package/es/yu-uims-user-dialog/index.js +42 -0
- package/lib/core-components.cjs +8 -4
- package/lib/core-components.d.ts +4 -2
- package/lib/ele-admin-layout/components/layout-tabs.d.ts +4 -4
- package/lib/ele-dropdown/components/pro-dropdown.d.ts +2 -2
- package/lib/ele-pro-layout/index.d.ts +4 -4
- package/lib/ele-tab-wrap/components/tab-dropdown.d.ts +4 -4
- package/lib/ele-upload-list/components/list-item.cjs +11 -3
- package/lib/ele-upload-list/components/list-item.d.ts +1 -0
- package/lib/ele-upload-list/index.cjs +16 -3
- package/lib/ele-upload-list/index.d.ts +2 -0
- package/lib/ele-upload-list/types.d.ts +2 -0
- package/lib/icons/ApiItem.cjs +31 -0
- package/lib/icons/ApiItem.d.ts +2 -0
- package/lib/icons/ApiTeam.cjs +41 -0
- package/lib/icons/ApiTeam.d.ts +2 -0
- package/lib/icons/OrganizationDept.cjs +32 -0
- package/lib/icons/OrganizationDept.d.ts +2 -0
- package/lib/icons/OrganizationOrg.cjs +31 -0
- package/lib/icons/OrganizationOrg.d.ts +2 -0
- package/lib/icons/OrganizationUnit.cjs +31 -0
- package/lib/icons/OrganizationUnit.d.ts +2 -0
- package/lib/icons/index.cjs +10 -0
- package/lib/icons/index.d.ts +5 -0
- package/lib/{yu-framework-attachment-image-upload → yu-framework-attachment-upload}/index.cjs +42 -63
- package/{es/yu-framework-attachment-image-upload → lib/yu-framework-attachment-upload}/index.d.ts +0 -1
- package/lib/yu-framework-slider-captcha-dialog/{SliderCaptcha.cjs → components/SliderCaptcha.cjs} +1 -1
- package/lib/yu-framework-slider-captcha-dialog/index.cjs +1 -1
- package/lib/yu-uims-organization-dialog/components/organization-dialog.cjs +326 -0
- package/lib/yu-uims-organization-dialog/components/organization-dialog.d.ts +20 -0
- package/lib/yu-uims-organization-dialog/index.cjs +67 -0
- package/lib/yu-uims-organization-dialog/index.d.ts +45 -0
- package/lib/yu-uims-role-dialog/components/role-dialog.cjs +223 -0
- package/lib/yu-uims-role-dialog/components/role-dialog.d.ts +20 -0
- package/lib/yu-uims-role-dialog/components/role-list.cjs +187 -0
- package/lib/yu-uims-role-dialog/components/role-list.d.ts +54 -0
- package/lib/yu-uims-role-dialog/components/role-query.cjs +131 -0
- package/lib/yu-uims-role-dialog/components/role-query.d.ts +28 -0
- package/lib/yu-uims-role-dialog/index.cjs +41 -0
- package/lib/yu-uims-role-dialog/index.d.ts +23 -0
- package/lib/yu-uims-user-dialog/components/user-dialog.cjs +246 -0
- package/lib/yu-uims-user-dialog/components/user-dialog.d.ts +20 -0
- package/lib/yu-uims-user-dialog/components/user-list.cjs +231 -0
- package/lib/yu-uims-user-dialog/components/user-list.d.ts +84 -0
- package/lib/yu-uims-user-dialog/components/user-query.cjs +166 -0
- package/lib/yu-uims-user-dialog/components/user-query.d.ts +30 -0
- package/lib/yu-uims-user-dialog/index.cjs +41 -0
- package/lib/yu-uims-user-dialog/index.d.ts +23 -0
- package/package.json +2 -2
- package/typings/global.d.ts +4 -2
- package/es/yu-framework-attachment-file-upload/CommonUpload/index.d.ts +0 -161
- package/es/yu-framework-attachment-file-upload/CommonUpload/index.js +0 -173
- package/es/yu-framework-attachment-file-upload/FileUpload/index.d.ts +0 -143
- package/es/yu-framework-attachment-file-upload/FileUpload/index.js +0 -219
- package/es/yu-framework-attachment-file-upload/index.d.ts +0 -16
- package/es/yu-framework-attachment-file-upload/index.js +0 -55
- package/lib/yu-framework-attachment-file-upload/CommonUpload/index.cjs +0 -172
- package/lib/yu-framework-attachment-file-upload/CommonUpload/index.d.ts +0 -161
- package/lib/yu-framework-attachment-file-upload/FileUpload/index.cjs +0 -218
- package/lib/yu-framework-attachment-file-upload/FileUpload/index.d.ts +0 -143
- package/lib/yu-framework-attachment-file-upload/index.cjs +0 -54
- package/lib/yu-framework-attachment-file-upload/index.d.ts +0 -16
- /package/es/yu-framework-slider-captcha-dialog/{SliderCaptcha.d.ts → components/SliderCaptcha.d.ts} +0 -0
- /package/lib/yu-framework-slider-captcha-dialog/{SliderCaptcha.d.ts → components/SliderCaptcha.d.ts} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent, mergeModels, ref, useModel, onMounted, resolveComponent,
|
|
1
|
+
import { defineComponent, mergeModels, ref, useModel, onMounted, resolveComponent, createBlock, openBlock } from "vue";
|
|
2
2
|
import { ElMessageBox } from "element-plus/es";
|
|
3
3
|
import { EleMessage } from "../utils/message";
|
|
4
4
|
import { http } from "yuang-framework-ui-common/lib/config/httpConfig";
|
|
5
5
|
import { getShortUuid } from "yuang-framework-ui-common/lib/utils/uuidUtils";
|
|
6
6
|
import { application } from "yuang-framework-ui-common/lib/config/applicationConfig";
|
|
7
7
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
-
...{ name: "
|
|
8
|
+
...{ name: "YuFrameworkAttachmentUpload" },
|
|
9
9
|
__name: "index",
|
|
10
10
|
props: /* @__PURE__ */ mergeModels({
|
|
11
11
|
modelValue: {},
|
|
@@ -16,19 +16,30 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
16
16
|
}),
|
|
17
17
|
emits: /* @__PURE__ */ mergeModels(["change"], ["update:modelValue"]),
|
|
18
18
|
setup(__props, { emit: __emit }) {
|
|
19
|
+
const props = __props;
|
|
19
20
|
const emit = __emit;
|
|
21
|
+
props.param.mode = props.param.mode ?? "file";
|
|
22
|
+
props.param.maxCount = props.param.maxCount ?? 5;
|
|
23
|
+
props.param.maxSize = props.param.maxSize ?? 5;
|
|
20
24
|
const images = ref([]);
|
|
25
|
+
const listType = ref(props.param.mode);
|
|
26
|
+
const accept = ref("");
|
|
27
|
+
if (props.param.mode == "file") {
|
|
28
|
+
accept.value = ".txt,.xlsx";
|
|
29
|
+
} else if (props.param.mode == "image") {
|
|
30
|
+
accept.value = ".png,.jpg,.jpeg,.gif,.svg";
|
|
31
|
+
}
|
|
21
32
|
const isLoading = ref(false);
|
|
22
33
|
const checkFile = (file) => {
|
|
23
34
|
if (!file) {
|
|
24
35
|
return;
|
|
25
36
|
}
|
|
26
|
-
if (!file.type.startsWith("image")) {
|
|
37
|
+
if (props.param.mode === "image" && !file.type.startsWith("image")) {
|
|
27
38
|
EleMessage.error("只能选择图片");
|
|
28
39
|
return;
|
|
29
40
|
}
|
|
30
|
-
if (file.size / 1024 / 1024 >
|
|
31
|
-
EleMessage.error(
|
|
41
|
+
if (file.size / 1024 / 1024 > props.param.maxSize) {
|
|
42
|
+
EleMessage.error(`图片大小不能超过${props.param.maxSize}MB`);
|
|
32
43
|
return;
|
|
33
44
|
}
|
|
34
45
|
return true;
|
|
@@ -53,14 +64,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
53
64
|
}
|
|
54
65
|
});
|
|
55
66
|
};
|
|
56
|
-
const handleUpload = (
|
|
57
|
-
if (!checkFile(
|
|
67
|
+
const handleUpload = (uploadItem, retry) => {
|
|
68
|
+
if (!checkFile(uploadItem.file)) {
|
|
58
69
|
return;
|
|
59
70
|
}
|
|
60
71
|
if (!retry) {
|
|
61
|
-
images.value.push({ ...
|
|
72
|
+
images.value.push({ ...uploadItem });
|
|
62
73
|
}
|
|
63
|
-
const item = images.value.find((t) => t.key ===
|
|
74
|
+
const item = images.value.find((t) => t.key === uploadItem.key);
|
|
64
75
|
console.log(JSON.parse(JSON.stringify(item)));
|
|
65
76
|
if (!item) {
|
|
66
77
|
return;
|
|
@@ -69,7 +80,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
69
80
|
item.progress = 0;
|
|
70
81
|
let formData = new FormData();
|
|
71
82
|
formData.append("code", model.value);
|
|
72
|
-
formData.append("multipartFile",
|
|
83
|
+
formData.append("multipartFile", uploadItem.file, uploadItem.file.name);
|
|
73
84
|
http({
|
|
74
85
|
url: `${application.gatewayServerBaseUrl}/framework-api/core/framework-attachment/uploadAttachment`,
|
|
75
86
|
method: "post",
|
|
@@ -130,69 +141,37 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
130
141
|
emit("change", attachemtList);
|
|
131
142
|
});
|
|
132
143
|
};
|
|
133
|
-
const handleRemove = (
|
|
134
|
-
let id =
|
|
144
|
+
const handleRemove = (uploadItem) => {
|
|
145
|
+
let id = uploadItem.id;
|
|
135
146
|
ElMessageBox.confirm("确定要删除吗?", "系统提示", { type: "warning", draggable: true }).then(() => {
|
|
136
147
|
http.get(`${application.gatewayServerBaseUrl}/framework-api/core/framework-attachment/deleteInfo`, { params: { id } }).then((res) => {
|
|
137
148
|
EleMessage.success(res.data.message);
|
|
138
|
-
images.value.splice(images.value.indexOf(
|
|
149
|
+
images.value.splice(images.value.indexOf(uploadItem), 1);
|
|
150
|
+
emitChange();
|
|
139
151
|
});
|
|
140
152
|
});
|
|
141
153
|
};
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
if (item.progress == null) {
|
|
145
|
-
item.progress = 20;
|
|
146
|
-
}
|
|
147
|
-
const timer = setInterval(
|
|
148
|
-
() => {
|
|
149
|
-
if (Math.round(Math.random() * 10) < 3) {
|
|
150
|
-
item.status = "exception";
|
|
151
|
-
EleMessage.error("上传失败, 服务器繁忙,请重试");
|
|
152
|
-
clearInterval(timer);
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
if (item.progress == null) {
|
|
156
|
-
item.progress = 20;
|
|
157
|
-
} else {
|
|
158
|
-
item.progress += 20;
|
|
159
|
-
}
|
|
160
|
-
if (item.progress === 100) {
|
|
161
|
-
item.status = "done";
|
|
162
|
-
clearInterval(timer);
|
|
163
|
-
if (checkDone()) {
|
|
164
|
-
submitForm();
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
},
|
|
168
|
-
Math.round(Math.random() * 2500) + 500
|
|
169
|
-
);
|
|
170
|
-
};
|
|
171
|
-
const checkDone = () => {
|
|
172
|
-
return !images.value.some((d) => d.status !== "done");
|
|
173
|
-
};
|
|
174
|
-
const submitForm = () => {
|
|
175
|
-
EleMessage.success("已全部上传完毕");
|
|
176
|
-
console.log(JSON.parse(JSON.stringify(images.value)));
|
|
177
|
-
isLoading.value = false;
|
|
154
|
+
const handleRetryUpload = (uploadItem) => {
|
|
155
|
+
handleUpload(uploadItem, true);
|
|
178
156
|
};
|
|
179
157
|
return (_ctx, _cache) => {
|
|
180
158
|
const _component_ele_upload_list = resolveComponent("ele-upload-list");
|
|
181
|
-
return openBlock(),
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
159
|
+
return openBlock(), createBlock(_component_ele_upload_list, {
|
|
160
|
+
drag: true,
|
|
161
|
+
tools: true,
|
|
162
|
+
modelValue: images.value,
|
|
163
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => images.value = $event),
|
|
164
|
+
limit: _ctx.param.maxCount,
|
|
165
|
+
listType: listType.value,
|
|
166
|
+
accept: accept.value,
|
|
167
|
+
readonly: isLoading.value,
|
|
168
|
+
disabled: _ctx.param.type != "edit",
|
|
169
|
+
sortable: { forceFallback: true },
|
|
170
|
+
onUpload: handleUpload,
|
|
171
|
+
onRetry: handleRetryUpload,
|
|
172
|
+
onRemove: handleRemove,
|
|
173
|
+
onEditUpload: handleEditUpload
|
|
174
|
+
}, null, 8, ["modelValue", "limit", "listType", "accept", "readonly", "disabled"]);
|
|
196
175
|
};
|
|
197
176
|
}
|
|
198
177
|
});
|
package/es/yu-framework-slider-captcha-dialog/{SliderCaptcha.js → components/SliderCaptcha.js}
RENAMED
|
@@ -2,7 +2,7 @@ import { defineComponent, ref, onMounted, nextTick, createElementBlock, openBloc
|
|
|
2
2
|
import { http } from "yuang-framework-ui-common/lib/config/httpConfig";
|
|
3
3
|
import { application } from "yuang-framework-ui-common/lib/config/applicationConfig";
|
|
4
4
|
import { RefreshRight, CircleClose } from "@element-plus/icons-vue";
|
|
5
|
-
import { SliderArrowStatic, SliderArrowSlide } from "
|
|
5
|
+
import { SliderArrowStatic, SliderArrowSlide } from "../../icons";
|
|
6
6
|
const _hoisted_1 = { class: "yu-framework-slider-captcha" };
|
|
7
7
|
const _hoisted_2 = { class: "yu-framework-slider-captcha-title" };
|
|
8
8
|
const _hoisted_3 = ["width", "height"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, ref, createElementBlock, createCommentVNode, openBlock, createElementVNode, createVNode } from "vue";
|
|
2
|
-
import SliderCaptcha from "./SliderCaptcha";
|
|
2
|
+
import SliderCaptcha from "./components/SliderCaptcha";
|
|
3
3
|
const _hoisted_1 = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "yu-framework-slider-captcha-dialog"
|
|
@@ -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,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;
|