@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
@@ -1,368 +1,363 @@
1
- <!--
2
- * @Author: wei.li
3
- * @Date: 2021-11-17 16:44:08
4
- * @LastEditors: levi7754 levi7754@163.com
5
- * @LastEditTime: 2025-04-08 15:43:16
6
- * @Description: file content
7
- -->
8
-
9
- <template>
10
- <div class="ut-menu-wrapper">
11
- <el-drawer
12
- :model-value="show"
13
- :title="$t('message.title.memuInfo')"
14
- :before-close="handleClose"
15
- direction="rtl"
16
- destroy-on-close
17
- size="50%"
18
- >
19
- <vxe-form
20
- ref="xForm"
21
- :data="record"
22
- :rules="rules"
23
- :loading="loading"
24
- title-colon
25
- title-align="right"
26
- title-width="110"
27
- >
28
- <vxe-form-item
29
- v-if="record.menuType === '0'"
30
- :title="$t('message.menuType')"
31
- field="menuCategory"
32
- span="24"
33
- >
34
- <template #default="{ data }">
35
- <vxe-select v-model="data.menuCategory" :disabled="data.menuCategory === '0'">
36
- <!-- v-for="dict in dictData['SU.MENU.TYPE']?.children" -->
37
- <vxe-option
38
- v-for="dict in getLovList('SU.MENU.TYPE')"
39
- :key="dict.dictCode"
40
- :value="dict.dictCode"
41
- :label="dict.dictName"
42
- :disabled="dict.enabled"
43
- />
44
- </vxe-select>
45
- </template>
46
- </vxe-form-item>
47
- <vxe-form-item :title="$t('message.permissionCode')" field="dispalyCode" span="24">
48
- <template #default="{ data }">
49
- <vxe-input
50
- v-model="data.dispalyCode"
51
- clearable
52
- :class="{ 'u-menu-prefix': dataStatus === 'add' }"
53
- :disabled="dataStatus !== 'add'"
54
- >
55
- <template v-if="dataStatus === 'add'" #prefix>
56
- <span>{{ prefixCode }}</span>
57
- </template>
58
- </vxe-input>
59
- </template>
60
- </vxe-form-item>
61
- <vxe-form-item
62
- v-if="!(record.menuType * 1) && record.menuCategory !== '3'"
63
- :title="$t('message.menuCode')"
64
- :item-render="{ name: '$input' }"
65
- field="menuCode"
66
- span="24"
67
- />
68
- <vxe-form-item
69
- :title="$t('message.menuName')"
70
- :item-render="{ name: '$input' }"
71
- field="menuName"
72
- span="24"
73
- />
74
- <vxe-form-item
75
- :title="$t('message.menuNameEn')"
76
- field="menuNameEn"
77
- span="24"
78
- :item-render="{ name: '$input' }"
79
- />
80
- <vxe-form-item
81
- v-if="!(record.menuType * 1)"
82
- :title="$t('message.menuPath')"
83
- :item-render="{ name: '$input' }"
84
- field="menuPath"
85
- span="24"
86
- />
87
- <vxe-form-item
88
- v-if="!(record.menuType * 1)"
89
- :title="$t('message.i18nField')"
90
- :item-render="{ name: '$input' }"
91
- field="i18nField"
92
- span="24"
93
- />
94
- <vxe-form-item
95
- v-if="record.menuCategory === '2'"
96
- :title="$t('message.frameSrc')"
97
- :item-render="{ name: '$input' }"
98
- field="frameSrc"
99
- span="24"
100
- />
101
- <vxe-form-item
102
- v-if="record.menuCategory === '3'"
103
- :title="$t('message.externalURI')"
104
- :item-render="{ name: '$input' }"
105
- field="menuCode"
106
- span="24"
107
- />
108
- <vxe-form-item
109
- v-if="!(record.menuType * 1) && record.menuCategory !== '3'"
110
- :title="$t('message.extraIcon')"
111
- :item-render="{ name: '$input' }"
112
- field="extraIcon"
113
- span="24"
114
- />
115
- <vxe-form-item
116
- v-if="['0', '5'].includes(record.menuCategory)"
117
- :title="$t('message.redirect')"
118
- :item-render="{ name: '$input' }"
119
- field="redirect"
120
- span="24"
121
- />
122
- <vxe-form-item v-if="!(record.menuType * 1)" :title="$t('message.sort')" span="24">
123
- <template #default="{ data }">
124
- <vxe-input v-model="data.sort" type="number" step="10" clearable />
125
- </template>
126
- </vxe-form-item>
127
- <vxe-form-item
128
- v-if="dataStatus === 'add' && ['2', '1'].includes(record.menuCategory)"
129
- :title="$t('message.btn.auth')"
130
- >
131
- <template #default>
132
- <vxe-checkbox-group v-model="authority">
133
- <vxe-checkbox label="add" :content="$t('message.btn.add')" />
134
- <vxe-checkbox label="del" :content="$t('message.btn.delete')" />
135
- <vxe-checkbox label="edit" :content="$t('message.btn.edit')" />
136
- <vxe-checkbox label="fetch" :content="$t('message.btn.fetch')" />
137
- <vxe-checkbox label="export" :content="$t('message.btn.export')" />
138
- </vxe-checkbox-group>
139
- </template>
140
- </vxe-form-item>
141
- <vxe-form-item v-if="!(record.menuType * 1)" :title="$t('message.icon')" span="24">
142
- <template #default="{ data }">
143
- <ut-icon-select v-model="data.icon" />
144
- </template>
145
- </vxe-form-item>
146
- </vxe-form>
147
- <el-divider />
148
- <el-row type="flex" justify="end" style="padding-right: 22px">
149
- <ut-button content="cancel" status="warning" @tap="handleClose" />
150
- <ut-button content="confirm" status="primary" @tap="onSubmit" />
151
- </el-row>
152
- </el-drawer>
153
- </div>
154
- </template>
155
- <script setup lang="ts">
156
- import { useI18n } from 'vue-i18n';
157
- import { ref, watch } from 'vue';
158
- import { VxeFormPropTypes } from 'vxe-table';
159
- import to from 'await-to-js';
160
- import { templateRef } from '@vueuse/core';
161
- import { useSystemStoreHook } from '../../../store/modules/system';
162
- import { getServiceApi } from '../../../api';
163
-
164
- interface IProps {
165
- show: boolean;
166
- record: IRecord;
167
- dataStatus?: string;
168
- direction?: string;
169
- }
170
-
171
- const dictData = useSystemStoreHook().getDataDict;
172
-
173
- const props = withDefaults(defineProps<IProps>(), {
174
- show: false,
175
- record: (): IRecord => {
176
- return {};
177
- },
178
- dataStatus: 'detail',
179
- direction: 'rtl'
180
- });
181
-
182
- watch(
183
- () => props.show,
184
- () => {
185
- prefixCode.value = props.show && getPrefixCode();
186
- }
187
- );
188
-
189
- const serviceApi = getServiceApi();
190
-
191
- const { t } = useI18n();
192
- const rules: VxeFormPropTypes.Rules = {
193
- menuCode: [
194
- {
195
- required: true,
196
- message: `${t('message.required')}${t('message.menuCode')}`
197
- }
198
- ],
199
- menuName: [
200
- {
201
- required: true,
202
- message: `${t('message.required')}${t('message.menuName')}`
203
- }
204
- ],
205
- menuPath: [
206
- {
207
- required: true,
208
- message: `${t('message.required')}${t('message.menuPath')}`
209
- }
210
- ],
211
- frameSrc: [
212
- {
213
- required: true,
214
- message: `${t('message.required')}${t('message.externalURI')}`
215
- }
216
- ],
217
- i18nField: [
218
- {
219
- required: true,
220
- message: `${t('message.required')}${t('message.i18nField')}`
221
- }
222
- ],
223
- dispalyCode: [
224
- {
225
- required: true,
226
- message: `${t('message.required')}${t('message.permissionCode')}`
227
- }
228
- ],
229
- menuCategory: [
230
- {
231
- required: true,
232
- message: `${t('message.required')}${t('message.menuType')}`
233
- }
234
- ]
235
- };
236
-
237
- const xForm = templateRef<any>('xForm', null);
238
- const loading = ref(false);
239
- const prefixCode = ref('');
240
- const authority = ref(['fetch']);
241
-
242
- const url = '/uums/menu';
243
-
244
- const emit = defineEmits<{
245
- (e: 'onClose', type): void;
246
- }>();
247
-
248
- const getPrefixCode = () => {
249
- const { record, dataStatus } = props;
250
- const { id, parentId, hasChildren } = record;
251
- if (dataStatus === 'update') return;
252
- if (!id && !parentId) return 'su';
253
- if (hasChildren || dataStatus === 'add') {
254
- record.dispalyCode = '';
255
- return record.permissionCode;
256
- }
257
- return record.permissionCode;
258
- };
259
-
260
- const onSubmit = () => {
261
- xForm.value.validate(async valid => {
262
- if (!valid) {
263
- loading.value = true;
264
- const { record, dataStatus } = props;
265
- if (dataStatus === 'add') {
266
- record.permissionCode = `${prefixCode.value}.${record.dispalyCode}`;
267
- const [err, data]: [Error, any] = await to(serviceApi.post(url, [record]));
268
- if (!err && !['0', '5'].includes(record.menuCategory) && authority.value.length) {
269
- const dataList = authority.value.map((auth, idx) => {
270
- return {
271
- permissionCode: record.permissionCode + '.' + auth,
272
- parentId: data[0].id,
273
- menuName: getAuthName(auth),
274
- menuType: 1,
275
- enabled: '1',
276
- sort: (idx + 1) * 10
277
- };
278
- });
279
- await to(serviceApi.post(url, dataList));
280
- }
281
- loading.value = false;
282
- } else {
283
- await to(serviceApi.put(url, [record]));
284
- loading.value = false;
285
- }
286
- handleClose('submit');
287
- }
288
- });
289
- };
290
- const getAuthName = code => {
291
- const auth = {
292
- fetch: t('message.btn.fetch'),
293
- add: t('message.btn.add'),
294
- edit: t('message.btn.edit'),
295
- del: t('message.btn.delete'),
296
- export: t('message.btn.export')
297
- };
298
- return auth[code];
299
- };
300
- const getLovList = code => {
301
- return dictData[code]?.children.map(m => {
302
- m.enabled = m.dictCode === '0' && props.record.menuCategory !== '0';
303
- return m;
304
- });
305
- };
306
- // 抽屉关闭
307
- function handleClose(type) {
308
- emit('onClose', type);
309
- }
310
- </script>
311
-
312
- <style lang="scss">
313
- .u-menu-prefix.vxe-input {
314
- height: 34px;
315
- }
316
-
317
- .u-menu-prefix.vxe-input .vxe-input--prefix {
318
- top: 1px;
319
- width: 150px;
320
- height: 24px;
321
- text-align: center;
322
- background-color: #f5f7fa;
323
- border-right: 1px solid #dcdfe6;
324
- }
325
-
326
- .u-menu-prefix.vxe-input .vxe-input--inner {
327
- padding-left: 160px;
328
- border: 1px solid #dcdfe6;
329
- }
330
-
331
- .ut-menu-wrapper {
332
- .el-drawer__header {
333
- margin-bottom: 16px;
334
- }
335
-
336
- .el-drawer__body {
337
- margin-bottom: 12px;
338
- overflow: auto;
339
- }
340
-
341
- .el-divider {
342
- margin: 15px 0;
343
- }
344
- }
345
-
346
- .menu-icon {
347
- display: flex;
348
- flex-wrap: wrap;
349
- width: 100%;
350
-
351
- li {
352
- display: flex;
353
- align-items: center;
354
- justify-content: center;
355
- width: 36px;
356
- height: 36px;
357
- margin: 0 2px;
358
- margin-top: 5px;
359
- cursor: pointer;
360
- border: 1px solid #ddd;
361
- }
362
-
363
- .active-icon {
364
- color: #fff;
365
- background-color: #59bfc1;
366
- }
367
- }
368
- </style>
1
+ <!--
2
+ * @Author: wei.li
3
+ * @Date: 2021-11-17 16:44:08
4
+ * @LastEditors: levi7754 levi7754@163.com
5
+ * @LastEditTime: 2025-08-01 17:38:53
6
+ * @Description: file content
7
+ -->
8
+
9
+ <template>
10
+ <div class="ut-menu-wrapper">
11
+ <el-drawer
12
+ :model-value="show"
13
+ :title="$t('message.title.memuInfo')"
14
+ :before-close="handleClose"
15
+ direction="rtl"
16
+ destroy-on-close
17
+ size="50%"
18
+ >
19
+ <vxe-form
20
+ ref="xForm"
21
+ :data="record"
22
+ :rules="rules"
23
+ :loading="loading"
24
+ title-colon
25
+ title-align="right"
26
+ title-width="110"
27
+ transfer
28
+ >
29
+ <vxe-form-item v-if="record.menuType === '0'" :title="$t('message.menuType')" field="menuCategory" span="24">
30
+ <template #default="{ data }">
31
+ <vxe-select v-model="data.menuCategory" :disabled="data.menuCategory === '0'" :transfer="false">
32
+ <vxe-option
33
+ v-for="dict in getLovList('SU.MENU.TYPE')"
34
+ :key="dict.dictCode"
35
+ :value="dict.dictCode"
36
+ :label="dict.dictName"
37
+ :disabled="dict.enabled"
38
+ />
39
+ </vxe-select>
40
+ </template>
41
+ </vxe-form-item>
42
+ <vxe-form-item :title="$t('message.permissionCode')" field="dispalyCode" span="24">
43
+ <template #default="{ data }">
44
+ <vxe-input
45
+ v-model="data.dispalyCode"
46
+ clearable
47
+ :class="{ 'u-menu-prefix': dataStatus === 'add' }"
48
+ :disabled="dataStatus !== 'add'"
49
+ >
50
+ <template v-if="dataStatus === 'add'" #prefix>
51
+ <span>{{ prefixCode }}</span>
52
+ </template>
53
+ </vxe-input>
54
+ </template>
55
+ </vxe-form-item>
56
+ <vxe-form-item
57
+ v-if="!(record.menuType * 1) && record.menuCategory !== '3'"
58
+ :title="$t('message.menuCode')"
59
+ :item-render="{ name: '$input' }"
60
+ field="menuCode"
61
+ span="24"
62
+ />
63
+ <vxe-form-item :title="$t('message.menuName')" :item-render="{ name: '$input' }" field="menuName" span="24" />
64
+ <vxe-form-item
65
+ :title="$t('message.menuNameEn')"
66
+ field="menuNameEn"
67
+ span="24"
68
+ :item-render="{ name: '$input' }"
69
+ />
70
+ <vxe-form-item
71
+ v-if="!(record.menuType * 1)"
72
+ :title="$t('message.menuPath')"
73
+ :item-render="{ name: '$input' }"
74
+ field="menuPath"
75
+ span="24"
76
+ />
77
+ <vxe-form-item
78
+ v-if="!(record.menuType * 1)"
79
+ :title="$t('message.i18nField')"
80
+ :item-render="{ name: '$input' }"
81
+ field="i18nField"
82
+ span="24"
83
+ />
84
+ <vxe-form-item
85
+ v-if="record.menuCategory === '2'"
86
+ :title="$t('message.frameSrc')"
87
+ :item-render="{ name: '$input' }"
88
+ field="frameSrc"
89
+ span="24"
90
+ />
91
+ <vxe-form-item
92
+ v-if="record.menuCategory === '3'"
93
+ :title="$t('message.externalURI')"
94
+ :item-render="{ name: '$input' }"
95
+ field="menuCode"
96
+ span="24"
97
+ />
98
+ <vxe-form-item
99
+ v-if="!(record.menuType * 1) && record.menuCategory !== '3'"
100
+ :title="$t('message.extraIcon')"
101
+ :item-render="{ name: '$input' }"
102
+ field="extraIcon"
103
+ span="24"
104
+ />
105
+ <vxe-form-item
106
+ v-if="['0', '5'].includes(record.menuCategory)"
107
+ :title="$t('message.redirect')"
108
+ :item-render="{ name: '$input' }"
109
+ field="redirect"
110
+ span="24"
111
+ />
112
+ <vxe-form-item v-if="!(record.menuType * 1)" :title="$t('message.sort')" span="24">
113
+ <template #default="{ data }">
114
+ <vxe-input v-model="data.sort" type="number" step="10" clearable />
115
+ </template>
116
+ </vxe-form-item>
117
+ <vxe-form-item
118
+ v-if="dataStatus === 'add' && ['2', '1'].includes(record.menuCategory)"
119
+ :title="$t('message.btn.auth')"
120
+ >
121
+ <template #default>
122
+ <vxe-checkbox-group v-model="authority">
123
+ <vxe-checkbox label="add" :content="$t('message.btn.add')" />
124
+ <vxe-checkbox label="del" :content="$t('message.btn.delete')" />
125
+ <vxe-checkbox label="edit" :content="$t('message.btn.edit')" />
126
+ <vxe-checkbox label="fetch" :content="$t('message.btn.fetch')" />
127
+ <vxe-checkbox label="export" :content="$t('message.btn.export')" />
128
+ </vxe-checkbox-group>
129
+ </template>
130
+ </vxe-form-item>
131
+ <vxe-form-item v-if="!(record.menuType * 1)" :title="$t('message.icon')" span="24">
132
+ <template #default="{ data }">
133
+ <ut-icon-select v-model="data.icon" />
134
+ </template>
135
+ </vxe-form-item>
136
+ </vxe-form>
137
+ <el-divider />
138
+ <el-row type="flex" justify="end" style="padding-right: 22px">
139
+ <ut-button content="cancel" status="warning" @tap="handleClose" />
140
+ <ut-button content="confirm" status="primary" @tap="onSubmit" />
141
+ </el-row>
142
+ </el-drawer>
143
+ </div>
144
+ </template>
145
+ <script setup lang="ts">
146
+ import { useI18n } from 'vue-i18n';
147
+ import { ref, watch } from 'vue';
148
+ import to from 'await-to-js';
149
+ import { templateRef } from '@vueuse/core';
150
+ import { useSystemStoreHook } from '../../../store/modules/system';
151
+ import { getServiceApi } from '../../../api';
152
+
153
+ interface IProps {
154
+ show: boolean;
155
+ record: IRecord;
156
+ dataStatus?: string;
157
+ direction?: string;
158
+ }
159
+
160
+ const dictData = useSystemStoreHook().getDataDict;
161
+
162
+ const props = withDefaults(defineProps<IProps>(), {
163
+ show: false,
164
+ record: (): IRecord => {
165
+ return {};
166
+ },
167
+ dataStatus: 'detail',
168
+ direction: 'rtl'
169
+ });
170
+
171
+ watch(
172
+ () => props.show,
173
+ () => {
174
+ prefixCode.value = props.show && getPrefixCode();
175
+ }
176
+ );
177
+
178
+ const serviceApi = getServiceApi();
179
+
180
+ const { t } = useI18n();
181
+ const rules = {
182
+ menuCode: [
183
+ {
184
+ required: true,
185
+ message: `${t('message.required')}${t('message.menuCode')}`
186
+ }
187
+ ],
188
+ menuName: [
189
+ {
190
+ required: true,
191
+ message: `${t('message.required')}${t('message.menuName')}`
192
+ }
193
+ ],
194
+ menuPath: [
195
+ {
196
+ required: true,
197
+ message: `${t('message.required')}${t('message.menuPath')}`
198
+ }
199
+ ],
200
+ frameSrc: [
201
+ {
202
+ required: true,
203
+ message: `${t('message.required')}${t('message.externalURI')}`
204
+ }
205
+ ],
206
+ i18nField: [
207
+ {
208
+ required: true,
209
+ message: `${t('message.required')}${t('message.i18nField')}`
210
+ }
211
+ ],
212
+ dispalyCode: [
213
+ {
214
+ required: true,
215
+ message: `${t('message.required')}${t('message.permissionCode')}`
216
+ }
217
+ ],
218
+ menuCategory: [
219
+ {
220
+ required: true,
221
+ message: `${t('message.required')}${t('message.menuType')}`
222
+ }
223
+ ]
224
+ };
225
+
226
+ const xForm = templateRef<any>('xForm', null);
227
+ const loading = ref(false);
228
+ const prefixCode = ref('');
229
+ const authority = ref(['fetch']);
230
+
231
+ const url = '/uums/menu';
232
+
233
+ const emit = defineEmits<{
234
+ (e: 'close', type, data?): void;
235
+ }>();
236
+
237
+ const getPrefixCode = () => {
238
+ const { record, dataStatus } = props;
239
+ const { id, parentId, hasChildren } = record;
240
+ if (dataStatus === 'update') return;
241
+ if (!id && !parentId) return 'su';
242
+ if (hasChildren || dataStatus === 'add') {
243
+ record.dispalyCode = '';
244
+ return record.permissionCode;
245
+ }
246
+ return record.permissionCode;
247
+ };
248
+
249
+ const onSubmit = () => {
250
+ xForm.value.validate(async valid => {
251
+ if (!valid) {
252
+ loading.value = true;
253
+ let resData;
254
+ const { record, dataStatus } = props;
255
+ if (dataStatus === 'add') {
256
+ record.permissionCode = `${prefixCode.value}.${record.dispalyCode}`;
257
+ const [err, data]: [Error, any] = await to(serviceApi.post(url, [record]));
258
+ if (!err && !['0', '5'].includes(record.menuCategory) && authority.value.length) {
259
+ const dataList = authority.value.map((auth, idx) => {
260
+ return {
261
+ permissionCode: record.permissionCode + '.' + auth,
262
+ parentId: data[0].id,
263
+ menuName: getAuthName(auth),
264
+ menuType: 1,
265
+ enabled: '1',
266
+ sort: (idx + 1) * 10
267
+ };
268
+ });
269
+ const [err, res] = await to(serviceApi.post(url, dataList));
270
+ if (!err) {
271
+ // props.record.children.push(...res);
272
+ resData = res[0];
273
+ }
274
+ }
275
+ loading.value = false;
276
+ } else {
277
+ record.permissionCode = record.dispalyCode;
278
+ await to(serviceApi.put(url, [record]));
279
+ loading.value = false;
280
+ resData = record;
281
+ }
282
+ handleClose('submit', resData);
283
+ }
284
+ });
285
+ };
286
+ const getAuthName = code => {
287
+ const auth = {
288
+ fetch: t('message.btn.fetch'),
289
+ add: t('message.btn.add'),
290
+ edit: t('message.btn.edit'),
291
+ del: t('message.btn.delete'),
292
+ export: t('message.btn.export')
293
+ };
294
+ return auth[code];
295
+ };
296
+ const getLovList = code => {
297
+ return dictData[code]?.children.map(m => {
298
+ m.enabled = m.dictCode === '0' && props.record.menuCategory !== '0';
299
+ return m;
300
+ });
301
+ };
302
+ // 抽屉关闭
303
+ function handleClose(type, data) {
304
+ emit('close', type, data);
305
+ }
306
+ </script>
307
+
308
+ <style lang="scss">
309
+ .u-menu-prefix.vxe-input {
310
+ height: 34px;
311
+ }
312
+
313
+ .u-menu-prefix.vxe-input .vxe-input--prefix {
314
+ top: 1px;
315
+ width: 150px;
316
+ height: 24px;
317
+ text-align: center;
318
+ background-color: #f5f7fa;
319
+ border-right: 1px solid #dcdfe6;
320
+ }
321
+
322
+ .u-menu-prefix.vxe-input .vxe-input--inner {
323
+ border: 1px solid #dcdfe6;
324
+ }
325
+
326
+ .ut-menu-wrapper {
327
+ .el-drawer__header {
328
+ margin-bottom: 16px;
329
+ }
330
+
331
+ .el-drawer__body {
332
+ margin-bottom: 12px;
333
+ overflow: auto;
334
+ }
335
+
336
+ .el-divider {
337
+ margin: 15px 0;
338
+ }
339
+ }
340
+
341
+ .menu-icon {
342
+ display: flex;
343
+ flex-wrap: wrap;
344
+ width: 100%;
345
+
346
+ li {
347
+ display: flex;
348
+ align-items: center;
349
+ justify-content: center;
350
+ width: 36px;
351
+ height: 36px;
352
+ margin: 0 2px;
353
+ margin-top: 5px;
354
+ cursor: pointer;
355
+ border: 1px solid #ddd;
356
+ }
357
+
358
+ .active-icon {
359
+ color: #fff;
360
+ background-color: #59bfc1;
361
+ }
362
+ }
363
+ </style>