@utogether/udp-core 1.0.1-beta.16 → 1.0.1-beta.18
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/build/plugins.ts +39 -39
- package/dist/{403-RBzulrcG.js → 403-B8xAGW0x.js} +1 -1
- package/dist/{404-DX-dU_6C.js → 404-BtgajMpP.js} +1 -1
- package/dist/{500-BCTk0__d.js → 500-DFWWZylZ.js} +1 -1
- package/dist/{AuthorityInfo-BADTOenq.js → AuthorityInfo-BxWSZs7n.js} +1 -1
- package/dist/{AuthorityInfo.vue_vue_type_style_index_0_lang-Cv46yAx_.js → AuthorityInfo.vue_vue_type_style_index_0_lang-XIiFdjxN.js} +1 -1
- package/dist/{Company-B-61KrWd.js → Company-BbUJtuvr.js} +3 -3
- package/dist/{CompanyPanel-CawSrEff.js → CompanyPanel-KOOFrGjk.js} +8 -8
- package/dist/{Department-CrzJPtvP.js → Department-BimSgBm2.js} +3 -3
- package/dist/{DepartmentPanel-DYuL8H-j.js → DepartmentPanel-DYXPUCDs.js} +3 -3
- package/dist/{DesignPanel-DEAv6V68.js → DesignPanel-CHZ36J4q.js} +1 -1
- package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-BsnXZ2td.js → DesignPanel.vue_vue_type_style_index_0_lang-ZbNixuuY.js} +2 -2
- package/dist/{DictView-BuO-2b-c.js → DictView-7RQYVj4H.js} +1 -1
- package/dist/{InvOrganization-CBgKBJAn.js → InvOrganization-esq9FI1K.js} +1 -1
- package/dist/{Org-BaQw2r-o.js → Org-BGswGV9g.js} +1 -1
- package/dist/{Preview-DvCrmKNk.js → Preview-DP0pD6Kf.js} +1 -1
- package/dist/{ReportDefine-DyhWz0as.js → ReportDefine-1rjKlbK-.js} +1 -1
- package/dist/{ReportDesign-DgZ2f2zv.js → ReportDesign-BIUj35Kh.js} +2 -2
- package/dist/{ReportQuery-DTZYbCDi.js → ReportQuery-CWevStRg.js} +1 -1
- package/dist/{ReportQueryFrom-B-vtJegP.js → ReportQueryFrom-vlOF5_gc.js} +1 -1
- package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-D6izgxph.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-BGyeoYxo.js} +1 -1
- package/dist/{ReportTemplate-DA1ZqKGf.js → ReportTemplate-BPURQOFZ.js} +1 -1
- package/dist/{Role-mbqoav5t.js → Role-D8xJ3rai.js} +3 -3
- package/dist/{RoleAssign-ltEJIEcr.js → RoleAssign-CE5FeHLd.js} +8 -8
- package/dist/{RolePanel-u90v9eS0.js → RolePanel-B6wskQVB.js} +1 -1
- package/dist/{RolePanel-1g1a-G8D.js → RolePanel-CqHsGjrK.js} +1 -1
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-LC4Egk-Q.js → RolePanel.vue_vue_type_script_setup_true_lang-Bjoq-nCm.js} +3 -3
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-D9YxpGnt.js → RolePanel.vue_vue_type_script_setup_true_lang-Dv5IVELj.js} +1 -1
- package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-DZ3W1epK.js → ScrollPanel.vue_vue_type_style_index_0_lang-Bp8Y_5A2.js} +1 -1
- package/dist/{Staff-CJ2GgCL3.js → Staff-DuYrik71.js} +3 -3
- package/dist/{StaffInfo-3KkodDCK.js → StaffInfo-CZiak-1b.js} +1 -1
- package/dist/{StaffInfo.vue_vue_type_script_setup_true_lang-CW-isIxJ.js → StaffInfo.vue_vue_type_script_setup_true_lang-LCuqxUh8.js} +1 -1
- package/dist/{StaffPanel-DoXPSoY5.js → StaffPanel-DI6MBAJH.js} +1 -1
- package/dist/{StaffPanel.vue_vue_type_script_setup_true_lang-DvhGnOMZ.js → StaffPanel.vue_vue_type_script_setup_true_lang-DxJhnVpd.js} +2 -2
- package/dist/{SysUser-BuIZhMPh.js → SysUser-DoNj2tIV.js} +2 -2
- package/dist/{SysUserPanel-t1GJcJGM.js → SysUserPanel-CvfyRxel.js} +1 -1
- package/dist/{SysUserPanel.vue_vue_type_script_setup_true_lang-CDDkFLlN.js → SysUserPanel.vue_vue_type_script_setup_true_lang-BoghL7F3.js} +43 -39
- package/dist/{SystemMenu-DuLEL6_l.js → SystemMenu-Cr3vUEQU.js} +2 -2
- package/dist/{UserInfo-WWby4lts.js → UserInfo-6c8UDIVO.js} +1 -1
- package/dist/{UserInfo.vue_vue_type_style_index_0_lang-B06ZSrJV.js → UserInfo.vue_vue_type_style_index_0_lang-DstUSeNQ.js} +1 -1
- package/dist/{childView-B0-EAoAi.js → childView-BlmHw5jv.js} +1 -1
- package/dist/{childView-IYY4L8VK.js → childView-C050pf1v.js} +1 -1
- package/dist/{childView.vue_vue_type_style_index_0_lang-B56v6yK7.js → childView.vue_vue_type_style_index_0_lang-BxLT1Dz0.js} +1 -1
- package/dist/{childView.vue_vue_type_style_index_0_lang-CjF8nZuj.js → childView.vue_vue_type_style_index_0_lang-D0nlTIP-.js} +2 -2
- package/dist/{code-rule-DDLdi3pP.js → code-rule-Br1Mh3_M.js} +1 -1
- package/dist/core.es.js +1 -1
- package/dist/{cron-task-p3-AFN1w.js → cron-task-DhuIk5pP.js} +1 -1
- package/dist/{frameView-B_WAZErD.js → frameView-hJoSI0Ai.js} +1 -1
- package/dist/index-1dgWFXT2.js +5436 -0
- package/dist/{layoutView-CoEp2afn.js → layoutView-DU-TVfOp.js} +1340 -1337
- package/dist/{login-DP0oP70W.js → login-CzJBV0x8.js} +2 -2
- package/dist/{lov-view-BDoZRK-v.js → lov-view-BxaHaVKE.js} +2 -2
- package/dist/{menuInfo-5Xls76qB.js → menuInfo-Dp7nAbgM.js} +1 -1
- package/dist/{menuInfo.vue_vue_type_style_index_0_lang-BfZczW9a.js → menuInfo.vue_vue_type_style_index_0_lang-Ch4NbiCL.js} +1 -1
- package/dist/{pda-app-DxGYn4G7.js → pda-app-BmxY3H7y.js} +2 -2
- package/dist/{resource-BnYWe_-Q.js → resource-D2dCI_x9.js} +1 -1
- package/dist/{su-welcome-B2rNhhDH.js → su-welcome-BKGU5HUf.js} +1 -1
- package/dist/{sys-config-Bb4WkxZK.js → sys-config-s8DnZMOd.js} +1 -1
- package/dist/udp-core.css +1 -9
- package/index.ts +48 -48
- package/package.json +1 -1
- package/src/App.vue +65 -65
- package/src/components/SuCharts/src/UserInfo.vue +78 -78
- package/src/components/SuScrollTree/ScrollPanel.vue +170 -175
- package/src/components/udp/{grid.vue → grid/index.vue} +39 -25
- package/src/components/udp/index.ts +2 -9
- package/src/components/udp/utils.ts +63 -108
- package/src/layout/components/lay-navbar/index.vue +239 -239
- package/src/layout/components/lay-panel/index.vue +150 -150
- package/src/layout/components/lay-search/index.vue +25 -25
- package/src/layout/components/lay-select-org/index.vue +64 -64
- package/src/layout/components/lay-sidebar/horizontal.vue +190 -190
- package/src/layout/components/lay-sidebar/mixNav.vue +260 -260
- package/src/layout/components/lay-sidebar/sidebar-logo.vue +1 -0
- package/src/layout/components/lay-tag/index.vue +20 -48
- package/src/layout/hooks/useNav.ts +173 -173
- package/src/layout/hooks/useTag.ts +5 -3
- package/src/layout/types.ts +3 -2
- package/src/main.ts +24 -21
- package/src/plugins/i18n/en.ts +302 -302
- package/src/plugins/i18n/zh.ts +356 -354
- package/src/plugins/vxe-table/index.ts +67 -4
- package/src/plugins/vxe-table/render.tsx +18 -29
- package/src/router/index.ts +186 -177
- package/src/router/modules/remaining.ts +58 -58
- package/src/router/utils.ts +393 -377
- package/src/store/modules/app.ts +1 -3
- package/src/store/modules/multiTags.ts +110 -109
- package/src/store/modules/permission.ts +113 -100
- package/src/style/button.scss +85 -85
- package/src/style/login.css +336 -336
- package/src/style/vxetable.scss +338 -321
- package/src/views/organization/company/CompanyPanel.vue +259 -259
- package/src/views/organization/department/DepartmentPanel.vue +269 -283
- package/src/views/system/menu/SystemMenu.vue +183 -183
- package/src/views/system/menu/menuInfo.vue +363 -363
- package/src/views/system/role/UserInfo.vue +195 -195
- package/src/views/system/role-assign/RoleAssign.vue +57 -57
- package/src/views/system/role-assign/RolePanel.vue +139 -139
- package/src/views/system/sys/sys-config.vue +336 -336
- package/src/views/system/sysUser/SysUserPanel.vue +279 -278
- package/src/views/uapp/pda/pda-app.vue +208 -208
- package/src/views/udev/dict/DictView.vue +118 -118
- package/src/views/udev/dict/childView.vue +1 -1
- package/src/views/udev/lov/lov-view.vue +91 -91
- package/src/views/ulogin/login.vue +323 -323
- package/src/views/upms/interface/log-out.vue +101 -101
- package/src/views/urpt/design/DesignPanel.vue +507 -507
- package/types/global.d.ts +230 -230
- package/dist/index-24fnvUBy.js +0 -2822
- package/src/components/udp/count-down.vue +0 -536
- package/src/components/udp/flip-down/FlipCard/flip-card.vue +0 -251
- package/src/components/udp/flip-down/FlipCard/interfaces.ts +0 -4
- package/src/components/udp/flip-down/FlipClock/flip-clock.vue +0 -113
- package/src/components/udp/form-upload.vue +0 -482
- package/src/components/udp/form.vue +0 -112
- package/src/components/udp/lov.vue +0 -388
- package/src/components/udp/modal-form.vue +0 -190
- package/src/components/udp/modal-grid.vue +0 -298
- package/src/components/udp/upload.vue +0 -423
- package/src/utils/udp/http/index.ts +0 -294
- package/src/utils/udp/http/types.d.ts +0 -49
- package/src/utils/udp/useRender.ts +0 -431
|
@@ -1,363 +1,363 @@
|
|
|
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>
|
|
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>
|