@gct-paas/core-web 0.1.6-dev.6 → 0.1.6-dev.7
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,36 @@
|
|
|
1
|
+
import { computed, createElementBlock, createElementVNode, createVNode, defineComponent, openBlock, resolveComponent, toDisplayString, unref } from "vue";
|
|
2
|
+
import { t } from "@gct-paas/core";
|
|
3
|
+
//#region src/modules/data-rules-container/src/components/header-action.vue?vue&type=script&setup=true&name=header-action&lang.ts
|
|
4
|
+
var _hoisted_1 = { class: "header-action" };
|
|
5
|
+
var _hoisted_2 = { class: "title" };
|
|
6
|
+
var _hoisted_3 = { class: "switch-area" };
|
|
7
|
+
var _hoisted_4 = { class: "check-title" };
|
|
8
|
+
var header_action_vue_vue_type_script_setup_true_name_header_action_lang_default = /* @__PURE__ */ defineComponent({
|
|
9
|
+
__name: "header-action",
|
|
10
|
+
props: {
|
|
11
|
+
checked: { type: Boolean },
|
|
12
|
+
title: {}
|
|
13
|
+
},
|
|
14
|
+
emits: ["update:checked"],
|
|
15
|
+
setup(__props, { emit: __emit }) {
|
|
16
|
+
const props = __props;
|
|
17
|
+
const emit = __emit;
|
|
18
|
+
const checkedValue = computed({
|
|
19
|
+
get() {
|
|
20
|
+
return props.checked;
|
|
21
|
+
},
|
|
22
|
+
set(value) {
|
|
23
|
+
emit("update:checked", value);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
return (_ctx, _cache) => {
|
|
27
|
+
const _component_a_switch = resolveComponent("a-switch");
|
|
28
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("span", _hoisted_2, toDisplayString(__props.title), 1), createElementVNode("div", _hoisted_3, [createElementVNode("span", _hoisted_4, toDisplayString(checkedValue.value ? unref(t)("sys.appDesigner.fieldEnable") : unref(t)("sys.appDesigner.fieldUnEnable")), 1), createVNode(_component_a_switch, {
|
|
29
|
+
checked: checkedValue.value,
|
|
30
|
+
"onUpdate:checked": _cache[0] || (_cache[0] = ($event) => checkedValue.value = $event)
|
|
31
|
+
}, null, 8, ["checked"])])]);
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
//#endregion
|
|
36
|
+
export { header_action_vue_vue_type_script_setup_true_name_header_action_lang_default as default };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.header-action[data-v-4e281013] {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
line-height: 22px;
|
|
5
|
+
padding-bottom: 16px;
|
|
6
|
+
}
|
|
7
|
+
.header-action .title[data-v-4e281013] {
|
|
8
|
+
display: inline-block;
|
|
9
|
+
line-height: 22px;
|
|
10
|
+
color: #333;
|
|
11
|
+
font-weight: 500;
|
|
12
|
+
}
|
|
13
|
+
.header-action .switch-area[data-v-4e281013] {
|
|
14
|
+
position: relative;
|
|
15
|
+
padding-left: 16px;
|
|
16
|
+
display: flex;
|
|
17
|
+
color: #333;
|
|
18
|
+
align-items: center;
|
|
19
|
+
}
|
|
20
|
+
.header-action .switch-area[data-v-4e281013]::before {
|
|
21
|
+
content: '';
|
|
22
|
+
position: absolute;
|
|
23
|
+
width: 1px;
|
|
24
|
+
height: 14px;
|
|
25
|
+
background-color: #eaeaea;
|
|
26
|
+
}
|
|
27
|
+
.header-action .check-title[data-v-4e281013] {
|
|
28
|
+
line-height: 22px;
|
|
29
|
+
display: inline-block;
|
|
30
|
+
margin-left: 16px;
|
|
31
|
+
margin-right: 8px;
|
|
32
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ApiParams } from '../typing';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
value?: string[];
|
|
4
|
+
apiParams: ApiParams;
|
|
5
|
+
filterType: string;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import ndo_select_cmp_vue_vue_type_script_setup_true_lang_default from "./ndo-select-cmp.vue_vue_type_script_setup_true_lang.mjs";
|
|
2
|
+
//#region src/modules/data-rules-container/src/components/ndo-select-cmp.vue
|
|
3
|
+
var ndo_select_cmp_default = ndo_select_cmp_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { ndo_select_cmp_default as default };
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { computed, createBlock, createElementVNode, createVNode, defineComponent, mergeProps, onBeforeMount, openBlock, ref, resolveComponent, toDisplayString, unref, watch, withCtx } from "vue";
|
|
2
|
+
import { debounce, isNil, throttle } from "lodash-es";
|
|
3
|
+
import { t } from "@gct-paas/core";
|
|
4
|
+
//#region src/modules/data-rules-container/src/components/ndo-select-cmp.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var DEBOUNCE_TIME = 500;
|
|
6
|
+
var ndo_select_cmp_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
7
|
+
__name: "ndo-select-cmp",
|
|
8
|
+
props: {
|
|
9
|
+
value: {},
|
|
10
|
+
apiParams: {},
|
|
11
|
+
filterType: {}
|
|
12
|
+
},
|
|
13
|
+
setup(__props) {
|
|
14
|
+
const props = __props;
|
|
15
|
+
const searchOptions = ref([]);
|
|
16
|
+
const initialOptions = ref([]);
|
|
17
|
+
const cacheOptions = ref([]);
|
|
18
|
+
const lastSearchValue = ref("");
|
|
19
|
+
const loading = ref(false);
|
|
20
|
+
const loadingMore = ref(false);
|
|
21
|
+
const displayField = ref();
|
|
22
|
+
const paginationStates = ref({
|
|
23
|
+
initial: {
|
|
24
|
+
pageNo: 1,
|
|
25
|
+
totalPage: 1,
|
|
26
|
+
hasMore: true
|
|
27
|
+
},
|
|
28
|
+
search: {
|
|
29
|
+
pageNo: 1,
|
|
30
|
+
totalPage: 1,
|
|
31
|
+
hasMore: true
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const isSearching = computed(() => lastSearchValue.value !== "");
|
|
35
|
+
const isFirstPage = computed(() => {
|
|
36
|
+
return (isSearching.value ? paginationStates.value.search : paginationStates.value.initial).pageNo === 1;
|
|
37
|
+
});
|
|
38
|
+
watch(() => props.value, async (newVal) => {
|
|
39
|
+
if (newVal && newVal.length !== 0 && !hasOption(newVal)) await fetchMissingOption(newVal);
|
|
40
|
+
}, { immediate: true });
|
|
41
|
+
const activeOptions = computed(() => {
|
|
42
|
+
return isSearching.value ? searchOptions.value : initialOptions.value;
|
|
43
|
+
});
|
|
44
|
+
const displayOptions = computed(() => {
|
|
45
|
+
if (isNoData.value) return [];
|
|
46
|
+
const normalOptions = activeOptions.value.filter((opt) => opt.type !== "status").map((item) => ({
|
|
47
|
+
label: item.label,
|
|
48
|
+
value: item.value
|
|
49
|
+
}));
|
|
50
|
+
const statusOptions = [];
|
|
51
|
+
if (activeOptions.value.length > 0) {
|
|
52
|
+
if (loading.value || loadingMore.value) statusOptions.push({
|
|
53
|
+
label: loading.value ? t("sys.loadingText") : t("sys.edhr.loadingMore"),
|
|
54
|
+
value: "loading_status",
|
|
55
|
+
disabled: true,
|
|
56
|
+
type: "status"
|
|
57
|
+
});
|
|
58
|
+
else if (!currentHasMore.value) {
|
|
59
|
+
if (!isPermScope.value) statusOptions.push({
|
|
60
|
+
label: t("sys.noMoreData"),
|
|
61
|
+
value: "no_more_status",
|
|
62
|
+
disabled: true,
|
|
63
|
+
type: "status"
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return [...normalOptions, ...statusOptions];
|
|
68
|
+
});
|
|
69
|
+
const currentHasMore = computed(() => {
|
|
70
|
+
return (isSearching.value ? paginationStates.value.search : paginationStates.value.initial).hasMore;
|
|
71
|
+
});
|
|
72
|
+
const isNoData = computed(() => {
|
|
73
|
+
return !loading.value && activeOptions.value.length === 0;
|
|
74
|
+
});
|
|
75
|
+
const separatorAttr = computed(() => ({
|
|
76
|
+
dropdownMatchSelectWidth: 180,
|
|
77
|
+
dropdownClassName: "gct-project-select-dropdown vxe-table--ignore-clear",
|
|
78
|
+
allowClear: true,
|
|
79
|
+
showSearch: true,
|
|
80
|
+
defaultActiveFirstOption: false,
|
|
81
|
+
filterOption: isPermScope.value ? filterOption : false,
|
|
82
|
+
mode: "multiple",
|
|
83
|
+
maxTagCount: "responsive",
|
|
84
|
+
maxTagTextLength: 2,
|
|
85
|
+
notFoundContent: isNoData.value && !isPermScope.value ? t("sys.edhr.noSearchResult") : void 0
|
|
86
|
+
}));
|
|
87
|
+
onBeforeMount(async () => {
|
|
88
|
+
await fetchInitialData(true);
|
|
89
|
+
if (isPermScope.value) getModelInfo();
|
|
90
|
+
});
|
|
91
|
+
const getModelInfo = async () => {
|
|
92
|
+
const { modelKey } = props.apiParams ?? {};
|
|
93
|
+
displayField.value = (await _api.apaas.modelMeta.getInfo({ id: modelKey }) || {}).displayField;
|
|
94
|
+
};
|
|
95
|
+
const filterOption = (input, option) => {
|
|
96
|
+
if (!option) return false;
|
|
97
|
+
const q = input.toLowerCase();
|
|
98
|
+
if (option.label) return String(option.label).toLowerCase().includes(q);
|
|
99
|
+
if (option.value != null) return String(option.value).toLowerCase().includes(q);
|
|
100
|
+
return false;
|
|
101
|
+
};
|
|
102
|
+
function hasOption(value) {
|
|
103
|
+
return value.filter((v) => !isNil(v)).filter((v) => ![
|
|
104
|
+
...initialOptions.value,
|
|
105
|
+
...cacheOptions.value,
|
|
106
|
+
...searchOptions.value
|
|
107
|
+
].some((o) => o.value === v)).length === 0;
|
|
108
|
+
}
|
|
109
|
+
async function fetchMissingOption(value) {
|
|
110
|
+
try {
|
|
111
|
+
const res = await _api.apaas.modelComprehensive.getBizServiceModelCategoryModelKeyBsKey({
|
|
112
|
+
bsKey: "listByIds",
|
|
113
|
+
...props.apiParams ?? {},
|
|
114
|
+
modelCategory: "entity"
|
|
115
|
+
}, { ids: value.join(",") });
|
|
116
|
+
if (res?.data) {
|
|
117
|
+
if (isPermScope.value && !displayField.value) await getModelInfo();
|
|
118
|
+
const newOptions = (res?.data ?? []).map((item) => ({
|
|
119
|
+
label: item.name_ || item[displayField.value],
|
|
120
|
+
value: item.id_,
|
|
121
|
+
type: "data"
|
|
122
|
+
}));
|
|
123
|
+
if (isPermScope.value) {
|
|
124
|
+
cacheOptions.value = mergeOptions(cacheOptions.value, newOptions);
|
|
125
|
+
initialOptions.value = mergeOptions(initialOptions.value, newOptions);
|
|
126
|
+
} else {
|
|
127
|
+
cacheOptions.value = [...newOptions, ...cacheOptions.value];
|
|
128
|
+
initialOptions.value = [...newOptions, ...initialOptions.value];
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
} catch (error) {
|
|
132
|
+
console.error("获取回显数据失败:", error);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
const mergeOptions = (existing, newItems) => {
|
|
136
|
+
const map = /* @__PURE__ */ new Map();
|
|
137
|
+
[...existing, ...newItems].forEach((item) => {
|
|
138
|
+
if (!map.has(item.value)) map.set(item.value, item);
|
|
139
|
+
});
|
|
140
|
+
return Array.from(map.values());
|
|
141
|
+
};
|
|
142
|
+
const isPermScope = computed(() => props.filterType === "permissionScope");
|
|
143
|
+
const fetchInitialData = async (resetPage = true) => {
|
|
144
|
+
if (loading.value) return;
|
|
145
|
+
loading.value = true;
|
|
146
|
+
const state = paginationStates.value.initial;
|
|
147
|
+
try {
|
|
148
|
+
if (resetPage) state.pageNo = 1;
|
|
149
|
+
const res = await _api.apaas.bizService.postModelKeyBsKey({
|
|
150
|
+
...props.apiParams ?? {},
|
|
151
|
+
bsKey: "listByPage"
|
|
152
|
+
}, {
|
|
153
|
+
pageNo: state.pageNo,
|
|
154
|
+
pageSize: 20
|
|
155
|
+
}, { addDisplayLabel: isPermScope.value ? 1 : void 0 });
|
|
156
|
+
if (res?.data) {
|
|
157
|
+
const newOptions = (res?.data ?? []).map((item) => ({
|
|
158
|
+
label: item.name_ || item.__LABEL__,
|
|
159
|
+
value: item.id_,
|
|
160
|
+
type: "data"
|
|
161
|
+
}));
|
|
162
|
+
state.totalPage = res.totalPage || 1;
|
|
163
|
+
state.hasMore = state.pageNo < state.totalPage;
|
|
164
|
+
if (resetPage) initialOptions.value = mergeOptions(cacheOptions.value, newOptions);
|
|
165
|
+
else initialOptions.value = mergeOptions(initialOptions.value, newOptions);
|
|
166
|
+
}
|
|
167
|
+
} catch (error) {
|
|
168
|
+
console.error("加载数据失败:", error);
|
|
169
|
+
state.hasMore = false;
|
|
170
|
+
} finally {
|
|
171
|
+
loading.value = false;
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
const fetchSearchData = async (searchVal, resetPage = true) => {
|
|
175
|
+
if (loading.value) return;
|
|
176
|
+
loading.value = true;
|
|
177
|
+
const state = paginationStates.value.search;
|
|
178
|
+
try {
|
|
179
|
+
if (resetPage) state.pageNo = 1;
|
|
180
|
+
const res = await _api.apaas.bizService.postModelKeyBsKey({
|
|
181
|
+
...props.apiParams ?? {},
|
|
182
|
+
bsKey: "listByPage"
|
|
183
|
+
}, {
|
|
184
|
+
pageNo: state.pageNo,
|
|
185
|
+
pageSize: 20,
|
|
186
|
+
query: { name_: !isPermScope.value ? searchVal : void 0 }
|
|
187
|
+
}, { addDisplayLabel: isPermScope.value ? 1 : void 0 });
|
|
188
|
+
if (res?.data) {
|
|
189
|
+
const newOptions = (res?.data ?? []).map((item) => ({
|
|
190
|
+
label: item.name_,
|
|
191
|
+
value: item.id_,
|
|
192
|
+
type: "data"
|
|
193
|
+
}));
|
|
194
|
+
state.totalPage = res.totalPage || 1;
|
|
195
|
+
state.hasMore = state.pageNo < state.totalPage;
|
|
196
|
+
if (resetPage) searchOptions.value = newOptions;
|
|
197
|
+
else searchOptions.value = [...searchOptions.value, ...newOptions];
|
|
198
|
+
} else searchOptions.value = [];
|
|
199
|
+
} catch (error) {
|
|
200
|
+
console.error("加载搜索数据失败:", error);
|
|
201
|
+
searchOptions.value = [];
|
|
202
|
+
state.hasMore = false;
|
|
203
|
+
} finally {
|
|
204
|
+
loading.value = false;
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
const onPopupScroll = throttle((e) => {
|
|
208
|
+
if (loading.value || loadingMore.value || !currentHasMore.value) return;
|
|
209
|
+
const target = e.target;
|
|
210
|
+
if (target.scrollHeight - target.scrollTop - target.clientHeight <= 30) loadMoreData();
|
|
211
|
+
}, 200);
|
|
212
|
+
const loadMoreData = async () => {
|
|
213
|
+
loadingMore.value = true;
|
|
214
|
+
try {
|
|
215
|
+
const state = isSearching.value ? paginationStates.value.search : paginationStates.value.initial;
|
|
216
|
+
state.pageNo += 1;
|
|
217
|
+
if (isSearching.value) await fetchSearchData(lastSearchValue.value, false);
|
|
218
|
+
else await fetchInitialData(false);
|
|
219
|
+
} catch (error) {
|
|
220
|
+
console.error("加载更多数据失败:", error);
|
|
221
|
+
} finally {
|
|
222
|
+
loadingMore.value = false;
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
const debouncedSearch = debounce((val) => {
|
|
226
|
+
lastSearchValue.value = val.trim();
|
|
227
|
+
if (lastSearchValue.value) fetchSearchData(lastSearchValue.value, true);
|
|
228
|
+
}, DEBOUNCE_TIME);
|
|
229
|
+
const onSearch = (val) => {
|
|
230
|
+
if (isPermScope.value) return;
|
|
231
|
+
debouncedSearch(val);
|
|
232
|
+
};
|
|
233
|
+
const onClear = () => {
|
|
234
|
+
lastSearchValue.value = "";
|
|
235
|
+
};
|
|
236
|
+
function getOmittedText(omitted) {
|
|
237
|
+
return omitted.map((v) => v && v.label ? v.label : String(v)).join(", ");
|
|
238
|
+
}
|
|
239
|
+
return (_ctx, _cache) => {
|
|
240
|
+
const _component_a_tooltip = resolveComponent("a-tooltip");
|
|
241
|
+
const _component_a_select = resolveComponent("a-select");
|
|
242
|
+
return openBlock(), createBlock(_component_a_select, mergeProps({
|
|
243
|
+
value: __props.value,
|
|
244
|
+
options: displayOptions.value,
|
|
245
|
+
loading: loading.value && isFirstPage.value
|
|
246
|
+
}, separatorAttr.value, {
|
|
247
|
+
onSearch,
|
|
248
|
+
onClear,
|
|
249
|
+
onPopupScroll: unref(onPopupScroll)
|
|
250
|
+
}), {
|
|
251
|
+
maxTagPlaceholder: withCtx((omittedValues) => [createVNode(_component_a_tooltip, { title: getOmittedText(omittedValues) }, {
|
|
252
|
+
default: withCtx(() => [createElementVNode("span", null, "+" + toDisplayString(omittedValues?.length), 1)]),
|
|
253
|
+
_: 2
|
|
254
|
+
}, 1032, ["title"])]),
|
|
255
|
+
_: 1
|
|
256
|
+
}, 16, [
|
|
257
|
+
"value",
|
|
258
|
+
"options",
|
|
259
|
+
"loading",
|
|
260
|
+
"onPopupScroll"
|
|
261
|
+
]);
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
//#endregion
|
|
266
|
+
export { ndo_select_cmp_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { LocalFieldMetaDTO } from '../typing';
|
|
2
|
+
export interface Props {
|
|
3
|
+
data: IObject;
|
|
4
|
+
/** 字段列表 | 模型列表 */
|
|
5
|
+
fieldList?: LocalFieldMetaDTO[];
|
|
6
|
+
/** 已经选择的字段key */
|
|
7
|
+
selectFiledKeys?: string[];
|
|
8
|
+
filterType?: string;
|
|
9
|
+
readonly: boolean;
|
|
10
|
+
isPageDesigner?: boolean;
|
|
11
|
+
isAllowClear?: boolean;
|
|
12
|
+
excludeValueType?: string[];
|
|
13
|
+
excludeOperatorType?: string[];
|
|
14
|
+
apiConfig?: object;
|
|
15
|
+
modelName?: string;
|
|
16
|
+
/**是否级联字段模式 */
|
|
17
|
+
cascadeField?: boolean;
|
|
18
|
+
/**数据权限时-是否开启校验 */
|
|
19
|
+
hasPermScopeError?: boolean;
|
|
20
|
+
}
|
|
21
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import _plugin_vue_export_helper_default from "../../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
2
|
+
import perm_action_node_vue_vue_type_script_setup_true_name_perm_action_node_lang_default from "./perm-action-node.vue_vue_type_script_setup_true_name_perm-action-node_lang.mjs";
|
|
3
|
+
import './perm-action-node.vue_vue_type_style_index_0_scoped_417c660f_lang.css';/* empty css */
|
|
4
|
+
//#region src/modules/data-rules-container/src/components/perm-action-node.vue
|
|
5
|
+
var perm_action_node_default = /* @__PURE__ */ _plugin_vue_export_helper_default(perm_action_node_vue_vue_type_script_setup_true_name_perm_action_node_lang_default, [["__scopeId", "data-v-417c660f"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { perm_action_node_default as default };
|