meixioacomponent 2.0.45 → 2.0.47

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.
Files changed (101) hide show
  1. package/lib/components/base/baseGuide/GuideControl.d.ts +44 -44
  2. package/lib/components/base/baseGuide/GuideControl.js +238 -238
  3. package/lib/components/dynamicmount/DynamicMountClass.d.ts +15 -15
  4. package/lib/components/dynamicmount/DynamicMountClass.js +65 -65
  5. package/lib/components/dynamicmount/index.d.ts +4 -4
  6. package/lib/components/dynamicmount/index.js +71 -71
  7. package/lib/components/index.d.ts +110 -110
  8. package/lib/components/index.d.ts.map +1 -1
  9. package/lib/components/index.js +242 -242
  10. package/lib/config/LinkViewClass.d.ts +56 -56
  11. package/lib/config/LinkViewClass.js +154 -154
  12. package/lib/config/ProTableLocalConfigManage/ProTableLocalConfigManage.d.ts +12 -12
  13. package/lib/config/ProTableLocalConfigManage/ProTableLocalConfigManage.js +68 -68
  14. package/lib/config/componentConfig.d.ts +3 -3
  15. package/lib/config/componentConfig.js +71 -71
  16. package/lib/config/uploadRequest.d.ts +2 -2
  17. package/lib/config/uploadRequest.js +87 -87
  18. package/lib/config/use/UseGuide.d.ts +8 -8
  19. package/lib/config/use/UseGuide.js +33 -33
  20. package/lib/config/use/UseImg.d.ts +9 -9
  21. package/lib/config/use/UseImg.js +44 -44
  22. package/lib/config/use/UseUpload.d.ts +12 -12
  23. package/lib/config/use/UseUpload.js +79 -79
  24. package/lib/config/use/UseViewVideo.d.ts +11 -11
  25. package/lib/config/use/UseViewVideo.js +41 -41
  26. package/lib/config/use/UseWait.d.ts +4 -4
  27. package/lib/config/use/UseWait.js +21 -21
  28. package/lib/config/use/WaitPlugin.d.ts +25 -25
  29. package/lib/config/use/WaitPlugin.js +106 -106
  30. package/lib/config/use/useConfirm/UseConfirm.d.ts +6 -6
  31. package/lib/config/use/useConfirm/UseConfirm.js +33 -33
  32. package/lib/config/use/useConfirm/UseNotify.d.ts +6 -6
  33. package/lib/config/use/useConfirm/UseNotify.js +18 -18
  34. package/lib/config/use/useConfirm/executeConfirm.d.ts +2 -2
  35. package/lib/config/use/useConfirm/executeConfirm.js +11 -11
  36. package/lib/config/use/useConfirm/registerConfirm.d.ts +4 -4
  37. package/lib/config/use/useConfirm/registerConfirm.js +8 -8
  38. package/lib/meixioacomponent.common.js +23005 -22961
  39. package/lib/meixioacomponent.umd.js +23123 -23079
  40. package/lib/meixioacomponent.umd.min.js +3 -3
  41. package/lib/style/tableStyle.less +5 -5
  42. package/lib/style/tdesignStyle.less +21 -21
  43. package/lib/typings/type.d.ts +405 -405
  44. package/lib/typings/type.js +2 -2
  45. package/lib/useType/useType.d.ts +27 -27
  46. package/lib/useType/useType.js +89 -89
  47. package/package.json +1 -1
  48. package/packages/components/base/baseAnchor/baseAnchor.vue +168 -168
  49. package/packages/components/base/baseAnchor/baseAnchorV2.vue +165 -165
  50. package/packages/components/base/baseArea/api.js +6 -6
  51. package/packages/components/base/baseArea/area.js +14979 -14979
  52. package/packages/components/base/baseArea/areaConfig.js +7 -7
  53. package/packages/components/base/baseArea/baseArea.vue +590 -590
  54. package/packages/components/base/baseArea/baseAreaV2.vue +144 -144
  55. package/packages/components/base/baseArea/baseAreaV21.vue +156 -156
  56. package/packages/components/base/baseArea/index.js +6 -6
  57. package/packages/components/base/baseAreaByMultiple/baseAreaByMultiple.vue +70 -70
  58. package/packages/components/base/baseAreaByMultiple/index.js +7 -7
  59. package/packages/components/base/baseButton/baseButton.vue +85 -85
  60. package/packages/components/base/baseButton/index.js +6 -6
  61. package/packages/components/base/baseInput/baseInput.vue +98 -98
  62. package/packages/components/base/baseSelect/baseSelect.vue +102 -102
  63. package/packages/components/base/baseSelect/index.js +6 -6
  64. package/packages/components/base/baseText/index.vue +4 -4
  65. package/packages/components/base/baseTimeRangePicker/baseTimeRangePicker.vue +59 -59
  66. package/packages/components/base/baseTimeRangePicker/index.js +7 -7
  67. package/packages/components/base/baseToggle/toggle.vue +59 -13
  68. package/packages/components/base/tDateRangePicker/index.js +5 -5
  69. package/packages/components/base/tDateRangePicker/tDateRangePicker.vue +95 -95
  70. package/packages/components/dynamicmount/DynamicMountClass.js +64 -64
  71. package/packages/components/dynamicmount/index.js +69 -69
  72. package/packages/components/hooks/useHookByBaseArea.js +49 -49
  73. package/packages/components/hooks/useHookByGuide.js +46 -46
  74. package/packages/components/hooks/useHookByUpload.js +130 -130
  75. package/packages/components/index.js +239 -239
  76. package/packages/components/index.ts +0 -2
  77. package/packages/components/mixins/mixinsByBaseArea.js +53 -53
  78. package/packages/components/proPageTable/oa_pro_table.vue +13 -13
  79. package/packages/components/searchHeader/searchHeader.vue +2 -2
  80. package/packages/components/style/tableStyle.less +5 -5
  81. package/packages/components/style/tdesignStyle.less +21 -21
  82. package/packages/config/LinkViewClass.js +152 -152
  83. package/packages/config/ProTableLocalConfigManage/ProTableLocalConfigManage.js +75 -75
  84. package/packages/config/ProTableLocalConfigManage/ProTableLocalConfigManage.ts +99 -99
  85. package/packages/config/componentConfig.js +68 -68
  86. package/packages/config/use/UseGuide.js +43 -43
  87. package/packages/config/use/UseImg.js +44 -44
  88. package/packages/config/use/UseUpload.js +79 -79
  89. package/packages/config/use/UseViewVideo.js +40 -40
  90. package/packages/config/use/UseWait.js +18 -18
  91. package/packages/config/use/WaitPlugin.js +106 -106
  92. package/packages/config/use/useConfirm/UseConfirm.js +31 -31
  93. package/packages/config/use/useConfirm/UseConfirm.ts +34 -34
  94. package/packages/config/use/useConfirm/UseNotify.js +16 -16
  95. package/packages/config/use/useConfirm/UseNotify.ts +18 -18
  96. package/packages/config/use/useConfirm/executeConfirm.js +8 -8
  97. package/packages/config/use/useConfirm/executeConfirm.ts +6 -6
  98. package/packages/config/use/useConfirm/registerConfirm.js +8 -8
  99. package/packages/config/use/useConfirm/registerConfirm.ts +7 -7
  100. package/packages/typings/type.js +2 -2
  101. package/packages/useType/useType.js +90 -90
