|
@@ -6,6 +6,7 @@ import { queenApi } from "queenjs";
|
|
import ShareModal from "./components/ShareModal";
|
|
import ShareModal from "./components/ShareModal";
|
|
import { sendPromotion } from "./components/SendPromotion";
|
|
import { sendPromotion } from "./components/SendPromotion";
|
|
import { AuthModule } from "@queenjs-modules/auth";
|
|
import { AuthModule } from "@queenjs-modules/auth";
|
|
|
|
+import { SelectOneImage } from "../Material2/modal";
|
|
|
|
|
|
export function createPromotinController(
|
|
export function createPromotinController(
|
|
auth: AuthModule,
|
|
auth: AuthModule,
|
|
@@ -13,7 +14,6 @@ export function createPromotinController(
|
|
editor: EditorModule
|
|
editor: EditorModule
|
|
) {
|
|
) {
|
|
const ctrl = new PromotionController();
|
|
const ctrl = new PromotionController();
|
|
-
|
|
|
|
ctrl.ListCtrl = new PageListController(resource.config?.httpConfig);
|
|
ctrl.ListCtrl = new PageListController(resource.config?.httpConfig);
|
|
ctrl.ListCtrl.setCrudPrefix("/h5");
|
|
ctrl.ListCtrl.setCrudPrefix("/h5");
|
|
ctrl.createPromotion = resource.actions.createPromotion;
|
|
ctrl.createPromotion = resource.actions.createPromotion;
|
|
@@ -56,7 +56,7 @@ export function createPromotinController(
|
|
}
|
|
}
|
|
);
|
|
);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ let url = ""
|
|
ctrl.onMenuClick = async (name, record) => {
|
|
ctrl.onMenuClick = async (name, record) => {
|
|
switch (name) {
|
|
switch (name) {
|
|
case "stat":
|
|
case "stat":
|
|
@@ -82,6 +82,14 @@ export function createPromotinController(
|
|
case "unpublish":
|
|
case "unpublish":
|
|
await resource.actions.publishPromotion(record, false);
|
|
await resource.actions.publishPromotion(record, false);
|
|
break;
|
|
break;
|
|
|
|
+
|
|
|
|
+ case "thumbnail":
|
|
|
|
+ url = await SelectOneImage() as string;
|
|
|
|
+ if (!url) return;
|
|
|
|
+ await resource.https.updatePromotion({_id: record._id, thumbnail: url});
|
|
|
|
+ record.thumbnail = url;
|
|
|
|
+ queenApi.messageSuccess("替换成功");
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|