@gct-paas/core-web 0.1.6-dev.6 → 0.1.6-dev.8
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/dist/ColorPicker-DFKXqgaG.js +1 -0
- package/dist/_plugin-vue_export-helper-CGzGcWFX.js +1 -0
- package/dist/index.min.css +1 -1
- package/dist/loader.esm.min.js +1 -1
- package/dist/{monaco-editor-BTqXEIZI.js → monaco-editor-CQJ9TMzD.js} +1 -1
- package/dist/{template-1ZQd8Z1w.js → template-CXn8oAg5.js} +1 -1
- package/es/components/index.d.ts +1 -0
- package/es/components/index.mjs +2 -0
- package/es/components/paas-bpmn-log/components/approval-node.vue.mjs +2 -2
- package/es/components/paas-bpmn-log/components/approval-node.vue_vue_type_script_setup_true_lang.mjs +1 -2
- package/es/components/paas-bpmn-log/components/{approval-node.vue_vue_type_style_index_0_scoped_a88d7ef9_lang.css → approval-node.vue_vue_type_style_index_0_scoped_a8065b24_lang.css} +9 -9
- package/es/components/paas-bpmn-log/paas-bpmn-log.vue.mjs +2 -2
- package/es/components/paas-bpmn-log/paas-bpmn-log.vue_vue_type_script_setup_true_lang.mjs +1 -2
- package/es/components/paas-bpmn-log/{paas-bpmn-log.vue_vue_type_style_index_0_scoped_c85122b0_lang.css → paas-bpmn-log.vue_vue_type_style_index_0_scoped_eb574523_lang.css} +9 -9
- package/es/components/select-user-modal/deptUser.vue.d.ts +9 -0
- package/es/components/select-user-modal/deptUser.vue.mjs +7 -0
- package/es/components/select-user-modal/deptUser.vue_vue_type_script_setup_true_name_deptUser_lang.mjs +296 -0
- package/es/components/select-user-modal/deptUser.vue_vue_type_style_index_0_scoped_02dff7bf_lang.css +40 -0
- package/es/components/select-user-modal/index.d.ts +2 -0
- package/es/components/select-user-modal/index.mjs +1 -0
- package/es/components/select-user-modal/range-role.vue.d.ts +9 -0
- package/es/components/select-user-modal/range-role.vue.mjs +7 -0
- package/es/components/select-user-modal/range-role.vue_vue_type_script_setup_true_name_role_lang.mjs +137 -0
- package/es/components/select-user-modal/range-role.vue_vue_type_style_index_0_scoped_1241bcdf_lang.css +34 -0
- package/es/components/select-user-modal/select-user-modal.vue.d.ts +12 -0
- package/es/components/select-user-modal/select-user-modal.vue.mjs +7 -0
- package/es/components/select-user-modal/select-user-modal.vue_vue_type_script_setup_true_name_select-user-modal_lang.mjs +123 -0
- package/es/components/select-user-modal/select-user-modal.vue_vue_type_style_index_0_scoped_2c0f184c_lang.css +14 -0
- package/es/components/select-user-modal/userGroup.vue.d.ts +9 -0
- package/es/components/select-user-modal/userGroup.vue.mjs +7 -0
- package/es/components/select-user-modal/userGroup.vue_vue_type_script_setup_true_name_userGroup_lang.mjs +149 -0
- package/es/components/select-user-modal/userGroup.vue_vue_type_style_index_0_scoped_47d1cbaa_lang.css +19 -0
- package/es/create-app-vue.d.ts +2 -2
- package/es/create-app-vue.mjs +3 -3
- package/es/index.d.ts +1 -0
- package/es/index.mjs +5 -1
- package/es/modules/data-rules-container/index.d.ts +3 -0
- package/es/modules/data-rules-container/index.mjs +2 -0
- package/es/modules/data-rules-container/src/components/header-action.vue.d.ts +10 -0
- package/es/modules/data-rules-container/src/components/header-action.vue.mjs +7 -0
- package/es/modules/data-rules-container/src/components/header-action.vue_vue_type_script_setup_true_name_header-action_lang.mjs +36 -0
- package/es/modules/data-rules-container/src/components/header-action.vue_vue_type_style_index_0_scoped_4e281013_lang.css +32 -0
- package/es/modules/data-rules-container/src/components/ndo-select-cmp.vue.d.ts +8 -0
- package/es/modules/data-rules-container/src/components/ndo-select-cmp.vue.mjs +5 -0
- package/es/modules/data-rules-container/src/components/ndo-select-cmp.vue_vue_type_script_setup_true_lang.mjs +266 -0
- package/es/modules/data-rules-container/src/components/perm-action-node.vue.d.ts +22 -0
- package/es/modules/data-rules-container/src/components/perm-action-node.vue.mjs +7 -0
- package/es/modules/data-rules-container/src/components/perm-action-node.vue_vue_type_script_setup_true_name_perm-action-node_lang.mjs +384 -0
- package/es/modules/data-rules-container/src/components/perm-action-node.vue_vue_type_style_index_0_scoped_417c660f_lang.css +73 -0
- package/es/modules/data-rules-container/src/components/perm-root-node.vue.d.ts +3 -0
- package/es/modules/data-rules-container/src/components/perm-root-node.vue.mjs +7 -0
- package/es/modules/data-rules-container/src/components/perm-root-node.vue_vue_type_script_setup_true_name_perm-root-node_lang.mjs +61 -0
- package/es/modules/data-rules-container/src/components/perm-root-node.vue_vue_type_style_index_0_scoped_ca5c9d20_lang.css +74 -0
- package/es/modules/data-rules-container/src/components/rdo-select-cmp.vue.d.ts +11 -0
- package/es/modules/data-rules-container/src/components/rdo-select-cmp.vue.mjs +5 -0
- package/es/modules/data-rules-container/src/components/rdo-select-cmp.vue_vue_type_script_setup_true_lang.mjs +93 -0
- package/es/modules/data-rules-container/src/components/request-select-cmp.vue.d.ts +9 -0
- package/es/modules/data-rules-container/src/components/request-select-cmp.vue.mjs +5 -0
- package/es/modules/data-rules-container/src/components/request-select-cmp.vue_vue_type_script_setup_true_name_request-select-cmp_lang.mjs +117 -0
- package/es/modules/data-rules-container/src/components/request-tree-select-cmp.vue.d.ts +3 -0
- package/es/modules/data-rules-container/src/components/request-tree-select-cmp.vue.mjs +6 -0
- package/es/modules/data-rules-container/src/components/request-tree-select-cmp.vue_vue_type_script_name_gct-select_setup_true_lang.mjs +100 -0
- package/es/modules/data-rules-container/src/components/request-tree-select-cmp.vue_vue_type_style_index_0_lang.css +21 -0
- package/es/modules/data-rules-container/src/components/select-modal-cmp.vue.d.ts +32 -0
- package/es/modules/data-rules-container/src/components/select-modal-cmp.vue.mjs +5 -0
- package/es/modules/data-rules-container/src/components/select-modal-cmp.vue_vue_type_script_setup_true_name_select-modal-cmp_lang.mjs +268 -0
- package/es/modules/data-rules-container/src/components/select-more.vue.d.ts +8 -0
- package/es/modules/data-rules-container/src/components/select-more.vue.mjs +5 -0
- package/es/modules/data-rules-container/src/components/select-more.vue_vue_type_script_setup_true_lang.mjs +26 -0
- package/es/modules/data-rules-container/src/components/select-userdep-cmp.vue.d.ts +12 -0
- package/es/modules/data-rules-container/src/components/select-userdep-cmp.vue.mjs +5 -0
- package/es/modules/data-rules-container/src/components/select-userdep-cmp.vue_vue_type_script_setup_true_name_select-userdep-cmp_lang.mjs +103 -0
- package/es/modules/data-rules-container/src/components/tree-action-node.vue.d.ts +25 -0
- package/es/modules/data-rules-container/src/components/tree-action-node.vue.mjs +7 -0
- package/es/modules/data-rules-container/src/components/tree-action-node.vue_vue_type_script_setup_true_name_tree-action-node_lang.mjs +544 -0
- package/es/modules/data-rules-container/src/components/tree-action-node.vue_vue_type_style_index_0_scoped_46368089_lang.css +67 -0
- package/es/modules/data-rules-container/src/components/tree-root-node.vue.d.ts +3 -0
- package/es/modules/data-rules-container/src/components/tree-root-node.vue.mjs +7 -0
- package/es/modules/data-rules-container/src/components/tree-root-node.vue_vue_type_script_setup_true_name_tree-root-node_lang.mjs +105 -0
- package/es/modules/data-rules-container/src/components/tree-root-node.vue_vue_type_style_index_0_scoped_37e323fb_lang.css +29 -0
- package/es/modules/data-rules-container/src/components/tree-select-cmp.vue.d.ts +3 -0
- package/es/modules/data-rules-container/src/components/tree-select-cmp.vue.mjs +5 -0
- package/es/modules/data-rules-container/src/components/tree-select-cmp.vue_vue_type_script_name_gct-select_setup_true_lang.mjs +89 -0
- package/es/modules/data-rules-container/src/constant/config.d.ts +146 -0
- package/es/modules/data-rules-container/src/constant/config.mjs +548 -0
- package/es/modules/data-rules-container/src/constant/interface.d.ts +85 -0
- package/es/modules/data-rules-container/src/constant/interface.mjs +36 -0
- package/es/modules/data-rules-container/src/data-rules-container.vue.d.ts +45 -0
- package/es/modules/data-rules-container/src/data-rules-container.vue.mjs +6 -0
- package/es/modules/data-rules-container/src/data-rules-container.vue_vue_type_script_setup_true_name_data-rules-container_lang.mjs +234 -0
- package/es/modules/data-rules-container/src/data-rules-container.vue_vue_type_style_index_0_lang.css +149 -0
- package/es/modules/data-rules-container/src/field-role-container.vue.d.ts +14 -0
- package/es/modules/data-rules-container/src/field-role-container.vue.mjs +5 -0
- package/es/modules/data-rules-container/src/field-role-container.vue_vue_type_script_setup_true_name_field-role-container_lang.mjs +73 -0
- package/es/modules/data-rules-container/src/hooks/useDataRulesTree.d.ts +30 -0
- package/es/modules/data-rules-container/src/hooks/useDataRulesTree.mjs +317 -0
- package/es/modules/data-rules-container/src/hooks/useEmitter.d.ts +10 -0
- package/es/modules/data-rules-container/src/hooks/useRdoHooks.d.ts +37 -0
- package/es/modules/data-rules-container/src/hooks/useRdoHooks.mjs +144 -0
- package/es/modules/data-rules-container/src/hooks/useRole.d.ts +8 -0
- package/es/modules/data-rules-container/src/typing.d.ts +40 -0
- package/package.json +9 -9
- package/dist/ColorPicker-DGQQb8I7.js +0 -1
- package/dist/_plugin-vue_export-helper-C9hXqKoS.js +0 -1
- package/es/components/paas-bpmn-log/hooks/useObserver.mjs +0 -46
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { useAsyncOptions } from "../hooks/useRdoHooks.mjs";
|
|
2
|
+
import { createBlock, createElementVNode, createVNode, defineComponent, onBeforeMount, openBlock, ref, resolveComponent, toDisplayString, unref, withCtx } from "vue";
|
|
3
|
+
import { debounce } from "lodash-es";
|
|
4
|
+
import { TreeSelect } from "ant-design-vue";
|
|
5
|
+
import { watchDebounced } from "@vueuse/core";
|
|
6
|
+
//#region src/modules/data-rules-container/src/components/rdo-select-cmp.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
+
var rdo_select_cmp_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
8
|
+
__name: "rdo-select-cmp",
|
|
9
|
+
props: {
|
|
10
|
+
value: {},
|
|
11
|
+
apiParams: {},
|
|
12
|
+
parentToDefault: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: true
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
setup(__props) {
|
|
18
|
+
const props = __props;
|
|
19
|
+
const searchValue = ref();
|
|
20
|
+
const { getChildrens, getAsyncOptions, treeData } = useAsyncOptions({
|
|
21
|
+
bindModelKey: props.apiParams.modelKey,
|
|
22
|
+
modelCategory: "entity"
|
|
23
|
+
});
|
|
24
|
+
async function getOptionsByQuery(opts = {}) {
|
|
25
|
+
await getAsyncOptions({
|
|
26
|
+
modelCategory: "entity",
|
|
27
|
+
pageSize: 9999,
|
|
28
|
+
queryData: { ...opts.queryData },
|
|
29
|
+
...opts
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
onBeforeMount(getOptionsByQuery);
|
|
33
|
+
watchDebounced(() => props.value, async (v) => {
|
|
34
|
+
/** 监听如果分业内不存在id 就手动查询 */
|
|
35
|
+
try {
|
|
36
|
+
await getChildrens(v);
|
|
37
|
+
} catch (error) {
|
|
38
|
+
console.log(error);
|
|
39
|
+
}
|
|
40
|
+
}, {
|
|
41
|
+
debounce: 200,
|
|
42
|
+
immediate: true
|
|
43
|
+
});
|
|
44
|
+
const search = debounce(async (keyword) => {
|
|
45
|
+
await getOptionsByQuery({
|
|
46
|
+
keyword,
|
|
47
|
+
pageNo: 1
|
|
48
|
+
});
|
|
49
|
+
if (!keyword)
|
|
50
|
+
/**選中後初始化选项 */
|
|
51
|
+
await getChildrens(props.value);
|
|
52
|
+
}, 200);
|
|
53
|
+
function getOmittedText(omitted) {
|
|
54
|
+
return omitted.map((v) => v.label?.children?.map((i) => i.children)?.join(":")).join(", ");
|
|
55
|
+
}
|
|
56
|
+
return (_ctx, _cache) => {
|
|
57
|
+
const _component_a_tooltip = resolveComponent("a-tooltip");
|
|
58
|
+
const _component_a_tree_select = resolveComponent("a-tree-select");
|
|
59
|
+
return openBlock(), createBlock(_component_a_tree_select, {
|
|
60
|
+
"search-value": searchValue.value,
|
|
61
|
+
"onUpdate:searchValue": _cache[0] || (_cache[0] = ($event) => searchValue.value = $event),
|
|
62
|
+
value: __props.value,
|
|
63
|
+
style: { "width": "100%" },
|
|
64
|
+
"tree-data": unref(treeData),
|
|
65
|
+
"show-search": "",
|
|
66
|
+
"allow-clear": true,
|
|
67
|
+
multiple: "",
|
|
68
|
+
"tree-node-label-prop": "full_path",
|
|
69
|
+
"show-checked-strategy": unref(TreeSelect).SHOW_ALL,
|
|
70
|
+
"max-tag-count": "responsive",
|
|
71
|
+
"max-tag-text-length": 2,
|
|
72
|
+
virtual: false,
|
|
73
|
+
"filter-tree-node": () => true,
|
|
74
|
+
"dropdown-class-name": "vxe-table--ignore-clear",
|
|
75
|
+
onSearch: unref(search)
|
|
76
|
+
}, {
|
|
77
|
+
maxTagPlaceholder: withCtx((omittedValues) => [createVNode(_component_a_tooltip, { title: getOmittedText(omittedValues) }, {
|
|
78
|
+
default: withCtx(() => [createElementVNode("span", null, "+" + toDisplayString(omittedValues?.length), 1)]),
|
|
79
|
+
_: 2
|
|
80
|
+
}, 1032, ["title"])]),
|
|
81
|
+
_: 1
|
|
82
|
+
}, 8, [
|
|
83
|
+
"search-value",
|
|
84
|
+
"value",
|
|
85
|
+
"tree-data",
|
|
86
|
+
"show-checked-strategy",
|
|
87
|
+
"onSearch"
|
|
88
|
+
]);
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
//#endregion
|
|
93
|
+
export { rdo_select_cmp_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CompProps } from '../typing';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<CompProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
3
|
+
"update:pageNo": (...args: any[]) => void;
|
|
4
|
+
"update:value": (...args: any[]) => void;
|
|
5
|
+
}, string, import('vue').PublicProps, Readonly<CompProps> & Readonly<{
|
|
6
|
+
"onUpdate:pageNo"?: ((...args: any[]) => any) | undefined;
|
|
7
|
+
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
8
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import request_select_cmp_vue_vue_type_script_setup_true_name_request_select_cmp_lang_default from "./request-select-cmp.vue_vue_type_script_setup_true_name_request-select-cmp_lang.mjs";
|
|
2
|
+
//#region src/modules/data-rules-container/src/components/request-select-cmp.vue
|
|
3
|
+
var request_select_cmp_default = request_select_cmp_vue_vue_type_script_setup_true_name_request_select_cmp_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { request_select_cmp_default as default };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { computed, createBlock, defineComponent, mergeProps, nextTick, onBeforeMount, openBlock, ref, resolveComponent, unref } from "vue";
|
|
2
|
+
import { debounce } from "lodash-es";
|
|
3
|
+
//#region src/modules/data-rules-container/src/components/request-select-cmp.vue?vue&type=script&setup=true&name=request-select-cmp&lang.ts
|
|
4
|
+
var SEARCH_DEBOUNCE_MS = 200;
|
|
5
|
+
var request_select_cmp_vue_vue_type_script_setup_true_name_request_select_cmp_lang_default = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "request-select-cmp",
|
|
7
|
+
props: {
|
|
8
|
+
value: {},
|
|
9
|
+
api: { type: Function },
|
|
10
|
+
apiParams: {},
|
|
11
|
+
filterType: {}
|
|
12
|
+
},
|
|
13
|
+
emits: ["update:pageNo", "update:value"],
|
|
14
|
+
setup(__props, { emit: __emit }) {
|
|
15
|
+
const emit = __emit;
|
|
16
|
+
const props = __props;
|
|
17
|
+
const options = ref([]);
|
|
18
|
+
const lastSearchValue = ref("");
|
|
19
|
+
const displayField = ref("name_");
|
|
20
|
+
const value = computed(() => props.value || []);
|
|
21
|
+
function toOption(item) {
|
|
22
|
+
return {
|
|
23
|
+
label: item.__LABEL__ ?? item.text ?? item.name_ ?? item.name ?? "",
|
|
24
|
+
value: item.id_ ?? item.value ?? item.key ?? item.id ?? ""
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
const filterOption = (input, option) => {
|
|
28
|
+
if (!option) return false;
|
|
29
|
+
if (option.label) return option.label.toLowerCase().includes(input.toLowerCase());
|
|
30
|
+
if (option.value != null) return String(option.value).toLowerCase().includes(input.toLowerCase());
|
|
31
|
+
return false;
|
|
32
|
+
};
|
|
33
|
+
const hasPageNo = computed(() => {
|
|
34
|
+
return Object.keys(props.apiParams)?.includes("pageNo");
|
|
35
|
+
});
|
|
36
|
+
const separatorAttr = computed(() => ({
|
|
37
|
+
showSearch: true,
|
|
38
|
+
filterOption: !hasPageNo.value ? filterOption : false,
|
|
39
|
+
maxTagTextLength: 2,
|
|
40
|
+
maxTagCount: "responsive"
|
|
41
|
+
}));
|
|
42
|
+
async function fetchOptions(params) {
|
|
43
|
+
if (typeof props.api !== "function") return [];
|
|
44
|
+
const result = await props.api({ ...params ?? {} });
|
|
45
|
+
return (Array.isArray(result) ? result : result?.data ?? []).map(toOption);
|
|
46
|
+
}
|
|
47
|
+
function getSearchParams(keyword) {
|
|
48
|
+
if (!keyword?.trim()) return props.apiParams ?? {};
|
|
49
|
+
const queryName = `${displayField.value}.ilike`;
|
|
50
|
+
return {
|
|
51
|
+
...props.apiParams,
|
|
52
|
+
query: { [queryName]: keyword.trim() },
|
|
53
|
+
exp: `OR(${queryName})`
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
async function getModelInfo() {
|
|
57
|
+
const { bindModelKey } = props.apiParams ?? {};
|
|
58
|
+
if (bindModelKey) displayField.value = (await _api.apaas.modelMeta.getInfo({ id: bindModelKey }) || {}).displayField || "name_";
|
|
59
|
+
}
|
|
60
|
+
/** 下拉触底分页 */
|
|
61
|
+
async function popupScroll(e) {
|
|
62
|
+
const target = e.target;
|
|
63
|
+
if (target.scrollTop + target.offsetHeight !== target.scrollHeight) return;
|
|
64
|
+
const { pageNo = 1, pageSize = 10 } = props.apiParams ?? {};
|
|
65
|
+
if (Number(pageNo) * Number(pageSize) > options.value?.length) return;
|
|
66
|
+
emit("update:pageNo");
|
|
67
|
+
await nextTick();
|
|
68
|
+
const opts = await fetchOptions(getSearchParams(lastSearchValue.value ?? "") ?? {});
|
|
69
|
+
const existingValues = new Set(options.value.map((j) => j.value));
|
|
70
|
+
const newOpts = opts.filter((i) => !existingValues.has(i.value));
|
|
71
|
+
if (newOpts.length) options.value = [...options.value, ...newOpts];
|
|
72
|
+
}
|
|
73
|
+
const debouncedSearch = debounce(async (val) => {
|
|
74
|
+
if (!hasPageNo.value) return;
|
|
75
|
+
lastSearchValue.value = val.trim();
|
|
76
|
+
emit("update:pageNo", 1);
|
|
77
|
+
options.value = await fetchOptions(getSearchParams(lastSearchValue.value));
|
|
78
|
+
}, SEARCH_DEBOUNCE_MS);
|
|
79
|
+
const handleChange = async (val) => {
|
|
80
|
+
emit("update:value", val);
|
|
81
|
+
if ((!val || val.length === 0) && hasPageNo.value) {
|
|
82
|
+
emit("update:pageNo", 1);
|
|
83
|
+
options.value = await fetchOptions(props.apiParams ?? {});
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
const handleFocus = async () => {
|
|
87
|
+
if (!hasPageNo.value) return;
|
|
88
|
+
if ((!value.value || value.value.length === 0) && lastSearchValue.value) {
|
|
89
|
+
emit("update:pageNo", 1);
|
|
90
|
+
options.value = await fetchOptions(props.apiParams ?? {});
|
|
91
|
+
}
|
|
92
|
+
lastSearchValue.value = "";
|
|
93
|
+
};
|
|
94
|
+
onBeforeMount(async () => {
|
|
95
|
+
getModelInfo();
|
|
96
|
+
options.value = await fetchOptions(props.apiParams ?? {});
|
|
97
|
+
});
|
|
98
|
+
return (_ctx, _cache) => {
|
|
99
|
+
const _component_a_select = resolveComponent("a-select");
|
|
100
|
+
return openBlock(), createBlock(_component_a_select, mergeProps({
|
|
101
|
+
value: value.value,
|
|
102
|
+
options: options.value
|
|
103
|
+
}, separatorAttr.value, {
|
|
104
|
+
onPopupScroll: popupScroll,
|
|
105
|
+
onSearch: unref(debouncedSearch),
|
|
106
|
+
onChange: handleChange,
|
|
107
|
+
onFocus: handleFocus
|
|
108
|
+
}), null, 16, [
|
|
109
|
+
"value",
|
|
110
|
+
"options",
|
|
111
|
+
"onSearch"
|
|
112
|
+
]);
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
//#endregion
|
|
117
|
+
export { request_select_cmp_vue_vue_type_script_setup_true_name_request_select_cmp_lang_default as default };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CompProps } from '../typing';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<CompProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<CompProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import request_tree_select_cmp_vue_vue_type_script_name_gct_select_setup_true_lang_default from "./request-tree-select-cmp.vue_vue_type_script_name_gct-select_setup_true_lang.mjs";
|
|
2
|
+
import './request-tree-select-cmp.vue_vue_type_style_index_0_lang.css';/* empty css */
|
|
3
|
+
//#region src/modules/data-rules-container/src/components/request-tree-select-cmp.vue
|
|
4
|
+
var request_tree_select_cmp_default = request_tree_select_cmp_vue_vue_type_script_name_gct_select_setup_true_lang_default;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { request_tree_select_cmp_default as default };
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { createBlock, defineComponent, onBeforeMount, openBlock, ref, resolveComponent, unref } from "vue";
|
|
2
|
+
import { cloneDeep } from "lodash-es";
|
|
3
|
+
import { FIELD_TYPE, PrintResourceEnum, TreeHelper } from "@gct-paas/core";
|
|
4
|
+
import { TreeSelect } from "ant-design-vue";
|
|
5
|
+
//#region src/modules/data-rules-container/src/components/request-tree-select-cmp.vue?vue&type=script&name=gct-select&setup=true&lang.ts
|
|
6
|
+
var request_tree_select_cmp_vue_vue_type_script_name_gct_select_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
7
|
+
__name: "request-tree-select-cmp",
|
|
8
|
+
props: {
|
|
9
|
+
value: {},
|
|
10
|
+
api: { type: Function },
|
|
11
|
+
apiParams: {},
|
|
12
|
+
filterType: {}
|
|
13
|
+
},
|
|
14
|
+
setup(__props) {
|
|
15
|
+
const props = __props;
|
|
16
|
+
const treeOptions = ref([]);
|
|
17
|
+
const isPrinterField = (params) => params?.fieldType === FIELD_TYPE.PRINTER;
|
|
18
|
+
/** 打印机树:父节点 + printChildNode 扁平化后交给 list_to_tree */
|
|
19
|
+
function buildPrinterTreeFlatList(list) {
|
|
20
|
+
return list.flatMap((i) => {
|
|
21
|
+
const dftInfo = i.printChildNode?.find((e) => e.defaultPrint === "是");
|
|
22
|
+
return [{
|
|
23
|
+
...i,
|
|
24
|
+
label: i.name,
|
|
25
|
+
value: i.printKey,
|
|
26
|
+
parentId: i.parentId || "ROOT",
|
|
27
|
+
dftPrintInfo: i.type === PrintResourceEnum.CLIENT_PRINT && dftInfo ? {
|
|
28
|
+
...dftInfo,
|
|
29
|
+
value: dftInfo.printKey,
|
|
30
|
+
label: dftInfo.name
|
|
31
|
+
} : void 0
|
|
32
|
+
}, ...i.printChildNode?.map((e) => ({
|
|
33
|
+
...e,
|
|
34
|
+
label: e.name,
|
|
35
|
+
value: e.printKey,
|
|
36
|
+
parentId: i.printKey
|
|
37
|
+
})) ?? []];
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
onBeforeMount(async () => {
|
|
41
|
+
if (typeof props.api === "function") {
|
|
42
|
+
const result = await props.api({ ...props.apiParams ?? {} });
|
|
43
|
+
const list = Array.isArray(result) ? result : result.data ?? [];
|
|
44
|
+
if (isPrinterField(props.apiParams)) {
|
|
45
|
+
const valueList = buildPrinterTreeFlatList(list ?? []);
|
|
46
|
+
treeOptions.value = TreeHelper.list_to_tree(cloneDeep(valueList.map((i) => ({
|
|
47
|
+
...i,
|
|
48
|
+
id: i.printKey
|
|
49
|
+
}))), (node) => ({
|
|
50
|
+
...node,
|
|
51
|
+
title: node.label ?? node.name ?? "",
|
|
52
|
+
disabled: node.parentId === "ROOT" && node.type === PrintResourceEnum.INTERNET_PRINT
|
|
53
|
+
}));
|
|
54
|
+
} else {
|
|
55
|
+
const options = list.map((i) => {
|
|
56
|
+
if (i.__NON_LEAF__ === void 0) i.__NON_LEAF__ = list.some((k) => k.parent_id_ === i.id_);
|
|
57
|
+
return {
|
|
58
|
+
label: i.__LABEL__,
|
|
59
|
+
value: i.id_,
|
|
60
|
+
full_path_: i.full_path_,
|
|
61
|
+
_item: i,
|
|
62
|
+
id: i.id_,
|
|
63
|
+
pId: i.parent_id_,
|
|
64
|
+
isLeaf: !i.__NON_LEAF__
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
treeOptions.value = options.map((item) => {
|
|
68
|
+
const ch_full_path = item.full_path_.split("/").map((path) => {
|
|
69
|
+
const n = options.find((k) => k.value === path);
|
|
70
|
+
if (n) return n.label;
|
|
71
|
+
return null;
|
|
72
|
+
}).filter((i) => i).join("/");
|
|
73
|
+
return {
|
|
74
|
+
...item,
|
|
75
|
+
label: ch_full_path,
|
|
76
|
+
title: ch_full_path
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
return (_ctx, _cache) => {
|
|
83
|
+
const _component_a_tree_select = resolveComponent("a-tree-select");
|
|
84
|
+
return openBlock(), createBlock(_component_a_tree_select, {
|
|
85
|
+
class: "gct-request-tree-select",
|
|
86
|
+
"dropdown-class-name": "gct-request-tree-select-dropdown",
|
|
87
|
+
"tree-data": treeOptions.value,
|
|
88
|
+
"tree-data-simple-mode": "",
|
|
89
|
+
"allow-clear": "",
|
|
90
|
+
"show-checked-strategy": unref(TreeSelect).SHOW_ALL,
|
|
91
|
+
"tree-node-label-prop": "label",
|
|
92
|
+
"filter-tree-node": false,
|
|
93
|
+
"max-tag-count": "responsive",
|
|
94
|
+
"max-tag-text-length": 3
|
|
95
|
+
}, null, 8, ["tree-data", "show-checked-strategy"]);
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
//#endregion
|
|
100
|
+
export { request_tree_select_cmp_vue_vue_type_script_name_gct_select_setup_true_lang_default as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.gct-request-tree-select-dropdown.ant-select-dropdown {
|
|
2
|
+
max-width: min(520px, 92vw);
|
|
3
|
+
}
|
|
4
|
+
.gct-request-tree-select-dropdown .ant-select-tree-list-holder-inner {
|
|
5
|
+
max-width: 100%;
|
|
6
|
+
}
|
|
7
|
+
.gct-request-tree-select-dropdown .ant-select-tree-treenode {
|
|
8
|
+
max-width: 100%;
|
|
9
|
+
}
|
|
10
|
+
.gct-request-tree-select-dropdown .ant-select-tree-node-content-wrapper {
|
|
11
|
+
flex: 1;
|
|
12
|
+
min-width: 0;
|
|
13
|
+
max-width: 100%;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
}
|
|
16
|
+
.gct-request-tree-select-dropdown .ant-select-tree-title {
|
|
17
|
+
display: block;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
text-overflow: ellipsis;
|
|
20
|
+
white-space: nowrap;
|
|
21
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ModalCompProps } from '../typing';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<ModalCompProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
3
|
+
change: (...args: any[]) => void;
|
|
4
|
+
}, string, import('vue').PublicProps, Readonly<ModalCompProps> & Readonly<{
|
|
5
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
6
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
7
|
+
selectUserModalRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
8
|
+
getContainer?: HTMLElement;
|
|
9
|
+
className?: string;
|
|
10
|
+
}> & Readonly<{
|
|
11
|
+
onOk?: ((...args: any[]) => any) | undefined;
|
|
12
|
+
}>, {
|
|
13
|
+
open: (data: IObject) => void;
|
|
14
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
15
|
+
ok: (...args: any[]) => void;
|
|
16
|
+
}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
17
|
+
P: {};
|
|
18
|
+
B: {};
|
|
19
|
+
D: {};
|
|
20
|
+
C: {};
|
|
21
|
+
M: {};
|
|
22
|
+
Defaults: {};
|
|
23
|
+
}, Readonly<{
|
|
24
|
+
getContainer?: HTMLElement;
|
|
25
|
+
className?: string;
|
|
26
|
+
}> & Readonly<{
|
|
27
|
+
onOk?: ((...args: any[]) => any) | undefined;
|
|
28
|
+
}>, {
|
|
29
|
+
open: (data: IObject) => void;
|
|
30
|
+
}, {}, {}, {}, {}> | null;
|
|
31
|
+
}, any>;
|
|
32
|
+
export default _default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import select_modal_cmp_vue_vue_type_script_setup_true_name_select_modal_cmp_lang_default from "./select-modal-cmp.vue_vue_type_script_setup_true_name_select-modal-cmp_lang.mjs";
|
|
2
|
+
//#region src/modules/data-rules-container/src/components/select-modal-cmp.vue
|
|
3
|
+
var select_modal_cmp_default = select_modal_cmp_vue_vue_type_script_setup_true_name_select_modal_cmp_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { select_modal_cmp_default as default };
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import select_user_modal_default from "../../../../components/select-user-modal/select-user-modal.vue.mjs";
|
|
2
|
+
import "../../../../components/select-user-modal/index.mjs";
|
|
3
|
+
import print_tmpl_modal_default from "../../../print-tmpl/print-tmpl-modal.vue.mjs";
|
|
4
|
+
import "../../../print-tmpl/index.mjs";
|
|
5
|
+
import { Fragment, computed, createElementBlock, createVNode, defineComponent, mergeProps, onMounted, openBlock, ref, resolveComponent, toRaw, unref, watch } from "vue";
|
|
6
|
+
import { PrintTypeEnum, t, uuid2 } from "@gct-paas/core";
|
|
7
|
+
//#region src/modules/data-rules-container/src/components/select-modal-cmp.vue?vue&type=script&setup=true&name=select-modal-cmp&lang.ts
|
|
8
|
+
var select_modal_cmp_vue_vue_type_script_setup_true_name_select_modal_cmp_lang_default = /* @__PURE__ */ defineComponent({
|
|
9
|
+
__name: "select-modal-cmp",
|
|
10
|
+
props: {
|
|
11
|
+
supportModalType: {},
|
|
12
|
+
pickerCompParams: {},
|
|
13
|
+
value: {}
|
|
14
|
+
},
|
|
15
|
+
emits: ["change"],
|
|
16
|
+
setup(__props, { emit: __emit }) {
|
|
17
|
+
const props = __props;
|
|
18
|
+
const emits = __emit;
|
|
19
|
+
const selectUserModalRef = ref();
|
|
20
|
+
const getClassName = "range-user-modal_" + uuid2(16, 16);
|
|
21
|
+
const allRoles = ref([]);
|
|
22
|
+
const allUserGroups = ref([]);
|
|
23
|
+
const allDepts = ref([]);
|
|
24
|
+
const allUsers = ref([]);
|
|
25
|
+
const labelOptions = ref([]);
|
|
26
|
+
const fieldObj = ref({});
|
|
27
|
+
const multiple = computed(() => props.pickerCompParams?.multiple);
|
|
28
|
+
const selectAtrr = computed(() => {
|
|
29
|
+
return {
|
|
30
|
+
mode: multiple.value ? "multiple" : void 0,
|
|
31
|
+
dropdownClassName: "hidden"
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
const showValue = computed(() => {
|
|
35
|
+
if (props.value) {
|
|
36
|
+
let value = props.value;
|
|
37
|
+
const a = multiple.value ? Array.isArray(value) ? value : value?.split(",").filter((i) => i) || [] : value;
|
|
38
|
+
return props.supportModalType === "range_user" ? a : value;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
const handleDeselect = (key) => {
|
|
42
|
+
if (props.supportModalType === "range_user") {
|
|
43
|
+
const raw = props.value;
|
|
44
|
+
const next = (multiple.value ? Array.isArray(raw) ? [...raw] : String(raw ?? "").split(",").filter(Boolean) : raw != null && raw !== "" ? [String(raw)] : []).filter((k) => String(k) !== String(key));
|
|
45
|
+
emits("change", next.length ? next : "", 0);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (props.supportModalType === "label_template_ref") if (multiple.value) {
|
|
49
|
+
const raw = props.value;
|
|
50
|
+
emits("change", (Array.isArray(raw) ? [...raw] : raw != null && raw !== "" ? String(raw).split(",").filter(Boolean) : []).filter((id) => String(id) !== String(key)), 0);
|
|
51
|
+
} else emits("change", "", 0);
|
|
52
|
+
};
|
|
53
|
+
const optionsData = computed(() => {
|
|
54
|
+
if (props.supportModalType === "range_user") {
|
|
55
|
+
const roleOpt = allRoles.value.filter((e) => showValue.value?.includes(e.value));
|
|
56
|
+
const userGroupOpt = allUserGroups.value.filter((e) => showValue.value?.includes(e.value));
|
|
57
|
+
const deptOpt = allDepts.value.filter((e) => showValue.value?.includes(e.value));
|
|
58
|
+
const userOpt = allUsers.value.filter((e) => showValue.value?.includes(e.value));
|
|
59
|
+
return [
|
|
60
|
+
...roleOpt,
|
|
61
|
+
...userGroupOpt,
|
|
62
|
+
...deptOpt,
|
|
63
|
+
...userOpt
|
|
64
|
+
];
|
|
65
|
+
}
|
|
66
|
+
if (props.supportModalType === "label_template_ref") return labelOptions.value.map((e) => {
|
|
67
|
+
return {
|
|
68
|
+
...e,
|
|
69
|
+
value: e.id,
|
|
70
|
+
label: `${e.name}${e.version && e.printType !== "btw" ? " : " + e.version : ""}`
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
return [];
|
|
74
|
+
});
|
|
75
|
+
/**
|
|
76
|
+
* 范围人员逻辑开始--------------------------------------
|
|
77
|
+
*/
|
|
78
|
+
const updateUserOptions = async (userIds) => {
|
|
79
|
+
if (!userIds?.length) return;
|
|
80
|
+
const notExistUserIds = userIds?.filter((e) => e.includes(`USER:`) && !allUsers.value.some((f) => f.value === e))?.map((e) => e.replace(/USER:/, ""));
|
|
81
|
+
notExistUserIds?.length && await getAllUsers(notExistUserIds);
|
|
82
|
+
};
|
|
83
|
+
const getAllRoles = async () => {
|
|
84
|
+
allRoles.value = (await _api.apaas.role.getList({}) ?? []).map((e) => {
|
|
85
|
+
return {
|
|
86
|
+
...e,
|
|
87
|
+
value: `ROLE:${e.id}`,
|
|
88
|
+
label: e.name,
|
|
89
|
+
iconExtraProps: {}
|
|
90
|
+
};
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
const getAllUsers = async (ids) => {
|
|
94
|
+
const res = (await _api.platform.orgUserPicker.getTenantManagementUserListByIds({ ids: ids.join(",") }) ?? []).map((e) => {
|
|
95
|
+
return {
|
|
96
|
+
...e,
|
|
97
|
+
value: `USER:${e.id}`,
|
|
98
|
+
label: e.fullname
|
|
99
|
+
};
|
|
100
|
+
});
|
|
101
|
+
allUsers.value.push(...res);
|
|
102
|
+
};
|
|
103
|
+
const getAllUserGroups = async () => {
|
|
104
|
+
allUserGroups.value = (await _api.apaas.userGroup.getList({}) ?? []).map((e) => {
|
|
105
|
+
return {
|
|
106
|
+
...e,
|
|
107
|
+
value: `USER_GROUP:${e.id}`,
|
|
108
|
+
label: e.name
|
|
109
|
+
};
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
const getAllDepts = async () => {
|
|
113
|
+
allDepts.value = (await _api.apaas.designerCommon.getGetCanBeUsedOrg({}) ?? []).map((e) => {
|
|
114
|
+
return {
|
|
115
|
+
...e,
|
|
116
|
+
value: `ORG:${e.id}`,
|
|
117
|
+
label: e.name
|
|
118
|
+
};
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* 标签模版逻辑开始--------------------------------------
|
|
123
|
+
*/
|
|
124
|
+
const getIsBtwLabel = (label) => {
|
|
125
|
+
if (!label?.printType) return false;
|
|
126
|
+
return label.printType === "btw";
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* 供标签选择弹窗回填:单选返回一条记录,多选返回已选记录数组(先补全 labelOptions)
|
|
130
|
+
*/
|
|
131
|
+
async function getLabelOptionValue(v = showValue.value) {
|
|
132
|
+
await hydrateLabelOptionsFromValue(v);
|
|
133
|
+
const ids = normalizeLabelTemplateIds(v);
|
|
134
|
+
if (!ids.length) return multiple.value ? [] : void 0;
|
|
135
|
+
const mapped = ids.map((id) => labelOptions.value.find((e) => String(e.id) === String(id))).filter(Boolean).map((data) => {
|
|
136
|
+
const categoryId = labelOptions.value.find((e) => e.id === data?.key)?.categoryId || data.categoryId;
|
|
137
|
+
const merged = {
|
|
138
|
+
...data,
|
|
139
|
+
categoryId
|
|
140
|
+
};
|
|
141
|
+
return {
|
|
142
|
+
...merged,
|
|
143
|
+
version: getIsBtwLabel(merged) ? "" : merged?.version
|
|
144
|
+
};
|
|
145
|
+
});
|
|
146
|
+
if (multiple.value) return mapped.map((m) => toRaw(m));
|
|
147
|
+
return mapped[0] ? toRaw(mapped[0]) : void 0;
|
|
148
|
+
}
|
|
149
|
+
async function getTmplInfo(id) {
|
|
150
|
+
const res = await _api.apaas.printDesigner.getInfo({
|
|
151
|
+
id,
|
|
152
|
+
moduleType: PrintTypeEnum.LABEL
|
|
153
|
+
});
|
|
154
|
+
res && labelOptions.value.push({
|
|
155
|
+
...res,
|
|
156
|
+
id: res.baseId ? res.baseId + ":" + res.id : res.id
|
|
157
|
+
});
|
|
158
|
+
return res;
|
|
159
|
+
}
|
|
160
|
+
/** 回填值统一为 id 列表(与 handleOk / handleDeselect 一致) */
|
|
161
|
+
function normalizeLabelTemplateIds(val) {
|
|
162
|
+
if (val == null || val === "") return [];
|
|
163
|
+
if (multiple.value) return Array.isArray(val) ? val.map(String).filter(Boolean) : String(val).split(",").filter(Boolean);
|
|
164
|
+
return [String(val)];
|
|
165
|
+
}
|
|
166
|
+
/** 已有选中项但本地无缓存时,拉取详情写入 labelOptions,供 options 展示 */
|
|
167
|
+
async function hydrateLabelOptionsFromValue(sourceVal) {
|
|
168
|
+
const ids = normalizeLabelTemplateIds(sourceVal ?? showValue.value);
|
|
169
|
+
if (!ids.length) return;
|
|
170
|
+
await Promise.all(ids.map(async (fullId) => {
|
|
171
|
+
if (labelOptions.value.some((e) => String(e.id) === String(fullId))) return;
|
|
172
|
+
await getTmplInfo((String(fullId).includes(":") ? String(fullId).split(":").pop() : String(fullId)) || fullId);
|
|
173
|
+
}));
|
|
174
|
+
}
|
|
175
|
+
const handleOk = async (data) => {
|
|
176
|
+
const notExistUserIds = data?.filter((e) => e.includes(`USER:`) && !allUsers.value.some((f) => f.value === e))?.map((e) => e.replace(/USER:/, ""));
|
|
177
|
+
notExistUserIds?.length && await getAllUsers(notExistUserIds);
|
|
178
|
+
emits("change", data.length ? data : "", 0);
|
|
179
|
+
};
|
|
180
|
+
const handleOpenModal = async () => {
|
|
181
|
+
if (props.supportModalType === "range_user") selectUserModalRef.value.open({
|
|
182
|
+
selectedValue: showValue.value,
|
|
183
|
+
title: ""
|
|
184
|
+
});
|
|
185
|
+
else if (props.supportModalType === "label_template_ref") {
|
|
186
|
+
const res = await _gct.openUtil.modal(print_tmpl_modal_default, {
|
|
187
|
+
selected: await getLabelOptionValue(),
|
|
188
|
+
moduleType: PrintTypeEnum.LABEL,
|
|
189
|
+
isRdo: true,
|
|
190
|
+
btwForceVisible: true,
|
|
191
|
+
multiple: multiple.value
|
|
192
|
+
}, {
|
|
193
|
+
title: t("sys.pageDesigner.chooseTmplSth", { sth: "" }),
|
|
194
|
+
width: 1100,
|
|
195
|
+
height: 734,
|
|
196
|
+
okText: t("sys.okText"),
|
|
197
|
+
wrapClassName: "vxe-table--ignore-clear"
|
|
198
|
+
});
|
|
199
|
+
if (res.ok && res.params?.selected?.length) {
|
|
200
|
+
const { selected } = res.params;
|
|
201
|
+
selected.forEach((o) => {
|
|
202
|
+
if (getIsBtwLabel(o)) {
|
|
203
|
+
o.id = `${o.baseId}:${o.id}`;
|
|
204
|
+
o.version = "";
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
selected.forEach((o) => {
|
|
208
|
+
if (!labelOptions.value.some((e) => e.id === o.id)) labelOptions.value.push({ ...o });
|
|
209
|
+
});
|
|
210
|
+
emits("change", multiple.value ? selected.map((e) => e.id) : selected[0].id, 0);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
watch(() => showValue, async (val) => {
|
|
215
|
+
if (props.supportModalType === "range_user") {
|
|
216
|
+
updateUserOptions(multiple.value ? val : [val]);
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
if (props.supportModalType === "label_template_ref") {
|
|
220
|
+
const ids = normalizeLabelTemplateIds(val);
|
|
221
|
+
await hydrateLabelOptionsFromValue(val);
|
|
222
|
+
const rows = ids?.map((id) => labelOptions.value.find((e) => e.id == id))?.filter(Boolean);
|
|
223
|
+
if (!rows?.length) {
|
|
224
|
+
fieldObj.value = {};
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
const primary = rows[0];
|
|
228
|
+
fieldObj.value = {
|
|
229
|
+
...primary,
|
|
230
|
+
version: getIsBtwLabel(primary) ? "" : primary?.version
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
}, {
|
|
234
|
+
immediate: true,
|
|
235
|
+
deep: true
|
|
236
|
+
});
|
|
237
|
+
onMounted(() => {
|
|
238
|
+
if (props.supportModalType === "range_user") {
|
|
239
|
+
getAllRoles();
|
|
240
|
+
getAllUserGroups();
|
|
241
|
+
getAllDepts();
|
|
242
|
+
if (!multiple.value && showValue.value || multiple.value && showValue.value?.length) updateUserOptions(multiple.value ? showValue.value : [showValue.value]);
|
|
243
|
+
}
|
|
244
|
+
if (props.supportModalType === "label_template_ref") hydrateLabelOptionsFromValue();
|
|
245
|
+
});
|
|
246
|
+
return (_ctx, _cache) => {
|
|
247
|
+
const _component_a_select = resolveComponent("a-select");
|
|
248
|
+
return openBlock(), createElementBlock(Fragment, null, [createVNode(_component_a_select, mergeProps({
|
|
249
|
+
open: false,
|
|
250
|
+
value: showValue.value,
|
|
251
|
+
"max-tag-count": "responsive",
|
|
252
|
+
"max-tag-text-length": 2,
|
|
253
|
+
options: optionsData.value
|
|
254
|
+
}, selectAtrr.value, {
|
|
255
|
+
onClick: handleOpenModal,
|
|
256
|
+
onDeselect: handleDeselect
|
|
257
|
+
}), null, 16, ["value", "options"]), createVNode(unref(select_user_modal_default), {
|
|
258
|
+
ref_key: "selectUserModalRef",
|
|
259
|
+
ref: selectUserModalRef,
|
|
260
|
+
"class-name": getClassName,
|
|
261
|
+
"destroy-on-close": true,
|
|
262
|
+
onOk: handleOk
|
|
263
|
+
}, null, 512)], 64);
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
//#endregion
|
|
268
|
+
export { select_modal_cmp_vue_vue_type_script_setup_true_name_select_modal_cmp_lang_default as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
2
|
+
next: (...args: any[]) => void;
|
|
3
|
+
}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{
|
|
4
|
+
onNext?: ((...args: any[]) => any) | undefined;
|
|
5
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
6
|
+
target: HTMLDivElement;
|
|
7
|
+
}, HTMLDivElement>;
|
|
8
|
+
export default _default;
|