@@ -1,87 +1,87 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- const axios_1 = __importDefault(require("axios"));
16
- const utils_js_1 = require("../utils/utils.js");
17
- exports.default = (params, uploadProgressFn, sourceToken, oss) => {
18
- const ossInstance = (data, uploadProgressFn) => {
19
- // 创建 axios 实例
20
- const instance = axios_1.default.create({
21
- // API 请求的默认前缀
22
- baseURL: `${params.get('url')}`,
23
- });
24
- // 异常拦截处理器
25
- const errorHandler = (error) => {
26
- return Promise.reject(error);
27
- };
28
- // 响应异常拦截处理器
29
- const resErrorHandler = (error) => {
30
- // Message.error(`网络超时,请稍后重试`);
31
- // return errorHandler(error);
32
- throw error;
33
- };
34
- // request 拦截器
35
- instance.interceptors.request.use((config) => {
36
- // @ts-ignore
37
- config.headers['Content-Type'] = 'multipart/form-data';
38
- // @ts-ignore
39
- config.headers['type'] = 'application/octet-stream';
40
- if (!oss) {
41
- // @ts-ignore
42
- config.headers['authorization'] = `Bearer ${(0, utils_js_1.GetToken)('token')}`;
43
- }
44
- config.onUploadProgress = (progressEvent) => {
45
- if (uploadProgressFn) {
46
- // @ts-ignore
47
- const percent = (progressEvent.loaded / progressEvent.total) * 100 || 0;
48
- uploadProgressFn(percent);
49
- }
50
- };
51
- return config;
52
- }, errorHandler);
53
- // response 拦截器
54
- instance.interceptors.response.use((response) => __awaiter(void 0, void 0, void 0, function* () {
55
- return response;
56
- }), resErrorHandler);
57
- return instance(data);
58
- };
59
- return new Promise((resolve, reject) => {
60
- // await 后端接口
61
- ossInstance({
62
- url: '',
63
- data: params,
64
- method: 'post',
65
- cancelToken: sourceToken.token,
66
- }, uploadProgressFn)
67
- .then((res) => {
68
- const { status } = res;
69
- if (status == 200) {
70
- const { data } = res;
71
- if (data) {
72
- resolve(data.data.original);
73
- }
74
- else {
75
- // 返回oss的params;
76
- const url = params.get('url');
77
- const key = params.get('key');
78
- resolve(`${url}/${key}`);
79
- }
80
- }
81
- })
82
- .catch((error) => {
83
- var _a;
84
- reject((_a = error.response) === null || _a === void 0 ? void 0 : _a.data.msg);
85
- });
86
- });
87
- };
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const axios_1 = __importDefault(require("axios"));
16
+ const utils_js_1 = require("../utils/utils.js");
17
+ exports.default = (params, uploadProgressFn, sourceToken, oss) => {
18
+ const ossInstance = (data, uploadProgressFn) => {
19
+ // 创建 axios 实例
20
+ const instance = axios_1.default.create({
21
+ // API 请求的默认前缀
22
+ baseURL: `${params.get('url')}`,
23
+ });
24
+ // 异常拦截处理器
25
+ const errorHandler = (error) => {
26
+ return Promise.reject(error);
27
+ };
28
+ // 响应异常拦截处理器
29
+ const resErrorHandler = (error) => {
30
+ // Message.error(`网络超时,请稍后重试`);
31
+ // return errorHandler(error);
32
+ throw error;
33
+ };
34
+ // request 拦截器
35
+ instance.interceptors.request.use((config) => {
36
+ // @ts-ignore
37
+ config.headers['Content-Type'] = 'multipart/form-data';
38
+ // @ts-ignore
39
+ config.headers['type'] = 'application/octet-stream';
40
+ if (!oss) {
41
+ // @ts-ignore
42
+ config.headers['authorization'] = `Bearer ${(0, utils_js_1.GetToken)('token')}`;
43
+ }
44
+ config.onUploadProgress = (progressEvent) => {
45
+ if (uploadProgressFn) {
46
+ // @ts-ignore
47
+ const percent = (progressEvent.loaded / progressEvent.total) * 100 || 0;
48
+ uploadProgressFn(percent);
49
+ }
50
+ };
51
+ return config;
52
+ }, errorHandler);
53
+ // response 拦截器
54
+ instance.interceptors.response.use((response) => __awaiter(void 0, void 0, void 0, function* () {
55
+ return response;
56
+ }), resErrorHandler);
57
+ return instance(data);
58
+ };
59
+ return new Promise((resolve, reject) => {
60
+ // await 后端接口
61
+ ossInstance({
62
+ url: '',
63
+ data: params,
64
+ method: 'post',
65
+ cancelToken: sourceToken.token,
66
+ }, uploadProgressFn)
67
+ .then((res) => {
68
+ const { status } = res;
69
+ if (status == 200) {
70
+ const { data } = res;
71
+ if (data) {
72
+ resolve(data.data.original);
73
+ }
74
+ else {
75
+ // 返回oss的params;
76
+ const url = params.get('url');
77
+ const key = params.get('key');
78
+ resolve(`${url}/${key}`);
79
+ }
80
+ }
81
+ })
82
+ .catch((error) => {
83
+ var _a;
84
+ reject((_a = error.response) === null || _a === void 0 ? void 0 : _a.data.msg);
85
+ });
86
+ });
87
+ };
@@ -1,9 +1,9 @@
1
- import { DynamicMountInterface, UseGuideInterface, UseGuideParamsType } from "../../typings/type";
2
- declare class UseGuide implements UseGuideInterface {
3
- guideComponent: DynamicMountInterface | null;
4
- constructor();
5
- startGuide(params: UseGuideParamsType): void;
6
- }
7
- declare const useGuide: UseGuide;
8
- export default useGuide;
1
+ import { DynamicMountInterface, UseGuideInterface, UseGuideParamsType } from "../../typings/type";
2
+ declare class UseGuide implements UseGuideInterface {
3
+ guideComponent: DynamicMountInterface | null;
4
+ constructor();
5
+ startGuide(params: UseGuideParamsType): void;
6
+ }
7
+ declare const useGuide: UseGuide;
8
+ export default useGuide;
9
9
  //# sourceMappingURL=UseGuide.d.ts.map
