@utogether/udp-core 1.0.0 → 1.0.1-beta.1

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.
Files changed (144) hide show
  1. package/build/plugins.ts +8 -2
  2. package/dist/{403-B1R-4vXw.js → 403-Dp617CWX.js} +9 -8
  3. package/dist/{404-fXPl8csw.js → 404-Cz_Axb6Y.js} +15 -14
  4. package/dist/{500-eI5842YB.js → 500-BGCtRNse.js} +11 -10
  5. package/dist/{AuthorityInfo-CfVH6PaB.js → AuthorityInfo-DGGfm7IS.js} +1 -1
  6. package/dist/{AuthorityInfo.vue_vue_type_style_index_0_lang-DbK-f8jH.js → AuthorityInfo.vue_vue_type_style_index_0_lang-BqccGW7v.js} +3 -3
  7. package/dist/{AuthorityPanel-BaLMwMgW.js → AuthorityPanel-BeBNiwqc.js} +1 -1
  8. package/dist/{AuthorityPanel.vue_vue_type_style_index_0_lang-C_bkqLD9.js → AuthorityPanel.vue_vue_type_style_index_0_lang-CIYmnP9-.js} +6 -6
  9. package/dist/{Company-CYC9Avfz.js → Company-IV3GTnzY.js} +3 -3
  10. package/dist/{CompanyPanel-B4MzoqN_.js → CompanyPanel-qV-_VtoL.js} +10 -10
  11. package/dist/{Department-B4BNSiYx.js → Department-B3W-OxW8.js} +3 -3
  12. package/dist/{DepartmentPanel-zJO89L2O.js → DepartmentPanel-Cw3OWxE7.js} +23 -23
  13. package/dist/{DesignPanel-S8P0J97f.js → DesignPanel-BFxR2fHJ.js} +1 -1
  14. package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-DW-_Vqrr.js → DesignPanel.vue_vue_type_style_index_0_lang-DljbeFba.js} +6 -6
  15. package/dist/{DictView-bIS5-rK-.js → DictView-C-i7e4hZ.js} +9 -9
  16. package/dist/InvOrganization-cfT6riGU.js +260 -0
  17. package/dist/{Org-kXHSjsgJ.js → Org-CA7vTDIF.js} +3 -3
  18. package/dist/{Preview-CRyiwUIR.js → Preview-BlDMmpdR.js} +1 -1
  19. package/dist/{ReportDefine-WZYIx8Sm.js → ReportDefine-Cub_85LA.js} +1 -1
  20. package/dist/{ReportDesign-D-7GKgpb.js → ReportDesign-hFhq5UVE.js} +10 -10
  21. package/dist/{ReportQuery-BIIJny6w.js → ReportQuery-ChkWEyxT.js} +5 -5
  22. package/dist/{ReportQueryFrom-OoUl7N2O.js → ReportQueryFrom-KVyD_8Dj.js} +1 -1
  23. package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-B878fgj8.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-CLNODquq.js} +6 -5
  24. package/dist/{ReportTemplate-Cfeq9US-.js → ReportTemplate-ag9NDvh2.js} +11 -11
  25. package/dist/{Role-BwTV2QMH.js → Role-_q3lQ8CZ.js} +3 -3
  26. package/dist/{RoleAssign-De1JjOun.js → RoleAssign-DZb9IRsm.js} +3 -3
  27. package/dist/{RolePanel-pUBXsqCM.js → RolePanel-BQb1LlhD.js} +1 -1
  28. package/dist/{RolePanel-E3RcdByM.js → RolePanel-CsLsz-Ds.js} +1 -1
  29. package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-B2pQwHb0.js → RolePanel.vue_vue_type_script_setup_true_lang-BrnRgHEk.js} +12 -12
  30. package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-CTIad9_Q.js → RolePanel.vue_vue_type_script_setup_true_lang-cmW7zBLu.js} +4 -4
  31. package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-vMR1fBi0.js → ScrollPanel.vue_vue_type_style_index_0_lang-CaFKRwXu.js} +8 -8
  32. package/dist/{Staff-Czm7A8vI.js → Staff-BSf9Ypbk.js} +3 -3
  33. package/dist/StaffInfo-BNKasyMF.js +4 -0
  34. package/dist/{StaffInfo.vue_vue_type_style_index_0_lang-DMTL7KCh.js → StaffInfo.vue_vue_type_script_setup_true_lang-DDZ7ukd0.js} +7 -7
  35. package/dist/{StaffPanel-CHk60LEz.js → StaffPanel-Bpq0WVlH.js} +1 -1
  36. package/dist/{StaffPanel.vue_vue_type_script_setup_true_lang-iPKLb5wG.js → StaffPanel.vue_vue_type_script_setup_true_lang-BhiJ0Q-Q.js} +46 -49
  37. package/dist/{SysUser-BGwbttRn.js → SysUser-FAABuNti.js} +2 -2
  38. package/dist/{SysUserPanel-BCbKoLKt.js → SysUserPanel-PxJeOgHm.js} +1 -1
  39. package/dist/{SysUserPanel.vue_vue_type_script_setup_true_lang-0QUjnhjF.js → SysUserPanel.vue_vue_type_script_setup_true_lang-njefUln5.js} +1 -2
  40. package/dist/{SystemMenu-BkqZSDKl.js → SystemMenu-C-7NAGon.js} +47 -45
  41. package/dist/{UserInfo-BsyAcT2d.js → UserInfo-ClXKtyGo.js} +1 -1
  42. package/dist/{UserInfo.vue_vue_type_style_index_0_lang-D0-KDxAh.js → UserInfo.vue_vue_type_style_index_0_lang-8N7P4Hl7.js} +13 -13
  43. package/dist/{childView-CyuLTUqC.js → childView-C_HmDQNd.js} +1 -1
  44. package/dist/{childView-CF83nhxb.js → childView-uUlBcTza.js} +1 -1
  45. package/dist/{childView.vue_vue_type_style_index_0_lang-CNSgGda3.js → childView.vue_vue_type_style_index_0_lang-Ckjmw6wJ.js} +6 -6
  46. package/dist/{childView.vue_vue_type_style_index_0_lang-Cch4lE-i.js → childView.vue_vue_type_style_index_0_lang-y0sDvYx5.js} +1 -1
  47. package/dist/{code-rule-Bz-gnktN.js → code-rule-AgCVDKFy.js} +6 -6
  48. package/dist/core.es.js +4 -4
  49. package/dist/{cron-task-CIifSUdW.js → cron-task-C6FgQxTi.js} +11 -11
  50. package/dist/{frameView-_d2mqjjQ.js → frameView-BDgISK7N.js} +15 -14
  51. package/dist/index-DzOzUkf6.js +3388 -0
  52. package/dist/{layoutView-DLKVepB8.js → layoutView-yb3DV2DQ.js} +658 -653
  53. package/dist/{login-LREiDfFU.js → login-RRpljbkm.js} +26 -25
  54. package/dist/{lov-view-DDrIVILB.js → lov-view-C9-rjzZR.js} +5 -5
  55. package/dist/{menuInfo-B1FUV-Sk.js → menuInfo-CzPQyFhp.js} +1 -1
  56. package/dist/{menuInfo.vue_vue_type_style_index_0_lang-Cnk3vdtD.js → menuInfo.vue_vue_type_style_index_0_lang-BumXunCg.js} +17 -17
  57. package/dist/pda-app-Dvy3U-b6.js +696 -0
  58. package/dist/redirect-BqegffKC.js +15 -0
  59. package/dist/{resource-BCwx9fEv.js → resource-Fy0lFkSV.js} +7 -7
  60. package/dist/{su-welcome-189A7N4r.js → su-welcome-DYvSCUST.js} +41 -40
  61. package/dist/{sys-config-BZ3sejow.js → sys-config-DJ1vNQTy.js} +18 -18
  62. package/dist/udp-core.css +2 -2
  63. package/dist/{utogether-r08LNiIZ.js → utogether-CjmJiHoE.js} +6 -6
  64. package/package.json +4 -2
  65. package/src/App.vue +3 -3
  66. package/src/components/udp/form-upload.vue +132 -0
  67. package/src/components/udp/index.ts +4 -0
  68. package/src/components/udp/modal-form.vue +180 -0
  69. package/src/components/udp/utils.ts +40 -0
  70. package/src/main.ts +5 -4
  71. package/src/plugins/vxe-table/index.ts +3 -3
  72. package/src/plugins/vxe-table/render.tsx +604 -184
  73. package/src/utils/udp/useRender.ts +420 -0
  74. package/src/views/organization/inv-org/InvOrganization.vue +2 -1
  75. package/src/views/organization/staff/StaffInfo.vue +0 -30
  76. package/src/views/organization/staff/StaffPanel.vue +4 -3
  77. package/src/views/system/menu/AuthorityPanel.vue +2 -2
  78. package/src/views/system/menu/SystemMenu.vue +9 -3
  79. package/src/views/system/menu/menuInfo.vue +6 -3
  80. package/src/views/system/role/AuthorityInfo.vue +1 -19
  81. package/src/views/system/sysUser/SysUserPanel.vue +1 -1
  82. package/src/views/udev/dict/DictView.vue +2 -2
  83. package/src/views/uhome/components/menu-favorite.vue +1 -1
  84. package/src/views/uhome/su-welcome.vue +1 -1
  85. package/src/views/ulogin/login.vue +1 -1
  86. package/types/global.d.ts +0 -1
  87. package/vite.config.ts +9 -2
  88. package/dist/InvOrganization-MuM2jtsG.js +0 -66
  89. package/dist/StaffInfo-DJzvBuxy.js +0 -4
  90. package/dist/core.umd.js +0 -173
  91. package/dist/index-BKIw8tSn.js +0 -9195
  92. package/dist/pda-app-CRhVGijN.js +0 -2209
  93. package/dist/redirect-DiaNDu8F.js +0 -15
  94. package/src/assets/images/empty.png +0 -0
  95. package/src/assets/images/logo.png +0 -0
  96. package/src/components/ReCountTo/README.md +0 -2
  97. package/src/components/ReCountTo/index.ts +0 -18
  98. package/src/components/ReCountTo/src/normal/index.tsx +0 -165
  99. package/src/components/ReCountTo/src/normal/props.ts +0 -37
  100. package/src/components/ReCountTo/src/rebound/index.tsx +0 -67
  101. package/src/components/ReCountTo/src/rebound/props.ts +0 -14
  102. package/src/components/ReCountTo/src/rebound/rebound.css +0 -77
  103. package/src/components/ReCropper/index.ts +0 -14
  104. package/src/components/ReCropper/src/index.tsx +0 -141
  105. package/src/components/ReFlicker/index.css +0 -39
  106. package/src/components/ReFlicker/index.ts +0 -50
  107. package/src/components/ReFlop/index.ts +0 -14
  108. package/src/components/ReFlop/src/Filpper.tsx +0 -99
  109. package/src/components/ReFlop/src/filpper.css +0 -184
  110. package/src/components/ReFlop/src/index.vue +0 -126
  111. package/src/components/ReFlowChart/index.ts +0 -24
  112. package/src/components/ReFlowChart/src/Control.vue +0 -139
  113. package/src/components/ReFlowChart/src/DataDialog.vue +0 -12
  114. package/src/components/ReFlowChart/src/NodePanel.vue +0 -151
  115. package/src/components/ReFlowChart/src/adpterForTurbo.ts +0 -160
  116. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.css +0 -49
  117. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.eot +0 -0
  118. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.js +0 -61
  119. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.json +0 -58
  120. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.svg +0 -47
  121. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.ttf +0 -0
  122. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.woff +0 -0
  123. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.woff2 +0 -0
  124. package/src/components/ReFlowChart/src/config.ts +0 -62
  125. package/src/components/ReSplitPane/index.css +0 -49
  126. package/src/components/ReSplitPane/index.tsx +0 -119
  127. package/src/components/ReSplitPane/resizer.css +0 -45
  128. package/src/components/ReSplitPane/resizer.tsx +0 -30
  129. package/src/components/SuCommon/card/components/Card.vue +0 -148
  130. package/src/components/SuCommon/card/components/DialogForm.vue +0 -127
  131. package/src/components/SuCommon/card/index.vue +0 -142
  132. package/src/components/SuCommon/icon-select/index.vue +0 -241
  133. package/src/components/SuCommon/table/index.vue +0 -208
  134. package/src/components/SuCommon/utils/index.ts +0 -103
  135. package/src/components/SuCommon/utils/slot.tsx +0 -50
  136. package/src/views/components/contextmenu/basic.vue +0 -74
  137. package/src/views/components/contextmenu/context-menu.vue +0 -40
  138. package/src/views/components/contextmenu/menuDynamic.vue +0 -99
  139. package/src/views/components/contextmenu/menuGroup.vue +0 -71
  140. package/src/views/components/count-to/index.vue +0 -43
  141. package/src/views/components/cropping/index.vue +0 -59
  142. package/src/views/components/cropping/picture.jpeg +0 -0
  143. package/src/views/components/split-pane/index.vue +0 -82
  144. package/src/views/components/video/index.vue +0 -57
