yuang-framework-ui-pc 1.1.67 → 1.1.69

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.
@@ -78,7 +78,8 @@ const _sfc_main = defineComponent({
78
78
  const value = props.modelValue ? props.modelValue[index2] : void 0;
79
79
  props.beforeRemove(index2, value).then(() => {
80
80
  removeTag(index2);
81
- }).catch(() => {
81
+ }).catch((ex) => {
82
+ console.error(ex);
82
83
  });
83
84
  };
84
85
  const handleInputChange = () => {
@@ -153,8 +153,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
153
153
  setTimeout(() => {
154
154
  emit("success", { key: key.value, value: moveLength });
155
155
  }, 500);
156
- }).catch(() => {
156
+ }).catch((ex) => {
157
157
  verifyFailEvent();
158
+ console.error(ex);
158
159
  });
159
160
  }
160
161
  }
@@ -31,19 +31,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
31
31
  const checkedKeys = ref([]);
32
32
  const orgName = ref("");
33
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;
34
+ nextTick(() => {
35
+ const infoList = props.param.initList;
36
+ for (let index in infoList) {
37
+ let info = infoList[index];
38
38
  selections.value.push({
39
- id: organization.id,
40
- code: organization.code,
41
- name: organization.name
39
+ id: info.id,
40
+ code: info.code,
41
+ name: info.name
42
42
  });
43
- checkedKeys.value.push(props.param.modelValue);
44
- handleUimsOrganizationTreeDefaultExpandNode({ id: props.param.modelValue, treeId: treeId.value });
45
- });
46
- }
43
+ checkedKeys.value.push(info.id);
44
+ handleUimsOrganizationTreeDefaultExpandNode({ id: info.id, treeId: treeId.value });
45
+ }
46
+ });
47
47
  });
48
48
  const loadTreeNode = async (node, resolve) => {
49
49
  var _a, _b;
@@ -1,45 +1,33 @@
1
1
  import { UimsOrganization } from 'yuang-framework-ui-common/lib/interface/uims/uimsOrganization';
2
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;
3
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
4
+ modelValue: import('vue').PropType<string>;
8
5
  param: {
9
- isMultiple: boolean;
6
+ type: import('vue').PropType<{
7
+ isMultiple?: boolean;
8
+ isShowInput?: boolean;
9
+ }>;
10
+ default: any;
10
11
  };
11
- }>>, {
12
+ }>, {
12
13
  showDialog: () => void;
13
14
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
14
15
  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;
16
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
17
+ modelValue: import('vue').PropType<string>;
20
18
  param: {
21
- isMultiple: boolean;
19
+ type: import('vue').PropType<{
20
+ isMultiple?: boolean;
21
+ isShowInput?: boolean;
22
+ }>;
23
+ default: any;
22
24
  };
23
- }>>> & Readonly<{
25
+ }>> & Readonly<{
24
26
  onChange?: ((uimsOrganizationList: UimsOrganization[]) => any) | undefined;
25
27
  }>, {
26
- param: object;
28
+ param: {
29
+ isMultiple?: boolean;
30
+ isShowInput?: boolean;
31
+ };
27
32
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
28
33
  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
- } & {};
@@ -1,15 +1,17 @@
1
- import { defineComponent, watch, onBeforeMount, ref, resolveComponent, createElementBlock, openBlock, withDirectives, createBlock, createCommentVNode, createVNode, vShow } from "vue";
1
+ import { defineComponent, mergeModels, watch, useModel, ref, computed, resolveComponent, createElementBlock, openBlock, Fragment, createBlock, createCommentVNode, unref } from "vue";
2
+ import { EleMessage } from "../utils/message";
2
3
  import OrganizationDialog from "./components/organization-dialog";