@@ -1,33 +1,33 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- // @ts-ignore
7
- const index_vue_1 = __importDefault(require("../../components/base/baseGuide/index.vue"));
8
- const DynamicMountClass_1 = __importDefault(require("../../components/dynamicmount/DynamicMountClass"));
9
- const componentConfig_1 = __importDefault(require("../componentConfig"));
10
- class UseGuide {
11
- constructor() {
12
- this.guideComponent = null;
13
- }
14
- startGuide(params) {
15
- if (!this.guideComponent) {
16
- this.guideComponent = new DynamicMountClass_1.default({
17
- vueComponent: index_vue_1.default,
18
- componentProps: Object.assign({}, params),
19
- });
20
- this.guideComponent.on('mounted', (component) => {
21
- componentConfig_1.default.Vue.nextTick(() => {
22
- component.guideControl.onStartGuide();
23
- });
24
- });
25
- this.guideComponent.on('destroyed', () => {
26
- this.guideComponent = null;
27
- });
28
- this.guideComponent.init();
29
- }
30
- }
31
- }
32
- const useGuide = new UseGuide();
33
- exports.default = useGuide;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ // @ts-ignore
7
+ const index_vue_1 = __importDefault(require("../../components/base/baseGuide/index.vue"));
8
+ const DynamicMountClass_1 = __importDefault(require("../../components/dynamicmount/DynamicMountClass"));
9
+ const componentConfig_1 = __importDefault(require("../componentConfig"));
10
+ class UseGuide {
11
+ constructor() {
12
+ this.guideComponent = null;
13
+ }
14
+ startGuide(params) {
15
+ if (!this.guideComponent) {
16
+ this.guideComponent = new DynamicMountClass_1.default({
17
+ vueComponent: index_vue_1.default,
18
+ componentProps: Object.assign({}, params),
19
+ });
20
+ this.guideComponent.on('mounted', (component) => {
21
+ componentConfig_1.default.Vue.nextTick(() => {
22
+ component.guideControl.onStartGuide();
23
+ });
24
+ });
25
+ this.guideComponent.on('destroyed', () => {
26
+ this.guideComponent = null;
27
+ });
28
+ this.guideComponent.init();
29
+ }
30
+ }
31
+ }
32
+ const useGuide = new UseGuide();
33
+ exports.default = useGuide;
@@ -1,10 +1,10 @@
1
- import { DynamicMountInterface, UserImgInterface } from "../../typings/type";
2
- declare class UseImg implements UserImgInterface {
3
- dynamicMount: DynamicMountInterface | null;
4
- constructor();
5
- toView(list: any[]): void;
6
- destroy: () => void;
7
- }
8
- declare let useImg: UseImg;
9
- export default useImg;
1
+ import { DynamicMountInterface, UserImgInterface } from "../../typings/type";
2
+ declare class UseImg implements UserImgInterface {
3
+ dynamicMount: DynamicMountInterface | null;
4
+ constructor();
5
+ toView(list: any[]): void;
6
+ destroy: () => void;
7
+ }
8
+ declare let useImg: UseImg;
9
+ export default useImg;
10
10
  //# sourceMappingURL=UseImg.d.ts.map