@@ -1,11 +1,11 @@
1
1
  import { computed as W, ref as L } from "vue";
2
- import { useGlobal as E, storageLocal as u, deviceDetection as H, cookies as C, storageSession as M } from "@utogether/utils";
3
- import { C as P, m as g, s as j, g as h, x as d, D as J, n as K, o as R, p as V, d as S, r as G, q as O, E as x, G as Z } from "./index-BKIw8tSn.js";
2
+ import { useGlobal as g, storageLocal as u, deviceDetection as H, cookies as C, storageSession as M } from "@utogether/utils";
3
+ import { y as P, j as E, s as j, g as h, v as d, z as J, l as K, m as R, n as V, u as S, r as G, o as O, A as x, B as Z } from "./index-DzOzUkf6.js";
4
4
  import { useI18n as f } from "vue-i18n";
5
5
  import { defineStore as v } from "pinia";
6
6
  function I() {
7
- const { $storage: t, $config: e } = E(), r = () => {
8
- P().multiTagsCache && (!t.tags || t.tags.length === 0) && (t.tags = g), t != null && t.locale || (f().locale.value = (e == null ? void 0 : e.Locale) ?? "zh"), t && !(t != null && t.layout) && (t.layout = {
7
+ const { $storage: t, $config: e } = g(), r = () => {
8
+ P().multiTagsCache && (!t.tags || t.tags.length === 0) && (t.tags = E), t != null && t.locale || (f().locale.value = (e == null ? void 0 : e.Locale) ?? "zh"), t && !(t != null && t.layout) && (t.layout = {
9
9
  layout: (e == null ? void 0 : e.Layout) ?? "vertical",
10
10
  theme: (e == null ? void 0 : e.Theme) ?? "default",
11
11
  darkMode: (e == null ? void 0 : e.DarkMode) ?? !1,
@@ -116,7 +116,7 @@ function $() {
116
116
  { color: "#eb2f96", themeColor: "pink" },
117
117
  /* 深紫罗兰色 */
118
118
  { color: "#722ed1", themeColor: "saucePurple" }
119
- ]), { $storage: s } = E(), m = L((T = s == null ? void 0 : s.layout) == null ? void 0 : T.darkMode), y = L((D = s == null ? void 0 : s.layout) == null ? void 0 : D.overallStyle), w = document.documentElement;
119
+ ]), { $storage: s } = g(), m = L((T = s == null ? void 0 : s.layout) == null ? void 0 : T.darkMode), y = L((D = s == null ? void 0 : s.layout) == null ? void 0 : D.overallStyle), w = document.documentElement;
120
120
  function p(a, l, o) {
121
121
  const i = o || document.body;
122
122
  let { className: n } = i;
@@ -157,7 +157,7 @@ function $() {
157
157
  function B() {
158
158
  C.remove(K), C.remove(R), C.remove(V), u.clear(), M.clear();
159
159
  const { Grey: a, Weak: l, MultiTagsCache: o, EpThemeColor: i, Layout: n } = h();
160
- X().setLayout(n), c(i), S().multiTagsCacheChange(o), p(a, "html-grey", document.querySelector("html")), p(l, "html-weakness", document.querySelector("html")), G.push("/login"), S().handleTags("equal", [...g]), O();
160
+ X().setLayout(n), c(i), S().multiTagsCacheChange(o), p(a, "html-grey", document.querySelector("html")), p(l, "html-weakness", document.querySelector("html")), G.push("/login"), S().handleTags("equal", [...E]), O();
161
161
  }
162
162
  return {
163
163
  body: w,
package/package.json CHANGED
@@ -1,14 +1,16 @@
1
1
  {
2
2
  "name": "@utogether/udp-core",
3
3
  "private": false,
4
- "version": "1.0.0",
4
+ "version": "1.0.1-beta.1",
5
5
  "description": "",
6
6
  "type": "module",
7
+ "main1": "index.ts",
7
8
  "main": "dist/core.es.js",
8
9
  "scripts": {
9
10
  "dev": "vite",
10
11
  "build": "vite build",
11
- "preview:build": "pnpm build && vite preview"
12
+ "preview:build": "pnpm build && vite preview",
13
+ "report": "rimraf dist && vite build"
12
14
  },
13
15
  "keywords": [],
14
16
  "author": "",
package/src/App.vue CHANGED
@@ -64,7 +64,7 @@ export default defineComponent({
64
64
  });
65
65
  </script>
66
66
  <style lang="scss">
67
- .hiprint-printElement-image-content img {
68
- content: url('/images/logo.png');
69
- }
67
+ // .hiprint-printElement-image-content img {
68
+ // content: url('/images/logo.png');
69
+ // }
70
70
  </style>
@@ -0,0 +1,132 @@
1
+ <!--
2
+ * @Author: wei.li
3
+ * @Date: 2022-11-04 14:53:36
4
+ * @LastEditors: levi7754 levi7754@163.com
5
+ * @LastEditTime: 2025-07-14 18:32:47
6
+ * @Description: form upload
7
+ -->
8
+ <template>
9
+ <div v-spinning="loading" class="ut-upload-wrapper">
10
+ <el-upload
11
+ v-model:file-list="fileList"
12
+ :action="baseUrl + '/ufil/file/uploadMultipart'"
13
+ list-type="picture-card"
14
+ :headers="headers"
15
+ :before-upload="beforeUpload"
16
+ :on-success="onSuccess"
17
+ :on-preview="onPreview"
18
+ :on-remove="handleRemove"
19
+ >
20
+ <template #default>
21
+ <i class="ri-add-line" />
22
+ </template>
23
+ </el-upload>
24
+ </div>
25
+ </template>
26
+
27
+ <script lang="ts">
28
+ export default { name: 'FormUpload' };
29
+ </script>
30
+
31
+ <script setup lang="ts">
32
+ import { ref, computed, getCurrentInstance } from 'vue';
33
+ import { cookies } from '@utogether/utils';
34
+ // import type { UploadProps } from "element-plus";
35
+ // import { loadEnv } from "@build/index";
36
+
37
+ // const { VITE_BASE_URL } = loadEnv();
38
+
39
+ export interface IProps {
40
+ record: object;
41
+ field: string;
42
+ limit?: number;
43
+ beforeUpload?: Function;
44
+ onSuccess?: Function;
45
+ onRemove?: Function;
46
+ }
47
+ const props = withDefaults(defineProps<IProps>(), {
48
+ record: () => {
49
+ return {};
50
+ },
51
+ field: '',
52
+ limit: 1
53
+ });
54
+
55
+ const instance = getCurrentInstance()!;
56
+ const baseUrl = instance.appContext.config.globalProperties.$url;
57
+
58
+ const headers = computed(() => {
59
+ const kTOKENKEY = 'authorized-token';
60
+ const token = cookies.get(kTOKENKEY)!;
61
+ const data = JSON.parse(token);
62
+ const headers = {
63
+ Authorization: 'Bearer ' + data.accessToken
64
+ };
65
+ return headers;
66
+ });
67
+
68
+ const fileList = ref([]);
69
+ const loading = ref(false);
70
+ const display = ref('flex');
71
+
72
+ const beforeUpload = file => {
73
+ if (props.beforeUpload) {
74
+ return props.beforeUpload(file);
75
+ }
76
+ console.log(file);
77
+ loading.value = true;
78
+ return true;
79
+ };
80
+
81
+ const onSuccess = response => {
82
+ loading.value = false;
83
+ if (props.onSuccess) {
84
+ return props.onSuccess(response);
85
+ } else {
86
+ const field = props.field;
87
+ Object.assign(props.record, { [field]: response.data });
88
+ display.value = props.limit > fileList.value.length ? 'flex' : 'none';
89
+ }
90
+ };
91
+
92
+ const handleRemove = (uploadFile, uploadFiles) => {
93
+ if (props.onRemove) {
94
+ return props.onRemove(uploadFile, fileList);
95
+ }
96
+ loading.value = false;
97
+ console.log(uploadFile, uploadFiles);
98
+ display.value = 'flex';
99
+ emit('remove', uploadFile, fileList);
100
+ };
101
+
102
+ const onPreview = () => {
103
+ console.log('....');
104
+ };
105
+ const emit = defineEmits<{
106
+ (e: 'remove', file: File, fileList: any): void;
107
+ }>();
108
+ </script>
109
+
110
+ <style lang="scss">
111
+ .ut-upload-wrapper {
112
+ .el-upload--picture-card {
113
+ display: v-bind(display);
114
+ width: 60px !important;
115
+ height: 60px !important;
116
+ }
117
+
118
+ .el-upload-list--picture-card .el-upload-list__item {
119
+ width: 60px !important;
120
+ height: 60px !important;
121
+ }
122
+
123
+ .el-upload-list--picture-card .el-progress {
124
+ width: 50px !important;
125
+
126
+ .el-progress-circle {
127
+ width: 50px !important;
128
+ height: 50px !important;
129
+ }
130
+ }
131
+ }
132
+ </style>
@@ -0,0 +1,4 @@
1
+ import UtModalForm2 from './modal-form.vue';
2
+ import FormUpload2 from './form-upload.vue';
3
+
4
+ export { UtModalForm2, FormUpload2 };
@@ -0,0 +1,180 @@
1
+ <!--
2
+ * @Author: wei.li
3
+ * @Date: 2021-11-29 21:02:43
4
+ * @LastEditors: levi7754 levi7754@163.com
5
+ * @LastEditTime: 2025-07-14 17:38:19
6
+ * @Description: file content
7
+ -->
8
+
9
+ <template>
10
+ <div>
11
+ <vxe-modal
12
+ v-model="showModal"
13
+ :title="title"
14
+ :width="width"
15
+ :height="height"
16
+ :loading="loading"
17
+ :show-footer="dataStatus !== 'detail'"
18
+ v-bind="modalAttrs"
19
+ min-width="240"
20
+ min-height="300"
21
+ destroy-on-close
22
+ resize
23
+ @close="onClose"
24
+ >
25
+ <template #default>
26
+ <vxe-form
27
+ ref="xForm"
28
+ :data="record"
29
+ :items="formItems"
30
+ :rules="rules"
31
+ title-align="right"
32
+ :title-width="formAttrs.titleWidth || 90"
33
+ v-bind="formAttrs"
34
+ />
35
+ </template>
36
+ <template #footer>
37
+ <ut-button status="warning" content="cancel" icon="ri-close-line" @tap="onClose" />
38
+ <ut-button status="u-cyan" content="confirm" icon="ri-save-3-line" @tap="onConfirm" />
39
+ </template>
40
+ </vxe-modal>
41
+ </div>
42
+ </template>
43
+
44
+ <script lang="ts">
45
+ export default {
46
+ name: 'UtModalForm'
47
+ };
48
+ </script>
49
+ <script lang="ts" setup>
50
+ import { onBeforeMount, ref, computed, getCurrentInstance, useAttrs } from 'vue';
51
+ import { useI18n } from 'vue-i18n';
52
+ import { getAttrs, formatItems } from './utils';
53
+ import to from 'await-to-js';
54
+ import { formatRules, successMessage } from '@utogether/utils';
55
+
56
+ // import type { IRecord, IFormItemProps } from '../../types';
57
+
58
+ export interface IProps {
59
+ record: IRecord; // 数据对象
60
+ formAttrs?: IRecord;
61
+ modalAttrs?: IRecord;
62
+ items: Array<IFormItemProps>; // form item
63
+ url?: string; // 服务路径
64
+ method?: string; // 请求方式
65
+ title?: string; // 标题
66
+ dataStatus?: string; // 状态
67
+ width?: number;
68
+ height?: number;
69
+ }
70
+
71
+ const props = withDefaults(defineProps<IProps>(), {
72
+ record: (): IRecord => {
73
+ return {};
74
+ },
75
+ formAttrs: (): IRecord => {
76
+ return {};
77
+ },
78
+ items: () => [],
79
+ title: '数据记录',
80
+ width: 420,
81
+ height: 360,
82
+ dataStatus: 'detail',
83
+ url: '',
84
+ method: 'post'
85
+ });
86
+
87
+ const attrs: IRecord = getAttrs(useAttrs());
88
+
89
+ const loading = ref(false);
90
+ const instance = getCurrentInstance()!;
91
+
92
+ const serviceApi = instance.appContext.config.globalProperties.$serviceApi;
93
+
94
+ /**
95
+ * @description: 根据items 获取必填选
96
+ */
97
+ const rules = computed(() => {
98
+ if (!props.items.length) return {};
99
+ return formatRules(props.items, t);
100
+ });
101
+
102
+ const formItems = computed(() => {
103
+ if (!props.items.length) return props.items;
104
+ return formatItems(props.items, props.dataStatus);
105
+ });
106
+
107
+ const { t } = useI18n();
108
+ const showModal = ref(false);
109
+
110
+ const xForm = ref(null);
111
+ /**
112
+ * @description: 弹框确认
113
+ */
114
+ const onConfirm = () => {
115
+ // @ts-ignore
116
+ xForm.value.validate(async (valid: boolean) => {
117
+ if (!valid) {
118
+ const { record, url, method } = props;
119
+ if (url) {
120
+ showLoading();
121
+ const body = attrs?.dataProcessMethod ? attrs?.dataProcessMethod(record) : record;
122
+ if (url) {
123
+ const [err, data] = await to(serviceApi[method](url, body));
124
+ if (!err) {
125
+ successMessage();
126
+ emit('confirm', data);
127
+ }
128
+ }
129
+ hiddenLoading();
130
+ onClose();
131
+ } else {
132
+ emit('confirm');
133
+ }
134
+ }
135
+ });
136
+ };
137
+
138
+ /**
139
+ * @description: 显示加载框
140
+ */
141
+ const showLoading = () => {
142
+ loading.value = true;
143
+ };
144
+
145
+ /**
146
+ * @description: 关闭加载框
147
+ */
148
+ const hiddenLoading = () => {
149
+ loading.value = false;
150
+ };
151
+ const validateForm = (cb: Function) => {
152
+ // @ts-ignore
153
+ xForm.value.validate(cb);
154
+ };
155
+
156
+ /**
157
+ * @description: 关闭弹框
158
+ */
159
+ const onClose = () => {
160
+ showModal.value = false;
161
+ emit('close');
162
+ };
163
+ /**
164
+ * @description: 打开弹框
165
+ */
166
+ const openModal = () => {
167
+ showModal.value = true;
168
+ };
169
+
170
+ const emit = defineEmits<{
171
+ (e: 'close'): void;
172
+ (e: 'confirm', record?: any): void;
173
+ }>();
174
+
175
+ defineExpose({ showLoading, hiddenLoading, openModal, validateForm });
176
+
177
+ onBeforeMount(() => {
178
+ openModal();
179
+ });
180
+ </script>
@@ -0,0 +1,40 @@
1
+ import { useRender } from '@utogether/utils';
2
+
3
+ export const getAttrs = attrs => {
4
+ const data = {};
5
+ Object.keys(attrs).forEach(key => {
6
+ const nKey = key.replace(/-(\w)/g, str => str.slice(1).toUpperCase());
7
+ data[nKey] = attrs[key];
8
+ });
9
+ return data;
10
+ };
11
+
12
+ export const formatItems = (items, status, span = 24) => {
13
+ const renderHook = useRender();
14
+
15
+ if (!items.length) return items;
16
+ return items.map(item => {
17
+ item.title = item.title || `message.${item.field}`;
18
+ item.span = item.span || span;
19
+ let disabled = false;
20
+ if (status === 'detail') {
21
+ disabled = true;
22
+ item.placeholder = null;
23
+ } else {
24
+ disabled =
25
+ item.disabled === false ? item.disabled : item.disabled || item.itemRender?.props?.disabled;
26
+ }
27
+ let itemRender = {
28
+ name: 'VxeInput',
29
+ props: { disabled, placeholder: disabled ? '' : item.placeholder }
30
+ };
31
+ if (item.code && !item.itemRender) {
32
+ itemRender = renderHook.renderDict(item.code);
33
+ }
34
+ item.itemRender = item.itemRender || itemRender;
35
+ item.itemRender['props'] = Object.assign(item.itemRender.props || {}, {
36
+ disabled
37
+ });
38
+ return item;
39
+ });
40
+ };
package/src/main.ts CHANGED
@@ -35,7 +35,8 @@ import VueViewer from 'v-viewer';
35
35
  // UtButton,
36
36
  // UGrid,
37
37
  // UtDivider,
38
- // UtModalForm,
38
+ // UtModalForm2,
39
+ // FormUpload2
39
40
  // UtForm,
40
41
  // UtModalGrid,
41
42
  // UtContent,
@@ -43,7 +44,7 @@ import VueViewer from 'v-viewer';
43
44
  // UtIconSelect,
44
45
  // UtCalendar
45
46
  // uAttachment
46
- // } from './../src/components/udp';
47
+ // } from './components/udp';
47
48
 
48
49
  const app = createApp(App);
49
50
 
@@ -72,7 +73,6 @@ const setGlobalDirective = app => {
72
73
  app.directive(key, (directives as { [key: string]: Directive })[key]);
73
74
  });
74
75
  };
75
- console.log('ucore--process', process.env);
76
76
 
77
77
  const init = ({ config, lang, views, env, tableConfig }) => {
78
78
  app.use(router);
@@ -87,7 +87,8 @@ const init = ({ config, lang, views, env, tableConfig }) => {
87
87
  app.component('FontIcon', FontIcon);
88
88
  // app.component('uAttachment', uAttachment).component('UGrid', UGrid);
89
89
  // .component('UtDivider', UtDivider)
90
- // .component('UtModalForm', UtModalForm)
90
+ // .component('UtModalForm2', UtModalForm2)
91
+ // .component('FormUpload2', FormUpload2);
91
92
  // .component('UtForm', UtForm)
92
93
  // .component('UtContent', UtContent)
93
94
  // .component('UtIconSelect', UtIconSelect)
@@ -2,7 +2,7 @@
2
2
  * @Author: levi7754 levi7754@163.com
3
3
  * @Date: 2024-06-05 14:32:03
4
4
  * @LastEditors: levi7754 levi7754@163.com
5
- * @LastEditTime: 2025-04-30 15:40:39
5
+ * @LastEditTime: 2025-07-16 15:36:56
6
6
  * @FilePath: /udp-front/packages/udp-core/src/plugins/vxe-table/index.ts
7
7
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
8
8
  */
@@ -10,8 +10,8 @@ import 'xe-utils';
10
10
  import { merge } from 'xe-utils';
11
11
  import { geti18n, transformI18n } from '../i18n/index';
12
12
  // import { storageLocal } from '@utogether/utils';
13
- import { VxetableRender } from '@utogether/utils';
14
- // import { VxetableRender } from './udp/render';
13
+ // import { VxetableRender } from '@utogether/utils';
14
+ import { VxetableRender } from './render';
15
15
  import { getServiceApi } from '../../api';
16
16
 
17
17
  import VXETable, { VxeUI } from 'vxe-table';