@kp-ui/lowcode-pc-v2 0.0.1 → 0.0.2
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/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 +497 -424
- 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/package.json +36 -36
- 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
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { ref } from "vue";
|
|
2
|
-
import _objectSpread from "@oxc-project/runtime/helpers/objectSpread2";
|
|
3
2
|
import { message } from "ant-design-vue";
|
|
4
3
|
import { http, routerReloadStatus, useDataQueryApi, useRouteBackTab } from "tmgc2-share";
|
|
5
4
|
import { cloneDeep } from "lodash-es";
|
|
6
|
-
import _asyncToGenerator from "@oxc-project/runtime/helpers/asyncToGenerator";
|
|
7
5
|
import { getLocat } from "@kp-ui/tool";
|
|
8
6
|
//#region ../core/src/hooks/useLowcode.ts
|
|
9
7
|
var defaultPageJson = {
|
|
@@ -12,7 +10,10 @@ var defaultPageJson = {
|
|
|
12
10
|
};
|
|
13
11
|
var pageJsonCache = /* @__PURE__ */ new Map();
|
|
14
12
|
var pageJsonRequestCache = /* @__PURE__ */ new Map();
|
|
15
|
-
var normalizePageJson = (json) =>
|
|
13
|
+
var normalizePageJson = (json) => ({
|
|
14
|
+
...defaultPageJson,
|
|
15
|
+
...json || {}
|
|
16
|
+
});
|
|
16
17
|
var getCachedPageJson = (formCode, useDataQuery) => {
|
|
17
18
|
const cached = pageJsonCache.get(formCode);
|
|
18
19
|
if (cached) return Promise.resolve(cached);
|
|
@@ -39,102 +40,76 @@ var useLowcode = (options = {}) => {
|
|
|
39
40
|
const formId = ref();
|
|
40
41
|
const formConfig = ref();
|
|
41
42
|
const { routeBackTab } = useRouteBackTab();
|
|
42
|
-
const getPageJson =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
(_vfdRef$value2 = vfdRef.value) === null || _vfdRef$value2 === void 0 || _vfdRef$value2.setLoading(false);
|
|
56
|
-
}
|
|
43
|
+
const getPageJson = async (formCode) => {
|
|
44
|
+
let json = cloneDeep(defaultPageJson);
|
|
45
|
+
formCode = formCode || options.formCode || getLocat().formCode;
|
|
46
|
+
if (formCode) {
|
|
47
|
+
var _vfdRef$value;
|
|
48
|
+
(_vfdRef$value = vfdRef.value) === null || _vfdRef$value === void 0 || _vfdRef$value.setLoading(true);
|
|
49
|
+
try {
|
|
50
|
+
const cache = await getCachedPageJson(formCode, useDataQuery);
|
|
51
|
+
json = cloneDeep(cache.json);
|
|
52
|
+
formId.value = cache.formId;
|
|
53
|
+
} finally {
|
|
54
|
+
var _vfdRef$value2;
|
|
55
|
+
(_vfdRef$value2 = vfdRef.value) === null || _vfdRef$value2 === void 0 || _vfdRef$value2.setLoading(false);
|
|
57
56
|
}
|
|
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
|
-
type: "EQ",
|
|
83
|
-
value: entityCode
|
|
84
|
-
}],
|
|
85
|
-
requiredFields: [
|
|
86
|
-
"entityPropertyCode",
|
|
87
|
-
"entityPropertyName",
|
|
88
|
-
"valueType"
|
|
89
|
-
],
|
|
90
|
-
page: 1,
|
|
91
|
-
pageSize: null,
|
|
92
|
-
sorts: []
|
|
93
|
-
};
|
|
94
|
-
return yield useDataQuery.execute(p).then((res) => res.data.object.list);
|
|
95
|
-
});
|
|
96
|
-
return function getFieldList(_x2) {
|
|
97
|
-
return _ref3.apply(this, arguments);
|
|
98
|
-
};
|
|
99
|
-
}();
|
|
100
|
-
const fieldListApi = function() {
|
|
101
|
-
var _ref4 = _asyncToGenerator(function* () {
|
|
102
|
-
return (yield getFieldList()).map((item) => ({
|
|
103
|
-
showName: item.entityPropertyName,
|
|
104
|
-
fieldCode: item.entityPropertyCode
|
|
105
|
-
}));
|
|
106
|
-
});
|
|
107
|
-
return function fieldListApi() {
|
|
108
|
-
return _ref4.apply(this, arguments);
|
|
57
|
+
}
|
|
58
|
+
isLoading.value = false;
|
|
59
|
+
formConfig.value = json.formConfig;
|
|
60
|
+
vfdRef.value.setFormJson(json);
|
|
61
|
+
return json;
|
|
62
|
+
};
|
|
63
|
+
const getComponentJson = async (..._args) => getPageJson(options.formCode);
|
|
64
|
+
const getFieldList = async (entityCode) => {
|
|
65
|
+
isLoading.value = true;
|
|
66
|
+
const p = {
|
|
67
|
+
pageCode: "EntityPropertyFormItem",
|
|
68
|
+
conditions: [{
|
|
69
|
+
fieldCode: "entityCode",
|
|
70
|
+
type: "EQ",
|
|
71
|
+
value: entityCode
|
|
72
|
+
}],
|
|
73
|
+
requiredFields: [
|
|
74
|
+
"entityPropertyCode",
|
|
75
|
+
"entityPropertyName",
|
|
76
|
+
"valueType"
|
|
77
|
+
],
|
|
78
|
+
page: 1,
|
|
79
|
+
pageSize: null,
|
|
80
|
+
sorts: []
|
|
109
81
|
};
|
|
110
|
-
|
|
82
|
+
return await useDataQuery.execute(p).then((res) => res.data.object.list);
|
|
83
|
+
};
|
|
84
|
+
const fieldListApi = async () => {
|
|
85
|
+
return (await getFieldList()).map((item) => ({
|
|
86
|
+
showName: item.entityPropertyName,
|
|
87
|
+
fieldCode: item.entityPropertyCode
|
|
88
|
+
}));
|
|
89
|
+
};
|
|
111
90
|
const goBack = (reloadStatus = routerReloadStatus.view, cb) => {
|
|
112
91
|
routeBackTab(reloadStatus, cb);
|
|
113
92
|
};
|
|
93
|
+
const saveJsonApi = async (json) => {
|
|
94
|
+
const { formCode } = getLocat();
|
|
95
|
+
const params = {
|
|
96
|
+
formCode,
|
|
97
|
+
formId: formId.value,
|
|
98
|
+
frontendDefinition: JSON.stringify(json)
|
|
99
|
+
};
|
|
100
|
+
await http.post(`/api/tmgc2-mgt/formDefinition/formDefinitionV2/save`, params);
|
|
101
|
+
if (formCode) pageJsonCache.set(formCode, {
|
|
102
|
+
formId: formId.value,
|
|
103
|
+
json: normalizePageJson(cloneDeep(json))
|
|
104
|
+
});
|
|
105
|
+
message.success("保存成功");
|
|
106
|
+
};
|
|
114
107
|
return {
|
|
115
108
|
isLoading,
|
|
116
109
|
goBack,
|
|
117
110
|
formConfig,
|
|
118
111
|
vfdRef,
|
|
119
|
-
saveJsonApi
|
|
120
|
-
var _ref5 = _asyncToGenerator(function* (json) {
|
|
121
|
-
const { formCode } = getLocat();
|
|
122
|
-
const params = {
|
|
123
|
-
formCode,
|
|
124
|
-
formId: formId.value,
|
|
125
|
-
frontendDefinition: JSON.stringify(json)
|
|
126
|
-
};
|
|
127
|
-
yield http.post(`/api/tmgc2-mgt/formDefinition/formDefinitionV2/save`, params);
|
|
128
|
-
if (formCode) pageJsonCache.set(formCode, {
|
|
129
|
-
formId: formId.value,
|
|
130
|
-
json: normalizePageJson(cloneDeep(json))
|
|
131
|
-
});
|
|
132
|
-
message.success("保存成功");
|
|
133
|
-
});
|
|
134
|
-
return function saveJsonApi(_x3) {
|
|
135
|
-
return _ref5.apply(this, arguments);
|
|
136
|
-
};
|
|
137
|
-
}(),
|
|
112
|
+
saveJsonApi,
|
|
138
113
|
getPageJson,
|
|
139
114
|
getComponentJson,
|
|
140
115
|
fieldListApi
|
|
@@ -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/package.json
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"name": "@kp-ui/lowcode-pc-v2",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public",
|
|
6
|
+
"registry": "https://registry.npmjs.org/"
|
|
7
|
+
},
|
|
8
|
+
"module": "index.js",
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"vxe-pc-ui": "4.10.29",
|
|
11
|
+
"vxe-table": "4.17.18",
|
|
12
|
+
"vuedraggable": "^4.0.0",
|
|
13
|
+
"bpmn-js": "13.2.0",
|
|
14
|
+
"vue-json-viewer": "^3.0.1",
|
|
15
|
+
"ant-design-vue": "4.2.6",
|
|
16
|
+
"query-string": "^6.14.1",
|
|
17
|
+
"dayjs": "^1.11.7",
|
|
18
|
+
"@kp-ui/tool": "2.14.1",
|
|
19
|
+
"tailwindcss": "3.4.9",
|
|
20
|
+
"vue": "3.5.17",
|
|
21
|
+
"vue-echarts": "^8.0.1",
|
|
22
|
+
"file-saver": "^2.0.5",
|
|
23
|
+
"echarts": "^5.6.0"
|
|
24
|
+
},
|
|
25
|
+
"main": "index.js",
|
|
26
|
+
"types": "types/pc/install.d.ts",
|
|
27
|
+
"sideEffects": [
|
|
28
|
+
"./assets/styles/*",
|
|
29
|
+
"./_virtual/*"
|
|
30
|
+
],
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"import": "./install.js",
|
|
34
|
+
"types": "./types/pc/install.d.ts"
|
|
7
35
|
},
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
"vxe-table": "4.17.18",
|
|
12
|
-
"vuedraggable": "^4.0.0",
|
|
13
|
-
"bpmn-js": "13.2.0",
|
|
14
|
-
"vue-json-viewer": "^3.0.1",
|
|
15
|
-
"ant-design-vue": "4.2.6",
|
|
16
|
-
"query-string": "^6.14.1",
|
|
17
|
-
"dayjs": "^1.11.7",
|
|
18
|
-
"@kp-ui/tool": "2.14.1",
|
|
19
|
-
"tailwindcss": "3.4.9",
|
|
20
|
-
"vue": "3.5.17",
|
|
21
|
-
"vue-echarts": "^8.0.1",
|
|
22
|
-
"file-saver": "^2.0.5",
|
|
23
|
-
"echarts": "^5.6.0"
|
|
24
|
-
},
|
|
25
|
-
"main": "index.js",
|
|
26
|
-
"types": "types/pc/install.d.ts",
|
|
27
|
-
"sideEffects": [
|
|
28
|
-
"./assets/styles/*",
|
|
29
|
-
"./_virtual/*"
|
|
30
|
-
],
|
|
31
|
-
"exports": {
|
|
32
|
-
".": {
|
|
33
|
-
"import": "./install.js",
|
|
34
|
-
"types": "./types/pc/install.d.ts"
|
|
35
|
-
},
|
|
36
|
-
"./style": "./assets/styles/style.css",
|
|
37
|
-
"./styles/*": "./assets/styles/*"
|
|
38
|
-
}
|
|
36
|
+
"./style": "./assets/styles/style.css",
|
|
37
|
+
"./styles/*": "./assets/styles/*"
|
|
38
|
+
}
|
|
39
39
|
}
|
|
@@ -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
|
}
|