@utogether/udp-core 1.0.1-beta.15 → 1.0.1-beta.17
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-DpJevH-h.js → 403-C3cfjZIT.js} +1 -1
- package/dist/{404-BpqJK3YD.js → 404-Bg3j7QIo.js} +1 -1
- package/dist/{500-DyvRbMD_.js → 500-CMT7Zyy7.js} +1 -1
- package/dist/{AuthorityInfo-Cyu4XHXx.js → AuthorityInfo-B1mvqs4x.js} +1 -1
- package/dist/{AuthorityInfo.vue_vue_type_style_index_0_lang-BxmnEEFq.js → AuthorityInfo.vue_vue_type_style_index_0_lang-DwoW7QWO.js} +3 -3
- package/dist/{Company-BLygcYrI.js → Company-qTguidK8.js} +3 -3
- package/dist/{CompanyPanel-D5Tgw6LF.js → CompanyPanel-BBC-o-k3.js} +17 -17
- package/dist/{Department-qI9OninZ.js → Department-C3mKZOnK.js} +3 -3
- package/dist/{DepartmentPanel-P-P8fPZQ.js → DepartmentPanel-CNdpOHBT.js} +25 -25
- package/dist/{DesignPanel-BxjD0AZi.js → DesignPanel-D9jrRCoG.js} +1 -1
- package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-DN_OKxCu.js → DesignPanel.vue_vue_type_style_index_0_lang-A-Aj1Hl0.js} +6 -6
- package/dist/{DictView-PWL_Vf0T.js → DictView-CgdVkSiP.js} +15 -16
- package/dist/{InvOrganization-JXBXyn3G.js → InvOrganization-RE7s3vBq.js} +1 -1
- package/dist/{Org-DcTJn6YQ.js → Org-wXDGvTrS.js} +3 -3
- package/dist/{Preview-IKvbHI8a.js → Preview-Pvt1__BV.js} +1 -1
- package/dist/{ReportDefine-_G7ts7Ch.js → ReportDefine-xEQsgFyv.js} +1 -1
- package/dist/{ReportDesign-7h5oFklh.js → ReportDesign-jOSuEFH9.js} +9 -9
- package/dist/{ReportQuery-dj0BQUyi.js → ReportQuery-DxEmmGiN.js} +1 -1
- package/dist/{ReportQueryFrom-6WaZPg9i.js → ReportQueryFrom-CFlxfS5M.js} +1 -1
- package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-ChhcBPqa.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-iHpiYz8f.js} +1 -1
- package/dist/{ReportTemplate-DIvJ3RrB.js → ReportTemplate-Dtz3aet7.js} +11 -11
- package/dist/{Role-ia_3qAZU.js → Role-B_NsHIyE.js} +3 -3
- package/dist/{RoleAssign-D0zVl4y3.js → RoleAssign-C9wm4zq4.js} +8 -8
- package/dist/{RolePanel-CQxOiAzj.js → RolePanel-BlHidBR0.js} +1 -1
- package/dist/{RolePanel-BiGGmP2w.js → RolePanel-DWM9mfNs.js} +1 -1
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-BYDLRS_x.js → RolePanel.vue_vue_type_script_setup_true_lang-Cn4RRzXm.js} +1 -1
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-Dwv5LFbf.js → RolePanel.vue_vue_type_script_setup_true_lang-DVQ9aqb1.js} +9 -9
- package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-gPP4duO8.js → ScrollPanel.vue_vue_type_style_index_0_lang-CCm-_i8O.js} +8 -8
- package/dist/{Staff-Bf_oUqF6.js → Staff-BfDc61QS.js} +3 -3
- package/dist/{StaffInfo-D5aisjx2.js → StaffInfo-BaJFo4mg.js} +1 -1
- package/dist/{StaffInfo.vue_vue_type_script_setup_true_lang-6PX7Bx6A.js → StaffInfo.vue_vue_type_script_setup_true_lang-Bwj4x1wu.js} +7 -7
- package/dist/{StaffPanel--zKzd4rt.js → StaffPanel-B6I2ZS6A.js} +1 -1
- package/dist/{StaffPanel.vue_vue_type_script_setup_true_lang-BWZSIFpq.js → StaffPanel.vue_vue_type_script_setup_true_lang-vbyS4w3V.js} +2 -2
- package/dist/{SysUser-BelbESLR.js → SysUser-B_r9LYc5.js} +2 -2
- package/dist/{SysUserPanel-BixKqQcA.js → SysUserPanel-C4ajcHPV.js} +1 -1
- package/dist/{SysUserPanel.vue_vue_type_script_setup_true_lang-BhaWZEfo.js → SysUserPanel.vue_vue_type_script_setup_true_lang-8Q0VvC9B.js} +41 -37
- package/dist/{SystemMenu-D40tzcSj.js → SystemMenu-CyPG23uP.js} +10 -10
- package/dist/{UserInfo-DTyk071j.js → UserInfo-BkoGt4ib.js} +1 -1
- package/dist/{UserInfo.vue_vue_type_style_index_0_lang-p9MByikC.js → UserInfo.vue_vue_type_style_index_0_lang-DrzF1YYG.js} +10 -10
- package/dist/{childView-so5qSxr0.js → childView-9vEO8ymO.js} +1 -1
- package/dist/{childView-xL3iE1yN.js → childView-Dh0NyiQe.js} +1 -1
- package/dist/{childView.vue_vue_type_style_index_0_lang-CKcXpSqa.js → childView.vue_vue_type_style_index_0_lang-BOeoZuAK.js} +7 -7
- package/dist/{childView.vue_vue_type_style_index_0_lang-DK1ei5uM.js → childView.vue_vue_type_style_index_0_lang-CMOjfXBX.js} +1 -1
- package/dist/{code-rule-DC35y76w.js → code-rule-C7jI_1gJ.js} +6 -6
- package/dist/core.es.js +17 -12
- package/dist/{cron-task-BhjQ4S68.js → cron-task-Dg9DJXvv.js} +11 -11
- package/dist/{frameView-G_zhG9pf.js → frameView-CeR-_hjB.js} +1 -1
- package/dist/{index-C6ehxLLO.js → index-Bb7gIEvu.js} +739 -496
- package/dist/{layoutView-CO2U8qCQ.js → layoutView-wsLHrEeX.js} +1347 -1346
- package/dist/login-CluzzdqH.js +249 -0
- package/dist/{lov-view-Cr929NMD.js → lov-view-BvQCvwbW.js} +5 -5
- package/dist/{menuInfo-BWuROp7u.js → menuInfo-B8RLelIC.js} +1 -1
- package/dist/{menuInfo.vue_vue_type_style_index_0_lang-9nouHUjO.js → menuInfo.vue_vue_type_style_index_0_lang-DvkapEZr.js} +7 -7
- package/dist/{pda-app-CQP1sMAI.js → pda-app-D3LNmD9a.js} +19 -19
- package/dist/{resource-BDQLrMpK.js → resource-D8JA_03-.js} +7 -7
- package/dist/{su-welcome-CZysrZQ1.js → su-welcome-BjxeEKSo.js} +88 -88
- package/dist/{sys-config-BiGNMYSA.js → sys-config-sbeLk9bP.js} +6 -6
- package/dist/udp-core.css +1 -9
- package/dist/utogether-MlnyYtNS.js +4 -0
- package/index.ts +48 -40
- 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} +27 -24
- package/src/components/udp/index.ts +2 -9
- package/src/components/udp/utils.ts +60 -107
- 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 +92 -92
- package/src/layout/components/lay-tag/index.vue +20 -48
- package/src/layout/hooks/useNav.ts +173 -173
- package/src/layout/hooks/useTag.ts +223 -233
- package/src/layout/types.ts +3 -2
- package/src/main.ts +117 -113
- package/src/plugins/i18n/en.ts +302 -302
- package/src/plugins/i18n/zh.ts +356 -354
- package/src/plugins/vxe-table/index.ts +116 -53
- package/src/plugins/vxe-table/render.tsx +956 -956
- 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 +1 -1
- package/src/style/vxetable.scss +25 -2
- package/src/utils/index.ts +3 -1
- 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 +2 -2
- package/src/views/upms/interface/log-out.vue +101 -101
- package/src/views/urpt/design/DesignPanel.vue +507 -507
- package/types/global.d.ts +2 -8
- package/dist/login-DzyK2soP.js +0 -278
- package/dist/utogether-BRirriOz.js +0 -182
- 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>
|