4
+ import { Select } from "@element-plus/icons-vue";
3
5
  const _sfc_main = /* @__PURE__ */ defineComponent({
4
6
  ...{ name: "YuUimsOrganizationDialog" },
5
7
  __name: "index",
6
- props: {
7
- modelValue: {},
8
- param: { default: {
9
- isMultiple: true
10
- } }
11
- },
12
- emits: ["change"],
8
+ props: /* @__PURE__ */ mergeModels({
9
+ param: { default: {} }
10
+ }, {
11
+ "modelValue": {},
12
+ "modelModifiers": {}
13
+ }),
14
+ emits: /* @__PURE__ */ mergeModels(["change"], ["update:modelValue"]),
13
15
  setup(__props, { expose: __expose, emit: __emit }) {
14
16
  const props = __props;
15
17
  watch(
@@ -25,41 +27,103 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
25
27
  }
26
28
  );
27
29
  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
- };
30
+ const modelValue = useModel(__props, "modelValue");
31
+ const initList = ref([]);
32
+ const inputValue = ref("");
35
33
  const isShowDialog = ref(false);
34
+ const isInitSuccess = ref(false);
35
+ const componentParam = computed(() => ({
36
+ modelValue: modelValue.value,
37
+ isMultiple: true,
38
+ isShowInput: true,
39
+ ...props.param,
40
+ initList: initList.value
41
+ }));
42
+ const init = async () => {
43
+ if (modelValue.value) {
44
+ if (!componentParam.value.isMultiple) {
45
+ if (modelValue.value != "0") {
46
+ let res = await http.get(`${application.gatewayServerBaseUrl}/uims-api/admin/uims-organization/selectInfo`, { params: { id: modelValue.value } });
47
+ const info = res.data.data;
48
+ inputValue.value = info.name;
49
+ initList.value = [info];
50
+ }
51
+ } else {
52
+ let idList = modelValue.value.split("|").filter((item) => item.trim() !== "");
53
+ if (idList.length > 0) {
54
+ let res = await http.post(`${application.gatewayServerBaseUrl}/uims-api/admin/uims-organization/selectInfoList`, idList);
55
+ const infoList = res.data.data;
56
+ let names = "";
57
+ for (let index in infoList) {
58
+ names += infoList[index].name + "、";
59
+ }
60
+ inputValue.value = names.substring(0, names.length - 1);
61
+ initList.value = infoList;
62
+ }
63
+ }
64
+ }
65
+ isInitSuccess.value = true;
66
+ };
36
67
  const showDialog = () => {
37
68
  isShowDialog.value = true;
38
69
  };
39
70
  const hideDialog = () => {
71
+ if (!isInitSuccess.value) {
72
+ EleMessage.warning("请等待初始化成功");
73
+ return;
74
+ }
40
75
  isShowDialog.value = false;
41
76
  };
42
77
  const handleChange = (selections) => {
78
+ console.log("selections", selections);
79
+ modelValue.value = "";
80
+ inputValue.value = "";
81
+ if (selections.length > 0) {
82
+ if (!componentParam.value.isMultiple) {
83
+ modelValue.value = selections[0].id;
84
+ inputValue.value = selections[0].name;
85
+ } else {
86
+ let modelValueValue = "";
87
+ let inputValueValue = "";
88
+ for (let index in selections) {
89
+ modelValueValue += selections[index].id + "|";
90
+ inputValueValue += selections[index].name + "、";
91
+ }
92
+ modelValue.value = "|" + modelValueValue;
93
+ inputValue.value = inputValueValue.substring(0, inputValueValue.length - 1);
94
+ }
95
+ }
43
96
  emit("change", selections);
44
97
  hideDialog();
45
98
  };
99
+ watch(
100
+ () => componentParam.value.modelValue,
101
+ () => {
102
+ init();
103
+ },
104
+ { immediate: true }
105
+ );
46
106
  __expose({
47
107
  showDialog
48
108
  });
49
109
  return (_ctx, _cache) => {
50
110
  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, {
111
+ return openBlock(), createElementBlock(Fragment, null, [
112
+ componentParam.value.isShowInput ? (openBlock(), createBlock(_component_el_input, {
56
113
  key: 0,
114
+ modelValue: inputValue.value,
115
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
116
+ "suffix-icon": unref(Select),
117
+ onClick: showDialog
118
+ }, null, 8, ["modelValue", "suffix-icon"])) : createCommentVNode("", true),
119
+ isShowDialog.value ? (openBlock(), createBlock(OrganizationDialog, {
120
+ key: 1,
57
121
  modelValue: isShowDialog.value,
58
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isShowDialog.value = $event),
59
- param: props.param,
122
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isShowDialog.value = $event),
123
+ param: componentParam.value,
60
124
  onChange: handleChange
61
125
  }, null, 8, ["modelValue", "param"])) : createCommentVNode("", true)
62
- ]);
126
+ ], 64);
63
127
  };
64
128
  }
65
129
  });
@@ -1,23 +1,33 @@
1
1
  import { UimsRole } from 'yuang-framework-ui-common/lib/interface/uims/uimsRole';
2
2
 