@@ -1,44 +1,44 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- // @ts-ignore
7
- const image_viewer_vue_1 = __importDefault(require("../../components/base/baseImageViewer/image-viewer.vue"));
8
- const DynamicMountClass_1 = __importDefault(require("../../components/dynamicmount/DynamicMountClass"));
9
- const componentConfig_1 = __importDefault(require("../componentConfig"));
10
- class UseImg {
11
- constructor() {
12
- this.destroy = () => {
13
- if (this.dynamicMount) {
14
- let referComponent = this.dynamicMount.getComponent();
15
- referComponent.$destroy();
16
- this.dynamicMount = null;
17
- }
18
- };
19
- this.dynamicMount = null;
20
- }
21
- toView(list) {
22
- if (this.dynamicMount) {
23
- this.destroy();
24
- }
25
- componentConfig_1.default.Vue.nextTick(() => {
26
- componentConfig_1.default.dynamicId += 1;
27
- this.dynamicMount = new DynamicMountClass_1.default({
28
- componentProps: {
29
- value: true,
30
- urlList: list,
31
- onClose: () => {
32
- this.destroy();
33
- },
34
- zIndex: componentConfig_1.default.dynamicId
35
- },
36
- vueComponent: image_viewer_vue_1.default,
37
- });
38
- // 挂载事件
39
- this.dynamicMount.init();
40
- });
41
- }
42
- }
43
- let useImg = new UseImg();
44
- exports.default = useImg;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ // @ts-ignore
7
+ const image_viewer_vue_1 = __importDefault(require("../../components/base/baseImageViewer/image-viewer.vue"));
8
+ const DynamicMountClass_1 = __importDefault(require("../../components/dynamicmount/DynamicMountClass"));
9
+ const componentConfig_1 = __importDefault(require("../componentConfig"));
10
+ class UseImg {
11
+ constructor() {
12
+ this.destroy = () => {
13
+ if (this.dynamicMount) {
14
+ let referComponent = this.dynamicMount.getComponent();
15
+ referComponent.$destroy();
16
+ this.dynamicMount = null;
17
+ }
18
+ };
19
+ this.dynamicMount = null;
20
+ }
21
+ toView(list) {
22
+ if (this.dynamicMount) {
23
+ this.destroy();
24
+ }
25
+ componentConfig_1.default.Vue.nextTick(() => {
26
+ componentConfig_1.default.dynamicId += 1;
27
+ this.dynamicMount = new DynamicMountClass_1.default({
28
+ componentProps: {
29
+ value: true,
30
+ urlList: list,
31
+ onClose: () => {
32
+ this.destroy();
33
+ },
34
+ zIndex: componentConfig_1.default.dynamicId
35
+ },
36
+ vueComponent: image_viewer_vue_1.default,
37
+ });
38
+ // 挂载事件
39
+ this.dynamicMount.init();
40
+ });
41
+ }
42
+ }
43
+ let useImg = new UseImg();
44
+ exports.default = useImg;
@@ -1,13 +1,13 @@
1
- import { DynamicMountInterface, UseUploadInterFace } from "../../typings/type";
2
- declare class UseUpload implements UseUploadInterFace {
3
- cbList: any[];
4
- dynamicMount: DynamicMountInterface | null;
5
- lock: Boolean;
6
- constructor();
7
- toUpload(uploadList: any, cb: any, isOss: any): boolean;
8
- uploadEd(evt?: null): void;
9
- appendUploadItem(list: any): void;
10
- }
11
- declare let useUpload: UseUpload;
12
- export default useUpload;
1
+ import { DynamicMountInterface, UseUploadInterFace } from "../../typings/type";
2
+ declare class UseUpload implements UseUploadInterFace {
3
+ cbList: any[];
4
+ dynamicMount: DynamicMountInterface | null;
5
+ lock: Boolean;
6
+ constructor();
7
+ toUpload(uploadList: any, cb: any, isOss: any): boolean;
8
+ uploadEd(evt?: null): void;
9
+ appendUploadItem(list: any): void;
10
+ }
11
+ declare let useUpload: UseUpload;
12
+ export default useUpload;
13
13
  //# sourceMappingURL=UseUpload.d.ts.map
