@utogether/udp-core 1.0.4 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{403-DASI6Pwz.js → 403-CTJDBjz7.js} +1 -1
- package/dist/{404-YhBA92cb.js → 404-BFYkWIkQ.js} +1 -1
- package/dist/{500-ywbFF5MX.js → 500-DGG3qadg.js} +1 -1
- package/dist/{AuthorityInfo-tCSX2Fh7.js → AuthorityInfo-ozZIo1Te.js} +1 -1
- package/dist/{AuthorityInfo.vue_vue_type_style_index_0_lang-Cwd6UT2i.js → AuthorityInfo.vue_vue_type_style_index_0_lang-DujerENw.js} +1 -1
- package/dist/{AuthorityPanel-BeBNiwqc.js → AuthorityPanel-CRlAwbaI.js} +1 -1
- package/dist/{AuthorityPanel.vue_vue_type_style_index_0_lang-CIYmnP9-.js → AuthorityPanel.vue_vue_type_style_index_0_lang-DxhZjp1S.js} +31 -24
- package/dist/{Company-l23MEzdM.js → Company-6VJtwh23.js} +3 -3
- package/dist/{CompanyPanel-D_s0rh6h.js → CompanyPanel-B2P488mq.js} +1 -1
- package/dist/{Department-DSEvORLg.js → Department-BnwoLEOC.js} +3 -3
- package/dist/{DepartmentPanel-WN8nOgCV.js → DepartmentPanel-CRrrmxtv.js} +1 -1
- package/dist/{DesignPanel-DirEGh9M.js → DesignPanel-CvbccgX2.js} +1 -1
- package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-D02hXSrN.js → DesignPanel.vue_vue_type_style_index_0_lang-Dz2tUszs.js} +2 -2
- package/dist/{DictView-DiIQdiek.js → DictView-Ce1LoVHh.js} +17 -16
- package/dist/{InvOrganization-b7v3g9EJ.js → InvOrganization-BwCFZO1X.js} +1 -1
- package/dist/{Org-BORfx1PL.js → Org-0hzs6b0R.js} +1 -1
- package/dist/{Preview-DkRn_TSc.js → Preview--DnEAhwh.js} +1 -1
- package/dist/{ReportDefine-Cd0QeaWA.js → ReportDefine-Cu983bTN.js} +1 -1
- package/dist/{ReportDesign-4qNqyeEW.js → ReportDesign-QsWXXgvo.js} +2 -2
- package/dist/{ReportQuery-BJfTFpec.js → ReportQuery-BjKIIhPu.js} +1 -1
- package/dist/{ReportQueryFrom-CB7sExZx.js → ReportQueryFrom-DIjBO6Fx.js} +1 -1
- package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-CqO_2Ier.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-0T62cUMK.js} +1 -1
- package/dist/{ReportTemplate-B69muSgT.js → ReportTemplate-2uk9tJcy.js} +1 -1
- package/dist/{Role-Bo4YrNDC.js → Role-_QP8QEaI.js} +3 -3
- package/dist/{RoleAssign-kOMYJ4s3.js → RoleAssign-C2gkcmEQ.js} +3 -3
- package/dist/{RolePanel-BSJmjyqc.js → RolePanel-B8FPNGaA.js} +1 -1
- package/dist/{RolePanel-B1d4e6uk.js → RolePanel-vnl_lXNY.js} +1 -1
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-DCzX-ZP_.js → RolePanel.vue_vue_type_script_setup_true_lang-BuQbYEEI.js} +1 -1
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-DgQpfjaU.js → RolePanel.vue_vue_type_script_setup_true_lang-bxHXrBYl.js} +3 -3
- package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-WNOYFxJ1.js → ScrollPanel.vue_vue_type_style_index_0_lang-C6yZXBqB.js} +1 -1
- package/dist/{Staff-BFp3zNNR.js → Staff-CHWrMIEb.js} +3 -3
- package/dist/{StaffInfo-DcU9_40C.js → StaffInfo-Cpq2eayz.js} +1 -1
- package/dist/{StaffInfo.vue_vue_type_script_setup_true_lang-CtfN2CAr.js → StaffInfo.vue_vue_type_script_setup_true_lang-BVCjF2i1.js} +1 -1
- package/dist/{StaffPanel-7exWkZd9.js → StaffPanel-D2BMXt5p.js} +1 -1
- package/dist/{StaffPanel.vue_vue_type_script_setup_true_lang-v5xOXKRS.js → StaffPanel.vue_vue_type_script_setup_true_lang-B6jAGo-g.js} +2 -2
- package/dist/{SysUser-B3uB_cp2.js → SysUser-om6H1BeC.js} +2 -2
- package/dist/{SysUserPanel-B0CLp5AO.js → SysUserPanel-CH0HPP7h.js} +1 -1
- package/dist/{SysUserPanel.vue_vue_type_script_setup_true_lang-Cwea_4dY.js → SysUserPanel.vue_vue_type_script_setup_true_lang-Dpl13ee0.js} +126 -111
- package/dist/{SystemMenu-a59l4hTk.js → SystemMenu-BkG_DKxA.js} +52 -49
- package/dist/{UserInfo-D1IA2oLt.js → UserInfo-D9croxUe.js} +1 -1
- package/dist/{UserInfo.vue_vue_type_style_index_0_lang-DDVgYRD5.js → UserInfo.vue_vue_type_style_index_0_lang-DLIP8xpN.js} +1 -1
- package/dist/{childView-6rCeLcsx.js → childView-BY_Ip-l1.js} +1 -1
- package/dist/{childView-JdrkroL5.js → childView-CHp_TueS.js} +1 -1
- package/dist/{childView.vue_vue_type_style_index_0_lang-BfcnWnx9.js → childView.vue_vue_type_style_index_0_lang-BNHbDRjt.js} +25 -22
- package/dist/{childView.vue_vue_type_style_index_0_lang-B8x99f1B.js → childView.vue_vue_type_style_index_0_lang-CbjGf7Z7.js} +1 -1
- package/dist/{code-rule-2lkPF547.js → code-rule-Ce6yWqCq.js} +1 -1
- package/dist/core.es.js +1 -1
- package/dist/{cron-task-DV1pGO1m.js → cron-task-DziaH0rI.js} +1 -1
- package/dist/{frameView-C0bzSB8c.js → frameView-DNeCVQaY.js} +1 -1
- package/dist/index-BabfUVv_.js +7241 -0
- package/dist/layout-home-Cis1KlEr.js +195 -0
- package/dist/{layoutView-CTV-E4Cj.js → layoutView-12Mlp9A2.js} +144 -145
- package/dist/{log-in-CoBP2x6u.js → log-in-1NGaA5OM.js} +1 -1
- package/dist/{log-out-KX8FiRVf.js → log-out-B8_atGcQ.js} +1 -1
- package/dist/{login-CtCoGWzD.js → login-5dydO6GR.js} +124 -134
- package/dist/{lov-view-Bm0JEzzg.js → lov-view-DPvGUu3h.js} +2 -2
- package/dist/{menuInfo-D2qPoRwz.js → menuInfo-DVADYfEK.js} +1 -1
- package/dist/{menuInfo.vue_vue_type_style_index_0_lang-DoQjX9Ly.js → menuInfo.vue_vue_type_style_index_0_lang-DgsifDrm.js} +37 -35
- package/dist/{pda-app-SbcIclbH.js → pda-app-BZXs-2BQ.js} +1 -1
- package/dist/{resource-Cdq1UKGI.js → resource-BZA9NFKc.js} +1 -1
- package/dist/su-welcome-BXe6Cdp3.js +580 -0
- package/dist/{sys-config-CCOf4xbj.js → sys-config-DQmNjWH4.js} +1 -1
- package/dist/udp-core.css +1 -1
- package/package.json +1 -1
- package/src/App.vue +71 -65
- package/src/components/udp/form-upload/form-upload.vue +492 -0
- package/src/components/udp/index.ts +2 -1
- package/src/layout/components/lay-content/index.vue +136 -143
- package/src/layout/components/lay-sidebar/sidebar-logo.vue +1 -1
- package/src/layout/layoutView.vue +7 -6
- package/src/main.ts +4 -7
- package/src/plugins/i18n/zh.ts +16 -3
- package/src/plugins/vxe-table/render.tsx +19 -1
- package/src/style/vxetable.scss +356 -348
- package/src/views/system/layout/layout-home.vue +199 -0
- package/src/views/system/menu/AuthorityPanel.vue +141 -140
- package/src/views/system/menu/SystemMenu.vue +10 -1
- package/src/views/system/menu/menuInfo.vue +384 -384
- package/src/views/system/sysUser/SysUserPanel.vue +22 -6
- package/src/views/udev/dict/DictView.vue +2 -2
- package/src/views/udev/dict/childView.vue +1 -0
- package/src/views/uhome/dynamic-card.vue +32 -0
- package/src/views/uhome/su-welcome.vue +10 -5
- package/src/views/ulogin/login.vue +34 -23
- package/types/global.d.ts +1 -0
- package/dist/index-BbtbEMCH.js +0 -4649
- package/dist/su-welcome-BHDsjqqV.js +0 -524
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: levi7754 levi7754@163.com
|
|
3
|
+
* @Date: 2025-12-23 11:00:51
|
|
4
|
+
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
+
* @LastEditTime: 2025-12-26 19:10:01
|
|
6
|
+
* @FilePath: \udp-crm\packages\udp-crm\src\views\udev\layout\home-layout.vue
|
|
7
|
+
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
8
|
+
-->
|
|
9
|
+
<template>
|
|
10
|
+
<div>
|
|
11
|
+
<ut-grid ref="xgrid" :items="items" :columns="columns" :url="url" />
|
|
12
|
+
<!-- 角色分配 -->
|
|
13
|
+
<ut-modal-grid
|
|
14
|
+
v-if="showModal"
|
|
15
|
+
ref="ygrid"
|
|
16
|
+
:columns="subColumns"
|
|
17
|
+
mode="form"
|
|
18
|
+
:url="url + '/detail'"
|
|
19
|
+
:title="$t('message.title.layoutRole', { name: data.title })"
|
|
20
|
+
width="50%"
|
|
21
|
+
@buttonClick="onButtonClick"
|
|
22
|
+
/>
|
|
23
|
+
<!-- 角色列表 -->
|
|
24
|
+
<ut-modal-grid
|
|
25
|
+
v-if="showRole"
|
|
26
|
+
ref="xmodal"
|
|
27
|
+
:items="subItems"
|
|
28
|
+
:columns="subColumns"
|
|
29
|
+
:show-footer="true"
|
|
30
|
+
:editable="false"
|
|
31
|
+
:title="$t('message.udp.roleList')"
|
|
32
|
+
url="/uums/role"
|
|
33
|
+
width="60%"
|
|
34
|
+
height="75%"
|
|
35
|
+
@close="showRole = false"
|
|
36
|
+
@confirm="onConfirm"
|
|
37
|
+
/>
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script setup lang="tsx">
|
|
42
|
+
import { ref } from 'vue';
|
|
43
|
+
import { useRender, successMessage, warnMessage } from '@utogether/utils';
|
|
44
|
+
import { to } from 'await-to-js';
|
|
45
|
+
import { clone } from 'xe-utils';
|
|
46
|
+
import { VxeUI } from 'vxe-pc-ui';
|
|
47
|
+
import { useI18n } from 'vue-i18n';
|
|
48
|
+
import { getServiceApi } from '../../../api';
|
|
49
|
+
|
|
50
|
+
defineOptions({ name: 'HomeLayout' });
|
|
51
|
+
|
|
52
|
+
const renderHook = useRender();
|
|
53
|
+
const { t } = useI18n();
|
|
54
|
+
|
|
55
|
+
const xgrid = ref(null);
|
|
56
|
+
const ygrid = ref(null);
|
|
57
|
+
const xmodal = ref(null);
|
|
58
|
+
|
|
59
|
+
const showModal = ref(false);
|
|
60
|
+
const showRole = ref(false);
|
|
61
|
+
|
|
62
|
+
const data = ref<IRecord>({});
|
|
63
|
+
|
|
64
|
+
const url = '/ucrm/sysHomeConfig';
|
|
65
|
+
|
|
66
|
+
const items = [
|
|
67
|
+
{ field: 'code', title: 'message.udp.componentCode' },
|
|
68
|
+
{ field: 'title', title: 'message.udp.componentTitle' }
|
|
69
|
+
];
|
|
70
|
+
|
|
71
|
+
const subItems = [
|
|
72
|
+
{ field: 'roleName', span: 9, title: 'message.udp.roleName' },
|
|
73
|
+
{ field: 'roleCode', span: 9, title: 'message.udp.roleCode' }
|
|
74
|
+
];
|
|
75
|
+
|
|
76
|
+
const options = [
|
|
77
|
+
{ label: 3, value: 3 },
|
|
78
|
+
{ label: 4, value: 4 },
|
|
79
|
+
{ label: 6, value: 6 },
|
|
80
|
+
{ label: 8, value: 8 },
|
|
81
|
+
{ label: 12, value: 12 },
|
|
82
|
+
{ label: 24, value: 24 }
|
|
83
|
+
];
|
|
84
|
+
|
|
85
|
+
// 列字段
|
|
86
|
+
const columns = [
|
|
87
|
+
{ type: 'checkbox', width: 50, align: 'center' },
|
|
88
|
+
{ field: 'seqNo', required: true, width: 100, editRender: renderHook.renderNumber({ min: 10, step: 10 }) },
|
|
89
|
+
{
|
|
90
|
+
field: 'code',
|
|
91
|
+
title: 'message.udp.componentCode',
|
|
92
|
+
width: 120,
|
|
93
|
+
required: true,
|
|
94
|
+
editRender: renderHook.renderInput()
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
field: 'title',
|
|
98
|
+
title: 'message.udp.componentTitle',
|
|
99
|
+
minWidth: 150,
|
|
100
|
+
required: true,
|
|
101
|
+
editRender: renderHook.renderInput()
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
field: 'span',
|
|
105
|
+
title: 'message.udp.componentSpan',
|
|
106
|
+
required: true,
|
|
107
|
+
width: 160,
|
|
108
|
+
editRender: renderHook.renderSelectLocal({ options })
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
field: 'height',
|
|
112
|
+
title: 'message.udp.componentHeight',
|
|
113
|
+
required: true,
|
|
114
|
+
editRender: renderHook.renderNumber({ min: 300 })
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
field: 'url',
|
|
118
|
+
title: 'message.udp.componentPath',
|
|
119
|
+
required: true,
|
|
120
|
+
minWidth: 150,
|
|
121
|
+
editRender: renderHook.renderInput()
|
|
122
|
+
},
|
|
123
|
+
{ field: 'enabled', width: 90, formatter: ['formatDict', 'SU.ENABLE'] },
|
|
124
|
+
{
|
|
125
|
+
field: 'operate',
|
|
126
|
+
width: 140,
|
|
127
|
+
fixed: 'right',
|
|
128
|
+
slots: {
|
|
129
|
+
default: ({ row }) => {
|
|
130
|
+
if (!row.id) return;
|
|
131
|
+
const enabled = {
|
|
132
|
+
conent: row.enabled === '1' ? 'disabled' : 'enable',
|
|
133
|
+
status: row.enabled === '1' ? 'warning' : 'success',
|
|
134
|
+
icon: row.enabled === '1' ? 'ri-pause-circle-line' : 'ri-play-circle-line'
|
|
135
|
+
};
|
|
136
|
+
return [
|
|
137
|
+
<>
|
|
138
|
+
<ut-button content="role" auth="role" icon="ri-user-line" onTap={() => handleRole(row)} />
|
|
139
|
+
<ut-button content={enabled.conent} {...enabled} onTap={() => handleRowStatus(row)} />
|
|
140
|
+
</>
|
|
141
|
+
];
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
];
|
|
146
|
+
|
|
147
|
+
const subColumns = [
|
|
148
|
+
{ type: 'checkbox', width: 40 },
|
|
149
|
+
{ field: 'roleName', title: 'message.udp.roleName' },
|
|
150
|
+
{ field: 'roleCode', title: 'message.udp.roleCode' }
|
|
151
|
+
];
|
|
152
|
+
|
|
153
|
+
const handleRole = row => {
|
|
154
|
+
data.value = row;
|
|
155
|
+
showModal.value = true;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
const handleAdd = () => {
|
|
159
|
+
showRole.value = true;
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
const handleRowStatus = async row => {
|
|
163
|
+
const message = row.enabled === '1' ? 'tip_disabledrecord' : 'tip_enabledrecord';
|
|
164
|
+
const type = await VxeUI.modal.confirm(t(`message.${message}`));
|
|
165
|
+
if (type === 'confirm') {
|
|
166
|
+
const body = clone(row, true);
|
|
167
|
+
body.enabled = body.enabled === '1' ? '0' : '1';
|
|
168
|
+
const [err] = await to(getServiceApi().put(url, [body]));
|
|
169
|
+
if (err) return;
|
|
170
|
+
successMessage();
|
|
171
|
+
xgrid.value.refreshData();
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
const handleDel = () => {
|
|
176
|
+
const selectRecords = ygrid.value.getSelectRecords();
|
|
177
|
+
if (!selectRecords.length) return;
|
|
178
|
+
ygrid.value.getInstance().commitProxy('delete');
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
const onConfirm = async records => {
|
|
182
|
+
if (records.length === 0) return warnMessage('message.tip.selectRole');
|
|
183
|
+
records.forEach(m => {
|
|
184
|
+
m.systemConfigId = data.value.id;
|
|
185
|
+
});
|
|
186
|
+
xmodal.value.showLoading();
|
|
187
|
+
const [err] = await to(getServiceApi().post(url + '/detail', records));
|
|
188
|
+
if (!err) {
|
|
189
|
+
successMessage();
|
|
190
|
+
ygrid.value.refreshData();
|
|
191
|
+
showRole.value = false;
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
const onButtonClick = code => {
|
|
196
|
+
code === 'add' && handleAdd();
|
|
197
|
+
code === 'del' && handleDel();
|
|
198
|
+
};
|
|
199
|
+
</script>
|
|
@@ -1,140 +1,141 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: wei.li
|
|
3
|
-
* @Date: 2022-08-05 10:05:27
|
|
4
|
-
* @LastEditors:
|
|
5
|
-
* @LastEditTime:
|
|
6
|
-
* @Description: 菜单权限列表
|
|
7
|
-
-->
|
|
8
|
-
<template>
|
|
9
|
-
<div class="u-dict-config_wrapper">
|
|
10
|
-
<el-drawer
|
|
11
|
-
:model-value="show"
|
|
12
|
-
:before-close="handleClose"
|
|
13
|
-
title="权限明细"
|
|
14
|
-
direction="rtl"
|
|
15
|
-
destroy-on-close
|
|
16
|
-
size="66%"
|
|
17
|
-
>
|
|
18
|
-
<ut-grid
|
|
19
|
-
ref="SuGridRef"
|
|
20
|
-
:columns="columns"
|
|
21
|
-
url="/uums/menu"
|
|
22
|
-
:default-params="{ parentId: record.id }"
|
|
23
|
-
:default-value="{ parentId: record.id, menuType: 1 }"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
import {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
() =>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
{
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
const {
|
|
99
|
-
|
|
100
|
-
if (
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: wei.li
|
|
3
|
+
* @Date: 2022-08-05 10:05:27
|
|
4
|
+
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
+
* @LastEditTime: 2025-12-20 08:03:07
|
|
6
|
+
* @Description: 菜单权限列表
|
|
7
|
+
-->
|
|
8
|
+
<template>
|
|
9
|
+
<div class="u-dict-config_wrapper">
|
|
10
|
+
<el-drawer
|
|
11
|
+
:model-value="show"
|
|
12
|
+
:before-close="handleClose"
|
|
13
|
+
title="权限明细"
|
|
14
|
+
direction="rtl"
|
|
15
|
+
destroy-on-close
|
|
16
|
+
size="66%"
|
|
17
|
+
>
|
|
18
|
+
<ut-grid
|
|
19
|
+
ref="SuGridRef"
|
|
20
|
+
:columns="columns"
|
|
21
|
+
url="/uums/menu"
|
|
22
|
+
:default-params="{ parentId: record.id }"
|
|
23
|
+
:default-value="{ parentId: record.id, menuType: 1 }"
|
|
24
|
+
:pager-config="{ layouts: [] }"
|
|
25
|
+
/>
|
|
26
|
+
</el-drawer>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script setup lang="tsx">
|
|
31
|
+
import { ref, watch } from 'vue';
|
|
32
|
+
import { useRender } from '@utogether/utils';
|
|
33
|
+
|
|
34
|
+
interface IProps {
|
|
35
|
+
record: IRecord;
|
|
36
|
+
show: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const props = withDefaults(defineProps<IProps>(), {
|
|
40
|
+
record: (): IRecord => {
|
|
41
|
+
return {};
|
|
42
|
+
},
|
|
43
|
+
show: false
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
watch(
|
|
47
|
+
() => props.show,
|
|
48
|
+
() => {
|
|
49
|
+
prefixCode.value = props.show && getPrefixCode();
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
const prefixCode = ref('');
|
|
54
|
+
|
|
55
|
+
const renderHook = useRender();
|
|
56
|
+
|
|
57
|
+
// 列字段
|
|
58
|
+
const columns = [
|
|
59
|
+
{ type: 'checkbox', width: 50, align: 'center' },
|
|
60
|
+
{
|
|
61
|
+
field: 'menuName',
|
|
62
|
+
title: 'message.permissionName',
|
|
63
|
+
required: true,
|
|
64
|
+
editRender: renderHook.renderInput()
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
field: 'permissionCode',
|
|
68
|
+
required: true,
|
|
69
|
+
minWidth: 180,
|
|
70
|
+
editRender: renderHook.renderInput(),
|
|
71
|
+
slots: {
|
|
72
|
+
edit: ({ row }) => {
|
|
73
|
+
const slots = {
|
|
74
|
+
prefix: () => <span>{prefixCode.value}.</span>
|
|
75
|
+
};
|
|
76
|
+
row.dispalyCode = row.permissionCode?.replace(`${prefixCode.value}.`, '');
|
|
77
|
+
return [
|
|
78
|
+
<vxe-input v-model={row.dispalyCode} v-slots={slots} className="ut-slot-input" onInput={() => onInput(row)} />
|
|
79
|
+
];
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
field: 'remark',
|
|
85
|
+
title: 'message.udp.description',
|
|
86
|
+
editRender: renderHook.renderInput()
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
field: 'enabled',
|
|
90
|
+
title: 'message.enabled',
|
|
91
|
+
width: 90,
|
|
92
|
+
editRender: renderHook.renderDict({ code: 'SU.ENABLE', defaultValue: '1' }),
|
|
93
|
+
formatter: ['formatDict', 'SU.ENABLE']
|
|
94
|
+
}
|
|
95
|
+
];
|
|
96
|
+
|
|
97
|
+
const getPrefixCode = () => {
|
|
98
|
+
const { record } = props;
|
|
99
|
+
const { id, parentId, hasChildren } = record;
|
|
100
|
+
if (!id && !parentId) return 'su';
|
|
101
|
+
if (hasChildren) {
|
|
102
|
+
record.dispalyCode = '';
|
|
103
|
+
return record.permissionCode;
|
|
104
|
+
}
|
|
105
|
+
return record.permissionCode;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const onInput = record => {
|
|
109
|
+
record.permissionCode = `${prefixCode.value}.${record.dispalyCode}`;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const emit = defineEmits<{ (e: 'close'): void }>();
|
|
113
|
+
// 抽屉关闭
|
|
114
|
+
function handleClose() {
|
|
115
|
+
emit('close');
|
|
116
|
+
}
|
|
117
|
+
</script>
|
|
118
|
+
|
|
119
|
+
<style lang="scss">
|
|
120
|
+
.u-dict-config_wrapper {
|
|
121
|
+
.el-drawer__header {
|
|
122
|
+
margin-bottom: 0;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.ut-slot-input {
|
|
126
|
+
.vxe-input--inner {
|
|
127
|
+
width: auto;
|
|
128
|
+
max-width: 66%;
|
|
129
|
+
padding-left: 0.5em;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.vxe-input--prefix {
|
|
133
|
+
display: contents;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.ut-disable-text {
|
|
138
|
+
background-color: #fefefe;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
</style>
|
|
@@ -163,8 +163,17 @@ async function handleUpdate({ row }) {
|
|
|
163
163
|
const handleDel = async () => {
|
|
164
164
|
const type = await VxeUI.modal.confirm(t('message.delRecord'));
|
|
165
165
|
const records = xgrid.value.getInstance().getCheckboxRecords();
|
|
166
|
+
console.log(records);
|
|
166
167
|
if (type === 'confirm') {
|
|
167
|
-
const [err] = await to(serviceApi.delete(url, records));
|
|
168
|
+
const [err, res] = await to(serviceApi.delete(url, records));
|
|
169
|
+
console.log(res);
|
|
170
|
+
if (err) return;
|
|
171
|
+
const parent = xgrid.value.getInstance().getTreeParentRow(records[0]);
|
|
172
|
+
if (parent) {
|
|
173
|
+
xgrid.value.getInstance().reloadTreeExpand(parent);
|
|
174
|
+
} else {
|
|
175
|
+
xgrid.value.refreshData();
|
|
176
|
+
}
|
|
168
177
|
}
|
|
169
178
|
};
|
|
170
179
|
|