3
- declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
4
- param: any;
5
- }>>, {
3
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
4
+ modelValue: import('vue').PropType<string>;
5
+ param: {
6
+ type: import('vue').PropType<{
7
+ isMultiple?: boolean;
8
+ isShowInput?: boolean;
9
+ }>;
10
+ default: any;
11
+ };
12
+ }>, {
6
13
  showDialog: () => void;
7
14
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
8
15
  change: (uimsRoleList: UimsRole[]) => void;
9
- }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
10
- param: any;
11
- }>>> & Readonly<{
16
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
17
+ modelValue: import('vue').PropType<string>;
18
+ param: {
19
+ type: import('vue').PropType<{
20
+ isMultiple?: boolean;
21
+ isShowInput?: boolean;
22
+ }>;
23
+ default: any;
24
+ };
25
+ }>> & Readonly<{
12
26
  onChange?: ((uimsRoleList: UimsRole[]) => any) | undefined;
13
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
14
- export default _default;
15
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
16
- type __VLS_TypePropsToRuntimeProps<T> = {
17
- [K in keyof T]-?: {} extends Pick<T, K> ? {
18
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
19
- } : {
20
- type: import('vue').PropType<T[K]>;
21
- required: true;
27
+ }>, {
28
+ param: {
29
+ isMultiple?: boolean;
30
+ isShowInput?: boolean;
22
31
  };
23
- };
32
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
33
+ export default _default;
@@ -1,36 +1,116 @@
1
- import { defineComponent, ref, resolveComponent, createElementBlock, openBlock, Fragment, withDirectives, createBlock, createCommentVNode, createVNode, vShow } from "vue";
1
+ import { defineComponent, mergeModels, useModel, ref, computed, watch, resolveComponent, createElementBlock, openBlock, Fragment, createBlock, createCommentVNode, unref } from "vue";
2
+ import { EleMessage } from "../utils/message";
2
3
  import RoleDialog from "./components/role-dialog";
4
+ import { Select } from "@element-plus/icons-vue";
5
+ import { http } from "yuang-framework-ui-common/lib/config/httpConfig";
6
+ import { application } from "yuang-framework-ui-common/lib/config/applicationConfig";
3
7
  const _sfc_main = /* @__PURE__ */ defineComponent({
4
8
  ...{ name: "YuUimsRoleDialog" },
5
9
  __name: "index",
6
- props: {
7
- param: {}
8
- },
9
- emits: ["change"],
10
+ props: /* @__PURE__ */ mergeModels({
11
+ param: { default: {} }
12
+ }, {
13
+ "modelValue": {},
14
+ "modelModifiers": {}
15
+ }),
16
+ emits: /* @__PURE__ */ mergeModels(["change"], ["update:modelValue"]),
10
17
  setup(__props, { expose: __expose, emit: __emit }) {
11
18
  const props = __props;
12
19
  const emit = __emit;
20
+ const modelValue = useModel(__props, "modelValue");
21
+ const initList = ref([]);
22
+ const inputValue = ref("");
13
23
  const isShowDialog = ref(false);
24
+ const isInitSuccess = ref(false);
25
+ const componentParam = computed(() => ({
26
+ modelValue: modelValue.value,
27
+ isMultiple: true,
28
+ isShowInput: true,
29
+ ...props.param,
30
+ initList: initList.value
31
+ }));
32
+ const init = async () => {
33
+ if (modelValue.value) {
34
+ if (!componentParam.value.isMultiple) {
35
+ if (modelValue.value != "0") {
36
+ let res = await http.get(`${application.gatewayServerBaseUrl}/cms-api/admin/cms-template/selectInfo`, { params: { id: modelValue.value } });
37
+ const info = res.data.data;
38
+ inputValue.value = info.name;
39
+ initList.value = [info];
40
+ }
41
+ } else {
42
+ let idList = modelValue.value.split("|").filter((item) => item.trim() !== "");
43
+ if (idList.length > 0) {
44
+ let res = await http.post(`${application.gatewayServerBaseUrl}/cms-api/admin/cms-template/selectInfoList`, idList);
45
+ const infoList = res.data.data;
46
+ let names = "";
47
+ for (let index in infoList) {
48
+ names += infoList[index].name + "、";
49
+ }
50
+ inputValue.value = names.substring(0, names.length - 1);
51
+ initList.value = infoList;
52
+ }
53
+ }
54
+ }
55
+ isInitSuccess.value = true;
56
+ };
14
57
  const showDialog = () => {
15
58
  isShowDialog.value = true;
16
59
  };
60
+ const hideDialog = () => {
61
+ if (!isInitSuccess.value) {
62
+ EleMessage.warning("请等待初始化成功");
63
+ return;
64
+ }
65
+ isShowDialog.value = false;
66
+ };
17
67
  const handleChange = (selections) => {
68
+ console.log("selections", selections);
69
+ modelValue.value = "";
70
+ inputValue.value = "";
71
+ if (selections.length > 0) {
72
+ if (!componentParam.value.isMultiple) {
73
+ modelValue.value = selections[0].id;
74
+ inputValue.value = selections[0].name;
75
+ } else {
76
+ let modelValueValue = "";
77
+ let inputValueValue = "";
78
+ for (let index in selections) {
79
+ modelValueValue += selections[index].id + "|";
80
+ inputValueValue += selections[index].name + "、";
81
+ }
82
+ modelValue.value = "|" + modelValueValue;
83
+ inputValue.value = inputValueValue.substring(0, inputValueValue.length - 1);
84
+ }
85
+ }
18
86
  emit("change", selections);
87
+ hideDialog();
19
88
  };
89
+ watch(
90
+ () => componentParam.value.modelValue,
91
+ () => {
92
+ init();
93
+ },
94
+ { immediate: true }
95
+ );
20
96
  __expose({
21
97
  showDialog
22
98
  });
23
99
  return (_ctx, _cache) => {
24
100
  const _component_el_input = resolveComponent("el-input");
25
101
  return openBlock(), createElementBlock(Fragment, null, [
26
- withDirectives(createVNode(_component_el_input, { onClick: showDialog }, null, 512), [
27
- [vShow, false]
28
- ]),
29
- isShowDialog.value ? (openBlock(), createBlock(RoleDialog, {
102
+ componentParam.value.isShowInput ? (openBlock(), createBlock(_component_el_input, {
30
103
  key: 0,
104
+ modelValue: inputValue.value,
105
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
106
+ "suffix-icon": unref(Select),
107
+ onClick: showDialog
108
+ }, null, 8, ["modelValue", "suffix-icon"])) : createCommentVNode("", true),
109
+ isShowDialog.value ? (openBlock(), createBlock(RoleDialog, {
110
+ key: 1,
31
111
  modelValue: isShowDialog.value,
32
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isShowDialog.value = $event),
33
- param: props.param,
112
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isShowDialog.value = $event),
113
+ param: componentParam.value,
34
114
  onChange: handleChange
35
115
  }, null, 8, ["modelValue", "param"])) : createCommentVNode("", true)
36
116
  ], 64);
@@ -1,23 +1,33 @@
1
1
  import { UimsUser } from 'yuang-framework-ui-common/lib/interface/uims/uimsUser';
2
2
 
3
- declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
4
- param: any;
5
- }>>, {
3
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
4
+ modelValue: import('vue').PropType<string>;
5
+ param: {
6
+ type: import('vue').PropType<{
7
+ isMultiple?: boolean;
8
+ isShowInput?: boolean;
9
+ }>;
10
+ default: any;
11
+ };
12
+ }>, {
6
13
  showDialog: () => void;
7
14
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
8
15
  change: (uimsUserList: UimsUser[]) => void;
9
- }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
10
- param: any;
11
- }>>> & Readonly<{
16
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
17
+ modelValue: import('vue').PropType<string>;
18
+ param: {
19
+ type: import('vue').PropType<{
20
+ isMultiple?: boolean;
21
+ isShowInput?: boolean;
22
+ }>;
23
+ default: any;
24
+ };
25
+ }>> & Readonly<{
12
26
  onChange?: ((uimsUserList: UimsUser[]) => any) | undefined;
13
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
14
- export default _default;
15
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
16
- type __VLS_TypePropsToRuntimeProps<T> = {
17
- [K in keyof T]-?: {} extends Pick<T, K> ? {
18
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
19
- } : {
20
- type: import('vue').PropType<T[K]>;
21
- required: true;
27
+ }>, {
28
+ param: {
29
+ isMultiple?: boolean;
30
+ isShowInput?: boolean;
22
31
  };
23
- };
32
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
33
+ export default _default;
@@ -1,36 +1,116 @@
1
- import { defineComponent, ref, resolveComponent, createElementBlock, openBlock, Fragment, withDirectives, createBlock, createCommentVNode, createVNode, vShow } from "vue";
1
+ import { defineComponent, mergeModels, useModel, ref, computed, watch, resolveComponent, createElementBlock, openBlock, Fragment, createBlock, createCommentVNode, unref } from "vue";
2
+ import { EleMessage } from "../utils/message";
3
+ import { Select } from "@element-plus/icons-vue";
2
4
  import UserDialog from "./components/user-dialog";
5
+ import { http } from "yuang-framework-ui-common/lib/config/httpConfig";
6
+ import { application } from "yuang-framework-ui-common/lib/config/applicationConfig";
3
7
  const _sfc_main = /* @__PURE__ */ defineComponent({
4
8
  ...{ name: "YuUimsUserDialog" },
5
9
  __name: "index",
6
- props: {
7
- param: {}
8
- },
9
- emits: ["change"],
10
+ props: /* @__PURE__ */ mergeModels({
11
+ param: { default: {} }
12
+ }, {
13
+ "modelValue": {},
14
+ "modelModifiers": {}
15
+ }),
16
+ emits: /* @__PURE__ */ mergeModels(["change"], ["update:modelValue"]),
10
17
  setup(__props, { expose: __expose, emit: __emit }) {
11
18
  const props = __props;
12
19
  const emit = __emit;
20
+ const modelValue = useModel(__props, "modelValue");
21
+ const initList = ref([]);
22
+ const inputValue = ref("");
13
23
  const isShowDialog = ref(false);
24
+ const isInitSuccess = ref(false);
25
+ const componentParam = computed(() => ({
26
+ modelValue: modelValue.value,
27
+ isMultiple: true,
28
+ isShowInput: true,
29
+ ...props.param,
30
+ initList: initList.value
31
+ }));
32
+ const init = async () => {
33
+ if (modelValue.value) {
34
+ if (!componentParam.value.isMultiple) {
35
+ if (modelValue.value != "0") {
36
+ let res = await http.get(`${application.gatewayServerBaseUrl}/cms-api/admin/cms-template/selectInfo`, { params: { id: modelValue.value } });
37
+ const info = res.data.data;
38
+ inputValue.value = info.name;
39
+ initList.value = [info];
40
+ }
41
+ } else {
42
+ let idList = modelValue.value.split("|").filter((item) => item.trim() !== "");
43
+ if (idList.length > 0) {
44
+ let res = await http.post(`${application.gatewayServerBaseUrl}/cms-api/admin/cms-template/selectInfoList`, idList);
45
+ const infoList = res.data.data;
46
+ let names = "";
47
+ for (let index in infoList) {
48
+ names += infoList[index].name + "、";
49
+ }
50
+ inputValue.value = names.substring(0, names.length - 1);
51
+ initList.value = infoList;
52
+ }
53
+ }
54
+ }
55
+ isInitSuccess.value = true;
56
+ };
14
57
  const showDialog = () => {
15
58
  isShowDialog.value = true;
16
59
  };
60
+ const hideDialog = () => {
61
+ if (!isInitSuccess.value) {
62
+ EleMessage.warning("请等待初始化成功");
63
+ return;
64
+ }
65
+ isShowDialog.value = false;
66
+ };
17
67
  const handleChange = (selections) => {
68
+ console.log("selections", selections);
69
+ modelValue.value = "";
70
+ inputValue.value = "";
71
+ if (selections.length > 0) {
72
+ if (!componentParam.value.isMultiple) {
73
+ modelValue.value = selections[0].id;
74
+ inputValue.value = selections[0].name;
75
+ } else {
76
+ let modelValueValue = "";
77
+ let inputValueValue = "";
78
+ for (let index in selections) {
79
+ modelValueValue += selections[index].id + "|";
80
+ inputValueValue += selections[index].name + "、";
81
+ }
82
+ modelValue.value = "|" + modelValueValue;
83
+ inputValue.value = inputValueValue.substring(0, inputValueValue.length - 1);
84
+ }
85
+ }
18
86
  emit("change", selections);
87
+ hideDialog();
19
88
  };
89
+ watch(
90
+ () => componentParam.value.modelValue,
91
+ () => {
92
+ init();
93
+ },
94
+ { immediate: true }
95
+ );
20
96
  __expose({
21
97
  showDialog
22
98
  });
23
99
  return (_ctx, _cache) => {
24
100
  const _component_el_input = resolveComponent("el-input");
25
101
  return openBlock(), createElementBlock(Fragment, null, [
26
- withDirectives(createVNode(_component_el_input, { onClick: showDialog }, null, 512), [
27
- [vShow, false]
28
- ]),
29
- isShowDialog.value ? (openBlock(), createBlock(UserDialog, {
102
+ componentParam.value.isShowInput ? (openBlock(), createBlock(_component_el_input, {
30
103
  key: 0,
104
+ modelValue: inputValue.value,
105
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
106
+ "suffix-icon": unref(Select),
107
+ onClick: showDialog
108
+ }, null, 8, ["modelValue", "suffix-icon"])) : createCommentVNode("", true),
109
+ isShowDialog.value ? (openBlock(), createBlock(UserDialog, {
110
+ key: 1,
31
111
  modelValue: isShowDialog.value,
32
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isShowDialog.value = $event),
33
- param: props.param,
112
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isShowDialog.value = $event),
113
+ param: componentParam.value,
34
114
  onChange: handleChange
35
115
  }, null, 8, ["modelValue", "param"])) : createCommentVNode("", true)
36
116
  ], 64);
@@ -79,7 +79,8 @@ const _sfc_main = vue.defineComponent({
79
79
  const value = props2.modelValue ? props2.modelValue[index2] : void 0;
80
80
  props2.beforeRemove(index2, value).then(() => {
81
81
  removeTag(index2);
82
- }).catch(() => {
82
+ }).catch((ex) => {
83
+ console.error(ex);
83
84
  });
84
85
  };
85
86
  const handleInputChange = () => {
@@ -154,8 +154,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
154
154
  setTimeout(() => {
155
155
  emit("success", { key: key.value, value: moveLength });
156
156
  }, 500);
157
- }).catch(() => {
157
+ }).catch((ex) => {
158
158
  verifyFailEvent();
159
+ console.error(ex);
159
160
  });
160
161
  }
161
162
  }
@@ -32,19 +32,19 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
32
32
  const checkedKeys = vue.ref([]);
33
33
  const orgName = vue.ref("");
34
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;
35
+ vue.nextTick(() => {
36
+ const infoList = props.param.initList;
37
+ for (let index in infoList) {
38
+ let info = infoList[index];
39
39
  selections.value.push({
40
- id: organization.id,
41
- code: organization.code,
42
- name: organization.name
40
+ id: info.id,
41
+ code: info.code,
42
+ name: info.name
43
43
  });
44
- checkedKeys.value.push(props.param.modelValue);
45
- uimsOrganization.handleUimsOrganizationTreeDefaultExpandNode({ id: props.param.modelValue, treeId: treeId.value });
46
- });
47
- }
44
+ checkedKeys.value.push(info.id);
45
+ uimsOrganization.handleUimsOrganizationTreeDefaultExpandNode({ id: info.id, treeId: treeId.value });
46
+ }
47
+ });
48
48
  });
49
49
  const loadTreeNode = async (node, resolve) => {
50
50
  var _a, _b;
@@ -1,16 +1,18 @@
1
1
  "use strict";
2
2
  const vue = require("vue");
3
+ const message = require("../utils/message");
3
4
  const OrganizationDialog = require("./components/organization-dialog");
5
+ const iconsVue = require("@element-plus/icons-vue");
4
6
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
5
7
  ...{ name: "YuUimsOrganizationDialog" },
6
8
  __name: "index",
7
- props: {
8
- modelValue: {},
9
- param: { default: {
10
- isMultiple: true
11
- } }
12
- },
13
- emits: ["change"],
9
+ props: /* @__PURE__ */ vue.mergeModels({
10
+ param: { default: {} }
11
+ }, {
12
+ "modelValue": {},
13
+ "modelModifiers": {}
14
+ }),
15
+ emits: /* @__PURE__ */ vue.mergeModels(["change"], ["update:modelValue"]),
14
16
  setup(__props, { expose: __expose, emit: __emit }) {
15
17
  const props = __props;
16
18
  vue.watch(
@@ -26,41 +28,103 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
26
28
  }
27
29
  );
28
30
  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
- };
31
+ const modelValue = vue.useModel(__props, "modelValue");
32
+ const initList = vue.ref([]);
33
+ const inputValue = vue.ref("");
36
34
  const isShowDialog = vue.ref(false);
35
+ const isInitSuccess = vue.ref(false);
36
+ const componentParam = vue.computed(() => ({
37
+ modelValue: modelValue.value,
38
+ isMultiple: true,
39
+ isShowInput: true,
40
+ ...props.param,
41
+ initList: initList.value
42
+ }));
43
+ const init = async () => {
44
+ if (modelValue.value) {
45
+ if (!componentParam.value.isMultiple) {
46
+ if (modelValue.value != "0") {
47
+ let res = await http.get(`${application.gatewayServerBaseUrl}/uims-api/admin/uims-organization/selectInfo`, { params: { id: modelValue.value } });
48
+ const info = res.data.data;
49
+ inputValue.value = info.name;
50
+ initList.value = [info];
51
+ }
52
+ } else {
53
+ let idList = modelValue.value.split("|").filter((item) => item.trim() !== "");
54
+ if (idList.length > 0) {
55
+ let res = await http.post(`${application.gatewayServerBaseUrl}/uims-api/admin/uims-organization/selectInfoList`, idList);
56
+ const infoList = res.data.data;
57
+ let names = "";
58
+ for (let index in infoList) {
59
+ names += infoList[index].name + "、";
60
+ }
61
+ inputValue.value = names.substring(0, names.length - 1);
62
+ initList.value = infoList;
63
+ }
64
+ }
65
+ }
66
+ isInitSuccess.value = true;
67
+ };
37
68
  const showDialog = () => {
38
69
  isShowDialog.value = true;
39
70
  };
40
71
  const hideDialog = () => {
72
+ if (!isInitSuccess.value) {
73
+ message.EleMessage.warning("请等待初始化成功");
74
+ return;
75
+ }
41
76
  isShowDialog.value = false;
42
77
  };
43
78
  const handleChange = (selections) => {
79
+ console.log("selections", selections);
80
+ modelValue.value = "";
81
+ inputValue.value = "";
82
+ if (selections.length > 0) {
83
+ if (!componentParam.value.isMultiple) {
84
+ modelValue.value = selections[0].id;
85
+ inputValue.value = selections[0].name;
86
+ } else {
87
+ let modelValueValue = "";
88
+ let inputValueValue = "";
89
+ for (let index in selections) {
90
+ modelValueValue += selections[index].id + "|";
91
+ inputValueValue += selections[index].name + "、";
92
+ }
93
+ modelValue.value = "|" + modelValueValue;
94
+ inputValue.value = inputValueValue.substring(0, inputValueValue.length - 1);
95
+ }
96
+ }
44
97
  emit("change", selections);
45
98
  hideDialog();
46
99
  };
100
+ vue.watch(
101
+ () => componentParam.value.modelValue,
102
+ () => {
103
+ init();
104
+ },
105
+ { immediate: true }
106
+ );
47
107
  __expose({
48
108
  showDialog
49
109
  });
50
110
  return (_ctx, _cache) => {
51
111
  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, {
112
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
113
+ componentParam.value.isShowInput ? (vue.openBlock(), vue.createBlock(_component_el_input, {
57
114
  key: 0,
115
+ modelValue: inputValue.value,
116
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
117
+ "suffix-icon": vue.unref(iconsVue.Select),
118
+ onClick: showDialog
119
+ }, null, 8, ["modelValue", "suffix-icon"])) : vue.createCommentVNode("", true),
120
+ isShowDialog.value ? (vue.openBlock(), vue.createBlock(OrganizationDialog, {
121
+ key: 1,
58
122
  modelValue: isShowDialog.value,
59
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isShowDialog.value = $event),
60
- param: props.param,
123
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isShowDialog.value = $event),
124
+ param: componentParam.value,
61
125
  onChange: handleChange
62
126
  }, null, 8, ["modelValue", "param"])) : vue.createCommentVNode("", true)
63
- ]);
127
+ ], 64);
64
128
  };