@@ -1,79 +1,79 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- // @ts-ignore
7
- const upload_vue_1 = __importDefault(require("../../components/base/upload/upload.vue"));
8
- const DynamicMountClass_1 = __importDefault(require("../../components/dynamicmount/DynamicMountClass"));
9
- const componentConfig_1 = __importDefault(require("../componentConfig"));
10
- class UseUpload {
11
- constructor() {
12
- this.cbList = [];
13
- this.dynamicMount = null;
14
- this.lock = false;
15
- }
16
- toUpload(uploadList, cb, isOss) {
17
- if (this.lock) {
18
- componentConfig_1.default.Vue.prototype.$message.error("请等待上传完成后,再上传");
19
- return false;
20
- }
21
- if (cb) {
22
- if (this.cbList.length === 0) {
23
- this.cbList.push({ cb, uploadList });
24
- }
25
- else {
26
- let index = this.cbList.findIndex((item) => {
27
- return item === cb;
28
- });
29
- if (index < 0) {
30
- this.cbList.push({ cb, uploadList });
31
- }
32
- }
33
- }
34
- if (this.dynamicMount) {
35
- this.appendUploadItem(uploadList);
36
- }
37
- else {
38
- this.dynamicMount = new DynamicMountClass_1.default({
39
- componentProps: {
40
- uploadEdEvent: (evt) => {
41
- console.log('evt', evt);
42
- this.uploadEd(evt);
43
- },
44
- isOss: isOss,
45
- toUploadList: uploadList,
46
- },
47
- vueComponent: upload_vue_1.default,
48
- });
49
- this.dynamicMount.init();
50
- }
51
- return true;
52
- }
53
- uploadEd(evt = null) {
54
- console.log('useUpload', evt);
55
- this.lock = true;
56
- this.cbList.forEach((item) => {
57
- item.cb(evt ? evt : item.uploadList);
58
- });
59
- if (this.dynamicMount) {
60
- let component = this.dynamicMount.getComponent();
61
- // @ts-ignore
62
- component.$destroy();
63
- this.dynamicMount = null;
64
- this.cbList = [];
65
- this.lock = false;
66
- }
67
- }
68
- appendUploadItem(list) {
69
- if (this.dynamicMount) {
70
- let refComponent = this.dynamicMount.getComponent();
71
- if (refComponent) {
72
- // @ts-ignore
73
- refComponent.appendUploadItem(list);
74
- }
75
- }
76
- }
77
- }
78
- let useUpload = new UseUpload();
79
- exports.default = useUpload;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ // @ts-ignore
7
+ const upload_vue_1 = __importDefault(require("../../components/base/upload/upload.vue"));
8
+ const DynamicMountClass_1 = __importDefault(require("../../components/dynamicmount/DynamicMountClass"));
9
+ const componentConfig_1 = __importDefault(require("../componentConfig"));
10
+ class UseUpload {
11
+ constructor() {
12
+ this.cbList = [];
13
+ this.dynamicMount = null;
14
+ this.lock = false;
15
+ }
16
+ toUpload(uploadList, cb, isOss) {
17
+ if (this.lock) {
18
+ componentConfig_1.default.Vue.prototype.$message.error("请等待上传完成后,再上传");
19
+ return false;
20
+ }
21
+ if (cb) {
22
+ if (this.cbList.length === 0) {
23
+ this.cbList.push({ cb, uploadList });
24
+ }
25
+ else {
26
+ let index = this.cbList.findIndex((item) => {
27
+ return item === cb;
28
+ });
29
+ if (index < 0) {
30
+ this.cbList.push({ cb, uploadList });
31
+ }
32
+ }
33
+ }
34
+ if (this.dynamicMount) {
35
+ this.appendUploadItem(uploadList);
36
+ }
37
+ else {
38
+ this.dynamicMount = new DynamicMountClass_1.default({
39
+ componentProps: {
40
+ uploadEdEvent: (evt) => {
41
+ console.log('evt', evt);
42
+ this.uploadEd(evt);
43
+ },
44
+ isOss: isOss,
45
+ toUploadList: uploadList,
46
+ },
47
+ vueComponent: upload_vue_1.default,
48
+ });
49
+ this.dynamicMount.init();
50
+ }
51
+ return true;
52
+ }
53
+ uploadEd(evt = null) {
54
+ console.log('useUpload', evt);
55
+ this.lock = true;
56
+ this.cbList.forEach((item) => {
57
+ item.cb(evt ? evt : item.uploadList);
58
+ });
59
+ if (this.dynamicMount) {
60
+ let component = this.dynamicMount.getComponent();
61
+ // @ts-ignore
62
+ component.$destroy();
63
+ this.dynamicMount = null;
64
+ this.cbList = [];
65
+ this.lock = false;
66
+ }
67
+ }
68
+ appendUploadItem(list) {
69
+ if (this.dynamicMount) {
70
+ let refComponent = this.dynamicMount.getComponent();
71
+ if (refComponent) {
72
+ // @ts-ignore
73
+ refComponent.appendUploadItem(list);
74
+ }
75
+ }
76
+ }
77
+ }
78
+ let useUpload = new UseUpload();
79
+ exports.default = useUpload;
@@ -1,12 +1,12 @@
1
- import { DynamicMountInterface, UseViewVideoInterface } from "../../typings/type";
2
- declare class UseViewVideo implements UseViewVideoInterface {
3
- component: null | DynamicMountInterface;
4
- constructor();
5
- playVideo(resource: string): void;
6
- switchVideoResource(): void;
7
- createVideoComponent(resource: any): void;
8
- unMountedVideo(): void;
9
- }
10
- declare const useViewVideo: UseViewVideo;
11
- export default useViewVideo;
1
+ import { DynamicMountInterface, UseViewVideoInterface } from "../../typings/type";
2
+ declare class UseViewVideo implements UseViewVideoInterface {
3
+ component: null | DynamicMountInterface;
4
+ constructor();
5
+ playVideo(resource: string): void;
6
+ switchVideoResource(): void;
7
+ createVideoComponent(resource: any): void;
8
+ unMountedVideo(): void;
9
+ }
10
+ declare const useViewVideo: UseViewVideo;
11
+ export default useViewVideo;
12
12
  //# sourceMappingURL=UseViewVideo.d.ts.map