meixioacomponent 0.9.48-alpha-2 → 0.9.48
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/lib/components/dynamicmount/DynamicMountClass.js +2 -2
- package/lib/components/dynamicmount/index.d.ts.map +1 -1
- package/lib/components/dynamicmount/index.js +1 -2
- package/lib/components/index.d.ts +1 -1
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +3 -0
- package/lib/config/componentConfig.d.ts.map +1 -1
- package/lib/config/componentConfig.js +6 -8
- package/lib/config/uploadRequest.d.ts +1 -1
- package/lib/config/uploadRequest.d.ts.map +1 -1
- package/lib/config/uploadRequest.js +19 -12
- package/lib/config/use/UseGuide.js +2 -2
- package/lib/config/use/UseImg.js +2 -2
- package/lib/config/use/UseUpload.d.ts +1 -1
- package/lib/config/use/UseUpload.d.ts.map +1 -1
- package/lib/config/use/UseUpload.js +6 -4
- package/lib/meixioacomponent.common.js +178 -145
- package/lib/meixioacomponent.umd.js +178 -145
- package/lib/meixioacomponent.umd.min.js +2 -2
- package/lib/typings/type.d.ts +2 -1
- package/lib/typings/type.d.ts.map +1 -1
- package/package.json +3 -3
- package/packages/components/base/baseUpload/baseUploadItem.vue +2 -2
- package/packages/components/base/baseUpload/mixins.js +30 -18
- package/packages/components/base/upload/upload.vue +4 -1
- package/packages/components/dynamicmount/DynamicMountClass.js +2 -2
- package/packages/components/dynamicmount/DynamicMountClass.ts +2 -2
- package/packages/components/dynamicmount/dynamicMount.vue +2 -3
- package/packages/components/dynamicmount/index.js +1 -2
- package/packages/components/dynamicmount/index.ts +1 -2
- package/packages/components/index.js +3 -0
- package/packages/components/index.ts +4 -1
- package/packages/components/proPageTable/TableCheckControl.js +3 -2
- package/packages/config/componentConfig.js +6 -8
- package/packages/config/componentConfig.ts +10 -9
- package/packages/config/theme/theme.js +3 -2
- package/packages/config/uploadRequest.ts +78 -67
- package/packages/config/use/UseGuide.js +2 -2
- package/packages/config/use/UseGuide.ts +2 -2
- package/packages/config/use/UseImg.js +2 -2
- package/packages/config/use/UseImg.ts +2 -2
- package/packages/config/use/UseUpload.js +6 -4
- package/packages/config/use/UseUpload.ts +7 -4
- package/packages/config/useElement.js +5 -5
- package/packages/typings/type.ts +4 -1
- package/packages/utils/upload.js +81 -30
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
6
|
+
const componentConfig_1 = __importDefault(require("../../config/componentConfig"));
|
|
7
7
|
class DynamicMountClass {
|
|
8
8
|
constructor(dynamicMount) {
|
|
9
9
|
this.params = dynamicMount;
|
|
@@ -13,7 +13,7 @@ class DynamicMountClass {
|
|
|
13
13
|
this.destroyCb = null;
|
|
14
14
|
}
|
|
15
15
|
init() {
|
|
16
|
-
this.domComponent =
|
|
16
|
+
this.domComponent = componentConfig_1.default.Vue.prototype.$dynmaicMount({
|
|
17
17
|
mountedDom: this.params.mountedDom,
|
|
18
18
|
vueComponent: this.params.vueComponent,
|
|
19
19
|
componentProps: this.params.componentProps,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/components/dynamicmount/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/components/dynamicmount/index.ts"],"names":[],"mappings":";;;AAyDA,wBAIC"}
|
|
@@ -6,8 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
// @ts-ignore
|
|
7
7
|
const dynamicMount_vue_1 = __importDefault(require("./dynamicMount.vue"));
|
|
8
8
|
const componentConfig_1 = __importDefault(require("../../config/componentConfig"));
|
|
9
|
-
const vue_1 = __importDefault(require("vue"));
|
|
10
|
-
const ComponentInsertConstructor = vue_1.default.extend(dynamicMount_vue_1.default);
|
|
11
9
|
//使用方法
|
|
12
10
|
// this.$dynmaicMount({
|
|
13
11
|
// mountedDom: "",
|
|
@@ -15,6 +13,7 @@ const ComponentInsertConstructor = vue_1.default.extend(dynamicMount_vue_1.defau
|
|
|
15
13
|
// componentProps: "",
|
|
16
14
|
// });
|
|
17
15
|
const Insert = (options) => {
|
|
16
|
+
const ComponentInsertConstructor = componentConfig_1.default.Vue.extend(dynamicMount_vue_1.default);
|
|
18
17
|
componentConfig_1.default.setDynamicId();
|
|
19
18
|
let id = componentConfig_1.default.dynamicId;
|
|
20
19
|
const componentInsertConstructor = new ComponentInsertConstructor();
|
|
@@ -64,7 +64,7 @@ declare const meixioacomponent: {
|
|
|
64
64
|
cbList: any[];
|
|
65
65
|
dynamicMount: import("../typings/type").DynamicMountInterface | null;
|
|
66
66
|
lock: Boolean;
|
|
67
|
-
toUpload(uploadList: any, cb: any):
|
|
67
|
+
toUpload(uploadList: any, cb: any, isOss: any): boolean;
|
|
68
68
|
uploadEd(evt?: null): void;
|
|
69
69
|
appendUploadItem(list: any): void;
|
|
70
70
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/components/index.ts"],"names":[],"mappings":"AAqDA,OAAO,iBAAiB,MAAM,kCAAkC,CAAA;AAGhE,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAS5C,OAAO,aAAa,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/components/index.ts"],"names":[],"mappings":"AAqDA,OAAO,iBAAiB,MAAM,kCAAkC,CAAA;AAGhE,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAS5C,OAAO,aAAa,MAAM,yBAAyB,CAAC;AAsFpD,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoErB,CAAA;AAID,eAAe,gBAAgB,CAAA"}
|
package/lib/components/index.js
CHANGED
|
@@ -121,6 +121,7 @@ const meixicomponents = [
|
|
|
121
121
|
baseWait_1.default
|
|
122
122
|
];
|
|
123
123
|
const install = (Vue) => {
|
|
124
|
+
componentConfig_1.default.Vue = Vue;
|
|
124
125
|
meixicomponents.forEach((baseComponent) => {
|
|
125
126
|
Vue.component(baseComponent.name, baseComponent);
|
|
126
127
|
});
|
|
@@ -134,6 +135,8 @@ const install = (Vue) => {
|
|
|
134
135
|
DynamicMountClass: DynamicMountClass_1.default
|
|
135
136
|
};
|
|
136
137
|
window[`meixiComponentConfig`] = componentConfig_1.default;
|
|
138
|
+
componentConfig_1.default.createDialogCacheWrap();
|
|
139
|
+
componentConfig_1.default.eventBus = new componentConfig_1.default.Vue();
|
|
137
140
|
};
|
|
138
141
|
//
|
|
139
142
|
if (typeof window !== 'undefined' && window[`Vue`]) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentConfig.d.ts","sourceRoot":"","sources":["../../packages/config/componentConfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"componentConfig.d.ts","sourceRoot":"","sources":["../../packages/config/componentConfig.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;AAEpD,QAAA,MAAM,eAAe,EAAE,mBAoEtB,CAAA;AAED,eAAe,eAAe,CAAA"}
|
|
@@ -3,8 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const vue_1 = __importDefault(require("vue"));
|
|
7
|
-
const useElement_1 = require("./useElement");
|
|
8
6
|
const selectStore_1 = __importDefault(require("./storeModule/selectStore"));
|
|
9
7
|
const dialogCacheStore_1 = __importDefault(require("./storeModule/dialogCacheStore"));
|
|
10
8
|
// @ts-ignore
|
|
@@ -16,8 +14,9 @@ const componentConfig = {
|
|
|
16
14
|
dynamicId: 0,
|
|
17
15
|
uploadUrl: '',
|
|
18
16
|
uploadPrefix: '',
|
|
19
|
-
eventBus:
|
|
17
|
+
eventBus: null,
|
|
20
18
|
selectStore: null,
|
|
19
|
+
Vue: null,
|
|
21
20
|
LinkViewClass: LinkViewClass_1.default,
|
|
22
21
|
dialogCacheComponent: {},
|
|
23
22
|
uploadStoreList: ['meixidev'],
|
|
@@ -28,14 +27,14 @@ const componentConfig = {
|
|
|
28
27
|
componentConfig.uploadPrefix = url;
|
|
29
28
|
},
|
|
30
29
|
setUploadUrl: (storeType, uploadType) => {
|
|
31
|
-
componentConfig.uploadUrl = `${componentConfig.uploadPrefix}/${componentConfig.uploadStoreList[storeType]}/${uploadType}/upload
|
|
30
|
+
// componentConfig.uploadUrl = `${componentConfig.uploadPrefix}/${componentConfig.uploadStoreList[storeType]}/${uploadType}/upload`
|
|
31
|
+
componentConfig.uploadUrl = `${componentConfig.uploadPrefix}`;
|
|
32
32
|
},
|
|
33
33
|
setUploadCustomUrl: (url) => {
|
|
34
34
|
componentConfig.uploadUrl = url;
|
|
35
35
|
},
|
|
36
36
|
initConfig: (_store, _router) => {
|
|
37
37
|
// 注册element 组件
|
|
38
|
-
(0, useElement_1.useElementComponent)();
|
|
39
38
|
// 动态注册vuex modules
|
|
40
39
|
_store[`registerModule`]('selectStore', selectStore_1.default);
|
|
41
40
|
// 注册vuex里面selectStore管理类
|
|
@@ -45,20 +44,19 @@ const componentConfig = {
|
|
|
45
44
|
componentConfig.selectStore =
|
|
46
45
|
componentConfig.store[`getters`]['selectStore/getSelectStore'];
|
|
47
46
|
componentConfig.registerModuleOfCacheDialog(_store);
|
|
48
|
-
componentConfig.createDialogCacheWrap();
|
|
49
47
|
},
|
|
50
48
|
registerModuleOfCacheDialog: (_store) => {
|
|
51
49
|
_store[`registerModule`]('dialogCacheStore', dialogCacheStore_1.default);
|
|
52
50
|
},
|
|
53
51
|
// 生成隐藏dialog的容器
|
|
54
52
|
createDialogCacheWrap: () => {
|
|
55
|
-
const component =
|
|
53
|
+
const component = componentConfig.Vue.extend(index_vue_1.default);
|
|
56
54
|
componentConfig.dialogCacheComponent = new component({
|
|
57
55
|
// @ts-ignore
|
|
58
56
|
store: componentConfig.store,
|
|
59
57
|
router: componentConfig.router,
|
|
60
58
|
});
|
|
61
|
-
|
|
59
|
+
componentConfig.Vue.nextTick(() => {
|
|
62
60
|
const cacheWrap = document.createElement('div');
|
|
63
61
|
cacheWrap.setAttribute('class', 'cacheWrap');
|
|
64
62
|
document.body.appendChild(cacheWrap);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploadRequest.d.ts","sourceRoot":"","sources":["../../packages/config/uploadRequest.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"uploadRequest.d.ts","sourceRoot":"","sources":["../../packages/config/uploadRequest.ts"],"names":[],"mappings":";AAKA,wBAsFC"}
|
|
@@ -13,15 +13,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const axios_1 = __importDefault(require("axios"));
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const componentConfig_1 = __importDefault(require("./componentConfig"));
|
|
19
|
-
exports.default = (file, uploadProgressFn, sourceToken) => {
|
|
20
|
-
const ossInstance = (params, uploadProgressFn) => {
|
|
16
|
+
exports.default = (params, uploadProgressFn, sourceToken) => {
|
|
17
|
+
const ossInstance = (data, uploadProgressFn) => {
|
|
21
18
|
// 创建 axios 实例
|
|
22
19
|
const instance = axios_1.default.create({
|
|
23
20
|
// API 请求的默认前缀
|
|
24
|
-
baseURL: `${
|
|
21
|
+
baseURL: `${params.get('url')}`,
|
|
25
22
|
});
|
|
26
23
|
// 异常拦截处理器
|
|
27
24
|
const errorHandler = (error) => {
|
|
@@ -39,7 +36,9 @@ exports.default = (file, uploadProgressFn, sourceToken) => {
|
|
|
39
36
|
// @ts-ignore
|
|
40
37
|
config.headers['Content-Type'] = 'multipart/form-data';
|
|
41
38
|
// @ts-ignore
|
|
42
|
-
config.headers['
|
|
39
|
+
config.headers['type'] = 'application/octet-stream';
|
|
40
|
+
// @ts-ignore
|
|
41
|
+
// config.headers['authorization'] = `Bearer ${GetToken('token')}`
|
|
43
42
|
config.onUploadProgress = (progressEvent) => {
|
|
44
43
|
if (uploadProgressFn) {
|
|
45
44
|
// @ts-ignore
|
|
@@ -53,22 +52,30 @@ exports.default = (file, uploadProgressFn, sourceToken) => {
|
|
|
53
52
|
instance.interceptors.response.use((response) => __awaiter(void 0, void 0, void 0, function* () {
|
|
54
53
|
return response;
|
|
55
54
|
}), resErrorHandler);
|
|
56
|
-
return instance(
|
|
55
|
+
return instance(data);
|
|
57
56
|
};
|
|
58
57
|
return new Promise((resolve, reject) => {
|
|
59
|
-
|
|
60
|
-
params.append('file', file);
|
|
58
|
+
// await 后端接口
|
|
61
59
|
ossInstance({
|
|
62
|
-
url: '
|
|
60
|
+
url: '',
|
|
63
61
|
data: params,
|
|
64
62
|
method: 'post',
|
|
65
63
|
cancelToken: sourceToken.token,
|
|
66
64
|
}, uploadProgressFn)
|
|
67
65
|
.then((res) => {
|
|
66
|
+
console.log(res);
|
|
68
67
|
const { status } = res;
|
|
69
68
|
if (status == 200) {
|
|
70
69
|
const { data } = res;
|
|
71
|
-
|
|
70
|
+
if (data) {
|
|
71
|
+
resolve(data.data.original);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
// 返回oss的params;
|
|
75
|
+
const url = params.get('url');
|
|
76
|
+
const key = params.get('key');
|
|
77
|
+
resolve(`${url}/${key}`);
|
|
78
|
+
}
|
|
72
79
|
}
|
|
73
80
|
})
|
|
74
81
|
.catch((error) => {
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
// @ts-ignore
|
|
7
7
|
const index_vue_1 = __importDefault(require("../../components/base/baseGuide/index.vue"));
|
|
8
8
|
const DynamicMountClass_1 = __importDefault(require("../../components/dynamicmount/DynamicMountClass"));
|
|
9
|
-
const
|
|
9
|
+
const componentConfig_1 = __importDefault(require("../componentConfig"));
|
|
10
10
|
class UseGuide {
|
|
11
11
|
constructor() {
|
|
12
12
|
this.guideComponent = null;
|
|
@@ -18,7 +18,7 @@ class UseGuide {
|
|
|
18
18
|
componentProps: Object.assign({}, params),
|
|
19
19
|
});
|
|
20
20
|
this.guideComponent.on('mounted', (component) => {
|
|
21
|
-
|
|
21
|
+
componentConfig_1.default.Vue.nextTick(() => {
|
|
22
22
|
component.guideControl.onStartGuide();
|
|
23
23
|
});
|
|
24
24
|
});
|
package/lib/config/use/UseImg.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
// @ts-ignore
|
|
7
7
|
const image_viewer_vue_1 = __importDefault(require("../../components/base/baseImageViewer/image-viewer.vue"));
|
|
8
8
|
const DynamicMountClass_1 = __importDefault(require("../../components/dynamicmount/DynamicMountClass"));
|
|
9
|
-
const
|
|
9
|
+
const componentConfig_1 = __importDefault(require("../componentConfig"));
|
|
10
10
|
class UseImg {
|
|
11
11
|
constructor() {
|
|
12
12
|
this.dynamicMount = null;
|
|
@@ -15,7 +15,7 @@ class UseImg {
|
|
|
15
15
|
if (this.dynamicMount) {
|
|
16
16
|
this.destroy();
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
componentConfig_1.default.Vue.nextTick(() => {
|
|
19
19
|
this.dynamicMount = new DynamicMountClass_1.default({
|
|
20
20
|
componentProps: {
|
|
21
21
|
urlList: list,
|
|
@@ -4,7 +4,7 @@ declare class UseUpload implements UseUploadInterFace {
|
|
|
4
4
|
dynamicMount: DynamicMountInterface | null;
|
|
5
5
|
lock: Boolean;
|
|
6
6
|
constructor();
|
|
7
|
-
toUpload(uploadList: any, cb: any):
|
|
7
|
+
toUpload(uploadList: any, cb: any, isOss: any): boolean;
|
|
8
8
|
uploadEd(evt?: null): void;
|
|
9
9
|
appendUploadItem(list: any): void;
|
|
10
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UseUpload.d.ts","sourceRoot":"","sources":["../../../packages/config/use/UseUpload.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,qBAAqB,EAAE,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AAG7E,cAAM,SAAU,YAAW,kBAAkB;IACzC,MAAM,EAAE,GAAG,EAAE,CAAC;IACd,YAAY,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAC3C,IAAI,EAAE,OAAO,CAAC;;IAQd,QAAQ,CAAC,UAAU,KAAA,EAAE,EAAE,KAAA;
|
|
1
|
+
{"version":3,"file":"UseUpload.d.ts","sourceRoot":"","sources":["../../../packages/config/use/UseUpload.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,qBAAqB,EAAE,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AAG7E,cAAM,SAAU,YAAW,kBAAkB;IACzC,MAAM,EAAE,GAAG,EAAE,CAAC;IACd,YAAY,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAC3C,IAAI,EAAE,OAAO,CAAC;;IAQd,QAAQ,CAAC,UAAU,KAAA,EAAE,EAAE,KAAA,EAAE,KAAK,KAAA;IA8B9B,QAAQ,CAAC,GAAG,OAAO;IAmBnB,gBAAgB,CAAC,IAAI,KAAA;CAYxB;AAED,QAAA,IAAI,SAAS,WAAkB,CAAA;AAE/B,eAAe,SAAS,CAAA"}
|
|
@@ -6,18 +6,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
// @ts-ignore
|
|
7
7
|
const upload_vue_1 = __importDefault(require("../../components/base/upload/upload.vue"));
|
|
8
8
|
const DynamicMountClass_1 = __importDefault(require("../../components/dynamicmount/DynamicMountClass"));
|
|
9
|
-
const
|
|
9
|
+
const componentConfig_1 = __importDefault(require("../componentConfig"));
|
|
10
10
|
class UseUpload {
|
|
11
11
|
constructor() {
|
|
12
12
|
this.cbList = [];
|
|
13
13
|
this.dynamicMount = null;
|
|
14
14
|
this.lock = false;
|
|
15
15
|
}
|
|
16
|
-
toUpload(uploadList, cb) {
|
|
16
|
+
toUpload(uploadList, cb, isOss) {
|
|
17
17
|
// componentConfig.setUploadUrl(0, 1);
|
|
18
18
|
if (this.lock) {
|
|
19
|
-
|
|
20
|
-
return;
|
|
19
|
+
componentConfig_1.default.Vue.prototype.$message.error('请等待上传完成后,再上传');
|
|
20
|
+
return false;
|
|
21
21
|
}
|
|
22
22
|
if (cb) {
|
|
23
23
|
this.cbList.push({ cb, uploadList });
|
|
@@ -31,12 +31,14 @@ class UseUpload {
|
|
|
31
31
|
uploadEdEvent: (evt) => {
|
|
32
32
|
this.uploadEd(evt);
|
|
33
33
|
},
|
|
34
|
+
isOss: isOss,
|
|
34
35
|
toUploadList: uploadList,
|
|
35
36
|
},
|
|
36
37
|
vueComponent: upload_vue_1.default,
|
|
37
38
|
});
|
|
38
39
|
this.dynamicMount.init();
|
|
39
40
|
}
|
|
41
|
+
return true;
|
|
40
42
|
}
|
|
41
43
|
uploadEd(evt = null) {
|
|
42
44
|
this.lock = true;
|