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

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 (201) hide show
  1. package/build/plugins.ts +39 -26
  2. package/dist/{403-B1R-4vXw.js → 403-Ctxjn4q8.js} +9 -8
  3. package/dist/{404-fXPl8csw.js → 404-W5yzyiZ9.js} +15 -14
  4. package/dist/{500-eI5842YB.js → 500-DXuGEOm4.js} +11 -10
  5. package/dist/{AuthorityInfo-CfVH6PaB.js → AuthorityInfo-C2tflCt8.js} +1 -1
  6. package/dist/AuthorityInfo.vue_vue_type_style_index_0_lang-SVgy3HX7.js +100 -0
  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-PLez5GoH.js} +3 -3
  10. package/dist/{CompanyPanel-B4MzoqN_.js → CompanyPanel-CIGaQooL.js} +20 -20
  11. package/dist/{Department-B4BNSiYx.js → Department-B9wLsXFm.js} +3 -3
  12. package/dist/{DepartmentPanel-zJO89L2O.js → DepartmentPanel-DSM4lTaz.js} +23 -23
  13. package/dist/{DesignPanel-S8P0J97f.js → DesignPanel-B6a9wW_A.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-DtHfoDQk.js} +28 -30
  15. package/dist/DictView-DhFbQxdJ.js +110 -0
  16. package/dist/{InvOrganization-MuM2jtsG.js → InvOrganization-D90AbR3b.js} +2 -2
  17. package/dist/Org-DxBkYabD.js +39 -0
  18. package/dist/{Preview-CRyiwUIR.js → Preview-BFtRpBxw.js} +1 -1
  19. package/dist/{ReportDefine-WZYIx8Sm.js → ReportDefine-BIa2QryC.js} +1 -1
  20. package/dist/{ReportDesign-D-7GKgpb.js → ReportDesign-CnyjI-WD.js} +44 -44
  21. package/dist/{ReportQuery-BIIJny6w.js → ReportQuery-BiK7yEhV.js} +5 -5
  22. package/dist/{ReportQueryFrom-OoUl7N2O.js → ReportQueryFrom-C2rqdFTm.js} +1 -1
  23. package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-B878fgj8.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-Ba9HLnXQ.js} +6 -5
  24. package/dist/{ReportTemplate-Cfeq9US-.js → ReportTemplate-DdkLscP3.js} +30 -30
  25. package/dist/{Role-BwTV2QMH.js → Role-BrsxgK8D.js} +6 -6
  26. package/dist/{RoleAssign-De1JjOun.js → RoleAssign-DiqwJqDa.js} +8 -8
  27. package/dist/{RolePanel-pUBXsqCM.js → RolePanel-BDusGyo7.js} +1 -1
  28. package/dist/{RolePanel-E3RcdByM.js → RolePanel-Dqx5dI3f.js} +1 -1
  29. package/dist/RolePanel.vue_vue_type_script_setup_true_lang-2Z1q_5uW.js +132 -0
  30. package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-B2pQwHb0.js → RolePanel.vue_vue_type_script_setup_true_lang-B5lUnaMI.js} +40 -34
  31. package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-vMR1fBi0.js → ScrollPanel.vue_vue_type_style_index_0_lang-vSP23fEq.js} +23 -23
  32. package/dist/{Staff-Czm7A8vI.js → Staff-Cwi9LQiZ.js} +3 -3
  33. package/dist/StaffInfo-XjVtyaMv.js +4 -0
  34. package/dist/{StaffInfo.vue_vue_type_style_index_0_lang-DMTL7KCh.js → StaffInfo.vue_vue_type_script_setup_true_lang-wSrAuyet.js} +16 -16
  35. package/dist/{StaffPanel-CHk60LEz.js → StaffPanel-C-wYcFdv.js} +1 -1
  36. package/dist/{StaffPanel.vue_vue_type_script_setup_true_lang-iPKLb5wG.js → StaffPanel.vue_vue_type_script_setup_true_lang-DZNArmnC.js} +46 -49
  37. package/dist/{SysUser-BGwbttRn.js → SysUser-O4tvr-Ur.js} +2 -2
  38. package/dist/{SysUserPanel-BCbKoLKt.js → SysUserPanel-B853docZ.js} +1 -1
  39. package/dist/SysUserPanel.vue_vue_type_script_setup_true_lang-DhiYYC97.js +294 -0
  40. package/dist/{SystemMenu-BkqZSDKl.js → SystemMenu-CXR6mrXr.js} +52 -50
  41. package/dist/{UserInfo-BsyAcT2d.js → UserInfo-BkP8pE2a.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-D4r_umjV.js} +38 -36
  43. package/dist/{childView-CyuLTUqC.js → childView-D0HwbgDT.js} +1 -1
  44. package/dist/{childView-CF83nhxb.js → childView-TRqUkSDC.js} +1 -1
  45. package/dist/{childView.vue_vue_type_style_index_0_lang-CNSgGda3.js → childView.vue_vue_type_style_index_0_lang-BzISq0Jf.js} +43 -43
  46. package/dist/{childView.vue_vue_type_style_index_0_lang-Cch4lE-i.js → childView.vue_vue_type_style_index_0_lang-DQRgNsJY.js} +1 -1
  47. package/dist/{code-rule-Bz-gnktN.js → code-rule-BV7PQWhK.js} +13 -14
  48. package/dist/core.es.js +13 -10
  49. package/dist/{cron-task-CIifSUdW.js → cron-task-9ZS9bi7K.js} +11 -11
  50. package/dist/{frameView-_d2mqjjQ.js → frameView-DE83AN50.js} +15 -14
  51. package/dist/img/l_img.svg +1 -1
  52. package/dist/img/minicolors.png +0 -0
  53. package/dist/img/v_img.svg +1 -1
  54. package/dist/index-DVARtten.js +2623 -0
  55. package/dist/{layoutView-DLKVepB8.js → layoutView-D1U-c4By.js} +730 -724
  56. package/dist/{login-log-CvVnyGi3.js → login-log-kqKzKTto.js} +1 -1
  57. package/dist/{login-LREiDfFU.js → login-sPCEiTGT.js} +107 -113
  58. package/dist/{lov-view-DDrIVILB.js → lov-view-76NcYTYl.js} +5 -5
  59. package/dist/{menuInfo-B1FUV-Sk.js → menuInfo-CxjfjFpm.js} +1 -1
  60. package/dist/{menuInfo.vue_vue_type_style_index_0_lang-Cnk3vdtD.js → menuInfo.vue_vue_type_style_index_0_lang-C2qahH3r.js} +98 -95
  61. package/dist/pda-app-BUH16bLj.js +710 -0
  62. package/dist/redirect-BqegffKC.js +15 -0
  63. package/dist/{resource-BCwx9fEv.js → resource-CCuHzoA6.js} +18 -18
  64. package/dist/{su-welcome-189A7N4r.js → su-welcome-mRArONsd.js} +133 -133
  65. package/dist/{sys-config-BZ3sejow.js → sys-config-Cvt05yF6.js} +21 -21
  66. package/dist/udp-core.css +2 -2
  67. package/dist/{utogether-r08LNiIZ.js → utogether-Dm_VBQHR.js} +6 -6
  68. package/index.ts +40 -36
  69. package/package.json +4 -2
  70. package/src/App.vue +65 -70
  71. package/src/api/index.ts +1 -1
  72. package/src/components/SuCharts/src/UserInfo.vue +78 -78
  73. package/src/components/SuScrollTree/ScrollPanel.vue +3 -3
  74. package/src/components/udp/count-down.vue +536 -0
  75. package/src/components/udp/flip-down/FlipCard/flip-card.vue +251 -0
  76. package/src/components/udp/flip-down/FlipCard/interfaces.ts +4 -0
  77. package/src/components/udp/flip-down/FlipClock/flip-clock.vue +113 -0
  78. package/src/components/udp/form-upload.vue +482 -0
  79. package/src/components/udp/form.vue +112 -0
  80. package/src/components/udp/grid.vue +495 -0
  81. package/src/components/udp/index.ts +10 -0
  82. package/src/components/udp/lov.vue +388 -0
  83. package/src/components/udp/modal-form.vue +189 -0
  84. package/src/components/udp/modal-grid.vue +288 -0
  85. package/src/components/udp/upload.vue +423 -0
  86. package/src/components/udp/utils.ts +447 -0
  87. package/src/directives/permission/index.ts +1 -1
  88. package/src/layout/components/lay-navbar/index.vue +1 -1
  89. package/src/layout/components/lay-panel/index.vue +150 -150
  90. package/src/layout/components/lay-search/index.vue +25 -25
  91. package/src/layout/components/lay-sidebar/breadCrumb.vue +1 -1
  92. package/src/layout/components/lay-tag/index.vue +625 -625
  93. package/src/layout/layoutView.vue +215 -215
  94. package/src/main.ts +25 -14
  95. package/src/plugins/i18n/en.ts +302 -289
  96. package/src/plugins/i18n/zh.ts +348 -337
  97. package/src/plugins/vxe-table/index.ts +53 -46
  98. package/src/plugins/vxe-table/render.tsx +956 -397
  99. package/src/router/index.ts +187 -183
  100. package/src/router/modules/remaining.ts +58 -83
  101. package/src/style/button.scss +85 -78
  102. package/src/style/tailwind.css +1 -68
  103. package/src/style/vxetable.scss +44 -11
  104. package/src/utils/authority/index.ts +1 -1
  105. package/src/utils/{http → udp/http}/index.ts +8 -24
  106. package/src/utils/{http → udp/http}/types.d.ts +8 -5
  107. package/src/utils/udp/useRender.ts +431 -0
  108. package/src/views/login/login-view.vue +2 -2
  109. package/src/views/organization/company/CompanyPanel.vue +259 -259
  110. package/src/views/organization/inv-org/InvOrganization.vue +1 -1
  111. package/src/views/organization/org/Org.vue +9 -5
  112. package/src/views/organization/staff/StaffInfo.vue +0 -30
  113. package/src/views/organization/staff/StaffPanel.vue +4 -3
  114. package/src/views/system/menu/AuthorityPanel.vue +2 -2
  115. package/src/views/system/menu/SystemMenu.vue +183 -191
  116. package/src/views/system/menu/menuInfo.vue +363 -368
  117. package/src/views/system/role/AuthorityInfo.vue +19 -33
  118. package/src/views/system/role/Role.vue +1 -5
  119. package/src/views/system/role/RolePanel.vue +11 -2
  120. package/src/views/system/role/UserInfo.vue +195 -193
  121. package/src/views/system/role-assign/RoleAssign.vue +57 -57
  122. package/src/views/system/role-assign/RolePanel.vue +139 -136
  123. package/src/views/system/sys/sys-config.vue +1 -1
  124. package/src/views/system/sysUser/SysUserPanel.vue +278 -278
  125. package/src/views/uapp/pda/pda-app.vue +208 -176
  126. package/src/views/udev/dict/DictView.vue +118 -106
  127. package/src/views/udev/dict/childView.vue +7 -7
  128. package/src/views/udev/lov/lov-view.vue +91 -91
  129. package/src/views/ufile/aggregation/File.vue +5 -5
  130. package/src/views/ufile/file/water-mark.vue +14 -14
  131. package/src/views/uhome/components/menu-favorite.vue +1 -1
  132. package/src/views/uhome/su-welcome.vue +4 -4
  133. package/src/views/ulogin/login.vue +15 -10
  134. package/src/views/upms/user/login-log.vue +1 -1
  135. package/src/views/urpt/design/DesignPanel.vue +507 -526
  136. package/src/views/urpt/design/ReportDesign.vue +15 -19
  137. package/src/views/urpt/static-resource/resource.vue +3 -3
  138. package/src/views/urpt/template/ReportTemplate.vue +7 -7
  139. package/types/global.d.ts +2 -2
  140. package/vite.config.ts +13 -2
  141. package/dist/AuthorityInfo.vue_vue_type_style_index_0_lang-DbK-f8jH.js +0 -102
  142. package/dist/DictView-bIS5-rK-.js +0 -95
  143. package/dist/Org-kXHSjsgJ.js +0 -35
  144. package/dist/RolePanel.vue_vue_type_script_setup_true_lang-CTIad9_Q.js +0 -126
  145. package/dist/StaffInfo-DJzvBuxy.js +0 -4
  146. package/dist/SysUserPanel.vue_vue_type_script_setup_true_lang-0QUjnhjF.js +0 -289
  147. package/dist/core.umd.js +0 -173
  148. package/dist/index-BKIw8tSn.js +0 -9195
  149. package/dist/pda-app-CRhVGijN.js +0 -2209
  150. package/dist/redirect-DiaNDu8F.js +0 -15
  151. package/src/assets/images/empty.png +0 -0
  152. package/src/assets/images/logo.png +0 -0
  153. package/src/components/ReCountTo/README.md +0 -2
  154. package/src/components/ReCountTo/index.ts +0 -18
  155. package/src/components/ReCountTo/src/normal/index.tsx +0 -165
  156. package/src/components/ReCountTo/src/normal/props.ts +0 -37
  157. package/src/components/ReCountTo/src/rebound/index.tsx +0 -67
  158. package/src/components/ReCountTo/src/rebound/props.ts +0 -14
  159. package/src/components/ReCountTo/src/rebound/rebound.css +0 -77
  160. package/src/components/ReCropper/index.ts +0 -14
  161. package/src/components/ReCropper/src/index.tsx +0 -141
  162. package/src/components/ReFlicker/index.css +0 -39
  163. package/src/components/ReFlicker/index.ts +0 -50
  164. package/src/components/ReFlop/index.ts +0 -14
  165. package/src/components/ReFlop/src/Filpper.tsx +0 -99
  166. package/src/components/ReFlop/src/filpper.css +0 -184
  167. package/src/components/ReFlop/src/index.vue +0 -126
  168. package/src/components/ReFlowChart/index.ts +0 -24
  169. package/src/components/ReFlowChart/src/Control.vue +0 -139
  170. package/src/components/ReFlowChart/src/DataDialog.vue +0 -12
  171. package/src/components/ReFlowChart/src/NodePanel.vue +0 -151
  172. package/src/components/ReFlowChart/src/adpterForTurbo.ts +0 -160
  173. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.css +0 -49
  174. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.eot +0 -0
  175. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.js +0 -61
  176. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.json +0 -58
  177. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.svg +0 -47
  178. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.ttf +0 -0
  179. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.woff +0 -0
  180. package/src/components/ReFlowChart/src/assets/iconfont/iconfont.woff2 +0 -0
  181. package/src/components/ReFlowChart/src/config.ts +0 -62
  182. package/src/components/ReSplitPane/index.css +0 -49
  183. package/src/components/ReSplitPane/index.tsx +0 -119
  184. package/src/components/ReSplitPane/resizer.css +0 -45
  185. package/src/components/ReSplitPane/resizer.tsx +0 -30
  186. package/src/components/SuCommon/card/components/Card.vue +0 -148
  187. package/src/components/SuCommon/card/components/DialogForm.vue +0 -127
  188. package/src/components/SuCommon/card/index.vue +0 -142
  189. package/src/components/SuCommon/icon-select/index.vue +0 -241
  190. package/src/components/SuCommon/table/index.vue +0 -208
  191. package/src/components/SuCommon/utils/index.ts +0 -103
  192. package/src/components/SuCommon/utils/slot.tsx +0 -50
  193. package/src/views/components/contextmenu/basic.vue +0 -74
  194. package/src/views/components/contextmenu/context-menu.vue +0 -40
  195. package/src/views/components/contextmenu/menuDynamic.vue +0 -99
  196. package/src/views/components/contextmenu/menuGroup.vue +0 -71
  197. package/src/views/components/count-to/index.vue +0 -43
  198. package/src/views/components/cropping/index.vue +0 -59
  199. package/src/views/components/cropping/picture.jpeg +0 -0
  200. package/src/views/components/split-pane/index.vue +0 -82
  201. package/src/views/components/video/index.vue +0 -57
