@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,259 +1,259 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: wei.li
|
|
3
|
-
* @Date: 2021-11-19 21:14:41
|
|
4
|
-
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
-
* @LastEditTime: 2025-04-08 15:48:36
|
|
6
|
-
* @Description: 租户管理
|
|
7
|
-
-->
|
|
8
|
-
|
|
9
|
-
<template>
|
|
10
|
-
<div class="page-content">
|
|
11
|
-
<!-- 工具栏 -->
|
|
12
|
-
<vxe-toolbar perfect class="">
|
|
13
|
-
<template #buttons>
|
|
14
|
-
<ut-button status="u-cyan" icon="ri-add-line" content="add" @tap="handleAdd()" />
|
|
15
|
-
<ut-button status="primary" icon="ri-edit-box-line" content="edit" @tap="handleEdit('update')" />
|
|
16
|
-
<ut-button status="danger" icon="ri-close-fill" content="delete" @tap="handleDelete()" />
|
|
17
|
-
</template>
|
|
18
|
-
</vxe-toolbar>
|
|
19
|
-
<el-row
|
|
20
|
-
v-if="data.dialogFormVisible"
|
|
21
|
-
type="flex"
|
|
22
|
-
justify="center"
|
|
23
|
-
align="middle"
|
|
24
|
-
class="w-departInfo-wrapper"
|
|
25
|
-
>
|
|
26
|
-
<el-card width="60%" shadow="always" class="box-card w-card-wrapper">
|
|
27
|
-
<div class="clearfix">
|
|
28
|
-
<span class="w-card-title" />
|
|
29
|
-
</div>
|
|
30
|
-
<el-row>
|
|
31
|
-
<vxe-form ref="xForm" :data="data.record" :rules="rules" label-width="80px">
|
|
32
|
-
<vxe-form-item
|
|
33
|
-
:title="$t('message.udp.unitName')"
|
|
34
|
-
field="unitName"
|
|
35
|
-
:item-render="{ name: '$input', props: { disabled: data.dataStatus === 'detail' } }"
|
|
36
|
-
:span="24"
|
|
37
|
-
/>
|
|
38
|
-
<vxe-form-item
|
|
39
|
-
:title="$t('message.udp.unitCode')"
|
|
40
|
-
field="unitCode"
|
|
41
|
-
:item-render="{ name: '$input', props: { disabled: data.dataStatus !== 'add' } }"
|
|
42
|
-
:span="24"
|
|
43
|
-
/>
|
|
44
|
-
<vxe-form-item
|
|
45
|
-
:title="$t('message.udp.unitNote')"
|
|
46
|
-
field="unitNote"
|
|
47
|
-
:item-render="{ name: '$input', props: { disabled: data.dataStatus === 'detail' } }"
|
|
48
|
-
:span="24"
|
|
49
|
-
/>
|
|
50
|
-
</vxe-form>
|
|
51
|
-
</el-row>
|
|
52
|
-
<el-row type="flex" justify="center">
|
|
53
|
-
<vxe-checkbox
|
|
54
|
-
v-if="data.dataStatus === 'add'"
|
|
55
|
-
v-model="data.isChecked"
|
|
56
|
-
style="padding-top: 5px; margin-right: 8px"
|
|
57
|
-
>{{ $t('message.udp.continueAdd') }}</vxe-checkbox
|
|
58
|
-
>
|
|
59
|
-
<vxe-button
|
|
60
|
-
v-if="data.dataStatus !== 'detail'"
|
|
61
|
-
status="primary"
|
|
62
|
-
:content="$t('message.btn.confirm')"
|
|
63
|
-
@click="handleComfirm"
|
|
64
|
-
/>
|
|
65
|
-
<vxe-button
|
|
66
|
-
v-if="data.dataStatus !== 'detail'"
|
|
67
|
-
status="warning"
|
|
68
|
-
:content="$t('message.btn.cancel')"
|
|
69
|
-
@click="handleCancle"
|
|
70
|
-
/>
|
|
71
|
-
</el-row>
|
|
72
|
-
</el-card>
|
|
73
|
-
</el-row>
|
|
74
|
-
<el-row v-else class="w-noclick-wrapper">
|
|
75
|
-
<!-- <span class="w-department-header">{{ $t('setting.deartment.organization') }}</span> -->
|
|
76
|
-
<div class="w-content-wrapper">
|
|
77
|
-
<ul>
|
|
78
|
-
<li class="w-department-line">
|
|
79
|
-
<div>● 点击新建,新建租户信息。</div>
|
|
80
|
-
<div style="margin: 0; text-indent: 2em">
|
|
81
|
-
已点击树结构上的租户名称,默认创建为当前租户的下属租户
|
|
82
|
-
</div>
|
|
83
|
-
<div style="margin: 0; text-indent: 2em">未点击树结构上的租户名称,则创建为一级租户</div>
|
|
84
|
-
</li>
|
|
85
|
-
<li class="w-department-line">● 点击树结构上的租户名称,点击修改按钮,修改租户信息。</li>
|
|
86
|
-
<li class="w-department-line">
|
|
87
|
-
<div>● 点击树结构上的租户名称,点击删除按钮,删除租户信息。</div>
|
|
88
|
-
<div style="text-indent: 2em">当租户下有单位存在时,不允许删除租户信息。</div>
|
|
89
|
-
</li>
|
|
90
|
-
</ul>
|
|
91
|
-
</div>
|
|
92
|
-
</el-row>
|
|
93
|
-
</div>
|
|
94
|
-
</template>
|
|
95
|
-
|
|
96
|
-
<script setup lang="ts">
|
|
97
|
-
import { useI18n } from 'vue-i18n';
|
|
98
|
-
import { reactive, watch, inject } from 'vue';
|
|
99
|
-
import { VxeUI } from 'vxe-table';
|
|
100
|
-
import { templateRef } from '@vueuse/core';
|
|
101
|
-
import { clone } from 'xe-utils';
|
|
102
|
-
import { successMessage, warnMessage } from '@utogether/utils';
|
|
103
|
-
import { getServiceApi } from '../../../api';
|
|
104
|
-
|
|
105
|
-
const data = reactive<IRecord>({
|
|
106
|
-
record: {},
|
|
107
|
-
dataList: [],
|
|
108
|
-
submitLoading: false,
|
|
109
|
-
dialogFormVisible: false,
|
|
110
|
-
isChecked: false,
|
|
111
|
-
dataStatus: ''
|
|
112
|
-
});
|
|
113
|
-
const { t } = useI18n();
|
|
114
|
-
const rules = {
|
|
115
|
-
unitName: [
|
|
116
|
-
{
|
|
117
|
-
required: true,
|
|
118
|
-
message: `${t('message.required')}${t('message.udp.unitName')}`
|
|
119
|
-
}
|
|
120
|
-
],
|
|
121
|
-
unitCode: [
|
|
122
|
-
{
|
|
123
|
-
required: true,
|
|
124
|
-
message: `${t('message.required')}${t('message.udp.unitCode')}`
|
|
125
|
-
}
|
|
126
|
-
]
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
const active: IRecord = inject('active');
|
|
130
|
-
const scrollPanelChange: IRecord = inject('scrollPanelChange');
|
|
131
|
-
|
|
132
|
-
const serviceApi = getServiceApi();
|
|
133
|
-
const url = '/uums/unit';
|
|
134
|
-
|
|
135
|
-
watch(
|
|
136
|
-
() => active.value,
|
|
137
|
-
(newVal, oldVal) => {
|
|
138
|
-
data.record = active.value;
|
|
139
|
-
newVal?.id && oldVal?.id && newVal !== oldVal && handleEdit('detail');
|
|
140
|
-
}
|
|
141
|
-
);
|
|
142
|
-
|
|
143
|
-
// 新增子类型
|
|
144
|
-
const handleAdd = () => {
|
|
145
|
-
data.dataStatus = 'add';
|
|
146
|
-
data.record = {};
|
|
147
|
-
data.record.parentId = active.value?.id;
|
|
148
|
-
data.isChecked = false;
|
|
149
|
-
data.dialogFormVisible = true;
|
|
150
|
-
};
|
|
151
|
-
// 编辑
|
|
152
|
-
const handleEdit = dataStatus => {
|
|
153
|
-
data.dataStatus = dataStatus;
|
|
154
|
-
data.record = clone(active.value, true);
|
|
155
|
-
data.dialogFormVisible = true;
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
const xForm = templateRef<any>('xForm', null);
|
|
159
|
-
const handleComfirm = () => {
|
|
160
|
-
xForm.value.validate(async valid => {
|
|
161
|
-
if (!valid) {
|
|
162
|
-
const { record, dataStatus } = data;
|
|
163
|
-
if (dataStatus === 'add') {
|
|
164
|
-
await serviceApi.post(url, record);
|
|
165
|
-
} else {
|
|
166
|
-
await serviceApi.put(url, record);
|
|
167
|
-
}
|
|
168
|
-
actionComplete();
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
const handleDelete = async () => {
|
|
174
|
-
const { record } = data;
|
|
175
|
-
if (record.children?.length) return warnMessage(t('message.deletePartment'));
|
|
176
|
-
const type = await VxeUI.modal.confirm(t('message.tip.del', { msg: 'aaaaa' }));
|
|
177
|
-
if (type === 'confirm') {
|
|
178
|
-
await serviceApi.delete(url, record);
|
|
179
|
-
actionComplete();
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
const actionComplete = () => {
|
|
184
|
-
scrollPanelChange.value = true;
|
|
185
|
-
successMessage(t('message.operateSuccess'));
|
|
186
|
-
handleClose();
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
const handleCancle = () => {
|
|
190
|
-
data.dialogFormVisible = false;
|
|
191
|
-
data.dataStatus = '';
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
const handleClose = () => {
|
|
195
|
-
data.dialogFormVisible = false;
|
|
196
|
-
};
|
|
197
|
-
</script>
|
|
198
|
-
<style lang="scss" scoped>
|
|
199
|
-
.page-content {
|
|
200
|
-
background-color: #fff;
|
|
201
|
-
|
|
202
|
-
.w-departInfo-wrapper {
|
|
203
|
-
width: 96%;
|
|
204
|
-
height: 75vh;
|
|
205
|
-
|
|
206
|
-
.w-card-wrapper {
|
|
207
|
-
width: 40%;
|
|
208
|
-
|
|
209
|
-
.el-card__header {
|
|
210
|
-
padding: 10px 20px;
|
|
211
|
-
|
|
212
|
-
.w-card-title {
|
|
213
|
-
position: relative;
|
|
214
|
-
top: 5px;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
.el-form-item {
|
|
220
|
-
margin-bottom: 12px;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
.w-noclick-wrapper {
|
|
225
|
-
display: flex;
|
|
226
|
-
flex-wrap: wrap;
|
|
227
|
-
align-items: center;
|
|
228
|
-
justify-content: center;
|
|
229
|
-
height: 100%;
|
|
230
|
-
|
|
231
|
-
.w-content-wrapper {
|
|
232
|
-
display: flex;
|
|
233
|
-
align-items: center;
|
|
234
|
-
justify-content: center;
|
|
235
|
-
height: 75vh;
|
|
236
|
-
|
|
237
|
-
ul {
|
|
238
|
-
padding: 24px;
|
|
239
|
-
border: 1px solid #ccc;
|
|
240
|
-
border-radius: 10px;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
.w-department-header {
|
|
245
|
-
padding-right: 20px;
|
|
246
|
-
font-size: 26px;
|
|
247
|
-
font-weight: bolder;
|
|
248
|
-
color: #69c;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
.w-department-line {
|
|
252
|
-
font-size: 16px;
|
|
253
|
-
line-height: 35px;
|
|
254
|
-
color: #999;
|
|
255
|
-
list-style: none;
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
</style>
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: wei.li
|
|
3
|
+
* @Date: 2021-11-19 21:14:41
|
|
4
|
+
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
+
* @LastEditTime: 2025-04-08 15:48:36
|
|
6
|
+
* @Description: 租户管理
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<div class="page-content">
|
|
11
|
+
<!-- 工具栏 -->
|
|
12
|
+
<vxe-toolbar perfect class="">
|
|
13
|
+
<template #buttons>
|
|
14
|
+
<ut-button status="u-cyan" icon="ri-add-line" content="add" @tap="handleAdd()" />
|
|
15
|
+
<ut-button status="primary" icon="ri-edit-box-line" content="edit" @tap="handleEdit('update')" />
|
|
16
|
+
<ut-button status="danger" icon="ri-close-fill" content="delete" @tap="handleDelete()" />
|
|
17
|
+
</template>
|
|
18
|
+
</vxe-toolbar>
|
|
19
|
+
<el-row
|
|
20
|
+
v-if="data.dialogFormVisible"
|
|
21
|
+
type="flex"
|
|
22
|
+
justify="center"
|
|
23
|
+
align="middle"
|
|
24
|
+
class="w-departInfo-wrapper"
|
|
25
|
+
>
|
|
26
|
+
<el-card width="60%" shadow="always" class="box-card w-card-wrapper">
|
|
27
|
+
<div class="clearfix">
|
|
28
|
+
<span class="w-card-title" />
|
|
29
|
+
</div>
|
|
30
|
+
<el-row>
|
|
31
|
+
<vxe-form ref="xForm" :data="data.record" :rules="rules" label-width="80px">
|
|
32
|
+
<vxe-form-item
|
|
33
|
+
:title="$t('message.udp.unitName')"
|
|
34
|
+
field="unitName"
|
|
35
|
+
:item-render="{ name: '$input', props: { disabled: data.dataStatus === 'detail' } }"
|
|
36
|
+
:span="24"
|
|
37
|
+
/>
|
|
38
|
+
<vxe-form-item
|
|
39
|
+
:title="$t('message.udp.unitCode')"
|
|
40
|
+
field="unitCode"
|
|
41
|
+
:item-render="{ name: '$input', props: { disabled: data.dataStatus !== 'add' } }"
|
|
42
|
+
:span="24"
|
|
43
|
+
/>
|
|
44
|
+
<vxe-form-item
|
|
45
|
+
:title="$t('message.udp.unitNote')"
|
|
46
|
+
field="unitNote"
|
|
47
|
+
:item-render="{ name: '$input', props: { disabled: data.dataStatus === 'detail' } }"
|
|
48
|
+
:span="24"
|
|
49
|
+
/>
|
|
50
|
+
</vxe-form>
|
|
51
|
+
</el-row>
|
|
52
|
+
<el-row type="flex" justify="center">
|
|
53
|
+
<vxe-checkbox
|
|
54
|
+
v-if="data.dataStatus === 'add'"
|
|
55
|
+
v-model="data.isChecked"
|
|
56
|
+
style="padding-top: 5px; margin-right: 8px"
|
|
57
|
+
>{{ $t('message.udp.continueAdd') }}</vxe-checkbox
|
|
58
|
+
>
|
|
59
|
+
<vxe-button
|
|
60
|
+
v-if="data.dataStatus !== 'detail'"
|
|
61
|
+
status="primary"
|
|
62
|
+
:content="$t('message.btn.confirm')"
|
|
63
|
+
@click="handleComfirm"
|
|
64
|
+
/>
|
|
65
|
+
<vxe-button
|
|
66
|
+
v-if="data.dataStatus !== 'detail'"
|
|
67
|
+
status="warning"
|
|
68
|
+
:content="$t('message.btn.cancel')"
|
|
69
|
+
@click="handleCancle"
|
|
70
|
+
/>
|
|
71
|
+
</el-row>
|
|
72
|
+
</el-card>
|
|
73
|
+
</el-row>
|
|
74
|
+
<el-row v-else class="w-noclick-wrapper">
|
|
75
|
+
<!-- <span class="w-department-header">{{ $t('setting.deartment.organization') }}</span> -->
|
|
76
|
+
<div class="w-content-wrapper">
|
|
77
|
+
<ul>
|
|
78
|
+
<li class="w-department-line">
|
|
79
|
+
<div>● 点击新建,新建租户信息。</div>
|
|
80
|
+
<div style="margin: 0; text-indent: 2em">
|
|
81
|
+
已点击树结构上的租户名称,默认创建为当前租户的下属租户
|
|
82
|
+
</div>
|
|
83
|
+
<div style="margin: 0; text-indent: 2em">未点击树结构上的租户名称,则创建为一级租户</div>
|
|
84
|
+
</li>
|
|
85
|
+
<li class="w-department-line">● 点击树结构上的租户名称,点击修改按钮,修改租户信息。</li>
|
|
86
|
+
<li class="w-department-line">
|
|
87
|
+
<div>● 点击树结构上的租户名称,点击删除按钮,删除租户信息。</div>
|
|
88
|
+
<div style="text-indent: 2em">当租户下有单位存在时,不允许删除租户信息。</div>
|
|
89
|
+
</li>
|
|
90
|
+
</ul>
|
|
91
|
+
</div>
|
|
92
|
+
</el-row>
|
|
93
|
+
</div>
|
|
94
|
+
</template>
|
|
95
|
+
|
|
96
|
+
<script setup lang="ts">
|
|
97
|
+
import { useI18n } from 'vue-i18n';
|
|
98
|
+
import { reactive, watch, inject } from 'vue';
|
|
99
|
+
import { VxeUI } from 'vxe-table';
|
|
100
|
+
import { templateRef } from '@vueuse/core';
|
|
101
|
+
import { clone } from 'xe-utils';
|
|
102
|
+
import { successMessage, warnMessage } from '@utogether/utils';
|
|
103
|
+
import { getServiceApi } from '../../../api';
|
|
104
|
+
|
|
105
|
+
const data = reactive<IRecord>({
|
|
106
|
+
record: {},
|
|
107
|
+
dataList: [],
|
|
108
|
+
submitLoading: false,
|
|
109
|
+
dialogFormVisible: false,
|
|
110
|
+
isChecked: false,
|
|
111
|
+
dataStatus: ''
|
|
112
|
+
});
|
|
113
|
+
const { t } = useI18n();
|
|
114
|
+
const rules = {
|
|
115
|
+
unitName: [
|
|
116
|
+
{
|
|
117
|
+
required: true,
|
|
118
|
+
message: `${t('message.required')}${t('message.udp.unitName')}`
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
unitCode: [
|
|
122
|
+
{
|
|
123
|
+
required: true,
|
|
124
|
+
message: `${t('message.required')}${t('message.udp.unitCode')}`
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const active: IRecord = inject('active');
|
|
130
|
+
const scrollPanelChange: IRecord = inject('scrollPanelChange');
|
|
131
|
+
|
|
132
|
+
const serviceApi = getServiceApi();
|
|
133
|
+
const url = '/uums/unit';
|
|
134
|
+
|
|
135
|
+
watch(
|
|
136
|
+
() => active.value,
|
|
137
|
+
(newVal, oldVal) => {
|
|
138
|
+
data.record = active.value;
|
|
139
|
+
newVal?.id && oldVal?.id && newVal !== oldVal && handleEdit('detail');
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
// 新增子类型
|
|
144
|
+
const handleAdd = () => {
|
|
145
|
+
data.dataStatus = 'add';
|
|
146
|
+
data.record = {};
|
|
147
|
+
data.record.parentId = active.value?.id;
|
|
148
|
+
data.isChecked = false;
|
|
149
|
+
data.dialogFormVisible = true;
|
|
150
|
+
};
|
|
151
|
+
// 编辑
|
|
152
|
+
const handleEdit = dataStatus => {
|
|
153
|
+
data.dataStatus = dataStatus;
|
|
154
|
+
data.record = clone(active.value, true);
|
|
155
|
+
data.dialogFormVisible = true;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
const xForm = templateRef<any>('xForm', null);
|
|
159
|
+
const handleComfirm = () => {
|
|
160
|
+
xForm.value.validate(async valid => {
|
|
161
|
+
if (!valid) {
|
|
162
|
+
const { record, dataStatus } = data;
|
|
163
|
+
if (dataStatus === 'add') {
|
|
164
|
+
await serviceApi.post(url, record);
|
|
165
|
+
} else {
|
|
166
|
+
await serviceApi.put(url, record);
|
|
167
|
+
}
|
|
168
|
+
actionComplete();
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const handleDelete = async () => {
|
|
174
|
+
const { record } = data;
|
|
175
|
+
if (record.children?.length) return warnMessage(t('message.deletePartment'));
|
|
176
|
+
const type = await VxeUI.modal.confirm(t('message.tip.del', { msg: 'aaaaa' }));
|
|
177
|
+
if (type === 'confirm') {
|
|
178
|
+
await serviceApi.delete(url, record);
|
|
179
|
+
actionComplete();
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
const actionComplete = () => {
|
|
184
|
+
scrollPanelChange.value = true;
|
|
185
|
+
successMessage(t('message.operateSuccess'));
|
|
186
|
+
handleClose();
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
const handleCancle = () => {
|
|
190
|
+
data.dialogFormVisible = false;
|
|
191
|
+
data.dataStatus = '';
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
const handleClose = () => {
|
|
195
|
+
data.dialogFormVisible = false;
|
|
196
|
+
};
|
|
197
|
+
</script>
|
|
198
|
+
<style lang="scss" scoped>
|
|
199
|
+
.page-content {
|
|
200
|
+
background-color: #fff;
|
|
201
|
+
|
|
202
|
+
.w-departInfo-wrapper {
|
|
203
|
+
width: 96%;
|
|
204
|
+
height: 75vh;
|
|
205
|
+
|
|
206
|
+
.w-card-wrapper {
|
|
207
|
+
width: 40%;
|
|
208
|
+
|
|
209
|
+
.el-card__header {
|
|
210
|
+
padding: 10px 20px;
|
|
211
|
+
|
|
212
|
+
.w-card-title {
|
|
213
|
+
position: relative;
|
|
214
|
+
top: 5px;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.el-form-item {
|
|
220
|
+
margin-bottom: 12px;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.w-noclick-wrapper {
|
|
225
|
+
display: flex;
|
|
226
|
+
flex-wrap: wrap;
|
|
227
|
+
align-items: center;
|
|
228
|
+
justify-content: center;
|
|
229
|
+
height: 100%;
|
|
230
|
+
|
|
231
|
+
.w-content-wrapper {
|
|
232
|
+
display: flex;
|
|
233
|
+
align-items: center;
|
|
234
|
+
justify-content: center;
|
|
235
|
+
height: 75vh;
|
|
236
|
+
|
|
237
|
+
ul {
|
|
238
|
+
padding: 24px;
|
|
239
|
+
border: 1px solid #ccc;
|
|
240
|
+
border-radius: 10px;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.w-department-header {
|
|
245
|
+
padding-right: 20px;
|
|
246
|
+
font-size: 26px;
|
|
247
|
+
font-weight: bolder;
|
|
248
|
+
color: #69c;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.w-department-line {
|
|
252
|
+
font-size: 16px;
|
|
253
|
+
line-height: 35px;
|
|
254
|
+
color: #999;
|
|
255
|
+
list-style: none;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
</style>
|