@ebiz/designer-components 0.0.18-beta.6 → 0.0.18-beta.8
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 +1 -1
- package/src/apiService/mockDataService.js +116 -0
- package/src/apiService/simpleDataService.js +1 -1
- package/src/apiService/simpleDataServiceAppData.js +278 -0
- package/src/components/Button.vue +2 -2
- package/src/components/EbizRemoteSelect.vue +98 -41
- package/src/components/EbizTabHeader.vue +2 -2
- package/src/components/TdesignCalendar/index.vue +6 -3
- package/src/components/TdesignDialog.vue +249 -0
- package/src/components/TdesignUpload.vue +68 -99
- package/src/index.js +61 -56
- package/src/main.js +5 -3
- package/src/router/index.js +6 -0
- package/src/views/DialogDemo.vue +126 -0
- package/src/views/Home.vue +2 -1
- package/src/views/RemoteSelect.vue +336 -5
@@ -1,47 +1,16 @@
|
|
1
1
|
<template>
|
2
|
-
<t-upload
|
3
|
-
:
|
4
|
-
:
|
5
|
-
:
|
6
|
-
:
|
7
|
-
:beforeUpload="handleBeforeUpload"
|
8
|
-
:data="data"
|
9
|
-
:disabled="disabled"
|
10
|
-
:draggable="draggable"
|
11
|
-
:fileListDisplay="fileListDisplay"
|
12
|
-
:files="internalFiles"
|
13
|
-
:format="format"
|
14
|
-
:formatRequest="formatRequest"
|
15
|
-
:headers="headers"
|
16
|
-
:isBatchUpload="isBatchUpload"
|
17
|
-
:max="max"
|
18
|
-
:method="method"
|
19
|
-
:multiple="multiple"
|
20
|
-
:name="name"
|
21
|
-
:placeholder="placeholder"
|
2
|
+
<t-upload :accept="accept" :action="internalAction" :allowUploadDuplicateFile="allowUploadDuplicateFile"
|
3
|
+
:autoUpload="autoUpload" :beforeUpload="handleBeforeUpload" :data="data" :disabled="disabled"
|
4
|
+
:draggable="draggable" :fileListDisplay="fileListDisplay" :files="internalFiles" :format="format"
|
5
|
+
:formatRequest="formatRequest" :headers="headers" :isBatchUpload="isBatchUpload" :max="max" :method="method"
|
6
|
+
:multiple="multiple" :name="name" :placeholder="placeholder"
|
22
7
|
:requestMethod="useInternalUpload ? customRequestMethod : requestMethod"
|
23
|
-
:showUploadProgress="showUploadProgress"
|
24
|
-
:
|
25
|
-
:
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
:uploadButton="uploadButton"
|
30
|
-
:useMockProgress="useMockProgress"
|
31
|
-
:withCredentials="withCredentials"
|
32
|
-
v-model="modelValue"
|
33
|
-
@change="handleChange"
|
34
|
-
@click="handleClick"
|
35
|
-
@drag="handleDrag"
|
36
|
-
@drop="handleDrop"
|
37
|
-
@fail="handleFail"
|
38
|
-
@preview="handlePreview"
|
39
|
-
@progress="handleProgress"
|
40
|
-
@remove="handleRemove"
|
41
|
-
@select-change="handleSelectChange"
|
42
|
-
@success="handleSuccess"
|
43
|
-
@validate="handleValidate"
|
44
|
-
>
|
8
|
+
:showUploadProgress="showUploadProgress" :sizeLimit="sizeLimit" :status="status" :theme="theme" :tips="tips"
|
9
|
+
:uploadAllFilesInOneRequest="uploadAllFilesInOneRequest" :uploadButton="uploadButton"
|
10
|
+
:useMockProgress="useMockProgress" :withCredentials="withCredentials" v-model="modelValue"
|
11
|
+
@change="handleChange" @click="handleClick" @drag="handleDrag" @drop="handleDrop" @fail="handleFail"
|
12
|
+
@preview="handlePreview" @progress="handleProgress" @remove="handleRemove" @select-change="handleSelectChange"
|
13
|
+
@success="handleSuccess" @validate="handleValidate">
|
45
14
|
<!-- 默认插槽 -->
|
46
15
|
<slot></slot>
|
47
16
|
|
@@ -86,7 +55,7 @@ export default {
|
|
86
55
|
<script setup>
|
87
56
|
import { computed, defineProps, defineEmits, ref, onMounted, watch } from 'vue';
|
88
57
|
import { Upload as TUpload } from 'tdesign-vue-next';
|
89
|
-
import
|
58
|
+
import dataServiceAppData from '../apiService/simpleDataServiceAppData';
|
90
59
|
|
91
60
|
// 内部上传地址常量
|
92
61
|
const INTERNAL_UPLOAD_URL = '/file/upload';
|
@@ -105,34 +74,34 @@ const initializeFiles = () => {
|
|
105
74
|
// 默认的格式化响应函数
|
106
75
|
const defaultFormatResponse = (res) => {
|
107
76
|
console.log('Default formatResponse handling:', res);
|
108
|
-
|
77
|
+
|
109
78
|
// 处理不同的响应格式
|
110
79
|
if (res === null || res === undefined) {
|
111
80
|
return { url: '', error: '上传失败:未收到服务器响应' };
|
112
81
|
}
|
113
|
-
|
82
|
+
|
114
83
|
// 如果res已经是字符串(文件路径),直接使用
|
115
84
|
if (typeof res === 'string') {
|
116
85
|
return { url: res };
|
117
86
|
}
|
118
|
-
|
87
|
+
|
119
88
|
// 如果返回的就是服务器的原始响应 { code: 0, msg: '上传成功', data: '文件路径' }
|
120
89
|
// axios拦截器应该已经提取了data部分,但我们做个双重检查
|
121
90
|
if (res.code === 0 && res.data) {
|
122
91
|
return { url: typeof res.data === 'string' ? res.data : '' };
|
123
92
|
}
|
124
|
-
|
93
|
+
|
125
94
|
// 如果是自定义对象,可能已经处理过
|
126
95
|
if (res.url) {
|
127
96
|
return { url: res.url };
|
128
97
|
}
|
129
|
-
|
98
|
+
|
130
99
|
// 直接处理服务器响应的标准格式
|
131
100
|
if (typeof res === 'string') {
|
132
101
|
// 直接是文件路径字符串
|
133
102
|
return { url: res };
|
134
103
|
}
|
135
|
-
|
104
|
+
|
136
105
|
// 如果服务器直接响应了数据,没有包装
|
137
106
|
if (res && !res.code && !res.data && typeof res === 'object') {
|
138
107
|
// 尝试找到可能的URL字段
|
@@ -140,10 +109,10 @@ const defaultFormatResponse = (res) => {
|
|
140
109
|
return { url: res.url || res.path || res.filePath || res.fileUrl };
|
141
110
|
}
|
142
111
|
}
|
143
|
-
|
112
|
+
|
144
113
|
// 处理其他可能的情况
|
145
114
|
console.warn('Unknown response format:', res);
|
146
|
-
|
115
|
+
|
147
116
|
// 无法识别的格式,返回空URL
|
148
117
|
return { url: '' };
|
149
118
|
};
|
@@ -368,19 +337,19 @@ const internalAction = computed(() => {
|
|
368
337
|
// 自定义上传方法,使用dataService进行上传
|
369
338
|
const customRequestMethod = (options) => {
|
370
339
|
console.log('Upload options:', options);
|
371
|
-
|
340
|
+
|
372
341
|
try {
|
373
342
|
// 解构选项,获取需要的属性
|
374
343
|
const { raw, onProgress, onSuccess, onError, data, method, name } = options || {};
|
375
|
-
|
344
|
+
|
376
345
|
// 创建FormData
|
377
346
|
const formData = new FormData();
|
378
|
-
|
347
|
+
|
379
348
|
// 创建一个执行上传的函数
|
380
349
|
const executeUpload = (fileToUpload) => {
|
381
350
|
console.log('Uploading file:', fileToUpload.name, fileToUpload.size);
|
382
351
|
formData.append('file', fileToUpload);
|
383
|
-
|
352
|
+
|
384
353
|
// 添加额外数据
|
385
354
|
if (data) {
|
386
355
|
Object.keys(data).forEach(key => {
|
@@ -397,14 +366,14 @@ const customRequestMethod = (options) => {
|
|
397
366
|
};
|
398
367
|
|
399
368
|
// 使用dataService上传文件
|
400
|
-
return
|
369
|
+
return dataServiceAppData
|
401
370
|
.upload(INTERNAL_UPLOAD_URL, formData, safeProgressCallback)
|
402
371
|
.then(response => {
|
403
372
|
console.log('Upload response:', response);
|
404
|
-
|
373
|
+
|
405
374
|
// 在组件内部处理响应数据
|
406
375
|
let formattedResponse;
|
407
|
-
|
376
|
+
|
408
377
|
try {
|
409
378
|
// 使用内部处理逻辑,不依赖props.formatResponse
|
410
379
|
formattedResponse = defaultFormatResponse(response);
|
@@ -412,7 +381,7 @@ const customRequestMethod = (options) => {
|
|
412
381
|
console.error('Error formatting response:', error);
|
413
382
|
formattedResponse = { url: '', error: error.message };
|
414
383
|
}
|
415
|
-
|
384
|
+
|
416
385
|
// 确保格式化后的响应包含文件基本信息
|
417
386
|
const fileObject = {
|
418
387
|
...formattedResponse,
|
@@ -423,7 +392,7 @@ const customRequestMethod = (options) => {
|
|
423
392
|
raw: fileToUpload, // 保存原始文件对象
|
424
393
|
lastModified: fileToUpload.lastModified
|
425
394
|
};
|
426
|
-
|
395
|
+
|
427
396
|
// 构建TDesign期望的成功响应对象
|
428
397
|
const successResponse = {
|
429
398
|
file: fileObject, // 文件对象
|
@@ -436,9 +405,9 @@ const customRequestMethod = (options) => {
|
|
436
405
|
e: { status: 'success' }, // 事件对象
|
437
406
|
status: 'success' // 必须的状态字段,只能是success或fail
|
438
407
|
};
|
439
|
-
|
408
|
+
|
440
409
|
console.log('Final formatted response:', successResponse);
|
441
|
-
|
410
|
+
|
442
411
|
// 安全地调用成功回调
|
443
412
|
if (typeof onSuccess === 'function') {
|
444
413
|
onSuccess(successResponse);
|
@@ -447,14 +416,14 @@ const customRequestMethod = (options) => {
|
|
447
416
|
})
|
448
417
|
.catch(error => {
|
449
418
|
console.error('Upload failed:', error);
|
450
|
-
|
419
|
+
|
451
420
|
// 构建错误响应对象
|
452
421
|
const failResponse = {
|
453
422
|
error: error,
|
454
423
|
status: 'fail', // 必须的状态字段,值为fail
|
455
424
|
e: { status: 'fail' }
|
456
425
|
};
|
457
|
-
|
426
|
+
|
458
427
|
// 安全地调用错误回调
|
459
428
|
if (typeof onError === 'function') {
|
460
429
|
onError(failResponse);
|
@@ -462,20 +431,20 @@ const customRequestMethod = (options) => {
|
|
462
431
|
return Promise.reject(failResponse);
|
463
432
|
});
|
464
433
|
};
|
465
|
-
|
434
|
+
|
466
435
|
// 尝试获取真实的文件对象
|
467
436
|
// 1. 首先检查raw是否直接是File对象
|
468
437
|
if (raw instanceof File) {
|
469
438
|
console.log('Using raw as File directly');
|
470
439
|
return executeUpload(raw);
|
471
|
-
}
|
472
|
-
|
440
|
+
}
|
441
|
+
|
473
442
|
// 2. 直接从options本身获取信息创建文件
|
474
443
|
if (options && options.name && options.type && options.size) {
|
475
444
|
// 我们找到了文件信息,但没有实际内容
|
476
445
|
// 我们需要使用FileReader获取实际文件或创建一个伪文件
|
477
446
|
console.log('Creating file from options properties');
|
478
|
-
|
447
|
+
|
479
448
|
// 由于我们无法获取真实文件内容,创建一个伪文件
|
480
449
|
// 注意:这在实际上传时可能会失败,因为没有真实内容
|
481
450
|
const pseudoFileContent = new Blob([`Pseudo file content for ${options.name}`], { type: options.type });
|
@@ -483,7 +452,7 @@ const customRequestMethod = (options) => {
|
|
483
452
|
type: options.type,
|
484
453
|
lastModified: options.lastModified || Date.now()
|
485
454
|
});
|
486
|
-
|
455
|
+
|
487
456
|
// 创建一个隐藏的文件输入,让用户重新选择文件
|
488
457
|
// 这是一个备选方案
|
489
458
|
const fileInput = document.createElement('input');
|
@@ -491,11 +460,11 @@ const customRequestMethod = (options) => {
|
|
491
460
|
fileInput.style.display = 'none';
|
492
461
|
fileInput.accept = options.type;
|
493
462
|
document.body.appendChild(fileInput);
|
494
|
-
|
463
|
+
|
495
464
|
// 提示用户选择同一个文件
|
496
465
|
console.log('Please select the same file again');
|
497
466
|
alert(`上传出错:TDesign上传组件无法获取文件内容。请在出现的文件选择框中重新选择"${options.name}"文件。`);
|
498
|
-
|
467
|
+
|
499
468
|
return new Promise((resolve, reject) => {
|
500
469
|
fileInput.onchange = (e) => {
|
501
470
|
const selectedFile = e.target.files[0];
|
@@ -513,7 +482,7 @@ const customRequestMethod = (options) => {
|
|
513
482
|
reject(failResponse);
|
514
483
|
}
|
515
484
|
};
|
516
|
-
|
485
|
+
|
517
486
|
fileInput.onerror = (error) => {
|
518
487
|
document.body.removeChild(fileInput);
|
519
488
|
const failResponse = {
|
@@ -523,12 +492,12 @@ const customRequestMethod = (options) => {
|
|
523
492
|
};
|
524
493
|
reject(failResponse);
|
525
494
|
};
|
526
|
-
|
495
|
+
|
527
496
|
// 触发文件选择
|
528
497
|
fileInput.click();
|
529
498
|
});
|
530
499
|
}
|
531
|
-
|
500
|
+
|
532
501
|
console.error('Cannot find valid file information', options);
|
533
502
|
if (typeof onError === 'function') {
|
534
503
|
const failResponse = {
|
@@ -573,26 +542,26 @@ watch(
|
|
573
542
|
// 文件状态变化事件
|
574
543
|
const handleChange = (value, context) => {
|
575
544
|
console.log('Upload change event:', value, context);
|
576
|
-
|
545
|
+
|
577
546
|
// 如果是上传成功,确保文件被添加到内部列表
|
578
547
|
if (context && context.file && context.file.status === 'success') {
|
579
548
|
const successFile = context.file;
|
580
|
-
|
549
|
+
|
581
550
|
// 检查是否已存在于内部文件列表
|
582
551
|
const fileExists = internalFiles.value.some(
|
583
552
|
file => file.name === successFile.name && file.size === successFile.size
|
584
553
|
);
|
585
|
-
|
554
|
+
|
586
555
|
if (!fileExists) {
|
587
556
|
console.log('Adding successful file from change event:', successFile);
|
588
557
|
internalFiles.value = [...internalFiles.value, successFile];
|
589
|
-
|
558
|
+
|
590
559
|
// 更新v-model和files属性
|
591
560
|
emit('update:modelValue', internalFiles.value);
|
592
561
|
emit('update:files', internalFiles.value);
|
593
562
|
}
|
594
563
|
}
|
595
|
-
|
564
|
+
|
596
565
|
emit('change', value, context);
|
597
566
|
};
|
598
567
|
|
@@ -631,19 +600,19 @@ const handleRemove = (context) => {
|
|
631
600
|
if (context && context.file) {
|
632
601
|
// 从内部文件列表中移除文件
|
633
602
|
const removedFile = context.file;
|
634
|
-
|
603
|
+
|
635
604
|
// 根据name和size过滤掉要删除的文件
|
636
605
|
internalFiles.value = internalFiles.value.filter(
|
637
606
|
file => !(file.name === removedFile.name && file.size === removedFile.size)
|
638
607
|
);
|
639
|
-
|
608
|
+
|
640
609
|
// 同时更新v-model绑定的值,保持一致性
|
641
610
|
emit('update:modelValue', internalFiles.value);
|
642
|
-
|
611
|
+
|
643
612
|
// 更新files属性,支持v-model:files双向绑定
|
644
613
|
emit('update:files', internalFiles.value);
|
645
614
|
}
|
646
|
-
|
615
|
+
|
647
616
|
// 发出原始移除事件
|
648
617
|
emit('remove', context);
|
649
618
|
};
|
@@ -656,7 +625,7 @@ const handleSelectChange = (files, context) => {
|
|
656
625
|
// 上传成功事件
|
657
626
|
const handleSuccess = (context) => {
|
658
627
|
console.log('Upload success event triggered:', context);
|
659
|
-
|
628
|
+
|
660
629
|
// 将上传成功的文件添加到文件列表中
|
661
630
|
// 首先检查文件是否已经在列表中
|
662
631
|
if (context && context.file) {
|
@@ -669,24 +638,24 @@ const handleSuccess = (context) => {
|
|
669
638
|
} else if (context.response && context.response.data && typeof context.response.data === 'string') {
|
670
639
|
fileUrl = context.response.data;
|
671
640
|
}
|
672
|
-
|
641
|
+
|
673
642
|
const newFile = {
|
674
643
|
...context.file,
|
675
644
|
url: fileUrl, // 确保有URL
|
676
645
|
status: 'success', // 设置状态为成功
|
677
646
|
response: context.response // 保留响应
|
678
647
|
};
|
679
|
-
|
648
|
+
|
680
649
|
console.log('Adding file to internal files:', newFile);
|
681
650
|
|
682
651
|
// 创建新的文件列表副本,以便进行修改
|
683
652
|
const currentFiles = [...internalFiles.value];
|
684
|
-
|
653
|
+
|
685
654
|
// 检查文件是否已存在(基于name和size)
|
686
655
|
const fileExists = currentFiles.some(
|
687
656
|
file => file.name === newFile.name && file.size === newFile.size
|
688
657
|
);
|
689
|
-
|
658
|
+
|
690
659
|
// 如果文件不存在于列表中,则添加它
|
691
660
|
if (!fileExists) {
|
692
661
|
currentFiles.push(newFile);
|
@@ -701,18 +670,18 @@ const handleSuccess = (context) => {
|
|
701
670
|
return file;
|
702
671
|
});
|
703
672
|
}
|
704
|
-
|
673
|
+
|
705
674
|
console.log('Updated internal files:', internalFiles.value);
|
706
|
-
|
675
|
+
|
707
676
|
// 同时更新v-model绑定的值,保持一致性
|
708
677
|
emit('update:modelValue', internalFiles.value);
|
709
|
-
|
678
|
+
|
710
679
|
// 更新files属性,支持v-model:files双向绑定
|
711
680
|
emit('update:files', internalFiles.value);
|
712
681
|
} else {
|
713
682
|
console.warn('Missing file in success context:', context);
|
714
683
|
}
|
715
|
-
|
684
|
+
|
716
685
|
// 发出原始成功事件
|
717
686
|
emit('success', context);
|
718
687
|
};
|
@@ -728,7 +697,7 @@ const addUploadedFile = (file) => {
|
|
728
697
|
console.error('Invalid file object. File must contain at least name and url properties.');
|
729
698
|
return false;
|
730
699
|
}
|
731
|
-
|
700
|
+
|
732
701
|
// 构建完整的文件对象
|
733
702
|
const fileObject = {
|
734
703
|
name: file.name,
|
@@ -741,24 +710,24 @@ const addUploadedFile = (file) => {
|
|
741
710
|
lastModified: file.lastModified || new Date().getTime(),
|
742
711
|
...file
|
743
712
|
};
|
744
|
-
|
713
|
+
|
745
714
|
// 检查文件是否已存在
|
746
715
|
const fileExists = internalFiles.value.some(
|
747
716
|
f => f.name === fileObject.name && f.url === fileObject.url
|
748
717
|
);
|
749
|
-
|
718
|
+
|
750
719
|
if (!fileExists) {
|
751
720
|
// 更新内部文件列表
|
752
721
|
internalFiles.value = [...internalFiles.value, fileObject];
|
753
|
-
|
722
|
+
|
754
723
|
// 同时更新v-model绑定的值,保持一致性
|
755
724
|
emit('update:modelValue', internalFiles.value);
|
756
|
-
|
725
|
+
|
757
726
|
// 更新files属性,支持v-model:files双向绑定
|
758
727
|
emit('update:files', internalFiles.value);
|
759
728
|
return true;
|
760
729
|
}
|
761
|
-
|
730
|
+
|
762
731
|
return false;
|
763
732
|
};
|
764
733
|
|
@@ -786,4 +755,4 @@ watch(
|
|
786
755
|
|
787
756
|
<style lang="less" scoped>
|
788
757
|
/* 自定义样式 */
|
789
|
-
</style>
|
758
|
+
</style>
|
package/src/index.js
CHANGED
@@ -1,64 +1,66 @@
|
|
1
|
-
import MyComponent from
|
2
|
-
import MyTable from
|
3
|
-
import EbizFormContainer from
|
4
|
-
import EbizButton from
|
5
|
-
import EbizTdesignButton from
|
6
|
-
import EbizTdesignIcon from
|
7
|
-
import EbizTdesignInput from
|
8
|
-
import EbizTdesignSelect from
|
9
|
-
import EbizTdesignForm from
|
10
|
-
import EbizTdesignFormItem from
|
11
|
-
import EbizTdesignDatePicker from
|
12
|
-
import EbizTdesignCard from
|
13
|
-
import EbizTdesignImage from
|
14
|
-
import EbizTdesignImageViewer from
|
15
|
-
import EbizDataContainer from
|
16
|
-
import EbizTitle from
|
17
|
-
import EbizDivider from
|
18
|
-
import EbizStatsCard from
|
19
|
-
import EbizOkrTree from
|
20
|
-
import EbizRemoteSelect from
|
21
|
-
import EbizMindmap from
|
22
|
-
import EbizRouteBreadcrumb from
|
23
|
-
import EbizFileUpload from
|
24
|
-
import EbizTabHeader from
|
25
|
-
import TdesignCalendar from
|
26
|
-
import TdesignCollapse from
|
27
|
-
import TdesignCollapsePanel from
|
28
|
-
import EbizTag from
|
29
|
-
import EbizSwiper from
|
30
|
-
import EbizSwiperItem from
|
31
|
-
import EbizSpace from
|
32
|
-
import EbizPagination from
|
33
|
-
import EbizCheckbox from
|
34
|
-
import EbizCheckboxGroup from
|
35
|
-
import EbizRadio from
|
36
|
-
import EbizRadioGroup from
|
37
|
-
import EbizSwitch from
|
38
|
-
import EbizTextarea from
|
39
|
-
import EbizUpload from
|
40
|
-
import EbizGrid from
|
41
|
-
import EbizCol from
|
42
|
-
import EbizTabs from
|
43
|
-
import EbizTabPanel from
|
44
|
-
import EbizStatistic from
|
45
|
-
import EbizWatermark from
|
46
|
-
import EbizAvatar from
|
47
|
-
import EbizEmployeeInfo from
|
48
|
-
import EbizAlert from
|
49
|
-
import
|
1
|
+
import MyComponent from './components/MyComponent.vue'
|
2
|
+
import MyTable from './components/Table.vue'
|
3
|
+
import EbizFormContainer from './components/Form.vue'
|
4
|
+
import EbizButton from './components/Button.vue'
|
5
|
+
import EbizTdesignButton from './components/TdesignButton.vue'
|
6
|
+
import EbizTdesignIcon from './components/TdesignIcon.vue'
|
7
|
+
import EbizTdesignInput from './components/TdesignInput.vue'
|
8
|
+
import EbizTdesignSelect from './components/TdesignSelect.vue'
|
9
|
+
import EbizTdesignForm from './components/TdesignForm.vue'
|
10
|
+
import EbizTdesignFormItem from './components/TdesignFormItem.vue'
|
11
|
+
import EbizTdesignDatePicker from './components/TdesignDatePicker.vue'
|
12
|
+
import EbizTdesignCard from './components/TdesignCard.vue'
|
13
|
+
import EbizTdesignImage from './components/TdesignImage.vue'
|
14
|
+
import EbizTdesignImageViewer from './components/TdesignImageViewer.vue'
|
15
|
+
import EbizDataContainer from './components/DataContainer.vue'
|
16
|
+
import EbizTitle from './components/EbizTitle.vue'
|
17
|
+
import EbizDivider from './components/EbizDivider.vue'
|
18
|
+
import EbizStatsCard from './components/EbizStatsCard.vue'
|
19
|
+
import EbizOkrTree from './components/EbizOkrTree.vue'
|
20
|
+
import EbizRemoteSelect from './components/EbizRemoteSelect.vue'
|
21
|
+
import EbizMindmap from './components/EbizMindmap/index.vue'
|
22
|
+
import EbizRouteBreadcrumb from './components/EbizRouteBreadcrumb.vue'
|
23
|
+
import EbizFileUpload from './components/EbizFileUpload.vue'
|
24
|
+
import EbizTabHeader from './components/EbizTabHeader.vue'
|
25
|
+
import TdesignCalendar from './components/TdesignCalendar/index.vue'
|
26
|
+
import TdesignCollapse from './components/TdesignCollapse.vue'
|
27
|
+
import TdesignCollapsePanel from './components/TdesignCollapsePanel.vue'
|
28
|
+
import EbizTag from './components/TdesignTag.vue'
|
29
|
+
import EbizSwiper from './components/EbizSwiper.vue'
|
30
|
+
import EbizSwiperItem from './components/EbizSwiperItem.vue'
|
31
|
+
import EbizSpace from './components/EbizSpace.vue'
|
32
|
+
import EbizPagination from './components/EbizPagination.vue'
|
33
|
+
import EbizCheckbox from './components/EbizCheckbox.vue'
|
34
|
+
import EbizCheckboxGroup from './components/EbizCheckboxGroup.vue'
|
35
|
+
import EbizRadio from './components/EbizRadio.vue'
|
36
|
+
import EbizRadioGroup from './components/EbizRadioGroup.vue'
|
37
|
+
import EbizSwitch from './components/EbizSwitch.vue'
|
38
|
+
import EbizTextarea from './components/TdesignTextarea.vue'
|
39
|
+
import EbizUpload from './components/TdesignUpload.vue'
|
40
|
+
import EbizGrid from './components/TdesignGrid.vue'
|
41
|
+
import EbizCol from './components/TdesignCol.vue'
|
42
|
+
import EbizTabs from './components/EbizTabs.vue'
|
43
|
+
import EbizTabPanel from './components/EbizTabPanel.vue'
|
44
|
+
import EbizStatistic from './components/EbizStatistic.vue'
|
45
|
+
import EbizWatermark from './components/TdesignWatermark.vue'
|
46
|
+
import EbizAvatar from './components/EbizAvatar.vue'
|
47
|
+
import EbizEmployeeInfo from './components/EbizEmployeeInfo.vue'
|
48
|
+
import EbizAlert from './components/TdesignAlert.vue'
|
49
|
+
import EbizDialog from './components/TdesignDialog.vue'
|
50
|
+
import { MessagePlugin as EbizMessage } from 'tdesign-vue-next'
|
50
51
|
|
51
52
|
// 导入简洁数据服务
|
52
|
-
import dataService from
|
53
|
+
import dataService from './apiService/simpleDataService'
|
54
|
+
import dataServiceAppData from './apiService/simpleDataServiceAppData'
|
53
55
|
|
54
|
-
import
|
56
|
+
import 'tdesign-vue-next/es/style/index.css'
|
55
57
|
|
56
58
|
// 导入图表样式
|
57
|
-
import
|
59
|
+
import './assets/styles/charts/main.less'
|
58
60
|
|
59
61
|
// 时间轴组件
|
60
|
-
import EbizTimeline from
|
61
|
-
import {TimelineItem as EbizTimelineItem} from 'tdesign-vue-next'
|
62
|
+
import EbizTimeline from './components/TdesignTimeline.vue'
|
63
|
+
import { TimelineItem as EbizTimelineItem } from 'tdesign-vue-next'
|
62
64
|
|
63
65
|
// 导出组件
|
64
66
|
export {
|
@@ -109,6 +111,7 @@ export {
|
|
109
111
|
EbizCheckboxGroup,
|
110
112
|
// 数据服务
|
111
113
|
dataService,
|
114
|
+
dataServiceAppData,
|
112
115
|
// 新增 EbizRadio 和 EbizRadioGroup
|
113
116
|
EbizRadio,
|
114
117
|
EbizRadioGroup,
|
@@ -140,5 +143,7 @@ export {
|
|
140
143
|
// 员工信息组件
|
141
144
|
EbizEmployeeInfo,
|
142
145
|
// 提示组件
|
143
|
-
EbizAlert
|
144
|
-
|
146
|
+
EbizAlert,
|
147
|
+
// 对话框组件
|
148
|
+
EbizDialog
|
149
|
+
}
|
package/src/main.js
CHANGED
@@ -20,11 +20,12 @@ import {
|
|
20
20
|
EbizFileUpload,
|
21
21
|
EbizTabHeader,
|
22
22
|
EbizMindmap,
|
23
|
-
dataService
|
23
|
+
dataService,
|
24
|
+
dataServiceAppData
|
24
25
|
} from './index.js'
|
25
26
|
|
26
|
-
import
|
27
|
-
import
|
27
|
+
import 'tdesign-vue-next/es/style/index.css'
|
28
|
+
import './assets/styles/charts/main.less'
|
28
29
|
|
29
30
|
const app = createApp(App)
|
30
31
|
|
@@ -50,6 +51,7 @@ app.component('EbizMindmap', EbizMindmap)
|
|
50
51
|
|
51
52
|
// 注册数据服务
|
52
53
|
app.config.globalProperties.$dataService = dataService
|
54
|
+
app.config.globalProperties.$dataServiceAppData = dataServiceAppData
|
53
55
|
|
54
56
|
// 使用路由
|
55
57
|
app.use(router)
|
package/src/router/index.js
CHANGED
@@ -228,6 +228,12 @@ const routes = [
|
|
228
228
|
name: 'TdesignAlert',
|
229
229
|
component: () => import('../views/TdesignAlert.vue'),
|
230
230
|
meta: { title: 'TDesign提示组件示例' }
|
231
|
+
},
|
232
|
+
{
|
233
|
+
path: '/tdesign-dialog',
|
234
|
+
name: 'TdesignDialog',
|
235
|
+
component: () => import('../views/DialogDemo.vue'),
|
236
|
+
meta: { title: 'TDesign对话框组件示例' }
|
231
237
|
}
|
232
238
|
]
|
233
239
|
|