@@ -0,0 +1,388 @@
1
+ <template>
2
+ <div class="ut-lov-wrapper">
3
+ <vxe-modal
4
+ v-if="mode === 'vxe'"
5
+ v-model="showLovModal"
6
+ :width="modalWidth"
7
+ :destroy-on-close="false"
8
+ :title="lovTitle"
9
+ :transfer="transfer"
10
+ height="66%"
11
+ resize
12
+ esc-closable
13
+ show-footer
14
+ :class-name="className"
15
+ :before-hide-method="beforeHideMethod"
16
+ >
17
+ <template #default>
18
+ <vxe-grid ref="xgrid" v-bind="data" resizable @cell-dblclick="onCellClick" />
19
+ </template>
20
+ <template #footer>
21
+ <vxe-button :content="$t('message.btn.cancel')" icon="ri-close-line" status="warning" @click="onClose" />
22
+ <vxe-button :content="$t('message.btn.confirm')" icon="ri-save-3-line" status="primary" @click="onConfirm" />
23
+ </template>
24
+ </vxe-modal>
25
+ <el-dialog
26
+ v-else
27
+ v-model="showLovModal"
28
+ :width="modalWidth"
29
+ :show-close="false"
30
+ :title="lovTitle"
31
+ :append-to-body="transfer"
32
+ draggable
33
+ destroy-on-close
34
+ close-on-press-escape
35
+ >
36
+ <template #default>
37
+ <div style="height: 360px">
38
+ <vxe-grid ref="xgrid" v-bind="data" resizable @cell-dblclick="onCellClick" />
39
+ </div>
40
+ </template>
41
+ <template #footer>
42
+ <vxe-button :content="$t('message.btn.cancel')" icon="ri-close-line" status="warning" @click="onClose" />
43
+ <vxe-button :content="$t('message.btn.confirm')" icon="ri-save-3-line" status="primary" @click="onConfirm" />
44
+ </template>
45
+ </el-dialog>
46
+ <vxe-input
47
+ v-model="record[displayName || field]"
48
+ :clearable="!disabled && clearable"
49
+ :disabled="disabled"
50
+ :readonly="readonly"
51
+ :placeholder="placeholder"
52
+ style="width: 100%"
53
+ type="search"
54
+ size="mini"
55
+ @search-click="onSeach"
56
+ @clear="onClear"
57
+ />
58
+ </div>
59
+ </template>
60
+
61
+ <script lang="ts">
62
+ export default {
63
+ name: 'UtLov'
64
+ };
65
+ </script>
66
+
67
+ <script setup lang="ts">
68
+ // @ts-nocheck
69
+ import { ref, reactive, getCurrentInstance } from 'vue';
70
+ import { VxeGridProps } from 'vxe-table';
71
+ import to from 'await-to-js';
72
+ import { clone, toDateString, isEmpty } from 'xe-utils';
73
+ import { useRender, cookies, delay } from '@utogether/utils';
74
+ // import type { IFormItemProps, IRecord } from '../../types';
75
+
76
+ export interface IProps {
77
+ record: object;
78
+ defaultParams?: object;
79
+ code: string;
80
+ field: string;
81
+ displayName?: string;
82
+ placeholder?: string;
83
+ mode?: string;
84
+ clearable?: boolean;
85
+ multiple?: boolean;
86
+ disabled?: boolean;
87
+ autoLoad?: boolean;
88
+ readonly?: boolean;
89
+ transfer?: boolean;
90
+ }
91
+ const props = withDefaults(defineProps<IProps>(), {
92
+ record: () => {
93
+ return {};
94
+ },
95
+ defaultParams: () => {
96
+ return {};
97
+ },
98
+ mode: 'vxe',
99
+ placeholder: '请选择',
100
+ clearable: true,
101
+ multiple: false,
102
+ disabled: false,
103
+ readonly: true,
104
+ autoLoad: true
105
+ });
106
+
107
+ const instance = getCurrentInstance()!;
108
+ const serviceApi = instance.appContext.config.globalProperties.$serviceApi;
109
+
110
+ const minWidth = 600;
111
+ const showLovModal = ref(false);
112
+ const modalWidth = ref(minWidth);
113
+ const lovTitle = ref('');
114
+ const className = ref('vxe-table--ignore-clear');
115
+
116
+ const data = reactive<VxeGridProps>({
117
+ loading: false,
118
+ border: true,
119
+ pagerConfig: {},
120
+ formConfig: { titleWidth: 90, titleAlign: 'right', items: [] },
121
+ height: 'auto',
122
+ editConfig: {},
123
+ rowConfig: { keyField: '_X_ROW_KEY' },
124
+ proxyConfig: {
125
+ form: true, // 查询是需要启用表单代理
126
+ autoLoad: false,
127
+ response: {
128
+ result: 'list',
129
+ total: 'total'
130
+ },
131
+ ajax: {
132
+ query: ({ page, form }) => {
133
+ const commonParam = cookies.get('kCookies_param') ? JSON.parse(cookies.get('kCookies_param')) : {};
134
+ let queryParams = Object.assign({}, form, commonParam, props.defaultParams);
135
+ queryParams.pageNum = page?.currentPage || 1;
136
+ queryParams.pageSize = page?.pageSize || 20;
137
+ if (!props.readonly) {
138
+ const { field, displayName } = props;
139
+ // 非只读时,意味着可录入文本,此时查询是需要加上录入的文本内容作为条件
140
+ queryParams[displayName || field] = props.record[displayName || field];
141
+ }
142
+ // console.log(queryParams);
143
+ queryParams = formatterParam(queryParams);
144
+ if (lovData.lovType !== 'url') {
145
+ queryParams.lovCode = props.code;
146
+ return serviceApi.get('/upfm/v1/lovViewHeader/listBySql', queryParams);
147
+ }
148
+ return serviceApi.get(lovData.lovUrl, queryParams);
149
+ }
150
+ }
151
+ },
152
+ checkboxConfig: {},
153
+ columns: []
154
+ });
155
+
156
+ // const displayName = ref(null);
157
+ let lovData = undefined;
158
+ let dataList = [];
159
+
160
+ const formatterParam = params => {
161
+ const columns = dataList.filter(col => ['date', 'month'].includes(col.fieldType) && col.isSearch);
162
+ columns.forEach(col => {
163
+ if (col.fieldType === 'date') {
164
+ params[col.field] = toDateString(params[col.field], 'yyyy-MM-dd 00:00:00');
165
+ } else if (col.fieldType === 'month') {
166
+ params[col.field] = toDateString(params[col.field], 'yyyy-MM');
167
+ }
168
+ });
169
+ return params;
170
+ };
171
+ // 查询字段
172
+ const getFormItem = () => {
173
+ const items = clone(dataList, true).filter(col => col.isSearch === 'Y');
174
+ if (!items.length) return;
175
+ // console.log(items);
176
+ const isCollapse = items.length > 2;
177
+ const forItems: IFormItemProps[] = items
178
+ .sort((a, b) => a.seqNo - b.seqNo)
179
+ .map((item: IRecord, idx) => {
180
+ return {
181
+ field: item.colField,
182
+ title: item.colTitle,
183
+ span: 8,
184
+ folding: idx > 1,
185
+ itemRender: getItemRender(item)
186
+ };
187
+ });
188
+ searchBtn.collapseNode = isCollapse;
189
+ if (isCollapse) {
190
+ // 按钮设置为 折叠节点并将搜索按钮插入到第一列的最后
191
+ forItems.splice(2, 0, searchBtn);
192
+ } else {
193
+ forItems.push(searchBtn);
194
+ }
195
+ data.formConfig.items = forItems;
196
+ };
197
+ const searchBtn: IFormItemProps = {
198
+ span: 8,
199
+ align: 'right',
200
+ collapseNode: false,
201
+ itemRender: {
202
+ name: 'VxeButtonGroup',
203
+ options: [
204
+ {
205
+ type: 'submit',
206
+ submit: 'submit',
207
+ content: 'message.btn.search',
208
+ status: 'primary',
209
+ icon: 'ri-search-line'
210
+ // props: {
211
+ // },
212
+ },
213
+ {
214
+ type: 'reset',
215
+ name: 'reset',
216
+ content: 'message.btn.reset',
217
+ status: 'info',
218
+ icon: 'ri-refresh-line'
219
+ // props: {
220
+ // },
221
+ }
222
+ ]
223
+ }
224
+ };
225
+
226
+ // console.log("useRender", useRender);
227
+ const renderHook = useRender();
228
+
229
+ const getItemRender = item => {
230
+ if (['date', 'month'].includes(item.fieldType)) {
231
+ const valueFormat = item.fieldType === 'date' ? 'yyyy-MM-dd HH:mm:ss' : 'yyyy-MM';
232
+ return renderHook.renderDate({ type: item.fieldType, valueFormat });
233
+ } else if (item.fieldType === 'dictCode') {
234
+ return renderHook.renderDict(item.dictCode);
235
+ }
236
+ return { name: 'VxeInput' };
237
+ };
238
+
239
+ // 获取columns
240
+ const getColumns = () => {
241
+ const columns = clone(dataList, true).filter((col: IRecord) => col.isCol === 'Y');
242
+ const colWidth = columns.reduce((curv, prev: IRecord) => curv + +prev.colWidth, 65);
243
+ modalWidth.value = colWidth < minWidth ? minWidth : colWidth > 900 ? 900 : colWidth;
244
+ data.columns = columns
245
+ .sort((a, b) => a.seqNo - b.seqNo)
246
+ .map(col => {
247
+ const fieldType = col.fieldType;
248
+ const dictCode = ['formatDict', col.dictCode];
249
+ return {
250
+ field: col.colField,
251
+ title: col.colTitle,
252
+ minWidth: col.colWidth,
253
+ formatter: fieldType === 'date' ? ['formatDate'] : col.fieldType === 'dictCode' ? dictCode : null
254
+ };
255
+ });
256
+ if (props.multiple) {
257
+ data.columns.unshift({ type: 'checkbox', width: 45, align: 'center' });
258
+ } else {
259
+ data.columns.unshift({ type: 'radio', width: 45, align: 'center' });
260
+ }
261
+ };
262
+
263
+ // 获取grid配置
264
+ const xgrid = ref(null);
265
+
266
+ const getGridConfig = async () => {
267
+ console.log('88888');
268
+ data.loading = true;
269
+ const url = '/upfm/v1/lovViewHeader/detailByViewCode';
270
+ const [err, res]: [Error, any] = await to(serviceApi.get(url, { lovCode: props.code }));
271
+ data.loading = false;
272
+ if (err) onClose();
273
+ lovTitle.value = res?.lovTitle || res.lovName;
274
+ dataList = res.lineList;
275
+ lovData = res;
276
+ props.autoLoad && xgrid.value.commitProxy('query');
277
+ getColumns();
278
+ getFormItem();
279
+ };
280
+
281
+ const onSeach = async () => {
282
+ if (props.disabled) return;
283
+ getGridConfig();
284
+ await delay(64);
285
+ showLovModal.value = true;
286
+ };
287
+
288
+ const onClear = () => {
289
+ emit('clear', '');
290
+ };
291
+
292
+ // 双击
293
+ const onCellClick = ({ row }) => {
294
+ const record = !props.multiple ? row : [row];
295
+ emit('change', record, lovData.valueField);
296
+ onClose();
297
+ };
298
+
299
+ const onConfirm = () => {
300
+ const grid = xgrid.value;
301
+ const record = !props.multiple ? grid.getRadioRecord() : grid.getCheckboxRecords();
302
+ !isEmpty(record) && emit('change', record, lovData.valueField);
303
+ onClose();
304
+ };
305
+ /** 输入框显示值 */
306
+ // const setDisplayLabel = row => {
307
+ // let value = row[lovData.valueField];
308
+ // if (props.multiple) {
309
+ // value = row.map(m => m[lovData.valueField]).join();
310
+ // }
311
+ // Object.assign(props.record, { [props.field]: value });
312
+ // };
313
+
314
+ // 关闭Lov
315
+ const onClose = () => {
316
+ dataList.length = 0;
317
+ showLovModal.value = false;
318
+ };
319
+
320
+ const beforeHideMethod = ({ type }) => {
321
+ // console.log("cccc", type);
322
+ };
323
+
324
+ const emit = defineEmits<{
325
+ (e: 'clear', str: ''): void;
326
+ (e: 'change', record: any, field: string): void;
327
+ }>();
328
+ </script>
329
+
330
+ <style lang="scss">
331
+ .ut-lov-wrapper {
332
+ .vxe-pager .vxe-pager--sizes {
333
+ display: inline-block;
334
+ width: 7em !important;
335
+ text-align: center;
336
+ cursor: pointer;
337
+ }
338
+
339
+ .el-dialog__header {
340
+ padding: 0.6em 4.6em 0.6em 1em;
341
+ margin-right: 0;
342
+ background-color: #f8f8f8;
343
+ border-bottom: 1px solid #ebeef5;
344
+
345
+ .el-dialog__title {
346
+ font-size: 1.1em;
347
+ font-weight: 600;
348
+ color: #000 !important;
349
+ }
350
+ }
351
+
352
+ .el-dialog__body {
353
+ padding: 5px 6px;
354
+ }
355
+
356
+ .el-dialog__footer {
357
+ padding: 5px 6px;
358
+ }
359
+
360
+ .vxe-grid {
361
+ .vxe-form {
362
+ .vxe-form--item {
363
+ .vxe-form--item-title-label {
364
+ font-weight: 500 !important;
365
+ color: #000 !important;
366
+ }
367
+
368
+ .vxe-input--date-picker-suffix {
369
+ color: #000 !important;
370
+ }
371
+ }
372
+ }
373
+
374
+ .vxe-cell {
375
+ .vxe-cell--label {
376
+ font-weight: 500 !important;
377
+ color: #000 !important;
378
+ }
379
+ }
380
+ }
381
+
382
+ .vxe-input {
383
+ i[class*='vxe-icon-'] {
384
+ color: #6a6a6a !important;
385
+ }
386
+ }
387
+ }
388
+ </style>
@@ -0,0 +1,189 @@
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
+ <vxe-checkbox
38
+ v-if="!url && dataStatus === 'add'"
39
+ v-model="continuous"
40
+ content="连续添加"
41
+ unchecked-value="0"
42
+ checked-value="1"
43
+ style="margin-right: 12px"
44
+ />
45
+ <ut-button status="warning" content="cancel" icon="ri-close-line" @tap="onClose" />
46
+ <ut-button status="u-cyan" content="confirm" icon="ri-save-3-line" @tap="onConfirm" />
47
+ </template>
48
+ </vxe-modal>
49
+ </div>
50
+ </template>
51
+
52
+ <script lang="ts">
53
+ export default {
54
+ name: 'UtModalForm'
55
+ };
56
+ </script>
57
+ <script lang="ts" setup>
58
+ import { onBeforeMount, ref, computed, getCurrentInstance, useAttrs } from 'vue';
59
+ import { useI18n } from 'vue-i18n';
60
+ import { getAttrs } from './utils';
61
+ import to from 'await-to-js';
62
+ import { formatRules, successMessage, formatItems } from '@utogether/utils';
63
+
64
+ // import type { IRecord, IFormItemProps } from '../../types';
65
+
66
+ export interface IProps {
67
+ record: IRecord; // 数据对象
68
+ formAttrs?: IRecord;
69
+ modalAttrs?: IRecord;
70
+ items: Array<IFormItemProps>; // form item
71
+ url?: string; // 服务路径
72
+ method?: string; // 请求方式
73
+ title?: string; // 标题
74
+ dataStatus?: string; // 状态
75
+ width?: number;
76
+ height?: number;
77
+ }
78
+
79
+ const props = withDefaults(defineProps<IProps>(), {
80
+ record: (): IRecord => {
81
+ return {};
82
+ },
83
+ formAttrs: (): IRecord => {
84
+ return {};
85
+ },
86
+ items: () => [],
87
+ title: '数据记录',
88
+ width: 420,
89
+ height: 360,
90
+ dataStatus: 'detail',
91
+ url: '',
92
+ method: 'post'
93
+ });
94
+
95
+ const attrs: IRecord = getAttrs(useAttrs());
96
+
97
+ const continuous = ref('0');
98
+ const loading = ref(false);
99
+ const instance = getCurrentInstance()!;
100
+
101
+ const serviceApi = instance.appContext.config.globalProperties.$serviceApi;
102
+
103
+ /**
104
+ * @description: 根据items 获取必填选
105
+ */
106
+ const rules = computed(() => {
107
+ if (!props.items.length) return {};
108
+ return formatRules(props.items, t);
109
+ });
110
+
111
+ const formItems = computed(() => {
112
+ if (!props.items.length) return props.items;
113
+ return formatItems(props.items, props.dataStatus);
114
+ });
115
+
116
+ const { t } = useI18n();
117
+ const showModal = ref(false);
118
+
119
+ const xForm = ref(null);
120
+ /**
121
+ * @description: 弹框确认
122
+ */
123
+ const onConfirm = () => {
124
+ // @ts-ignore
125
+ xForm.value.validate(async (valid: boolean) => {
126
+ if (!valid) {
127
+ const { record, url, method } = props;
128
+ if (url) {
129
+ showLoading();
130
+ const body = attrs?.dataProcessMethod ? attrs?.dataProcessMethod(record) : record;
131
+ if (url) {
132
+ const [err, data] = await to(serviceApi[method](url, body));
133
+ if (!err) {
134
+ successMessage();
135
+ emit('confirm', data);
136
+ }
137
+ }
138
+ hiddenLoading();
139
+ onClose();
140
+ } else {
141
+ emit('confirm');
142
+ }
143
+ }
144
+ });
145
+ };
146
+
147
+ /**
148
+ * @description: 显示加载框
149
+ */
150
+ const showLoading = () => {
151
+ loading.value = true;
152
+ };
153
+
154
+ /**
155
+ * @description: 关闭加载框
156
+ */
157
+ const hiddenLoading = () => {
158
+ loading.value = false;
159
+ };
160
+ const validateForm = (cb: Function) => {
161
+ // @ts-ignore
162
+ xForm.value.validate(cb);
163
+ };
164
+
165
+ /**
166
+ * @description: 关闭弹框
167
+ */
168
+ const onClose = () => {
169
+ showModal.value = false;
170
+ emit('close');
171
+ };
172
+ /**
173
+ * @description: 打开弹框
174
+ */
175
+ const openModal = () => {
176
+ showModal.value = true;
177
+ };
178
+
179
+ const emit = defineEmits<{
180
+ (e: 'close'): void;
181
+ (e: 'confirm', record?: any): void;
182
+ }>();
183
+
184
+ defineExpose({ showLoading, hiddenLoading, openModal, validateForm });
185
+
186
+ onBeforeMount(() => {
187
+ openModal();
188
+ });
189
+ </script>