|
@@ -32,40 +32,49 @@ export const helper = ResourceModule.helper({
|
|
|
return ctrl;
|
|
|
},
|
|
|
|
|
|
- createSourceController() {
|
|
|
- const { controls, actions } = this;
|
|
|
+ // createSourceController() {
|
|
|
+ // const { controls, actions } = this;
|
|
|
|
|
|
- const ctrl = new MaterialController();
|
|
|
- ctrl.imageCtrl = controls.materialImageListCtrl;
|
|
|
- ctrl.vidoeCtrl = controls.materialVideoListCtrl;
|
|
|
- ctrl.taskCtrl = controls.renderTaskListCtrl;
|
|
|
- ctrl.tplCtrl = controls.matTempListCtrl;
|
|
|
+ // const ctrl = new MaterialController();
|
|
|
+ // ctrl.imageCtrl = controls.materialImageListCtrl;
|
|
|
+ // ctrl.vidoeCtrl = controls.materialVideoListCtrl;
|
|
|
+ // ctrl.taskCtrl = controls.renderTaskListCtrl;
|
|
|
+ // ctrl.tplCtrl = controls.matTempListCtrl;
|
|
|
|
|
|
- ctrl.onBtnClick = async function (name: string) {
|
|
|
- if (name == "upload") {
|
|
|
- const uploaded = await actions.uploadMaterial();
|
|
|
- ctrl.switchTab(uploaded.fileType, false);
|
|
|
- ctrl.getCurrControl().loadPage(1);
|
|
|
- return;
|
|
|
- }
|
|
|
- ctrl.showDialog(name);
|
|
|
- };
|
|
|
- ctrl.onItemClick = function (name, record) {
|
|
|
- if (name == "delete") return actions.deleteMaterial(record);
|
|
|
- return actions.downloadMaterial(record);
|
|
|
- };
|
|
|
- return ctrl;
|
|
|
- },
|
|
|
+ // ctrl.onBtnClick = async function (name: string) {
|
|
|
+ // if (name == "upload") {
|
|
|
+ // const uploaded = await actions.uploadMaterial();
|
|
|
+ // ctrl.switchTab(uploaded.fileType, false);
|
|
|
+ // ctrl.getCurrControl().loadPage(1);
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // ctrl.showDialog(name);
|
|
|
+ // };
|
|
|
+ // ctrl.onItemClick = function (name, record) {
|
|
|
+ // if (name == "delete") return actions.deleteMaterial(record);
|
|
|
+ // return actions.downloadMaterial(record);
|
|
|
+ // };
|
|
|
+ // return ctrl;
|
|
|
+ // },
|
|
|
|
|
|
- async uploadResource(accept = "image/*") {
|
|
|
- const [blob] = await queenApi.selectFile({ accept });
|
|
|
- const data = await this.controls.uploader.uploadFile(blob, "queenshow");
|
|
|
+ async uploadResource(opts?: { accept?: string; multiple?: boolean }) {
|
|
|
+ const result = [];
|
|
|
+ const blobs = await queenApi.selectFile(opts);
|
|
|
|
|
|
- const souceObj = {
|
|
|
- file: data,
|
|
|
- fileType: blob.type.split("/")[0],
|
|
|
- from: "upload",
|
|
|
- };
|
|
|
- return souceObj;
|
|
|
+ queenApi.showLoading("上传中……");
|
|
|
+
|
|
|
+ for (const key in blobs) {
|
|
|
+ const blob = blobs[key];
|
|
|
+ const file = await this.controls.uploader.uploadFile(blob, "queenshow");
|
|
|
+ const souceObj = {
|
|
|
+ file,
|
|
|
+ fileType: blob.type.split("/")[0],
|
|
|
+ from: "upload",
|
|
|
+ };
|
|
|
+ result.push(souceObj);
|
|
|
+ }
|
|
|
+
|
|
|
+ queenApi.hideLoading();
|
|
|
+ return result;
|
|
|
},
|
|
|
});
|