@ebiz/designer-components 0.0.34 → 0.0.35
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/package.json
CHANGED
@@ -34,22 +34,13 @@
|
|
34
34
|
</div>
|
35
35
|
</slot>
|
36
36
|
</template>
|
37
|
-
|
38
|
-
<!-- <template #footer>
|
39
|
-
<slot name="footer">
|
40
|
-
<t-space>
|
41
|
-
<t-button v-if="cancelText" theme="default" @click="handleDialogCancel">{{ cancelText }}</t-button>
|
42
|
-
<t-button v-if="confirmText" theme="primary" :loading="apiLoading" @click="handleDialogConfirm">{{ confirmText }}</t-button>
|
43
|
-
</t-space>
|
44
|
-
</slot>
|
45
|
-
</template> -->
|
46
37
|
</t-dialog>
|
47
38
|
</div>
|
48
39
|
</template>
|
49
40
|
|
50
41
|
<script setup>
|
51
42
|
import { ref, computed, watch } from 'vue'
|
52
|
-
import { Button as TButton, Dialog as TDialog,
|
43
|
+
import { Button as TButton, Dialog as TDialog, MessagePlugin, Icon as TIcon } from 'tdesign-vue-next'
|
53
44
|
import dataService from '../apiService/simpleDataService'
|
54
45
|
|
55
46
|
const props = defineProps({
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<template>
|
2
2
|
<div>
|
3
|
-
<div>
|
3
|
+
<div style="margin-bottom: 16px;">
|
4
4
|
<EbizTdesignCard v-if="showPageHeader || $slots.form" :bordered="false">
|
5
5
|
<EbizPageHeader v-if="showPageHeader"></EbizPageHeader>
|
6
6
|
<EbizDivider v-if="showPageHeader"></EbizDivider>
|
7
|
-
|
7
|
+
|
8
8
|
<!-- 表单区域 -->
|
9
9
|
<ebiz-s-form v-if="$slots.form" v-model="formDataValue" ref="formRef" layout="inline" labelAlign="top"
|
10
10
|
@submit="handleSearch" @reset="handleReset">
|
@@ -19,7 +19,7 @@
|
|
19
19
|
</EbizTdesignCard>
|
20
20
|
</div>
|
21
21
|
|
22
|
-
<EbizTdesignCard :bordered="false"
|
22
|
+
<EbizTdesignCard :bordered="false">
|
23
23
|
<div>
|
24
24
|
<!-- 表格区域 -->
|
25
25
|
<div style="display: flex; justify-content: space-between; align-items: center;">
|
@@ -34,7 +34,7 @@ export default {
|
|
34
34
|
</script>
|
35
35
|
|
36
36
|
<script setup>
|
37
|
-
import { defineProps, defineEmits, ref
|
37
|
+
import { defineProps, defineEmits, ref } from 'vue';
|
38
38
|
import { Form as TForm, Button as TButton, Space as TSpace, MessagePlugin } from 'tdesign-vue-next';
|
39
39
|
import dataService from "../../../apiService/simpleDataService";
|
40
40
|
import EbizSFormItem from './item.vue';
|
@@ -235,23 +235,7 @@ const emit = defineEmits([
|
|
235
235
|
const formRef = ref(null);
|
236
236
|
const loading = ref(false);
|
237
237
|
|
238
|
-
/**
|
239
|
-
* 提交表单
|
240
|
-
*/
|
241
|
-
const handleFormSubmit = async () => {
|
242
|
-
if (!formRef.value) return;
|
243
|
-
|
244
|
-
const validateResult = await formRef.value.validate();
|
245
|
-
if (validateResult !== true) {
|
246
|
-
return;
|
247
|
-
}
|
248
238
|
|
249
|
-
emit('submit', props.data);
|
250
|
-
|
251
|
-
if (props.apiConfig) {
|
252
|
-
await submitFormData();
|
253
|
-
}
|
254
|
-
};
|
255
239
|
|
256
240
|
/**
|
257
241
|
* 调用API提交表单数据
|
@@ -292,12 +276,29 @@ const submitFormData = async () => {
|
|
292
276
|
}
|
293
277
|
};
|
294
278
|
|
279
|
+
/**
|
280
|
+
* 提交表单
|
281
|
+
*/
|
282
|
+
const handleFormSubmit = async () => {
|
283
|
+
if (!formRef.value) return;
|
284
|
+
|
285
|
+
const validateResult = await formRef.value.validate();
|
286
|
+
if (validateResult !== true) {
|
287
|
+
return;
|
288
|
+
}
|
289
|
+
|
290
|
+
emit('submit', props.data);
|
291
|
+
|
292
|
+
if (props.apiConfig) {
|
293
|
+
await submitFormData();
|
294
|
+
}
|
295
|
+
};
|
296
|
+
|
295
297
|
/**
|
296
298
|
* 表单重置
|
297
299
|
* @param {Object} context 表单上下文
|
298
300
|
*/
|
299
301
|
const handleReset = (context) => {
|
300
|
-
console.log('handleReset', context);
|
301
302
|
emit('reset', context);
|
302
303
|
};
|
303
304
|
|
@@ -314,8 +315,6 @@ const handleValidate = (result) => {
|
|
314
315
|
* 表单提交事件,由内置的HTML表单submit事件触发
|
315
316
|
*/
|
316
317
|
const handleSubmit = (context) => {
|
317
|
-
console.log('handleSubmit', context);
|
318
|
-
|
319
318
|
// 这里只做转发,实际提交逻辑在handleFormSubmit中
|
320
319
|
emit('submit', context);
|
321
320
|
};
|