65
129
  }
66
130
  });
@@ -1,45 +1,33 @@
1
1
  import { UimsOrganization } from 'yuang-framework-ui-common/lib/interface/uims/uimsOrganization';
2
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;
3
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
4
+ modelValue: import('vue').PropType<string>;
8
5
  param: {
9
- isMultiple: boolean;
6
+ type: import('vue').PropType<{
7
+ isMultiple?: boolean;
8
+ isShowInput?: boolean;
9
+ }>;
10
+ default: any;
10
11
  };
11
- }>>, {
12
+ }>, {
12
13
  showDialog: () => void;
13
14
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
14
15
  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;
16
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
17
+ modelValue: import('vue').PropType<string>;
20
18
  param: {
21
- isMultiple: boolean;
19
+ type: import('vue').PropType<{
20
+ isMultiple?: boolean;
21
+ isShowInput?: boolean;
22
+ }>;
23
+ default: any;
22
24
  };
23
- }>>> & Readonly<{
25
+ }>> & Readonly<{
24
26
  onChange?: ((uimsOrganizationList: UimsOrganization[]) => any) | undefined;
25
27
  }>, {
26
- param: object;
28
+ param: {
29
+ isMultiple?: boolean;
30
+ isShowInput?: boolean;
31
+ };
27
32
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
28
33
  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
- } & {};
@@ -1,37 +1,117 @@
1
1
  "use strict";
