@utogether/udp-core 2.0.0-beta.27 → 2.0.0-beta.28
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-gdcH0-Bo.js → 403-CyoOD-Ik.js} +1 -1
- package/dist/{404-Se2SF97M.js → 404-Ch_OHTw0.js} +1 -1
- package/dist/{500-B6j9AqLo.js → 500-Cf9am7HK.js} +1 -1
- package/dist/{AuthorityInfo-CQ8ydZvr.js → AuthorityInfo-BJ427cqG.js} +1 -1
- package/dist/{AuthorityInfo.vue_vue_type_style_index_0_lang-C4NRvS8p.js → AuthorityInfo.vue_vue_type_style_index_0_lang-D9y7AwbB.js} +11 -12
- package/dist/{Company-BzSVBSC4.js → Company-qo-lKPkv.js} +3 -3
- package/dist/{CompanyPanel-DBjZB4aJ.js → CompanyPanel-DkKWAKvY.js} +7 -7
- package/dist/{Department-BkgseHo8.js → Department-CHUQByKX.js} +3 -3
- package/dist/{DepartmentPanel-Sen93_2M.js → DepartmentPanel-C742dfOO.js} +27 -28
- package/dist/{DesignPanel-pqDcwaFC.js → DesignPanel-D9oE5R7m.js} +1 -1
- package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-BjtYyEw7.js → DesignPanel.vue_vue_type_style_index_0_lang-hYldVEbo.js} +192 -108
- package/dist/{DictView-CJLG4LlE.js → DictView-CrFXprP9.js} +1 -1
- package/dist/{InvOrganization-D0Jq1IAa.js → InvOrganization-Cz8SzIgs.js} +6 -7
- package/dist/{Org-CO_1WT39.js → Org-Bzt6yKox.js} +9 -10
- package/dist/{Preview-DLI4Bwel.js → Preview-jonigfMQ.js} +1 -1
- package/dist/{ReportDefine-Cw46OnJ_.js → ReportDefine-BpiM5Ovq.js} +1 -1
- package/dist/{ReportDesign-D4sHTXT7.js → ReportDesign-fp09cXJ7.js} +24 -25
- package/dist/{ReportQuery-DtOCvQSN.js → ReportQuery-52ZP1PYP.js} +1 -1
- package/dist/{ReportQueryFrom-QjL-ETPq.js → ReportQueryFrom-DSYavJb1.js} +1 -1
- package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-Dj9ne87n.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-DBGYEp0u.js} +4 -4
- package/dist/{ReportTemplate-BxAgc_Aj.js → ReportTemplate-CA_UW0eD.js} +3 -3
- package/dist/{Role-Df77BBD-.js → Role-DqOt8Bk0.js} +3 -3
- package/dist/{RoleAssign-BrunouML.js → RoleAssign-BdxhefhQ.js} +3 -3
- package/dist/{RolePanel-HLA7XBlN.js → RolePanel-2gZ3H0ET.js} +1 -1
- package/dist/{RolePanel-DSVwqhiD.js → RolePanel-BsNd0svJ.js} +1 -1
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-CN0rUxKz.js → RolePanel.vue_vue_type_script_setup_true_lang-DLOwgF99.js} +9 -9
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-CKlbqRa5.js → RolePanel.vue_vue_type_script_setup_true_lang-DmzD9kab.js} +26 -27
- package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-D_FeSXKv.js → ScrollPanel.vue_vue_type_style_index_0_lang-B9ptUMeI.js} +7 -7
- package/dist/{Staff-BeL1xcRf.js → Staff-D3L8fEoY.js} +3 -3
- package/dist/{StaffInfo-CIfnltyX.js → StaffInfo-DYRw6ZYJ.js} +1 -1
- package/dist/{StaffInfo.vue_vue_type_script_setup_true_lang-DbLFwWfG.js → StaffInfo.vue_vue_type_script_setup_true_lang-xqEOQnMs.js} +1 -1
- package/dist/{StaffPanel-BV2CHWac.js → StaffPanel-DkrNH6Px.js} +1 -1
- package/dist/{StaffPanel.vue_vue_type_script_setup_true_lang-CvT-Vp2G.js → StaffPanel.vue_vue_type_script_setup_true_lang-BPBMnliy.js} +8 -9
- package/dist/{SysUser-DPfNvthk.js → SysUser-Bl1-cIpJ.js} +2 -2
- package/dist/{SysUserPanel-CoLKYlQE.js → SysUserPanel-yxNLaBwt.js} +1 -1
- package/dist/{SysUserPanel.vue_vue_type_script_setup_true_lang-lcO3Cjbq.js → SysUserPanel.vue_vue_type_script_setup_true_lang-BDcsgSl5.js} +11 -12
- package/dist/{SystemMenu-sdj1dRDA.js → SystemMenu-C4_Arn12.js} +9 -10
- package/dist/{UserInfo-CTX4hhFl.js → UserInfo-QcNwJCUR.js} +1 -1
- package/dist/{UserInfo.vue_vue_type_style_index_0_lang-ClhCd_8z.js → UserInfo.vue_vue_type_style_index_0_lang-DLIeUphX.js} +5 -6
- package/dist/{childView-BDmWwJO5.js → childView-B23DEO2u.js} +1 -1
- package/dist/{childView-Dx3ACtHa.js → childView-saDZQv9x.js} +1 -1
- package/dist/{childView.vue_vue_type_style_index_0_lang-CfKq_0FN.js → childView.vue_vue_type_style_index_0_lang-RsKR6CAC.js} +14 -15
- package/dist/{childView.vue_vue_type_style_index_0_lang-DxZNtkhd.js → childView.vue_vue_type_style_index_0_lang-ZFEfavUY.js} +11 -12
- package/dist/{code-rule-cvN4gYC_.js → code-rule-2_Ihx_by.js} +12 -13
- package/dist/core.es.js +21 -19
- package/dist/{cron-task-B0TkxFdp.js → cron-task-BFOPJQIk.js} +3 -4
- package/dist/{frameView-5cy5BSgS.js → frameView-f7Ya0Knj.js} +1 -1
- package/dist/img/minicolors.png +0 -0
- package/dist/{index-C5WRTwvI.js → index-BpdTDaTk.js} +811 -604
- package/dist/{layout-home-DrARg-3o.js → layout-home-v3DPJ7rB.js} +12 -13
- package/dist/{layoutView-25v_ngk5.js → layoutView-DZHoQDH1.js} +186 -187
- package/dist/{log-in-Bmz5Uhbt.js → log-in-BPAMJTwH.js} +4 -5
- package/dist/{log-out-B-8m3oNj.js → log-out-DZACF0jg.js} +8 -9
- package/dist/{login-Cmp2RvvW.js → login-B8cwozax.js} +22 -23
- package/dist/{lov-view-BATtzw2X.js → lov-view-Ba7Y7xy0.js} +4 -5
- package/dist/{menuInfo-BIvrE7nm.js → menuInfo-BpRKFYK8.js} +1 -1
- package/dist/{menuInfo.vue_vue_type_style_index_0_lang-B6USomit.js → menuInfo.vue_vue_type_style_index_0_lang-DJ5sUC6m.js} +17 -18
- package/dist/{pda-app-CzHVyeEa.js → pda-app-C0jJecrL.js} +7 -8
- package/dist/{resource-Y5lGB38n.js → resource-BG22Cw4P.js} +4 -4
- package/dist/su-welcome-DaxhbrC6.js +879 -0
- package/dist/{sys-config-CqO03LeC.js → sys-config-CG2fMtak.js} +22 -23
- package/dist/udp-core.css +1 -1
- package/dist/{useNav-C-rCgubt.js → useNav-_u2UAQWk.js} +24 -24
- package/index.ts +54 -51
- package/package.json +21 -21
- package/src/api/http.ts +10 -4
- package/src/api/index.ts +51 -51
- package/src/api/user.ts +64 -64
- package/src/components/udp/content/index.vue +93 -93
- package/src/components/udp/form-upload/form-upload.vue +496 -496
- package/src/components/udp/grid/index.vue +643 -544
- package/src/components/udp/index.ts +2 -1
- package/src/components/udp/modal-form/index.vue +326 -0
- package/src/components/udp/utils.ts +420 -420
- package/src/layout/components/lay-navbar/index.vue +240 -240
- package/src/layout/components/lay-search/components/SearchModal.vue +185 -185
- package/src/layout/components/lay-sidebar/mixNav.vue +261 -261
- package/src/layout/components/lay-sidebar/sidebarItem.vue +199 -195
- package/src/layout/components/lay-sidebar/vertical.vue +92 -92
- package/src/layout/layoutView.vue +1 -0
- package/src/main.ts +111 -111
- package/src/plugins/i18n/zh.ts +5 -1
- package/src/plugins/vxe-table/index.ts +116 -116
- package/src/router/index.ts +158 -156
- package/src/router/utils.ts +434 -430
- package/src/store/modules/permission.ts +1 -1
- package/src/store/modules/system.ts +193 -193
- package/src/style/print-lock.css +380 -375
- package/src/style/suprint.css +990 -985
- package/src/utils/authority/index.ts +46 -46
- package/src/utils/dataFormat/index.ts +309 -222
- package/src/utils/udp/http/index.ts +19 -11
- package/src/views/uhome/components/home-todo.vue +15 -3
- package/src/views/uhome/dynamic-card.vue +31 -31
- package/src/views/uhome/su-welcome.vue +310 -310
- package/src/views/ulogin/login.vue +292 -292
- package/src/views/urpt/design/DesignPanel.vue +538 -507
- package/src/views/urpt/design/print-data.ts +39 -59
- package/dist/await-to-js.es5-Bv3Eu4mi.js +0 -10
- package/dist/su-welcome-CXA6OzBw.js +0 -878
|
@@ -5,5 +5,6 @@ import FormUpload2 from './form-upload/form-upload.vue';
|
|
|
5
5
|
import UtStampBadge2 from './ut-stamp-badge/index.vue';
|
|
6
6
|
import UtUpload2 from './upload/index.vue';
|
|
7
7
|
import UtLov2 from './lov/index.vue';
|
|
8
|
+
import UtModalForm2 from './modal-form/index.vue';
|
|
8
9
|
|
|
9
|
-
export { UtGrid2, UtForm2, UtContent2, FormUpload2, UtStampBadge2, UtUpload2, UtLov2 };
|
|
10
|
+
export { UtGrid2, UtForm2, UtContent2, FormUpload2, UtStampBadge2, UtUpload2, UtLov2, UtModalForm2 };
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: wei.li
|
|
3
|
+
* @Date: 2021-11-29 21:02:43
|
|
4
|
+
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
+
* @LastEditTime: 2026-08-06 10:20:41
|
|
6
|
+
* @Description: file content
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<div>
|
|
11
|
+
<vxe-modal
|
|
12
|
+
v-model="showModal"
|
|
13
|
+
:title="title"
|
|
14
|
+
:width="width"
|
|
15
|
+
:height="modalHeight"
|
|
16
|
+
:loading="loading"
|
|
17
|
+
:show-footer="dataStatus !== 'detail'"
|
|
18
|
+
min-width="240"
|
|
19
|
+
destroy-on-close
|
|
20
|
+
resize
|
|
21
|
+
v-bind="modalOptions"
|
|
22
|
+
@close="onClose"
|
|
23
|
+
>
|
|
24
|
+
<template #default>
|
|
25
|
+
<vxe-form
|
|
26
|
+
ref="xForm"
|
|
27
|
+
:data="data"
|
|
28
|
+
:items="formItems"
|
|
29
|
+
:rules="rules"
|
|
30
|
+
:title-width="titleWidth"
|
|
31
|
+
title-align="right"
|
|
32
|
+
v-bind="formOptions"
|
|
33
|
+
>
|
|
34
|
+
<template #dividerPrefix />
|
|
35
|
+
<!-- <template #collapseNode>
|
|
36
|
+
<vxe-checkbox
|
|
37
|
+
v-model="collapseStatus"
|
|
38
|
+
content="查看更多"
|
|
39
|
+
:checked-value="false"
|
|
40
|
+
:unchecked-value="true"
|
|
41
|
+
class="pl-10"
|
|
42
|
+
@change="onChange"
|
|
43
|
+
/>
|
|
44
|
+
</template> -->
|
|
45
|
+
</vxe-form>
|
|
46
|
+
</template>
|
|
47
|
+
<template v-if="!loading" #footer>
|
|
48
|
+
<vxe-checkbox
|
|
49
|
+
v-if="dataStatus === 'add'"
|
|
50
|
+
v-model="isContinue"
|
|
51
|
+
:content="$t('message.udp.continuousAddition')"
|
|
52
|
+
style="margin-right: 8px"
|
|
53
|
+
/>
|
|
54
|
+
<ut-button
|
|
55
|
+
v-if="attrs?.showCancleButton !== false"
|
|
56
|
+
status="warning"
|
|
57
|
+
:content="modalOptions?.cancelButtonText || 'cancel'"
|
|
58
|
+
icon="ri-close-line"
|
|
59
|
+
@tap="onClose"
|
|
60
|
+
/>
|
|
61
|
+
<slot />
|
|
62
|
+
<ut-button
|
|
63
|
+
v-if="attrs?.showConfirmButton !== false"
|
|
64
|
+
status="u-cyan"
|
|
65
|
+
:content="modalOptions?.confirmButtonText || 'confirm'"
|
|
66
|
+
icon="ri-save-3-line"
|
|
67
|
+
@tap="onConfirm"
|
|
68
|
+
/>
|
|
69
|
+
</template>
|
|
70
|
+
</vxe-modal>
|
|
71
|
+
</div>
|
|
72
|
+
</template>
|
|
73
|
+
|
|
74
|
+
<script lang="ts">
|
|
75
|
+
export default {
|
|
76
|
+
name: 'UtModalForm'
|
|
77
|
+
};
|
|
78
|
+
</script>
|
|
79
|
+
<script lang="ts" setup>
|
|
80
|
+
import { onBeforeMount, ref, computed, getCurrentInstance, useAttrs } from 'vue';
|
|
81
|
+
import { useI18n } from 'vue-i18n';
|
|
82
|
+
import { getAttrs } from '../utils';
|
|
83
|
+
import to from 'await-to-js';
|
|
84
|
+
import { formatRules, formatItems, successMessage } from '@utogether/utils';
|
|
85
|
+
import { clone } from 'xe-utils';
|
|
86
|
+
|
|
87
|
+
export interface IProps {
|
|
88
|
+
record: IRecord; // 数据对象
|
|
89
|
+
formOptions?: IRecord;
|
|
90
|
+
modalOptions?: IRecord;
|
|
91
|
+
items: Array<IFormItemProps>; // form item
|
|
92
|
+
url?: string; // 服务路径
|
|
93
|
+
method?: string; // 请求方式
|
|
94
|
+
title?: string; // 标题
|
|
95
|
+
titleWidth?: string | number; // 标题宽度
|
|
96
|
+
dataStatus?: string; // 状态
|
|
97
|
+
width?: number;
|
|
98
|
+
beforeHideMethod?: () => Promise<boolean>;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const props = withDefaults(defineProps<IProps>(), {
|
|
102
|
+
record: (): IRecord => {
|
|
103
|
+
return {};
|
|
104
|
+
},
|
|
105
|
+
formOptions: (): IRecord => {
|
|
106
|
+
return {};
|
|
107
|
+
},
|
|
108
|
+
modalOptions: (): IRecord => {
|
|
109
|
+
return {};
|
|
110
|
+
},
|
|
111
|
+
items: () => [],
|
|
112
|
+
title: '数据记录',
|
|
113
|
+
width: 420,
|
|
114
|
+
titleWidth: 100,
|
|
115
|
+
dataStatus: 'detail',
|
|
116
|
+
url: '',
|
|
117
|
+
method: 'post'
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
const attrs: IRecord = getAttrs(useAttrs());
|
|
121
|
+
|
|
122
|
+
const loading = ref(false);
|
|
123
|
+
|
|
124
|
+
const isContinue = ref(false);
|
|
125
|
+
// 保存初始record,用于连续添加时重置
|
|
126
|
+
const defaultRecord = clone(props.record, true);
|
|
127
|
+
|
|
128
|
+
const data = ref<IRecord>(props.record);
|
|
129
|
+
|
|
130
|
+
const instance = getCurrentInstance()!;
|
|
131
|
+
|
|
132
|
+
const serviceApi = instance.appContext.config.globalProperties.$serviceApi;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* @description: 根据items 获取必填选
|
|
136
|
+
*/
|
|
137
|
+
const rules = computed(() => {
|
|
138
|
+
if (!props.items.length) return {};
|
|
139
|
+
return formatRules(props.items, t);
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
const { t } = useI18n();
|
|
143
|
+
|
|
144
|
+
const formItems = computed(() => {
|
|
145
|
+
if (!props.items.length) return props.items;
|
|
146
|
+
return formatItems(clone(props.items, true), props.dataStatus, 24);
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
const modalHeight = computed(() => {
|
|
150
|
+
const maxHeight = Math.floor(window.innerHeight * 0.8);
|
|
151
|
+
let height = 0;
|
|
152
|
+
let offset = props.dataStatus !== 'detail' ? 100 : 60;
|
|
153
|
+
if (props.items.length === 1) {
|
|
154
|
+
// 仅有一项时,增加8px的边距
|
|
155
|
+
offset += 8;
|
|
156
|
+
}
|
|
157
|
+
console.log('modalHeight', maxHeight);
|
|
158
|
+
let contentHeight = 0;
|
|
159
|
+
let currentRowSpan = 0;
|
|
160
|
+
let currentRowHeight = 0;
|
|
161
|
+
|
|
162
|
+
const flattenItems = (items: any[]): any[] => {
|
|
163
|
+
const result: any[] = [];
|
|
164
|
+
items.forEach(item => {
|
|
165
|
+
result.push(item);
|
|
166
|
+
if (item.children?.length) {
|
|
167
|
+
result.push(...item.children);
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
return result;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const flatItems = flattenItems(props.items);
|
|
174
|
+
console.log('flatItems', flatItems);
|
|
175
|
+
flatItems
|
|
176
|
+
.filter(item => item.visible !== false)
|
|
177
|
+
.forEach((item, index) => {
|
|
178
|
+
const span = item.span ?? 24;
|
|
179
|
+
let itemHeight = item.itemRender?.name === 'VxeTextarea' ? 75 : item.vertical || item.titleBold ? 30 : 45;
|
|
180
|
+
if (item.visibleMethod) {
|
|
181
|
+
if (!item.visibleMethod({ data: props.record })) {
|
|
182
|
+
itemHeight = 0;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
if (index === 0) {
|
|
186
|
+
currentRowSpan = span;
|
|
187
|
+
currentRowHeight = itemHeight;
|
|
188
|
+
} else if (currentRowSpan + span <= 24) {
|
|
189
|
+
currentRowSpan += span;
|
|
190
|
+
currentRowHeight = Math.max(currentRowHeight, itemHeight);
|
|
191
|
+
} else {
|
|
192
|
+
contentHeight += currentRowHeight;
|
|
193
|
+
currentRowSpan = span;
|
|
194
|
+
currentRowHeight = itemHeight;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const nextSpan = flatItems[index + 1]?.span ?? 24;
|
|
198
|
+
if (nextSpan + currentRowSpan > 24) {
|
|
199
|
+
contentHeight += currentRowHeight;
|
|
200
|
+
currentRowSpan = 0;
|
|
201
|
+
currentRowHeight = 0;
|
|
202
|
+
console.log(index, '-contentHeight=', contentHeight, itemHeight);
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
// contentHeight += currentRowHeight;
|
|
206
|
+
|
|
207
|
+
height = contentHeight + offset;
|
|
208
|
+
height = maxHeight < height ? maxHeight : height;
|
|
209
|
+
// console.log('height', height);
|
|
210
|
+
// console.log('maxHeight', maxHeight);
|
|
211
|
+
return height;
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
const showModal = ref(false);
|
|
215
|
+
|
|
216
|
+
const xForm = ref(null);
|
|
217
|
+
/**
|
|
218
|
+
* @description: 弹框确认
|
|
219
|
+
*/
|
|
220
|
+
const onConfirm = () => {
|
|
221
|
+
// @ts-ignore
|
|
222
|
+
xForm.value.validate(async (valid: boolean) => {
|
|
223
|
+
if (!valid) {
|
|
224
|
+
const { url, method } = props;
|
|
225
|
+
if (url) {
|
|
226
|
+
showLoading();
|
|
227
|
+
const body = attrs?.dataProcessMethod ? attrs?.dataProcessMethod(data.value) : data.value;
|
|
228
|
+
const [err, res] = await to(serviceApi[method](url, body));
|
|
229
|
+
hiddenLoading();
|
|
230
|
+
if (!err) {
|
|
231
|
+
let beforeHideMethodResult = true;
|
|
232
|
+
if (props.beforeHideMethod) {
|
|
233
|
+
beforeHideMethodResult = await props.beforeHideMethod();
|
|
234
|
+
}
|
|
235
|
+
successMessage();
|
|
236
|
+
emit('confirm', res);
|
|
237
|
+
if (isContinue.value) {
|
|
238
|
+
// 连续添加:重置表单为默认值,不关闭弹框
|
|
239
|
+
resetRecord();
|
|
240
|
+
} else if (beforeHideMethodResult) {
|
|
241
|
+
onClose();
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
} else {
|
|
245
|
+
emit('confirm');
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
// const onBeforeHideMethod = () => {
|
|
252
|
+
// console.log('onBeforeHideMethod');
|
|
253
|
+
// return new Promise((resolve, reject) => {
|
|
254
|
+
// reject(new Error());
|
|
255
|
+
// });
|
|
256
|
+
// };
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* @description: 重置表单数据为初始值
|
|
260
|
+
*/
|
|
261
|
+
const resetRecord = () => {
|
|
262
|
+
data.value = clone(defaultRecord, true);
|
|
263
|
+
xForm.value?.clearValidate();
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* @description: 显示加载框
|
|
268
|
+
*/
|
|
269
|
+
const showLoading = () => {
|
|
270
|
+
loading.value = true;
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* @description: 关闭加载框
|
|
275
|
+
*/
|
|
276
|
+
const hiddenLoading = () => {
|
|
277
|
+
loading.value = false;
|
|
278
|
+
};
|
|
279
|
+
const validate = (cb: Function) => {
|
|
280
|
+
// @ts-ignore
|
|
281
|
+
xForm.value.validate(cb);
|
|
282
|
+
};
|
|
283
|
+
/**
|
|
284
|
+
* @deprecated 已过期,使用validate
|
|
285
|
+
*/
|
|
286
|
+
const validateForm = (cb: Function) => {
|
|
287
|
+
// @ts-ignore
|
|
288
|
+
xForm.value.validate(cb);
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* @description: 关闭弹框
|
|
293
|
+
*/
|
|
294
|
+
const onClose = () => {
|
|
295
|
+
showModal.value = false;
|
|
296
|
+
emit('close');
|
|
297
|
+
};
|
|
298
|
+
/**
|
|
299
|
+
* @description: 打开弹框
|
|
300
|
+
*/
|
|
301
|
+
const openModal = () => {
|
|
302
|
+
showModal.value = true;
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
const closeModal = () => {
|
|
306
|
+
onClose();
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
const emit = defineEmits<{
|
|
310
|
+
(e: 'close'): void;
|
|
311
|
+
(e: 'confirm', record?: any): void;
|
|
312
|
+
}>();
|
|
313
|
+
|
|
314
|
+
defineExpose({
|
|
315
|
+
showLoading,
|
|
316
|
+
hiddenLoading,
|
|
317
|
+
openModal,
|
|
318
|
+
closeModal,
|
|
319
|
+
validate,
|
|
320
|
+
validateForm
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
onBeforeMount(() => {
|
|
324
|
+
openModal();
|
|
325
|
+
});
|
|
326
|
+
</script>
|