@kp-ui/lowcode-pc-v2 0.0.1 → 0.0.3
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/_virtual/virtual_svg-icons-register.js +21 -0
- package/core/src/components/common/render/LowcodeRenderProvider.vue_vue_type_script_setup_true_lang.js +3 -5
- package/core/src/components/common/render/RenderWidgetList.vue_vue_type_script_setup_true_lang.js +3 -5
- package/core/src/components/common/render/usePageContext.js +25 -30
- package/core/src/hooks/useAppRef.js +5 -4
- package/core/src/hooks/useFactoryRender.js +4 -2
- package/core/src/hooks/useField.js +24 -40
- package/core/src/hooks/useLowcode.js +64 -89
- package/core/src/hooks/useRemoteData.js +35 -41
- package/core/src/hooks/useSelect.js +4 -2
- package/core/src/utils/i18n.js +1 -15
- package/core/src/utils/smart-vue-i18n/index.js +38 -39
- package/install.js +1 -1
- package/package.json +1 -1
- package/src/components/public/ActionButtonListRender.vue_vue_type_script_lang.js +26 -32
- package/src/components/public/ConfigView/CustomPageRender.vue_vue_type_script_setup_true_lang.js +7 -7
- package/src/components/public/CustomerModal/CustomerModal.vue_vue_type_script_setup_true_lang.js +13 -24
- package/src/components/public/CustomerModal/useCustomerModal.js +6 -7
- package/src/components/public/DataTableColumnDialog.vue_vue_type_script_setup_true_name_DataTableColumnDialog_lang.js +36 -38
- package/src/hooks/useTableWidget.js +39 -44
- package/src/render/index.vue_vue_type_script_setup_true_lang.js +9 -6
- package/src/widgets/advanced/code-editor/index.vue_vue_type_script_setup_true_lang.js +4 -6
- package/src/widgets/advanced/code-editor/schema.js +8 -8
- package/src/widgets/advanced/custom-render/index.vue_vue_type_script_setup_true_lang.js +4 -6
- package/src/widgets/advanced/custom-render/schema.js +7 -5
- package/src/widgets/advanced/data-table/index.vue_vue_type_script_setup_true_lang.js +7 -7
- package/src/widgets/advanced/data-table/schema.js +3 -3
- package/src/widgets/advanced/file-upload/index.vue_vue_type_script_setup_true_lang.js +35 -37
- package/src/widgets/advanced/file-upload/schema.js +11 -8
- package/src/widgets/advanced/rich-editor/index.vue_vue_type_script_setup_true_lang.js +4 -6
- package/src/widgets/advanced/rich-editor/schema.js +10 -9
- package/src/widgets/advanced/tree/index.vue_vue_type_script_setup_true_lang.js +4 -6
- package/src/widgets/advanced/tree/schema.js +11 -8
- package/src/widgets/advanced/tree-select/index.vue_vue_type_script_setup_true_lang.js +6 -7
- package/src/widgets/advanced/tree-select/schema.js +11 -10
- package/src/widgets/base/button/index.vue_vue_type_script_setup_true_lang.js +7 -6
- package/src/widgets/base/button/schema.js +0 -1
- package/src/widgets/base/button-list/index.vue_vue_type_script_setup_true_lang.js +3 -5
- package/src/widgets/base/button-list/schema.js +0 -1
- package/src/widgets/base/cascader/index.vue_vue_type_script_setup_true_lang.js +8 -8
- package/src/widgets/base/cascader/schema.js +9 -9
- package/src/widgets/base/checkbox/index.vue_vue_type_script_setup_true_lang.js +4 -6
- package/src/widgets/base/checkbox/schema.js +9 -9
- package/src/widgets/base/color/index.vue_vue_type_script_setup_true_lang.js +4 -6
- package/src/widgets/base/color/schema.js +7 -7
- package/src/widgets/base/date/index.vue_vue_type_script_setup_true_lang.js +5 -7
- package/src/widgets/base/date/schema.js +8 -8
- package/src/widgets/base/date-range/index.vue_vue_type_script_setup_true_lang.js +5 -7
- package/src/widgets/base/date-range/schema.js +8 -8
- package/src/widgets/base/divider/index.vue_vue_type_script_setup_true_lang.js +3 -5
- package/src/widgets/base/divider/schema.js +0 -1
- package/src/widgets/base/html/index.vue_vue_type_script_setup_true_lang.js +3 -5
- package/src/widgets/base/html/schema.js +6 -6
- package/src/widgets/base/input/index.vue_vue_type_script_setup_true_lang.js +12 -18
- package/src/widgets/base/input/schema.js +11 -8
- package/src/widgets/base/number/index.vue_vue_type_script_setup_true_lang.js +8 -7
- package/src/widgets/base/number/schema.js +8 -8
- package/src/widgets/base/radio/index.vue_vue_type_script_setup_true_lang.js +4 -6
- package/src/widgets/base/radio/schema.js +9 -9
- package/src/widgets/base/rate/index.vue_vue_type_script_setup_true_lang.js +4 -6
- package/src/widgets/base/rate/schema.js +8 -8
- package/src/widgets/base/select/index.vue_vue_type_script_setup_true_lang.js +17 -20
- package/src/widgets/base/select/schema.js +12 -9
- package/src/widgets/base/slider/index.vue_vue_type_script_setup_true_lang.js +5 -7
- package/src/widgets/base/slider/schema.js +7 -7
- package/src/widgets/base/static-text/index.vue_vue_type_script_setup_true_lang.js +3 -5
- package/src/widgets/base/static-text/schema.js +0 -1
- package/src/widgets/base/switch/index.vue_vue_type_script_setup_true_lang.js +5 -7
- package/src/widgets/base/switch/schema.js +7 -7
- package/src/widgets/base/textarea/index.vue_vue_type_script_setup_true_lang.js +8 -7
- package/src/widgets/base/textarea/schema.js +8 -8
- package/src/widgets/base/time/index.vue_vue_type_script_setup_true_lang.js +7 -8
- package/src/widgets/base/time/schema.js +8 -8
- package/src/widgets/base/time-range/index.vue_vue_type_script_setup_true_lang.js +8 -7
- package/src/widgets/base/time-range/schema.js +8 -8
- package/src/widgets/containers/box/index-render.vue_vue_type_script_setup_true_lang.js +4 -6
- package/src/widgets/containers/box/schema.js +0 -1
- package/src/widgets/containers/collapse/index-render.vue_vue_type_script_setup_true_lang.js +4 -6
- package/src/widgets/containers/collapse/schema.js +0 -1
- package/src/widgets/containers/dialog/index-render.vue_vue_type_script_setup_true_lang.js +19 -35
- package/src/widgets/containers/dialog/schema.js +0 -1
- package/src/widgets/containers/form/index-render.vue_vue_type_script_setup_true_lang.js +4 -6
- package/src/widgets/containers/form/schema.js +6 -6
- package/src/widgets/containers/grid/index-render.vue_vue_type_script_setup_true_lang.js +3 -5
- package/src/widgets/containers/grid/schema.js +0 -1
- package/src/widgets/containers/grid-col/index-render.vue_vue_type_script_setup_true_lang.js +3 -5
- package/src/widgets/containers/grid-col/schema.js +0 -1
- package/src/widgets/containers/list/index-render.vue_vue_type_script_setup_true_lang.js +36 -53
- package/src/widgets/containers/list/schema.js +3 -3
- package/src/widgets/containers/space/index-render.vue_vue_type_script_setup_true_lang.js +4 -6
- package/src/widgets/containers/tab/index-render.vue_vue_type_script_setup_true_lang.js +11 -19
- package/src/widgets/containers/tab/schema.js +0 -1
- package/src/widgets/containers/tab-pane/index-render.vue_vue_type_script_setup_true_lang.js +3 -5
- package/src/widgets/containers/tab-pane/schema.js +0 -1
- package/src/widgets/template/SecondaryPage/index-render.vue_vue_type_script_setup_true_lang.js +4 -6
- package/src/widgets/template/SecondaryPage/schema.js +0 -1
- package/src/widgets/wrapper/form-item-wrapper.vue_vue_type_script_setup_true_lang.js +3 -3
- package/stats.html +1 -1
|
@@ -2,7 +2,6 @@ import { usePagination } from "./usePagination.js";
|
|
|
2
2
|
import { computed, ref, watch } from "vue";
|
|
3
3
|
import { useExecFunction } from "tmgc2-share";
|
|
4
4
|
import { debounce } from "lodash-es";
|
|
5
|
-
import _asyncToGenerator from "@oxc-project/runtime/helpers/asyncToGenerator";
|
|
6
5
|
//#region ../core/src/hooks/useRemoteData.ts
|
|
7
6
|
function useRemoteData({ widget, onLoaded, formConfig }) {
|
|
8
7
|
var _widget$dataSource;
|
|
@@ -38,50 +37,45 @@ function useRemoteData({ widget, onLoaded, formConfig }) {
|
|
|
38
37
|
totalPage: 0
|
|
39
38
|
});
|
|
40
39
|
};
|
|
41
|
-
const loadData =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
const loadData = async () => {
|
|
41
|
+
if (!isRemote.value) {
|
|
42
|
+
data.value = dataSource.value.data || [];
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (loading.value) return;
|
|
46
|
+
loading.value = true;
|
|
47
|
+
if (pagination.value.current === 1) initPager();
|
|
48
|
+
try {
|
|
49
|
+
if (!httpMethod.value) {
|
|
50
|
+
loading.value = false;
|
|
45
51
|
return;
|
|
46
52
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
pageSize: pagination.value.pageSize
|
|
59
|
-
} : {};
|
|
60
|
-
const result = yield execHttpFunction({
|
|
61
|
-
http,
|
|
62
|
-
dataHandlerCode,
|
|
63
|
-
dataReqHandlerCode
|
|
64
|
-
}, { data: params });
|
|
65
|
-
if (!result) {
|
|
66
|
-
loading.value = false;
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
if (loadingPage.value) {
|
|
70
|
-
pagination.value.total = result.total || 0;
|
|
71
|
-
pagination.value.totalPage = result.totalPage || 0;
|
|
72
|
-
}
|
|
73
|
-
data.value = result.list;
|
|
74
|
-
onLoaded === null || onLoaded === void 0 || onLoaded(result);
|
|
75
|
-
} catch (err) {
|
|
76
|
-
console.error("remote data load error:", err);
|
|
77
|
-
} finally {
|
|
53
|
+
const { dataHandlerCode, dataReqHandlerCode, http } = httpMethod.value;
|
|
54
|
+
const params = loadingPage.value ? {
|
|
55
|
+
page: pagination.value.current,
|
|
56
|
+
pageSize: pagination.value.pageSize
|
|
57
|
+
} : {};
|
|
58
|
+
const result = await execHttpFunction({
|
|
59
|
+
http,
|
|
60
|
+
dataHandlerCode,
|
|
61
|
+
dataReqHandlerCode
|
|
62
|
+
}, { data: params });
|
|
63
|
+
if (!result) {
|
|
78
64
|
loading.value = false;
|
|
65
|
+
return;
|
|
79
66
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
67
|
+
if (loadingPage.value) {
|
|
68
|
+
pagination.value.total = result.total || 0;
|
|
69
|
+
pagination.value.totalPage = result.totalPage || 0;
|
|
70
|
+
}
|
|
71
|
+
data.value = result.list;
|
|
72
|
+
onLoaded === null || onLoaded === void 0 || onLoaded(result);
|
|
73
|
+
} catch (err) {
|
|
74
|
+
console.error("remote data load error:", err);
|
|
75
|
+
} finally {
|
|
76
|
+
loading.value = false;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
85
79
|
const loadMore = debounce(() => {
|
|
86
80
|
if (pagination.value.totalPage === pagination.value.current) return;
|
|
87
81
|
pagination.value.current += 1;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useRemoteData } from "./useRemoteData.js";
|
|
2
2
|
import { computed, ref, unref } from "vue";
|
|
3
|
-
import _objectSpread from "@oxc-project/runtime/helpers/objectSpread2";
|
|
4
3
|
import { cloneDeep, isArray } from "lodash-es";
|
|
5
4
|
//#region ../core/src/hooks/useSelect.ts
|
|
6
5
|
function findInArray(arrayObject, element) {
|
|
@@ -16,7 +15,10 @@ function useSelect({ widget, designState, fieldModel, formConfig }) {
|
|
|
16
15
|
const apiResult = ref({ list: [] });
|
|
17
16
|
const onLoaded = (result) => {
|
|
18
17
|
const data = result.data || {};
|
|
19
|
-
if (data) apiResult.value = isArray(data) ? { list: [...unref(apiResult).list, ...data] } :
|
|
18
|
+
if (data) apiResult.value = isArray(data) ? { list: [...unref(apiResult).list, ...data] } : {
|
|
19
|
+
...data,
|
|
20
|
+
list: [...unref(apiResult).list, ...data.list]
|
|
21
|
+
};
|
|
20
22
|
};
|
|
21
23
|
const { loadData, loadMore, refresh, data, pager, loading } = useRemoteData({
|
|
22
24
|
widget,
|
package/core/src/utils/i18n.js
CHANGED
|
@@ -1,23 +1,9 @@
|
|
|
1
1
|
import { createI18n } from "./smart-vue-i18n/index.js";
|
|
2
|
-
import _objectSpread from "@oxc-project/runtime/helpers/objectSpread2";
|
|
3
2
|
import { mapActions, mapState } from "pinia";
|
|
4
|
-
import _asyncToGenerator from "@oxc-project/runtime/helpers/asyncToGenerator";
|
|
5
3
|
import { useLocaleStore } from "@kp-ui/i18n";
|
|
6
4
|
//#region ../core/src/utils/i18n.ts
|
|
7
5
|
var i18n = createI18n({ locale: "zh-CN" });
|
|
8
|
-
|
|
9
|
-
changeLocale(langName) {
|
|
10
|
-
return _asyncToGenerator(function* () {
|
|
11
|
-
yield i18n.setLang(langName);
|
|
12
|
-
})();
|
|
13
|
-
},
|
|
14
|
-
i18nt(key) {
|
|
15
|
-
return i18n.$st(key);
|
|
16
|
-
},
|
|
17
|
-
i18n2t(key1, key2) {
|
|
18
|
-
return i18n.$st2(key1, key2);
|
|
19
|
-
}
|
|
20
|
-
});
|
|
6
|
+
({ ...mapState(useLocaleStore, ["getLocale"]) }), { ...mapActions(useLocaleStore, ["setLocale"]) };
|
|
21
7
|
function useI18n$1() {
|
|
22
8
|
const i18nt = (key, obj) => {
|
|
23
9
|
return i18n.$st(key, obj);
|
|
@@ -1,41 +1,39 @@
|
|
|
1
1
|
import { reactive } from "vue";
|
|
2
|
-
import _objectSpread from "@oxc-project/runtime/helpers/objectSpread2";
|
|
3
2
|
import { get, isObject } from "lodash-es";
|
|
4
|
-
import _asyncToGenerator from "@oxc-project/runtime/helpers/asyncToGenerator";
|
|
5
3
|
//#region ../core/src/utils/smart-vue-i18n/index.ts
|
|
6
4
|
var locale = reactive({
|
|
7
5
|
lang: "zh-CN",
|
|
8
6
|
messages: {}
|
|
9
7
|
});
|
|
10
8
|
var langLoaders = {
|
|
11
|
-
"zh-CN":
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
9
|
+
"zh-CN": async () => {
|
|
10
|
+
const [zhCN, zhLocale, zhLocale_render, zhLocale_extension] = await Promise.all([
|
|
11
|
+
import("ant-design-vue/es/locale/zh_CN"),
|
|
12
|
+
import("../../lang/zh-CN.js"),
|
|
13
|
+
import("../../lang/zh-CN_render.js"),
|
|
14
|
+
import("../../lang/zh-CN_extension.js")
|
|
15
|
+
]);
|
|
16
|
+
return {
|
|
17
|
+
...zhCN.default,
|
|
18
|
+
...zhLocale.default,
|
|
19
|
+
...zhLocale_render.default,
|
|
20
|
+
...zhLocale_extension.default
|
|
23
21
|
};
|
|
24
|
-
}
|
|
25
|
-
"en-US":
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
22
|
+
},
|
|
23
|
+
"en-US": async () => {
|
|
24
|
+
const [enUS, enLocale, enLocale_render, enLocale_extension] = await Promise.all([
|
|
25
|
+
import("ant-design-vue/es/locale/en_US"),
|
|
26
|
+
import("../../lang/en-US.js"),
|
|
27
|
+
import("../../lang/en-US_render.js"),
|
|
28
|
+
import("../../lang/en-US_extension.js")
|
|
29
|
+
]);
|
|
30
|
+
return {
|
|
31
|
+
...enUS.default,
|
|
32
|
+
...enLocale.default,
|
|
33
|
+
...enLocale_render.default,
|
|
34
|
+
...enLocale_extension.default
|
|
37
35
|
};
|
|
38
|
-
}
|
|
36
|
+
}
|
|
39
37
|
};
|
|
40
38
|
function createI18n(options) {
|
|
41
39
|
return {
|
|
@@ -59,19 +57,20 @@ function createI18n(options) {
|
|
|
59
57
|
const message = get(messages, path);
|
|
60
58
|
return message !== null ? message : get(messages, path2);
|
|
61
59
|
},
|
|
62
|
-
setLang(lang) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
locale.lang = lang;
|
|
71
|
-
})();
|
|
60
|
+
async setLang(lang) {
|
|
61
|
+
locale.lang = lang;
|
|
62
|
+
if (!(lang in locale.messages)) locale.messages[lang] = {};
|
|
63
|
+
if (lang in langLoaders) {
|
|
64
|
+
const messages = await langLoaders[lang]();
|
|
65
|
+
locale.messages[lang] = messages;
|
|
66
|
+
}
|
|
67
|
+
locale.lang = lang;
|
|
72
68
|
},
|
|
73
69
|
setLangMessages(lang, messages) {
|
|
74
|
-
locale.messages[lang] =
|
|
70
|
+
locale.messages[lang] = {
|
|
71
|
+
...locale.messages[lang],
|
|
72
|
+
...messages
|
|
73
|
+
};
|
|
75
74
|
}
|
|
76
75
|
};
|
|
77
76
|
}
|
package/install.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import "./_virtual/virtual_svg-icons-register.js";
|
|
1
2
|
import render_default from "./src/render/index.js";
|
|
2
3
|
import CustomPageRender_default from "./src/components/public/ConfigView/CustomPageRender.js";
|
|
3
|
-
import "virtual:svg-icons-register";
|
|
4
4
|
import { VxeTooltip } from "vxe-pc-ui";
|
|
5
5
|
//#region install.ts
|
|
6
6
|
var createLowcode = ({ app, publicComponents }) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ButtonPositionEnum } from "../../../core/src/constants/index.js";
|
|
2
2
|
import { computed, defineComponent } from "vue";
|
|
3
3
|
import { SvgIcon, useExecFunction } from "tmgc2-share";
|
|
4
|
-
import _asyncToGenerator from "@oxc-project/runtime/helpers/asyncToGenerator";
|
|
5
4
|
//#region src/components/public/ActionButtonListRender.vue?vue&type=script&lang.ts
|
|
6
5
|
var ActionButtonListRender_vue_vue_type_script_lang_default = defineComponent({
|
|
7
6
|
name: "ActionButtonListRender",
|
|
@@ -53,37 +52,32 @@ var ActionButtonListRender_vue_vue_type_script_lang_default = defineComponent({
|
|
|
53
52
|
return isDisabled.value ? "body" : ((_props$options2 = props.options) === null || _props$options2 === void 0 ? void 0 : _props$options2.getContainer) || "body";
|
|
54
53
|
});
|
|
55
54
|
const visibleButtons = computed(() => props.buttonList.filter((item) => item.hidden !== 1).filter((item) => !handleHidden(item)));
|
|
56
|
-
const handleClick =
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
});
|
|
83
|
-
return function handleClick(_x) {
|
|
84
|
-
return _ref.apply(this, arguments);
|
|
85
|
-
};
|
|
86
|
-
}();
|
|
55
|
+
const handleClick = async (item) => {
|
|
56
|
+
if (props.designState) return;
|
|
57
|
+
if (!item.onClick) {
|
|
58
|
+
emit("on-click", {
|
|
59
|
+
item,
|
|
60
|
+
result: true
|
|
61
|
+
});
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (item.loading) return;
|
|
65
|
+
item.loading = true;
|
|
66
|
+
try {
|
|
67
|
+
emit("on-click", {
|
|
68
|
+
item,
|
|
69
|
+
result: await asyncExecuteFunction({
|
|
70
|
+
functionBody: item.onClick,
|
|
71
|
+
context: props.ctx,
|
|
72
|
+
params: props.scope
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
} catch (error) {
|
|
76
|
+
console.error("Button click handler error:", error);
|
|
77
|
+
} finally {
|
|
78
|
+
item.loading = false;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
87
81
|
const handleDisabled = (item) => {
|
|
88
82
|
if (!item.onDisabled) return false;
|
|
89
83
|
try {
|
package/src/components/public/ConfigView/CustomPageRender.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { useLowcode } from "../../../../core/src/hooks/useLowcode.js";
|
|
2
2
|
import render_default from "../../../render/index.js";
|
|
3
3
|
import { createElementBlock, createVNode, defineComponent, onMounted, openBlock, ref, unref } from "vue";
|
|
4
|
-
import _objectSpread from "@oxc-project/runtime/helpers/objectSpread2";
|
|
5
|
-
import _asyncToGenerator from "@oxc-project/runtime/helpers/asyncToGenerator";
|
|
6
4
|
import { getLocat } from "@kp-ui/tool";
|
|
7
5
|
//#region src/components/public/ConfigView/CustomPageRender.vue?vue&type=script&setup=true&lang.tsx
|
|
8
6
|
var _hoisted_1 = { class: "t-bg-[#fff] t-h-full" };
|
|
@@ -19,17 +17,19 @@ var CustomPageRender_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
19
17
|
anchorList.value = list;
|
|
20
18
|
};
|
|
21
19
|
const { vfdRef, formConfig, getPageJson, goBack } = useLowcode();
|
|
22
|
-
onMounted(
|
|
23
|
-
|
|
24
|
-
})
|
|
20
|
+
onMounted(async () => {
|
|
21
|
+
await getPageJson();
|
|
22
|
+
});
|
|
25
23
|
return (_ctx, _cache) => {
|
|
26
24
|
return openBlock(), createElementBlock("div", _hoisted_1, [createVNode(render_default, {
|
|
27
25
|
ref_key: "vfdRef",
|
|
28
26
|
ref: vfdRef,
|
|
29
|
-
vfCtx:
|
|
27
|
+
vfCtx: {
|
|
28
|
+
_id: unref(id),
|
|
29
|
+
...unref(getLocat)(),
|
|
30
30
|
goBack: unref(goBack),
|
|
31
31
|
setAnchorList
|
|
32
|
-
}
|
|
32
|
+
}
|
|
33
33
|
}, null, 8, ["vfCtx"])]);
|
|
34
34
|
};
|
|
35
35
|
}
|
package/src/components/public/CustomerModal/CustomerModal.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -3,10 +3,8 @@ import { useLowcode } from "../../../../core/src/hooks/useLowcode.js";
|
|
|
3
3
|
import ActionButtonListRender_default from "../ActionButtonListRender.js";
|
|
4
4
|
import render_default from "../../../render/index.js";
|
|
5
5
|
import { computed, createBlock, createVNode, defineComponent, mergeProps, nextTick, onMounted, openBlock, ref, unref, useAttrs, withCtx } from "vue";
|
|
6
|
-
import _objectSpread from "@oxc-project/runtime/helpers/objectSpread2";
|
|
7
6
|
import { Skeleton } from "ant-design-vue";
|
|
8
7
|
import { TpfConfigProvider, TpfModal } from "tmgc2-share";
|
|
9
|
-
import _asyncToGenerator from "@oxc-project/runtime/helpers/asyncToGenerator";
|
|
10
8
|
//#region src/components/public/CustomerModal/CustomerModal.vue?vue&type=script&setup=true&lang.tsx
|
|
11
9
|
var CustomerModal_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
12
10
|
__name: "CustomerModal",
|
|
@@ -30,10 +28,11 @@ var CustomerModal_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
30
28
|
const emit = __emit;
|
|
31
29
|
const vfCtx = computed(() => {
|
|
32
30
|
var _attrs$row;
|
|
33
|
-
return
|
|
31
|
+
return {
|
|
34
32
|
_id: (attrs === null || attrs === void 0 || (_attrs$row = attrs.row) === null || _attrs$row === void 0 || (_attrs$row = _attrs$row.record) === null || _attrs$row === void 0 ? void 0 : _attrs$row._id) || null,
|
|
35
|
-
type: props.type
|
|
36
|
-
|
|
33
|
+
type: props.type,
|
|
34
|
+
...attrs
|
|
35
|
+
};
|
|
37
36
|
});
|
|
38
37
|
const isDisabled = ref(false);
|
|
39
38
|
const { vfdRef, formConfig, getPageJson, isLoading } = useLowcode();
|
|
@@ -45,16 +44,11 @@ var CustomerModal_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
45
44
|
if (props.type === "view") return "查看";
|
|
46
45
|
return "新增";
|
|
47
46
|
});
|
|
48
|
-
const show =
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
});
|
|
54
|
-
return function show() {
|
|
55
|
-
return _ref.apply(this, arguments);
|
|
56
|
-
};
|
|
57
|
-
}();
|
|
47
|
+
const show = async () => {
|
|
48
|
+
visible.value = true;
|
|
49
|
+
await nextTick();
|
|
50
|
+
await getPageJson(props.formCode);
|
|
51
|
+
};
|
|
58
52
|
const setleftText = (number) => {
|
|
59
53
|
leftNum.value = number;
|
|
60
54
|
};
|
|
@@ -68,15 +62,10 @@ var CustomerModal_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
68
62
|
visible.value = false;
|
|
69
63
|
emit("cancel");
|
|
70
64
|
};
|
|
71
|
-
const handleButtonClick =
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
});
|
|
76
|
-
return function handleButtonClick(_x) {
|
|
77
|
-
return _ref2.apply(this, arguments);
|
|
78
|
-
};
|
|
79
|
-
}();
|
|
65
|
+
const handleButtonClick = async ({ item, result }) => {
|
|
66
|
+
if (item.name === "cancelButton") return handleCloseDialog();
|
|
67
|
+
if (result !== false) handleCloseDialog();
|
|
68
|
+
};
|
|
80
69
|
__expose({
|
|
81
70
|
handleCloseDialog,
|
|
82
71
|
i18nt,
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { createVNode, defineAsyncComponent, render } from "vue";
|
|
2
|
-
import _objectSpread from "@oxc-project/runtime/helpers/objectSpread2";
|
|
3
|
-
import _objectWithoutProperties from "@oxc-project/runtime/helpers/objectWithoutProperties";
|
|
4
2
|
//#region src/components/public/CustomerModal/useCustomerModal.tsx
|
|
5
|
-
var _excluded = ["type", "formCode"];
|
|
6
3
|
var openCustomerModal = (ops, app) => {
|
|
7
|
-
const { type, formCode
|
|
4
|
+
const { type, formCode, ...args } = ops;
|
|
8
5
|
const div = document.createElement("div");
|
|
9
6
|
document.body.appendChild(div);
|
|
10
7
|
const Com = defineAsyncComponent(() => import("./CustomerModal.js"));
|
|
@@ -12,10 +9,12 @@ var openCustomerModal = (ops, app) => {
|
|
|
12
9
|
render(null, div);
|
|
13
10
|
div.remove();
|
|
14
11
|
};
|
|
15
|
-
const vnode = createVNode(Com,
|
|
12
|
+
const vnode = createVNode(Com, {
|
|
16
13
|
type,
|
|
17
|
-
formCode
|
|
18
|
-
|
|
14
|
+
formCode,
|
|
15
|
+
...args,
|
|
16
|
+
onCancel: hide
|
|
17
|
+
});
|
|
19
18
|
vnode.appContext = app._context;
|
|
20
19
|
render(vnode, div);
|
|
21
20
|
};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { useTableColumnStore } from "../../../core/src/store/useTableColumnStore.js";
|
|
2
2
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeModels, normalizeClass, normalizeStyle, openBlock, ref, renderList, resolveComponent, toDisplayString, unref, useModel, watch, withCtx } from "vue";
|
|
3
|
-
import _objectSpread from "@oxc-project/runtime/helpers/objectSpread2";
|
|
4
3
|
import { message } from "ant-design-vue";
|
|
5
4
|
import { SvgIcon, TpfModal } from "tmgc2-share";
|
|
6
5
|
import draggable from "vuedraggable";
|
|
7
6
|
import { cloneDeep } from "lodash-es";
|
|
8
|
-
import _asyncToGenerator from "@oxc-project/runtime/helpers/asyncToGenerator";
|
|
9
7
|
import { useI18n } from "@kp-ui/i18n";
|
|
10
8
|
import { SearchOutlined } from "@ant-design/icons-vue";
|
|
11
9
|
import TpfDelConfirm$1 from "tmgc2-share/src/components/TpfModal/TpfDelConfirm";
|
|
@@ -26,7 +24,10 @@ var DataTableColumnDialog_vue_vue_type_script_setup_true_name_DataTableColumnDia
|
|
|
26
24
|
pageCode: { default: "" },
|
|
27
25
|
tableId: { default: "" }
|
|
28
26
|
}, {
|
|
29
|
-
"visible":
|
|
27
|
+
"visible": {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: false
|
|
30
|
+
},
|
|
30
31
|
"visibleModifiers": {}
|
|
31
32
|
}),
|
|
32
33
|
emits: /* @__PURE__ */ mergeModels(["update"], ["update:visible"]),
|
|
@@ -76,31 +77,32 @@ var DataTableColumnDialog_vue_vue_type_script_setup_true_name_DataTableColumnDia
|
|
|
76
77
|
const selectList = unref(rightShowColumns);
|
|
77
78
|
const unSelectList = [];
|
|
78
79
|
unref(initColumn).forEach((item) => {
|
|
79
|
-
if (!unref(selectList).some((it) => it.dataIndex === item.dataIndex)) unSelectList.push(
|
|
80
|
+
if (!unref(selectList).some((it) => it.dataIndex === item.dataIndex)) unSelectList.push({
|
|
81
|
+
...item,
|
|
82
|
+
visible: false
|
|
83
|
+
});
|
|
80
84
|
});
|
|
81
|
-
return [...selectList, ...unSelectList].map((item, index) =>
|
|
85
|
+
return [...selectList, ...unSelectList].map((item, index) => ({
|
|
86
|
+
...item,
|
|
87
|
+
displayOrdinal: index
|
|
88
|
+
}));
|
|
82
89
|
};
|
|
83
90
|
const restColum = () => {
|
|
84
91
|
tableColumns.value = cloneDeep(unref(initColumn));
|
|
85
92
|
getRightShowColumns();
|
|
86
93
|
updateCheckAll();
|
|
87
94
|
};
|
|
88
|
-
const restPageJson =
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
});
|
|
100
|
-
return function restPageJson() {
|
|
101
|
-
return _ref.apply(this, arguments);
|
|
102
|
-
};
|
|
103
|
-
}();
|
|
95
|
+
const restPageJson = async () => {
|
|
96
|
+
const storageKey = props.pageCode || props.tableId;
|
|
97
|
+
if (!storageKey) {
|
|
98
|
+
message.warning(t("lang.未配置 pageCode 或 tableId"));
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
await TpfDelConfirm$1({ content: t("lang.确定清除缓存记录吗") });
|
|
102
|
+
tableColumnStore.clearTableConfig(storageKey);
|
|
103
|
+
message.success(t("lang.清除成功"));
|
|
104
|
+
window.location.reload();
|
|
105
|
+
};
|
|
104
106
|
const onCancel = () => {
|
|
105
107
|
visible.value = false;
|
|
106
108
|
};
|
|
@@ -149,29 +151,25 @@ var DataTableColumnDialog_vue_vue_type_script_setup_true_name_DataTableColumnDia
|
|
|
149
151
|
if (storedColumnList.length === 0) return cloneDeep(props.columns);
|
|
150
152
|
return cloneDeep(props.columns).map((col) => {
|
|
151
153
|
const stored = storedColumnList.find((item) => item.dataIndex === col.dataIndex);
|
|
152
|
-
if (stored) return
|
|
154
|
+
if (stored) return {
|
|
155
|
+
...col,
|
|
153
156
|
visible: stored.visible !== false,
|
|
154
157
|
fixed: stored.fixed,
|
|
155
158
|
displayOrdinal: stored.displayOrdinal
|
|
156
|
-
}
|
|
159
|
+
};
|
|
157
160
|
return col;
|
|
158
161
|
});
|
|
159
162
|
};
|
|
160
|
-
watch(() => visible.value,
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
});
|
|
171
|
-
return function(_x) {
|
|
172
|
-
return _ref2.apply(this, arguments);
|
|
173
|
-
};
|
|
174
|
-
}(), { immediate: true });
|
|
163
|
+
watch(() => visible.value, async (val) => {
|
|
164
|
+
if (val) {
|
|
165
|
+
const columnsConfig = restoreColumnFromStorage();
|
|
166
|
+
tableColumns.value = columnsConfig;
|
|
167
|
+
initColumn.value = columnsConfig;
|
|
168
|
+
getRightShowColumns();
|
|
169
|
+
sortRightColumns();
|
|
170
|
+
updateCheckAll();
|
|
171
|
+
}
|
|
172
|
+
}, { immediate: true });
|
|
175
173
|
__expose({
|
|
176
174
|
open,
|
|
177
175
|
restColum
|