2
2
  const vue = require("vue");
3
+ const message = require("../utils/message");
3
4
  const RoleDialog = require("./components/role-dialog");
5
+ const iconsVue = require("@element-plus/icons-vue");
6
+ const httpConfig = require("yuang-framework-ui-common/lib/config/httpConfig");
7
+ const applicationConfig = require("yuang-framework-ui-common/lib/config/applicationConfig");
4
8
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
5
9
  ...{ name: "YuUimsRoleDialog" },
6
10
  __name: "index",
7
- props: {
8
- param: {}
9
- },
10
- emits: ["change"],
11
+ props: /* @__PURE__ */ vue.mergeModels({
12
+ param: { default: {} }
13
+ }, {
14
+ "modelValue": {},
15
+ "modelModifiers": {}
16
+ }),
17
+ emits: /* @__PURE__ */ vue.mergeModels(["change"], ["update:modelValue"]),
11
18
  setup(__props, { expose: __expose, emit: __emit }) {
12
19
  const props = __props;
13
20
  const emit = __emit;
21
+ const modelValue = vue.useModel(__props, "modelValue");
22
+ const initList = vue.ref([]);
23
+ const inputValue = vue.ref("");
14
24
  const isShowDialog = vue.ref(false);
25
+ const isInitSuccess = vue.ref(false);
26
+ const componentParam = vue.computed(() => ({
27
+ modelValue: modelValue.value,
28
+ isMultiple: true,
29
+ isShowInput: true,
30
+ ...props.param,
31
+ initList: initList.value
32
+ }));
33
+ const init = async () => {
34
+ if (modelValue.value) {
35
+ if (!componentParam.value.isMultiple) {
36
+ if (modelValue.value != "0") {
37
+ let res = await httpConfig.http.get(`${applicationConfig.application.gatewayServerBaseUrl}/cms-api/admin/cms-template/selectInfo`, { params: { id: modelValue.value } });
38
+ const info = res.data.data;
39
+ inputValue.value = info.name;
40
+ initList.value = [info];
41
+ }
42
+ } else {
43
+ let idList = modelValue.value.split("|").filter((item) => item.trim() !== "");
44
+ if (idList.length > 0) {
45
+ let res = await httpConfig.http.post(`${applicationConfig.application.gatewayServerBaseUrl}/cms-api/admin/cms-template/selectInfoList`, idList);
46
+ const infoList = res.data.data;
47
+ let names = "";
48
+ for (let index in infoList) {
49
+ names += infoList[index].name + "、";
50
+ }
51
+ inputValue.value = names.substring(0, names.length - 1);
52
+ initList.value = infoList;
53
+ }
54
+ }
55
+ }
56
+ isInitSuccess.value = true;
57
+ };
15
58
  const showDialog = () => {
16
59
  isShowDialog.value = true;
17
60
  };
61
+ const hideDialog = () => {
62
+ if (!isInitSuccess.value) {
63
+ message.EleMessage.warning("请等待初始化成功");
64
+ return;
65
+ }
66
+ isShowDialog.value = false;
67
+ };
18
68
  const handleChange = (selections) => {
69
+ console.log("selections", selections);
70
+ modelValue.value = "";
71
+ inputValue.value = "";
72
+ if (selections.length > 0) {
73
+ if (!componentParam.value.isMultiple) {
74
+ modelValue.value = selections[0].id;
75
+ inputValue.value = selections[0].name;
76
+ } else {
77
+ let modelValueValue = "";
78
+ let inputValueValue = "";
79
+ for (let index in selections) {
80
+ modelValueValue += selections[index].id + "|";
81
+ inputValueValue += selections[index].name + "、";
82
+ }
83
+ modelValue.value = "|" + modelValueValue;
84
+ inputValue.value = inputValueValue.substring(0, inputValueValue.length - 1);
85
+ }
86
+ }
19
87
  emit("change", selections);
88
+ hideDialog();
20
89
  };
90
+ vue.watch(
91
+ () => componentParam.value.modelValue,
92
+ () => {
93
+ init();
94
+ },
95
+ { immediate: true }
96
+ );
21
97
  __expose({
22
98
  showDialog
23
99
  });
24
100
  return (_ctx, _cache) => {
25
101
  const _component_el_input = vue.resolveComponent("el-input");
26
102
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
27
- vue.withDirectives(vue.createVNode(_component_el_input, { onClick: showDialog }, null, 512), [
28
- [vue.vShow, false]
29
- ]),
30
- isShowDialog.value ? (vue.openBlock(), vue.createBlock(RoleDialog, {
103
+ componentParam.value.isShowInput ? (vue.openBlock(), vue.createBlock(_component_el_input, {
31
104
  key: 0,
105
+ modelValue: inputValue.value,
106
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
107
+ "suffix-icon": vue.unref(iconsVue.Select),
108
+ onClick: showDialog
109
+ }, null, 8, ["modelValue", "suffix-icon"])) : vue.createCommentVNode("", true),
110
+ isShowDialog.value ? (vue.openBlock(), vue.createBlock(RoleDialog, {
111
+ key: 1,
32
112
  modelValue: isShowDialog.value,
33
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isShowDialog.value = $event),
34
- param: props.param,
113
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isShowDialog.value = $event),
114
+ param: componentParam.value,
35
115
  onChange: handleChange
36
116
  }, null, 8, ["modelValue", "param"])) : vue.createCommentVNode("", true)
37
117
  ], 64);
@@ -1,23 +1,33 @@
1
1
  import { UimsRole } from 'yuang-framework-ui-common/lib/interface/uims/uimsRole';
2
2
 
3
- declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
4
- param: any;
5
- }>>, {
3
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
4
+ modelValue: import('vue').PropType<string>;
5
+ param: {
6
+ type: import('vue').PropType<{
7
+ isMultiple?: boolean;
8
+ isShowInput?: boolean;
9
+ }>;
10
+ default: any;
11
+ };
12
+ }>, {
6
13
  showDialog: () => void;
7
14
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
8
15
  change: (uimsRoleList: UimsRole[]) => void;
9
- }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
10
- param: any;
11
- }>>> & Readonly<{
16
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
17
+ modelValue: import('vue').PropType<string>;
18
+ param: {
19
+ type: import('vue').PropType<{
20
+ isMultiple?: boolean;
21
+ isShowInput?: boolean;
22
+ }>;
23
+ default: any;
24
+ };
25
+ }>> & Readonly<{
12
26
  onChange?: ((uimsRoleList: UimsRole[]) => any) | undefined;
13
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
14
- export default _default;
15
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
16
- type __VLS_TypePropsToRuntimeProps<T> = {
17
- [K in keyof T]-?: {} extends Pick<T, K> ? {
18
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
19
- } : {
20
- type: import('vue').PropType<T[K]>;
21
- required: true;
27
+ }>, {
28
+ param: {
29
+ isMultiple?: boolean;
30
+ isShowInput?: boolean;
22
31
  };
23
- };
32
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
33
+ export default _default;
@@ -1,37 +1,117 @@
1
1
  "use strict";
2
2
  const vue = require("vue");
3
+ const message = require("../utils/message");
4
+ const iconsVue = require("@element-plus/icons-vue");
3
5
  const UserDialog = require("./components/user-dialog");
6
+ const httpConfig = require("yuang-framework-ui-common/lib/config/httpConfig");
7
+ const applicationConfig = require("yuang-framework-ui-common/lib/config/applicationConfig");
4
8
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
5
9
  ...{ name: "YuUimsUserDialog" },
6
10
  __name: "index",
7
- props: {
8
- param: {}
9
- },
10
- emits: ["change"],
11
+ props: /* @__PURE__ */ vue.mergeModels({
12
+ param: { default: {} }
13
+ }, {
14
+ "modelValue": {},
15
+ "modelModifiers": {}
16
+ }),
17
+ emits: /* @__PURE__ */ vue.mergeModels(["change"], ["update:modelValue"]),
11
18
  setup(__props, { expose: __expose, emit: __emit }) {
12
19
  const props = __props;
13
20
  const emit = __emit;
21
+ const modelValue = vue.useModel(__props, "modelValue");
22
+ const initList = vue.ref([]);
23
+ const inputValue = vue.ref("");
14
24
  const isShowDialog = vue.ref(false);
25
+ const isInitSuccess = vue.ref(false);
26
+ const componentParam = vue.computed(() => ({
27
+ modelValue: modelValue.value,
28
+ isMultiple: true,
29
+ isShowInput: true,
30
+ ...props.param,
31
+ initList: initList.value
32
+ }));
33
+ const init = async () => {
34
+ if (modelValue.value) {
35
+ if (!componentParam.value.isMultiple) {
36
+ if (modelValue.value != "0") {
37
+ let res = await httpConfig.http.get(`${applicationConfig.application.gatewayServerBaseUrl}/cms-api/admin/cms-template/selectInfo`, { params: { id: modelValue.value } });
38
+ const info = res.data.data;
39
+ inputValue.value = info.name;
40
+ initList.value = [info];
41
+ }
42
+ } else {
43
+ let idList = modelValue.value.split("|").filter((item) => item.trim() !== "");
44
+ if (idList.length > 0) {
45
+ let res = await httpConfig.http.post(`${applicationConfig.application.gatewayServerBaseUrl}/cms-api/admin/cms-template/selectInfoList`, idList);
46
+ const infoList = res.data.data;
47
+ let names = "";
48
+ for (let index in infoList) {
49
+ names += infoList[index].name + "、";
50
+ }
51
+ inputValue.value = names.substring(0, names.length - 1);
52
+ initList.value = infoList;
53
+ }
54
+ }
55
+ }
56
+ isInitSuccess.value = true;
57
+ };
15
58
  const showDialog = () => {
16
59
  isShowDialog.value = true;
17
60
  };
61
+ const hideDialog = () => {
62
+ if (!isInitSuccess.value) {
63
+ message.EleMessage.warning("请等待初始化成功");
64
+ return;
65
+ }
66
+ isShowDialog.value = false;
67
+ };
18
68
  const handleChange = (selections) => {
69
+ console.log("selections", selections);
70
+ modelValue.value = "";
71
+ inputValue.value = "";
72
+ if (selections.length > 0) {
73
+ if (!componentParam.value.isMultiple) {
74
+ modelValue.value = selections[0].id;
75
+ inputValue.value = selections[0].name;
76
+ } else {
77
+ let modelValueValue = "";
78
+ let inputValueValue = "";
79
+ for (let index in selections) {
80
+ modelValueValue += selections[index].id + "|";
81
+ inputValueValue += selections[index].name + "、";
82
+ }
83
+ modelValue.value = "|" + modelValueValue;
84
+ inputValue.value = inputValueValue.substring(0, inputValueValue.length - 1);
85
+ }
86
+ }
19
87
  emit("change", selections);
88
+ hideDialog();
20
89
  };
90
+ vue.watch(
91
+ () => componentParam.value.modelValue,
92
+ () => {
93
+ init();
94
+ },
95
+ { immediate: true }
96
+ );
21
97
  __expose({
22
98
  showDialog
23
99
  });
24
100
  return (_ctx, _cache) => {
25
101
  const _component_el_input = vue.resolveComponent("el-input");
26
102
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
27
- vue.withDirectives(vue.createVNode(_component_el_input, { onClick: showDialog }, null, 512), [
28
- [vue.vShow, false]
29
- ]),
30
- isShowDialog.value ? (vue.openBlock(), vue.createBlock(UserDialog, {
103
+ componentParam.value.isShowInput ? (vue.openBlock(), vue.createBlock(_component_el_input, {
31
104
  key: 0,
105
+ modelValue: inputValue.value,
106
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
107
+ "suffix-icon": vue.unref(iconsVue.Select),
108
+ onClick: showDialog
109
+ }, null, 8, ["modelValue", "suffix-icon"])) : vue.createCommentVNode("", true),
110
+ isShowDialog.value ? (vue.openBlock(), vue.createBlock(UserDialog, {
111
+ key: 1,
32
112
  modelValue: isShowDialog.value,
33
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isShowDialog.value = $event),
34
- param: props.param,
113
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isShowDialog.value = $event),
114
+ param: componentParam.value,
35
115
  onChange: handleChange
36
116
  }, null, 8, ["modelValue", "param"])) : vue.createCommentVNode("", true)
37
117
  ], 64);
@@ -1,23 +1,33 @@
1
1
  import { UimsUser } from 'yuang-framework-ui-common/lib/interface/uims/uimsUser';
2
2
 
3
- declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
4
- param: any;
5
- }>>, {
3
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
4
+ modelValue: import('vue').PropType<string>;
5
+ param: {
6
+ type: import('vue').PropType<{
7
+ isMultiple?: boolean;
8
+ isShowInput?: boolean;
9
+ }>;
10
+ default: any;
11
+ };
12
+ }>, {
6
13
  showDialog: () => void;
7
14
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
8
15
  change: (uimsUserList: UimsUser[]) => void;
9
- }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
10
- param: any;
11
- }>>> & Readonly<{
16
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
17
+ modelValue: import('vue').PropType<string>;
18
+ param: {
19
+ type: import('vue').PropType<{
20
+ isMultiple?: boolean;
21
+ isShowInput?: boolean;
22
+ }>;
23
+ default: any;
24
+ };
25
+ }>> & Readonly<{
12
26
  onChange?: ((uimsUserList: UimsUser[]) => any) | undefined;
13
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
14
- export default _default;
15
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
16
- type __VLS_TypePropsToRuntimeProps<T> = {
17
- [K in keyof T]-?: {} extends Pick<T, K> ? {
18
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
19
- } : {
20
- type: import('vue').PropType<T[K]>;
21
- required: true;
27
+ }>, {
28
+ param: {
29
+ isMultiple?: boolean;
30
+ isShowInput?: boolean;
22
31
  };
23
- };
32
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
33
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yuang-framework-ui-pc",
3
- "version": "1.1.67",
3
+ "version": "1.1.69",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite --host --config vite.global.ts --mode dev",